makes check voiding work correctly
This commit is contained in:
@@ -51,15 +51,15 @@
|
||||
:operation/name "VoidCheck"}
|
||||
|
||||
:venia/queries [{:query/data [:void-check
|
||||
{:check-id (:id check)}
|
||||
[:id :status :amount :check_number :s3_url :date [:vendor [:name :id]] [:company [:name :id]]]]}]}
|
||||
{:payment-id (:id check)}
|
||||
[:id :status :amount :check_number :s3_url :date [:vendor [:name :id]] [:client [:name :id]]]]}]}
|
||||
:on-success [::check-voided]}}))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::check-voided
|
||||
(fn [db [_ {:keys [void-check]}]]
|
||||
(-> db
|
||||
(update-in [::check-page :checks] (fn [checks]
|
||||
(update-in [::check-page :payments] (fn [checks]
|
||||
(mapv (fn [c]
|
||||
(if (= (:id c) (:id void-check))
|
||||
(assoc void-check :class "live-removed")
|
||||
@@ -162,8 +162,8 @@
|
||||
[:td (gstring/format "$%.2f" amount )]
|
||||
[:td status]
|
||||
[:td
|
||||
(when (or (= "pending" status)
|
||||
(#{"cash" "debit"} type))
|
||||
(when (or (= ":pending" status)
|
||||
(#{":cash" ":debit"} type))
|
||||
[:button.button.is-warning.is-outlined {:on-click (dispatch-event [::void-check i])} [:span [:span.icon [:i.fa.fa-minus-circle]]]])
|
||||
(if s3-url
|
||||
[:a.tag {:href s3-url :target "_new"} [:i.fa.fa-money-check] [:span.icon [:i.fa.fa-money]] (str " " check-number " (" (gstring/format "$%.2f" amount ) ")")]
|
||||
|
||||
Reference in New Issue
Block a user