From a7a06a77dd0a9bfb34fb522d4e3a97f743bc6964 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Thu, 12 Sep 2013 13:59:06 +0530 Subject: [PATCH] [fix] journal voucher to fetch company currency --- accounts/doctype/journal_voucher/journal_voucher.js | 4 ++++ accounts/doctype/journal_voucher/journal_voucher.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/accounts/doctype/journal_voucher/journal_voucher.js b/accounts/doctype/journal_voucher/journal_voucher.js index eb081669b7..a3aa6f127a 100644 --- a/accounts/doctype/journal_voucher/journal_voucher.js +++ b/accounts/doctype/journal_voucher/journal_voucher.js @@ -79,6 +79,10 @@ cur_frm.cscript.refresh = function(doc) { } } +cur_frm.cscript.company = function(doc, cdt, cdn) { + cur_frm.refresh_fields(); +} + cur_frm.cscript.is_opening = function(doc, cdt, cdn) { hide_field('aging_date'); if (doc.is_opening == 'Yes') unhide_field('aging_date'); diff --git a/accounts/doctype/journal_voucher/journal_voucher.py b/accounts/doctype/journal_voucher/journal_voucher.py index 0fb974713e..a43f8ca7a5 100644 --- a/accounts/doctype/journal_voucher/journal_voucher.py +++ b/accounts/doctype/journal_voucher/journal_voucher.py @@ -178,7 +178,7 @@ class DocType(AccountsController): if account_type == 'Bank or Cash': company_currency = get_company_currency(self.doc.company) amt = flt(d.debit) and d.debit or d.credit - self.doc.total_amount = company_currency +' '+ cstr(amt) + self.doc.total_amount = company_currency + ' ' + cstr(amt) from webnotes.utils import money_in_words self.doc.total_amount_in_words = money_in_words(amt, company_currency)