[Erp5-report] r14296 - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_skins/er...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed May 2 12:24:29 CEST 2007


Author: jerome
Date: Wed May  2 12:24:29 2007
New Revision: 14296

URL: http://svn.erp5.org?rev=14296&view=rev
Log:
Add a at_date parameter to Invoice_getRemainingTotalPayablePrice, to ignore payments after this date.

Modified:
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Invoice_getRemainingTotalPayablePrice.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Invoice_getRemainingTotalPayablePrice.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Invoice_getRemainingTotalPayablePrice.xml?rev=14296&r1=14295&r2=14296&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Invoice_getRemainingTotalPayablePrice.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Invoice_getRemainingTotalPayablePrice.xml Wed May  2 12:24:29 2007
@@ -76,6 +76,9 @@
 reference for lines.\n
 If `detailed` argument is set to a true value, instead of returning the price\n
 as a float value, it returns a mapping (node, mirror_section) -> total_price.\n
+The `at_date` paremeter is when you want to know the remaining amount at a\n
+particuliar date. This simply ignores related payments or transactions after\n
+this date.\n
 """\n
 portal = context.getPortalObject()\n
 total_payable_price_per_node_section = dict()\n
@@ -109,6 +112,7 @@
     line_section = line.getDestinationSection()\n
     mirror_section = line.getSourceSection()\n
     amount = line.getDestinationInventoriatedTotalAssetPrice() or 0\n
+\n
   \n
   if node_value is not None and \\\n
       node_value.getAccountTypeId() in (\'payable\', \'receivable\'):\n
@@ -160,14 +164,18 @@
       line_section = line.getSourceSection()\n
       mirror_section = line.getDestinationSection()\n
       amount = line.getSourceInventoriatedTotalAssetPrice() or 0\n
+      date = line.getStartDate().earliestTime()\n
     else:\n
       node_value = line.getDestinationValue(portal_type=\'Account\')\n
       line_section = line.getDestinationSection()\n
       mirror_section = line.getSourceSection()\n
       amount = line.getDestinationInventoriatedTotalAssetPrice() or 0\n
+      date = line.getStopDate().earliestTime()\n
     \n
     if node_value is not None and \\\n
         node_value.getAccountTypeId() in (\'payable\', \'receivable\'):\n
+      if at_date and date > at_date:\n
+        continue\n
       if node_value in accounts_in_context:\n
         key = (node_value.getRelativeUrl(), mirror_section)\n
         total_payable_price_per_node_section[key] =\\\n
@@ -201,7 +209,7 @@
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>detailed=0</string> </value>
+            <value> <string>detailed=0, at_date=None</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -221,13 +229,14 @@
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>1</int> </value>
+                        <value> <int>2</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
                             <string>detailed</string>
+                            <string>at_date</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>portal</string>
@@ -256,6 +265,7 @@
                             <string>other_invoice_line_account</string>
                             <string>ValueError</string>
                             <string>related_transaction_is_source</string>
+                            <string>date</string>
                             <string>sum</string>
                           </tuple>
                         </value>
@@ -270,6 +280,7 @@
             <value>
               <tuple>
                 <int>0</int>
+                <none/>
               </tuple>
             </value>
         </item>

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=14296&r1=14295&r2=14296&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision Wed May  2 12:24:29 2007
@@ -1,1 +1,1 @@
-290
+292




More information about the Erp5-report mailing list