feat: allow to set valuation rate for Rejected Materials (#47582)

This commit is contained in:
rohitwaghchaure
2025-05-19 12:51:32 +05:30
committed by GitHub
parent a058fe7319
commit ca0e53dd78
5 changed files with 190 additions and 12 deletions

View File

@@ -681,6 +681,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,
@@ -689,7 +693,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,
},
)