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
...@@ -374,6 +374,8 @@ for node in getInventoryList(\n ...@@ -374,6 +374,8 @@ for node in getInventoryList(\n
**inventory_params):\n **inventory_params):\n
account_props = line_per_account.setdefault(getKey(node), dict(debit=0, credit=0))\n account_props = line_per_account.setdefault(getKey(node), dict(debit=0, credit=0))\n
total_price = node[\'total_price\'] or 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 account_props[\'initial_debit_balance\'] = account_props.get(\n
\'initial_debit_balance\', 0) + max(total_price, 0)\n \'initial_debit_balance\', 0) + max(total_price, 0)\n
account_props[\'initial_credit_balance\'] = account_props.get(\n account_props[\'initial_credit_balance\'] = account_props.get(\n
...@@ -391,6 +393,8 @@ for node in getInventoryList(\n ...@@ -391,6 +393,8 @@ for node in getInventoryList(\n
**inventory_params):\n **inventory_params):\n
account_props = line_per_account.setdefault(getKey(node), dict(debit=0, credit=0))\n account_props = line_per_account.setdefault(getKey(node), dict(debit=0, credit=0))\n
total_price = node[\'total_price\'] or 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 account_props[\'initial_debit_balance\'] = account_props.get(\n
\'initial_debit_balance\', 0) + max(total_price, 0)\n \'initial_debit_balance\', 0) + max(total_price, 0)\n
account_props[\'initial_credit_balance\'] = account_props.get(\n account_props[\'initial_credit_balance\'] = account_props.get(\n
...@@ -679,10 +683,12 @@ for key, data in line_per_account.items():\n ...@@ -679,10 +683,12 @@ for key, data in line_per_account.items():\n
node_title=node_title,\n node_title=node_title,\n
mirror_section_title=mirror_section_title,\n mirror_section_title=mirror_section_title,\n
node_relative_url=node_relative_url,\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_debit_balance=initial_debit_balance,\n
initial_credit_balance=initial_credit_balance,\n initial_credit_balance=initial_credit_balance,\n
debit=data[\'debit\'],\n debit=data[\'debit\'],\n
credit=data[\'credit\'],\n credit=data[\'credit\'],\n
final_balance=final_debit_balance - final_credit_balance,\n
final_debit_balance=final_debit_balance,\n final_debit_balance=final_debit_balance,\n
final_credit_balance=final_credit_balance,\n final_credit_balance=final_credit_balance,\n
final_balance_if_debit=max(closing_balance, 0),\n final_balance_if_debit=max(closing_balance, 0),\n
...@@ -774,6 +780,7 @@ for account_class in account_class_list:\n ...@@ -774,6 +780,7 @@ for account_class in account_class_list:\n
# summary\n # summary\n
add_line(Object(node_title=Base_translateString(\'Total for class ${account_class}\',\n add_line(Object(node_title=Base_translateString(\'Total for class ${account_class}\',\n
mapping=dict(account_class=account_class or \'???\')),\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 initial_debit_balance=round(initial_debit_balance, precision),\n
debit=round(debit, precision),\n debit=round(debit, precision),\n
final_debit_balance=round(final_debit_balance, precision),\n final_debit_balance=round(final_debit_balance, precision),\n
...@@ -781,7 +788,8 @@ for account_class in account_class_list:\n ...@@ -781,7 +788,8 @@ for account_class in account_class_list:\n
credit=round(credit, precision),\n credit=round(credit, precision),\n
final_credit_balance=round(final_credit_balance, 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_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 \n
add_line(Object(node_title=\' \'))\n add_line(Object(node_title=\' \'))\n
\n \n
......
...@@ -56,7 +56,6 @@ from Products.ERP5Form.Report import ReportSection\n ...@@ -56,7 +56,6 @@ from Products.ERP5Form.Report import ReportSection\n
\n \n
request = context.REQUEST\n request = context.REQUEST\n
portal = context.portal_url.getPortalObject()\n portal = context.portal_url.getPortalObject()\n
N_ = portal.Base_translateString\n
\n \n
at_date = request[\'at_date\']\n at_date = request[\'at_date\']\n
from_date = request.get(\'from_date\', None)\n from_date = request.get(\'from_date\', None)\n
...@@ -70,6 +69,7 @@ show_empty_accounts = request[\'show_empty_accounts\']\n ...@@ -70,6 +69,7 @@ show_empty_accounts = request[\'show_empty_accounts\']\n
per_account_class_summary = request[\'per_account_class_summary\']\n per_account_class_summary = request[\'per_account_class_summary\']\n
gap_root = request.get(\'gap_root\', None)\n gap_root = request.get(\'gap_root\', None)\n
mirror_section_category = request.get(\'mirror_section_category_list\', 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 section_uid = portal.Base_getSectionUidListForSectionCategory(\n
request[\'section_category\'],\n request[\'section_category\'],\n
request[\'section_category_strict\'])\n request[\'section_category_strict\'])\n
...@@ -130,19 +130,33 @@ for analytic in group_analytic:\n ...@@ -130,19 +130,33 @@ for analytic in group_analytic:\n
extra_columns += ((uid_key, analytic_column[1]),)\n extra_columns += ((uid_key, analytic_column[1]),)\n
\n \n
\n \n
selection_columns = (\n if show_detailed_balance_columns:\n
selection_columns = (\n
(\'node_id\', \'GAP Account ID\'),\n (\'node_id\', \'GAP Account ID\'),\n
(\'node_title\', \'Account Name\'),\n (\'node_title\', \'Account Name\'),\n
) + extra_columns + (\n ) + extra_columns + (\n
(\'initial_debit_balance\', \'Initial Debit Balance\'),\n (\'initial_debit_balance\', \'Initial Debit Balance\'),\n
(\'initial_credit_balance\', \'Initial Credit Balance\'),\n (\'initial_credit_balance\', \'Initial Credit Balance\'),\n
(\'initial_balance\', \'Initial Balance\'),\n
(\'debit\', \'Debit Transactions\'),\n (\'debit\', \'Debit Transactions\'),\n
(\'credit\', \'Credit Transactions\'),\n (\'credit\', \'Credit Transactions\'),\n
(\'final_debit_balance\', \'Final Debit Balance\'),\n (\'final_debit_balance\', \'Final Debit Balance\'),\n
(\'final_credit_balance\', \'Final Credit 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_debit\', \'Final Balance (Debit)\'),\n
(\'final_balance_if_credit\', \'Final Balance (Credit)\'),\n (\'final_balance_if_credit\', \'Final Balance (Credit)\'),\n
)\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 return [ ReportSection(\n
path=portal.account_module.getPhysicalPath(),\n path=portal.account_module.getPhysicalPath(),\n
form_id=\'AccountModule_viewAccountListForTrialBalance\',\n form_id=\'AccountModule_viewAccountListForTrialBalance\',\n
......
...@@ -62,8 +62,10 @@ final_balance_if_credit = request[\'TrialBalance.final_balance_if_credit\']\n ...@@ -62,8 +62,10 @@ final_balance_if_credit = request[\'TrialBalance.final_balance_if_credit\']\n
\n \n
return [ Object( initial_debit_balance=initial_debit_balance,\n return [ Object( initial_debit_balance=initial_debit_balance,\n
initial_credit_balance=initial_credit_balance,\n initial_credit_balance=initial_credit_balance,\n
initial_balance=initial_debit_balance-initial_credit_balance,\n
debit=debit,\n debit=debit,\n
credit=credit,\n credit=credit,\n
final_balance=(initial_debit_balance + debit) - (initial_credit_balance + credit),\n
final_debit_balance=initial_debit_balance + debit,\n final_debit_balance=initial_debit_balance + debit,\n
final_credit_balance=initial_credit_balance + credit,\n final_credit_balance=initial_credit_balance + credit,\n
final_balance_if_debit=final_balance_if_debit,\n final_balance_if_debit=final_balance_if_debit,\n
......
...@@ -88,6 +88,8 @@ ...@@ -88,6 +88,8 @@
<string>listbox_final_debit_balance</string> <string>listbox_final_debit_balance</string>
<string>listbox_final_balance_if_credit</string> <string>listbox_final_balance_if_credit</string>
<string>listbox_final_balance_if_debit</string> <string>listbox_final_balance_if_debit</string>
<string>listbox_final_balance</string>
<string>listbox_initial_balance</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -323,6 +323,10 @@ ...@@ -323,6 +323,10 @@
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>anchor</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <value>
...@@ -335,6 +339,10 @@ ...@@ -335,6 +339,10 @@
<string>node_title</string> <string>node_title</string>
<string>Account Name</string> <string>Account Name</string>
</tuple> </tuple>
<tuple>
<string>initial_balance</string>
<string>Initial Balance</string>
</tuple>
<tuple> <tuple>
<string>initial_debit_balance</string> <string>initial_debit_balance</string>
<string>Initial Debit Balance</string> <string>Initial Debit Balance</string>
...@@ -351,6 +359,10 @@ ...@@ -351,6 +359,10 @@
<string>credit</string> <string>credit</string>
<string>Credit Transactions</string> <string>Credit Transactions</string>
</tuple> </tuple>
<tuple>
<string>final_balance</string>
<string>Final Balance</string>
</tuple>
<tuple> <tuple>
<string>final_debit_balance</string> <string>final_debit_balance</string>
<string>Final Debit Balance</string> <string>Final Debit Balance</string>
...@@ -382,6 +394,10 @@ ...@@ -382,6 +394,10 @@
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>default_display_style</string> </key>
<value> <string>table</string> </value>
</item>
<item> <item>
<key> <string>default_params</string> </key> <key> <string>default_params</string> </key>
<value> <value>
...@@ -392,6 +408,12 @@ ...@@ -392,6 +408,12 @@
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>display_style_list</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>domain_root_list</string> </key> <key> <string>domain_root_list</string> </key>
<value> <value>
...@@ -410,6 +432,10 @@ ...@@ -410,6 +432,10 @@
<key> <string>editable_columns</string> </key> <key> <string>editable_columns</string> </key>
<value> <value>
<list> <list>
<tuple>
<string>initial_balance</string>
<string>Initial Balance</string>
</tuple>
<tuple> <tuple>
<string>initial_debit_balance</string> <string>initial_debit_balance</string>
<string>Initial Debit Balance</string> <string>Initial Debit Balance</string>
...@@ -426,6 +452,10 @@ ...@@ -426,6 +452,10 @@
<string>credit</string> <string>credit</string>
<string>Credit Transactions</string> <string>Credit Transactions</string>
</tuple> </tuple>
<tuple>
<string>final_balance</string>
<string>Final Balance</string>
</tuple>
<tuple> <tuple>
<string>final_debit_balance</string> <string>final_debit_balance</string>
<string>Final Debit Balance</string> <string>Final Debit Balance</string>
...@@ -459,10 +489,18 @@ ...@@ -459,10 +489,18 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>global_search_column</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item>
<key> <string>hide_rows_on_no_search_criterion</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>lines</string> </key> <key> <string>lines</string> </key>
<value> <int>25</int> </value> <value> <int>25</int> </value>
...@@ -483,6 +521,10 @@ ...@@ -483,6 +521,10 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>page_navigation_template</string> </key>
<value> <string>ListBox_viewSliderPageNavigationRenderer</string> </value>
</item>
<item> <item>
<key> <string>page_template</string> </key> <key> <string>page_template</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -503,6 +545,10 @@ ...@@ -503,6 +545,10 @@
<key> <string>report_tree</string> </key> <key> <string>report_tree</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item>
<key> <string>row_css_method</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>search</string> </key> <key> <string>search</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -545,10 +591,22 @@ ...@@ -545,10 +591,22 @@
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>style_columns</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Accounts</string> </value> <value> <string>Accounts</string> </value>
</item> </item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>url_columns</string> </key> <key> <string>url_columns</string> </key>
<value> <value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="FloatField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_final_balance</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>
<item>
<key> <string>not_float</string> </key>
<value> <string>You did not enter a floating point number.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</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>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</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>input_style</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</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>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</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>input_style</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>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</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>figure</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>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</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>input_style</string> </key>
<value> <string>-1 234.5</string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Final Balance</string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>request/precision | python: 2</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="FloatField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_initial_balance</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>
<item>
<key> <string>not_float</string> </key>
<value> <string>You did not enter a floating point number.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</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>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</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>input_style</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</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>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</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>input_style</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>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</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>figure</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>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</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>input_style</string> </key>
<value> <string>-1 234.5</string> </value>
</item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Initial Balance</string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>request/precision | python: 2</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
<string>your_group_analytic</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_show_detailed_balance_columns</string>
<string>your_portal_skin</string> <string>your_portal_skin</string>
<string>your_format</string> <string>your_format</string>
<string>your_deferred_style</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>
...@@ -2161,6 +2161,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2161,6 +2161,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['show_empty_accounts'] = 1 request_form['show_empty_accounts'] = 1
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['show_detailed_balance_columns'] = 1
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
self.portal.accounting_module, self.portal.accounting_module,
...@@ -2179,75 +2180,157 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2179,75 +2180,157 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
len(data_line_list)) len(data_line_list))
self.assertEqual(['node_id', 'node_title', self.assertEqual(['node_id', 'node_title',
'initial_debit_balance', 'initial_credit_balance', 'debit', 'initial_debit_balance', 'initial_credit_balance',
'credit', 'final_debit_balance', 'final_credit_balance', 'initial_balance', 'debit', 'credit', 'final_debit_balance',
'final_balance_if_debit', 'final_balance_if_credit'], 'final_credit_balance', 'final_balance', 'final_balance_if_debit',
'final_balance_if_credit'],
data_line_list[0].column_id_list) data_line_list[0].column_id_list)
# account are sorted by GAP Id # account are sorted by GAP Id
self.checkLineProperties(data_line_list[0], node_id='1', self.checkLineProperties(data_line_list[0], node_id='1',
node_title='Equity', initial_debit_balance=0, initial_credit_balance=0, node_title='Equity', initial_debit_balance=0, initial_credit_balance=0,
debit=0, credit=0, final_debit_balance=0, final_credit_balance=0, initial_balance=0, debit=0, credit=0, final_debit_balance=0,
final_balance_if_debit=0, final_balance_if_credit=0) final_credit_balance=0, final_balance=0, final_balance_if_debit=0,
final_balance_if_credit=0)
self.checkLineProperties(data_line_list[1], node_id='2', self.checkLineProperties(data_line_list[1], node_id='2',
node_title='Fixed Assets', initial_debit_balance=0, node_title='Fixed Assets', initial_debit_balance=0,
initial_credit_balance=0, debit=0, credit=0, final_debit_balance=0, initial_credit_balance=0, initial_balance=0, debit=0, credit=0,
final_credit_balance=0, final_balance_if_debit=0, final_debit_balance=0, final_credit_balance=0, final_balance=0,
final_balance_if_credit=0) final_balance_if_debit=0, final_balance_if_credit=0)
self.checkLineProperties(data_line_list[2], node_id='3', self.checkLineProperties(data_line_list[2], node_id='3',
node_title='Stocks', initial_debit_balance=0, initial_credit_balance=0, node_title='Stocks', initial_debit_balance=0, initial_credit_balance=0,
debit=0, credit=0, final_debit_balance=0, final_credit_balance=0, initial_balance=0, debit=0, credit=0, final_debit_balance=0,
final_balance_if_debit=0, final_balance_if_credit=0) final_credit_balance=0, final_balance=0, final_balance_if_debit=0,
final_balance_if_credit=0)
self.checkLineProperties(data_line_list[3], node_id='40', self.checkLineProperties(data_line_list[3], node_id='40',
node_title='Payable', initial_debit_balance=0, initial_credit_balance=0, node_title='Payable', initial_debit_balance=0,
debit=200, credit=100, final_debit_balance=200, final_credit_balance=100, initial_credit_balance=0, initial_balance=0, debit=200, credit=100,
final_debit_balance=200, final_credit_balance=100, final_balance=100,
final_balance_if_debit=100, final_balance_if_credit=0,) final_balance_if_debit=100, final_balance_if_credit=0,)
self.checkLineProperties(data_line_list[4], node_id='41', self.checkLineProperties(data_line_list[4], node_id='41',
node_title='Receivable', initial_debit_balance=0, node_title='Receivable', initial_debit_balance=0,
initial_credit_balance=0, debit=3400, credit=200, initial_credit_balance=0, initial_balance=0, debit=3400, credit=200,
final_debit_balance=3400, final_credit_balance=200, final_debit_balance=3400, final_credit_balance=200, final_balance=3200,
final_balance_if_debit=3200, final_balance_if_credit=0,) final_balance_if_debit=3200, final_balance_if_credit=0,)
self.checkLineProperties(data_line_list[5], node_id='4456', self.checkLineProperties(data_line_list[5], node_id='4456',
node_title='Refundable VAT 10%', initial_debit_balance=0, node_title='Refundable VAT 10%', initial_debit_balance=0,
initial_credit_balance=0, debit=0, credit=0, final_debit_balance=0, initial_credit_balance=0, initial_balance=0, debit=0, credit=0,
final_credit_balance=0, final_balance_if_debit=0, final_debit_balance=0, final_credit_balance=0, final_balance=0,
final_balance_if_credit=0) final_balance_if_debit=0, final_balance_if_credit=0)
self.checkLineProperties(data_line_list[6], node_id='4457', self.checkLineProperties(data_line_list[6], node_id='4457',
node_title='Collected VAT 10%', initial_debit_balance=0, node_title='Collected VAT 10%', initial_debit_balance=0,
initial_credit_balance=0, debit=0, credit=0, final_debit_balance=0, initial_credit_balance=0, initial_balance=0, debit=0, credit=0,
final_credit_balance=0, final_balance_if_debit=0, final_debit_balance=0, final_credit_balance=0, final_balance=0,
final_balance_if_credit=0) final_balance_if_debit=0, final_balance_if_credit=0)
self.checkLineProperties(data_line_list[7], node_id='5', self.checkLineProperties(data_line_list[7], node_id='5',
node_title='Bank (Bank1)', initial_debit_balance=0, node_title='Bank (Bank1)', initial_debit_balance=0,
initial_credit_balance=0, debit=0, credit=3300, final_debit_balance=0, initial_credit_balance=0, initial_balance=0, debit=0, credit=3300,
final_credit_balance=3300, final_balance_if_debit=0, final_debit_balance=0, final_credit_balance=3300, final_balance=-3300,
final_balance_if_credit=3300,) final_balance_if_debit=0, final_balance_if_credit=3300,)
self.checkLineProperties(data_line_list[8], node_id='6', self.checkLineProperties(data_line_list[8], node_id='6',
node_title='Goods Purchase', initial_debit_balance=0, node_title='Goods Purchase', initial_debit_balance=0,
initial_credit_balance=0, debit=0, credit=0, final_debit_balance=0, initial_credit_balance=0, initial_balance=0, debit=0, credit=0,
final_credit_balance=0, final_balance_if_debit=0, final_debit_balance=0, final_credit_balance=0, final_balance=0,
final_balance_if_credit=0) final_balance_if_debit=0, final_balance_if_credit=0)
self.checkLineProperties(data_line_list[9], node_id='7', self.checkLineProperties(data_line_list[9], node_id='7',
node_title='Goods Sales', initial_debit_balance=0, node_title='Goods Sales', initial_debit_balance=0,
initial_credit_balance=0, debit=0, credit=0, final_debit_balance=0, initial_credit_balance=0, initial_balance=0, debit=0, credit=0,
final_credit_balance=0, final_balance_if_debit=0, final_debit_balance=0, final_credit_balance=0, final_balance=0,
final_balance_if_credit=0) final_balance_if_debit=0, final_balance_if_credit=0)
self.assertTrue(line_list[-1].isStatLine()) self.assertTrue(line_list[-1].isStatLine())
self.checkLineProperties(line_list[-1], node_id=None, node_title=None, self.checkLineProperties(line_list[-1], node_id=None, node_title=None,
initial_debit_balance=0, initial_credit_balance=0, debit=3600, initial_debit_balance=0, initial_credit_balance=0, initial_balance=0,
credit=3600, final_debit_balance=3600, final_credit_balance=3600, debit=3600, credit=3600, final_debit_balance=3600,
final_credit_balance=3600, final_balance=0,
final_balance_if_debit=3300, final_balance_if_credit=3300) final_balance_if_debit=3300, final_balance_if_credit=3300)
def testTrialBalanceNoDetailedBalanceColumns(self):
# Simple test of trial balance with option "show_detailed_balance_columns"
# turned off.
# we will use the same data set as account statement
self.createAccountStatementDataSet(use_two_bank_accounts=0)
# set request variables and render
request_form = self.portal.REQUEST.form
request_form['from_date'] = DateTime(2006, 1, 1)
request_form['at_date'] = DateTime(2006, 12, 31)
request_form['section_category'] = 'group/demo_group'
request_form['section_category_strict'] = False
request_form['simulation_state'] = ['stopped', 'delivered']
request_form['show_empty_accounts'] = 1
request_form['expand_accounts'] = 0
request_form['per_account_class_summary'] = 0
request_form['show_detailed_balance_columns'] = 0
report_section_list = self.getReportSectionList(
self.portal.accounting_module,
'AccountModule_viewTrialBalanceReport')
self.assertEqual(1, len(report_section_list))
line_list = self.getListBoxLineList(report_section_list[0])
data_line_list = [l for l in line_list if l.isDataLine()]
self.assertEqual(
['node_id', 'node_title', 'initial_balance', 'debit', 'credit',
'final_balance', ],
data_line_list[0].column_id_list)
# account are sorted by GAP Id
self.checkLineProperties(data_line_list[0], node_id='1',
node_title='Equity', initial_balance=0, debit=0, credit=0,
final_balance=0)
self.checkLineProperties(data_line_list[1], node_id='2',
node_title='Fixed Assets', initial_balance=0, debit=0, credit=0,
final_balance=0)
self.checkLineProperties(data_line_list[2], node_id='3',
node_title='Stocks', initial_balance=0, debit=0, credit=0,
final_balance=0)
self.checkLineProperties(data_line_list[3], node_id='40',
node_title='Payable',
initial_balance=0, debit=200, credit=100,
final_balance=100)
self.checkLineProperties(data_line_list[4], node_id='41',
node_title='Receivable',
initial_balance=0, debit=3400, credit=200,
final_balance=3200)
self.checkLineProperties(data_line_list[5], node_id='4456',
node_title='Refundable VAT 10%', initial_balance=0, debit=0, credit=0,
final_balance=0)
self.checkLineProperties(data_line_list[6], node_id='4457',
node_title='Collected VAT 10%', initial_balance=0, debit=0, credit=0,
final_balance=0)
self.checkLineProperties(data_line_list[7], node_id='5',
node_title='Bank (Bank1)', initial_balance=0, debit=0, credit=3300,
final_balance=-3300)
self.checkLineProperties(data_line_list[8], node_id='6',
node_title='Goods Purchase', initial_balance=0, debit=0, credit=0,
final_balance=0)
self.checkLineProperties(data_line_list[9], node_id='7',
node_title='Goods Sales', initial_balance=0, debit=0, credit=0,
final_balance=0)
self.assertTrue(line_list[-1].isStatLine())
self.checkLineProperties(line_list[-1], node_id=None, node_title=None,
initial_balance=0, debit=3600, credit=3600, final_balance=0)
def testTrialBalanceMultipleSection(self): def testTrialBalanceMultipleSection(self):
account_module = self.portal.account_module account_module = self.portal.account_module
t1 = self._makeOne( t1 = self._makeOne(
...@@ -2286,6 +2369,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2286,6 +2369,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['group_analytic'] = ["section"] request_form['group_analytic'] = ["section"]
request_form['show_detailed_balance_columns'] = 1
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
self.portal.accounting_module, self.portal.accounting_module,
...@@ -2296,8 +2380,9 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2296,8 +2380,9 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
self.assertEqual(['node_id', 'node_title', self.assertEqual(['node_id', 'node_title',
'section_uid', 'Movement_getSectionPriceCurrency', 'section_uid', 'Movement_getSectionPriceCurrency',
'initial_debit_balance', 'initial_credit_balance', 'debit', 'initial_debit_balance', 'initial_credit_balance',
'credit', 'final_debit_balance', 'final_credit_balance', 'initial_balance', 'debit', 'credit', 'final_debit_balance',
'final_credit_balance', 'final_balance',
'final_balance_if_debit', 'final_balance_if_credit'], 'final_balance_if_debit', 'final_balance_if_credit'],
data_line_list[0].column_id_list) data_line_list[0].column_id_list)
...@@ -2348,6 +2433,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2348,6 +2433,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['expand_accounts'] = 1 request_form['expand_accounts'] = 1
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['group_analytic'] = [] request_form['group_analytic'] = []
request_form['show_detailed_balance_columns'] = 1
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
self.portal.accounting_module, self.portal.accounting_module,
...@@ -2359,9 +2445,10 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2359,9 +2445,10 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
self.assertEqual(6, len(data_line_list)) self.assertEqual(6, len(data_line_list))
self.assertEqual(['node_id', 'node_title', 'mirror_section_title', self.assertEqual(['node_id', 'node_title', 'mirror_section_title',
'initial_debit_balance', 'initial_credit_balance', 'debit', 'credit', 'initial_debit_balance', 'initial_credit_balance', 'initial_balance',
'final_debit_balance', 'final_credit_balance', 'final_balance_if_debit', 'debit', 'credit', 'final_debit_balance', 'final_credit_balance',
'final_balance_if_credit'], data_line_list[0].column_id_list) 'final_balance', 'final_balance_if_debit', 'final_balance_if_credit'],
data_line_list[0].column_id_list)
# account are sorted by GAP Id # account are sorted by GAP Id
self.checkLineProperties(data_line_list[0], node_id='40', self.checkLineProperties(data_line_list[0], node_id='40',
...@@ -2466,6 +2553,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2466,6 +2553,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['show_empty_accounts'] = 0 request_form['show_empty_accounts'] = 0
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['show_detailed_balance_columns'] = 1
request_form['group_analytic'] = [] request_form['group_analytic'] = []
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
...@@ -2481,38 +2569,41 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2481,38 +2569,41 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
# TODO: sort by "gap normalized path" # TODO: sort by "gap normalized path"
self.checkLineProperties(data_line_list[0], node_id='1', self.checkLineProperties(data_line_list[0], node_id='1',
node_title='Equity', initial_debit_balance=200, node_title='Equity', initial_debit_balance=200,
initial_credit_balance=0, debit=0, credit=0, initial_credit_balance=0, initial_balance=200, debit=0, credit=0,
final_debit_balance=200, final_credit_balance=0, final_debit_balance=200, final_credit_balance=0, final_balance=200,
final_balance_if_debit=200, final_balance_if_credit=0) final_balance_if_debit=200, final_balance_if_credit=0)
self.checkLineProperties(data_line_list[1], node_id='40', self.checkLineProperties(data_line_list[1], node_id='40',
node_title='Payable', initial_debit_balance=0, node_title='Payable', initial_debit_balance=0,
initial_credit_balance=600, debit=200, credit=100, initial_credit_balance=600, initial_balance=-600, debit=200,
final_debit_balance=200, final_credit_balance=700, credit=100, final_debit_balance=200, final_credit_balance=700,
final_balance_if_debit=0, final_balance_if_credit=500) final_balance=-500, final_balance_if_debit=0,
final_balance_if_credit=500)
self.checkLineProperties(data_line_list[2], node_id='41', self.checkLineProperties(data_line_list[2], node_id='41',
node_title='Receivable', initial_debit_balance=400, node_title='Receivable', initial_debit_balance=400,
initial_credit_balance=0, debit=1950, credit=200, initial_credit_balance=0, initial_balance=400, debit=1950, credit=200,
final_debit_balance=2350, final_credit_balance=200, final_debit_balance=2350, final_credit_balance=200, final_balance=2150,
final_balance_if_debit=2150, final_balance_if_credit=0) final_balance_if_debit=2150, final_balance_if_credit=0)
self.checkLineProperties(data_line_list[3], node_id='5', self.checkLineProperties(data_line_list[3], node_id='5',
node_title='Bank (Bank1)', initial_debit_balance=0, node_title='Bank (Bank1)', initial_debit_balance=0,
initial_credit_balance=0, debit=0, credit=1800, initial_credit_balance=0, initial_balance=0, debit=0, credit=1800,
final_debit_balance=0, final_credit_balance=1800, final_debit_balance=0, final_credit_balance=1800, final_balance=-1800,
final_balance_if_debit=0, final_balance_if_credit=1800,) final_balance_if_debit=0, final_balance_if_credit=1800,)
self.checkLineProperties(data_line_list[4], node_id='7', self.checkLineProperties(data_line_list[4], node_id='7',
node_title='Goods Sales', initial_debit_balance=0, node_title='Goods Sales', initial_debit_balance=0,
initial_credit_balance=0, debit=0, credit=50, initial_credit_balance=0, initial_balance=0, debit=0, credit=50,
final_debit_balance=0, final_credit_balance=50, final_debit_balance=0, final_credit_balance=50, final_balance=-50,
final_balance_if_debit=0, final_balance_if_credit=50,) final_balance_if_debit=0, final_balance_if_credit=50,)
self.assertTrue(line_list[-1].isStatLine()) self.assertTrue(line_list[-1].isStatLine())
self.checkLineProperties(line_list[-1], node_id=None, node_title=None, self.checkLineProperties(line_list[-1], node_id=None, node_title=None,
initial_debit_balance=600, initial_credit_balance=600, debit=2150, initial_debit_balance=600, initial_credit_balance=600,
initial_balance=0, debit=2150,
credit=2150, final_debit_balance=2750, final_credit_balance=2750, credit=2150, final_debit_balance=2750, final_credit_balance=2750,
final_balance=0,
final_balance_if_debit=2350, final_balance_if_credit=2350) final_balance_if_debit=2350, final_balance_if_credit=2350)
def testTrialBalanceInitialBalance(self): def testTrialBalanceInitialBalance(self):
...@@ -2552,6 +2643,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2552,6 +2643,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['show_empty_accounts'] = 0 request_form['show_empty_accounts'] = 0
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['show_detailed_balance_columns'] = 1
request_form['group_analytic'] = [] request_form['group_analytic'] = []
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
...@@ -2618,6 +2710,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2618,6 +2710,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['show_empty_accounts'] = 0 request_form['show_empty_accounts'] = 0
request_form['expand_accounts'] = 1 request_form['expand_accounts'] = 1
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['show_detailed_balance_columns'] = 1
request_form['group_analytic'] = [] request_form['group_analytic'] = []
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
...@@ -2699,6 +2792,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2699,6 +2792,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['show_empty_accounts'] = 0 request_form['show_empty_accounts'] = 0
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['show_detailed_balance_columns'] = 1
request_form['group_analytic'] = [] request_form['group_analytic'] = []
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
...@@ -2768,6 +2862,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2768,6 +2862,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['show_empty_accounts'] = 0 request_form['show_empty_accounts'] = 0
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['show_detailed_balance_columns'] = 1
request_form['group_analytic'] = [] request_form['group_analytic'] = []
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
...@@ -2836,6 +2931,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2836,6 +2931,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['show_empty_accounts'] = 0 request_form['show_empty_accounts'] = 0
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['show_detailed_balance_columns'] = 1
request_form['group_analytic'] = [] request_form['group_analytic'] = []
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
...@@ -2918,6 +3014,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2918,6 +3014,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['group_analytic'] = [] request_form['group_analytic'] = []
request_form['show_detailed_balance_columns'] = 1
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
self.portal.accounting_module, self.portal.accounting_module,
...@@ -2987,6 +3084,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -2987,6 +3084,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['group_analytic'] = [] request_form['group_analytic'] = []
request_form['show_detailed_balance_columns'] = 1
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
self.portal.accounting_module, self.portal.accounting_module,
...@@ -3060,6 +3158,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -3060,6 +3158,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['group_analytic'] = [] request_form['group_analytic'] = []
request_form['show_detailed_balance_columns'] = 1
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
self.portal.accounting_module, self.portal.accounting_module,
...@@ -3104,6 +3203,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -3104,6 +3203,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['gap_list'] = ['my_country/my_accounting_standards/4'] request_form['gap_list'] = ['my_country/my_accounting_standards/4']
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['group_analytic'] = [] request_form['group_analytic'] = []
request_form['show_detailed_balance_columns'] = 1
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
self.portal.accounting_module, self.portal.accounting_module,
...@@ -3183,6 +3283,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -3183,6 +3283,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['per_account_class_summary'] = 1 request_form['per_account_class_summary'] = 1
request_form['group_analytic'] = [] request_form['group_analytic'] = []
request_form['show_detailed_balance_columns'] = 1
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
self.portal.accounting_module, self.portal.accounting_module,
...@@ -3236,6 +3337,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -3236,6 +3337,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['portal_type'] = ['Purchase Invoice Transaction'] request_form['portal_type'] = ['Purchase Invoice Transaction']
request_form['group_analytic'] = [] request_form['group_analytic'] = []
request_form['show_detailed_balance_columns'] = 1
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
self.portal.accounting_module, self.portal.accounting_module,
...@@ -3278,6 +3380,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -3278,6 +3380,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['function'] = 'function/a' request_form['function'] = 'function/a'
request_form['group_analytic'] = [] request_form['group_analytic'] = []
request_form['show_detailed_balance_columns'] = 1
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
self.portal.accounting_module, self.portal.accounting_module,
...@@ -3321,8 +3424,10 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -3321,8 +3424,10 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['function'] = '' request_form['function'] = ''
request_form['group_analytic'] = ["function"] request_form['group_analytic'] = ["function"]
request_form['show_detailed_balance_columns'] = 1
report_section_list = self.portal.accounting_module.AccountModule_getTrialBalanceReportSectionList() report_section_list = self.portal.accounting_module.AccountModule_getTrialBalanceReportSectionList()
line_list = self.getListBoxLineList(report_section_list[0]) line_list = self.getListBoxLineList(report_section_list[0])
# XXX where is the end of this test ?
def testTrialBalanceProject(self): def testTrialBalanceProject(self):
...@@ -3341,6 +3446,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -3341,6 +3446,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['project'] = self.project_1.getRelativeUrl() request_form['project'] = self.project_1.getRelativeUrl()
request_form['group_analytic'] = [] request_form['group_analytic'] = []
request_form['show_detailed_balance_columns'] = 1
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
self.portal.accounting_module, self.portal.accounting_module,
...@@ -3384,6 +3490,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -3384,6 +3490,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['project'] = 'None' request_form['project'] = 'None'
request_form['group_analytic'] = [] request_form['group_analytic'] = []
request_form['show_detailed_balance_columns'] = 1
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
self.portal.accounting_module, self.portal.accounting_module,
...@@ -3428,6 +3535,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase): ...@@ -3428,6 +3535,7 @@ class TestAccountingReports(AccountingTestCase, ERP5ReportTestCase):
request_form['show_empty_accounts'] = 0 request_form['show_empty_accounts'] = 0
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['group_analytic'] = [] request_form['group_analytic'] = []
request_form['show_detailed_balance_columns'] = 1
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
self.portal.accounting_module, self.portal.accounting_module,
...@@ -4840,6 +4948,7 @@ DT, b, P2 - Project 2''', ...@@ -4840,6 +4948,7 @@ DT, b, P2 - Project 2''',
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['gap_list'] = ['my_country/my_accounting_standards/7'] request_form['gap_list'] = ['my_country/my_accounting_standards/7']
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['show_detailed_balance_columns'] = 1
request_form['group_analytic'] = ['project'] request_form['group_analytic'] = ['project']
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
...@@ -4852,9 +4961,10 @@ DT, b, P2 - Project 2''', ...@@ -4852,9 +4961,10 @@ DT, b, P2 - Project 2''',
self.assertEqual(2, len(data_line_list)) self.assertEqual(2, len(data_line_list))
self.assertEqual(['node_id', 'node_title', 'project_uid', self.assertEqual(['node_id', 'node_title', 'project_uid',
'initial_debit_balance', 'initial_credit_balance', 'debit', 'credit', 'initial_debit_balance', 'initial_credit_balance', 'initial_balance',
'final_debit_balance', 'final_credit_balance', 'final_balance_if_debit', 'debit', 'credit', 'final_debit_balance', 'final_credit_balance',
'final_balance_if_credit'], data_line_list[0].column_id_list) 'final_balance', 'final_balance_if_debit', 'final_balance_if_credit'],
data_line_list[0].column_id_list)
self.checkLineProperties(data_line_list[0], node_id='7', self.checkLineProperties(data_line_list[0], node_id='7',
node_title='Goods Sales', project_uid='P1 - Project 1', node_title='Goods Sales', project_uid='P1 - Project 1',
...@@ -4885,6 +4995,7 @@ DT, b, P2 - Project 2''', ...@@ -4885,6 +4995,7 @@ DT, b, P2 - Project 2''',
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['gap_list'] = ['my_country/my_accounting_standards/7'] request_form['gap_list'] = ['my_country/my_accounting_standards/7']
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['show_detailed_balance_columns'] = 1
request_form['group_analytic'] = ['function'] request_form['group_analytic'] = ['function']
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
...@@ -4897,9 +5008,10 @@ DT, b, P2 - Project 2''', ...@@ -4897,9 +5008,10 @@ DT, b, P2 - Project 2''',
self.assertEqual(2, len(data_line_list)) self.assertEqual(2, len(data_line_list))
self.assertEqual(['node_id', 'node_title', 'function_uid', self.assertEqual(['node_id', 'node_title', 'function_uid',
'initial_debit_balance', 'initial_credit_balance', 'debit', 'credit', 'initial_debit_balance', 'initial_credit_balance', 'initial_balance',
'final_debit_balance', 'final_credit_balance', 'final_balance_if_debit', 'debit', 'credit', 'final_debit_balance', 'final_credit_balance',
'final_balance_if_credit'], data_line_list[0].column_id_list) 'final_balance', 'final_balance_if_debit', 'final_balance_if_credit'],
data_line_list[0].column_id_list)
self.checkLineProperties(data_line_list[0], node_id='7', self.checkLineProperties(data_line_list[0], node_id='7',
node_title='Goods Sales', function_uid='a', node_title='Goods Sales', function_uid='a',
...@@ -4930,6 +5042,7 @@ DT, b, P2 - Project 2''', ...@@ -4930,6 +5042,7 @@ DT, b, P2 - Project 2''',
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['gap_list'] = ['my_country/my_accounting_standards/7'] request_form['gap_list'] = ['my_country/my_accounting_standards/7']
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['show_detailed_balance_columns'] = 1
request_form['group_analytic'] = ['function', 'project'] request_form['group_analytic'] = ['function', 'project']
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
...@@ -4942,8 +5055,9 @@ DT, b, P2 - Project 2''', ...@@ -4942,8 +5055,9 @@ DT, b, P2 - Project 2''',
self.assertEqual(3, len(data_line_list)) self.assertEqual(3, len(data_line_list))
self.assertEqual(['node_id', 'node_title', 'function_uid', 'project_uid', self.assertEqual(['node_id', 'node_title', 'function_uid', 'project_uid',
'initial_debit_balance', 'initial_credit_balance', 'debit', 'credit', 'initial_debit_balance', 'initial_credit_balance', 'initial_balance',
'final_debit_balance', 'final_credit_balance', 'final_balance_if_debit', 'debit', 'credit', 'final_debit_balance', 'final_credit_balance',
'final_balance', 'final_balance_if_debit',
'final_balance_if_credit'], data_line_list[0].column_id_list) 'final_balance_if_credit'], data_line_list[0].column_id_list)
self.checkLineProperties(data_line_list[0], node_id='7', self.checkLineProperties(data_line_list[0], node_id='7',
...@@ -4996,6 +5110,7 @@ DT, b, P2 - Project 2''', ...@@ -4996,6 +5110,7 @@ DT, b, P2 - Project 2''',
request_form['expand_accounts'] = 0 request_form['expand_accounts'] = 0
request_form['gap_list'] = ['my_country/my_accounting_standards/7'] request_form['gap_list'] = ['my_country/my_accounting_standards/7']
request_form['per_account_class_summary'] = 0 request_form['per_account_class_summary'] = 0
request_form['show_detailed_balance_columns'] = 1
# in the dialog, categories are in the '_translated_title' form # in the dialog, categories are in the '_translated_title' form
request_form['group_analytic'] = ['product_line_translated_title'] request_form['group_analytic'] = ['product_line_translated_title']
self.assertTrue( self.assertTrue(
...@@ -5013,9 +5128,10 @@ DT, b, P2 - Project 2''', ...@@ -5013,9 +5128,10 @@ DT, b, P2 - Project 2''',
self.assertEqual(1, len(data_line_list)) self.assertEqual(1, len(data_line_list))
self.assertEqual(['node_id', 'node_title', 'strict_product_line_uid', self.assertEqual(['node_id', 'node_title', 'strict_product_line_uid',
'initial_debit_balance', 'initial_credit_balance', 'debit', 'credit', 'initial_debit_balance', 'initial_credit_balance', 'initial_balance',
'final_debit_balance', 'final_credit_balance', 'final_balance_if_debit', 'debit', 'credit', 'final_debit_balance', 'final_credit_balance',
'final_balance_if_credit'], data_line_list[0].column_id_list) 'final_balance', 'final_balance_if_debit', 'final_balance_if_credit'],
data_line_list[0].column_id_list)
self.checkLineProperties(data_line_list[0], node_id='7', self.checkLineProperties(data_line_list[0], node_id='7',
node_title='Goods Sales', strict_product_line_uid='pl1', node_title='Goods Sales', strict_product_line_uid='pl1',
......
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