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 ...@@ -83,9 +83,8 @@ object_list = []\n
total_price = 0\n total_price = 0\n
\n \n
# FIXME: this report does not support multiple Payment Condition\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 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 tax_category_uid=employee_share_uid,\n
portal_type=(\'Pay Sheet Line\', \'Pay Sheet Cell\'),\n portal_type=(\'Pay Sheet Line\', \'Pay Sheet Cell\'),\n
section_uid=section_uid,\n section_uid=section_uid,\n
......
...@@ -81,9 +81,7 @@ ...@@ -81,9 +81,7 @@
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <value>
<list> <list/>
<string>my_base_amount_list</string>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -103,6 +101,7 @@ ...@@ -103,6 +101,7 @@
<value> <value>
<list> <list>
<string>my_variation_category_list</string> <string>my_variation_category_list</string>
<string>my_base_contribution_list</string>
</list> </list>
</value> </value>
</item> </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 @@ ...@@ -117,6 +117,8 @@
<list> <list>
<string>my_base_amount_list</string> <string>my_base_amount_list</string>
<string>my_variation_category_list</string> <string>my_variation_category_list</string>
<string>my_base_contribution_list</string>
<string>my_base_application_list</string>
<string>my_editable</string> <string>my_editable</string>
</list> </list>
</value> </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 ...@@ -79,7 +79,7 @@ else:\n
if base_amount_dict:\n if base_amount_dict:\n
# get the application amount for this cell\n # get the application amount for this cell\n
model_line = cell.getParentValue()\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 if base_amount_dict.has_key(base):\n
base_application += base_amount_dict[base][tax_category]\n base_application += base_amount_dict[base][tax_category]\n
\n \n
......
...@@ -53,25 +53,18 @@ ...@@ -53,25 +53,18 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string>\'\'\'\n
\'\'\'\n
return the amount composed by all amount of paysheet line wich category of\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 category_list parameter is in variation_category_list of the PaySheet line \n
and wich payroll service has a base_participation in the \n and wich has a base_contribution in the base_contribution_list\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
\'\'\'\n \'\'\'\n
\n \n
# test the list parameters\n # test the list parameters\n
if base_participation_list is None:\n if base_contribution_list is None:\n
base_participation_list = []\n base_contribution_list = []\n
elif not (same_type(base_participation_list, []) or\n elif not (same_type(base_contribution_list, []) or\n
same_type(base_participation_list, ())):\n same_type(base_contribution_list, ())):\n
base_participation_list = [base_participation_list]\n base_contribution_list = [base_contribution_list]\n
\n \n
if category_list is None:\n if category_list is None:\n
category_list = []\n category_list = []\n
...@@ -86,9 +79,8 @@ paysheet = context\n ...@@ -86,9 +79,8 @@ paysheet = context\n
amount = 0\n amount = 0\n
\n \n
for pay_sheet_line in paysheet.contentValues(portal_type=\'Pay Sheet Line\'):\n for pay_sheet_line in paysheet.contentValues(portal_type=\'Pay Sheet Line\'):\n
for base_participation in base_participation_list:\n for base_contribution in base_contribution_list:\n
base_amount_list = pay_sheet_line.getResourceValue().getBaseAmountList()\n if base_contribution in pay_sheet_line.getBaseContributionList():\n
if base_participation in base_amount_list:\n
if pay_sheet_line.getSalaryRangeList(base=1) != []:\n if pay_sheet_line.getSalaryRangeList(base=1) != []:\n
for slice in pay_sheet_line.getSalaryRangeList(base=1):\n for slice in pay_sheet_line.getSalaryRangeList(base=1):\n
for category in category_list:\n for category in category_list:\n
...@@ -108,13 +100,11 @@ for pay_sheet_line in paysheet.contentValues(portal_type=\'Pay Sheet Line\'):\n ...@@ -108,13 +100,11 @@ for pay_sheet_line in paysheet.contentValues(portal_type=\'Pay Sheet Line\'):\n
amount += total_price\n amount += total_price\n
\n \n
break # this permit to add only one time the amount even \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 \n
amount = round(amount, precision)\n amount = round(amount, precision)\n
return amount\n return amount\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -124,7 +114,7 @@ return amount\n ...@@ -124,7 +114,7 @@ return amount\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <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>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -150,7 +140,7 @@ return amount\n ...@@ -150,7 +140,7 @@ return amount\n
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>base_participation_list</string> <string>base_contribution_list</string>
<string>category_list</string> <string>category_list</string>
<string>None</string> <string>None</string>
<string>same_type</string> <string>same_type</string>
...@@ -161,8 +151,7 @@ return amount\n ...@@ -161,8 +151,7 @@ return amount\n
<string>amount</string> <string>amount</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>pay_sheet_line</string> <string>pay_sheet_line</string>
<string>base_participation</string> <string>base_contribution</string>
<string>base_amount_list</string>
<string>slice</string> <string>slice</string>
<string>category</string> <string>category</string>
<string>cell</string> <string>cell</string>
......
...@@ -85,7 +85,7 @@ id = 0\n ...@@ -85,7 +85,7 @@ id = 0\n
context.log(model_line_list)\n context.log(model_line_list)\n
for model_line in model_line_list:\n for model_line in model_line_list:\n
base_category_list = model_line.getVariationBaseCategoryList()\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 translated_base_application_list = [str(translateString(x)) for x in base_application_list]\n
base_application_list = \', \'.join(translated_base_application_list)\n base_application_list = \', \'.join(translated_base_application_list)\n
list_of_list = []\n list_of_list = []\n
...@@ -119,11 +119,11 @@ for model_line in model_line_list:\n ...@@ -119,11 +119,11 @@ for model_line in model_line_list:\n
base = quantity\n base = quantity\n
\n \n
base_list = [str(translateString(base_application)) for base_application in \\\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 base_name = \'+\'.join(base_list)\n
\n \n
payroll_service = model_line.getResourceValue()\n payroll_service = model_line.getResourceValue()\n
base_participation_list = payroll_service.getBaseAmountList()\n base_contribution_list = model_line.getBaseContributionList()\n
\n \n
price = cell.getPrice()\n price = cell.getPrice()\n
if price is None:\n if price is None:\n
...@@ -162,7 +162,7 @@ for model_line in model_line_list:\n ...@@ -162,7 +162,7 @@ for model_line in model_line_list:\n
\'base_name\':base_name,\n \'base_name\':base_name,\n
\'base\':base,\n \'base\':base,\n
\'model_line\': model_line.getRelativeUrl(),\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 \'base_application_list\': base_application_list,\n
\'service_id\':payroll_service.getId()}\n \'service_id\':payroll_service.getId()}\n
object_dict[salary_range].update(share_dict)\n object_dict[salary_range].update(share_dict)\n
...@@ -297,7 +297,7 @@ return line_list\n ...@@ -297,7 +297,7 @@ return line_list\n
<string>base_list</string> <string>base_list</string>
<string>base_name</string> <string>base_name</string>
<string>payroll_service</string> <string>payroll_service</string>
<string>base_participation_list</string> <string>base_contribution_list</string>
<string>price</string> <string>price</string>
<string>_write_</string> <string>_write_</string>
<string>tuple_dict</string> <string>tuple_dict</string>
......
...@@ -69,7 +69,7 @@ def addProperties(line, line_dict, property_list):\n ...@@ -69,7 +69,7 @@ def addProperties(line, line_dict, property_list):\n
\n \n
line_dict_list = []\n line_dict_list = []\n
property_list = [ \'slice\',\n property_list = [ \'slice\',\n
\'base_participation_list\',\n \'base_contribution_list\',\n
\'base_application_list\',\n \'base_application_list\',\n
\'base_name\',\n \'base_name\',\n
\'base\',\n \'base\',\n
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>\'\'\'\n <value> <string>\'\'\'\n
This script return a Pay Sheet Line list with some new parameters on\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 payroll_service,...)\n
It\'s used in the PaySheetTransaction_view to display PaySheetLines\n It\'s used in the PaySheetTransaction_view to display PaySheetLines\n
\'\'\'\n \'\'\'\n
...@@ -77,18 +77,18 @@ line_list = []\n ...@@ -77,18 +77,18 @@ line_list = []\n
\n \n
for paysheet_line in paysheet_line_list:\n for paysheet_line in paysheet_line_list:\n
base_category_list = paysheet_line.getVariationBaseCategoryList()\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 translated_base_application_list = [str(translateString(x)) for x in base_application_list]\n
base_application_list = \', \'.join(translated_base_application_list)\n base_application_list = \', \'.join(translated_base_application_list)\n
payroll_service = paysheet_line.getResourceValue(portal_type=\'Payroll Service\')\n payroll_service = paysheet_line.getResourceValue(portal_type=\'Payroll Service\')\n
if payroll_service is not None:\n if payroll_service is not None:\n
base_participation_list = payroll_service.getBaseAmountList()\n base_contribution_list = paysheet_line.getBaseContributionList()\n
else:\n else:\n
base_participation_list = []\n base_contribution_list = []\n
causality = paysheet_line.getCausality()\n causality = paysheet_line.getCausality()\n
\n \n
base_list = [str(translateString(base_application)) for base_application in \\\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 base_name = \'+\'.join(base_list)\n
\n \n
list_of_list = []\n list_of_list = []\n
...@@ -141,7 +141,7 @@ for paysheet_line in paysheet_line_list:\n ...@@ -141,7 +141,7 @@ for paysheet_line in paysheet_line_list:\n
\'slice\':slice_title,\n \'slice\':slice_title,\n
\'base_name\':base_name,\n \'base_name\':base_name,\n
\'base\':base,\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 \'base_application_list\': base_application_list,\n
\'payroll_service\':payroll_service.getId(),\n \'payroll_service\':payroll_service.getId(),\n
\'causality\': causality,}\n \'causality\': causality,}\n
...@@ -250,7 +250,7 @@ return line_list\n ...@@ -250,7 +250,7 @@ return line_list\n
<string>translated_base_application_list</string> <string>translated_base_application_list</string>
<string>payroll_service</string> <string>payroll_service</string>
<string>None</string> <string>None</string>
<string>base_participation_list</string> <string>base_contribution_list</string>
<string>causality</string> <string>causality</string>
<string>base_application</string> <string>base_application</string>
<string>base_list</string> <string>base_list</string>
......
...@@ -91,7 +91,6 @@ ...@@ -91,7 +91,6 @@
<string>my_price_currency</string> <string>my_price_currency</string>
<string>my_price</string> <string>my_price</string>
<string>my_quantity</string> <string>my_quantity</string>
<string>my_base_amount_list</string>
<string>my_resource_title</string> <string>my_resource_title</string>
<string>my_variation_category_list</string> <string>my_variation_category_list</string>
<string>my_specialise_title</string> <string>my_specialise_title</string>
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<string>listbox_model_line</string> <string>listbox_model_line</string>
<string>listbox_slice_path</string> <string>listbox_slice_path</string>
<string>listbox_base_application_string</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_service_id</string>
<string>listbox_quantity</string> <string>listbox_quantity</string>
<string>listbox_price</string> <string>listbox_price</string>
......
...@@ -152,8 +152,8 @@ ...@@ -152,8 +152,8 @@
<string>Tax Category</string> <string>Tax Category</string>
</tuple> </tuple>
<tuple> <tuple>
<string>base_participation_string</string> <string>base_contribution_string</string>
<string>Base Participation</string> <string>Base Contribution</string>
</tuple> </tuple>
<tuple> <tuple>
<string>base_application_string</string> <string>base_application_string</string>
......
...@@ -84,7 +84,6 @@ ...@@ -84,7 +84,6 @@
<string>my_title</string> <string>my_title</string>
<string>my_quantity_unit</string> <string>my_quantity_unit</string>
<string>my_product_line</string> <string>my_product_line</string>
<string>my_base_amount_list</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -81,7 +81,6 @@ ...@@ -81,7 +81,6 @@
<list> <list>
<string>my_quantity_unit</string> <string>my_quantity_unit</string>
<string>my_product_line</string> <string>my_product_line</string>
<string>my_base_amount_list</string>
</list> </list>
</value> </value>
</item> </item>
......
2009-01-15 fabien 2009-01-15 fabien
* update bt format * update bt format
* change the related key because of the changes of uses of base_amount * 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 2008-09-16 Kazuhiko
* revise pay_sheet_transaction_builder using new API. * revise pay_sheet_transaction_builder using new API.
......
330 332
\ No newline at end of file \ 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