Commit 62506246 authored by Jérome Perrin's avatar Jérome Perrin

show currency information on the accounting line export

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34523 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 17ccd53d
...@@ -95,6 +95,19 @@ def getTitle(document):\n ...@@ -95,6 +95,19 @@ def getTitle(document):\n
return document.getTitle()\n return document.getTitle()\n
return \'\'\n return \'\'\n
\n \n
accounting_currency_reference_cache = dict()\n
def getAccountingCurrencyReference(section_relative_url):\n
try:\n
return accounting_currency_reference_cache[section_relative_url]\n
except KeyError:\n
reference = \'\'\n
if section_relative_url:\n
section = portal.restrictedTraverse(section_relative_url, None)\n
if section is not None:\n
reference = section.getProperty(\'price_currency_reference\')\n
accounting_currency_reference_cache[section_relative_url] = reference\n
return reference\n
\n
\n \n
portal_type = context.getPortalAccountingMovementTypeList()\n portal_type = context.getPortalAccountingMovementTypeList()\n
for delivery in delivery_list:\n for delivery in delivery_list:\n
...@@ -119,6 +132,11 @@ for delivery in delivery_list:\n ...@@ -119,6 +132,11 @@ for delivery in delivery_list:\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
currency=getAccountingCurrencyReference(movement.getSourceSection()),\n
debit_quantity=movement.getSourceDebit(),\n
credit_quantity=movement.getSourceCredit(),\n
resource=movement.getResourceReference(),\n
quantity_precision=movement.getQuantityPrecisionFromResource(movement.getResource()),\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
...@@ -138,6 +156,11 @@ for delivery in delivery_list:\n ...@@ -138,6 +156,11 @@ for delivery in delivery_list:\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
currency=getAccountingCurrencyReference(movement.getDestinationSection()),\n
debit_quantity=movement.getDestinationDebit(),\n
credit_quantity=movement.getDestinationCredit(),\n
resource=movement.getResourceReference(),\n
quantity_precision=movement.getQuantityPrecisionFromResource(movement.getResource()),\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
...@@ -203,6 +226,8 @@ return line_list\n ...@@ -203,6 +226,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>accounting_currency_reference_cache</string>
<string>getAccountingCurrencyReference</string>
<string>portal_type</string> <string>portal_type</string>
<string>delivery</string> <string>delivery</string>
<string>is_source</string> <string>is_source</string>
......
...@@ -95,6 +95,8 @@ ...@@ -95,6 +95,8 @@
<string>listbox_debit</string> <string>listbox_debit</string>
<string>listbox_date</string> <string>listbox_date</string>
<string>listbox_credit</string> <string>listbox_credit</string>
<string>listbox_credit_quantity</string>
<string>listbox_debit_quantity</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -134,6 +134,22 @@ ...@@ -134,6 +134,22 @@
<string>credit</string> <string>credit</string>
<string>Credit</string> <string>Credit</string>
</tuple> </tuple>
<tuple>
<string>currency</string>
<string>Accounting Currency</string>
</tuple>
<tuple>
<string>debit_quantity</string>
<string>Original Debit</string>
</tuple>
<tuple>
<string>credit_quantity</string>
<string>Original Credit</string>
</tuple>
<tuple>
<string>resource</string>
<string>Original Currency</string>
</tuple>
<tuple> <tuple>
<string>translated_portal_type</string> <string>translated_portal_type</string>
<string>Line Type</string> <string>Line Type</string>
...@@ -165,6 +181,14 @@ ...@@ -165,6 +181,14 @@
<string>credit</string> <string>credit</string>
<string>Credit</string> <string>Credit</string>
</tuple> </tuple>
<tuple>
<string>debit_quantity</string>
<string>Original Debit</string>
</tuple>
<tuple>
<string>credit_quantity</string>
<string>Original Credit</string>
</tuple>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>precision</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_credit_quantity</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_money_quantity</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>cell/quantity_precision | python:2</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>precision</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_debit_quantity</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_money_quantity</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>cell/quantity_precision | python:2</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
1171 1173
\ 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