mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
fix: additional cost not consider in valuation rate for Stock Entry transfer
This commit is contained in:
@@ -186,7 +186,23 @@ class SerialBatchBundle:
|
||||
}
|
||||
|
||||
if self.sle.actual_qty < 0 and self.is_material_transfer():
|
||||
values_to_update["valuation_rate"] = flt(sn_doc.avg_rate)
|
||||
basic_rate = flt(sn_doc.avg_rate)
|
||||
ste_detail = frappe.db.get_value(
|
||||
"Stock Entry Detail",
|
||||
self.sle.voucher_detail_no,
|
||||
["additional_cost", "landed_cost_voucher_amount", "transfer_qty"],
|
||||
as_dict=True,
|
||||
)
|
||||
|
||||
additional_cost = 0.0
|
||||
|
||||
if ste_detail:
|
||||
additional_cost = (
|
||||
flt(ste_detail.additional_cost) + flt(ste_detail.landed_cost_voucher_amount)
|
||||
) / flt(ste_detail.transfer_qty)
|
||||
|
||||
values_to_update["basic_rate"] = basic_rate
|
||||
values_to_update["valuation_rate"] = basic_rate + additional_cost
|
||||
|
||||
if not frappe.get_single_value(
|
||||
"Stock Settings", "do_not_update_serial_batch_on_creation_of_auto_bundle"
|
||||
|
||||
Reference in New Issue
Block a user