Commit 89ed1269 authored by Jérome Perrin's avatar Jérome Perrin

add more columns to accounting line export

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34940 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 69b28dbb
...@@ -95,6 +95,25 @@ def getTitle(document):\n ...@@ -95,6 +95,25 @@ def getTitle(document):\n
return document.getTitle()\n return document.getTitle()\n
return \'\'\n return \'\'\n
\n \n
bank_account_title_cache = dict()\n
def getBankAccountTitle(bank_account):\n
try:\n
return bank_account_title_cache[bank_account]\n
except KeyError:\n
pass\n
\n
if bank_account is not None:\n
reference = bank_account.getReference()\n
title = bank_account.getTitle()\n
if reference and reference != title:\n
value = "%s - %s" % (reference, title)\n
else:\n
value = title\n
else:\n
value = \'\'\n
bank_account_title_cache[bank_account] = value\n
return value\n
\n
accounting_currency_reference_cache = dict()\n accounting_currency_reference_cache = dict()\n
def getAccountingCurrencyReference(section_relative_url):\n def getAccountingCurrencyReference(section_relative_url):\n
try:\n try:\n
...@@ -126,9 +145,13 @@ for delivery in delivery_list:\n ...@@ -126,9 +145,13 @@ for delivery in delivery_list:\n
node_reference=getAccountReference(movement.getSource(portal_type=\'Account\')),\n node_reference=getAccountReference(movement.getSource(portal_type=\'Account\')),\n
node_title=movement.getSourceTitle(),\n node_title=movement.getSourceTitle(),\n
section_title=movement.getSourceSectionTitle(),\n section_title=movement.getSourceSectionTitle(),\n
payment_title=getBankAccountTitle(movement.getSourcePaymentValue()),\n
payment_mode=movement.getPaymentModeTranslatedTitle(),\n
mirror_section_title=movement.getDestinationSectionTitle(),\n mirror_section_title=movement.getDestinationSectionTitle(),\n
mirror_payment_title=getBankAccountTitle(movement.getDestinationPaymentValue()),\n
function_title=getTitle(movement.getSourceFunctionValue()),\n function_title=getTitle(movement.getSourceFunctionValue()),\n
project_title=getTitle(movement.getSourceProjectValue()),\n project_title=getTitle(movement.getSourceProjectValue()),\n
product_line=movement.getProductLineTranslatedTitle(),\n
date=movement.getStartDate(),\n date=movement.getStartDate(),\n
debit=movement.getSourceInventoriatedTotalAssetDebit(),\n debit=movement.getSourceInventoriatedTotalAssetDebit(),\n
credit=movement.getSourceInventoriatedTotalAssetCredit(),\n credit=movement.getSourceInventoriatedTotalAssetCredit(),\n
...@@ -140,6 +163,7 @@ for delivery in delivery_list:\n ...@@ -140,6 +163,7 @@ for delivery in delivery_list:\n
translated_portal_type=movement.getTranslatedPortalType(),\n translated_portal_type=movement.getTranslatedPortalType(),\n
parent_translated_portal_type=delivery.getTranslatedPortalType(),\n parent_translated_portal_type=delivery.getTranslatedPortalType(),\n
translated_simulation_state_title=movement.getTranslatedSimulationStateTitle(),))\n translated_simulation_state_title=movement.getTranslatedSimulationStateTitle(),))\n
\n
if delivery.portal_type == \'Internal Invoice Transaction\' or not is_source:\n if delivery.portal_type == \'Internal Invoice Transaction\' or not is_source:\n
line_list.append(Object(\n line_list.append(Object(\n
title=movement.hasTitle() and movement.getTitle() or\n title=movement.hasTitle() and movement.getTitle() or\n
...@@ -150,9 +174,13 @@ for delivery in delivery_list:\n ...@@ -150,9 +174,13 @@ for delivery in delivery_list:\n
node_reference=getAccountReference(movement.getDestination(portal_type=\'Account\')),\n node_reference=getAccountReference(movement.getDestination(portal_type=\'Account\')),\n
node_title=movement.getDestinationTitle(),\n node_title=movement.getDestinationTitle(),\n
section_title=movement.getDestinationSectionTitle(),\n section_title=movement.getDestinationSectionTitle(),\n
payment_title=getBankAccountTitle(movement.getDestinationPaymentValue()),\n
payment_mode=movement.getPaymentModeTranslatedTitle(),\n
mirror_section_title=movement.getSourceSectionTitle(),\n mirror_section_title=movement.getSourceSectionTitle(),\n
mirror_payment_title=getBankAccountTitle(movement.getSourcePaymentValue()),\n
function_title=getTitle(movement.getDestinationFunctionValue()),\n function_title=getTitle(movement.getDestinationFunctionValue()),\n
project_title=getTitle(movement.getDestinationProjectValue()),\n project_title=getTitle(movement.getDestinationProjectValue()),\n
product_line=movement.getProductLineTranslatedTitle(),\n
date=movement.getStopDate(),\n date=movement.getStopDate(),\n
debit=movement.getDestinationInventoriatedTotalAssetDebit(),\n debit=movement.getDestinationInventoriatedTotalAssetDebit(),\n
credit=movement.getDestinationInventoriatedTotalAssetCredit(),\n credit=movement.getDestinationInventoriatedTotalAssetCredit(),\n
...@@ -226,6 +254,8 @@ return line_list\n ...@@ -226,6 +254,8 @@ return line_list\n
<string>account_reference_cache</string> <string>account_reference_cache</string>
<string>getAccountReference</string> <string>getAccountReference</string>
<string>getTitle</string> <string>getTitle</string>
<string>bank_account_title_cache</string>
<string>getBankAccountTitle</string>
<string>accounting_currency_reference_cache</string> <string>accounting_currency_reference_cache</string>
<string>getAccountingCurrencyReference</string> <string>getAccountingCurrencyReference</string>
<string>portal_type</string> <string>portal_type</string>
......
...@@ -110,10 +110,22 @@ ...@@ -110,10 +110,22 @@
<string>section_title</string> <string>section_title</string>
<string>Section</string> <string>Section</string>
</tuple> </tuple>
<tuple>
<string>payment_title</string>
<string>Section Bank Account</string>
</tuple>
<tuple>
<string>payment_mode</string>
<string>Payment Mode</string>
</tuple>
<tuple> <tuple>
<string>mirror_section_title</string> <string>mirror_section_title</string>
<string>Third Party</string> <string>Third Party</string>
</tuple> </tuple>
<tuple>
<string>mirror_payment_title</string>
<string>Third Party Bank Account</string>
</tuple>
<tuple> <tuple>
<string>function_title</string> <string>function_title</string>
<string>Function</string> <string>Function</string>
...@@ -122,6 +134,10 @@ ...@@ -122,6 +134,10 @@
<string>project_title</string> <string>project_title</string>
<string>Project</string> <string>Project</string>
</tuple> </tuple>
<tuple>
<string>product_line</string>
<string>Product Line</string>
</tuple>
<tuple> <tuple>
<string>date</string> <string>date</string>
<string>Operation Date</string> <string>Operation Date</string>
......
1198 1199
\ 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