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): ...@@ -322,8 +322,8 @@ class PaySheetTransaction(Invoice):
variation_slice_list = model_line.getVariationCategoryList(\ variation_slice_list = model_line.getVariationCategoryList(\
base_category_list=['salary_range',]) 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) cell = model_line.getCell(slice, share)
if cell is None: if cell is None:
LOG('createNotEditablePaySheetLineList : cell is None') LOG('createNotEditablePaySheetLineList : cell is None')
...@@ -383,20 +383,19 @@ class PaySheetTransaction(Invoice): ...@@ -383,20 +383,19 @@ class PaySheetTransaction(Invoice):
} }
cell_list.append(new_cell) cell_list.append(new_cell)
# update base participation # update base participation
base_participation_list = service.getBaseAmountList(base=1) base_participation_list = service.getBaseAmountList(base=1)
for base_participation in base_participation_list: for base_participation in base_participation_list:
if quantity: if quantity:
if base_amount_current_value_dict.has_key(base_participation): if base_amount_current_value_dict.has_key(base_participation):
old_val = base_amount_current_value_dict[base_participation] old_val = base_amount_current_value_dict[base_participation]
else: else:
old_val = 0 old_val = 0
new_val = old_val + quantity new_val = old_val + quantity
if price: if price:
if old_val != 0: new_val = round((old_val + quantity*price), precision)
new_val = round((old_val + quantity*price), precision) base_amount_current_value_dict[base_participation] = new_val
base_amount_current_value_dict[base_participation] = new_val
if cell_list: if cell_list:
# create the PaySheetLine # 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