mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +00:00
fix: sales return for product bundle items
This commit is contained in:
@@ -638,6 +638,17 @@ class SerialandBatchBundle(Document):
|
||||
if not rate and self.voucher_detail_no and self.voucher_no:
|
||||
rate = frappe.db.get_value(child_table, self.voucher_detail_no, valuation_field)
|
||||
|
||||
is_packed_item = False
|
||||
if rate is None and child_table == "Delivery Note Item":
|
||||
rate = frappe.db.get_value(
|
||||
"Packed Item",
|
||||
self.voucher_detail_no,
|
||||
"incoming_rate",
|
||||
)
|
||||
|
||||
if rate is not None:
|
||||
is_packed_item = True
|
||||
|
||||
stock_queue = []
|
||||
batches = []
|
||||
if prev_sle and prev_sle.stock_queue:
|
||||
@@ -659,6 +670,9 @@ class SerialandBatchBundle(Document):
|
||||
elif (d.incoming_rate == rate) and not stock_queue and d.qty and d.stock_value_difference:
|
||||
continue
|
||||
|
||||
if is_packed_item and d.incoming_rate:
|
||||
rate = d.incoming_rate
|
||||
|
||||
d.incoming_rate = flt(rate)
|
||||
if d.qty:
|
||||
d.stock_value_difference = flt(d.qty) * d.incoming_rate
|
||||
|
||||
Reference in New Issue
Block a user