Commit c3ae6bc6 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

try to find payment conditions in the following order.

* local payment conditions
* payment conditions specified in specialised trade conditions
* payment conditions specified in BPM configuration


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32993 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0e651305
......@@ -63,6 +63,26 @@ class PaymentSimulationRule(Rule, PredicateMatrix):
movement_and_tuple_list = self._getInputMovementAndPathTupleList(
applied_rule)
input_movement = movement_and_tuple_list[0][0]
payment_conditon_list = []
# try to find local payment conditions
delivery = input_movement.getDeliveryValue()
if delivery is None:
delivery = input_movement.getExplanationValue()
if delivery is not None:
payment_condition_list = delivery.getPaymentConditionValueList()
# try to find payment conditions in specialised trade conditions
if len(payment_condition_list) == 0:
specialise = input_movement.getSpecialiseValue()
if specialise is None and delivery is not None:
specialise = delivery.getSpecialiseValue()
if specialise is not None:
payment_condition_list = specialise.getPaymentConditionValueList()
# try to use payment conditions in BPM configuration
if len(payment_condition_list) == 0:
payment_condition_list = [x[1] for x in movement_and_tuple_list if x[1] is not None]
kw = self._getExpandablePropertyDict(applied_rule, input_movement, None)
......
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