[Erp5-report] r42732 jerome - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_s...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jan 28 11:57:13 CET 2011


Author: jerome
Date: Fri Jan 28 11:57:12 2011
New Revision: 42732

URL: http://svn.erp5.org?rev=42732&view=rev
Log:
* support that one can have more account types in asset, equity or liability. It was producing wrong GL and TB
* make sure to call the analytic scripts on accounting_module

Modified:
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountListForTrialBalance.xml
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalReportSectionList.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountListForTrialBalance.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountListForTrialBalance.xml?rev=42732&r1=42731&r2=42732&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountListForTrialBalance.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getAccountListForTrialBalance.xml [utf8] Fri Jan 28 11:57:12 2011
@@ -117,13 +117,11 @@ line_per_account = {}\n
 # account ?"\n
 account_used = {}\n
 \n
-account_type_to_group_by_node = [\n
-                  \'account_type/asset\',\n
-                  \'account_type/asset/cash\',\n
-                  \'account_type/asset/receivable/refundable_vat\',\n
-                  \'account_type/liability/payable/collected_vat\',\n
-                  \'account_type/equity\',\n
-                  \'account_type/liability\',]\n
+account_type = portal.portal_categories.account_type\n
+balance_sheet_account_type_list = [c[0] for c in \n
+ account_type.asset.getCategoryChildItemList(base=1, is_self_excluded=False, display_none_category=False ) + \\\n
+ account_type.equity.getCategoryChildItemList(base=1, is_self_excluded=False, display_none_category=False) + \\\n
+ account_type.liability.getCategoryChildItemList(base=1, is_self_excluded=False, display_none_category=False) ]\n
 \n
 profit_and_loss_account_type = [\n
                   \'account_type/expense\',\n
@@ -131,16 +129,21 @@ profit_and_loss_account_type = [\n
 \n
 account_type_to_group_by_payment = [ \'account_type/asset/cash/bank\' ]\n
 \n
-if expand_accounts:\n
-  account_type_to_group_by_mirror_section = [\n
+account_type_payable_receivable = [\n
                   \'account_type/asset/receivable\',\n
                   \'account_type/liability/payable\', ]\n
+if expand_accounts:\n
+  account_type_to_group_by_mirror_section = account_type_payable_receivable\n
 else:\n
-  account_type_to_group_by_node.extend([\n
-                  \'account_type/asset/receivable\',\n
-                  \'account_type/liability/payable\' ])\n
   account_type_to_group_by_mirror_section = []\n
 \n
+account_type_to_group_by_node = [at for at in balance_sheet_account_type_list\n
+  if at not in account_type_to_group_by_payment\n
+  and at not in account_type_to_group_by_mirror_section]\n
+\n
+account_type_to_group_by_node_previous_period = [at for at in account_type_to_group_by_node if at not in account_type_payable_receivable]\n
+\n
+\n
 total_debit = 0\n
 total_credit = 0\n
 total_initial_debit_balance = 0\n
@@ -342,13 +345,8 @@ initial_balance_date = (from_date - 1).l
 # standards accounts {{{\n
 # balance at period start date\n
 for node in getInventoryList(\n
-                node_category_strict_membership=[\n
-                  \'account_type/asset\',\n
-                  \'account_type/asset/cash\',\n
-                  \'account_type/asset/receivable/refundable_vat\',\n
-                  \'account_type/liability/payable/collected_vat\',\n
-                  \'account_type/equity\',\n
-                  \'account_type/liability\',],\n
+                node_category_strict_membership=\n
+                   account_type_to_group_by_node_previous_period,\n
                 group_by_node=1,\n
                 to_date=period_start_date,\n
                 portal_type=accounting_movement_type_list +\n
@@ -364,13 +362,8 @@ for node in getInventoryList(\n
 found_balance = False\n
 # Balance Transaction\n
 for node in getInventoryList(\n
-                node_category_strict_membership=[\n
-                  \'account_type/asset\',\n
-                  \'account_type/asset/cash\',\n
-                  \'account_type/asset/receivable/refundable_vat\',\n
-                  \'account_type/liability/payable/collected_vat\',\n
-                  \'account_type/equity\',\n
-                  \'account_type/liability\',],\n
+                node_category_strict_membership=\n
+                   account_type_to_group_by_node_previous_period,\n
                 group_by_node=1,\n
                 from_date=from_date,\n
                 at_date=from_date + 1,\n
@@ -451,9 +444,7 @@ for node in getInventoryList(\n
 # payable / receivable accounts {{{\n
 # initial balance\n
 for node in getInventoryList(\n
-                node_category_strict_membership=[\n
-                        \'account_type/asset/receivable\',\n
-                        \'account_type/liability/payable\', ],\n
+                node_category_strict_membership=account_type_payable_receivable,\n
                 group_by_mirror_section=1,\n
                 group_by_node=1,\n
                 to_date=period_start_date,\n
@@ -476,9 +467,7 @@ for node in getInventoryList(\n
 found_balance=False\n
 # Balance Transactions\n
 for node in getInventoryList(\n
-                node_category_strict_membership=[\n
-                        \'account_type/asset/receivable\',\n
-                        \'account_type/liability/payable\', ],\n
+                node_category_strict_membership=account_type_payable_receivable,\n
                 group_by_mirror_section=1,\n
                 group_by_node=1,\n
                 from_date=from_date,\n

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml?rev=42732&r1=42731&r2=42732&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountModule_getGeneralLedgerReportSectionList.xml [utf8] Fri Jan 28 11:57:12 2011
@@ -129,7 +129,7 @@ if hide_analytic:\n
                                            \'mirror_section_uid\',\n
                                            \'payment_uid\' )\n
 else:\n
-  analytic_column_list = context.AccountModule_getAnalyticColumnList()\n
+  analytic_column_list = context.accounting_module.AccountModule_getAnalyticColumnList()\n
 \n
 account_columns = (\n
       (\'Movement_getSpecificReference\', \'Reference\'),\n
@@ -187,13 +187,10 @@ def getFullAccountName(account_info):\n
 \n
 \n
 # look at inventories to decide which sections will be shown\n
-account_type_to_group_by_node = [\n
-                  \'account_type/asset\',\n
-                  \'account_type/asset/cash\',\n
-                  \'account_type/asset/receivable/refundable_vat\',\n
-                  \'account_type/liability/payable/collected_vat\',\n
-                  \'account_type/equity\',\n
-                  \'account_type/liability\',]\n
+balance_sheet_account_type_list = [c[0] for c in \n
+ cat_tool.account_type.asset.getCategoryChildItemList(base=1, is_self_excluded=False, display_none_category=False ) + \\\n
+ cat_tool.account_type.equity.getCategoryChildItemList(base=1, is_self_excluded=False, display_none_category=False) + \\\n
+ cat_tool.account_type.liability.getCategoryChildItemList(base=1, is_self_excluded=False, display_none_category=False) ]\n
 \n
 profit_and_loss_account_type = []\n
 for account_type_value in (cat_tool.account_type.expense,\n
@@ -208,6 +205,9 @@ account_type_to_group_by_mirror_section 
                   \'account_type/asset/receivable\',\n
                   \'account_type/liability/payable\', ]\n
 \n
+account_type_to_group_by_node = [at for at in balance_sheet_account_type_list\n
+  if at not in account_type_to_group_by_payment\n
+  and at not in account_type_to_group_by_mirror_section]\n
 \n
 if gap_list or gap_root:\n
   params[\'node_category\'] = gap_list or gap_root\n

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalReportSectionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalReportSectionList.xml?rev=42732&r1=42731&r2=42732&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalReportSectionList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getJournalReportSectionList.xml [utf8] Fri Jan 28 11:57:12 2011
@@ -99,7 +99,7 @@ if hide_analytic:\n
                                    \'payment_uid\',\n
                                    \'node_uid\' )\n
 else:\n
-  analytic_column_list = context.AccountModule_getAnalyticColumnList()\n
+  analytic_column_list = context.accounting_module.AccountModule_getAnalyticColumnList()\n
   selection_params[\'analytic_column_list\'] = analytic_column_list\n
 \n
 selection_columns = (\n

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=42732&r1=42731&r2=42732&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] Fri Jan 28 11:57:12 2011
@@ -1 +1 @@
-1433
\ No newline at end of file
+1436
\ No newline at end of file



More information about the Erp5-report mailing list