[sales common] [fix] calculate outstanding amount only for docstatus=0 on client side
diff --git a/selling/doctype/sales_common/sales_common.js b/selling/doctype/sales_common/sales_common.js
index 27c82f6..cf757a6 100644
--- a/selling/doctype/sales_common/sales_common.js
+++ b/selling/doctype/sales_common/sales_common.js
@@ -397,7 +397,7 @@
// 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;