Merge pull request #15567 from rohitwaghchaure/fix_payment_request
[Fix] Payment request not working
This commit is contained in:
commit
d6cacbe565
@ -77,8 +77,9 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (doc.outstanding_amount > 0 && !cint(doc.is_return)) {
|
if (doc.outstanding_amount > 0 && !cint(doc.is_return)) {
|
||||||
cur_frm.add_custom_button(__('Payment Request'),
|
cur_frm.add_custom_button(__('Payment Request'), function() {
|
||||||
this.make_payment_request, __("Make"));
|
me.make_payment_request()
|
||||||
|
}, __("Make"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doc.docstatus===0) {
|
if(doc.docstatus===0) {
|
||||||
|
@ -35,6 +35,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
},
|
},
|
||||||
|
|
||||||
refresh: function(doc, dt, dn) {
|
refresh: function(doc, dt, dn) {
|
||||||
|
const me = this;
|
||||||
this._super();
|
this._super();
|
||||||
if(cur_frm.msgbox && cur_frm.msgbox.$wrapper.is(":visible")) {
|
if(cur_frm.msgbox && cur_frm.msgbox.$wrapper.is(":visible")) {
|
||||||
// hide new msgbox
|
// hide new msgbox
|
||||||
@ -82,9 +83,10 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doc.outstanding_amount>0 && !cint(doc.is_return)) {
|
if (doc.outstanding_amount>0 && !cint(doc.is_return)) {
|
||||||
cur_frm.add_custom_button(__('Payment Request'),
|
cur_frm.add_custom_button(__('Payment Request'), function() {
|
||||||
this.make_payment_request, __("Make"));
|
me.make_payment_request();
|
||||||
|
}, __("Make"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!doc.auto_repeat) {
|
if(!doc.auto_repeat) {
|
||||||
@ -102,7 +104,6 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.set_default_print_format();
|
this.set_default_print_format();
|
||||||
var me = this;
|
|
||||||
if (doc.docstatus == 1 && !doc.inter_company_invoice_reference) {
|
if (doc.docstatus == 1 && !doc.inter_company_invoice_reference) {
|
||||||
frappe.model.with_doc("Customer", me.frm.doc.customer, function() {
|
frappe.model.with_doc("Customer", me.frm.doc.customer, function() {
|
||||||
var customer = frappe.model.get_doc("Customer", me.frm.doc.customer);
|
var customer = frappe.model.get_doc("Customer", me.frm.doc.customer);
|
||||||
|
@ -211,8 +211,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
make_payment_request: function() {
|
make_payment_request: function() {
|
||||||
const me = this;
|
var me = this;
|
||||||
const payment_request_type = (in_list(['Sales Order', 'Sales Invoice'], me.frm.doc.doctype))
|
const payment_request_type = (in_list(['Sales Order', 'Sales Invoice'], this.frm.doc.doctype))
|
||||||
? "Inward" : "Outward";
|
? "Inward" : "Outward";
|
||||||
|
|
||||||
frappe.call({
|
frappe.call({
|
||||||
|
Loading…
Reference in New Issue
Block a user