Commit ed421035 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

more efficient calculation for payment condition related values.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32989 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0d54d763
...@@ -72,18 +72,22 @@ class PaymentSimulationRule(Rule, PredicateMatrix): ...@@ -72,18 +72,22 @@ class PaymentSimulationRule(Rule, PredicateMatrix):
cell = self._getMatchingCell(input_movement) cell = self._getMatchingCell(input_movement)
if cell is not None : # else, we do nothing if cell is not None : # else, we do nothing
for payment_rule_cell_line in cell.objectValues():
for payment_condition in payment_condition_list: 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()
quantity = payment_condition.getExpectedQuantity(input_movement)
for payment_rule_cell_line in cell.objectValues():
prevision_line = kw.copy() prevision_line = kw.copy()
prevision_line.update( prevision_line.update(
source=payment_rule_cell_line.getSource() or \ source=payment_rule_cell_line.getSource() or \
input_movement.getSource(), input_movement.getSource(),
destination=payment_rule_cell_line.getDestination() or \ destination=payment_rule_cell_line.getDestination() or \
input_movement.getDestination(), input_movement.getDestination(),
start_date=payment_condition.getExpectedStartdate(input_movement), start_date=start_date,
stop_date=payment_condition.getExpectedStopdate(input_movement), stop_date=stop_date,
quantity=payment_condition.getExpectedQuantity(input_movement) * \ quantity=quantity * payment_rule_cell_line.getQuantity()
payment_rule_cell_line.getQuantity()
) )
# Generate Prevision Script is required for Payment Simulation Rule? # Generate Prevision Script is required for Payment Simulation Rule?
if payment_rule_cell_line.hasProperty( if payment_rule_cell_line.hasProperty(
......
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