Commit 8c03b05c authored by Fabien Morin's avatar Fabien Morin

- change for imbrication order to update base participation only when changing

slice.
- remove an if condition wich was a mistake


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17825 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 94a6033f
......@@ -322,8 +322,8 @@ class PaySheetTransaction(Invoice):
variation_slice_list = model_line.getVariationCategoryList(\
base_category_list=['salary_range',])
for share in variation_share_list:
for slice in variation_slice_list:
for slice in variation_slice_list:
for share in variation_share_list:
cell = model_line.getCell(slice, share)
if cell is None:
LOG('createNotEditablePaySheetLineList : cell is None')
......@@ -383,20 +383,19 @@ class PaySheetTransaction(Invoice):
}
cell_list.append(new_cell)
# update base participation
base_participation_list = service.getBaseAmountList(base=1)
for base_participation in base_participation_list:
if quantity:
if base_amount_current_value_dict.has_key(base_participation):
old_val = base_amount_current_value_dict[base_participation]
else:
old_val = 0
new_val = old_val + quantity
if price:
if old_val != 0:
new_val = round((old_val + quantity*price), precision)
base_amount_current_value_dict[base_participation] = new_val
# update base participation
base_participation_list = service.getBaseAmountList(base=1)
for base_participation in base_participation_list:
if quantity:
if base_amount_current_value_dict.has_key(base_participation):
old_val = base_amount_current_value_dict[base_participation]
else:
old_val = 0
new_val = old_val + quantity
if price:
new_val = round((old_val + quantity*price), precision)
base_amount_current_value_dict[base_participation] = new_val
if cell_list:
# create the PaySheetLine
......
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