mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-29 03:28:32 +00:00
fix: in_contex_translation_fixes
(cherry picked from commit a87e7fde03)
# Conflicts:
# erpnext/accounts/utils.py
# erpnext/templates/pages/order.html
This commit is contained in:
@@ -12,15 +12,15 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-left font-bold">{{ _('Grand Total') }}</td>
|
<td class="text-left font-bold">{{ _("Grand Total") }}</td>
|
||||||
<td class='text-right'> {{ frappe.utils.fmt_money(data.grand_total or '', currency=currency) }}</td>
|
<td class='text-right'> {{ frappe.utils.fmt_money(data.grand_total or '', currency=currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-left font-bold">{{ _('Net Total') }}</td>
|
<td class="text-left font-bold">{{ _("Net Total") }}</td>
|
||||||
<td class='text-right'> {{ frappe.utils.fmt_money(data.net_total or '', currency=currency) }}</td>
|
<td class='text-right'> {{ frappe.utils.fmt_money(data.net_total or '', currency=currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-left font-bold">{{ _('Total Quantity') }}</td>
|
<td class="text-left font-bold">{{ _("Total Quantity") }}</td>
|
||||||
<td class='text-right'>{{ data.total_quantity or '' }}</td>
|
<td class='text-right'>{{ data.total_quantity or '' }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{% for d in data.payment_reconciliation %}
|
{% for d in data.payment_reconciliation %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-left">{{ d.mode_of_payment }}</td>
|
<td class="text-left">{{ _(d.mode_of_payment) }}</td>
|
||||||
<td class='text-right'> {{ frappe.utils.fmt_money(d.expected_amount - d.opening_amount, currency=currency) }}</td>
|
<td class='text-right'> {{ frappe.utils.fmt_money(d.expected_amount - d.opening_amount, currency=currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="text-left">{{ _("Account") }}</th>
|
<th class="text-left">{{ _("Account") }}</th>
|
||||||
<th class="text-left">{{ _("Rate") }}</th>
|
<th class="text-left">{{ _(" Tax Rate") }}</th>
|
||||||
<th class="text-right">{{ _("Amount") }}</th>
|
<th class="text-right">{{ _("Amount") }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|||||||
@@ -76,6 +76,48 @@ def get_fiscal_years(
|
|||||||
as_dict=False,
|
as_dict=False,
|
||||||
boolean=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 []
|
fiscal_years = frappe.cache().hget("fiscal_years", company) or []
|
||||||
|
|
||||||
if not fiscal_years:
|
if not fiscal_years:
|
||||||
|
|||||||
@@ -40,7 +40,11 @@
|
|||||||
<p>
|
<p>
|
||||||
<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"
|
<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"
|
||||||
class="btn btn-primary btn-sm" id="pay-for-order">
|
class="btn btn-primary btn-sm" id="pay-for-order">
|
||||||
|
<<<<<<< HEAD
|
||||||
{{ _("Pay") }} {{doc.get_formatted("grand_total") }}
|
{{ _("Pay") }} {{doc.get_formatted("grand_total") }}
|
||||||
|
=======
|
||||||
|
{{ _("Pay", null, "Amount") }} {{ pay_amount }}
|
||||||
|
>>>>>>> a87e7fde03 (fix: in_contex_translation_fixes)
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user