[fix] Journal Entry client side minor fixes
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js
index 246c410..383b4b6 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -75,7 +75,6 @@
setup_queries: function() {
var me = this;
- var company_currency = erpnext.get_currency(me.frm.doc.company);
me.frm.set_query("account", "accounts", function(doc, cdt, cdn) {
var filters = {
@@ -83,7 +82,9 @@
is_group: 0
};
if(!doc.multi_currency) {
- $.extend(filters, {currency: company_currency});
+ $.extend(filters, {
+ account_currency: frappe.get_doc(":Company", me.frm.doc.company).default_currency
+ });
}
return { filters: filters };
});
@@ -230,6 +231,7 @@
row.debit = -doc.difference;
}
}
+ cur_frm.cscript.update_totals(doc);
},
});
@@ -405,7 +407,7 @@
}
erpnext.journal_entry.set_exchange_rate = function(frm, cdt, cdn) {
- var company_currency = erpnext.get_currency(frm.doc.company);
+ var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
var row = locals[cdt][cdn];
if(row.account_currency == company_currency || !frm.doc.multi_currency) {
@@ -417,8 +419,8 @@
account: row.account,
account_currency: row.account_currency,
company: frm.doc.company,
- reference_type: row.reference_type,
- reference_name: row.reference_name,
+ reference_type: cstr(row.reference_type),
+ reference_name: cstr(row.reference_name),
debit: flt(row.debit_in_account_currency),
credit: flt(row.credit_in_account_currency),
exchange_rate: row.exchange_rate