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):
'cell_list' : []
}
# create cells if a value has been entered by accountable
# create cells if a value has been entered
if quantity or price:
for salary_range in salary_range_categories:
# Define an empty new cell
......@@ -285,6 +285,7 @@ class PaySheetTransaction(Invoice):
else:
old_val = 0
new_val = old_val + paysheetcell.getQuantity()
# increment the corresponding amount
base_amount_current_value_dict[base_amount] = new_val
# get not editables model lines
......@@ -325,19 +326,30 @@ class PaySheetTransaction(Invoice):
for share in variation_share_list:
for slice in variation_slice_list:
cell = model_line.getCell(slice, share)
if cell is not None:
if cell is None:
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
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_max = model_slice.getQuantityRangeMax()
######################
# 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
script_name = model_line.getCalculationScriptId()
if script_name is None:
......@@ -354,29 +366,30 @@ class PaySheetTransaction(Invoice):
calculation_script = getattr(self, script_name, None)
quantity=0
price=0
LOG('script_name :', 0, script_name)
result = calculation_script(\
base_amount_current_value_dict=base_amount_current_value_dict,
share=share,
model_slice_min=model_slice_min,
model_slice_max=model_slice_max,
cell=cell,)
quantity = result['quantity']
price = result['price']
# Cell creation :
# Define an empty new cell
new_cell = { 'axe_list' : [share, slice]
, 'quantity' : quantity
, 'price' : price
new_cell = { 'axe_list' : [share, slice],
'quantity' : quantity,
'price' : price,
}
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\
not ('base_salary' in base_list or\
'bonus' in base_list or\
'gross_salary' in base_list):
('deductible_tax' in base_list or\
'non_deductible_tax' in base_list):
employee_tax_amount += round((price * quantity), precision)
# 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