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 @@ ...@@ -74,11 +74,20 @@
\n \n
If there is more than one mirror_section on lines, the listbox will have an\n If there is more than one mirror_section on lines, the listbox will have an\n
extra column showing mirror_section_title.\n extra column showing mirror_section_title.\n
The same for apply for payment / payment_reference.\n
"""\n """\n
section_dict = {None: 1}\n section_dict = {None: 1}\n
payment_dict = {None: 1}\n
for line in context.getMovementList():\n for line in context.getMovementList():\n
section_dict[line.getSourceSection()] = 1\n section_dict[line.getSourceSection()] = 1\n
section_dict[line.getDestinationSection()] = 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 \n
if context.getSourceSection() and context.getDestinationSection():\n if context.getSourceSection() and context.getDestinationSection():\n
min_section_count = 3\n min_section_count = 3\n
...@@ -88,31 +97,32 @@ else:\n ...@@ -88,31 +97,32 @@ else:\n
min_section_count = 2\n min_section_count = 2\n
\n \n
multiple_sections = len(section_dict) > min_section_count\n multiple_sections = len(section_dict) > min_section_count\n
multiple_payment = len(payment_dict) > min_payment_count\n
\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 multiple_sections:\n
if source:\n if source:\n
return ((\'id\', \'ID\'),\n a((\'getDestinationSectionTitle\', \'Third Party\'))\n
(\'source\', \'Account\'),\n
(\'getDestinationSectionTitle\', \'Third Party\'),\n
(\'source_debit\', \'Debit\'),\n
(\'source_credit\', \'Credit\'))\n
else:\n else:\n
return ((\'id\', \'ID\'),\n a((\'getSourceSectionTitle\', \'Third Party\'))\n
(\'destination\', \'Account\'),\n if multiple_payment:\n
(\'getSourceSectionTitle\', \'Third Party\'),\n
(\'destination_debit\', \'Debit\'),\n
(\'destination_credit\', \'Credit\'))\n
else:\n
if source:\n if source:\n
return ((\'id\', \'ID\'),\n a((\'getSourcePaymentReference\', \'Bank Account\'))\n
(\'source\', \'Account\'),\n
(\'source_debit\', \'Debit\'),\n
(\'source_credit\', \'Credit\'))\n
else:\n else:\n
return ((\'id\', \'ID\'),\n a((\'getDestinationPaymentReference\', \'Bank Account\'))\n
(\'destination\', \'Account\'),\n if source:\n
(\'destination_debit\', \'Debit\'),\n a((\'source_debit\', \'Debit\'))\n
(\'destination_credit\', \'Credit\'))\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> ]]></string> </value>
...@@ -166,14 +176,19 @@ else:\n ...@@ -166,14 +176,19 @@ else:\n
<string>source</string> <string>source</string>
<string>None</string> <string>None</string>
<string>section_dict</string> <string>section_dict</string>
<string>payment_dict</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>line</string> <string>line</string>
<string>_write_</string> <string>_write_</string>
<string>min_payment_count</string>
<string>min_section_count</string> <string>min_section_count</string>
<string>len</string> <string>len</string>
<string>multiple_sections</string> <string>multiple_sections</string>
<string>multiple_payment</string>
<string>column_item_list</string>
<string>a</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
314 317
\ No newline at end of file \ 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