From fc0f727fb8dff4018dfe26fa25cf5107f6081615 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Sat, 14 Jul 2018 12:31:29 -0700 Subject: [PATCH] hopefully adds routing numbers --- src/clj/auto_ap/routes/checks.clj | 3 ++- src/clj/auto_ap/yodlee/import.clj | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/clj/auto_ap/routes/checks.clj b/src/clj/auto_ap/routes/checks.clj index 6159fad2..9b22d9bf 100644 --- a/src/clj/auto_ap/routes/checks.clj +++ b/src/clj/auto_ap/routes/checks.clj @@ -80,7 +80,7 @@ [[:cell {:colspan 2}] [:cell {:colspan 10 :leading 30} - [:phrase {:size 18 :ttf-name "public/micrenc.ttf"} (str "c" check "c a" (:acct-number (:bank company)) "a 10302c")]]] + [:phrase {:size 18 :ttf-name "public/micrenc.ttf"} (str "c" check "c a" (:routing (:bank company)) "a " (:acct-number (:bank company)) "c")]]] [[:cell {:colspan 12 :leading 18} [:spacer]]] @@ -198,6 +198,7 @@ :address (:address company) :bank {:name (:bank-name bank-account) :acct (:bank-code bank-account) + :routing (:routing bank-account) :acct-number (:number bank-account)}}} :invoices (map :id invoices)})) diff --git a/src/clj/auto_ap/yodlee/import.clj b/src/clj/auto_ap/yodlee/import.clj index ebafd96b..d5302f26 100644 --- a/src/clj/auto_ap/yodlee/import.clj +++ b/src/clj/auto_ap/yodlee/import.clj @@ -34,7 +34,10 @@ (defn extract-check-number [{{description-original :original} :description}] (if-let [[_ check-number] (re-find #"(?i)check[^0-9]+([0-9]*)" description-original)] - (Integer/parseInt check-number) + (try + (Integer/parseInt check-number) + (catch NumberFormatException e + nil)) nil)) (defn import-transactions [transactions transaction->company transaction->bank-account-id]