From 80e0650d00afed0c724282c16481c9fb24574995 Mon Sep 17 00:00:00 2001 From: Travis Semple Date: Mon, 9 Sep 2024 17:06:34 -0700 Subject: [PATCH] Small fix for statement owing (#1736) --- pay-api/src/pay_api/services/eft_short_names.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pay-api/src/pay_api/services/eft_short_names.py b/pay-api/src/pay_api/services/eft_short_names.py index ec2d5b708..59c48e7b1 100644 --- a/pay-api/src/pay_api/services/eft_short_names.py +++ b/pay-api/src/pay_api/services/eft_short_names.py @@ -627,6 +627,10 @@ def get_statement_summary_query(): InvoiceModel.id == StatementInvoicesModel.invoice_id, InvoiceModel.payment_method_code == PaymentMethod.EFT.value ) + ).filter( + InvoiceModel.invoice_status_code.notin_([InvoiceStatus.CANCELLED.value, + InvoiceStatus.REFUND_REQUESTED.value, + InvoiceStatus.REFUNDED.value]) ).group_by(StatementModel.payment_account_id) @classmethod