mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-25 17:48:30 +00:00
feat: show formatted currency symbol on ledger preview
(cherry picked from commit 5c8cb1e7ec)
This commit is contained in:
@@ -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
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user