[Erp5-report] r6478 - /erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_ac...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Apr 6 10:21:25 CEST 2006


Author: jerome
Date: Thu Apr  6 10:21:21 2006
New Revision: 6478

URL: http://svn.erp5.org?rev=6478&view=rev
Log:
typo in getInventory variable name, (+ big mistake in copy/paste, BankAccount_getAccountingTransactionList was commited with the content of Entity_getAccountingTransactionList)

Modified:
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BankAccount_getAccountingTransactionList.xml
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Entity_getAccountingTransactionList.xml

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BankAccount_getAccountingTransactionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BankAccount_getAccountingTransactionList.xml?rev=6478&r1=6477&r2=6478&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BankAccount_getAccountingTransactionList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/BankAccount_getAccountingTransactionList.xml Thu Apr  6 10:21:21 2006
@@ -97,18 +97,17 @@
   # Create a new parameter list to get the previous balance\n
   get_inventory_kw = params.copy()\n
   get_inventory_kw.update({ \'omit_simulation\'         : 1\n
+                          , \'payment_uid\'             : context.getUid()\n
                           , \'to_date\'                 : from_date\n
-                          , \'mirror_section_uid\'      : context.getUid()\n
                           , \'section_portal_type_list\': [\'Organisation\']\n
+                          , \'stat\'                    : 1\n
                           })\n
-  getInventory = context.getPortalObject()\\\n
-                    .portal_simulation.getInventoryAssetPrice\n
+\n
+  getInventory = context.getPortalObject().portal_simulation.getInventory\n
   # Get previous debit and credit\n
-  previous_total_debit  = r_(getInventoryAssetPrice(omit_output=1,\n
-                                                    **get_inventory_kw))\n
-  previous_total_credit = r_(getInventoryAssetPrice(omit_input =1,\n
-                                                    **get_inventory_kw))\n
-  if previous_total_credit != 0 :\n
+  previous_total_debit  = r_(getInventory(omit_output=1, **get_inventory_kw))\n
+  previous_total_credit = r_(getInventory(omit_input =1, **get_inventory_kw))\n
+  if previous_total_credit != 0:\n
     previous_total_credit = - previous_total_credit\n
 \n
   # Show the previous balance if not empty\n
@@ -122,20 +121,15 @@
     previous_balance.setUid(\'new_000\')\n
 \n
     previous_balance.edit( \\\n
-        parent_title = context.Base_translateString("Previous Balance")\n
-      , section_title                     = ""\n
-      , date                              = from_date - 1\n
-      , portal_type                       = ""\n
-      , account_uid                       = None\n
-      , parent_reference                  = None\n
-      , parent_specific_reference         = None\n
-      , translated_simulation_state_title = None\n
-      , debit                             = previous_total_debit\n
-      , credit                            = previous_total_credit\n
-      , grouping_reference                = None\n
-      , balance                           = net_balance\n
-      , net_balance                       = net_balance\n
-      , is_previous_balance               = True\n
+        title                   = context.Base_translateString("Previous Balance")\n
+      , date                    = from_date - 1\n
+      , portal_type             = ""\n
+      , simulation_state_title  = ""\n
+      , debit                   = previous_total_debit\n
+      , credit                  = previous_total_credit\n
+      , balance                 = net_balance\n
+      , net_balance             = net_balance\n
+      , is_previous_balance     = True\n
       )\n
     new_result.append(previous_balance)\n
 \n
@@ -143,12 +137,19 @@
 # Show / Hide grouping if needed\n
 if kw.has_key(\'hide_grouping\'): params[\'hide_grouping\'] = kw[\'hide_grouping\']\n
 \n
-# FIXME: same problem as in BankAccount_getAccountingTransactionList\n
-result = context.Entity_zGetAccountingTransactionList( from_date = from_date\n
-                                                     , at_date   = at_date\n
-                                                     , src__     = src__\n
-                                                     , **params\n
-                                                     )\n
+# FIXME:\n
+# using listbox current page number * number of line per listbox page, you can call a\n
+# ZSQL Method to initialize net_balance and calculate this only for this page.\n
+#\n
+# But this is just temporary because some day, erp5_accounting will be rewritten using\n
+# only portal_catalog and getInventory. The Iventory API should provide a way to implement\n
+# such a net_balance column (in one instruction, so that we do not need to write a wrapping\n
+# list method like this one)\n
+result = context.BankAccount_zGetAccountingTransactionList( from_date = from_date\n
+                                                          , at_date   = at_date\n
+                                                          , src__     = src__\n
+                                                          , **params\n
+                                                          )\n
 if src__:\n
   return result\n
 \n
@@ -157,19 +158,13 @@
   o = l.getObject()\n
   net_balance += l.balance or 0.0\n
   if o is not None:\n
-    c = o.asContext( net_balance                       = net_balance\n
-                   , balance                           = l.balance\n
-                   , credit                            = l.credit\n
-                   , debit                             = l.debit\n
-                   , date                              = l.date\n
-                   , section_title                     = l.section_title\n
-                   , parent_reference                  = l.parent_reference\n
-                   , parent_specific_reference         = l.parent_specific_reference\n
-                   , translated_simulation_state_title = o.getTranslatedSimulationStateTitle()\n
-                   # FIXME: overriding \'portal_type\' in asContext is clearly a bad idea, as many methods are storred on the portal type\n
-                   # (hence the translated_simulation_state_title hack) -j\xc3\xa9rome\n
-                   , portal_type                       = l.portal_type\n
-                   , account_uid                       = l.account_uid\n
+    c = o.asContext( net_balance        = net_balance\n
+                   , balance            = l.balance\n
+                   , credit             = l.credit\n
+                   , debit              = l.debit\n
+                   , date               = l.date\n
+                   , section_title      = l.section_title\n
+                   , specific_reference = l.specific_reference\n
                    )\n
     new_result.append(c)\n
 \n
@@ -240,7 +235,6 @@
                             <string>get_inventory_kw</string>
                             <string>getInventory</string>
                             <string>_apply_</string>
-                            <string>getInventoryAssetPrice</string>
                             <string>previous_total_debit</string>
                             <string>previous_total_credit</string>
                             <string>Products.ERP5Type.Document</string>

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Entity_getAccountingTransactionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Entity_getAccountingTransactionList.xml?rev=6478&r1=6477&r2=6478&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Entity_getAccountingTransactionList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Entity_getAccountingTransactionList.xml Thu Apr  6 10:21:21 2006
@@ -104,9 +104,9 @@
   getInventory = context.getPortalObject()\\\n
                     .portal_simulation.getInventoryAssetPrice\n
   # Get previous debit and credit\n
-  previous_total_debit  = r_(getInventoryAssetPrice(omit_output=1,\n
+  previous_total_debit  = r_(getInventory(omit_output=1,\n
                                                     **get_inventory_kw))\n
-  previous_total_credit = r_(getInventoryAssetPrice(omit_input =1,\n
+  previous_total_credit = r_(getInventory(omit_input =1,\n
                                                     **get_inventory_kw))\n
   if previous_total_credit != 0 :\n
     previous_total_credit = - previous_total_credit\n
@@ -240,7 +240,6 @@
                             <string>get_inventory_kw</string>
                             <string>getInventory</string>
                             <string>_apply_</string>
-                            <string>getInventoryAssetPrice</string>
                             <string>previous_total_debit</string>
                             <string>previous_total_credit</string>
                             <string>Products.ERP5Type.Document</string>




More information about the Erp5-report mailing list