From 6795848593e65903da8583541058118159c347c7 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 17 Jul 2025 15:10:06 +0530 Subject: [PATCH] fix: precision issue for Sales Incoming Rate (cherry picked from commit 7b99275ceb4e6bccd5ef5b19dc4c4ff8c4a61ca2) # Conflicts: # erpnext/controllers/buying_controller.py --- erpnext/controllers/buying_controller.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 364aadc8eae..e519565cb84 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -332,6 +332,7 @@ class BuyingController(SubcontractingController): if not posting_time and self.doctype == "Purchase Order": posting_time = nowtime() +<<<<<<< HEAD outgoing_rate = get_incoming_rate( { "item_code": d.item_code, @@ -375,6 +376,15 @@ class BuyingController(SubcontractingController): d.discount_percentage = 0.0 d.discount_amount = 0.0 d.margin_rate_or_amount = 0.0 +======= + d.sales_incoming_rate = flt(outgoing_rate * (d.conversion_factor or 1)) + else: + field = "incoming_rate" if self.get("is_internal_supplier") else "rate" + d.sales_incoming_rate = flt( + frappe.db.get_value(ref_doctype, d.get(frappe.scrub(ref_doctype)), field) + * (d.conversion_factor or 1) + ) +>>>>>>> 7b99275ceb (fix: precision issue for Sales Incoming Rate) def validate_for_subcontracting(self): if self.is_subcontracted and self.get("is_old_subcontracting_flow"):