[enhance] Payment order (#15056)

This commit is contained in:
rohitwaghchaure
2018-09-11 17:40:37 +05:30
committed by Nabin Hait
parent 76b31deda5
commit 713cfc786f
25 changed files with 2817 additions and 766 deletions

View File

@@ -210,6 +210,30 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
});
},
make_payment_request: function() {
const me = this;
const payment_request_type = (in_list(['Sales Order', 'Sales Invoice'], me.frm.doc.doctype))
? "Inward" : "Outward";
frappe.call({
method:"erpnext.accounts.doctype.payment_request.payment_request.make_payment_request",
args: {
dt: me.frm.doc.doctype,
dn: me.frm.doc.name,
recipient_id: me.frm.doc.contact_email,
payment_request_type: payment_request_type,
party_type: payment_request_type == 'Outward' ? "Supplier" : "Customer",
party: payment_request_type == 'Outward' ? me.frm.doc.supplier : me.frm.doc.customer
},
callback: function(r) {
if(!r.exc){
var doc = frappe.model.sync(r.message);
frappe.set_route("Form", r.message.doctype, r.message.name);
}
}
})
},
onload_post_render: function() {
if(this.frm.doc.__islocal && !(this.frm.doc.taxes || []).length
&& !(this.frm.doc.__onload ? this.frm.doc.__onload.load_after_mapping : false)) {