From d697f3d6a3bde2fc216c385147097a9347940b79 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Wed, 23 Mar 2016 11:25:54 +0530 Subject: [PATCH] [minor][fix] reset is_paid if company not selected --- .../accounts/doctype/purchase_invoice/purchase_invoice.js | 1 + .../accounts/doctype/purchase_invoice/purchase_invoice.json | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index ebda170404..123f4ea661 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -111,6 +111,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ cur_frm.cscript.hide_fields(this.frm.doc); if(cint(this.frm.doc.is_paid)) { if(!this.frm.doc.company) { + cur_frm.set_value("is_paid", 0) msgprint(__("Please specify Company to proceed")); } } diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index f76442b0be..46843b3f34 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -287,6 +287,7 @@ "label": "Company", "length": 0, "no_copy": 0, + "options": "Company", "permlevel": 0, "print_hide": 1, "print_hide_if_no_value": 0, @@ -2649,7 +2650,7 @@ "search_index": 0, "set_only_once": 0, "unique": 0 - }, + }, { "allow_on_submit": 1, "bold": 0, @@ -2676,7 +2677,7 @@ "search_index": 0, "set_only_once": 0, "unique": 0 - }, + }, { "allow_on_submit": 1, "bold": 0,