From 52303184457f3ea917cee7ce1c103b3f2101bfec Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Aug 2013 11:28:37 +0530 Subject: [PATCH] [minor] [fix] make bank voucher form expense claim --- hr/doctype/expense_claim/expense_claim.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hr/doctype/expense_claim/expense_claim.js b/hr/doctype/expense_claim/expense_claim.js index 3497702723..ad3dacebda 100644 --- a/hr/doctype/expense_claim/expense_claim.js +++ b/hr/doctype/expense_claim/expense_claim.js @@ -25,9 +25,11 @@ erpnext.hr.ExpenseClaimController = wn.ui.form.Controller.extend({ // credit to bank var d1 = wn.model.add_child(jv, 'Journal Voucher Detail', 'entries'); - d1.account = r.message[0].account; d1.credit = cur_frm.doc.total_sanctioned_amount; - d1.balance = r.message[0].balance; + if(r.message) { + d1.account = r.message[0].account; + d1.balance = r.message[0].balance; + } loaddoc('Journal Voucher', jv.name); }