From 0d4f56bf849eae216f9a48cf2b1b3f6c838d574e Mon Sep 17 00:00:00 2001 From: Shllokkk Date: Thu, 26 Mar 2026 17:23:15 +0530 Subject: [PATCH] refactor: table body data rendering cleanup --- .../general_ledger_standard.json | 4 +- .../report/general_ledger/general_ledger.html | 153 +++++++++--------- 2 files changed, 82 insertions(+), 75 deletions(-) diff --git a/erpnext/accounts/print_format/general_ledger_standard/general_ledger_standard.json b/erpnext/accounts/print_format/general_ledger_standard/general_ledger_standard.json index da4fe92a006..05efcc4aab6 100644 --- a/erpnext/accounts/print_format/general_ledger_standard/general_ledger_standard.json +++ b/erpnext/accounts/print_format/general_ledger_standard/general_ledger_standard.json @@ -8,14 +8,14 @@ "docstatus": 0, "doctype": "Print Format", "font_size": 14, - "html": "\n\n
\n\n
\n\n
\n
\n {%= __(\"STATEMENT OF ACCOUNTS\") %}\n
\n
\n\n {% if (subtitle && subtitle.trim()) { %}\n
\n {{ subtitle }}\n
\n {% } else { %}\n
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t{%= __(\"Customer\") %}:\n\t\t\t\t\t{%= \n\t\t\t\t\t\t(filters.party.length && filters.party.join(\", \")) || filters.party_name || \"All Parties\"\n\t\t\t\t\t%}\n\t\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t{%= __(\"Statement Period\") %}:\n\t\t\t\t\t{%= __(\"{0} to {1}\", [\n\t\t\t\t\t\tfrappe.datetime.str_to_user(filters.from_date),\n\t\t\t\t\t\tfrappe.datetime.str_to_user(filters.to_date)\n\t\t\t\t\t]) %}\n\t\t\t\t
\n\t\t\t
\n\t\t
\n {% } %}\n\n
\n \n \n \n \n \n\n {% if(filters.show_remarks) { %}\n \n {% } %}\n\n \n \n \n \n \n\n \n {% for(var i=0, l=data.length; i\n\n \n\n \n\n {% if(filters.show_remarks) { %}\n \n {% } %}\n\n \n\n \n\n \n\n \n {% endfor %}\n \n
{%= __(\"Date\") %}{%= __(\"Voucher Details\") %}{%= __(\"Remarks\") %}{%= __(\"Debit\") %}{%= __(\"Credit\") %}{%= __(\"Balance\") %}
\n {% if(row.posting_date) { %}\n {%= frappe.datetime.str_to_user(row.posting_date) %}\n {% } else if(i == 0) { %}\n {%= frappe.datetime.str_to_user(filters.from_date) %}\n {% } %}\n \n {% if(row.posting_date) { %}\n {%= row.voucher_type %} {%= row.voucher_no %}\n\n {% if(!(filters.party || filters.account)) { %}\n
\n {%= row.party || row.account %}\n
\n {% } %}\n\n {% if(row.bill_no) { %}\n
\n {%= __(\"Supplier Invoice No\") %}: {%= row.bill_no %}\n
\n {% } %}\n\n {% } else { %}\n {% if(i == l-2) { %}\n {%= __(\"Total\") %}\n {% } else if(i == l-1) { %}\n {%= __(\"Closing [Opening + Total] \") %}\n {% } else { %}\n {%= frappe.format(row.account, {fieldtype: \"Link\"}) || \" \" %}\n {% } %}\n {% } %}\n
\n {% if(row.posting_date && row.remarks && row.remarks != \"No Remarks\") { %}\n {%= row.remarks %}\n {% } %}\n \n {% if(row.posting_date) { %}\n {% if(row.debit != 0) { %}\n {%= format_currency(row.debit, filters.presentation_currency) %}\n {% } %}\n {% } else if(i != 0 && i != l-1) { %}\n {%= row.account && format_currency(row.debit, filters.presentation_currency) %}\n {% } %}\n \n {% if(row.posting_date) { %}\n {% if(row.credit != 0) { %}\n {%= format_currency(row.credit, filters.presentation_currency) %}\n {% } %}\n {% } else if(i != 0 && i != l-1) { %}\n {%= row.account && format_currency(row.credit, filters.presentation_currency) %}\n {% } %}\n \n {% if(i == l-1) { %}\n {%= format_currency(row.balance, filters.presentation_currency) %}\n {% if(row.balance < 0){ %} Cr{% } %}\n {% if(row.balance > 0){ %} Dr{% } %}\n {% } else { %}\n {%= format_currency(row.balance, filters.presentation_currency) %}\n {% } %}\n
\n
\n\n

\n {%= __(\"Printed on {0}\", [\n frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())\n ]) %}\n

\n\n
", + "html": "\n\n
\n\n
\n\n
\n
\n {%= __(\"Statement Of Accounts\") %}\n
\n
\n\n {% if (subtitle && subtitle.trim()) { %}\n
\n {{ subtitle }}\n
\n {% } else { %}\n
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t{%= __(\"Customer\") %}:\n\t\t\t\t\t{%=\n\t\t\t\t\t\t(filters.party.length && filters.party.join(\", \")) || filters.party_name || \"All Parties\"\n\t\t\t\t\t%}\n\t\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t{%= __(\"Statement Period\") %}:\n\t\t\t\t\t{%= __(\"{0} to {1}\", [\n\t\t\t\t\t\tfrappe.datetime.str_to_user(filters.from_date),\n\t\t\t\t\t\tfrappe.datetime.str_to_user(filters.to_date)\n\t\t\t\t\t]) %}\n\t\t\t\t
\n\t\t\t
\n\t\t
\n {% } %}\n\n
\n \n \n \n \n \n\n {% if(filters.show_remarks) { %}\n \n {% } %}\n\n \n \n \n \n \n\n \n\t\t\t\t{% for(var i=0, l=data.length; i\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t{% if(filters.show_remarks) { %}\n\t\t\t\t\t\t\n\t\t\t\t\t\t{% } %}\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t{% } %}\n\t\t\t\n
{%= __(\"Date\") %}{%= __(\"Voucher Details\") %}{%= __(\"Remarks\") %}{%= __(\"Debit\") %}{%= __(\"Credit\") %}{%= __(\"Balance\") %}
\n\t\t\t\t\t\t\t{% if(is_entry) { %}\n\t\t\t\t\t\t\t\t{%= frappe.datetime.str_to_user(row.posting_date) %}\n\t\t\t\t\t\t\t{% } else if(i == 0) { %}\n\t\t\t\t\t\t\t\t{%= frappe.datetime.str_to_user(filters.from_date) %}\n\t\t\t\t\t\t\t{% } %}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{% if(is_entry) { %}\n\n\t\t\t\t\t\t\t\t{%= row.voucher_type %} {%= row.voucher_no %}\n\n\t\t\t\t\t\t\t\t{% if(!(filters.party || filters.account)) { %}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t{%= row.party || row.account %}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{% } %}\n\n\t\t\t\t\t\t\t\t{% if(row.bill_no) { %}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t{%= __(\"Supplier Invoice No\") %}: {%= row.bill_no %}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{% } %}\n\n\t\t\t\t\t\t\t{% } else { %}\n\n\t\t\t\t\t\t\t\t{% if(is_second_last) { %}\n\t\t\t\t\t\t\t\t\t{%= __(\"Total\") %}\n\t\t\t\t\t\t\t\t{% } else if(is_last) { %}\n\t\t\t\t\t\t\t\t\t{%= __(\"Closing [Opening + Total] \") %}\n\t\t\t\t\t\t\t\t{% } else { %}\n\t\t\t\t\t\t\t\t\t{%= frappe.format(row.account, {fieldtype: \"Link\"}) || \" \" %}\n\t\t\t\t\t\t\t\t{% } %}\n\n\t\t\t\t\t\t\t{% } %}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{% if(is_entry && row.remarks && row.remarks != \"No Remarks\") { %}\n\t\t\t\t\t\t\t\t{%= row.remarks %}\n\t\t\t\t\t\t\t{% } %}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{% if(is_entry) { %}\n\t\t\t\t\t\t\t\t{% if(row.debit != 0) { %}\n\t\t\t\t\t\t\t\t\t{%= format_currency(row.debit, filters.presentation_currency) %}\n\t\t\t\t\t\t\t\t{% } %}\n\t\t\t\t\t\t\t{% } else if(i != 0 && !is_last) { %}\n\t\t\t\t\t\t\t\t{%= row.account && format_currency(row.debit, filters.presentation_currency) %}\n\t\t\t\t\t\t\t{% } %}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{% if(is_entry) { %}\n\t\t\t\t\t\t\t\t{% if(row.credit != 0) { %}\n\t\t\t\t\t\t\t\t\t{%= format_currency(row.credit, filters.presentation_currency) %}\n\t\t\t\t\t\t\t\t{% } %}\n\t\t\t\t\t\t\t{% } else if(i != 0 && !is_last) { %}\n\t\t\t\t\t\t\t\t{%= row.account && format_currency(row.credit, filters.presentation_currency) %}\n\t\t\t\t\t\t\t{% } %}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{% if(is_last) { %}\n\t\t\t\t\t\t\t\t{%= format_currency(row.balance, filters.presentation_currency) %}\n\t\t\t\t\t\t\t\t{% if(row.balance < 0) { %} Cr{% } %}\n\t\t\t\t\t\t\t\t{% if(row.balance > 0) { %} Dr{% } %}\n\t\t\t\t\t\t\t{% } else { %}\n\t\t\t\t\t\t\t\t{%= format_currency(row.balance, filters.presentation_currency) %}\n\t\t\t\t\t\t\t{% } %}\n\t\t\t\t\t\t
\n
\n\n

\n {%= __(\"Printed on {0}\", [\n frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())\n ]) %}\n

\n\n
", "idx": 0, "line_breaks": 0, "margin_bottom": 15.0, "margin_left": 15.0, "margin_right": 15.0, "margin_top": 15.0, - "modified": "2026-03-26 12:02:00.022093", + "modified": "2026-03-26 17:07:36.264246", "modified_by": "Administrator", "module": "Accounts", "name": "General Ledger Standard", diff --git a/erpnext/accounts/report/general_ledger/general_ledger.html b/erpnext/accounts/report/general_ledger/general_ledger.html index cb3fdddac73..c620986bc2c 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.html +++ b/erpnext/accounts/report/general_ledger/general_ledger.html @@ -11,7 +11,7 @@ } .title-letter-spacing { - font-size: 14px; + font-size: 15px; font-weight: 600; color: #171717; } @@ -117,7 +117,7 @@
- {%= __("STATEMENT OF ACCOUNTS") %} + {%= __("Statement Of Accounts") %}
@@ -156,7 +156,7 @@ {%= __("Voucher Details") %} {% if(filters.show_remarks) { %} - {%= __("Remarks") %} + {%= __("Remarks") %} {% } %} {%= __("Debit") %} @@ -166,86 +166,93 @@ - {% for(var i=0, l=data.length; i + {% for(var i=0, l=data.length; i - {% if(row.posting_date) { %} - {%= frappe.datetime.str_to_user(row.posting_date) %} - {% } else if(i == 0) { %} - {%= frappe.datetime.str_to_user(filters.from_date) %} - {% } %} - + - - {% if(row.posting_date) { %} - {%= row.voucher_type %} {%= row.voucher_no %} + + {% if(is_entry) { %} + {%= frappe.datetime.str_to_user(row.posting_date) %} + {% } else if(i == 0) { %} + {%= frappe.datetime.str_to_user(filters.from_date) %} + {% } %} + - {% if(!(filters.party || filters.account)) { %} -
- {%= row.party || row.account %} -
- {% } %} + + {% if(is_entry) { %} - {% if(row.bill_no) { %} -
- {%= __("Supplier Invoice No") %}: {%= row.bill_no %} -
- {% } %} + {%= row.voucher_type %} {%= row.voucher_no %} - {% } else { %} - {% if(i == l-2) { %} - {%= __("Total") %} - {% } else if(i == l-1) { %} - {%= __("Closing [Opening + Total] ") %} - {% } else { %} - {%= frappe.format(row.account, {fieldtype: "Link"}) || " " %} - {% } %} - {% } %} - + {% if(!(filters.party || filters.account)) { %} +
+ {%= row.party || row.account %} +
+ {% } %} - {% if(filters.show_remarks) { %} - - {% if(row.posting_date && row.remarks && row.remarks != "No Remarks") { %} - {%= row.remarks %} - {% } %} - - {% } %} + {% if(row.bill_no) { %} +
+ {%= __("Supplier Invoice No") %}: {%= row.bill_no %} +
+ {% } %} - - {% if(row.posting_date) { %} - {% if(row.debit != 0) { %} - {%= format_currency(row.debit, filters.presentation_currency) %} - {% } %} - {% } else if(i != 0 && i != l-1) { %} - {%= row.account && format_currency(row.debit, filters.presentation_currency) %} - {% } %} - + {% } else { %} - - {% if(row.posting_date) { %} - {% if(row.credit != 0) { %} - {%= format_currency(row.credit, filters.presentation_currency) %} - {% } %} - {% } else if(i != 0 && i != l-1) { %} - {%= row.account && format_currency(row.credit, filters.presentation_currency) %} - {% } %} - + {% if(is_second_last) { %} + {%= __("Total") %} + {% } else if(is_last) { %} + {%= __("Closing [Opening + Total] ") %} + {% } else { %} + {%= frappe.format(row.account, {fieldtype: "Link"}) || " " %} + {% } %} - - {% if(i == l-1) { %} - {%= format_currency(row.balance, filters.presentation_currency) %} - {% if(row.balance < 0){ %} Cr{% } %} - {% if(row.balance > 0){ %} Dr{% } %} - {% } else { %} - {%= format_currency(row.balance, filters.presentation_currency) %} - {% } %} - + {% } %} + - - {% endfor %} - + {% if(filters.show_remarks) { %} + + {% if(is_entry && row.remarks && row.remarks != "No Remarks") { %} + {%= row.remarks %} + {% } %} + + {% } %} + + + {% if(is_entry) { %} + {% if(row.debit != 0) { %} + {%= format_currency(row.debit, filters.presentation_currency) %} + {% } %} + {% } else if(i != 0 && !is_last) { %} + {%= row.account && format_currency(row.debit, filters.presentation_currency) %} + {% } %} + + + + {% if(is_entry) { %} + {% if(row.credit != 0) { %} + {%= format_currency(row.credit, filters.presentation_currency) %} + {% } %} + {% } else if(i != 0 && !is_last) { %} + {%= row.account && format_currency(row.credit, filters.presentation_currency) %} + {% } %} + + + + {% if(is_last) { %} + {%= format_currency(row.balance, filters.presentation_currency) %} + {% if(row.balance < 0) { %} Cr{% } %} + {% if(row.balance > 0) { %} Dr{% } %} + {% } else { %} + {%= format_currency(row.balance, filters.presentation_currency) %} + {% } %} + + + + {% } %} +