Commit 24c129ab authored by Jérome Perrin's avatar Jérome Perrin

Hiding balanced accounts is also possible in the Trial Balance



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11241 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f26bb079
...@@ -73,12 +73,15 @@ ...@@ -73,12 +73,15 @@
from DateTime import DateTime\n from DateTime import DateTime\n
import math\n import math\n
\n \n
\n
##########\n ##########\n
# This method returns a list of accounts virtually expanded, ie. payable and receivable accounts\n # This method returns a list of accounts virtually expanded, ie. payable and\n
# are split by \'destination_section\' categories and bank accounts are split by \'source_payment\'.\n # receivable accounts are split by \'destination_section\' categories and bank\n
# accounts are split by \'source_payment\'.\n
##########\n ##########\n
\n \n
LOG = lambda msg: context.getPortalObject().log("AccountModule_getAccountListForTrialBalance", msg)\n LOG = lambda msg: context.getPortalObject().log(\n
"AccountModule_getAccountListForTrialBalance", msg)\n
\n \n
from_date = kw.get(\'from_date\', None)\n from_date = kw.get(\'from_date\', None)\n
at_date = kw[\'at_date\']\n at_date = kw[\'at_date\']\n
...@@ -233,7 +236,8 @@ def expandBankAccountsForAccount(account, **kw):\n ...@@ -233,7 +236,8 @@ def expandBankAccountsForAccount(account, **kw):\n
tmp_accounts = []\n tmp_accounts = []\n
orga_and_banks = []\n orga_and_banks = []\n
for orga in organisation_list:\n for orga in organisation_list:\n
orga_and_banks += [(orga, o.getObject()) for o in orga.searchFolder(portal_type=context.getPortalPaymentNodeTypeList())]\n orga_and_banks += [(orga, o.getObject()) for o in orga.contentValues(\n
portal_type=context.getPortalPaymentNodeTypeList())]\n
\n \n
for orga, bank in orga_and_banks:\n for orga, bank in orga_and_banks:\n
this_tmp_account = {\n this_tmp_account = {\n
...@@ -256,7 +260,10 @@ def expandBankAccountsForAccount(account, **kw):\n ...@@ -256,7 +260,10 @@ def expandBankAccountsForAccount(account, **kw):\n
this_tmp_account[\'credit_movement\'] != 0 or\n this_tmp_account[\'credit_movement\'] != 0 or\n
this_tmp_account[\'debit_movement\'] != 0 or\n this_tmp_account[\'debit_movement\'] != 0 or\n
this_tmp_account[\'closing_balance\'] != 0 ):\n this_tmp_account[\'closing_balance\'] != 0 ):\n
tmp_accounts.append( account.asContext(**formatValues(this_tmp_account) ) )\n if show_balanced_accounts or (this_tmp_account[\'closing_balance\'] != 0):\n
tmp_accounts.append(account.asContext(\n
**formatValues(this_tmp_account)))\n
\n
return tmp_accounts\n return tmp_accounts\n
\n \n
\n \n
...@@ -283,7 +290,9 @@ def expandThirdPartiesForAccount(account, **kw):\n ...@@ -283,7 +290,9 @@ def expandThirdPartiesForAccount(account, **kw):\n
if (this_tmp_account[\'opening_balance\'] != 0 or\n if (this_tmp_account[\'opening_balance\'] != 0 or\n
this_tmp_account[\'credit_movement\'] != 0 or\n this_tmp_account[\'credit_movement\'] != 0 or\n
this_tmp_account[\'debit_movement\'] != 0 ):\n this_tmp_account[\'debit_movement\'] != 0 ):\n
tmp_accounts.append(account.asContext(**formatValues(this_tmp_account)))\n if show_balanced_accounts or (this_tmp_account[\'closing_balance\'] != 0):\n
tmp_accounts.append(\n
account.asContext(**formatValues(this_tmp_account) ) )\n
return tmp_accounts\n return tmp_accounts\n
\n \n
\n \n
...@@ -466,6 +475,7 @@ for account_dict in account_list:\n ...@@ -466,6 +475,7 @@ for account_dict in account_list:\n
if (item[\'opening_balance\'] != 0 or\n if (item[\'opening_balance\'] != 0 or\n
item[\'credit_movement\'] != 0 or\n item[\'credit_movement\'] != 0 or\n
item[\'debit_movement\'] != 0 ):\n item[\'debit_movement\'] != 0 ):\n
if show_balanced_accounts or (item[\'closing_balance\'] != 0):\n
report_items.append(account.asContext(**formatValues(item)))\n report_items.append(account.asContext(**formatValues(item)))\n
\n \n
# MUST BE FIXED:\n # MUST BE FIXED:\n
...@@ -507,7 +517,7 @@ return report_items\n ...@@ -507,7 +517,7 @@ return report_items\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>src__=0, **kw</string> </value> <value> <string>src__=0, show_balanced_accounts=0, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -527,13 +537,14 @@ return report_items\n ...@@ -527,13 +537,14 @@ return report_items\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>1</int> </value> <value> <int>2</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>src__</string> <string>src__</string>
<string>show_balanced_accounts</string>
<string>kw</string> <string>kw</string>
<string>DateTime</string> <string>DateTime</string>
<string>math</string> <string>math</string>
...@@ -613,6 +624,7 @@ return report_items\n ...@@ -613,6 +624,7 @@ return report_items\n
<value> <value>
<tuple> <tuple>
<int>0</int> <int>0</int>
<int>0</int>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -83,6 +83,7 @@ gap_list = request.get(\'gap_list\' , [])\n ...@@ -83,6 +83,7 @@ gap_list = request.get(\'gap_list\' , [])\n
from_date = request.get(\'from_date\' , None)\n from_date = request.get(\'from_date\' , None)\n
expand_accounts = request.get(\'expand_accounts\' , False)\n expand_accounts = request.get(\'expand_accounts\' , False)\n
show_parent_accounts = request.get(\'show_parent_accounts\', False)\n show_parent_accounts = request.get(\'show_parent_accounts\', False)\n
show_balanced_accounts = request[\'show_balanced_accounts\']\n
\n \n
request.other[\'is_accounting_report\'] = True\n request.other[\'is_accounting_report\'] = True\n
\n \n
...@@ -105,6 +106,7 @@ params = {\n ...@@ -105,6 +106,7 @@ params = {\n
, \'gap_list\' : gap_list\n , \'gap_list\' : gap_list\n
, \'show_parent_accounts\' : show_parent_accounts\n , \'show_parent_accounts\' : show_parent_accounts\n
, \'expand_accounts\' : expand_accounts\n , \'expand_accounts\' : expand_accounts\n
, \'show_balanced_accounts\' : show_balanced_accounts\n
}\n }\n
\n \n
balance_columns = (\n balance_columns = (\n
...@@ -210,6 +212,7 @@ return result\n ...@@ -210,6 +212,7 @@ return result\n
<string>False</string> <string>False</string>
<string>expand_accounts</string> <string>expand_accounts</string>
<string>show_parent_accounts</string> <string>show_parent_accounts</string>
<string>show_balanced_accounts</string>
<string>True</string> <string>True</string>
<string>_write_</string> <string>_write_</string>
<string>result</string> <string>result</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.StandardFields</string>
<string>CheckBoxField</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_show_balanced_accounts</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 Balanced Accounts</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
</item> </item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <int>1</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
......
122 124
\ 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