Merge pull request #54664 from rohitwaghchaure/fixed-support-66924

fix: show in and out qty in the stock ledger report for stock recos
This commit is contained in:
rohitwaghchaure
2026-04-30 14:13:42 +05:30
committed by GitHub

View File

@@ -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: