diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index a1b38467b0..acc70df8e6 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -118,7 +118,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ setup_sms: function() { var me = this; - if(this.frm.doc.docstatus===1 && !in_list(["Lost", "Stopped"], this.frm.doc.status) + if(this.frm.doc.docstatus===1 && !in_list(["Lost", "Stopped", "Closed"], this.frm.doc.status) && this.frm.doctype != "Purchase Invoice") { this.frm.page.add_menu_item(__('Send SMS'), function() { me.send_sms(); }); } diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 8a7da63853..df91d63a18 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -199,7 +199,7 @@ def get_customer_outstanding(customer, company): select sum(base_grand_total*(100 - per_billed)/100) from `tabSales Order` where customer=%s and docstatus = 1 and company=%s - and per_billed < 100 and status != 'Stopped'""", (customer, company)) + and per_billed < 100 and status != 'Closed'""", (customer, company)) outstanding_based_on_so = flt(outstanding_based_on_so[0][0]) if outstanding_based_on_so else 0.0 @@ -210,7 +210,7 @@ def get_customer_outstanding(customer, company): where dn.name = dn_item.parent and dn.customer=%s and dn.company=%s - and dn.docstatus = 1 and dn.status != 'Stopped' + and dn.docstatus = 1 and dn.status not in ('Closed', 'Stopped') and ifnull(dn_item.against_sales_order, '') = '' and ifnull(dn_item.against_sales_invoice, '') = ''""", (customer, company), as_dict=True)