Commit 74f37ab7 authored by Jérome Perrin's avatar Jérome Perrin

support breakdown by various analytic axis in trial balance

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36233 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b3c2ac07
...@@ -100,17 +100,48 @@ if gap_uid_list:\n ...@@ -100,17 +100,48 @@ if gap_uid_list:\n
default_gap_uid=gap_uid_list)] or -1\n default_gap_uid=gap_uid_list)] or -1\n
\n \n
request.set(\'is_accounting_report\', True)\n request.set(\'is_accounting_report\', True)\n
group_analytic = request[\'group_analytic\']\n
group_analytic_uid = ()\n
\n \n
# flat_mode is a boolean that indicate wether we should use a report tree or a\n extra_columns = ()\n
# flat list of all accounts.\n if expand_accounts:\n
if request.get(\'tree_mode\', False): # TODO\n extra_columns += (\'mirror_section_title\', \'Third Party\'),\n
raise \'Tree mode no longer supported\'\n
\n \n
possible_analytic_column_list = context.AccountModule_getAnalyticColumnList()\n
for analytic in group_analytic:\n
if analytic == \'project\':\n
extra_columns += ((\'project_uid\', \'Project\', ), )\n
group_analytic_uid += (\'project_uid\',)\n
elif analytic == \'function\':\n
extra_columns += ((\'function_uid\',\n
context.AccountingTransactionLine_getFunctionBaseCategoryTitle()),)\n
group_analytic_uid += (\'function_uid\',)\n
else:\n
for analytic_column in possible_analytic_column_list:\n
if analytic_column[0] == analytic:\n
uid_key = \'strict_%s\' % analytic_column[0].replace(\'_translated_title\', \'_uid\')\n
group_analytic_uid += (uid_key, )\n
extra_columns += ((uid_key, analytic_column[1]),)\n
\n
\n
selection_columns = (\n
(\'node_id\', \'GAP Account ID\'),\n
(\'node_title\', \'Account Name\'),\n
) + extra_columns + (\n
(\'initial_debit_balance\', \'Initial Debit Balance\'),\n
(\'initial_credit_balance\', \'Initial Credit Balance\'),\n
(\'debit\', \'Debit Transactions\'),\n
(\'credit\', \'Credit Transactions\'),\n
(\'final_debit_balance\', \'Final Debit Balance\'),\n
(\'final_credit_balance\', \'Final Credit Balance\'),\n
(\'final_balance_if_debit\', \'Final Balance (Debit)\'),\n
(\'final_balance_if_credit\', \'Final Balance (Credit)\'),\n
)\n
return [ ReportSection(\n return [ ReportSection(\n
path=portal.account_module.getPhysicalPath(),\n path=portal.account_module.getPhysicalPath(),\n
level=1,\n
form_id=\'AccountModule_viewAccountListForTrialBalance\',\n form_id=\'AccountModule_viewAccountListForTrialBalance\',\n
selection_name=\'trial_balance_selection\',\n selection_name=\'trial_balance_selection\',\n
selection_columns=selection_columns,\n
selection_params=dict(show_empty_accounts=show_empty_accounts,\n selection_params=dict(show_empty_accounts=show_empty_accounts,\n
expand_accounts=expand_accounts,\n expand_accounts=expand_accounts,\n
at_date=at_date.latestTime(),\n at_date=at_date.latestTime(),\n
...@@ -123,6 +154,7 @@ return [ ReportSection(\n ...@@ -123,6 +154,7 @@ return [ ReportSection(\n
portal_type=portal_type,\n portal_type=portal_type,\n
simulation_state=simulation_state,\n simulation_state=simulation_state,\n
precision=precision,\n precision=precision,\n
group_analytic=group_analytic_uid,\n
node_uid=node_uid,\n node_uid=node_uid,\n
per_account_class_summary=\n per_account_class_summary=\n
per_account_class_summary,\n per_account_class_summary,\n
...@@ -195,6 +227,15 @@ return [ ReportSection(\n ...@@ -195,6 +227,15 @@ return [ ReportSection(\n
<string>$append0</string> <string>$append0</string>
<string>x</string> <string>x</string>
<string>True</string> <string>True</string>
<string>group_analytic</string>
<string>group_analytic_uid</string>
<string>extra_columns</string>
<string>_inplacevar_</string>
<string>possible_analytic_column_list</string>
<string>analytic</string>
<string>analytic_column</string>
<string>uid_key</string>
<string>selection_columns</string>
<string>dict</string> <string>dict</string>
</tuple> </tuple>
</value> </value>
......
...@@ -82,6 +82,7 @@ ...@@ -82,6 +82,7 @@
<string>your_from_date</string> <string>your_from_date</string>
<string>your_at_date</string> <string>your_at_date</string>
<string>your_expand_accounts</string> <string>your_expand_accounts</string>
<string>your_group_analytic</string>
<string>your_show_empty_accounts</string> <string>your_show_empty_accounts</string>
<string>your_per_account_class_summary</string> <string>your_per_account_class_summary</string>
<string>your_portal_skin</string> <string>your_portal_skin</string>
......
1268 1277
\ 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