fix: Ageing errors in PSOA
This commit is contained in:
parent
1ec53c1cf2
commit
178938b2f0
@ -60,8 +60,8 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<br><br>
|
<br><br>
|
||||||
{% if aging %}
|
{% if ageing %}
|
||||||
<h3 class="text-center">{{ _("Ageing Report Based On ") }} {{ aging.ageing_based_on }}</h3>
|
<h3 class="text-center">{{ _("Ageing Report Based On ") }} {{ ageing.ageing_based_on }}</h3>
|
||||||
<h5 class="text-center">
|
<h5 class="text-center">
|
||||||
{{ _("Up to " ) }} {{ frappe.format(filters.to_date, 'Date')}}
|
{{ _("Up to " ) }} {{ frappe.format(filters.to_date, 'Date')}}
|
||||||
</h5>
|
</h5>
|
||||||
@ -78,10 +78,10 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ aging.range1 }}</td>
|
<td>{{ frappe.utils.fmt_money(ageing.range1, currency=filters.presentation_currency) }}</td>
|
||||||
<td>{{ aging.range2 }}</td>
|
<td>{{ frappe.utils.fmt_money(ageing.range2, currency=filters.presentation_currency) }}</td>
|
||||||
<td>{{ aging.range3 }}</td>
|
<td>{{ frappe.utils.fmt_money(ageing.range3, currency=filters.presentation_currency) }}</td>
|
||||||
<td>{{ aging.range4 }}</td>
|
<td>{{ frappe.utils.fmt_money(ageing.range4, currency=filters.presentation_currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -38,7 +38,7 @@ class ProcessStatementOfAccounts(Document):
|
|||||||
|
|
||||||
def get_report_pdf(doc, consolidated=True):
|
def get_report_pdf(doc, consolidated=True):
|
||||||
statement_dict = {}
|
statement_dict = {}
|
||||||
aging = ''
|
ageing = ''
|
||||||
base_template_path = "frappe/www/printview.html"
|
base_template_path = "frappe/www/printview.html"
|
||||||
template_path = "erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html"
|
template_path = "erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html"
|
||||||
|
|
||||||
@ -54,8 +54,10 @@ def get_report_pdf(doc, consolidated=True):
|
|||||||
'range4': 120,
|
'range4': 120,
|
||||||
'customer': entry.customer
|
'customer': entry.customer
|
||||||
})
|
})
|
||||||
col1, aging = get_ageing(ageing_filters)
|
col1, ageing = get_ageing(ageing_filters)
|
||||||
aging[0]['ageing_based_on'] = doc.ageing_based_on
|
|
||||||
|
if ageing:
|
||||||
|
ageing[0]['ageing_based_on'] = doc.ageing_based_on
|
||||||
|
|
||||||
tax_id = frappe.get_doc('Customer', entry.customer).tax_id
|
tax_id = frappe.get_doc('Customer', entry.customer).tax_id
|
||||||
|
|
||||||
@ -83,11 +85,14 @@ def get_report_pdf(doc, consolidated=True):
|
|||||||
|
|
||||||
if len(res) == 3:
|
if len(res) == 3:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
html = frappe.render_template(template_path, \
|
html = frappe.render_template(template_path, \
|
||||||
{"filters": filters, "data": res, "aging": aging[0] if doc.include_ageing else None})
|
{"filters": filters, "data": res, "ageing": ageing[0] if (doc.include_ageing and ageing) else None})
|
||||||
|
|
||||||
html = frappe.render_template(base_template_path, {"body": html, \
|
html = frappe.render_template(base_template_path, {"body": html, \
|
||||||
"css": get_print_style(), "title": "Statement For " + entry.customer})
|
"css": get_print_style(), "title": "Statement For " + entry.customer})
|
||||||
statement_dict[entry.customer] = html
|
statement_dict[entry.customer] = html
|
||||||
|
|
||||||
if not bool(statement_dict):
|
if not bool(statement_dict):
|
||||||
return False
|
return False
|
||||||
elif consolidated:
|
elif consolidated:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user