Merge pull request #47096 from frappe/mergify/bp/version-15-hotfix/pr-47001

fix: fetch exchange rate while creating inter-company order and invoice (backport #47001)
This commit is contained in:
ruthra kumar
2025-04-15 17:46:38 +05:30
committed by GitHub

View File

@@ -1127,13 +1127,14 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
currency() {
// The transaction date be either transaction_date (from orders) or posting_date (from invoices)
let transaction_date = this.frm.doc.transaction_date || this.frm.doc.posting_date;
let inter_company_reference = this.frm.doc.inter_company_order_reference || this.frm.doc.inter_company_invoice_reference;
let me = this;
this.set_dynamic_labels();
let company_currency = this.get_company_currency();
// Added `load_after_mapping` to determine if document is loading after mapping from another doc
if(this.frm.doc.currency && this.frm.doc.currency !== company_currency
&& !this.frm.doc.__onload?.load_after_mapping) {
&& (!this.frm.doc.__onload?.load_after_mapping || inter_company_reference)) {
this.get_exchange_rate(transaction_date, this.frm.doc.currency, company_currency,
function(exchange_rate) {