Fix: Void bill now saves old bill id

This commit is contained in:
Amritanshu Agrawal 2021-08-10 07:50:08 +05:30
parent baefaeb228
commit 70c9d22bbc

View File

@ -28,7 +28,7 @@ def void(
try:
with SessionFuture() as db:
item: Voucher = db.execute(select(Voucher).where(Voucher.id == id_)).scalar_one()
item.reason = reason
item.reason = f"{reason} / Old Bill ID was: {item.full_bill_id}"
item.bill_id = None
item.voucher_type = VoucherType.VOID
do_update_settlements(item, [SettleSchema(id=SettleOption.VOID(), amount=round(item.amount))], db)