From 7a2ccb7fb1da5eb129261a1bf888b6dcf702eed1 Mon Sep 17 00:00:00 2001 From: tanshu Date: Tue, 26 Apr 2022 08:47:55 +0530 Subject: [PATCH] Fix: Sale Report won't add sales of printed but yet unsettled bills to Category wise sale. --- barker/barker/routers/reports/sale_report.py | 1 + 1 file changed, 1 insertion(+) diff --git a/barker/barker/routers/reports/sale_report.py b/barker/barker/routers/reports/sale_report.py index 303e579..9c448b3 100644 --- a/barker/barker/routers/reports/sale_report.py +++ b/barker/barker/routers/reports/sale_report.py @@ -70,6 +70,7 @@ def get_sale(s: date, f: date, db: Session) -> List[SaleReportItem]: Voucher.date >= start_date, Voucher.date <= finish_date, Voucher.voucher_type == VoucherType.REGULAR_BILL, + ~Voucher.settlements.any(Settlement.settled == SettleOption.UNSETTLED()), or_( ProductVersion.valid_from == None, # noqa: E711 ProductVersion.valid_from <= day,