Commit 2efb3ff0 authored by Łukasz Nowak's avatar Łukasz Nowak

- formatting and spellchecking

 - small fixes to description of interface


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27631 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5a826a46
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
# Łukasz Nowak <luke@nexedi.com> # Łukasz Nowak <luke@nexedi.com>
# #
# WARNING: This program as such is intended to be used by professional # WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential # programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs # consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial # End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software # guarantees and support are strongly advised to contract a Free Software
# Service Company # Service Company
# #
# This program is Free Software; you can redistribute it and/or # This program is Free Software; you can redistribute it and/or
...@@ -28,26 +28,23 @@ ...@@ -28,26 +28,23 @@
# #
############################################################################## ##############################################################################
# simple interface which have to be implemented on TradeModelLine,
# Transformation, Pay Sheet Model, etc
from zope.interface import Interface from zope.interface import Interface
class ITransformation(Interface): class ITransformation(Interface):
""" """
Common Interface to implementing querying of Indirect Amount Common Interface to implementing querying of Indirect Amount
Models (TaxModelLine, InvoiceModelLine) shall be based on this interface Models (TaxModelLine, InvoiceModelLine, etc) shall be based on this
interface
TODO:
- define parameters precisely for each method
""" """
def getAggregatedAmountList(context, movement_list=None, rounding=False): def getAggregatedAmountList(context, movement_list=None, rounding=False):
"""Returns implementation specific AggregatedAmountList of amounts """Returns list of amounts generated by set of models
generated by set of rules
context - represents object for which calculation shall happen context - represents object for which calculation shall happen
movement_list - optional argument, movement list to apply on, if not passed movement_list - optional argument, movement list to apply on, if not passed
it will be generated from passed context it will be generated from passed context
rounding - boolean argument, which controls if rounding shall be applied on rounding - boolean argument, which controls if rounding shall be applied on
generated movements or not generated movements or not
...@@ -61,16 +58,19 @@ class ITransformation(Interface): ...@@ -61,16 +58,19 @@ class ITransformation(Interface):
pass pass
def updateAggregatedAmountList(context, movement_list=None, rounding=False): def updateAggregatedAmountList(context, movement_list=None, rounding=False):
"""Updates existing movement and returns new or deleted if any. """Updates existing movement and returns new or deleted if any according to model
Returns a dictionary of list of movement 'movement_to_add_list' and
'movement_to_delete_list'
context - represents object on which update shall happen context - represents object on which update shall happen
movement_list - optional argument, movement list to apply on, if not passed movement_list - optional argument, movement list to apply on, if not passed
it will be generated from passed context it will be generated from passed context
rounding - boolean argument, which controls if rounding shall be applied on rounding - boolean argument, which controls if rounding shall be applied on
generated movements or not generated movements or not
Returns a dictionary of list of instances of AggregatedAmountList class.
Dictionary contain lists described by keys:
* movement_to_add_list - list for movements which shall be added
* movement_to_delete_list - list of movements which shall be deleted
""" """
pass 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