Commit 3068e0d7 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

modify how to get original values to support both old and new simulation tree.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32573 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fd796eb9
...@@ -48,22 +48,24 @@ class TaxRule(DeliveryRule): ...@@ -48,22 +48,24 @@ class TaxRule(DeliveryRule):
""" """ """ """
immutable_movement_list = [] immutable_movement_list = []
parent_simulation_movement = applied_rule.getParentValue() root_simulation_movement = applied_rule.getRootSimulationMovement()
order_movement = parent_simulation_movement.getDefaultOrderValue() order_movement = root_simulation_movement.getDefaultOrderValue()
if order_movement is None:
order_movement = root_simulation_movement.getDefaultDeliveryValue()
order_movement_dict = {} order_movement_dict = {}
for s_m in applied_rule.objectValues(): for s_m in applied_rule.objectValues():
order_movement_dict.setdefault(s_m.getOrder(), []).append(s_m) order_movement_dict.setdefault(s_m.getOrder() or s_m.getDelivery(), []).append(s_m)
order_movement_total_price = order_movement.getTotalPrice() order_movement_total_price = order_movement.getTotalPrice()
parent_simulation_movement_total_price = \ root_simulation_movement_total_price = \
parent_simulation_movement.getTotalPrice() root_simulation_movement.getTotalPrice()
# XXX round # XXX round
if order_movement_total_price != 0 and \ if order_movement_total_price != 0 and \
parent_simulation_movement_total_price != 0: root_simulation_movement_total_price != 0:
ratio = parent_simulation_movement_total_price / \ ratio = root_simulation_movement_total_price / \
order_movement_total_price order_movement_total_price
for tax_movement in order_movement\ for tax_movement in order_movement\
.DeliveryMovement_getCorrespondingTaxLineList(): .DeliveryMovement_getCorrespondingTaxLineList():
......
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