From 42d8db59f043d3c2985264e54ef119bdf212fb17 Mon Sep 17 00:00:00 2001 From: Abhishek Balam Date: Wed, 30 Sep 2020 01:32:42 +0530 Subject: [PATCH 1/2] fix: add currency select to Trial Balance --- erpnext/accounts/report/trial_balance/trial_balance.js | 7 +++++++ erpnext/accounts/report/trial_balance/trial_balance.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/trial_balance/trial_balance.js b/erpnext/accounts/report/trial_balance/trial_balance.js index 9c0854c5d3..f935bec749 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.js +++ b/erpnext/accounts/report/trial_balance/trial_balance.js @@ -72,6 +72,13 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() { "fieldtype": "Link", "options": "Finance Book", }, + { + "fieldname": "presentation_currency", + "label": __("Currency"), + "fieldtype": "Select", + "options": erpnext.get_presentation_currency_list(), + "default": frappe.defaults.get_user_default("currency") + }, { "fieldname": "with_period_closing_entry", "label": __("Period Closing Entry"), diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py index 3cf08703f8..33360e2b01 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.py +++ b/erpnext/accounts/report/trial_balance/trial_balance.py @@ -56,7 +56,7 @@ def get_data(filters): accounts = frappe.db.sql("""select name, account_number, parent_account, account_name, root_type, report_type, lft, rgt from `tabAccount` where company=%s order by lft""", filters.company, as_dict=True) - company_currency = erpnext.get_company_currency(filters.company) + company_currency = filters.presentation_currency or erpnext.get_company_currency(filters.company) if not accounts: return None From 001e7e9df974ae1dd0e58896d17389240338b8c2 Mon Sep 17 00:00:00 2001 From: Abhishek Balam Date: Wed, 30 Sep 2020 10:39:26 +0530 Subject: [PATCH 2/2] fix: remove default value --- erpnext/accounts/report/trial_balance/trial_balance.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/accounts/report/trial_balance/trial_balance.js b/erpnext/accounts/report/trial_balance/trial_balance.js index f935bec749..8645d55d0f 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.js +++ b/erpnext/accounts/report/trial_balance/trial_balance.js @@ -76,8 +76,7 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() { "fieldname": "presentation_currency", "label": __("Currency"), "fieldtype": "Select", - "options": erpnext.get_presentation_currency_list(), - "default": frappe.defaults.get_user_default("currency") + "options": erpnext.get_presentation_currency_list() }, { "fieldname": "with_period_closing_entry",