refactor: Payment btn criteria for Cr/Dr notes

This commit is contained in:
ruthra kumar 2023-08-23 17:58:15 +05:30
parent 8f695123cd
commit 60eee564bf
2 changed files with 2 additions and 4 deletions

View File

@ -86,8 +86,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

@ -98,8 +98,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
erpnext.accounts.ledger_preview.show_stock_ledger_preview(this.frm); erpnext.accounts.ledger_preview.show_stock_ledger_preview(this.frm);
} }
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(),