Commit d0770d7a authored by Jérome Perrin's avatar Jérome Perrin

Document Debit Credit according to implementation, and also describe

cancellation amount for accounting movements.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31920 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 233f7b28
...@@ -135,22 +135,36 @@ class IAccountingMovement(IAssetMovement): ...@@ -135,22 +135,36 @@ class IAccountingMovement(IAssetMovement):
""" """
Accounting Movement private interface specification Accounting Movement private interface specification
The notion of debit and credit is used in accounting The notion of debit and credit is used in accounting instead of signed
instead of signed quantity. The following calculation quantity. The following calculation rules apply:
rules apply:
Credit/Debit Credit/Debit
if quantity > 0 if quantity > 0
source_credit = - quantity source_credit = quantity
source_debit = quantity source_debit = 0
destination_credit = quantity destination_credit = 0
destination_debit = - quantity destination_debit = quantity
if quantity < 0 if quantity < 0
source_credit = quantity source_credit = 0
source_debit = - quantity source_debit = - quantity
destination_credit = - quantity destination_credit = - quantity
destination_debit = 0
The cancellation amount concept from IAmount interface also applies for debit
and credit. For a cancellation amount, the calculation rule are different:
if quantity > 0
source_credit = 0
source_debit = - quantity
destination_credit = - quantity
destination_debit = 0
if quantity < 0
source_credit = quantity
source_debit = 0
destination_credit = 0
destination_debit = quantity destination_debit = quantity
""" """
......
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