mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-16 10:20:31 +00:00
* ci: add prettier to pre-commit
(cherry picked from commit 2c16036ef3)
* style: format js files
---------
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
@@ -1,60 +1,78 @@
|
||||
frappe.provide('erpnext.accounts');
|
||||
frappe.provide("erpnext.accounts");
|
||||
|
||||
erpnext.accounts.ledger_preview = {
|
||||
show_accounting_ledger_preview(frm) {
|
||||
let me = this;
|
||||
if(!frm.is_new() && frm.doc.docstatus == 0) {
|
||||
frm.add_custom_button(__('Accounting Ledger'), function() {
|
||||
frappe.call({
|
||||
"type": "GET",
|
||||
"method": "erpnext.controllers.stock_controller.show_accounting_ledger_preview",
|
||||
"args": {
|
||||
"company": frm.doc.company,
|
||||
"doctype": frm.doc.doctype,
|
||||
"docname": frm.doc.name
|
||||
},
|
||||
"callback": function(response) {
|
||||
me.make_dialog("Accounting Ledger Preview", "accounting_ledger_preview_html", response.message.gl_columns, response.message.gl_data);
|
||||
}
|
||||
})
|
||||
}, __("Preview"));
|
||||
if (!frm.is_new() && frm.doc.docstatus == 0) {
|
||||
frm.add_custom_button(
|
||||
__("Accounting Ledger"),
|
||||
function () {
|
||||
frappe.call({
|
||||
type: "GET",
|
||||
method: "erpnext.controllers.stock_controller.show_accounting_ledger_preview",
|
||||
args: {
|
||||
company: frm.doc.company,
|
||||
doctype: frm.doc.doctype,
|
||||
docname: frm.doc.name,
|
||||
},
|
||||
callback: function (response) {
|
||||
me.make_dialog(
|
||||
"Accounting Ledger Preview",
|
||||
"accounting_ledger_preview_html",
|
||||
response.message.gl_columns,
|
||||
response.message.gl_data
|
||||
);
|
||||
},
|
||||
});
|
||||
},
|
||||
__("Preview")
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
show_stock_ledger_preview(frm) {
|
||||
let me = this
|
||||
if(!frm.is_new() && frm.doc.docstatus == 0) {
|
||||
frm.add_custom_button(__('Stock Ledger'), function() {
|
||||
frappe.call({
|
||||
"type": "GET",
|
||||
"method": "erpnext.controllers.stock_controller.show_stock_ledger_preview",
|
||||
"args": {
|
||||
"company": frm.doc.company,
|
||||
"doctype": frm.doc.doctype,
|
||||
"docname": frm.doc.name
|
||||
},
|
||||
"callback": function(response) {
|
||||
me.make_dialog("Stock Ledger Preview", "stock_ledger_preview_html", response.message.sl_columns, response.message.sl_data);
|
||||
}
|
||||
})
|
||||
}, __("Preview"));
|
||||
let me = this;
|
||||
if (!frm.is_new() && frm.doc.docstatus == 0) {
|
||||
frm.add_custom_button(
|
||||
__("Stock Ledger"),
|
||||
function () {
|
||||
frappe.call({
|
||||
type: "GET",
|
||||
method: "erpnext.controllers.stock_controller.show_stock_ledger_preview",
|
||||
args: {
|
||||
company: frm.doc.company,
|
||||
doctype: frm.doc.doctype,
|
||||
docname: frm.doc.name,
|
||||
},
|
||||
callback: function (response) {
|
||||
me.make_dialog(
|
||||
"Stock Ledger Preview",
|
||||
"stock_ledger_preview_html",
|
||||
response.message.sl_columns,
|
||||
response.message.sl_data
|
||||
);
|
||||
},
|
||||
});
|
||||
},
|
||||
__("Preview")
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
make_dialog(label, fieldname, columns, data) {
|
||||
let me = this;
|
||||
let dialog = new frappe.ui.Dialog({
|
||||
"size": "extra-large",
|
||||
"title": __(label),
|
||||
"fields": [
|
||||
size: "extra-large",
|
||||
title: __(label),
|
||||
fields: [
|
||||
{
|
||||
"fieldtype": "HTML",
|
||||
"fieldname": fieldname,
|
||||
fieldtype: "HTML",
|
||||
fieldname: fieldname,
|
||||
},
|
||||
]
|
||||
],
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
me.get_datatable(columns, data, dialog.get_field(fieldname).wrapper);
|
||||
}, 200);
|
||||
|
||||
@@ -70,9 +88,6 @@ erpnext.accounts.ledger_preview = {
|
||||
inlineFilters: true,
|
||||
};
|
||||
|
||||
new frappe.DataTable(
|
||||
wrapper,
|
||||
datatable_options
|
||||
);
|
||||
}
|
||||
}
|
||||
new frappe.DataTable(wrapper, datatable_options);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user