diff --git a/product/ERP5/Document/PaymentCondition.py b/product/ERP5/Document/PaymentCondition.py index 5ea4fe6ab11766a93569408a71d33472d43ceeaf..eb23ca2717923aad9662ad62bc8b2ce0106e5871 100644 --- a/product/ERP5/Document/PaymentCondition.py +++ b/product/ERP5/Document/PaymentCondition.py @@ -30,9 +30,9 @@ from Products.ERP5Type.Globals import InitializeClass, PersistentMapping 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 """ diff --git a/product/ERP5/Document/PaymentSimulationRule.py b/product/ERP5/Document/PaymentSimulationRule.py index 87c2ef86ac4a6f4cfa8cecc6bcec715fc6908c59..3f90754c3543385e6303545e4339683544985b71 100644 --- a/product/ERP5/Document/PaymentSimulationRule.py +++ b/product/ERP5/Document/PaymentSimulationRule.py @@ -97,12 +97,13 @@ class PaymentSimulationRule(Rule, PredicateMatrix): 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()