feat: show formatted currency symbol on ledger preview

(cherry picked from commit 5c8cb1e7ec)
This commit is contained in:
Navin-S-R
2026-02-11 17:29:20 +05:30
committed by Mergify
parent 0d831aad41
commit b844afe0ec
2 changed files with 9 additions and 1 deletions

View File

@@ -2017,7 +2017,7 @@ def get_gl_entries_for_preview(doctype, docname, fields):
def get_columns(raw_columns, fields): def get_columns(raw_columns, fields):
return [ return [
{"name": d.get("label"), "editable": False, "width": 110} {"name": d.get("label"), "editable": False, "width": 110, "fieldtype": d.get("fieldtype")}
for d in raw_columns for d in raw_columns
if not d.get("hidden") and d.get("fieldname") in fields if not d.get("hidden") and d.get("fieldname") in fields
] ]

View File

@@ -84,6 +84,14 @@ erpnext.accounts.ledger_preview = {
}, },
get_datatable(columns, data, wrapper) { get_datatable(columns, data, wrapper) {
columns.forEach((col) => {
if (col.fieldtype === "Currency") {
col.format = (value) => {
return format_currency(value);
};
}
});
const datatable_options = { const datatable_options = {
columns: columns, columns: columns,
data: data, data: data,