diff --git a/barker/barker/routers/voucher/save.py b/barker/barker/routers/voucher/save.py index 6038669..9bb619d 100644 --- a/barker/barker/routers/voucher/save.py +++ b/barker/barker/routers/voucher/save.py @@ -110,7 +110,7 @@ def do_save( item.kots.append(kot) db.add(kot) for index, i in enumerate(k.inventories): - if i.quantity == 0: + if round(i.quantity, 2) == 0: continue total_quantity = round( sum(inv.quantity for ko in data.kots for inv in ko.inventories if inv.product.id_ == i.product.id_), diff --git a/barker/barker/routers/voucher/update.py b/barker/barker/routers/voucher/update.py index a39a086..492c9cf 100644 --- a/barker/barker/routers/voucher/update.py +++ b/barker/barker/routers/voucher/update.py @@ -110,6 +110,8 @@ def update_route( item.kots.append(kot) db.add(kot) for index, i in enumerate(k.inventories): + if round(i.quantity, 2) == 0: + continue product: ProductVersion = db.execute( select(ProductVersion).where( and_(