mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-26 01:58:31 +00:00
fix: opening qty in stock balance
(cherry picked from commit d7fdab99cb)
This commit is contained in:
committed by
Mergify
parent
3ec3cd512c
commit
1f2342cf4b
@@ -230,9 +230,18 @@ class StockBalanceReport:
|
|||||||
.groupby(doctype.voucher_detail_no)
|
.groupby(doctype.voucher_detail_no)
|
||||||
)
|
)
|
||||||
|
|
||||||
data = query.run(as_list=True)
|
data = query.run(as_dict=True)
|
||||||
if data:
|
if not data:
|
||||||
self.stock_reco_voucher_wise_count = frappe._dict(data)
|
return
|
||||||
|
|
||||||
|
for row in data:
|
||||||
|
if row.count != 1:
|
||||||
|
continue
|
||||||
|
|
||||||
|
current_qty = frappe.db.get_value(
|
||||||
|
"Stock Reconciliation Item", row.voucher_detail_no, "current_qty"
|
||||||
|
)
|
||||||
|
self.stock_reco_voucher_wise_count[row.voucher_detail_no] = current_qty
|
||||||
|
|
||||||
def prepare_new_data(self):
|
def prepare_new_data(self):
|
||||||
if self.filters.get("show_stock_ageing_data"):
|
if self.filters.get("show_stock_ageing_data"):
|
||||||
@@ -312,7 +321,8 @@ class StockBalanceReport:
|
|||||||
if entry.voucher_type == "Stock Reconciliation" and (
|
if entry.voucher_type == "Stock Reconciliation" and (
|
||||||
not entry.batch_no or entry.serial_no or entry.serial_and_batch_bundle
|
not entry.batch_no or entry.serial_no or entry.serial_and_batch_bundle
|
||||||
):
|
):
|
||||||
if entry.serial_no and self.stock_reco_voucher_wise_count.get(entry.voucher_detail_no, 0) == 1:
|
if entry.serial_no and entry.voucher_detail_no in self.stock_reco_voucher_wise_count:
|
||||||
|
qty_dict.opening_qty -= self.stock_reco_voucher_wise_count.get(entry.voucher_detail_no, 0)
|
||||||
qty_dict.bal_qty = 0.0
|
qty_dict.bal_qty = 0.0
|
||||||
qty_diff = flt(entry.actual_qty)
|
qty_diff = flt(entry.actual_qty)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user