From adfada707d2e24a37d270754215a65198755558f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 2 Jul 2014 17:10:46 +0530 Subject: [PATCH] Automatic Outstanding Writeoff --- erpnext/accounts/doctype/sales_invoice/sales_invoice.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index bfb500c665..70fc272736 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -183,8 +183,9 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte frappe.model.round_floats_in(this.frm.doc, ["grand_total", "paid_amount"]); // this will make outstanding amount 0 this.frm.set_value("write_off_amount", - flt(this.frm.doc.grand_total - this.frm.doc.paid_amount), - precision("write_off_amount")); + flt(this.frm.doc.grand_total - this.frm.doc.paid_amount, + precision("write_off_amount")) + ); } this.calculate_outstanding_amount(false);