Skip to content

Commit

Permalink
fix: consider stock qty 0 if get_latest_stock_qty returns None
Browse files Browse the repository at this point in the history
(cherry picked from commit 063607a)
  • Loading branch information
akurungadam authored and Sajinsr committed Dec 17, 2024
1 parent 3e4bd52 commit 5f15057
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def get_drug_shortage_map(medication_orders, warehouse):

drug_shortage = dict()
for drug, required_qty in drug_requirement.items():
available_qty = get_latest_stock_qty(drug, warehouse)
available_qty = get_latest_stock_qty(drug, warehouse) or 0
if flt(required_qty) > flt(available_qty):
drug_shortage[drug] = flt(flt(required_qty) - flt(available_qty))

Expand Down

0 comments on commit 5f15057

Please sign in to comment.