Commit e653f790 authored by Fabien Morin's avatar Fabien Morin

update some scripts :

- typo
- fix some problems in PaySheetTransaction_getYearToDateSlice

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26070 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5d7906f0
...@@ -164,7 +164,7 @@ def getPaymentConditionText(paysheet):\n ...@@ -164,7 +164,7 @@ def getPaymentConditionText(paysheet):\n
if date:\n if date:\n
if paysheet.getProperty(\'default_payment_condition_payment_mode_title\'):\n if paysheet.getProperty(\'default_payment_condition_payment_mode_title\'):\n
return \'%s: %s\' % (translateString(\'Payment\'),\n return \'%s: %s\' % (translateString(\'Payment\'),\n
translateString(\'${payment_mode} at ${payment_date}\', \n translateString(\'${payment_mode} at ${payment_date}\',\n
mapping = {\'payment_mode\': paysheet.getProperty(\'default_payment_condition_payment_mode_title\'),\n mapping = {\'payment_mode\': paysheet.getProperty(\'default_payment_condition_payment_mode_title\'),\n
\'payment_date\':date}))\n \'payment_date\':date}))\n
else:\n else:\n
......
...@@ -68,48 +68,50 @@ from_date=DateTime(context.getStartDate().year(), 1, 1)\n ...@@ -68,48 +68,50 @@ from_date=DateTime(context.getStartDate().year(), 1, 1)\n
to_date=context.getStartDate()\n to_date=context.getStartDate()\n
\n \n
search_params = \\\n search_params = \\\n
{ \n {\n
\'portal_type\' : \'Pay Sheet Transaction\',\n \'portal_type\' : \'Pay Sheet Transaction\',\n
\'delivery.start_date\' : {\'range\': "minmax", \'query\': (from_date, to_date)},\n \'delivery.start_date\' : {\'range\': "minmax", \'query\': (from_date, to_date)},\n
\'delivery.source_section_uid\' : context.getSourceSectionUid(),\n \'delivery.source_section_uid\' : context.getSourceSectionUid(),\n
\'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n \'simulation_state\' : [\'stopped\', \'delivered\'],\n
}\n }\n
\n \n
paysheet_list = accounting_module.searchFolder(**search_params)\n paysheet_list = [r.getObject() for r in accounting_module.searchFolder(**search_params)]\n
\n \n
yearly_slice_amount = 0\n yearly_slice_amount = 0\n
# get the slice value for this paysheet :\n # get the slice value for this paysheet :\n
model = context.getSpecialiseValue().getEffectiveModel(context)\n model = context.getSpecialiseValue().getEffectiveModel(context)\n
slice = model.getCell(slice_path)\n slice = model.getCell(slice_path, paysheet=context)\n
\n \n
if not slice:\n if slice is None:\n
return 0.0\n return 0.0\n
\n \n
plafond = slice.getQuantityRangeMax()\n plafond_max = slice.getQuantityRangeMax()\n
plafond_min = slice.getQuantityRangeMin()\n
\n \n
gross_salary = context.PaySheetTransaction_getAmountFromBaseParticipationList(\\\n gross_salary = context.PaySheetTransaction_getMovementTotalPriceFromCategory(\\\n
base_participation_list=(\'gross_salary\',),\n base_contribution=\'base_contribution/base_amount/gross_salary\',\n
category_list=\'tax_category/employee_share\')\n tax_category=\'tax_category/employee_share\')\n
\n \n
if gross_salary < plafond:\n if gross_salary < plafond_max:\n
slice_amount = gross_salary\n slice_amount = gross_salary - plafond_min\n
else:\n else:\n
slice_amount = plafond\n slice_amount = plafond_max - plafond_min\n
yearly_slice_amount += slice_amount\n yearly_slice_amount += slice_amount\n
\n \n
for paysheet in paysheet_list :\n for paysheet in paysheet_list :\n
model = paysheet.getSpecialiseValue().getEffectiveModel(paysheet)\n model = paysheet.getSpecialiseValue().getEffectiveModel(paysheet)\n
if model is not None:\n if model is not None:\n
slice = model.getCell(slice_path)\n slice = model.getCell(slice_path)\n
plafond = slice.getQuantityRangeMax()\n plafond_max = slice.getQuantityRangeMax()\n
gross_salary=paysheet.PaySheetTransaction_getAmountFromBaseParticipationList(\\\n plafond_min = slice.getQuantityRangeMin()\n
base_participation_list=(\'gross_salary\',), \n gross_salary=paysheet.PaySheetTransaction_getMovementTotalPriceFromCategory(\\\n
category_list=\'tax_category/employee_share\')\n base_contribution=\'base_contribution/base_amount/gross_salary\',\n
tax_category=\'tax_category/employee_share\')\n
slice_amount = 0\n slice_amount = 0\n
if gross_salary < plafond:\n if gross_salary < plafond_max:\n
slice_amount = gross_salary\n slice_amount = gross_salary - plafond_min\n
else:\n else:\n
slice_amount = plafond\n slice_amount = plafond_max - plafond_min\n
yearly_slice_amount += slice_amount\n yearly_slice_amount += slice_amount\n
\n \n
return yearly_slice_amount\n return yearly_slice_amount\n
...@@ -160,18 +162,22 @@ return yearly_slice_amount\n ...@@ -160,18 +162,22 @@ return yearly_slice_amount\n
<string>from_date</string> <string>from_date</string>
<string>to_date</string> <string>to_date</string>
<string>search_params</string> <string>search_params</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>_apply_</string> <string>_apply_</string>
<string>r</string>
<string>paysheet_list</string> <string>paysheet_list</string>
<string>yearly_slice_amount</string> <string>yearly_slice_amount</string>
<string>model</string> <string>model</string>
<string>slice</string> <string>slice</string>
<string>plafond</string> <string>None</string>
<string>plafond_max</string>
<string>plafond_min</string>
<string>gross_salary</string> <string>gross_salary</string>
<string>slice_amount</string> <string>slice_amount</string>
<string>_inplacevar_</string> <string>_inplacevar_</string>
<string>_getiter_</string>
<string>paysheet</string> <string>paysheet</string>
<string>None</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
96 99
\ 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