Fix: Kots with product quantity = 0 were allowed. So blank kots could be added.
This commit is contained in:
@ -237,7 +237,7 @@ export class BillService {
|
||||
printKot(guestBookId: string | null): Observable<boolean> {
|
||||
const item = JSON.parse(JSON.stringify(this.bill));
|
||||
const newKot = this.bill.kots.find((k) => k.id === undefined) as Kot;
|
||||
if (newKot.inventories.length === 0) {
|
||||
if (newKot.inventories.filter((x) => x.quantity !== 0).length === 0) {
|
||||
return throwError('Cannot print a blank KOT\nPlease add some products!');
|
||||
}
|
||||
if (!this.happyHourItemsBalanced() || this.happyHourItemsMoreThanRegular()) {
|
||||
|
||||
Reference in New Issue
Block a user