mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
fix: dialog is undefined
This commit is contained in:
@@ -246,13 +246,12 @@ const request_irn_generation = (frm, dialog) => {
|
|||||||
method: 'erpnext.regional.india.e_invoice.utils.generate_irn',
|
method: 'erpnext.regional.india.e_invoice.utils.generate_irn',
|
||||||
args: { doctype: frm.doc.doctype, docname: frm.doc.name },
|
args: { doctype: frm.doc.doctype, docname: frm.doc.name },
|
||||||
freeze: true,
|
freeze: true,
|
||||||
callback: () => frm.reload_doc() || dialog.hide(),
|
callback: () => frm.reload_doc()
|
||||||
error: () => dialog.hide()
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const get_preview_dialog = (frm, action) => {
|
const get_preview_dialog = (frm, action) => {
|
||||||
return new frappe.ui.Dialog({
|
const dialog = new frappe.ui.Dialog({
|
||||||
title: __("Preview"),
|
title: __("Preview"),
|
||||||
wide: 1,
|
wide: 1,
|
||||||
fields: [
|
fields: [
|
||||||
@@ -262,16 +261,17 @@ const get_preview_dialog = (frm, action) => {
|
|||||||
"fieldtype": "HTML"
|
"fieldtype": "HTML"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
primary_action: () => action(frm),
|
primary_action: () => action(frm) || dialog.hide(),
|
||||||
primary_action_label: __('Generate IRN')
|
primary_action_label: __('Generate IRN')
|
||||||
});
|
});
|
||||||
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
const show_einvoice_preview = (frm, einvoice) => {
|
const show_einvoice_preview = (frm, einvoice) => {
|
||||||
const preview_dialog = get_preview_dialog(frm, request_irn_generation);
|
const preview_dialog = get_preview_dialog(frm, request_irn_generation);
|
||||||
|
|
||||||
// initialize empty e-invoice fields
|
// initialize e-invoice fields
|
||||||
einvoice.Irn = einvoice.AckNo = ''; einvoice.AckDate = frappe.datetime.nowdate();
|
einvoice["Irn"] = einvoice["AckNo"] = ''; einvoice["AckDt"] = frappe.datetime.nowdate();
|
||||||
frm.doc.signed_einvoice = JSON.stringify(einvoice);
|
frm.doc.signed_einvoice = JSON.stringify(einvoice);
|
||||||
|
|
||||||
// initialize preview wrapper
|
// initialize preview wrapper
|
||||||
|
|||||||
Reference in New Issue
Block a user