fix: Move ledger display to dialog
This commit is contained in:
parent
011ac131cf
commit
ed76ee3e16
@ -211,12 +211,7 @@
|
|||||||
"is_discounted",
|
"is_discounted",
|
||||||
"remarks",
|
"remarks",
|
||||||
"repost_required",
|
"repost_required",
|
||||||
"connections_tab",
|
"connections_tab"
|
||||||
"ledger_preview",
|
|
||||||
"accounting_ledger_section",
|
|
||||||
"accounting_ledger_preview_html",
|
|
||||||
"stock_ledger_section",
|
|
||||||
"stock_ledger_preview_html"
|
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@ -2147,29 +2142,6 @@
|
|||||||
"fieldname": "use_company_roundoff_cost_center",
|
"fieldname": "use_company_roundoff_cost_center",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Use Company default Cost Center for Round off"
|
"label": "Use Company default Cost Center for Round off"
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "ledger_preview",
|
|
||||||
"fieldtype": "Tab Break",
|
|
||||||
"label": "Ledger Preview"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "accounting_ledger_section",
|
|
||||||
"fieldtype": "Section Break",
|
|
||||||
"label": "Accounting Ledger"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "accounting_ledger_preview_html",
|
|
||||||
"fieldtype": "HTML"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "stock_ledger_section",
|
|
||||||
"fieldtype": "Section Break",
|
|
||||||
"label": "Stock Ledger"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "stock_ledger_preview_html",
|
|
||||||
"fieldtype": "HTML"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-file-text",
|
"icon": "fa fa-file-text",
|
||||||
@ -2182,7 +2154,7 @@
|
|||||||
"link_fieldname": "consolidated_invoice"
|
"link_fieldname": "consolidated_invoice"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2023-06-11 11:18:14.024258",
|
"modified": "2023-06-21 16:02:18.988799",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Sales Invoice",
|
"name": "Sales Invoice",
|
||||||
|
@ -94,15 +94,44 @@ erpnext.stock.StockController = class StockController extends frappe.ui.form.Con
|
|||||||
"docname": me.frm.doc.name
|
"docname": me.frm.doc.name
|
||||||
},
|
},
|
||||||
"callback": function(response) {
|
"callback": function(response) {
|
||||||
me.get_datatable(response.message.gl_columns, response.message.gl_data, me.frm.get_field("accounting_ledger_preview_html").wrapper);
|
me.make_dialog(response.message);
|
||||||
me.get_datatable(response.message.sl_columns, response.message.sl_data, me.frm.get_field("stock_ledger_preview_html").wrapper);
|
|
||||||
me.frm.scroll_to_field("accounting_ledger_preview_html");
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, __("View"));
|
}, __("View"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
make_dialog(data) {
|
||||||
|
let me = this;
|
||||||
|
let gl_columns = data.gl_columns;
|
||||||
|
let gl_data = data.gl_data;
|
||||||
|
let sl_columns = data.sl_columns;
|
||||||
|
let sl_data = data.sl_data;
|
||||||
|
|
||||||
|
let dialog = new frappe.ui.Dialog({
|
||||||
|
"size": "extra-large",
|
||||||
|
"title": __("Ledger Preview"),
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"fieldtype": "HTML",
|
||||||
|
"fieldname": "accounting_ledger_preview_html",
|
||||||
|
"label": __("Accounting Ledger"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldtype": "HTML",
|
||||||
|
"fieldname": "stock_ledger_preview_html",
|
||||||
|
"label": __("Stock Ledger"),
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
me.get_datatable(gl_columns, gl_data, dialog.get_field("accounting_ledger_preview_html").wrapper);
|
||||||
|
}, 200);
|
||||||
|
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
get_datatable(columns, data, wrapper) {
|
get_datatable(columns, data, wrapper) {
|
||||||
const datatable_options = {
|
const datatable_options = {
|
||||||
columns: columns,
|
columns: columns,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user