feat: add generate txt file button for india region

This commit is contained in:
Mangesh-Khairnar 2019-05-03 21:19:02 +05:30
parent 0faf9f5f8c
commit 48d88b0478

View File

@ -0,0 +1,22 @@
frappe.ui.form.on('Payment Order', {
refresh: function(frm) {
if (frm.doc.docstatus==1) {
frm.add_custom_button(__('Generate Text File'),
function() {
frm.trigger("generate_text_and_download_file");
});
}
},
generate_text_and_download_file: (frm) => {
return frappe.call({
method: "erpnext.regional.india.bank_remittance_txt.generate_report_and_get_url",
args: {
name: this.frm.name,
},
freeze: true,
callback: function(r) {
frm.refresh();
}
});
}
});