diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getListBoxColumnList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getListBoxColumnList.xml index 85050d225fdc2b7851eb440ab4b22d8579948dfc..7bba40deaa8784f56d3dfcab2ffd7fa0bdd9295b 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getListBoxColumnList.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getListBoxColumnList.xml @@ -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> diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision index c0d6976f6b2c443c848629a9f6e5fcb8337bd30d..059361f2464e150ad36f1317b66db501364219e1 100644 --- a/bt5/erp5_accounting/bt/revision +++ b/bt5/erp5_accounting/bt/revision @@ -1 +1 @@ -314 \ No newline at end of file +317 \ No newline at end of file