From df74d30cf180e9c26db35e0b224816b31adb6e77 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 10 May 2012 19:19:31 +0530 Subject: [PATCH] fix in listview of journal voucher --- erpnext/accounts/doctype/journal_voucher/listview.js | 5 +++-- erpnext/startup/event_handlers.py | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/journal_voucher/listview.js b/erpnext/accounts/doctype/journal_voucher/listview.js index 6fe4cde234..f3c6a74607 100644 --- a/erpnext/accounts/doctype/journal_voucher/listview.js +++ b/erpnext/accounts/doctype/journal_voucher/listview.js @@ -4,7 +4,8 @@ wn.doclistviews['Journal Voucher'] = wn.views.ListView.extend({ this.fields = this.fields.concat([ '`tabJournal Voucher`.voucher_type', '`tabJournal Voucher`.remark', - '`tabJournal Voucher`.total_debit' + '`tabJournal Voucher`.total_debit', + '`tabJournal Voucher`.company', ]); this.stats = this.stats.concat(['voucher_type']); }, @@ -25,7 +26,7 @@ wn.doclistviews['Journal Voucher'] = wn.views.ListView.extend({ { width: '18%', content: function(parent, data) { - $(parent).html(fmt_money(data.total_debit)) + $(parent).html(wn.boot.company[data.company].default_currency + ' ' + fmt_money(data.total_debit)) }, css: {'text-align':'right'} }, diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py index a67a2148b9..9f4ff9b7f5 100644 --- a/erpnext/startup/event_handlers.py +++ b/erpnext/startup/event_handlers.py @@ -88,6 +88,13 @@ def boot_session(bootinfo): if hasattr(conf, 'max_users'): bootinfo['max_users'] = conf.max_users if hasattr(conf, 'expires_on'): bootinfo['expires_on'] = conf.expires_on + company = webnotes.conn.sql("select name, default_currency from `tabCompany`", as_dict=1) + company_dict = {} + for c in company: + company_dict.setdefault(c['name'], {}).update(c) + + bootinfo['company'] = company_dict + def get_letter_heads(): """load letter heads with startup"""