Merge pull request #16133 from rohitwaghchaure/fixed_stock_value_diifference_calculation_for_stock_reco
[Fix] Stock value difference calculation for stock reconciliation
This commit is contained in:
commit
dce68422a7
@ -180,7 +180,7 @@ class StockReconciliation(StockController):
|
|||||||
frappe.throw(_("Valuation Rate required for Item in row {0}").format(row.idx))
|
frappe.throw(_("Valuation Rate required for Item in row {0}").format(row.idx))
|
||||||
|
|
||||||
if ((previous_sle and row.qty == previous_sle.get("qty_after_transaction")
|
if ((previous_sle and row.qty == previous_sle.get("qty_after_transaction")
|
||||||
and row.valuation_rate == previous_sle.get("valuation_rate"))
|
and (row.valuation_rate == previous_sle.get("valuation_rate") or row.qty == 0))
|
||||||
or (not previous_sle and not row.qty)):
|
or (not previous_sle and not row.qty)):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
@ -176,7 +176,7 @@ class update_entries_after(object):
|
|||||||
# rounding as per precision
|
# rounding as per precision
|
||||||
self.stock_value = flt(self.stock_value, self.precision)
|
self.stock_value = flt(self.stock_value, self.precision)
|
||||||
|
|
||||||
if self.prev_stock_value < 0 and self.stock_value >= 0:
|
if self.prev_stock_value < 0 and self.stock_value >= 0 and sle.voucher_type != 'Stock Reconciliation':
|
||||||
stock_value_difference = sle.actual_qty * self.valuation_rate
|
stock_value_difference = sle.actual_qty * self.valuation_rate
|
||||||
else:
|
else:
|
||||||
stock_value_difference = self.stock_value - self.prev_stock_value
|
stock_value_difference = self.stock_value - self.prev_stock_value
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user