Commit 72dfb2c4 authored by Jérome Perrin's avatar Jérome Perrin

accounting: apply the same change than GL on account statement

parent 8c313674
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>icon</string> </key> <key> <string>icon</string> </key>
...@@ -73,7 +75,7 @@ ...@@ -73,7 +75,7 @@
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
string:${object_url}/AccountModule_viewAccountStatementReportDialog?your_portal_skin=ODS&your_format= string:${object_url}/AccountModule_viewAccountStatementReportDialog?your_portal_skin=ODS&your_format=&field_your_export:int=1
]]></string> </value> ]]></string> </value>
</item> </item>
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
string:${object_url}/accounting_module/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format= string:${object_url}/accounting_module/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format=&field_your_export:int=1
]]></string> </value> ]]></string> </value>
</item> </item>
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
string:${object_url}/accounting_module/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format= string:${object_url}/accounting_module/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format=&field_your_export:int=1
]]></string> </value> ]]></string> </value>
</item> </item>
......
...@@ -90,6 +90,8 @@ period_start_date = context\\\n ...@@ -90,6 +90,8 @@ period_start_date = context\\\n
section_category=request[\'section_category\'],\n section_category=request[\'section_category\'],\n
date=from_date or at_date)\n date=from_date or at_date)\n
\n \n
export = request[\'export\']\n
\n
# Also get the currency, to know the precision\n # Also get the currency, to know the precision\n
currency = context.Base_getCurrencyForSection(request[\'section_category\'])\n currency = context.Base_getCurrencyForSection(request[\'section_category\'])\n
precision = context.account_module.getQuantityPrecisionFromResource(currency)\n precision = context.account_module.getQuantityPrecisionFromResource(currency)\n
...@@ -144,21 +146,27 @@ if hide_analytic:\n ...@@ -144,21 +146,27 @@ if hide_analytic:\n
else:\n else:\n
analytic_column_list = context.AccountModule_getAnalyticColumnList()\n analytic_column_list = context.AccountModule_getAnalyticColumnList()\n
params[\'analytic_column_list\'] = analytic_column_list\n params[\'analytic_column_list\'] = analytic_column_list\n
request.set(\'analytic_column_list\', analytic_column_list) # for Movement_getExplanationTitleAndAnalytics\n
\n \n
selection_columns = (\n selection_columns = (\n
(\'date\', \'Operation Date\'),\n
(\'Movement_getSpecificReference\', \'Transaction Reference\'),\n (\'Movement_getSpecificReference\', \'Transaction Reference\'),\n
(\'date\', \'Date\'),\n (\'Movement_getExplanationTitleAndAnalytics\', \'Title\\nReference and Analytics\' if analytic_column_list else \'Title\\nReference\'),\n
(\'Movement_getExplanationTitle\', \'Accounting Transaction Title\'), )\n )\n
if len(section_uid) > 1:\n if len(section_uid) > 1:\n
selection_columns += ( (\'section_title\', \'Section\'), )\n selection_columns += ((\'section_title\', \'Section\'),)\n
selection_columns += analytic_column_list\n
if not mirror_section:\n
selection_columns += ( (\'Movement_getMirrorSectionTitle\', \'Third Party\'), )\n
selection_columns += (\n selection_columns += (\n
(\'Movement_getExplanationReference\', \'Document Reference\'),\n
(\'debit_price\', \'Debit\'),\n (\'debit_price\', \'Debit\'),\n
(\'credit_price\', \'Credit\'),\n (\'credit_price\', \'Credit\'),\n
(\'running_total_price\', \'Net\'),)\n (\'running_total_price\', \'Running Balance\'),\n
(\'grouping_reference\', \'Grouping Reference\'),\n
(\'grouping_date\', \'Grouping Date\'),\n
(\'modification_date\', \'Modification Date\'),\n
(\'getTranslatedSimulationStateTitle\', \'State\'),\n
)\n
\n
if export:\n
selection_columns = context.AccountModule_getGeneralLedgerColumnItemList()\n
\n \n
report_section_list = []\n report_section_list = []\n
if from_date and detailed_from_date_summary:\n if from_date and detailed_from_date_summary:\n
...@@ -185,7 +193,7 @@ if from_date and detailed_from_date_summary:\n ...@@ -185,7 +193,7 @@ if from_date and detailed_from_date_summary:\n
report_section_list.append(\n report_section_list.append(\n
ReportSection(\n ReportSection(\n
path=node,\n path=node,\n
form_id=\'Account_viewAccountingTransactionList\',\n form_id=\'Account_viewAccountingTransactionListExport\' if export else \'Account_viewAccountingTransactionList\',\n
selection_name=\'account_preference_selection\',\n selection_name=\'account_preference_selection\',\n
selection_params=params,\n selection_params=params,\n
selection_columns=selection_columns,\n selection_columns=selection_columns,\n
......
...@@ -112,6 +112,7 @@ ...@@ -112,6 +112,7 @@
<list> <list>
<string>your_simulation_state</string> <string>your_simulation_state</string>
<string>your_portal_type</string> <string>your_portal_type</string>
<string>your_export</string>
</list> </list>
</value> </value>
</item> </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>
...@@ -51,12 +51,9 @@ ...@@ -51,12 +51,9 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.PythonScripts.standard import Object\n <value> <string>from Products.PythonScripts.standard import Object\n
from Products.ERP5Type.Document import newTempBase\n
from Products.ERP5Type.Message import Message\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
getObject = portal.portal_catalog.getObject\n getObject = portal.portal_catalog.getObject\n
params = portal.ERP5Accounting_getParams(selection_name)\n params = portal.ERP5Accounting_getParams(selection_name)\n
N_ = lambda msg: Message(\'erp5_ui\', msg)\n
\n \n
# this also prevents to be called directly\n # this also prevents to be called directly\n
assert \'node_uid\' in kw\n assert \'node_uid\' in kw\n
...@@ -141,31 +138,14 @@ for brain in portal.Base_zGetNotGroupedMovementList(\n ...@@ -141,31 +138,14 @@ for brain in portal.Base_zGetNotGroupedMovementList(\n
total_price=brain.total_price,\n total_price=brain.total_price,\n
date=brain.date,\n date=brain.date,\n
Movement_getSpecificReference=specific_reference,\n Movement_getSpecificReference=specific_reference,\n
Movement_getMirrorSectionTitle=mirror_section_title,\n mirror_section_title=mirror_section_title,\n
section_title=section_title,\n section_title=section_title,\n
debit=debit,\n debit=debit,\n
credit=credit,\n credit=credit,\n
debit_price=debit_price,\n debit_price=debit_price,\n
credit_price=credit_price,\n credit_price=credit_price,\n
Movement_getExplanationTitle=\n Movement_getExplanationTitleAndAnalytics=brain.Movement_getExplanationTitleAndAnalytics(brain))\n
mvt.hasTitle() and mvt.getTitle() or transaction.getTitle())\n
\n \n
analytic_info = {}\n
for analytic_column, analytic_column_title in analytic_column_list:\n
if analytic_column == \'project\':\n
if is_source:\n
analytic_info[\'project\'] = mvt.asContext(project_uid=mvt.getSourceProjectUid()).Movement_getProjectTitle()\n
else:\n
analytic_info[\'project\'] = mvt.asContext(project_uid=mvt.getDestinationProjectUid()).Movement_getProjectTitle()\n
elif analytic_column == \'function\':\n
if is_source:\n
analytic_info[\'function\'] = mvt.asContext(function_uid=mvt.getDestinationFunctionUid()).Movement_getFunctionTitle()\n
else:\n
analytic_info[\'function\'] = mvt.asContext(function_uid=mvt.getDestinationFunctionUid()).Movement_getFunctionTitle()\n
else:\n
analytic_info[analytic_column] = mvt.getProperty(analytic_column)\n
\n
line.update(analytic_info)\n
line_list.append(line)\n line_list.append(line)\n
\n \n
\n \n
......
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