ignoring vendor on transactions.

This commit is contained in:
Bryce
2018-06-29 15:11:09 -07:00
parent 5f6bc5beea
commit 9ee2c6fc2f
5 changed files with 6 additions and 27 deletions

View File

@@ -8,12 +8,8 @@
[auto-ap.time :as time]))
(defn transaction->vendor-id [_]
(-> (vendors/get-all)
first
:id))
(defn transaction->check-id [_ check-number company-id vendor-id]
(defn transaction->check-id [_ check-number company-id]
(when check-number
(-> (checks/get-graphql {:company-id company-id
:check-number check-number})
@@ -57,8 +53,7 @@
(assoc-in transaction [:description :original] (str "check xxx" (rand-nth ["6789" "1234" "6790"])))
transaction)
check-number (extract-check-number transaction)
company-id (account->company account-id)
vendor-id (transaction->vendor-id transaction)]]
company-id (account->company account-id) ]]
(try
(transactions/upsert!
@@ -72,10 +67,9 @@
:type type
:status status
:company-id company-id
:vendor-id vendor-id
:check-number check-number
:bank-account-id (yodlee-account-id->bank-account-id account-id)
:check-id (transaction->check-id transaction check-number company-id vendor-id)
:check-id (transaction->check-id transaction check-number company-id)
})
(catch Exception e
(println e))))))