When plaid merchant is linked to vendor, automatically code to that vendor.
This commit is contained in:
@@ -247,6 +247,15 @@
|
||||
(when-not (seq (match-transaction-to-unpaid-invoices amount client))
|
||||
(apply-rules transaction valid-locations)))
|
||||
|
||||
(defn maybe-apply-default-vendor [t]
|
||||
(cond-> t
|
||||
(and (not (:transaction/vendor t))
|
||||
(:transaction/default-vendor t))
|
||||
(assoc :transaction/vendor (:transaction/default-vendor t))
|
||||
|
||||
true
|
||||
(dissoc :transaction/default-vendor)))
|
||||
|
||||
(defn transaction->txs [transaction bank-account apply-rules]
|
||||
(let [bank-account-id (:db/id bank-account)
|
||||
client (:client/_bank-accounts bank-account)
|
||||
@@ -263,6 +272,7 @@
|
||||
(assoc :transaction/approval-status :transaction-approval-status/unapproved)
|
||||
maybe-assoc-check-number
|
||||
code-fn
|
||||
(maybe-apply-default-vendor)
|
||||
remove-nils)))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user