Commit 3faaeeed authored by Fabien Morin's avatar Fabien Morin

Add base_application_list and base_contribution_list fields on...

Add base_application_list and base_contribution_list fields on PaySheetModelLine_view and remove base_amount on PaySheetModelLine and Payroll services

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25118 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 167af084
......@@ -83,9 +83,8 @@ object_list = []\n
total_price = 0\n
\n
# FIXME: this report does not support multiple Payment Condition\n
# FIXME: parent_base_amount will be updated to use base_contribution someday\n
for inventory in portal.portal_simulation.getInventoryList(\n
parent_base_amount_uid=net_salary_base_amount_uid,\n
parent_base_contribution_uid=net_salary_base_amount_uid,\n
tax_category_uid=employee_share_uid,\n
portal_type=(\'Pay Sheet Line\', \'Pay Sheet Cell\'),\n
section_uid=section_uid,\n
......
......@@ -81,9 +81,7 @@
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>my_base_amount_list</string>
</list>
<list/>
</value>
</item>
<item>
......@@ -103,6 +101,7 @@
<value>
<list>
<string>my_variation_category_list</string>
<string>my_base_contribution_list</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_base_contribution_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_base_contribution_list</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Tax_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -117,6 +117,8 @@
<list>
<string>my_base_amount_list</string>
<string>my_variation_category_list</string>
<string>my_base_contribution_list</string>
<string>my_base_application_list</string>
<string>my_editable</string>
</list>
</value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_base_application_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_base_application_list</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Tax_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_base_contribution_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_base_contribution_list</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Tax_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -79,7 +79,7 @@ else:\n
if base_amount_dict:\n
# get the application amount for this cell\n
model_line = cell.getParentValue()\n
for base in model_line.getBaseAmountList(base=1):\n
for base in model_line.getBaseApplicationList():\n
if base_amount_dict.has_key(base):\n
base_application += base_amount_dict[base][tax_category]\n
\n
......
......@@ -53,25 +53,18 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
\'\'\'\n
<value> <string>\'\'\'\n
return the amount composed by all amount of paysheet line wich category of\n
category_list parameter is in variation_category_list of the PaySheet line \n
and wich payroll service has a base_participation in the \n
base_participation_list\n
\n
XXX this script needs refactoring, no need to get the base amount on the resource.\n
It is now stored on the movement: see http://svn.erp5.org/?view=rev&revision=21660\n
\n
and wich has a base_contribution in the base_contribution_list\n
\'\'\'\n
\n
# test the list parameters\n
if base_participation_list is None:\n
base_participation_list = []\n
elif not (same_type(base_participation_list, []) or\n
same_type(base_participation_list, ())):\n
base_participation_list = [base_participation_list]\n
if base_contribution_list is None:\n
base_contribution_list = []\n
elif not (same_type(base_contribution_list, []) or\n
same_type(base_contribution_list, ())):\n
base_contribution_list = [base_contribution_list]\n
\n
if category_list is None:\n
category_list = []\n
......@@ -86,9 +79,8 @@ paysheet = context\n
amount = 0\n
\n
for pay_sheet_line in paysheet.contentValues(portal_type=\'Pay Sheet Line\'):\n
for base_participation in base_participation_list:\n
base_amount_list = pay_sheet_line.getResourceValue().getBaseAmountList()\n
if base_participation in base_amount_list:\n
for base_contribution in base_contribution_list:\n
if base_contribution in pay_sheet_line.getBaseContributionList():\n
if pay_sheet_line.getSalaryRangeList(base=1) != []:\n
for slice in pay_sheet_line.getSalaryRangeList(base=1):\n
for category in category_list:\n
......@@ -108,13 +100,11 @@ for pay_sheet_line in paysheet.contentValues(portal_type=\'Pay Sheet Line\'):\n
amount += total_price\n
\n
break # this permit to add only one time the amount even \n
# if many base_amount are in base_participation_list\n
# if many base_amount are in base_contribution_list\n
\n
amount = round(amount, precision)\n
return amount\n
]]></string> </value>
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -124,7 +114,7 @@ return amount\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>base_participation_list=None, category_list=None</string> </value>
<value> <string>base_contribution_list=None, category_list=None</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -150,7 +140,7 @@ return amount\n
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>base_participation_list</string>
<string>base_contribution_list</string>
<string>category_list</string>
<string>None</string>
<string>same_type</string>
......@@ -161,8 +151,7 @@ return amount\n
<string>amount</string>
<string>_getiter_</string>
<string>pay_sheet_line</string>
<string>base_participation</string>
<string>base_amount_list</string>
<string>base_contribution</string>
<string>slice</string>
<string>category</string>
<string>cell</string>
......
......@@ -85,7 +85,7 @@ id = 0\n
context.log(model_line_list)\n
for model_line in model_line_list:\n
base_category_list = model_line.getVariationBaseCategoryList()\n
base_application_list = model_line.getBaseAmountTitleList()\n
base_application_list = model_line.getBaseApplicationTitleList()\n
translated_base_application_list = [str(translateString(x)) for x in base_application_list]\n
base_application_list = \', \'.join(translated_base_application_list)\n
list_of_list = []\n
......@@ -119,11 +119,11 @@ for model_line in model_line_list:\n
base = quantity\n
\n
base_list = [str(translateString(base_application)) for base_application in \\\n
model_line.getBaseAmountTitleList()]\n
model_line.getBaseApplicationTitleList()]\n
base_name = \'+\'.join(base_list)\n
\n
payroll_service = model_line.getResourceValue()\n
base_participation_list = payroll_service.getBaseAmountList()\n
base_contribution_list = model_line.getBaseContributionList()\n
\n
price = cell.getPrice()\n
if price is None:\n
......@@ -162,7 +162,7 @@ for model_line in model_line_list:\n
\'base_name\':base_name,\n
\'base\':base,\n
\'model_line\': model_line.getRelativeUrl(),\n
\'base_participation_list\':base_participation_list,\n
\'base_contribution_list\':base_contribution_list,\n
\'base_application_list\': base_application_list,\n
\'service_id\':payroll_service.getId()}\n
object_dict[salary_range].update(share_dict)\n
......@@ -297,7 +297,7 @@ return line_list\n
<string>base_list</string>
<string>base_name</string>
<string>payroll_service</string>
<string>base_participation_list</string>
<string>base_contribution_list</string>
<string>price</string>
<string>_write_</string>
<string>tuple_dict</string>
......
......@@ -69,7 +69,7 @@ def addProperties(line, line_dict, property_list):\n
\n
line_dict_list = []\n
property_list = [ \'slice\',\n
\'base_participation_list\',\n
\'base_contribution_list\',\n
\'base_application_list\',\n
\'base_name\',\n
\'base\',\n
......
......@@ -55,7 +55,7 @@
<key> <string>_body</string> </key>
<value> <string>\'\'\'\n
This script return a Pay Sheet Line list with some new parameters on\n
each Pay Sheet Line (like base, base_name, base_participation_list,\n
each Pay Sheet Line (like base, base_name, base_contribution_list,\n
payroll_service,...)\n
It\'s used in the PaySheetTransaction_view to display PaySheetLines\n
\'\'\'\n
......@@ -77,18 +77,18 @@ line_list = []\n
\n
for paysheet_line in paysheet_line_list:\n
base_category_list = paysheet_line.getVariationBaseCategoryList()\n
base_application_list = paysheet_line.getBaseAmountTitleList()\n
base_application_list = paysheet_line.getBaseApplicationTitleList()\n
translated_base_application_list = [str(translateString(x)) for x in base_application_list]\n
base_application_list = \', \'.join(translated_base_application_list)\n
payroll_service = paysheet_line.getResourceValue(portal_type=\'Payroll Service\')\n
if payroll_service is not None:\n
base_participation_list = payroll_service.getBaseAmountList()\n
base_contribution_list = paysheet_line.getBaseContributionList()\n
else:\n
base_participation_list = []\n
base_contribution_list = []\n
causality = paysheet_line.getCausality()\n
\n
base_list = [str(translateString(base_application)) for base_application in \\\n
paysheet_line.getBaseAmountTitleList()]\n
paysheet_line.getBaseApplicationTitleList()]\n
base_name = \'+\'.join(base_list)\n
\n
list_of_list = []\n
......@@ -141,7 +141,7 @@ for paysheet_line in paysheet_line_list:\n
\'slice\':slice_title,\n
\'base_name\':base_name,\n
\'base\':base,\n
\'base_participation_list\':base_participation_list,\n
\'base_contribution_list\':base_contribution_list,\n
\'base_application_list\': base_application_list,\n
\'payroll_service\':payroll_service.getId(),\n
\'causality\': causality,}\n
......@@ -250,7 +250,7 @@ return line_list\n
<string>translated_base_application_list</string>
<string>payroll_service</string>
<string>None</string>
<string>base_participation_list</string>
<string>base_contribution_list</string>
<string>causality</string>
<string>base_application</string>
<string>base_list</string>
......
......@@ -91,7 +91,6 @@
<string>my_price_currency</string>
<string>my_price</string>
<string>my_quantity</string>
<string>my_base_amount_list</string>
<string>my_resource_title</string>
<string>my_variation_category_list</string>
<string>my_specialise_title</string>
......
......@@ -97,7 +97,7 @@
<string>listbox_model_line</string>
<string>listbox_slice_path</string>
<string>listbox_base_application_string</string>
<string>listbox_base_participation_string</string>
<string>listbox_base_contribution_string</string>
<string>listbox_service_id</string>
<string>listbox_quantity</string>
<string>listbox_price</string>
......
......@@ -152,8 +152,8 @@
<string>Tax Category</string>
</tuple>
<tuple>
<string>base_participation_string</string>
<string>Base Participation</string>
<string>base_contribution_string</string>
<string>Base Contribution</string>
</tuple>
<tuple>
<string>base_application_string</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="StringField" module="Products.Formulator.StandardFields"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_base_contribution_string</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>Too much input was given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Base Contribution</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -84,7 +84,6 @@
<string>my_title</string>
<string>my_quantity_unit</string>
<string>my_product_line</string>
<string>my_base_amount_list</string>
</list>
</value>
</item>
......
......@@ -81,7 +81,6 @@
<list>
<string>my_quantity_unit</string>
<string>my_product_line</string>
<string>my_base_amount_list</string>
</list>
</value>
</item>
......
2009-01-15 fabien
* update bt format
* change the related key because of the changes of uses of base_amount
* Add base_application_list and base_contribution_list fields on PaySheetModelLine_view and remove base_amount on PaySheetModelLine and Payroll services
2008-09-16 Kazuhiko
* revise pay_sheet_transaction_builder using new API.
......
330
\ No newline at end of file
332
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment