From 2c60f6419e6db5ad113a276a60bff085ca4d80f1 Mon Sep 17 00:00:00 2001 From: Anurag Mishra <32095923+Anurag810@users.noreply.github.com> Date: Fri, 20 Sep 2019 23:00:09 +0530 Subject: [PATCH] feat: missmatching amount in GST Sales report and itemised sales report (#19116) --- .../item_wise_sales_register/item_wise_sales_register.py | 2 +- erpnext/accounts/report/sales_register/sales_register.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py index e8b19b4024..9da89ff2c9 100644 --- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py +++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py @@ -17,7 +17,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum filters.update({"from_date": filters.get("date_range") and filters.get("date_range")[0], "to_date": filters.get("date_range") and filters.get("date_range")[1]}) columns = get_columns(additional_table_columns) - company_currency = erpnext.get_company_currency(filters.get('company')) + company_currency = frappe.get_cached_value('Company', filters.get("company"), "default_currency") item_list = get_items(filters, additional_query_columns) if item_list: diff --git a/erpnext/accounts/report/sales_register/sales_register.py b/erpnext/accounts/report/sales_register/sales_register.py index d08056f6f9..2b32fa9378 100644 --- a/erpnext/accounts/report/sales_register/sales_register.py +++ b/erpnext/accounts/report/sales_register/sales_register.py @@ -68,7 +68,8 @@ def _execute(filters, additional_table_columns=None, additional_query_columns=No total_tax = 0 for tax_acc in tax_accounts: if tax_acc not in income_accounts: - tax_amount = flt(invoice_tax_map.get(inv.name, {}).get(tax_acc)) + tax_amount_precision = get_field_precision(frappe.get_meta("Sales Taxes and Charges").get_field("tax_amount"), currency=company_currency) or 2 + tax_amount = flt(invoice_tax_map.get(inv.name, {}).get(tax_acc), tax_amount_precision) total_tax += tax_amount row.append(tax_amount)