Commit e45cfa71 authored by Łukasz Nowak's avatar Łukasz Nowak

- add parameters needed in implementation

 - fix typos
 - rewrite and extend docstrings


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27609 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 746722dd
......@@ -34,21 +34,24 @@ from zope.interface import Interface
class ITransformation(Interface):
"""
Common Interface to implementing quering of Indirect Amount
Common Interface to implementing querying of Indirect Amount
Models (TaxModelLine, InvoiceModelLine) shall be based on this interface
TODO:
- define parameters precisely for each method
"""
def getAggregatedAmountList(context):
def getAggregatedAmountList(context, movement_list=None, rounding=False):
"""Returns implementation specific AggregatedAmountList of amounts
generated by set of rules
context - represents object for which calculation shall happen
movement_list - optional argument, movement list to apply on, if not passed
it will be generated from passed context
rounding - boolean argument, which controls if rounding shall be applied on
generated movements or not
The method returns an instance of AggregatedAmountList class defined
at ERP5/AggregatedAmountList.py
Returns list of instance of AggregatedAmountList class
Note: This method shall be linear in case if context is order, line,
applied rule or movement. In case of built delivery this method shall
......@@ -57,16 +60,17 @@ class ITransformation(Interface):
"""
pass
def updateAggregatedAmountList(context):
def updateAggregatedAmountList(context, movement_list=None, rounding=False):
"""Updates existing movement and returns new or deleted if any.
Returns a dict of list of movement 'movement_to_add_list' and
Returns a dictionary of list of movement 'movement_to_add_list' and
'movement_to_delete_list'
context - represents object on which update shall happen
The method return a dict of list of movements : 'movement_to_add_list' and
'movement_to_delete_list'.
movement_list - optional argument, movement list to apply on, if not passed
it will be generated from passed context
rounding - boolean argument, which controls if rounding shall be applied on
generated movements or not
"""
pass
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