From 0c9d42258cda91c95fbb4642c37ef559f416050f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 25 Mar 2014 19:35:41 +0530 Subject: [PATCH] Minor fix related to pos paid amount --- erpnext/selling/sales_common.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index d2eab6888e..1dbbbfe2a1 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -407,9 +407,12 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ "paid_amount"]); var total_amount_to_pay = this.frm.doc.grand_total - this.frm.doc.write_off_amount - this.frm.doc.total_advance; + if(this.frm.doc.is_pos) { + if(!this.frm.doc.paid_amount) this.frm.doc.paid_amount = flt(total_amount_to_pay); + } else { + this.frm.doc.paid_amount = 0 + } - this.frm.doc.paid_amount = (this.frm.doc.is_pos && !this.frm.doc.paid_amount) ? - flt(total_amount_to_pay): 0.0; this.frm.set_value("outstanding_amount", flt(total_amount_to_pay - this.frm.doc.paid_amount, precision("outstanding_amount"))); }