From 9ba45e6de8ce095a8173e92ec206c7c05d3b6bcb Mon Sep 17 00:00:00 2001 From: Travis Semple Date: Mon, 9 Sep 2024 13:20:52 -0700 Subject: [PATCH] only reverse receipt number, if it exists --- jobs/payment-jobs/tasks/eft_task.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jobs/payment-jobs/tasks/eft_task.py b/jobs/payment-jobs/tasks/eft_task.py index f58cb3e78..94d36549b 100644 --- a/jobs/payment-jobs/tasks/eft_task.py +++ b/jobs/payment-jobs/tasks/eft_task.py @@ -323,7 +323,8 @@ def _rollback_receipt_and_invoice(cls, cfs_account: CfsAccountModel, f'not found for invoice id: {invoice.id} - {invoice.invoice_status_code}') is_invoice_refund = invoice.invoice_status_code == InvoiceStatus.REFUND_REQUESTED.value is_reversal = not is_invoice_refund - CFSService.reverse_rs_receipt_in_cfs(cfs_account, receipt_number, ReverseOperation.VOID.value) + if receipt_number: + CFSService.reverse_rs_receipt_in_cfs(cfs_account, receipt_number, ReverseOperation.VOID.value) if is_invoice_refund: cls._handle_invoice_refund(invoice, invoice_reference) else: