After Put The Sales Invoice,How ll i Create Make Payment button?

Hi,
After Put The Sales Invoice,Then I Click Make Patment entry button That Journal Voucher Doctype Automatically Open .How ll I Do This For My Own App???
Thanks…

See this code:

Aftr ths Journal Screen Is Open Automatically…How ll i Do tht?

Please follow the code. On clicking the button, it calls the
make_bank_entry function

after the server side execution, the callback function calls:

1 Like

$.extend(cur_frm.cscript, {
onload: function() {
erpnext.add_applicable_territory();
}
},
refresh: function() {
cur_frm.add_custom_button(__(“Make Payment Entry”), cur_frm.cscript.make_payment_voucher, “icon-money”);
});
cur_frm.cscript.make_payment_voucher = function() {
return frappe.call({
method: “erpnext.accounts.doctype.journal_entry.journal_entry.get_payment_entry_from_schedule_confirmation”,
args: {
“schedule_confirmation”: cur_frm.doc.name
},
callback: function(r) {
var doclist = frappe.model.sync(r.message);
frappe.set_route(“Form”, doclist[0].doctype, doclist[0].name);
}
}
});

Any Error In THs Program

After Click The Make Payment Button And The Journal Voucher Screen open Automatically…How I Do That?
Thanks