Commit 0052b8ae authored by Fabien Morin's avatar Fabien Morin

the slice amount will not be used on PaySheet who don't have any model in the...

the slice amount will not be used on PaySheet who don't have any model in the YearToDateSlice script.
This case must not appear very often. Just on the old PaySheet (before or during the Upgrade). During the upgrade, a default model is set on the Pay Sheets.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18613 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f12245ae
......@@ -84,7 +84,7 @@ search_params = \\\n
\'portal_type\' : \'Pay Sheet Transaction\',\n
\'delivery.start_date\' : {\'range\': "minmax", \'query\': (from_date, to_date)},\n
\'delivery.source_section_uid\' : context.getSourceSectionUid(),\n
# \'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n
\'simulation_state\' : [\'confirmed\', \'stopped\', \'delivered\'],\n
}\n
\n
paysheet_list = accounting_module.searchFolder(**search_params)\n
......@@ -107,17 +107,18 @@ yearly_slice_amount += slice_amount\n
\n
for paysheet in paysheet_list :\n
model = paysheet.getSpecialiseValue()\n
slice = model.getCell(slice_path)\n
plafond = slice.getQuantityRangeMax()\n
gross_salary=paysheet.PaySheetTransaction_getAmountFromBaseParticipationList(\\\n
base_participation_list=(\'gross_salary\',), \n
category_list=\'tax_category/employee_share\')\n
slice_amount = 0\n
if gross_salary < plafond:\n
slice_amount = gross_salary\n
else:\n
slice_amount = plafond\n
yearly_slice_amount += slice_amount\n
if model is not None:\n
slice = model.getCell(slice_path)\n
plafond = slice.getQuantityRangeMax()\n
gross_salary=paysheet.PaySheetTransaction_getAmountFromBaseParticipationList(\\\n
base_participation_list=(\'gross_salary\',), \n
category_list=\'tax_category/employee_share\')\n
slice_amount = 0\n
if gross_salary < plafond:\n
slice_amount = gross_salary\n
else:\n
slice_amount = plafond\n
yearly_slice_amount += slice_amount\n
\n
return yearly_slice_amount\n
......@@ -184,6 +185,7 @@ return yearly_slice_amount\n
<string>_inplacevar_</string>
<string>_getiter_</string>
<string>paysheet</string>
<string>None</string>
</tuple>
</value>
</item>
......
57
\ No newline at end of file
59
\ 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