mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-16 05:22:10 +00:00
fix: fetch exchange rate while creating inter-company order and invoice
(cherry picked from commit 145a6c5e2a)
This commit is contained in:
@@ -1127,13 +1127,14 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
currency() {
|
currency() {
|
||||||
// The transaction date be either transaction_date (from orders) or posting_date (from invoices)
|
// 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 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;
|
let me = this;
|
||||||
this.set_dynamic_labels();
|
this.set_dynamic_labels();
|
||||||
let company_currency = this.get_company_currency();
|
let company_currency = this.get_company_currency();
|
||||||
// Added `load_after_mapping` to determine if document is loading after mapping from another doc
|
// 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
|
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,
|
this.get_exchange_rate(transaction_date, this.frm.doc.currency, company_currency,
|
||||||
function(exchange_rate) {
|
function(exchange_rate) {
|
||||||
|
|||||||
Reference in New Issue
Block a user