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