ignoring vendor on transactions.
This commit is contained in:
@@ -76,8 +76,6 @@
|
||||
:description_original {:type 'String}
|
||||
:description_simple {:type 'String}
|
||||
:status {:type 'String}
|
||||
:vendor {:type :vendor
|
||||
:resolve :get-vendor-for-transaction}
|
||||
:company {:type :company
|
||||
:resolve :get-company-for-transaction}
|
||||
:check {:type :check
|
||||
@@ -389,7 +387,6 @@
|
||||
:get-vendor-for-check gq-checks/get-vendor-for-check
|
||||
:get-company-for-check gq-checks/get-company-for-check
|
||||
:get-company-for-transaction gq-transactions/get-company-for-transaction
|
||||
:get-vendor-for-transaction gq-transactions/get-vendor-for-transaction
|
||||
:get-check-for-transaction gq-transactions/get-check-for-transaction
|
||||
:get-company-for-invoice get-company-for-invoice
|
||||
:get-invoices-checks get-invoices-checks
|
||||
|
||||
@@ -11,12 +11,6 @@
|
||||
[auto-ap.db.companies :as companies]
|
||||
[auto-ap.time :refer [parse normal-date]]))
|
||||
|
||||
(defn get-vendor-for-transaction [context args value]
|
||||
(->graphql
|
||||
(if-let [vendor-cache (:vendor-cache context)]
|
||||
(vendor-cache (:vendor_id value))
|
||||
(vendors/get-by-id (:vendor_id value)))))
|
||||
|
||||
(defn get-check-for-transaction [context args value]
|
||||
(->graphql
|
||||
(checks/get-by-id (:check_id value))))
|
||||
|
||||
@@ -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))))))
|
||||
|
||||
Reference in New Issue
Block a user