Commit 8c313674 authored by Jérome Perrin's avatar Jérome Perrin

accounting: improve General Ledger

- We now have two different layouts for export and report
- Export mode uses the new merge_report_section_list parameter from erp5_ods_style
- Project is displayed as ${project_reference} - ${project_title} (in
  all reports)
- Show grouping reference & modification date
parent 62c1971a
......@@ -30,7 +30,9 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
......@@ -73,7 +75,7 @@
<key> <string>text</string> </key>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/AccountModule_viewGeneralLedgerReportDialog?your_portal_skin=ODS&your_format=
string:${object_url}/AccountModule_viewGeneralLedgerReportDialog?your_portal_skin=ODS&your_format=&your_export:int=1
]]></string> </value>
</item>
......
......@@ -30,7 +30,9 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
......
......@@ -77,7 +77,7 @@
<key> <string>text</string> </key>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/accounting_module/AccountModule_viewGeneralLedgerReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format=
string:${object_url}/accounting_module/AccountModule_viewGeneralLedgerReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format=&field_your_export:int=1
]]></string> </value>
</item>
......
......@@ -77,7 +77,7 @@
<key> <string>text</string> </key>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/accounting_module/AccountModule_viewGeneralLedgerReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format=
string:${object_url}/accounting_module/AccountModule_viewGeneralLedgerReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format=&field_your_export:int=1
]]></string> </value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return (\n
(\'Movement_getNodeGapId\', \'Account Code\'),\n
(\'node_translated_title\', \'Account Name\'),\n
(\'section_title\', \'Section\'),\n
(\'mirror_section_title\', \'Third Party\'),\n
(\'date\', \'Operation Date\'),\n
(\'modification_date\', \'Modification Date\'),\n
(\'Movement_getSpecificReference\', \'Transaction Reference\'),\n
(\'Movement_getExplanationTranslatedPortalType\', \'Type\'),\n
(\'Movement_getExplanationTitle\', \'Title\'),\n
(\'Movement_getExplanationReference\', \'Document Reference\'),\n
) + context.accounting_module.AccountModule_getAnalyticColumnList() + (\n
(\'debit_price\', \'Debit\'),\n
(\'credit_price\', \'Credit\'),\n
(\'total_price\', \'Balance\'),\n
(\'Movement_getSectionPriceCurrency\', \'Accounting Currency\'),\n
\n
(\'debit\', \'Transaction Currency Debit\'),\n
(\'credit\', \'Transaction Currency Credit\'),\n
(\'total_quantity\', \'Transaction Currency Balance\'),\n
(\'resource_reference\', \'Transaction Currency\'),\n
\n
(\'Movement_getPaymentTitle\', \'Section Bank Account\',),\n
(\'payment_mode_translated_title\', \'Payment Mode\',),\n
\n
(\'grouping_reference\', \'Grouping Reference\'),\n
(\'grouping_date\', \'Grouping Date\'),\n
(\'getTranslatedSimulationStateTitle\', \'State\'),\n
)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AccountModule_getGeneralLedgerColumnItemList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -112,6 +112,7 @@
<list>
<string>your_simulation_state</string>
<string>your_mirror_section_category_list</string>
<string>your_export</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>css_class</string>
<string>hidden</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_export</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>target</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>css_class</string> </key>
<value> <string>hidden_label</string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_checkbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Export Mode</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -101,6 +101,8 @@
<string>listbox_function</string>
<string>listbox_project</string>
<string>listbox_funding</string>
<string>listbox_modification_date</string>
<string>listbox_grouping_date</string>
</list>
</value>
</item>
......
......@@ -181,6 +181,14 @@
<string>date</string>
<string>date</string>
</tuple>
<tuple>
<string>modification_date</string>
<string>date</string>
</tuple>
<tuple>
<string>grouping_date</string>
<string>date</string>
</tuple>
<tuple>
<string>debit_price</string>
<string>debit</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Account_viewAccountingTransactionListExport</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Account_viewAccountingTransactionList</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_list</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Account</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>selection_name</string>
<string>stat_columns</string>
<string>stat_method</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox</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>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>listbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Account_viewAccountingTransactionList</string> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string>account_history_export_selection</string> </value>
</item>
<item>
<key> <string>stat_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>stat_method</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>
</ZopeData>
......@@ -63,10 +63,13 @@ if context.getPortalType() == \'Accounting Transaction Module\':\n
project_list = []\n
for project in portal.portal_catalog(\n
portal_type=\'Project\',\n
select_list=[\'relative_url\', \'title\'],\n
select_list=[\'relative_url\', \'title\', \'reference\'],\n
validation_state=(\'validated\',),\n
sort_on=((\'title\', \'ASC\'),)):\n
project_list.append((project.title, project.relative_url,))\n
if project.reference:\n
project_list.append((\'%s - %s\' % (project.reference, project.title), project.relative_url,))\n
else:\n
project_list.append((project.title, project.relative_url,))\n
\n
if not project_list:\n
return [] # returning an empty list, not to add project column on reports\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>request = container.REQUEST\n
movement = brain.getObject()\n
\n
explanation = movement.getExplanationValue()\n
\n
if movement.hasTitle():\n
title = movement.getTitle()\n
else:\n
title = explanation.getTitle()\n
\n
analytic_property_list = [explanation.getReference()]\n
\n
for property_name, property_title in request[\'analytic_column_list\']:\n
# XXX it would be a little better to reuse editable field\n
if property_name == \'project\':\n
analytic_property_list.append(brain.Movement_getProjectTitle())\n
elif property_name == \'function\':\n
analytic_property_list.append(brain.Movement_getFunctionTitle())\n
elif property_name == \'funding\':\n
analytic_property_list.append(brain.Movement_getFundingTitle())\n
else:\n
analytic_property_list.append(movement.getProperty(property_name))\n
\n
return "%s\\n%s" % (title, \', \'.join([x for x in analytic_property_list if x]))\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>brain, selection=None, **kwd</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Movement_getExplanationTitleAndAnalytics</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>if brain.payment_uid:\n
bank_account = context.getPortalObject().portal_catalog.getObject(brain.payment_uid)\n
if bank_account is not None:\n
# XXX use preference ?\n
if bank_account.getReference():\n
return \'%s - %s\' % (bank_account.getReference(), bank_account.getTitle())\n
return bank_account.getTitle()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>brain, selection=None, **kwd</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Movement_getPaymentTitle</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
This diff is collapsed.
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