[Erp5-report] r31920 jerome - /erp5/trunk/products/ERP5/interfaces/movement.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jan 22 17:35:46 CET 2010


Author: jerome
Date: Fri Jan 22 17:35:44 2010
New Revision: 31920

URL: http://svn.erp5.org?rev=31920&view=rev
Log:
Document Debit Credit according to implementation, and also describe
cancellation amount for accounting movements.

Modified:
    erp5/trunk/products/ERP5/interfaces/movement.py

Modified: erp5/trunk/products/ERP5/interfaces/movement.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/interfaces/movement.py?rev=31920&r1=31919&r2=31920&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/interfaces/movement.py [utf8] (original)
+++ erp5/trunk/products/ERP5/interfaces/movement.py [utf8] Fri Jan 22 17:35:44 2010
@@ -135,22 +135,36 @@
   """
   Accounting Movement private interface specification
 
-  The notion of debit and credit is used in accounting
-  instead of signed quantity. The following calculation
-  rules apply:
+  The notion of debit and credit is used in accounting instead of signed
+  quantity. The following calculation rules apply:
 
     Credit/Debit
 
     if quantity > 0
-      source_credit = - quantity
-      source_debit = quantity
-      destination_credit = quantity
-      destination_debit = - quantity
-
-    if quantity < 0
       source_credit = quantity
+      source_debit = 0
+      destination_credit = 0
+      destination_debit = quantity
+
+    if quantity < 0
+      source_credit = 0
       source_debit = - 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
 
   """
@@ -240,4 +254,4 @@
     """
     Returns True if this movement should be indexed in the
     stock table of the catalog, False else.
-    """
+    """




More information about the Erp5-report mailing list