From 9c4aac03dffd497ca8c62cbd65a76b4074cc4df6 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Mon, 28 Jul 2025 12:48:57 +0530 Subject: [PATCH] fix: fetch item valuation rate for internal transactions --- erpnext/public/js/controllers/transaction.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 4e4d9c980b3..61d69e93f7f 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -674,9 +674,12 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe me.apply_product_discount(d); } }, - () => { + async () => { // for internal customer instead of pricing rule directly apply valuation rate on item - if ((me.frm.doc.is_internal_customer || me.frm.doc.is_internal_supplier) && me.frm.doc.represents_company === me.frm.doc.company) { + const fetch_valuation_rate_for_internal_transactions = await frappe.db.get_single_value( + "Accounts Settings", "fetch_valuation_rate_for_internal_transaction" + ); + if ((me.frm.doc.is_internal_customer || me.frm.doc.is_internal_supplier) && fetch_valuation_rate_for_internal_transactions) { me.get_incoming_rate(item, me.frm.posting_date, me.frm.posting_time, me.frm.doc.doctype, me.frm.doc.company); } else {