From 29ea5d014ed6cb9ed865f86103ac58952efa4801 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 5 Jul 2013 17:23:14 +0530 Subject: [PATCH] [sales common] [fix] calculate outstanding amount only for docstatus=0 on client side --- selling/doctype/sales_common/sales_common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selling/doctype/sales_common/sales_common.js b/selling/doctype/sales_common/sales_common.js index 27c82f6cf4..cf757a6cea 100644 --- a/selling/doctype/sales_common/sales_common.js +++ b/selling/doctype/sales_common/sales_common.js @@ -397,7 +397,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ // NOTE: // write_off_amount is only for POS Invoice // total_advance is only for non POS Invoice - if(this.frm.doc.doctype == "Sales Invoice" && this.frm.doc.docstatus < 2) { + if(this.frm.doc.doctype == "Sales Invoice" && this.frm.doc.docstatus==0) { wn.model.round_floats_in(this.frm.doc, ["grand_total", "total_advance", "write_off_amount", "paid_amount"]); var total_amount_to_pay = this.frm.doc.grand_total - this.frm.doc.write_off_amount;