Skip to content

Commit

Permalink
fix: use Stock Qty while getting POS Reserved Qty
Browse files Browse the repository at this point in the history
(cherry picked from commit 7223106)
  • Loading branch information
s-aga-r authored and mergify[bot] committed Dec 27, 2023
1 parent ab9fce3 commit c403e2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erpnext/accounts/doctype/pos_invoice/pos_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ def get_pos_reserved_qty(item_code, warehouse):
reserved_qty = (
frappe.qb.from_(p_inv)
.from_(p_item)
.select(Sum(p_item.qty).as_("qty"))
.select(Sum(p_item.stock_qty).as_("stock_qty"))
.where(
(p_inv.name == p_item.parent)
& (IfNull(p_inv.consolidated_invoice, "") == "")
Expand All @@ -775,7 +775,7 @@ def get_pos_reserved_qty(item_code, warehouse):
)
).run(as_dict=True)

return reserved_qty[0].qty or 0 if reserved_qty else 0
return flt(reserved_qty[0].stock_qty) if reserved_qty else 0


@frappe.whitelist()
Expand Down

0 comments on commit c403e2e

Please sign in to comment.