[Erp5-report] r33074 kazuhiko - /erp5/trunk/products/ERP5/Document/PaymentSimulationRule.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Feb 24 05:46:31 CET 2010


Author: kazuhiko
Date: Wed Feb 24 05:46:30 2010
New Revision: 33074

URL: http://svn.erp5.org?rev=33074&view=rev
Log:
try to find payment condition not from explanation delivery but from delivery link movement, to make it possible to have payment condition for each movement (though not supported for now).

Modified:
    erp5/trunk/products/ERP5/Document/PaymentSimulationRule.py

Modified: erp5/trunk/products/ERP5/Document/PaymentSimulationRule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/PaymentSimulationRule.py?rev=33074&r1=33073&r2=33074&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/PaymentSimulationRule.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/PaymentSimulationRule.py [utf8] Wed Feb 24 05:46:30 2010
@@ -66,10 +66,14 @@
 
     payment_conditon_list = []
 
-    # try to find local payment conditions
-    delivery = input_movement.getDeliveryValue()
-    if delivery is None:
-      delivery = input_movement.getExplanationValue()
+    # try to find local payment conditions from the upper level delivery
+    rule = applied_rule
+    movement = input_movement
+    delivery = movement.getDeliveryValue()
+    while delivery is None and not(rule.isRootAppliedRule()):
+      rule = movement.getParentValue()
+      movement = rule.getParentValue()
+      delivery = movement.getDeliveryValue()
     if delivery is not None:
       payment_condition_list = delivery.getPaymentConditionValueList()
 




More information about the Erp5-report mailing list