Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check disbursement status for none #1841

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions jobs/payment-jobs/tasks/ap_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
RoutingSlipStatus,
)
from sentry_sdk import capture_message
from sqlalchemy import Date, cast, or_
from sqlalchemy import Date, cast

from tasks.common.cgi_ap import CgiAP
from tasks.common.dataclasses import APLine
Expand Down Expand Up @@ -109,8 +109,7 @@ def _create_eft_refund_file(cls):
eft_refunds_dao = (
db.session.query(EFTRefundModel)
.filter(EFTRefundModel.status == EFTShortnameRefundStatus.APPROVED.value)
.filter(or_(EFTRefundModel.disbursement_status_code != DisbursementStatus.UPLOADED.value,
EFTRefundModel.disbursement_status_code.is_(None)))
.filter(EFTRefundModel.disbursement_status_code.is_(None))
.filter(EFTRefundModel.refund_amount > 0)
.all()
)
Expand Down
2 changes: 1 addition & 1 deletion jobs/payment-jobs/tests/jobs/test_ap_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_eft_refunds(session, monkeypatch):
)
short_name = factory_create_eft_shortname("SHORTNAMETEST")
eft_refund = factory_create_eft_refund(
disbursement_status_code=DisbursementStatus.ACKNOWLEDGED.value,
disbursement_status_code=None,
refund_amount=100,
refund_email="test@test.com",
short_name_id=short_name.id,
Expand Down