Commit 61653bc6 authored by Jérome Perrin's avatar Jérome Perrin

dynamically show a column for bank account if a line contains a different...

dynamically show a column for bank account if a line contains a different payment that the transaction.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14669 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 67dcb1c2
......@@ -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 @@ else:\n
min_section_count = 2\n
\n
multiple_sections = len(section_dict) > min_section_count\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 @@ else:\n
<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>
......
314
\ No newline at end of file
317
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment