[fix] Journal Entry client side minor fixes
This commit is contained in:
parent
2377cdfa4e
commit
71ef6675ce
@ -75,7 +75,6 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
|||||||
|
|
||||||
setup_queries: function() {
|
setup_queries: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
var company_currency = erpnext.get_currency(me.frm.doc.company);
|
|
||||||
|
|
||||||
me.frm.set_query("account", "accounts", function(doc, cdt, cdn) {
|
me.frm.set_query("account", "accounts", function(doc, cdt, cdn) {
|
||||||
var filters = {
|
var filters = {
|
||||||
@ -83,7 +82,9 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
|||||||
is_group: 0
|
is_group: 0
|
||||||
};
|
};
|
||||||
if(!doc.multi_currency) {
|
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 };
|
return { filters: filters };
|
||||||
});
|
});
|
||||||
@ -230,6 +231,7 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
|||||||
row.debit = -doc.difference;
|
row.debit = -doc.difference;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cur_frm.cscript.update_totals(doc);
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -405,7 +407,7 @@ erpnext.journal_entry.set_debit_credit_in_company_currency = function(frm, cdt,
|
|||||||
}
|
}
|
||||||
|
|
||||||
erpnext.journal_entry.set_exchange_rate = function(frm, cdt, cdn) {
|
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];
|
var row = locals[cdt][cdn];
|
||||||
|
|
||||||
if(row.account_currency == company_currency || !frm.doc.multi_currency) {
|
if(row.account_currency == company_currency || !frm.doc.multi_currency) {
|
||||||
@ -417,8 +419,8 @@ erpnext.journal_entry.set_exchange_rate = function(frm, cdt, cdn) {
|
|||||||
account: row.account,
|
account: row.account,
|
||||||
account_currency: row.account_currency,
|
account_currency: row.account_currency,
|
||||||
company: frm.doc.company,
|
company: frm.doc.company,
|
||||||
reference_type: row.reference_type,
|
reference_type: cstr(row.reference_type),
|
||||||
reference_name: row.reference_name,
|
reference_name: cstr(row.reference_name),
|
||||||
debit: flt(row.debit_in_account_currency),
|
debit: flt(row.debit_in_account_currency),
|
||||||
credit: flt(row.credit_in_account_currency),
|
credit: flt(row.credit_in_account_currency),
|
||||||
exchange_rate: row.exchange_rate
|
exchange_rate: row.exchange_rate
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user