Fix: Users without ability of edit printed products where not able to set quantity to zero in the bill
This commit is contained in:
parent
03918fee80
commit
e56a753053
|
@ -184,7 +184,7 @@ export class BillService {
|
||||||
const old = newKot.inventories.find(
|
const old = newKot.inventories.find(
|
||||||
(x) => x.product.id === item.productId && x.isHappyHour === item.isHappyHour,
|
(x) => x.product.id === item.productId && x.isHappyHour === item.isHappyHour,
|
||||||
) as Inventory;
|
) 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;
|
old.quantity -= 1;
|
||||||
} else if (item.quantity === 0) {
|
} else if (item.quantity === 0) {
|
||||||
newKot.inventories.splice(newKot.inventories.indexOf(old), 1);
|
newKot.inventories.splice(newKot.inventories.indexOf(old), 1);
|
||||||
|
|
Loading…
Reference in New Issue