Merge pull request #48984 from frappe/mergify/bp/version-14-hotfix/pr-48798

feat: add show_amount_in_company_currency in gl report (backport #48798)
This commit is contained in:
ruthra kumar
2025-08-05 17:44:27 +05:30
committed by GitHub
3 changed files with 19 additions and 1 deletions

View File

@@ -197,6 +197,11 @@ frappe.query_reports["General Ledger"] = {
label: __("Show Net Values in Party Account"),
fieldtype: "Check",
},
{
fieldname: "show_amount_in_company_currency",
label: __("Show Credit / Debit in Company Currency"),
fieldtype: "Check",
},
{
fieldname: "show_remarks",
label: __("Show Remarks"),

View File

@@ -580,6 +580,19 @@ def get_columns(filters):
company = filters.get("company") or get_default_company()
filters["presentation_currency"] = currency = get_company_currency(company)
company_currency = get_company_currency(filters.get("company") or get_default_company())
if (
filters.get("show_amount_in_company_currency")
and filters["presentation_currency"] != company_currency
):
frappe.throw(
_("Presentation Currency cannot be {0} , When {1} is enabled.").format(
frappe.bold(filters["presentation_currency"]),
frappe.bold("Show Credit / Debit in Company Currency"),
)
)
columns = [
{
"label": _("GL Entry"),

View File

@@ -118,7 +118,7 @@ def convert_to_presentation_currency(gl_entries, currency_info, filters=None):
len(account_currencies) == 1
and account_currency == presentation_currency
and not exchange_gain_or_loss
):
) and not filters.get("show_amount_in_company_currency"):
entry["debit"] = debit_in_account_currency
entry["credit"] = credit_in_account_currency
else: