From 5f75aea6fab48675f4606d5d9b36425d2d7cbbc4 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Thu, 24 Aug 2023 17:58:51 +0530 Subject: [PATCH] fix(demo): Default accounts for demo company --- .../verified/ae_uae_chart_template_standard.json | 16 ++++++++++++---- .../verified/id_chart_of_accounts.json | 3 ++- erpnext/accounts/general_ledger.py | 4 ++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json index a8afb55df6f..3a3b6e399e1 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json @@ -437,12 +437,20 @@ }, "Sales": { "Sales from Other Regions": { - "Sales from Other Region": {} + "Sales from Other Region": { + "account_type": "Income Account" + } }, "Sales of same region": { - "Management Consultancy Fees 1": {}, - "Sales Account": {}, - "Sales of I/C": {} + "Management Consultancy Fees 1": { + "account_type": "Income Account" + }, + "Sales Account": { + "account_type": "Income Account" + }, + "Sales of I/C": { + "account_type": "Income Account" + } } }, "root_type": "Income" diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/id_chart_of_accounts.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/id_chart_of_accounts.json index 12f517d64b5..fb974765db0 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/id_chart_of_accounts.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/id_chart_of_accounts.json @@ -669,7 +669,8 @@ }, "Penjualan Barang Dagangan": { "Penjualan": { - "account_number": "4110.000" + "account_number": "4110.000", + "account_type": "Income Account" }, "Potongan Penjualan": { "account_number": "4130.000" diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index 3803836ef76..d4967785ba0 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -539,6 +539,10 @@ def get_round_off_account_and_cost_center( "Company", company, ["round_off_account", "round_off_cost_center"] ) or [None, None] + # Use expense account as fallback + if not round_off_account: + round_off_account = frappe.get_cached_value("Company", company, "default_expense_account") + meta = frappe.get_meta(voucher_type) # Give first preference to parent cost center for round off GLE