mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 06:29:20 +00:00
feat: allow to set valuation rate for Rejected Materials (#47582)
(cherry picked from commit ca0e53dd78)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -658,6 +658,10 @@ class BuyingController(SubcontractingController):
|
||||
sl_entries.append(from_warehouse_sle)
|
||||
|
||||
if flt(d.rejected_qty) != 0:
|
||||
valuation_rate_for_rejected_item = 0.0
|
||||
if frappe.db.get_single_value("Buying Settings", "set_valuation_rate_for_rejected_materials"):
|
||||
valuation_rate_for_rejected_item = d.valuation_rate
|
||||
|
||||
sl_entries.append(
|
||||
self.get_sl_entries(
|
||||
d,
|
||||
@@ -666,7 +670,7 @@ class BuyingController(SubcontractingController):
|
||||
"actual_qty": flt(
|
||||
flt(d.rejected_qty) * flt(d.conversion_factor), d.precision("stock_qty")
|
||||
),
|
||||
"incoming_rate": 0.0,
|
||||
"incoming_rate": valuation_rate_for_rejected_item,
|
||||
"serial_and_batch_bundle": d.rejected_serial_and_batch_bundle,
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user