From 65700d2760e2d05a1fbde185b8b9547175b9e081 Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Tue, 14 Mar 2023 00:15:35 +0530 Subject: [PATCH] Fix: Date was not updated when the bill was printed. --- barker/barker/routers/voucher/update.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/barker/barker/routers/voucher/update.py b/barker/barker/routers/voucher/update.py index 5828b60..0eba262 100644 --- a/barker/barker/routers/voucher/update.py +++ b/barker/barker/routers/voucher/update.py @@ -71,6 +71,8 @@ def update_route( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail="Internal error, reprints should not reach here", ) + if item.voucher_type == VoucherType.KOT and voucher_type != VoucherType.KOT: + item.date = now item.voucher_type = voucher_type item.user_id = user.id_ item.last_edit_date = now