Skip to content

Commit 1353a14

Browse files
mahsemmergify[bot]
authored andcommitted
fix: in_contex_translation_fixes
(cherry picked from commit a87e7fd) # Conflicts: # erpnext/accounts/utils.py # erpnext/templates/pages/order.html
1 parent 8b4f526 commit 1353a14

File tree

3 files changed

+51
-5
lines changed

3 files changed

+51
-5
lines changed

erpnext/accounts/doctype/pos_closing_entry/closing_voucher_details.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ <h6 class="text-center uppercase" style="color: #8D99A6">{{ _("Sales Summary") }
1212
</thead>
1313
<tbody>
1414
<tr>
15-
<td class="text-left font-bold">{{ _('Grand Total') }}</td>
15+
<td class="text-left font-bold">{{ _("Grand Total") }}</td>
1616
<td class='text-right'> {{ frappe.utils.fmt_money(data.grand_total or '', currency=currency) }}</td>
1717
</tr>
1818
<tr>
19-
<td class="text-left font-bold">{{ _('Net Total') }}</td>
19+
<td class="text-left font-bold">{{ _("Net Total") }}</td>
2020
<td class='text-right'> {{ frappe.utils.fmt_money(data.net_total or '', currency=currency) }}</td>
2121
</tr>
2222
<tr>
23-
<td class="text-left font-bold">{{ _('Total Quantity') }}</td>
23+
<td class="text-left font-bold">{{ _("Total Quantity") }}</td>
2424
<td class='text-right'>{{ data.total_quantity or '' }}</td>
2525
</tr>
2626

@@ -44,7 +44,7 @@ <h6 class="text-center uppercase" style="color: #8D99A6">{{ _("Mode of Payments"
4444
<tbody>
4545
{% for d in data.payment_reconciliation %}
4646
<tr>
47-
<td class="text-left">{{ d.mode_of_payment }}</td>
47+
<td class="text-left">{{ _(d.mode_of_payment) }}</td>
4848
<td class='text-right'> {{ frappe.utils.fmt_money(d.expected_amount - d.opening_amount, currency=currency) }}</td>
4949
</tr>
5050
{% endfor %}
@@ -63,7 +63,7 @@ <h6 class="text-center uppercase" style="color: #8D99A6">{{ _("Taxes") }}</h6>
6363
<thead>
6464
<tr>
6565
<th class="text-left">{{ _("Account") }}</th>
66-
<th class="text-left">{{ _("Rate") }}</th>
66+
<th class="text-left">{{ _(" Tax Rate") }}</th>
6767
<th class="text-right">{{ _("Amount") }}</th>
6868
</tr>
6969
</thead>

erpnext/accounts/utils.py

+42
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,48 @@ def get_fiscal_years(
7676
as_dict=False,
7777
boolean=False,
7878
):
79+
<<<<<<< HEAD
80+
=======
81+
if transaction_date:
82+
transaction_date = getdate(transaction_date)
83+
# backwards compat
84+
if boolean is not None:
85+
raise_on_missing = not boolean
86+
87+
all_fiscal_years = _get_fiscal_years(company=company)
88+
89+
# No restricting selectors
90+
if not transaction_date and not fiscal_year:
91+
return all_fiscal_years
92+
93+
for fy in all_fiscal_years:
94+
if (fiscal_year and fy.name == fiscal_year) or (
95+
transaction_date
96+
and getdate(fy.year_start_date) <= transaction_date
97+
and getdate(fy.year_end_date) >= transaction_date
98+
):
99+
if as_dict:
100+
return (fy,)
101+
else:
102+
return ((fy.name, fy.year_start_date, fy.year_end_date),)
103+
104+
# No match for restricting selectors
105+
if raise_on_missing:
106+
error_msg = _("""{0} {1} is not in any active Fiscal Year""").format(
107+
_(label), formatdate(transaction_date)
108+
)
109+
if company:
110+
error_msg = _("""{0} for {1}""").format(error_msg, frappe.bold(company))
111+
112+
if verbose == 1:
113+
frappe.msgprint(error_msg)
114+
115+
raise FiscalYearError(error_msg)
116+
return []
117+
118+
119+
def _get_fiscal_years(company=None):
120+
>>>>>>> a87e7fde03 (fix: in_contex_translation_fixes)
79121
fiscal_years = frappe.cache().hget("fiscal_years", company) or []
80122

81123
if not fiscal_years:

erpnext/templates/pages/order.html

+4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ <h3 class="m-0">{{ doc.name }}</h3>
4040
<p>
4141
<a href="/api/method/erpnext.accounts.doctype.payment_request.payment_request.make_payment_request?dn={{ doc.name }}&dt={{ doc.doctype }}&submit_doc=1&order_type=Shopping Cart"
4242
class="btn btn-primary btn-sm" id="pay-for-order">
43+
<<<<<<< HEAD
4344
{{ _("Pay") }} {{doc.get_formatted("grand_total") }}
45+
=======
46+
{{ _("Pay", null, "Amount") }} {{ pay_amount }}
47+
>>>>>>> a87e7fde03 (fix: in_contex_translation_fixes)
4448
</a>
4549
</p>
4650
</div>

0 commit comments

Comments
 (0)