mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-01 04:28:27 +00:00
fix: show in and out qty in the stock ledger report for stock recos
This commit is contained in:
@@ -72,6 +72,7 @@ def execute(filters=None):
|
||||
inv_dimension_wise_dict, filters, inv_dimension_key=inv_dimension_key, opening_row=opening_row
|
||||
)
|
||||
|
||||
item_wh_wise_prev_sle = {}
|
||||
for sle in sl_entries:
|
||||
item_detail = item_details[sle.item_code]
|
||||
|
||||
@@ -113,6 +114,21 @@ def execute(filters=None):
|
||||
elif sle.voucher_type == "Stock Reconciliation":
|
||||
sle["in_out_rate"] = sle.valuation_rate
|
||||
|
||||
if (
|
||||
sle.voucher_type == "Stock Reconciliation"
|
||||
and not sle.in_qty
|
||||
and not sle.out_qty
|
||||
and not sle.actual_qty
|
||||
):
|
||||
if prev_sle := item_wh_wise_prev_sle.get((sle.item_code, sle.warehouse)):
|
||||
bal_qty = prev_sle.get("qty_after_transaction", 0)
|
||||
qty = sle.qty_after_transaction - bal_qty
|
||||
if qty > 0:
|
||||
sle.in_qty = qty
|
||||
elif qty < 0:
|
||||
sle.out_qty = qty
|
||||
|
||||
item_wh_wise_prev_sle[(sle.item_code, sle.warehouse)] = sle
|
||||
data.append(sle)
|
||||
|
||||
if include_uom:
|
||||
|
||||
Reference in New Issue
Block a user