From 4a323463f76fcfeafb95dd97c016506857599511 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 13 Sep 2019 18:36:57 +0530 Subject: [PATCH] fix: for pos, paid amount has not considered the tax amount due to which outstanding amount showing for the pos invoices (#19039) --- erpnext/accounts/page/pos/pos.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 2173e7dfb7..0cd8bfefb8 100755 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -1691,20 +1691,13 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ if(this.si_docs) { this.si_docs.forEach((row) => { - existing_pos_list.push(Object.keys(row)); + existing_pos_list.push(Object.keys(row)[0]); }); } if (this.frm.doc.offline_pos_name - && in_list(existing_pos_list, this.frm.doc.offline_pos_name)) { + && in_list(existing_pos_list, cstr(this.frm.doc.offline_pos_name))) { this.update_invoice() - //to retrieve and set the default payment - invoice_data[this.frm.doc.offline_pos_name] = this.frm.doc; - invoice_data[this.frm.doc.offline_pos_name].payments[0].amount = this.frm.doc.net_total - invoice_data[this.frm.doc.offline_pos_name].payments[0].base_amount = this.frm.doc.net_total - - this.frm.doc.paid_amount = this.frm.doc.net_total - this.frm.doc.outstanding_amount = 0 } else if(!this.frm.doc.offline_pos_name) { this.frm.doc.offline_pos_name = frappe.datetime.now_datetime(); this.frm.doc.posting_date = frappe.datetime.get_today();