mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-22 11:44:11 +00:00
feat: added ability to use custom html format for process statement of accounts (copy #45746) (#46012)
feat: added ability to use custom html format for process statement of accounts (#45746)
* feat: added ability to use custom print format for process statement of accounts documents.
* fix: handles missing hook issues
* chore: linter changes
---------
Co-authored-by: Boy4099 <mashtawayne4099@gmail.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
(cherry picked from commit a0cd08e9ea)
Co-authored-by: Steve Wilson <stevew9009@gmail.com>
This commit is contained in:
@@ -236,17 +236,21 @@ def get_ar_filters(doc, entry):
|
|||||||
|
|
||||||
def get_html(doc, filters, entry, col, res, ageing):
|
def get_html(doc, filters, entry, col, res, ageing):
|
||||||
base_template_path = "frappe/www/printview.html"
|
base_template_path = "frappe/www/printview.html"
|
||||||
template_path = (
|
template_path = "erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html"
|
||||||
"erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html"
|
if doc.report == "General Ledger":
|
||||||
if doc.report == "General Ledger"
|
template_path = (
|
||||||
else "erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html"
|
"erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
process_soa_html = frappe.get_hooks("process_soa_html")
|
||||||
|
# fetching custom print format for Process Statement of Accounts
|
||||||
|
if process_soa_html and process_soa_html.get(doc.report):
|
||||||
|
template_path = process_soa_html[doc.report][-1]
|
||||||
|
|
||||||
if doc.letter_head:
|
if doc.letter_head:
|
||||||
from frappe.www.printview import get_letter_head
|
from frappe.www.printview import get_letter_head
|
||||||
|
|
||||||
letter_head = get_letter_head(doc, 0)
|
letter_head = get_letter_head(doc, 0)
|
||||||
|
|
||||||
html = frappe.render_template(
|
html = frappe.render_template(
|
||||||
template_path,
|
template_path,
|
||||||
{
|
{
|
||||||
@@ -262,7 +266,6 @@ def get_html(doc, filters, entry, col, res, ageing):
|
|||||||
else None,
|
else None,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
html = frappe.render_template(
|
html = frappe.render_template(
|
||||||
base_template_path,
|
base_template_path,
|
||||||
{"body": html, "css": get_print_style(), "title": "Statement For " + entry.customer},
|
{"body": html, "css": get_print_style(), "title": "Statement For " + entry.customer},
|
||||||
|
|||||||
Reference in New Issue
Block a user