diff --git a/src/clj/auto_ap/yodlee/import.clj b/src/clj/auto_ap/yodlee/import.clj index 0c49ad76..0350ab53 100644 --- a/src/clj/auto_ap/yodlee/import.clj +++ b/src/clj/auto_ap/yodlee/import.clj @@ -68,23 +68,24 @@ (try - (transactions/upsert! - {:post-date (time/parse post-date "YYYY-MM-dd") - :id (sha-256 (str id)) - :account-id account-id - :date (time/parse date "YYYY-MM-dd") - :amount amount - :description-original description-original - :description-simple description-simple - :type type - :status status - :company-id company-id - :check-number check-number - :bank-account-id (transaction->bank-account-id transaction) - :check-id check-id - }) - (when check-id - (checks/update! {:id check-id :status "cleared"})) + (when company-id + (transactions/upsert! + {:post-date (time/parse post-date "YYYY-MM-dd") + :id (sha-256 (str id)) + :account-id account-id + :date (time/parse date "YYYY-MM-dd") + :amount amount + :description-original description-original + :description-simple description-simple + :type type + :status status + :company-id company-id + :check-number check-number + :bank-account-id (transaction->bank-account-id transaction) + :check-id check-id + }) + (when check-id + (checks/update! {:id check-id :status "cleared"}))) (catch Exception e (println e)))))