From 5003082b281e37f2eeef310dbe90038807e02809 Mon Sep 17 00:00:00 2001 From: "Nihantra C. Patel" <141945075+Nihantra-Patel@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:02:18 +0530 Subject: [PATCH] fix: creation of return/credit note from sales invoice --- erpnext/accounts/doctype/sales_invoice/sales_invoice.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index f9141261bf4..174518cf3d3 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -113,7 +113,11 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e }) if (doc.outstanding_amount >= 0 || Math.abs(flt(doc.outstanding_amount)) < flt(doc.grand_total)) { - this.frm.add_custom_button(__("Return / Credit Note"), this.make_sales_return, __("Create")); + this.frm.add_custom_button( + __("Return / Credit Note"), + this.make_sales_return.bind(this), + __("Create") + ); this.frm.page.set_inner_btn_group_as_primary(__("Create")); } -- GitLab