Fix: Voucher Update would not filter out Zero quantity inventories.
This commit is contained in:
parent
7cf6775ea1
commit
d14250c0c7
|
@ -110,7 +110,7 @@ def do_save(
|
||||||
item.kots.append(kot)
|
item.kots.append(kot)
|
||||||
db.add(kot)
|
db.add(kot)
|
||||||
for index, i in enumerate(k.inventories):
|
for index, i in enumerate(k.inventories):
|
||||||
if i.quantity == 0:
|
if round(i.quantity, 2) == 0:
|
||||||
continue
|
continue
|
||||||
total_quantity = round(
|
total_quantity = round(
|
||||||
sum(inv.quantity for ko in data.kots for inv in ko.inventories if inv.product.id_ == i.product.id_),
|
sum(inv.quantity for ko in data.kots for inv in ko.inventories if inv.product.id_ == i.product.id_),
|
||||||
|
|
|
@ -110,6 +110,8 @@ def update_route(
|
||||||
item.kots.append(kot)
|
item.kots.append(kot)
|
||||||
db.add(kot)
|
db.add(kot)
|
||||||
for index, i in enumerate(k.inventories):
|
for index, i in enumerate(k.inventories):
|
||||||
|
if round(i.quantity, 2) == 0:
|
||||||
|
continue
|
||||||
product: ProductVersion = db.execute(
|
product: ProductVersion = db.execute(
|
||||||
select(ProductVersion).where(
|
select(ProductVersion).where(
|
||||||
and_(
|
and_(
|
||||||
|
|
Loading…
Reference in New Issue