Fix: Users without ability of edit printed products where not able to set quantity to zero in the bill

This commit is contained in:
Amritanshu Agrawal 2023-03-19 14:43:40 +05:30
parent 03918fee80
commit e56a753053

View File

@ -184,7 +184,7 @@ export class BillService {
const old = newKot.inventories.find(
(x) => x.product.id === item.productId && x.isHappyHour === item.isHappyHour,
) as Inventory;
if (item.quantity > 1 || (canEdit && this.minimum(item.productId as string, item.isHappyHour) >= 1)) {
if (item.quantity >= 1 || (canEdit && this.minimum(item.productId as string, item.isHappyHour) >= 1)) {
old.quantity -= 1;
} else if (item.quantity === 0) {
newKot.inventories.splice(newKot.inventories.indexOf(old), 1);