[Erp5-report] r6722 - /erp5/trunk/bt5/erp5_accounting_l10n_fr/SkinTemplateItem/portal_skins...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Apr 14 23:27:25 CEST 2006


Author: kevin
Date: Fri Apr 14 23:27:23 2006
New Revision: 6722

URL: http://svn.erp5.org?rev=6722&view=rev
Log:
Use where_expression.

Modified:
    erp5/trunk/bt5/erp5_accounting_l10n_fr/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_creditorAccountsSum.xml

Modified: erp5/trunk/bt5/erp5_accounting_l10n_fr/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_creditorAccountsSum.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting_l10n_fr/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_creditorAccountsSum.xml?rev=6722&r1=6721&r2=6722&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting_l10n_fr/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_creditorAccountsSum.xml (original)
+++ erp5/trunk/bt5/erp5_accounting_l10n_fr/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_creditorAccountsSum.xml Fri Apr 14 23:27:23 2006
@@ -66,16 +66,19 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>"""\n
-  This script adds accounts value, only if they are creditors\n
+            <value> <string encoding="cdata"><![CDATA[
+
 """\n
+  This script adds accounts value, only if they are creditors.\n
+"""\n
 \n
 def shortAccountNumberToFullGapCategory(accountNumber) :\n
-  """ translates a short account number (eg 280) to a full gap category url \n
-    (eg gap/2/28/280) """\n
+  """\n
+    Translates a short account number (eg 280) to a full gap category url (eg gap/2/28/280).\n
+  """\n
   accountNumber = accountNumber.strip()\n
   gap = request.get("gap_base", kwd.get("gap_base", "gap/fr/pcg/"))\n
-  for i in range(len(accountNumber)) :\n
+  for i in range(len(accountNumber)):\n
     gap += accountNumber[:i+1]+"/"\n
   return gap[:-1]\n
 \n
@@ -88,16 +91,21 @@
 kw["section_category"]  = kwd.get("section_category",\n
                             "group/%s"%context.restrictedTraverse(request.get("organisation")).getGroup())\n
 kw[\'to_date\'] = kwd.get(\'at_date\', request[\'at_date\']) +1\n
+kw[\'where_expression\'] = " section.portal_type = \'Organisation\' "\n
 \n
 sum = 0.0\n
 for accountNumber in accounts :\n
   # we get all acounts strict member of this GAP category\n
   gap = context.restrictedTraverse("portal_categories/"+shortAccountNumberToFullGapCategory(accountNumber))\n
   for account in gap.getGapRelatedValueList(portal_type=\'Account\') :\n
-     sum += context.getPortalObject().portal_simulation.getInventoryAssetPrice( node_uid = account.getUid(), **kw )\n
+    result = context.getPortalObject().portal_simulation.getInventoryAssetPrice( node_uid = account.getUid(), **kw )\n
+    if result < 0 :\n
+      sum += result\n
 return sum\n
 # vim: syntax=python\n
-</string> </value>
+
+
+]]></string> </value>
         </item>
         <item>
             <key> <string>_code</string> </key>
@@ -113,7 +121,13 @@
         </item>
         <item>
             <key> <string>_filepath</string> </key>
-            <value> <string>Script (Python):/erp5/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_creditorAccountsSum</string> </value>
+            <value> <string>Script (Python):/nexedi/portal_skins/erp5_accounting_l10n_fr/FiscalReportCell_creditorAccountsSum</string> </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
         </item>
         <item>
             <key> <string>_params</string> </key>
@@ -159,6 +173,7 @@
                             <string>gap</string>
                             <string>account</string>
                             <string>_apply_</string>
+                            <string>result</string>
                           </tuple>
                         </value>
                     </item>




More information about the Erp5-report mailing list