diff --git a/src/backend/expungeservice/form_filling.py b/src/backend/expungeservice/form_filling.py index d094d2802..3f8888573 100644 --- a/src/backend/expungeservice/form_filling.py +++ b/src/backend/expungeservice/form_filling.py @@ -697,8 +697,12 @@ def _create_and_write_pdf( @staticmethod def counties_with_cases_to_expunge(all_case_results: List[CaseResults]): - counties: List[str] = [] + counties_with_eligible_charge: List[str] = [] + counties_with_balances: List[str] = [] for case_result in all_case_results: - if case_result.has_eligible_charges and case_result.case.summary.location not in counties: - counties.append(case_result.case.summary.location) - return counties + if case_result.has_eligible_charges and case_result.case.summary.location not in counties_with_eligible_charge: + counties_with_eligible_charge.append(case_result.case.summary.location) + if case_result.case.summary.balance_due_in_cents != 0: + counties_with_balances.append(case_result.case.summary.location) + counties_with_expungements = [county for county in counties_with_eligible_charge if county not in counties_with_balances] + return counties_with_expungements