Commit 4b742773 authored by Fabien Morin's avatar Fabien Morin

typo, add comments


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17812 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2a11b7bd
...@@ -203,7 +203,7 @@ class PaySheetTransaction(Invoice): ...@@ -203,7 +203,7 @@ class PaySheetTransaction(Invoice):
'cell_list' : [] 'cell_list' : []
} }
# create cells if a value has been entered by accountable # create cells if a value has been entered
if quantity or price: if quantity or price:
for salary_range in salary_range_categories: for salary_range in salary_range_categories:
# Define an empty new cell # Define an empty new cell
...@@ -285,6 +285,7 @@ class PaySheetTransaction(Invoice): ...@@ -285,6 +285,7 @@ class PaySheetTransaction(Invoice):
else: else:
old_val = 0 old_val = 0
new_val = old_val + paysheetcell.getQuantity() new_val = old_val + paysheetcell.getQuantity()
# increment the corresponding amount
base_amount_current_value_dict[base_amount] = new_val base_amount_current_value_dict[base_amount] = new_val
# get not editables model lines # get not editables model lines
...@@ -325,19 +326,30 @@ class PaySheetTransaction(Invoice): ...@@ -325,19 +326,30 @@ class PaySheetTransaction(Invoice):
for share in variation_share_list: for share in variation_share_list:
for slice in variation_slice_list: for slice in variation_slice_list:
cell = model_line.getCell(slice, share) cell = model_line.getCell(slice, share)
if cell is not None: if cell is None:
LOG('createNotEditablePaySheetLineList : cell is None')
continue
# get the slice : # get the slice :
model_slice = None model_slice = None
model_slice = model_line.getParentValue().getCell(slice) model_slice = model_line.getParentValue().getCell(slice)
quantity = 0.0 quantity = 0.0
price = 0.0 price = 0.0
if model_slice is not None: if model_slice is None:
LOG('createNotEditablePaySheetLineList : model_slice %s is None' %\
slice)
continue
model_slice_min = model_slice.getQuantityRangeMin() model_slice_min = model_slice.getQuantityRangeMin()
model_slice_max = model_slice.getQuantityRangeMax() model_slice_max = model_slice.getQuantityRangeMax()
###################### ######################
# calculation part : # # calculation part : #
###################### ######################
# get script in this order
# 1 - model_line script
# 2 - model script
# 3 - get the default calculation script
# get the model line script # get the model line script
script_name = model_line.getCalculationScriptId() script_name = model_line.getCalculationScriptId()
if script_name is None: if script_name is None:
...@@ -354,29 +366,30 @@ class PaySheetTransaction(Invoice): ...@@ -354,29 +366,30 @@ class PaySheetTransaction(Invoice):
calculation_script = getattr(self, script_name, None) calculation_script = getattr(self, script_name, None)
quantity=0 quantity=0
price=0 price=0
LOG('script_name :', 0, script_name)
result = calculation_script(\ result = calculation_script(\
base_amount_current_value_dict=base_amount_current_value_dict, base_amount_current_value_dict=base_amount_current_value_dict,
share=share, share=share,
model_slice_min=model_slice_min, model_slice_min=model_slice_min,
model_slice_max=model_slice_max, model_slice_max=model_slice_max,
cell=cell,) cell=cell,)
quantity = result['quantity'] quantity = result['quantity']
price = result['price'] price = result['price']
# Cell creation : # Cell creation :
# Define an empty new cell # Define an empty new cell
new_cell = { 'axe_list' : [share, slice] new_cell = { 'axe_list' : [share, slice],
, 'quantity' : quantity 'quantity' : quantity,
, 'price' : price 'price' : price,
} }
cell_list.append(new_cell) cell_list.append(new_cell)
#XXX this is a hack to have the net salary #XXX this is a hack to have the net salary
base_list = model_line.getResourceValue().getBaseAmountList() base_list = model_line.getResourceValue().getBaseAmountList()
if price is not None and 'employee_share' in share and\ if price is not None and 'employee_share' in share and\
not ('base_salary' in base_list or\ ('deductible_tax' in base_list or\
'bonus' in base_list or\ 'non_deductible_tax' in base_list):
'gross_salary' in base_list):
employee_tax_amount += round((price * quantity), precision) employee_tax_amount += round((price * quantity), precision)
# update base participation # update base participation
......
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