Merge pull request #47001 from aerele/inter-company-order-echange-rate

fix: fetch exchange rate while creating inter-company order and invoice
This commit is contained in:
ruthra kumar
2025-04-15 17:35:58 +05:30
committed by GitHub

View File

@@ -1130,13 +1130,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) {