Commit a87f0808 authored by Fabien Morin's avatar Fabien Morin

remove a hack and put it in the localized script PaySheetTransaction_postCalculation


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17821 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b9b368b1
......@@ -295,7 +295,6 @@ class PaySheetTransaction(Invoice):
model_line_list = [line for line in model_line_list if not line.getEditable()]
pay_sheet_line_list = []
employee_tax_amount = 0
# main loop : find all informations and create cell and PaySheetLines
for model_line in model_line_list:
......@@ -330,7 +329,6 @@ class PaySheetTransaction(Invoice):
LOG('createNotEditablePaySheetLineList : cell is None')
continue
# get the slice :
model_slice = None
model_slice = model_line.getParentValue().getCell(slice)
quantity = 0.0
price = 0.0
......@@ -369,7 +367,7 @@ class PaySheetTransaction(Invoice):
LOG('script_name :', 0, script_name)
result = calculation_script(\
base_amount_current_value_dict=base_amount_current_value_dict,
share=share,
share=share, #XXX
model_slice_min=model_slice_min,
model_slice_max=model_slice_max,
cell=cell,)
......@@ -385,13 +383,6 @@ class PaySheetTransaction(Invoice):
}
cell_list.append(new_cell)
#XXX this is a hack to have the net salary
base_list = model_line.getResourceValue().getBaseAmountList()
if price is not None and 'employee_share' in share and\
('deductible_tax' in base_list or\
'non_deductible_tax' in base_list):
employee_tax_amount += round((price * quantity), precision)
# update base participation
base_participation_list = service.getBaseAmountList(base=1)
for base_participation in base_participation_list:
......@@ -422,9 +413,9 @@ class PaySheetTransaction(Invoice):
# this script is used to add a line that permit to have good accounting
# lines
localized_add_end_line_script = getattr(self,
post_calculation_script = getattr(self,
'PaySheetTransaction_postCalculation', None)
if localized_add_end_line_script:
localized_add_end_line_script(employee_tax_amount)
if post_calculation_script:
post_calculation_script()
return pay_sheet_line_list
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