Commit eb255c6a authored by Jérome Perrin's avatar Jérome Perrin

* support that one can have more account types in asset, equity or liability....

* 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

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42732 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0eb01dcd
...@@ -117,13 +117,11 @@ line_per_account = {}\n ...@@ -117,13 +117,11 @@ line_per_account = {}\n
# account ?"\n # account ?"\n
account_used = {}\n account_used = {}\n
\n \n
account_type_to_group_by_node = [\n account_type = portal.portal_categories.account_type\n
\'account_type/asset\',\n balance_sheet_account_type_list = [c[0] for c in \n
\'account_type/asset/cash\',\n account_type.asset.getCategoryChildItemList(base=1, is_self_excluded=False, display_none_category=False ) + \\\n
\'account_type/asset/receivable/refundable_vat\',\n account_type.equity.getCategoryChildItemList(base=1, is_self_excluded=False, display_none_category=False) + \\\n
\'account_type/liability/payable/collected_vat\',\n account_type.liability.getCategoryChildItemList(base=1, is_self_excluded=False, display_none_category=False) ]\n
\'account_type/equity\',\n
\'account_type/liability\',]\n
\n \n
profit_and_loss_account_type = [\n profit_and_loss_account_type = [\n
\'account_type/expense\',\n \'account_type/expense\',\n
...@@ -131,16 +129,21 @@ profit_and_loss_account_type = [\n ...@@ -131,16 +129,21 @@ profit_and_loss_account_type = [\n
\n \n
account_type_to_group_by_payment = [ \'account_type/asset/cash/bank\' ]\n account_type_to_group_by_payment = [ \'account_type/asset/cash/bank\' ]\n
\n \n
if expand_accounts:\n account_type_payable_receivable = [\n
account_type_to_group_by_mirror_section = [\n
\'account_type/asset/receivable\',\n \'account_type/asset/receivable\',\n
\'account_type/liability/payable\', ]\n \'account_type/liability/payable\', ]\n
if expand_accounts:\n
account_type_to_group_by_mirror_section = account_type_payable_receivable\n
else:\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 account_type_to_group_by_mirror_section = []\n
\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_debit = 0\n
total_credit = 0\n total_credit = 0\n
total_initial_debit_balance = 0\n total_initial_debit_balance = 0\n
...@@ -342,13 +345,8 @@ initial_balance_date = (from_date - 1).latestTime()\n ...@@ -342,13 +345,8 @@ initial_balance_date = (from_date - 1).latestTime()\n
# standards accounts {{{\n # standards accounts {{{\n
# balance at period start date\n # balance at period start date\n
for node in getInventoryList(\n for node in getInventoryList(\n
node_category_strict_membership=[\n node_category_strict_membership=\n
\'account_type/asset\',\n account_type_to_group_by_node_previous_period,\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
group_by_node=1,\n group_by_node=1,\n
to_date=period_start_date,\n to_date=period_start_date,\n
portal_type=accounting_movement_type_list +\n portal_type=accounting_movement_type_list +\n
...@@ -364,13 +362,8 @@ for node in getInventoryList(\n ...@@ -364,13 +362,8 @@ for node in getInventoryList(\n
found_balance = False\n found_balance = False\n
# Balance Transaction\n # Balance Transaction\n
for node in getInventoryList(\n for node in getInventoryList(\n
node_category_strict_membership=[\n node_category_strict_membership=\n
\'account_type/asset\',\n account_type_to_group_by_node_previous_period,\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
group_by_node=1,\n group_by_node=1,\n
from_date=from_date,\n from_date=from_date,\n
at_date=from_date + 1,\n at_date=from_date + 1,\n
...@@ -451,9 +444,7 @@ for node in getInventoryList(\n ...@@ -451,9 +444,7 @@ for node in getInventoryList(\n
# payable / receivable accounts {{{\n # payable / receivable accounts {{{\n
# initial balance\n # initial balance\n
for node in getInventoryList(\n for node in getInventoryList(\n
node_category_strict_membership=[\n node_category_strict_membership=account_type_payable_receivable,\n
\'account_type/asset/receivable\',\n
\'account_type/liability/payable\', ],\n
group_by_mirror_section=1,\n group_by_mirror_section=1,\n
group_by_node=1,\n group_by_node=1,\n
to_date=period_start_date,\n to_date=period_start_date,\n
...@@ -476,9 +467,7 @@ for node in getInventoryList(\n ...@@ -476,9 +467,7 @@ for node in getInventoryList(\n
found_balance=False\n found_balance=False\n
# Balance Transactions\n # Balance Transactions\n
for node in getInventoryList(\n for node in getInventoryList(\n
node_category_strict_membership=[\n node_category_strict_membership=account_type_payable_receivable,\n
\'account_type/asset/receivable\',\n
\'account_type/liability/payable\', ],\n
group_by_mirror_section=1,\n group_by_mirror_section=1,\n
group_by_node=1,\n group_by_node=1,\n
from_date=from_date,\n from_date=from_date,\n
......
...@@ -129,7 +129,7 @@ if hide_analytic:\n ...@@ -129,7 +129,7 @@ if hide_analytic:\n
\'mirror_section_uid\',\n \'mirror_section_uid\',\n
\'payment_uid\' )\n \'payment_uid\' )\n
else:\n else:\n
analytic_column_list = context.AccountModule_getAnalyticColumnList()\n analytic_column_list = context.accounting_module.AccountModule_getAnalyticColumnList()\n
\n \n
account_columns = (\n account_columns = (\n
(\'Movement_getSpecificReference\', \'Reference\'),\n (\'Movement_getSpecificReference\', \'Reference\'),\n
...@@ -187,13 +187,10 @@ def getFullAccountName(account_info):\n ...@@ -187,13 +187,10 @@ def getFullAccountName(account_info):\n
\n \n
\n \n
# look at inventories to decide which sections will be shown\n # look at inventories to decide which sections will be shown\n
account_type_to_group_by_node = [\n balance_sheet_account_type_list = [c[0] for c in \n
\'account_type/asset\',\n cat_tool.account_type.asset.getCategoryChildItemList(base=1, is_self_excluded=False, display_none_category=False ) + \\\n
\'account_type/asset/cash\',\n cat_tool.account_type.equity.getCategoryChildItemList(base=1, is_self_excluded=False, display_none_category=False) + \\\n
\'account_type/asset/receivable/refundable_vat\',\n cat_tool.account_type.liability.getCategoryChildItemList(base=1, is_self_excluded=False, display_none_category=False) ]\n
\'account_type/liability/payable/collected_vat\',\n
\'account_type/equity\',\n
\'account_type/liability\',]\n
\n \n
profit_and_loss_account_type = []\n profit_and_loss_account_type = []\n
for account_type_value in (cat_tool.account_type.expense,\n for account_type_value in (cat_tool.account_type.expense,\n
...@@ -208,6 +205,9 @@ account_type_to_group_by_mirror_section = [\n ...@@ -208,6 +205,9 @@ account_type_to_group_by_mirror_section = [\n
\'account_type/asset/receivable\',\n \'account_type/asset/receivable\',\n
\'account_type/liability/payable\', ]\n \'account_type/liability/payable\', ]\n
\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 \n
if gap_list or gap_root:\n if gap_list or gap_root:\n
params[\'node_category\'] = gap_list or gap_root\n params[\'node_category\'] = gap_list or gap_root\n
......
...@@ -99,7 +99,7 @@ if hide_analytic:\n ...@@ -99,7 +99,7 @@ if hide_analytic:\n
\'payment_uid\',\n \'payment_uid\',\n
\'node_uid\' )\n \'node_uid\' )\n
else:\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 selection_params[\'analytic_column_list\'] = analytic_column_list\n
\n \n
selection_columns = (\n selection_columns = (\n
......
1433 1436
\ 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