mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-14 10:13:57 +00:00
fix(stock): set incoming_rate with lcv rate for internal purchase
(cherry picked from commitf0dccc3cd7) (cherry picked from commit41c592a1a8)
This commit is contained in:
@@ -2377,6 +2377,7 @@ def get_incoming_rate_for_inter_company_transfer(sle) -> float:
|
|||||||
For inter company transfer, incoming rate is the average of the outgoing rate
|
For inter company transfer, incoming rate is the average of the outgoing rate
|
||||||
"""
|
"""
|
||||||
rate = 0.0
|
rate = 0.0
|
||||||
|
lcv_rate = 0.0
|
||||||
|
|
||||||
field = "delivery_note_item" if sle.voucher_type == "Purchase Receipt" else "sales_invoice_item"
|
field = "delivery_note_item" if sle.voucher_type == "Purchase Receipt" else "sales_invoice_item"
|
||||||
|
|
||||||
@@ -2391,7 +2392,15 @@ def get_incoming_rate_for_inter_company_transfer(sle) -> float:
|
|||||||
"incoming_rate",
|
"incoming_rate",
|
||||||
)
|
)
|
||||||
|
|
||||||
return rate
|
# add lcv amount in incoming_rate
|
||||||
|
lcv_amount = frappe.db.get_value(
|
||||||
|
f"{sle.voucher_type} Item", sle.voucher_detail_no, "landed_cost_voucher_amount"
|
||||||
|
)
|
||||||
|
|
||||||
|
if lcv_amount:
|
||||||
|
lcv_rate = flt(lcv_amount / abs(sle.actual_qty))
|
||||||
|
|
||||||
|
return rate + lcv_rate
|
||||||
|
|
||||||
|
|
||||||
def is_internal_transfer(sle):
|
def is_internal_transfer(sle):
|
||||||
|
|||||||
Reference in New Issue
Block a user