[Erp5-report] r33312 kazuhiko - /erp5/trunk/products/ERP5/Document/

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Mar 3 10:12:10 CET 2010


Author: kazuhiko
Date: Wed Mar  3 10:12:10 2010
New Revision: 33312

URL: http://svn.erp5.org?rev=33312&view=rev
Log:
inherit from Trade Model Line instead of Business Path in Payment Condition, that makes more flexible for customisation.

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

Modified: erp5/trunk/products/ERP5/Document/PaymentCondition.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/PaymentCondition.py?rev=33312&r1=33311&r2=33312&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/PaymentCondition.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/PaymentCondition.py [utf8] Wed Mar  3 10:12:10 2010
@@ -30,9 +30,9 @@
 from AccessControl import ClassSecurityInfo
 
 from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
-from Products.ERP5.Document.BusinessPath import BusinessPath
+from Products.ERP5.Document.TradeModelLine import TradeModelLine
 
-class PaymentCondition(BusinessPath):
+class PaymentCondition(TradeModelLine):
     """
       Payment Conditions are used to define all the parameters of a payment
     """

Modified: erp5/trunk/products/ERP5/Document/PaymentSimulationRule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/PaymentSimulationRule.py?rev=33312&r1=33311&r2=33312&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/PaymentSimulationRule.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/PaymentSimulationRule.py [utf8] Wed Mar  3 10:12:10 2010
@@ -97,12 +97,13 @@
 
     if cell is not None : # else, we do nothing
       for payment_condition in payment_condition_list:
-        start_date = payment_condition.getExpectedStartDate(input_movement) or \
-                     input_movement.getStartDate()
-        stop_date = payment_condition.getExpectedStopDate(input_movement) or \
-                     input_movement.getStopDate()
-        kw.update({'start_date':start_date, 'stop_date':stop_date})
-        quantity = payment_condition.getExpectedQuantity(input_movement)
+        aggregated_ammount_list = payment_condition.getAggregatedAmountList(
+            input_movement, movement_list=[input_movement])
+        assert len(aggregated_ammount_list) == 1
+        aggregated_ammount = aggregated_ammount_list[0]
+        start_date = aggregated_ammount.getStartDate()
+        stop_date = aggregated_ammount.getStopDate()
+        quantity = aggregated_ammount.getQuantity()
 
         # one for payable
         prevision_line = kw.copy()




More information about the Erp5-report mailing list