Commit 01e1ef23 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

initial implementation of getExpectedQuantity().


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32538 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b7f88607
......@@ -406,6 +406,20 @@ class BusinessPath(Path):
and self._isDeliverySimulationMovementRelated(
explanation, simulation_movement)]
def getExpectedQuantity(self, explanation, *args, **kwargs):
"""
Returns the expected stop date for this
path based on the explanation.
XXX predecessor_quantity argument is required?
"""
if self.getQuantity():
return self.getQuantity()
elif self.getEfficiency():
return explanation.getQuantity() * self.getEfficiency()
else:
return explanation.getQuantity()
def getExpectedStartDate(self, explanation, predecessor_date=None, *args, **kwargs):
"""
Returns the expected start date for this
......
......@@ -588,15 +588,11 @@ class Rule(Predicate, XMLObject):
property_dict['%s_list' % base_category] = [category_url]
else:
property_dict['%s_list' % base_category] = []
# Amount
if business_path.getQuantity():
property_dict['quantity'] = business_path.getQuantity()
elif business_path.getEfficiency():
property_dict['quantity'] = movement.getQuantity() *\
business_path.getEfficiency()
else:
property_dict['quantity'] = movement.getQuantity()
property_dict['quantity'] = business_path.getExpectedQuantity()
# Date
if movement.getStartDate() == movement.getStopDate():
property_dict['start_date'] = business_path.getExpectedStartDate(
movement)
......
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