Commit c4839ceb authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

inherit from Trade Model Line instead of Business Path in Payment Condition,...

inherit from Trade Model Line instead of Business Path in Payment Condition, that makes more flexible for customisation.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33312 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0cd2ff3f
......@@ -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
"""
......
......@@ -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()
......
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