feat: show formatted currency symbol on ledger preview

This commit is contained in:
Navin-S-R
2026-02-11 17:29:20 +05:30
parent da07f84e44
commit 5c8cb1e7ec
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):
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
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) {
columns.forEach((col) => {
if (col.fieldtype === "Currency") {
col.format = (value) => {
return format_currency(value);
};
}
});
const datatable_options = {
columns: columns,
data: data,