From 565cffaef10b19e1a173ce16441d583c9f298ec2 Mon Sep 17 00:00:00 2001 From: tanshu Date: Thu, 24 Dec 2020 09:10:55 +0530 Subject: [PATCH] Fix: Kot move fixed. Kot id was missing on move. Also, voucher_type KOT as truthy not and would give bill not found error. --- barker/barker/routers/voucher/merge_move.py | 2 +- bookie/src/app/sales/bills/bills.component.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/barker/barker/routers/voucher/merge_move.py b/barker/barker/routers/voucher/merge_move.py index c0d144a..4b68898 100644 --- a/barker/barker/routers/voucher/merge_move.py +++ b/barker/barker/routers/voucher/merge_move.py @@ -165,7 +165,7 @@ def update_settlements(vouchers: List[uuid.UUID], db: Session): def check_if_voucher_is_unprinted(voucher_id: uuid.UUID, db: Session) -> None: voucher_type: VoucherType = db.query(Voucher.voucher_type).filter(Voucher.id == voucher_id).scalar() - if not voucher_type: + if voucher_type is None: raise HTTPException( status_code=status.HTTP_404_NOT_FOUND, detail="Original bill not found", diff --git a/bookie/src/app/sales/bills/bills.component.ts b/bookie/src/app/sales/bills/bills.component.ts index 776d1b4..58ecf81 100644 --- a/bookie/src/app/sales/bills/bills.component.ts +++ b/bookie/src/app/sales/bills/bills.component.ts @@ -220,7 +220,7 @@ export class BillsComponent implements OnInit { ); } - moveKot(kot: Kot) { + moveKot(kot: BillViewItem) { const canMergeTables = this.auth.allowed('merge-tables'); this.chooseTable(canMergeTables) .pipe( @@ -233,9 +233,9 @@ export class BillsComponent implements OnInit { return this.bs.moveTable(table); } if (table.status) { - return this.bs.mergeKot(kot.id as string, table); + return this.bs.mergeKot(kot.kotId as string, table); } - return this.bs.moveKot(kot.id as string, table); + return this.bs.moveKot(kot.kotId as string, table); }), ) .subscribe(