From 1353a14a6b4c58b96916b3bf4f7a27e85716ab79 Mon Sep 17 00:00:00 2001 From: mahsem <137205921+mahsem@users.noreply.github.com> Date: Mon, 23 Dec 2024 11:30:00 +0100 Subject: [PATCH 1/3] fix: in_contex_translation_fixes (cherry picked from commit a87e7fde031393607b384138b0927d0b4c36322b) # Conflicts: # erpnext/accounts/utils.py # erpnext/templates/pages/order.html --- .../closing_voucher_details.html | 10 ++--- erpnext/accounts/utils.py | 42 +++++++++++++++++++ erpnext/templates/pages/order.html | 4 ++ 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/doctype/pos_closing_entry/closing_voucher_details.html b/erpnext/accounts/doctype/pos_closing_entry/closing_voucher_details.html index 983f49563cd..5bc4e7a1587 100644 --- a/erpnext/accounts/doctype/pos_closing_entry/closing_voucher_details.html +++ b/erpnext/accounts/doctype/pos_closing_entry/closing_voucher_details.html @@ -12,15 +12,15 @@ - {{ _('Grand Total') }} + {{ _("Grand Total") }} {{ frappe.utils.fmt_money(data.grand_total or '', currency=currency) }} - {{ _('Net Total') }} + {{ _("Net Total") }} {{ frappe.utils.fmt_money(data.net_total or '', currency=currency) }} - {{ _('Total Quantity') }} + {{ _("Total Quantity") }} {{ data.total_quantity or '' }} @@ -44,7 +44,7 @@ {% for d in data.payment_reconciliation %} - {{ d.mode_of_payment }} + {{ _(d.mode_of_payment) }} {{ frappe.utils.fmt_money(d.expected_amount - d.opening_amount, currency=currency) }} {% endfor %} @@ -63,7 +63,7 @@ {{ _("Account") }} - {{ _("Rate") }} + {{ _(" Tax Rate") }} {{ _("Amount") }} diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 51b4ed248ce..96f67613d3f 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -76,6 +76,48 @@ def get_fiscal_years( as_dict=False, boolean=False, ): +<<<<<<< HEAD +======= + if transaction_date: + transaction_date = getdate(transaction_date) + # backwards compat + if boolean is not None: + raise_on_missing = not boolean + + all_fiscal_years = _get_fiscal_years(company=company) + + # No restricting selectors + if not transaction_date and not fiscal_year: + return all_fiscal_years + + for fy in all_fiscal_years: + if (fiscal_year and fy.name == fiscal_year) or ( + transaction_date + and getdate(fy.year_start_date) <= transaction_date + and getdate(fy.year_end_date) >= transaction_date + ): + if as_dict: + return (fy,) + else: + return ((fy.name, fy.year_start_date, fy.year_end_date),) + + # No match for restricting selectors + if raise_on_missing: + error_msg = _("""{0} {1} is not in any active Fiscal Year""").format( + _(label), formatdate(transaction_date) + ) + if company: + error_msg = _("""{0} for {1}""").format(error_msg, frappe.bold(company)) + + if verbose == 1: + frappe.msgprint(error_msg) + + raise FiscalYearError(error_msg) + return [] + + +def _get_fiscal_years(company=None): +>>>>>>> a87e7fde03 (fix: in_contex_translation_fixes) fiscal_years = frappe.cache().hget("fiscal_years", company) or [] if not fiscal_years: diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html index 388feb9eba9..ec565060191 100644 --- a/erpnext/templates/pages/order.html +++ b/erpnext/templates/pages/order.html @@ -40,7 +40,11 @@

+<<<<<<< HEAD {{ _("Pay") }} {{doc.get_formatted("grand_total") }} +======= + {{ _("Pay", null, "Amount") }} {{ pay_amount }} +>>>>>>> a87e7fde03 (fix: in_contex_translation_fixes)

From 2efc701e4e37127aff69035742b0f415ae4b3505 Mon Sep 17 00:00:00 2001 From: mahsem <137205921+mahsem@users.noreply.github.com> Date: Mon, 23 Dec 2024 17:42:33 +0100 Subject: [PATCH 2/3] fix: whitespace (cherry picked from commit 1f4e1811de51b75c765fa87118aafa0b16dedd6f) --- .../doctype/pos_closing_entry/closing_voucher_details.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/pos_closing_entry/closing_voucher_details.html b/erpnext/accounts/doctype/pos_closing_entry/closing_voucher_details.html index 5bc4e7a1587..63e88cf44c2 100644 --- a/erpnext/accounts/doctype/pos_closing_entry/closing_voucher_details.html +++ b/erpnext/accounts/doctype/pos_closing_entry/closing_voucher_details.html @@ -63,7 +63,7 @@ {{ _("Account") }} - {{ _(" Tax Rate") }} + {{ _("Tax Rate") }} {{ _("Amount") }} From 2e9c507dfa70eda65c98558aa6de8078f01681fa Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 30 Dec 2024 16:18:12 +0530 Subject: [PATCH 3/3] chore: resolve conflicts --- erpnext/accounts/utils.py | 42 ------------------------------ erpnext/templates/pages/order.html | 4 --- 2 files changed, 46 deletions(-) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 96f67613d3f..51b4ed248ce 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -76,48 +76,6 @@ def get_fiscal_years( as_dict=False, boolean=False, ): -<<<<<<< HEAD -======= - if transaction_date: - transaction_date = getdate(transaction_date) - # backwards compat - if boolean is not None: - raise_on_missing = not boolean - - all_fiscal_years = _get_fiscal_years(company=company) - - # No restricting selectors - if not transaction_date and not fiscal_year: - return all_fiscal_years - - for fy in all_fiscal_years: - if (fiscal_year and fy.name == fiscal_year) or ( - transaction_date - and getdate(fy.year_start_date) <= transaction_date - and getdate(fy.year_end_date) >= transaction_date - ): - if as_dict: - return (fy,) - else: - return ((fy.name, fy.year_start_date, fy.year_end_date),) - - # No match for restricting selectors - if raise_on_missing: - error_msg = _("""{0} {1} is not in any active Fiscal Year""").format( - _(label), formatdate(transaction_date) - ) - if company: - error_msg = _("""{0} for {1}""").format(error_msg, frappe.bold(company)) - - if verbose == 1: - frappe.msgprint(error_msg) - - raise FiscalYearError(error_msg) - return [] - - -def _get_fiscal_years(company=None): ->>>>>>> a87e7fde03 (fix: in_contex_translation_fixes) fiscal_years = frappe.cache().hget("fiscal_years", company) or [] if not fiscal_years: diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html index ec565060191..ade66dd481f 100644 --- a/erpnext/templates/pages/order.html +++ b/erpnext/templates/pages/order.html @@ -40,11 +40,7 @@

-<<<<<<< HEAD - {{ _("Pay") }} {{doc.get_formatted("grand_total") }} -======= {{ _("Pay", null, "Amount") }} {{ pay_amount }} ->>>>>>> a87e7fde03 (fix: in_contex_translation_fixes)