[Erp5-report] r32573 kazuhiko - /erp5/trunk/products/ERP5/Document/TaxRule.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Feb 16 06:15:03 CET 2010
Author: kazuhiko
Date: Tue Feb 16 06:15:02 2010
New Revision: 32573
URL: http://svn.erp5.org?rev=32573&view=rev
Log:
modify how to get original values to support both old and new simulation tree.
Modified:
erp5/trunk/products/ERP5/Document/TaxRule.py
Modified: erp5/trunk/products/ERP5/Document/TaxRule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/TaxRule.py?rev=32573&r1=32572&r2=32573&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/TaxRule.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/TaxRule.py [utf8] Tue Feb 16 06:15:02 2010
@@ -48,22 +48,24 @@
""" """
immutable_movement_list = []
- parent_simulation_movement = applied_rule.getParentValue()
- order_movement = parent_simulation_movement.getDefaultOrderValue()
+ root_simulation_movement = applied_rule.getRootSimulationMovement()
+ order_movement = root_simulation_movement.getDefaultOrderValue()
+ if order_movement is None:
+ order_movement = root_simulation_movement.getDefaultDeliveryValue()
order_movement_dict = {}
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()
- parent_simulation_movement_total_price = \
- parent_simulation_movement.getTotalPrice()
+ root_simulation_movement_total_price = \
+ root_simulation_movement.getTotalPrice()
# XXX round
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
for tax_movement in order_movement\
.DeliveryMovement_getCorrespondingTaxLineList():
More information about the Erp5-report
mailing list