From 4dc5ecc40c8fd219b1bc01dba4e11611764618c4 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Mon, 21 May 2018 08:17:57 -0400 Subject: [PATCH] Compare oldest transactions first --- src/ledger_reconciler/core.clj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ledger_reconciler/core.clj b/src/ledger_reconciler/core.clj index e24aec1..13c8228 100644 --- a/src/ledger_reconciler/core.clj +++ b/src/ledger_reconciler/core.clj @@ -56,7 +56,10 @@ (let [[period account filename] args dcu-record (parse-dcu-csv filename) ledger-record (parse-ledger-output period account) - [dcu-unmatched ledger-unmatched] (compare-records dcu-record ledger-record '() '())] + [dcu-unmatched ledger-unmatched] (compare-records + (reverse dcu-record) + (reverse ledger-record) + '() '())] (if (> (+ (count dcu-unmatched) (count ledger-unmatched)) 0) (do (println "Unmatched bank transactions:") (doseq [t dcu-unmatched] (println (format-item t)))