Commit 6a4f5519 authored by Tatuya Kamada's avatar Tatuya Kamada

When accounting, the debit price is expressed by a minus quantity.

Thus, we must take into account the both minus and plus quantity.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38893 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 44d90d73
......@@ -53,7 +53,10 @@ class SplitAndDefer(CopyToTarget):
applied_rule = simulation_movement.getParentValue()
rule = applied_rule.getSpecialiseValue()
if movement_quantity > new_movement_quantity:
# When accounting, the debit price is expressed by a minus quantity.
# Thus, we must take into account the both minus and plus quantity.
if ((movement_quantity < new_movement_quantity <= 0) or
(movement_quantity > new_movement_quantity >= 0)):
split_index = 0
new_id = "%s_split_%s" % (simulation_movement.getId(), split_index)
while getattr(aq_base(applied_rule), new_id, None) is not None:
......
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