Commit b0401f5a authored by Fabien Morin's avatar Fabien Morin

the calculation script part was not at the good place, sorry


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28029 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d3148c2c
......@@ -266,13 +266,6 @@ class TradeModelLine(Predicate, XMLMatrix, Amount):
modified = 1
tmp_movement.setQuantity(quantity + movement.getTotalPrice())
# if a calculation script is defined, use it
calculation_script = self.getCalculationScript(context)
if calculation_script is not None:
tmp_movement = calculation_script(\
current_aggregated_amount_list=movement_list,
current_movement=tmp_movement)
else:
# if the quantity is defined, use it
modified = 1
......@@ -280,6 +273,13 @@ class TradeModelLine(Predicate, XMLMatrix, Amount):
# if price is not defined, it the same as 100 %
tmp_movement.setPrice(1)
# if a calculation script is defined, use it
calculation_script = self.getCalculationScript(context)
if calculation_script is not None:
tmp_movement = calculation_script(\
current_aggregated_amount_list=movement_list,
current_movement=tmp_movement)
# check if slices are used
salary_range_list = tmp_movement.getVariationCategoryList(\
base_category_list='salary_range') #XXX hardcoded values
......
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