Commit 1c077bb3 authored by Fabien Morin's avatar Fabien Morin

if base_application is not in the slice range, quantity is 0


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28025 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 68860733
......@@ -265,7 +265,10 @@ class TradeModelLine(Predicate, XMLMatrix, Amount):
model_slice_min = cell.getQuantityRangeMin()
model_slice_max = cell.getQuantityRangeMax()
base_application = tmp_movement.getQuantity(0.0)
if base_application-model_slice_min>0:
if base_application < model_slice_min:
# if base_application is not in the slice range, quantity is 0
tmp_movement.setQuantity(0)
elif base_application-model_slice_min > 0:
if base_application <= model_slice_max:
tmp_movement.setQuantity(base_application-model_slice_min)
elif model_slice_max:
......
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