brotherton-erpnext/erpnext/regional/italy/sales_invoice.js
Gaurav b30a9b1869 fix(regional,italy): bank details, custom button on sales invoice
Updates to Bank details in e-invoice XML
Additional fields on Payment Schedule
Button to Generate E-Invoice on Sales Invoice (generates and replaces attached e-invoice)
Replaced `x.decode('utf-8')` with `frappe.safe_decode(x, encoding='utf-8')` in setup.py
Updated italian localisation patch line in patches.txt
2019-03-01 12:38:35 +05:30

20 lines
636 B
JavaScript

erpnext.setup_e_invoice_button = (doctype) => {
frappe.ui.form.on(doctype, {
refresh: (frm) => {
if(frm.doc.docstatus == 1) {
frm.add_custom_button('Generate E-Invoice', () => {
var w = window.open(
frappe.urllib.get_full_url(
"/api/method/erpnext.regional.italy.utils.generate_single_invoice?"
+ "docname=" + frm.doc.name
)
)
if (!w) {
frappe.msgprint(__("Please enable pop-ups")); return;
}
});
}
}
});
};