Commit 0a1f2563 authored by Fabien Morin's avatar Fabien Morin

- copy float_index of PaySheetModelLine in PaySheetLine

- use a localised script to do post calculation (add lines requiered by
  accouning lines)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17733 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7dbd41c9
...@@ -101,7 +101,7 @@ class PaySheetTransaction(Invoice): ...@@ -101,7 +101,7 @@ class PaySheetTransaction(Invoice):
security.declareProtected(Permissions.AddPortalContent, security.declareProtected(Permissions.AddPortalContent,
'createPaySheetLine') 'createPaySheetLine')
def createPaySheetLine(self, cell_list, title='', res='', desc='', def createPaySheetLine(self, cell_list, title='', res='', desc='',
base_amount_list=None, **kw): base_amount_list=None, int_index=None, **kw):
''' '''
This function register all paysheet informations in paysheet lines and This function register all paysheet informations in paysheet lines and
cells. Select good cells only cells. Select good cells only
...@@ -137,6 +137,7 @@ class PaySheetTransaction(Invoice): ...@@ -137,6 +137,7 @@ class PaySheetTransaction(Invoice):
variation_base_category_list = ('tax_category', 'salary_range'), variation_base_category_list = ('tax_category', 'salary_range'),
variation_category_list = var_cat_list, variation_category_list = var_cat_list,
base_amount_list = base_amount_list, base_amount_list = base_amount_list,
int_index = int_index,
**kw) **kw)
base_id = 'movement' base_id = 'movement'
...@@ -198,6 +199,7 @@ class PaySheetTransaction(Invoice): ...@@ -198,6 +199,7 @@ class PaySheetTransaction(Invoice):
'desc' : [], 'desc' : [],
'base_amount_list' : model_line.getBaseAmountList(), 'base_amount_list' : model_line.getBaseAmountList(),
'res' : service.getRelativeUrl(), 'res' : service.getRelativeUrl(),
'int_index' : model_line.getFloatIndex(),
'cell_list' : [] 'cell_list' : []
} }
...@@ -234,6 +236,7 @@ class PaySheetTransaction(Invoice): ...@@ -234,6 +236,7 @@ class PaySheetTransaction(Invoice):
res = item['res'], res = item['res'],
desc = desc, desc = desc,
cell_list = item['cell_list'], cell_list = item['cell_list'],
int_index = item['int_index'],
base_amount_list=item['base_amount_list'],) base_amount_list=item['base_amount_list'],)
...@@ -334,6 +337,7 @@ class PaySheetTransaction(Invoice): ...@@ -334,6 +337,7 @@ class PaySheetTransaction(Invoice):
service = model_line.getResourceValue() service = model_line.getResourceValue()
title = model_line.getTitleOrId() title = model_line.getTitleOrId()
int_index = model_line.getFloatIndex()
id = model_line.getId() id = model_line.getId()
base_amount_list = model_line.getBaseAmountList() base_amount_list = model_line.getBaseAmountList()
res = service.getRelativeUrl() res = service.getRelativeUrl()
...@@ -438,24 +442,20 @@ class PaySheetTransaction(Invoice): ...@@ -438,24 +442,20 @@ class PaySheetTransaction(Invoice):
pay_sheet_line = self.createPaySheetLine( pay_sheet_line = self.createPaySheetLine(
title = title, title = title,
res = res, res = res,
int_index = int_index,
desc = desc, desc = desc,
base_amount_list = base_amount_list, base_amount_list = base_amount_list,
cell_list = cell_list, cell_list = cell_list,
) )
pay_sheet_line_list.append(pay_sheet_line) pay_sheet_line_list.append(pay_sheet_line)
# create a line of the total tax payed by the employee
# this hack permit to calculate the net salary # this script is used to add a line that permit to have good accounting
new_cell = { 'axe_list' : [ 'tax_category/employer_share', # lines
'salary_range/france/forfait'] localized_add_end_line_script = getattr(self,
, 'quantity' : employee_tax_amount 'PaySheetTransaction_addEndLine',
, 'price' : 1 None)
} if localized_add_end_line_script:
pay_sheet_line = self.createPaySheetLine( localized_add_end_line_script(employee_tax_amount)
title = 'total employee contributions'
, res = 'payroll_service_module/total_employee_contributions'
, desc = 'this line permit to calculate the sum of the employer'
' share and permit to calculate the net salary'
, cell_list = [new_cell])
return pay_sheet_line_list 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