From 2004fec8eb3aa03d933fe5fdc6f217f5ec7c70e5 Mon Sep 17 00:00:00 2001 From: pateljannat Date: Thu, 22 Apr 2021 14:52:36 +0530 Subject: [PATCH] fix: removed multicurrency --- .../project_profitability.py | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/erpnext/projects/report/project_profitability/project_profitability.py b/erpnext/projects/report/project_profitability/project_profitability.py index 7703b81cf7..0051c47458 100644 --- a/erpnext/projects/report/project_profitability/project_profitability.py +++ b/erpnext/projects/report/project_profitability/project_profitability.py @@ -18,7 +18,6 @@ def execute(filters=None): def get_data(filters): data = get_rows(filters) - data = handle_multi_currency(data, filters) data = calculate_cost_and_profit(data) return data @@ -53,37 +52,6 @@ def get_rows(filters): {0}) as t""".format(conditions) return frappe.db.sql(sql,filters, as_dict=True) -def handle_multi_currency(data, filters): - currency_precision = get_currency_precision() or 2 - company_currency = frappe.get_cached_value("Company", filters.get("company"), "default_currency") - - for row in data: - row.currency = company_currency - - if filters.get("employee"): - party_currency = get_employee_currency(row.employee) - - if filters.get("customer_name"): - party_currency = frappe.db.get_value("Customer", row.customer_name, ["default_currency"]) - - if party_currency and party_currency != company_currency: - exchange_rate = get_exchange_rate(company_currency, party_currency) - row.currency = party_currency - - row.base_grand_total = flt(flt(row.base_grand_total) * - flt(exchange_rate), currency_precision) - - row.base_gross_pay = flt(flt(row.base_gross_pay) * - flt(exchange_rate), currency_precision) - - row.profit = flt(flt(row.profit) * - flt(exchange_rate), currency_precision) - - row.fractional_cost = flt(flt(row.fractional_cost) * - flt(exchange_rate), currency_precision) - - return data - def calculate_cost_and_profit(data): for row in data: row.fractional_cost = row.base_gross_pay * row.utilization