made fix.
This commit is contained in:
18
main.py
18
main.py
@@ -580,12 +580,22 @@ def main() -> None:
|
|||||||
t for t in all_ynab_txns if t["account_id"] in set(account_ids_for_ext)
|
t for t in all_ynab_txns if t["account_id"] in set(account_ids_for_ext)
|
||||||
]
|
]
|
||||||
|
|
||||||
# Filter WF to the comparison window, then find only new ones
|
# Filter WF to the comparison window
|
||||||
filtered_wf = _filter_wf_from_date(wf_txns, start_iso)
|
filtered_wf = _filter_wf_from_date(wf_txns, start_iso)
|
||||||
new_wf = _find_new_transactions(filtered_wf, scoped_ynab)
|
|
||||||
|
|
||||||
# Convert the new WF transactions to YNAB-ready dicts
|
# For import: only exclude WF txns that already match a cleared/reconciled
|
||||||
ynab_ready = _convert_wf_to_ynab_transactions(new_wf, target_account_id)
|
# YNAB transaction. Posted WF txns matching *uncleared* YNAB entries must
|
||||||
|
# survive so _classify_for_import can promote them to cleared.
|
||||||
|
settled_ynab = [
|
||||||
|
t for t in scoped_ynab
|
||||||
|
if t["cleared"] in ("cleared", "reconciled")
|
||||||
|
]
|
||||||
|
import_candidates = _find_new_transactions(filtered_wf, settled_ynab)
|
||||||
|
|
||||||
|
# Convert the candidates to YNAB-ready dicts
|
||||||
|
ynab_ready = _convert_wf_to_ynab_transactions(
|
||||||
|
import_candidates, target_account_id,
|
||||||
|
)
|
||||||
|
|
||||||
# Classify against existing YNAB transactions
|
# Classify against existing YNAB transactions
|
||||||
classification = _classify_for_import(ynab_ready, scoped_ynab)
|
classification = _classify_for_import(ynab_ready, scoped_ynab)
|
||||||
|
|||||||
Reference in New Issue
Block a user