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): ...@@ -406,6 +406,20 @@ class BusinessPath(Path):
and self._isDeliverySimulationMovementRelated( and self._isDeliverySimulationMovementRelated(
explanation, simulation_movement)] 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): def getExpectedStartDate(self, explanation, predecessor_date=None, *args, **kwargs):
""" """
Returns the expected start date for this Returns the expected start date for this
......
...@@ -588,15 +588,11 @@ class Rule(Predicate, XMLObject): ...@@ -588,15 +588,11 @@ class Rule(Predicate, XMLObject):
property_dict['%s_list' % base_category] = [category_url] property_dict['%s_list' % base_category] = [category_url]
else: else:
property_dict['%s_list' % base_category] = [] property_dict['%s_list' % base_category] = []
# Amount # Amount
if business_path.getQuantity(): property_dict['quantity'] = business_path.getExpectedQuantity()
property_dict['quantity'] = business_path.getQuantity()
elif business_path.getEfficiency():
property_dict['quantity'] = movement.getQuantity() *\
business_path.getEfficiency()
else:
property_dict['quantity'] = movement.getQuantity()
# Date
if movement.getStartDate() == movement.getStopDate(): if movement.getStartDate() == movement.getStopDate():
property_dict['start_date'] = business_path.getExpectedStartDate( property_dict['start_date'] = business_path.getExpectedStartDate(
movement) 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