style: change formatting
This commit is contained in:
parent
644e181729
commit
93c9a99548
@ -1,30 +1,30 @@
|
|||||||
frappe.ui.form.on('Payment Order', {
|
frappe.ui.form.on('Payment Order', {
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
if (frm.doc.docstatus==1 && frm.doc.payment_order_type==='Payment Entry') {
|
if (frm.doc.docstatus==1 && frm.doc.payment_order_type==='Payment Entry') {
|
||||||
frm.add_custom_button(__('Generate Text File'),
|
frm.add_custom_button(__('Generate Text File'),
|
||||||
function() {
|
function() {
|
||||||
frm.trigger("generate_text_and_download_file");
|
frm.trigger("generate_text_and_download_file");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
generate_text_and_download_file: (frm) => {
|
generate_text_and_download_file: (frm) => {
|
||||||
return frappe.call({
|
return frappe.call({
|
||||||
method: "erpnext.regional.india.bank_remittance_txt.generate_report",
|
method: "erpnext.regional.india.bank_remittance_txt.generate_report",
|
||||||
args: {
|
args: {
|
||||||
name: frm.doc.name
|
name: frm.doc.name
|
||||||
},
|
},
|
||||||
freeze: true,
|
freeze: true,
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
{
|
{
|
||||||
frm.refresh();
|
frm.refresh();
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
let file_obj = r.message;
|
let file_obj = r.message;
|
||||||
a.href = file_obj.file_url;
|
a.href = file_obj.file_url;
|
||||||
a.target = '_blank';
|
a.target = '_blank';
|
||||||
a.download = file_obj.file_name;
|
a.download = file_obj.file_name;
|
||||||
a.click();
|
a.click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
Loading…
x
Reference in New Issue
Block a user