[Erp5-report] r14669 - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_skins/er...
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Jun 1 16:15:09 CEST 2007
Author: jerome
Date: Fri Jun 1 16:15:08 2007
New Revision: 14669
URL: http://svn.erp5.org?rev=14669&view=rev
Log:
dynamically show a column for bank account if a line contains a different payment that the transaction.
Modified:
erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getListBoxColumnList.xml
erp5/trunk/bt5/erp5_accounting/bt/revision
Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getListBoxColumnList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getListBoxColumnList.xml?rev=14669&r1=14668&r2=14669&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getListBoxColumnList.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getListBoxColumnList.xml Fri Jun 1 16:15:08 2007
@@ -74,11 +74,20 @@
\n
If there is more than one mirror_section on lines, the listbox will have an\n
extra column showing mirror_section_title.\n
+The same for apply for payment / payment_reference.\n
"""\n
section_dict = {None: 1}\n
+payment_dict = {None: 1}\n
for line in context.getMovementList():\n
section_dict[line.getSourceSection()] = 1\n
section_dict[line.getDestinationSection()] = 1\n
+ payment_dict[line.getSourcePayment()] = 1\n
+ payment_dict[line.getDestinationPayment()] = 1\n
+\n
+if context.getSourcePayment() or context.getDestinationSection():\n
+ min_payment_count = 2\n
+else:\n
+ min_payment_count = 1\n
\n
if context.getSourceSection() and context.getDestinationSection():\n
min_section_count = 3\n
@@ -88,31 +97,32 @@
min_section_count = 2\n
\n
multiple_sections = len(section_dict) > min_section_count\n
-\n
+multiple_payment = len(payment_dict) > min_payment_count\n
+\n
+column_item_list = [(\'id\', \'ID\')]\n
+a = column_item_list.append\n
+if source:\n
+ a((\'source\', \'Account\'))\n
+else:\n
+ a((\'destination\', \'Account\'))\n
if multiple_sections:\n
if source:\n
- return ((\'id\', \'ID\'),\n
- (\'source\', \'Account\'),\n
- (\'getDestinationSectionTitle\', \'Third Party\'),\n
- (\'source_debit\', \'Debit\'),\n
- (\'source_credit\', \'Credit\'))\n
+ a((\'getDestinationSectionTitle\', \'Third Party\'))\n
else:\n
- return ((\'id\', \'ID\'),\n
- (\'destination\', \'Account\'),\n
- (\'getSourceSectionTitle\', \'Third Party\'),\n
- (\'destination_debit\', \'Debit\'),\n
- (\'destination_credit\', \'Credit\'))\n
-else:\n
+ a((\'getSourceSectionTitle\', \'Third Party\'))\n
+if multiple_payment:\n
if source:\n
- return ((\'id\', \'ID\'),\n
- (\'source\', \'Account\'),\n
- (\'source_debit\', \'Debit\'),\n
- (\'source_credit\', \'Credit\'))\n
+ a((\'getSourcePaymentReference\', \'Bank Account\'))\n
else:\n
- return ((\'id\', \'ID\'),\n
- (\'destination\', \'Account\'),\n
- (\'destination_debit\', \'Debit\'),\n
- (\'destination_credit\', \'Credit\'))\n
+ a((\'getDestinationPaymentReference\', \'Bank Account\'))\n
+if source:\n
+ a((\'source_debit\', \'Debit\'))\n
+ a((\'source_credit\', \'Credit\'))\n
+else:\n
+ a((\'destination_debit\', \'Debit\'))\n
+ a((\'destination_credit\', \'Credit\'))\n
+\n
+return column_item_list\n
]]></string> </value>
@@ -166,14 +176,19 @@
<string>source</string>
<string>None</string>
<string>section_dict</string>
+ <string>payment_dict</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>line</string>
<string>_write_</string>
+ <string>min_payment_count</string>
<string>min_section_count</string>
<string>len</string>
<string>multiple_sections</string>
+ <string>multiple_payment</string>
+ <string>column_item_list</string>
+ <string>a</string>
</tuple>
</value>
</item>
Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=14669&r1=14668&r2=14669&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision Fri Jun 1 16:15:08 2007
@@ -1,1 +1,1 @@
-314
+317
More information about the Erp5-report
mailing list