mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-14 18:23:55 +00:00
fix: set valuation rate for rejected serial/batch item
(cherry picked from commit 614402cf6c)
This commit is contained in:
@@ -667,8 +667,12 @@ class SerialandBatchBundle(Document):
|
|||||||
if batches and valuation_method == "FIFO":
|
if batches and valuation_method == "FIFO":
|
||||||
stock_queue = parse_json(prev_sle.stock_queue)
|
stock_queue = parse_json(prev_sle.stock_queue)
|
||||||
|
|
||||||
|
set_valuation_rate_for_rejected_materials = frappe.db.get_single_value(
|
||||||
|
"Buying Settings", "set_valuation_rate_for_rejected_materials"
|
||||||
|
)
|
||||||
|
|
||||||
for d in self.entries:
|
for d in self.entries:
|
||||||
if self.is_rejected:
|
if self.is_rejected and not set_valuation_rate_for_rejected_materials:
|
||||||
rate = 0.0
|
rate = 0.0
|
||||||
elif (d.incoming_rate == rate) and not stock_queue and d.qty and d.stock_value_difference:
|
elif (d.incoming_rate == rate) and not stock_queue and d.qty and d.stock_value_difference:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user