[Fix] Stock value difference calculation for stock reconciliation

This commit is contained in:
Rohit Waghchaure 2018-11-30 16:20:52 +05:30
parent e3136c38e1
commit 16b8ecbe05
2 changed files with 2 additions and 2 deletions

View File

@ -180,7 +180,7 @@ class StockReconciliation(StockController):
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")
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)):
continue

View File

@ -176,7 +176,7 @@ class update_entries_after(object):
# rounding as per 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
else:
stock_value_difference = self.stock_value - self.prev_stock_value