fix: GL entries for rejected returned materials (#47612)
(cherry picked from commit 3e098da01f)
This commit is contained in:
@@ -670,7 +670,8 @@ class BuyingController(SubcontractingController):
|
||||
"actual_qty": flt(
|
||||
flt(d.rejected_qty) * flt(d.conversion_factor), d.precision("stock_qty")
|
||||
),
|
||||
"incoming_rate": valuation_rate_for_rejected_item,
|
||||
"incoming_rate": valuation_rate_for_rejected_item if not self.is_return else 0.0,
|
||||
"outgoing_rate": valuation_rate_for_rejected_item if self.is_return else 0.0,
|
||||
"serial_and_batch_bundle": d.rejected_serial_and_batch_bundle,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -499,9 +499,7 @@ class PurchaseReceipt(BuyingController):
|
||||
if item.get("rejected_qty") and frappe.db.get_single_value(
|
||||
"Buying Settings", "set_valuation_rate_for_rejected_materials"
|
||||
):
|
||||
outgoing_amount += abs(
|
||||
get_stock_value_difference(self.name, item.name, item.rejected_warehouse)
|
||||
)
|
||||
outgoing_amount += get_stock_value_difference(self.name, item.name, item.rejected_warehouse)
|
||||
credit_amount = outgoing_amount
|
||||
|
||||
if credit_amount:
|
||||
@@ -640,9 +638,7 @@ class PurchaseReceipt(BuyingController):
|
||||
if item.get("rejected_qty") and frappe.db.get_single_value(
|
||||
"Buying Settings", "set_valuation_rate_for_rejected_materials"
|
||||
):
|
||||
rejected_item_cost = abs(
|
||||
get_stock_value_difference(self.name, item.name, item.rejected_warehouse)
|
||||
)
|
||||
rejected_item_cost = get_stock_value_difference(self.name, item.name, item.rejected_warehouse)
|
||||
divisional_loss -= rejected_item_cost
|
||||
|
||||
if divisional_loss:
|
||||
|
||||
Reference in New Issue
Block a user