Obey currency filter in financial statement prints #pdd (#13648)
This commit is contained in:
parent
a952e40b56
commit
ed34a442a8
@ -22,9 +22,9 @@
|
|||||||
<h2 class="text-center">{%= __(report.report_name) %}</h2>
|
<h2 class="text-center">{%= __(report.report_name) %}</h2>
|
||||||
<h3 class="text-center">{%= filters.company %}</h3>
|
<h3 class="text-center">{%= filters.company %}</h3>
|
||||||
<h3 class="text-center">{%= filters.fiscal_year %}</h3>
|
<h3 class="text-center">{%= filters.fiscal_year %}</h3>
|
||||||
<h5 class="text-center">{%= __("Currency") %} : {%= erpnext.get_currency(filters.company) %} </h4>
|
<h5 class="text-center">{%= __("Currency") %} : {%= filters.presentation_currency || erpnext.get_currency(filters.company) %} </h4>
|
||||||
{% if (filters.from_date) { %}
|
{% if (filters.from_date) { %}
|
||||||
<h4 class="text-center">{%= dateutil.str_to_user(filters.from_date) %} - {%= dateutil.str_to_user(filters.to_date) %}</h3>
|
<h4 class="text-center">{%= frappe.datetime.str_to_user(filters.from_date) %} - {%= frappe.datetime.str_to_user(filters.to_date) %}</h3>
|
||||||
{% } %}
|
{% } %}
|
||||||
<hr>
|
<hr>
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
@ -51,7 +51,7 @@
|
|||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
{% var fieldname = report.columns[i].field || report.columns[i].fieldname; %}
|
{% var fieldname = report.columns[i].field || report.columns[i].fieldname; %}
|
||||||
{% if (!is_null(row[fieldname])) { %}
|
{% if (!is_null(row[fieldname])) { %}
|
||||||
{%= format_number(row[fieldname], null)%}
|
{%= format_currency(row[fieldname], filters.presentation_currency) %}
|
||||||
{% } %}
|
{% } %}
|
||||||
</td>
|
</td>
|
||||||
{% } %}
|
{% } %}
|
||||||
@ -59,4 +59,4 @@
|
|||||||
{% } %}
|
{% } %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p class="text-right text-muted">Printed On {%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}</p>
|
<p class="text-right text-muted">Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}</p>
|
||||||
|
@ -19,7 +19,7 @@ def execute(filters=None):
|
|||||||
accumulated_values=filters.accumulated_values,
|
accumulated_values=filters.accumulated_values,
|
||||||
ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
|
ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
|
||||||
|
|
||||||
net_profit_loss = get_net_profit_loss(income, expense, period_list, filters.company)
|
net_profit_loss = get_net_profit_loss(income, expense, period_list, filters.company, filters.presentation_currency)
|
||||||
|
|
||||||
data = []
|
data = []
|
||||||
data.extend(income or [])
|
data.extend(income or [])
|
||||||
@ -33,13 +33,13 @@ def execute(filters=None):
|
|||||||
|
|
||||||
return columns, data, None, chart
|
return columns, data, None, chart
|
||||||
|
|
||||||
def get_net_profit_loss(income, expense, period_list, company):
|
def get_net_profit_loss(income, expense, period_list, company, currency=None):
|
||||||
total = 0
|
total = 0
|
||||||
net_profit_loss = {
|
net_profit_loss = {
|
||||||
"account_name": "'" + _("Profit for the year") + "'",
|
"account_name": "'" + _("Profit for the year") + "'",
|
||||||
"account": "'" + _("Profit for the year") + "'",
|
"account": "'" + _("Profit for the year") + "'",
|
||||||
"warn_if_negative": True,
|
"warn_if_negative": True,
|
||||||
"currency": frappe.db.get_value("Company", company, "default_currency")
|
"currency": currency or frappe.db.get_value("Company", company, "default_currency")
|
||||||
}
|
}
|
||||||
|
|
||||||
has_value = False
|
has_value = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user