Removes plaid matching, disables payment for scheduled.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -45,3 +45,4 @@ data/solr/data/logs
|
||||
data/solr/logs
|
||||
.vscode/**
|
||||
sysco-poller/**/*.csv
|
||||
.aider*
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
(:merchant_name t) (assoc :transaction/plaid-merchant {:plaid-merchant/name (:merchant_name t)
|
||||
:db/id (random-tempid)})
|
||||
(not (str/blank? (:check_number t))) (assoc :transaction/check-number (Integer/parseInt (:check_number t)))
|
||||
(plaid-merchant->vendor-id (:merchant_name t)) (assoc :transaction/default-vendor
|
||||
#_#_(plaid-merchant->vendor-id (:merchant_name t)) (assoc :transaction/default-vendor
|
||||
(plaid-merchant->vendor-id (:merchant_name t)))))
|
||||
|
||||
(defn build-plaid-merchant->vendor-id []
|
||||
|
||||
@@ -344,6 +344,14 @@
|
||||
|
||||
(defn pay-button* [params]
|
||||
(let [ids (:ids params)
|
||||
ids (if (seq ids)
|
||||
(map first
|
||||
(dc/q '[:find ?i
|
||||
:in $ [?i ...]
|
||||
:where (not [?i :invoice/scheduled-payment])]
|
||||
(dc/db conn)
|
||||
ids))
|
||||
ids)
|
||||
selected-client-count (if (seq ids)
|
||||
(ffirst
|
||||
(dc/q '[:find (count ?c)
|
||||
@@ -392,10 +400,10 @@
|
||||
:x-ref "button"
|
||||
:minimal-loading? true
|
||||
:class "relative"}
|
||||
(if (> (count (:ids params)) 0)
|
||||
(if (> (count ids) 0)
|
||||
|
||||
(format "Pay %d invoices ($%,.2f)"
|
||||
(count (:ids params))
|
||||
(count ids)
|
||||
(or total 0.0))
|
||||
"Pay")
|
||||
(when (or (= 0 (count ids))
|
||||
@@ -516,16 +524,18 @@
|
||||
(some-> due (atime/unparse-local atime/normal-date)))}
|
||||
{:key "status"
|
||||
:name "Status"
|
||||
:render (fn [{:invoice/keys [status]}]
|
||||
(condp = status
|
||||
:invoice-status/paid
|
||||
:render (fn [{:invoice/keys [status scheduled-payment]}]
|
||||
(cond (= status :invoice-status/paid)
|
||||
(com/pill {:color :primary} "Paid")
|
||||
|
||||
:invoice-status/unpaid
|
||||
(com/pill {:color :secondary} "Unpaid")
|
||||
:invoice-status/voided
|
||||
(= status :invoice-status/voided)
|
||||
(com/pill {:color :red} "Voided")
|
||||
nil
|
||||
|
||||
scheduled-payment
|
||||
(com/pill {:color :yellow} "Scheduled")
|
||||
|
||||
(= status :invoice-status/unpaid)
|
||||
(com/pill {:color :secondary} "Unpaid")
|
||||
:else
|
||||
""))}
|
||||
{:key "accounts"
|
||||
:name "Account"
|
||||
@@ -1197,7 +1207,8 @@
|
||||
(->> (dc/q '[:find ?i
|
||||
:in $ [?i ...]
|
||||
:where [?i :invoice/status :invoice-status/unpaid]
|
||||
[?i :invoice/client ?c]]
|
||||
[?i :invoice/client ?c]
|
||||
(not [?i :invoice/scheduled-payment])]
|
||||
(dc/db conn)
|
||||
ids)
|
||||
(map first)))
|
||||
|
||||
Reference in New Issue
Block a user