refactor: Payment btn criteria for Cr/Dr notes

(cherry picked from commit 60eee564bf)
This commit is contained in:
ruthra kumar
2023-08-23 17:58:15 +05:30
committed by Mergify
parent 1aeeac4d06
commit 956f05238a
2 changed files with 2 additions and 4 deletions

View File

@@ -99,8 +99,7 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
} }
} }
if(doc.docstatus == 1 && doc.outstanding_amount != 0 if(doc.docstatus == 1 && doc.outstanding_amount != 0 && !doc.on_hold) {
&& !(doc.is_return && doc.return_against) && !doc.on_hold) {
this.frm.add_custom_button( this.frm.add_custom_button(
__('Payment'), __('Payment'),
() => this.make_payment_entry(), () => this.make_payment_entry(),

View File

@@ -91,8 +91,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
if(doc.update_stock) this.show_stock_ledger(); if(doc.update_stock) this.show_stock_ledger();
if (doc.docstatus == 1 && doc.outstanding_amount!=0 if (doc.docstatus == 1 && doc.outstanding_amount!=0) {
&& !(cint(doc.is_return) && doc.return_against)) {
this.frm.add_custom_button( this.frm.add_custom_button(
__('Payment'), __('Payment'),
() => this.make_payment_entry(), () => this.make_payment_entry(),