[Erp5-report] r13261 - in /erp5/trunk/bt5/erp5_accounting_l10n_fr_m9: SkinTemplateItem/port...
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Mar 7 13:58:52 CET 2007
Author: jerome
Date: Wed Mar 7 13:58:46 2007
New Revision: 13261
URL: http://svn.erp5.org?rev=13261&view=rev
Log:
When selecting a payment_mode which is not a leave, display a detail of
transaction for each payment mode inside the selected payment_mode
Modified:
erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/AccountingTransactionModule_getJournalPerTransmissionSheetReportSectionList.xml
erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/AccountingTransactionModule_getPerOriginAndSheetSummaryLineList.xml
erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/bt/revision
Modified: erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/AccountingTransactionModule_getJournalPerTransmissionSheetReportSectionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/AccountingTransactionModule_getJournalPerTransmissionSheetReportSectionList.xml?rev=13261&r1=13260&r2=13261&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/AccountingTransactionModule_getJournalPerTransmissionSheetReportSectionList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/AccountingTransactionModule_getJournalPerTransmissionSheetReportSectionList.xml Wed Mar 7 13:58:46 2007
@@ -68,7 +68,9 @@
</item>
<item>
<key> <string>_body</string> </key>
- <value> <string>"""\n
+ <value> <string encoding="cdata"><![CDATA[
+
+"""\n
"""\n
from Products.ERP5Form.Report import ReportSection\n
request = context.REQUEST\n
@@ -84,15 +86,20 @@
portal_type = request[\'portal_type\']\n
\n
payment_mode_url = None\n
+detail_per_payment_mode = 0\n
+payment_mode_request_keys = dict()\n
+\n
if portal_type == \'Payment Transaction\':\n
payment_mode = request.get(\'payment_mode\')\n
if payment_mode:\n
payment_mode_value = portal.portal_categories.payment_mode\\\n
.restrictedTraverse(payment_mode)\n
payment_mode_url = payment_mode_value.getRelativeUrl().split(\'/\', 1)[1]\n
-\n
+ detail_per_payment_mode = len(payment_mode_value.contentValues()) > 0\n
+ for pm in payment_mode_value.contentValues():\n
+ cache_storage.setdefault(\'m9_report_per_%s\' % pm.getRelativeUrl(), {})\n
+ \n
simulation_state = [\'delivered\']\n
-\n
selection_name = \'accounting_selection\'\n
simtool = context.portal_simulation\n
\n
@@ -164,7 +171,19 @@
\n
total_debit, total_credit = account.get(origin, (0, 0))\n
account[origin] = ( total_debit + debit, total_credit + credit )\n
- # per origin and sheet\n
+ \n
+ # per origin and sheet, detailed per payment mode\n
+ if detail_per_payment_mode:\n
+ key = \'m9_report_per_payment_mode/%s\' % mvt.getPaymentMode()\n
+ if key not in payment_mode_request_keys:\n
+ payment_mode_request_keys[key] = mvt.getPaymentModeTitle()\n
+ origin_cache = cache_storage[key].setdefault(brain.node_relative_url, {})\n
+ total_debit, total_credit = origin_cache.get(\n
+ (sheet, brain.node_relative_url), (0, 0))\n
+ origin_cache[(sheet, brain.node_relative_url)] = \\\n
+ ( total_debit + debit,\n
+ total_credit + credit )\n
+ # per origin and sheet, global\n
origin_cache = per_origin_and_sheet_cache.setdefault(origin, {})\n
total_debit, total_credit = origin_cache.get(\n
(sheet, brain.node_relative_url), (0, 0))\n
@@ -177,19 +196,37 @@
cache[brain.node_relative_url] = ( total_debit + debit,\n
total_credit + credit )\n
\n
-report_section_list = [ ReportSection(\n
+report_section_list = []\n
+report_section_list.append(ReportSection(\n
title=N_(\'Transactions\'),\n
path=context.getPhysicalPath(),\n
form_id=\'AccountingTransactionModule_viewPerOriginAndSheetSummary\',\n
selection_name=\'accounting_transaction_module_m9_\'\n
\'accounting_transaction_list_report_selection\',\n
- selection_params={},\n
+ selection_params=dict(cache_key=\'m9_report_per_origin_and_sheet_summary\'),\n
selection_columns=[(\'sheet\', \'Transmission Sheet\'),\n
(\'account_id\', \'Account\'),\n
(\'account_title\', \'Account Name\'),\n
(\'debit\', \'Debit\'),\n
(\'credit\', \'Credit\')],\n
- listbox_display_mode=\'FlatListMode\', )]\n
+ listbox_display_mode=\'FlatListMode\', ))\n
+\n
+if detail_per_payment_mode:\n
+ for cache_key, payment_mode_title in payment_mode_request_keys.items():\n
+ report_section_list.append(ReportSection(\n
+ title=N_(\'Transactions for Payment Mode ${payment_mode_title}\',\n
+ mapping=dict(payment_mode_title=payment_mode_title)),\n
+ path=context.getPhysicalPath(),\n
+ level=3,\n
+ form_id=\'AccountingTransactionModule_viewPerOriginAndSheetSummary\',\n
+ selection_name=\'accounting_transaction_module_m9_\'\n
+ \'accounting_transaction_list_report_selection\',\n
+ selection_params=dict(cache_key=cache_key),\n
+ selection_columns=[(\'account_id\', \'Account\'),\n
+ (\'account_title\', \'Account Name\'),\n
+ (\'debit\', \'Debit\'),\n
+ (\'credit\', \'Credit\')],\n
+ listbox_display_mode=\'FlatListMode\', ))\n
\n
for account_class in range(1, 10):\n
account_class = str(account_class)\n
@@ -207,7 +244,9 @@
listbox_display_mode=\'FlatListMode\', ))\n
\n
return report_section_list\n
-</string> </value>
+
+
+]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
@@ -271,8 +310,14 @@
<string>section_category</string>
<string>portal_type</string>
<string>payment_mode_url</string>
+ <string>detail_per_payment_mode</string>
+ <string>dict</string>
+ <string>payment_mode_request_keys</string>
<string>payment_mode</string>
<string>payment_mode_value</string>
+ <string>len</string>
+ <string>_getiter_</string>
+ <string>pm</string>
<string>simulation_state</string>
<string>selection_name</string>
<string>simtool</string>
@@ -283,7 +328,6 @@
<string>getAccountClass</string>
<string>origin_id_cache</string>
<string>getOriginId</string>
- <string>_getiter_</string>
<string>brain</string>
<string>mvt</string>
<string>origin</string>
@@ -297,13 +341,15 @@
<string>total_debit</string>
<string>total_credit</string>
<string>_write_</string>
+ <string>key</string>
<string>origin_cache</string>
<string>cache</string>
<string>report_section_list</string>
+ <string>cache_key</string>
+ <string>payment_mode_title</string>
<string>range</string>
<string>account_class</string>
<string>str</string>
- <string>dict</string>
</tuple>
</value>
</item>
Modified: erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/AccountingTransactionModule_getPerOriginAndSheetSummaryLineList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/AccountingTransactionModule_getPerOriginAndSheetSummaryLineList.xml?rev=13261&r1=13260&r2=13261&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/AccountingTransactionModule_getPerOriginAndSheetSummaryLineList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/SkinTemplateItem/portal_skins/erp5_accounting_l10n_fr_m9/AccountingTransactionModule_getPerOriginAndSheetSummaryLineList.xml Wed Mar 7 13:58:46 2007
@@ -75,7 +75,7 @@
total_debit = 0\n
total_credit = 0\n
\n
-origin_cache = cache_storage[\'m9_report_per_origin_and_sheet_summary\']\n
+origin_cache = cache_storage[cache_key]\n
origin_list = origin_cache.keys()\n
origin_list.sort()\n
\n
@@ -114,8 +114,14 @@
</value>
</item>
<item>
+ <key> <string>_owner</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
<key> <string>_params</string> </key>
- <value> <string>**kw</string> </value>
+ <value> <string>cache_key=\'m9_report_per_origin_and_sheet_summary\', **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
@@ -135,12 +141,13 @@
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
- <value> <int>0</int> </value>
+ <value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
+ <string>cache_key</string>
<string>kw</string>
<string>Products.PythonScripts.standard</string>
<string>Object</string>
@@ -176,7 +183,9 @@
<item>
<key> <string>func_defaults</string> </key>
<value>
- <none/>
+ <tuple>
+ <string>m9_report_per_origin_and_sheet_summary</string>
+ </tuple>
</value>
</item>
<item>
Modified: erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/bt/revision?rev=13261&r1=13260&r2=13261&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/bt/revision (original)
+++ erp5/trunk/bt5/erp5_accounting_l10n_fr_m9/bt/revision Wed Mar 7 13:58:46 2007
@@ -1,1 +1,1 @@
-89
+84
More information about the Erp5-report
mailing list