Commit 78d1baf1 authored by Jérome Perrin's avatar Jérome Perrin

accounting: Trial Balance: add columns for initial and final balance and hide...

accounting: Trial Balance: add columns for initial and final balance and hide detailed balance columns

Add an option to display detailed balance columns
parent 5ae7e594
No related merge requests found
......@@ -374,6 +374,8 @@ for node in getInventoryList(\n
**inventory_params):\n
account_props = line_per_account.setdefault(getKey(node), dict(debit=0, credit=0))\n
total_price = node[\'total_price\'] or 0\n
account_props[\'initial_balance\'] = account_props.get(\n
\'initial_balance\', 0) + total_price\n
account_props[\'initial_debit_balance\'] = account_props.get(\n
\'initial_debit_balance\', 0) + max(total_price, 0)\n
account_props[\'initial_credit_balance\'] = account_props.get(\n
......@@ -391,6 +393,8 @@ for node in getInventoryList(\n
**inventory_params):\n
account_props = line_per_account.setdefault(getKey(node), dict(debit=0, credit=0))\n
total_price = node[\'total_price\'] or 0\n
account_props[\'initial_balance\'] = account_props.get(\n
\'initial_balance\', 0) + total_price\n
account_props[\'initial_debit_balance\'] = account_props.get(\n
\'initial_debit_balance\', 0) + max(total_price, 0)\n
account_props[\'initial_credit_balance\'] = account_props.get(\n
......@@ -679,10 +683,12 @@ for key, data in line_per_account.items():\n
node_title=node_title,\n
mirror_section_title=mirror_section_title,\n
node_relative_url=node_relative_url,\n
initial_balance=initial_debit_balance - initial_credit_balance,\n
initial_debit_balance=initial_debit_balance,\n
initial_credit_balance=initial_credit_balance,\n
debit=data[\'debit\'],\n
credit=data[\'credit\'],\n
final_balance=final_debit_balance - final_credit_balance,\n
final_debit_balance=final_debit_balance,\n
final_credit_balance=final_credit_balance,\n
final_balance_if_debit=max(closing_balance, 0),\n
......@@ -774,6 +780,7 @@ for account_class in account_class_list:\n
# summary\n
add_line(Object(node_title=Base_translateString(\'Total for class ${account_class}\',\n
mapping=dict(account_class=account_class or \'???\')),\n
initial_balance=round(initial_debit_balance - initial_credit_balance, precision),\n
initial_debit_balance=round(initial_debit_balance, precision),\n
debit=round(debit, precision),\n
final_debit_balance=round(final_debit_balance, precision),\n
......@@ -781,7 +788,8 @@ for account_class in account_class_list:\n
credit=round(credit, precision),\n
final_credit_balance=round(final_credit_balance, precision),\n
final_balance_if_debit=round(final_balance_if_debit, precision),\n
final_balance_if_credit=round(final_balance_if_credit, precision),))\n
final_balance_if_credit=round(final_balance_if_credit, precision),\n
final_balance=round(final_debit_balance - final_credit_balance, precision),))\n
\n
add_line(Object(node_title=\' \'))\n
\n
......
......@@ -56,7 +56,6 @@ from Products.ERP5Form.Report import ReportSection\n
\n
request = context.REQUEST\n
portal = context.portal_url.getPortalObject()\n
N_ = portal.Base_translateString\n
\n
at_date = request[\'at_date\']\n
from_date = request.get(\'from_date\', None)\n
......@@ -70,6 +69,7 @@ show_empty_accounts = request[\'show_empty_accounts\']\n
per_account_class_summary = request[\'per_account_class_summary\']\n
gap_root = request.get(\'gap_root\', None)\n
mirror_section_category = request.get(\'mirror_section_category_list\', None)\n
show_detailed_balance_columns = request[\'show_detailed_balance_columns\']\n
section_uid = portal.Base_getSectionUidListForSectionCategory(\n
request[\'section_category\'],\n
request[\'section_category_strict\'])\n
......@@ -130,19 +130,33 @@ for analytic in group_analytic:\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
if show_detailed_balance_columns:\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
(\'initial_debit_balance\', \'Initial Debit Balance\'),\n
(\'initial_credit_balance\', \'Initial Credit Balance\'),\n
(\'initial_balance\', \'Initial 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\', \'Final Balance\'),\n
(\'final_balance_if_debit\', \'Final Balance (Debit)\'),\n
(\'final_balance_if_credit\', \'Final Balance (Credit)\'),\n
)\n
else:\n
selection_columns = (\n
(\'node_id\', \'GAP Account ID\'),\n
(\'node_title\', \'Account Name\'),\n
) + extra_columns + (\n
(\'initial_balance\', \'Initial Balance\'),\n
(\'debit\', \'Debit Transactions\'),\n
(\'credit\', \'Credit Transactions\'),\n
(\'final_balance\', \'Final Balance\'),\n
)\n
\n
return [ ReportSection(\n
path=portal.account_module.getPhysicalPath(),\n
form_id=\'AccountModule_viewAccountListForTrialBalance\',\n
......
......@@ -62,8 +62,10 @@ final_balance_if_credit = request[\'TrialBalance.final_balance_if_credit\']\n
\n
return [ Object( initial_debit_balance=initial_debit_balance,\n
initial_credit_balance=initial_credit_balance,\n
initial_balance=initial_debit_balance-initial_credit_balance,\n
debit=debit,\n
credit=credit,\n
final_balance=(initial_debit_balance + debit) - (initial_credit_balance + credit),\n
final_debit_balance=initial_debit_balance + debit,\n
final_credit_balance=initial_credit_balance + credit,\n
final_balance_if_debit=final_balance_if_debit,\n
......
......@@ -88,6 +88,8 @@
<string>listbox_final_debit_balance</string>
<string>listbox_final_balance_if_credit</string>
<string>listbox_final_balance_if_debit</string>
<string>listbox_final_balance</string>
<string>listbox_initial_balance</string>
</list>
</value>
</item>
......
......@@ -323,6 +323,10 @@
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>anchor</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>columns</string> </key>
<value>
......@@ -335,6 +339,10 @@
<string>node_title</string>
<string>Account Name</string>
</tuple>
<tuple>
<string>initial_balance</string>
<string>Initial Balance</string>
</tuple>
<tuple>
<string>initial_debit_balance</string>
<string>Initial Debit Balance</string>
......@@ -351,6 +359,10 @@
<string>credit</string>
<string>Credit Transactions</string>
</tuple>
<tuple>
<string>final_balance</string>
<string>Final Balance</string>
</tuple>
<tuple>
<string>final_debit_balance</string>
<string>Final Debit Balance</string>
......@@ -382,6 +394,10 @@
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_display_style</string> </key>
<value> <string>table</string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
......@@ -392,6 +408,12 @@
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_style_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>domain_root_list</string> </key>
<value>
......@@ -410,6 +432,10 @@
<key> <string>editable_columns</string> </key>
<value>
<list>
<tuple>
<string>initial_balance</string>
<string>Initial Balance</string>
</tuple>
<tuple>
<string>initial_debit_balance</string>
<string>Initial Debit Balance</string>
......@@ -426,6 +452,10 @@
<string>credit</string>
<string>Credit Transactions</string>
</tuple>
<tuple>
<string>final_balance</string>
<string>Final Balance</string>
</tuple>
<tuple>
<string>final_debit_balance</string>
<string>Final Debit Balance</string>
......@@ -459,10 +489,18 @@
<list/>
</value>
</item>
<item>
<key> <string>global_search_column</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>hide_rows_on_no_search_criterion</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>lines</string> </key>
<value> <int>25</int> </value>
......@@ -483,6 +521,10 @@
<list/>
</value>
</item>
<item>
<key> <string>page_navigation_template</string> </key>
<value> <string>ListBox_viewSliderPageNavigationRenderer</string> </value>
</item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
......@@ -503,6 +545,10 @@
<key> <string>report_tree</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>row_css_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>search</string> </key>
<value> <int>0</int> </value>
......@@ -545,10 +591,22 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>style_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Accounts</string> </value>
</item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>url_columns</string> </key>
<value>
......
......@@ -93,6 +93,7 @@
<string>your_group_analytic</string>
<string>your_show_empty_accounts</string>
<string>your_per_account_class_summary</string>
<string>your_show_detailed_balance_columns</string>
<string>your_portal_skin</string>
<string>your_format</string>
<string>your_deferred_style</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="CheckBoxField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_show_detailed_balance_columns</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>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</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>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Show Detailed Balance Columns</string> </value>
</item>
</dictionary>
</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