mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
[fix] Don't overwrite exchange rate on saving for bank transfer
This commit is contained in:
@@ -368,10 +368,6 @@ frappe.ui.form.on("Journal Entry Account", {
|
|||||||
|
|
||||||
credit: function(frm, dt, dn) {
|
credit: function(frm, dt, dn) {
|
||||||
cur_frm.cscript.update_totals(frm.doc);
|
cur_frm.cscript.update_totals(frm.doc);
|
||||||
},
|
|
||||||
|
|
||||||
exchange_rate: function(frm, cdt, cdn) {
|
|
||||||
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -418,7 +414,7 @@ $.extend(erpnext.journal_entry, {
|
|||||||
|
|
||||||
if(row.account_currency == company_currency || !frm.doc.multi_currency) {
|
if(row.account_currency == company_currency || !frm.doc.multi_currency) {
|
||||||
frappe.model.set_value(cdt, cdn, "exchange_rate", 1);
|
frappe.model.set_value(cdt, cdn, "exchange_rate", 1);
|
||||||
} else if (!row.exchange_rate || row.account_type == "Bank") {
|
} else if (!row.exchange_rate || row.exchange_rate == 1 || row.account_type == "Bank") {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_exchange_rate",
|
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_exchange_rate",
|
||||||
args: {
|
args: {
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ class JournalEntry(AccountsController):
|
|||||||
for d in self.get("accounts"):
|
for d in self.get("accounts"):
|
||||||
if d.account_currency == self.company_currency:
|
if d.account_currency == self.company_currency:
|
||||||
d.exchange_rate = 1
|
d.exchange_rate = 1
|
||||||
elif not d.exchange_rate or d.account_type=="Bank" or \
|
elif not d.exchange_rate or d.exchange_rate == 1 or \
|
||||||
(d.reference_type in ("Sales Invoice", "Purchase Invoice") and d.reference_name):
|
(d.reference_type in ("Sales Invoice", "Purchase Invoice") and d.reference_name):
|
||||||
d.exchange_rate = get_exchange_rate(d.account, d.account_currency, self.company,
|
d.exchange_rate = get_exchange_rate(d.account, d.account_currency, self.company,
|
||||||
d.reference_type, d.reference_name, d.debit, d.credit, d.exchange_rate)
|
d.reference_type, d.reference_name, d.debit, d.credit, d.exchange_rate)
|
||||||
|
|||||||
Reference in New Issue
Block a user