started work on simplifying invoice page

This commit is contained in:
Bryce Covert
2020-08-10 13:26:14 -07:00
parent 8f491de902
commit 9dede12b61
5 changed files with 174 additions and 249 deletions

View File

@@ -5,6 +5,7 @@
[auto-ap.events :as events] [auto-ap.events :as events]
[auto-ap.views.main :refer [page active-page] ] [auto-ap.views.main :refer [page active-page] ]
[auto-ap.reload :as reload] [auto-ap.reload :as reload]
[auto-ap.events :as events]
[auto-ap.config :as config] [auto-ap.config :as config]
[auto-ap.effects :as effects] [auto-ap.effects :as effects]

View File

@@ -168,10 +168,15 @@
(let [headers (if token (let [headers (if token
{"Authorization" (str "Token " token)} {"Authorization" (str "Token " token)}
{}) {})
on-success (if (fn? on-success)
on-success
(fn [result]
(conj on-success result)))
method (if (= (get-in query-obj [:venia/operation :operation/type]) :mutation) method (if (= (get-in query-obj [:venia/operation :operation/type]) :mutation)
:post :post
:get) :get)
headers (if (= method :post) headers (if (= method :post)
(assoc headers "Content-Type" "text/plain") (assoc headers "Content-Type" "text/plain")
headers) headers)
@@ -214,5 +219,5 @@
:body :body
:data :data
(dates->date-times) (dates->date-times)
(conj on-success) (on-success)
(re-frame/dispatch)))))))) (re-frame/dispatch))))))))

View File

@@ -108,14 +108,16 @@
(r/as-element (into (r/as-element (into
[:div {:style {:margin-bottom "1rem"}} [:div {:style {:margin-bottom "1rem"}}
[:div.level [:div.level
[:div.level-left (into
[:div.level-item [:div.level-left
[paginator {:start start :end end :count count :total total [:div.level-item
:on-change on-params-change}]] [paginator {:start start :end end :count count :total total
[:div.level-item :on-change on-params-change}]]
[sort-by-list {:sort (:sort params) [:div.level-item
:on-change on-params-change}]]]]] [sort-by-list {:sort (:sort params)
children))))])) :on-change on-params-change}]]]
(mapv (fn [c]
[:div.level-item c]) children))]]))))]))
(defn table [] (defn table []
(r/create-class {:reagent-render (r/create-class {:reagent-render

View File

@@ -1,49 +1,21 @@
(ns auto-ap.views.components.invoice-table (ns auto-ap.views.components.invoice-table
(:require [re-frame.core :as re-frame] (:require [auto-ap.events :as events]
[auto-ap.routes :as routes]
[auto-ap.subs :as subs]
[auto-ap.views.components.buttons :as buttons]
[auto-ap.views.components.dropdown
:refer
[drop-down drop-down-contents]]
[auto-ap.views.components.grid :as grid]
[auto-ap.views.pages.invoices.form :as form]
[auto-ap.views.pages.invoices.common :refer [invoice-read]]
[auto-ap.views.utils :refer [date->str dispatch-event nf]]
[bidi.bidi :as bidi] [bidi.bidi :as bidi]
[cemerick.url :as url] [cemerick.url :as url]
[auto-ap.subs :as subs]
[auto-ap.routes :as routes]
[auto-ap.views.utils :refer [date->str dispatch-event delayed-dispatch nf]]
[auto-ap.views.components.paginator :refer [paginator]]
[auto-ap.views.components.sort-by-list :refer [sort-by-list]]
[auto-ap.views.components.sorter :refer [sorted-column]]
[auto-ap.views.components.dropdown :refer [drop-down drop-down-contents]]
[auto-ap.events :as events]
[reagent.core :as reagent]
[clojure.string :as str]
[cljs-time.format :as format]
[cljs-time.core :as t] [cljs-time.core :as t]
[clojure.string :as str]
[goog.string :as gstring] [goog.string :as gstring]
[goog.i18n.NumberFormat.Format]) [re-frame.core :as re-frame]))
)
;; TODO graphql schema enforcement
;; TODO postgres constraints for data integrity
;; TODO performance
;; TODO refactor graphql
(re-frame/reg-event-fx
::toggle-checks
(fn [{:keys [db] } [_ invoice-id]]
{:db
(update-in db [::visible-checks] (fn [i] (if (= i invoice-id) nil invoice-id) ))}))
(re-frame/reg-sub
::visible-checks
(fn [db]
(::visible-checks db)))
(re-frame/reg-event-fx
::toggle-expense-accounts
(fn [{:keys [db] } [_ invoice-id]]
{:db
(update-in db [::visible-expense-accounts] (fn [i] (if (= i invoice-id) nil invoice-id) ))}))
(re-frame/reg-sub
::visible-expense-accounts
(fn [db]
(::visible-expense-accounts db)))
(defn query [params] (defn query [params]
{:venia/queries [[:invoice_page {:venia/queries [[:invoice_page
@@ -80,15 +52,53 @@
(fn [{table-params :db} [_ params :as z]] (fn [{table-params :db} [_ params :as z]]
{:db (merge table-params params)})) {:db (merge table-params params)}))
(defn row [{:keys [invoice check-boxes checked on-check-changed selected-client overrides expense-event on-edit-invoice on-void-invoice on-unvoid-invoice]}] (re-frame/reg-event-fx
::void-invoice
(fn [{:keys [db]} [_ {id :id}]]
{:graphql
{:token (-> db :user)
:owns-state {:multi ::void
:which id}
:query-obj {:venia/operation {:operation/type :mutation
:operation/name "VoidInvoice"}
:venia/queries [{:query/data [:void-invoice
{:invoice-id id}
invoice-read]}]}
:on-success (fn [result]
[::invoice-updated (assoc (:void-invoice result)
:class "live-removed")])}}))
(re-frame/reg-event-fx
::unvoid-invoice
(fn [{:keys [db]} [_ {id :id}]]
{:graphql
{:token (-> db :user)
:owns-state {:multi ::unvoid
:which id}
:query-obj {:venia/operation {:operation/type :mutation
:operation/name "UnvoidInvoice"}
:venia/queries [{:query/data [:unvoid-invoice
{:invoice-id id}
invoice-read]}]}
:on-success (fn [result]
[::invoice-updated (assoc (:unvoid-invoice result)
:class "live-added")])}}))
(re-frame/reg-event-fx
::invoice-updated
(fn [{:keys [db]} [_ invoice]]
{:db db}))
(defn row [{:keys [invoice check-boxes checked on-check-changed selected-client overrides expense-event ]}]
(let [{:keys [client payments expense-accounts invoice-number date due total outstanding-balance id vendor checkable?] :as i} invoice (let [{:keys [client payments expense-accounts invoice-number date due total outstanding-balance id vendor checkable?] :as i} invoice
accounts-by-id @(re-frame/subscribe [::subs/accounts-by-id client]) accounts-by-id @(re-frame/subscribe [::subs/accounts-by-id client])
account->name #(:name (accounts-by-id (:id %)))] account->name #(:name (accounts-by-id (:id %)))]
[:tr {:class (:class i)} [grid/row {:class (:class i)}
(when check-boxes (when check-boxes
[:td.expandable [grid/cell {}
[:input.checkbox (cond-> {:type "checkbox" [:input.checkbox (cond-> {:type "checkbox"
:checked (if (get checked id) :checked (if (get checked id)
"checked" "checked"
"") "")
@@ -96,13 +106,14 @@
(on-check-changed id i)))} (on-check-changed id i)))}
(boolean? checkable?) (assoc :disabled (not checkable?))) ]]) (boolean? checkable?) (assoc :disabled (not checkable?))) ]])
(when-not selected-client (when-not selected-client
[:td (if-let [client-override (:client overrides)] [grid/cell {}
(client-override i) (if-let [client-override (:client overrides)]
(:name client))]) (client-override i)
[:td (:name vendor)] (:name client))])
[:td invoice-number] [grid/cell {} (:name vendor)]
[:td (date->str date) ] [grid/cell {} invoice-number]
[:td [grid/cell {} (date->str date) ]
[grid/cell {}
(when due (when due
(let [today (t/at-midnight (t/now)) (let [today (t/at-midnight (t/now))
due (t/at-midnight due) due (t/at-midnight due)
@@ -113,19 +124,18 @@
[:span.has-text-success due-in " days"] [:span.has-text-success due-in " days"]
[:span.has-text-danger due-in " days"]) [:span.has-text-danger due-in " days"])
))] ))]
[:td (str/join ", " (set (map :location expense-accounts)))] [grid/cell {} (str/join ", " (set (map :location expense-accounts)))]
[:td.has-text-right (nf total )] [grid/cell {:class "has-text-right"} (nf total )]
[:td.has-text-right (nf outstanding-balance )] [grid/cell {:class "has-text-right"} (nf outstanding-balance )]
[:td.expandable [grid/cell {:style {:overflow "visible"}}
[:div.buttons [:div.buttons
(when (seq expense-accounts) (when (seq expense-accounts)
[drop-down {:id [::expense-accounts id ] [drop-down {:id [::expense-accounts id ]
:header [:a.button.badge {:data-badge (str (clojure.core/count expense-accounts)) :header [:a.button.badge {:data-badge (str (clojure.core/count expense-accounts))
:aria-haspopup true :aria-haspopup true
:on-click (dispatch-event [::events/toggle-menu [::expense-accounts id]]) :on-click (dispatch-event [::events/toggle-menu [::expense-accounts id]])
:tab-index "0" :tab-index "0"} "Accounts"]}
} "Accounts"]}
[drop-down-contents [drop-down-contents
[:div [:div
(for [e expense-accounts] (for [e expense-accounts]
@@ -137,12 +147,15 @@
(when expense-event (when expense-event
[:a.dropdown-item.is-primary {:on-click (dispatch-event (conj expense-event i))} "Change"])]]]) [:a.dropdown-item.is-primary {:on-click (dispatch-event (conj expense-event i))} "Change"])]]])
[:span {:style {:margin-left "1em"}}] [:span {:style {:margin-left "1em"}}]
(when (and on-edit-invoice (not= ":voided" (:status i))) (when (not= ":voided" (:status i))
[:a.button {:on-click (fn [] (on-edit-invoice i))} [:span.icon [:i.fa.fa-pencil]]]) [buttons/fa-icon {:icon "fa-pencil"
(when (and on-void-invoice (= (:outstanding-balance i) (:total i)) (not= ":voided" (:status i))) :event [::form/editing i]}])
[:a.button {:on-click (fn [] (on-void-invoice i))} [:span.icon [:span.icon-bin-2 {:style {:font-weight "400"}}]]]) (when (and (= (:outstanding-balance i) (:total i)) (not= ":voided" (:status i)))
(when (and on-unvoid-invoice (= ":voided" (:status i))) [buttons/sl-icon {:icon "icon-bin-2"
[:a.button {:on-click (fn [] (on-unvoid-invoice i))} [:span [:span.icon [:i.fa.fa-undo]]]]) :event [::void-invoice i]}])
(when (= ":voided" (:status i))
[buttons/fa-icon {:icon "fa-undo"
:event [::unvoid-invoice i]}])
(when (seq payments) (when (seq payments)
[drop-down {:id [::payments id] [drop-down {:id [::payments id]
:header [:button.button.badge {:data-badge (str (clojure.core/count payments)) :header [:button.button.badge {:data-badge (str (clojure.core/count payments))
@@ -169,19 +182,12 @@
(when (= :cleared (:status (:payment payment))) (when (= :cleared (:status (:payment payment)))
(str " - " (:post-date (:transaction (:payment payment))))))]))]])]]])) (str " - " (:post-date (:transaction (:payment payment))))))]))]])]]]))
(defn invoice-table [{:keys [id invoice-page status vendors check-boxes checked on-check-changed on-edit-invoice on-void-invoice on-unvoid-invoice expense-event overrides]}] (defn invoice-table [{:keys [id invoice-page status vendors check-boxes checked on-check-changed expense-event overrides]}]
(let [opc (fn [p] (let [selected-client @(re-frame/subscribe [::subs/client])
(re-frame/dispatch [::params-changed p]))
visible-checks @(re-frame/subscribe [::visible-checks])
visible-expense-accounts @(re-frame/subscribe [::visible-expense-accounts])
selected-client @(re-frame/subscribe [::subs/client])
{:keys [sort]} @(re-frame/subscribe [::table-params]) {:keys [sort]} @(re-frame/subscribe [::table-params])
{:keys [invoices outstanding start end count total]} @invoice-page {:keys [invoices outstanding start end count total]} @invoice-page
visible-checks @(re-frame/subscribe [::visible-checks])
visible-expense-accounts @(re-frame/subscribe [::visible-expense-accounts])
selected-client @(re-frame/subscribe [::subs/client]) selected-client @(re-frame/subscribe [::subs/client])
percentage-size (if selected-client "%50%" "33%") is-loading? (= :loading status)
is-loading? (:loading @status)
is-sorted-by-vendor? (and (= "vendor" (:sort-key (first sort))) is-sorted-by-vendor? (and (= "vendor" (:sort-key (first sort)))
(not is-loading?)) (not is-loading?))
[invoice-groups] (if is-sorted-by-vendor? [invoice-groups] (if is-sorted-by-vendor?
@@ -196,95 +202,46 @@
[[] nil] [[] nil]
(:invoices @invoice-page)) (:invoices @invoice-page))
[[(:invoices @invoice-page)]])] [[(:invoices @invoice-page)]])]
[:div [grid/grid {:on-params-change (fn [p]
[:div.level (re-frame/dispatch [::params-changed p]))
[:div.level-left :params @(re-frame/subscribe [::table-params])
[:div.level-item :status status
[paginator {:start start :end end :count count :total total ;; TODO checkboxes
:on-change opc}]] :column-count (if selected-client 8 9)}
[:div.level-item [grid/controls @invoice-page
[sort-by-list {:sort sort [:div.level-item
:on-change opc}]] "Outstanding " (nf outstanding)]]
[:div.level-item (for [invoices invoice-groups]
"Outstanding " (nf outstanding)]]] ^{:key (or (:id (first invoices)) "init")}
(doall [grid/table {:fullwidth true}
(for [invoices invoice-groups] [grid/header {}
^{:key (:id (first invoices))} [grid/row {}
[:table.table.is-fullwidth (when check-boxes
[:thead [grid/header-cell {:style {:width "22px"}}])
[:tr (when-not selected-client
(when check-boxes [grid/sortable-header-cell {:sort-key "client" :sort-name "Client"} "Client"])
[:th {:style {"width" "20px"}}]) [grid/sortable-header-cell {:sort-key "vendor" :sort-name "Vendor"}
(when-not selected-client (if is-sorted-by-vendor?
[sorted-column {:on-sort opc (:name (:vendor (first invoices)))
:style {:width percentage-size :cursor "pointer"} "Vendor")]
:sort-name "Client"
:sort-key "client"
:sort sort}
"Client"])
[sorted-column {:on-sort opc
:style {:width percentage-size :cursor "pointer"}
:sort-name "Vendor"
:sort-key "vendor"
:sort sort}
(if is-sorted-by-vendor?
(:name (:vendor (first invoices)))
"Vendor")]
[sorted-column {:on-sort opc
:style {:width percentage-size :cursor "pointer"}
:sort-name "Invoice Number"
:sort-key "invoice-number"
:sort sort}
"Invoice #"]
[sorted-column {:on-sort opc
:style {:width "8em" :cursor "pointer"}
:sort-name "Date"
:sort-key "date"
:sort sort}
"Date"]
[sorted-column {:on-sort opc
:style {:width "8em" :cursor "pointer"}
:sort-name "Due"
:sort-key "due"
:sort sort}
"Due"]
[sorted-column {:on-sort opc
:style {:width "5em" :cursor "pointer"}
:sort-name "Location"
:sort-key "location"
:sort sort}
"Loc"]
[sorted-column {:on-sort opc
:style {:width "8em" :cursor "pointer"}
:sort-name "Total"
:sort-key "total"
:class "has-text-right"
:sort sort}
"Amount"]
[sorted-column {:on-sort opc [grid/sortable-header-cell {:sort-key "invoice-number" :sort-name "Invoice Number"} "Invoice #"]
:style {:width "10em" :cursor "pointer"} [grid/sortable-header-cell {:sort-key "date" :sort-name "Date" :style {:width "8em"}} "Date"]
:sort-name "Outstanding" [grid/sortable-header-cell {:sort-key "due" :sort-name "Due" :style {:width "8em"}} "Due"]
:sort-key "outstanding-balance" [grid/sortable-header-cell {:sort-key "location" :sort-name "Location" :style {:width "5em"}} "Loc"]
:class "has-text-right" [grid/sortable-header-cell {:sort-key "total" :sort-name "Total" :style {:width "8em"} :class "has-text-right"} "Total"]
:sort sort}
"Outstanding"] [grid/sortable-header-cell {:sort-key "outstanding-balance" :sort-name "Outstanding" :style {:width "10em"} :class "has-text-right"} "Outstanding"]
[:th {:style {:width "20rem" :cursor "pointer"}} [grid/header-cell {:style {:width "20rem" }}]
""]]] ]]
[:tbody
(if is-loading? [grid/body
[:tr (for [{:keys [client payments expense-accounts invoice-number date due total outstanding-balance id vendor] :as i} invoices]
[:td {:col-span 5} ^{:key id}
[:i.fa.fa-spin.fa-spinner]]] [row {:invoice i
(for [{:keys [client payments expense-accounts invoice-number date due total outstanding-balance id vendor] :as i} invoices] :check-boxes check-boxes
^{:key id} :checked checked
[row {:invoice i :on-check-changed on-check-changed
:check-boxes check-boxes :selected-client selected-client
:checked checked :overrides overrides
:on-check-changed on-check-changed :expense-event expense-event}])]])]))
:selected-client selected-client
:overrides overrides
:expense-event expense-event
:on-edit-invoice on-edit-invoice
:on-void-invoice on-void-invoice
:on-unvoid-invoice on-unvoid-invoice}]))]]))]))

View File

@@ -21,7 +21,10 @@
[goog.string :as gstring] [goog.string :as gstring]
[vimsical.re-frame.cofx.inject :as inject] [vimsical.re-frame.cofx.inject :as inject]
[re-frame.core :as re-frame] [re-frame.core :as re-frame]
[reagent.core :as r])) [reagent.core :as r]
[auto-ap.status :as status]
[vimsical.re-frame.fx.track :as track]
[auto-ap.utils :refer [merge-by]]))
(defn does-amount-exceed-outstanding? [amount outstanding-balance] (defn does-amount-exceed-outstanding? [amount outstanding-balance]
(let [amount (js/parseFloat amount) (let [amount (js/parseFloat amount)
@@ -71,25 +74,16 @@
(fn [db] (fn [db]
(-> db ::check-results))) (-> db ::check-results)))
(re-frame/reg-sub
::last-params
(fn [db]
(-> db ::last-params)))
(re-frame/reg-sub (re-frame/reg-sub
::params ::params
:<- [::last-params]
:<- [::subs/client] :<- [::subs/client]
:<- [::side-bar/filter-params] :<- [::side-bar/filter-params]
:<- [::table/table-params] :<- [::table/table-params]
(fn [[last-params client filter-params table-params]] (fn [[client filter-params table-params]]
(let [params (cond-> {:import-status "imported"} (cond-> {:import-status "imported"}
client (assoc :client-id (:id client)) client (assoc :client-id (:id client))
(seq filter-params) (merge filter-params) (seq filter-params) (merge filter-params)
(seq table-params) (merge table-params))] (seq table-params) (merge table-params))))
(when (not= params last-params)
(re-frame/dispatch [::params-change]))
params)))
(re-frame/reg-event-db (re-frame/reg-event-db
::invoice-updated ::invoice-updated
@@ -101,12 +95,10 @@
(re-frame/reg-event-fx (re-frame/reg-event-fx
::params-change ::params-change
[with-user (re-frame/inject-cofx ::inject/sub [::params])] [with-user]
(fn [{::keys [params] :as cofx} _] (fn [{:keys [user]} [_ params]]
{:db (-> (:db cofx) {:graphql {:token user
(assoc-in [:status :loading] true) :owns-state {:single ::page}
(assoc-in [::last-params] params))
:graphql {:token (-> cofx :db :user)
:query-obj (table/query params ) :query-obj (table/query params )
:on-success [::received] :on-success [::received]
:on-error [::events/page-failed]} :on-error [::events/page-failed]}
@@ -118,7 +110,20 @@
(re-frame/reg-event-fx (re-frame/reg-event-fx
::unmounted ::unmounted
(fn [{:keys [db]} _] (fn [{:keys [db]} _]
{:db (dissoc db ::invoice-page ::table/table-params ::side-bar/filters ::side-bar/settled-filters ::last-params)})) {:db (dissoc db ::invoice-page ::table/table-params ::side-bar/filters ::side-bar/settled-filters ::last-params)
:forward-events {:unregister ::updated}
::track/dispose {:id ::params}}))
(re-frame/reg-event-fx
::mounted
(fn [{:keys [db]} _]
{::track/register {:id ::params
:subscription [::params]
:event-fn (fn [params]
[::params-change params])}
:forward-events {:register ::updated
:events #{::table/invoice-updated}
:dispatch-to [::invoice-updated]}}))
(re-frame/reg-event-db (re-frame/reg-event-db
::received ::received
@@ -310,32 +315,6 @@
:location (first (:locations @(re-frame/subscribe [::subs/client])))}]})) :location (first (:locations @(re-frame/subscribe [::subs/client])))}]}))
(re-frame/reg-event-fx
::unvoid-invoice
(fn [{:keys [db]} [_ {id :id}]]
{:graphql
{:token (-> db :user)
:query-obj {:venia/operation {:operation/type :mutation
:operation/name "UnvoidInvoice"}
:venia/queries [{:query/data [:unvoid-invoice
{:invoice-id id}
invoice-read]}]}
:on-success [::invoice-unvoided]}}))
(re-frame/reg-event-fx
::void-invoice
(fn [{:keys [db]} [_ {id :id}]]
{:graphql
{:token (-> db :user)
:query-obj {:venia/operation {:operation/type :mutation
:operation/name "VoidInvoice"}
:venia/queries [{:query/data [:void-invoice
{:invoice-id id}
invoice-read]}]}
:on-success [::invoice-voided]}}))
(re-frame/reg-event-fx (re-frame/reg-event-fx
::handwrite-checks-save ::handwrite-checks-save
(fn [{:keys [db]} _] (fn [{:keys [db]} _]
@@ -380,27 +359,12 @@
(dissoc ::handwrite-checks))}))) (dissoc ::handwrite-checks))})))
(re-frame/reg-event-fx
::invoice-unvoided
(fn [{:keys [db]} [_ {:keys [unvoid-invoice]}]]
{:db (-> db
(update-in [::invoice-page :invoices]
(fn [is]
(mapv (fn [i]
(if (= (:id i) (:id unvoid-invoice))
(assoc unvoid-invoice :class "live-removed")
i)) is))))}))
(re-frame/reg-event-fx (re-frame/reg-event-fx
::invoice-voided ::invoice-updated
(fn [{:keys [db]} [_ {:keys [void-invoice]}]] [(re-frame/path [::invoice-page :invoices])]
{:db (-> db (fn [{:keys [db]} [_ [_ invoice]]]
(update-in [::invoice-page :invoices] {:db (merge-by db :id invoice)}))
(fn [is]
(mapv (fn [i]
(if (= (:id i) (:id void-invoice))
(assoc void-invoice :class "live-removed")
i)) is))))}))
@@ -642,13 +606,8 @@
[pay-button {:print-checks-shown? print-checks-shown? :checked-invoices checked :print-checks-loading? print-checks-loading?}]) [pay-button {:print-checks-shown? print-checks-shown? :checked-invoices checked :print-checks-loading? print-checks-loading?}])
[table/invoice-table {:id :unpaid [table/invoice-table {:id :unpaid
:invoice-page (re-frame/subscribe [::invoice-page]) :invoice-page (re-frame/subscribe [::invoice-page])
:status (re-frame/subscribe [::subs/status]) :status @(re-frame/subscribe [::status/single ::page])
:on-edit-invoice (fn [which]
(re-frame/dispatch [::form/editing which]))
:on-unvoid-invoice (fn [which]
(re-frame/dispatch [::unvoid-invoice which]))
:on-void-invoice (fn [which]
(re-frame/dispatch [::void-invoice which]))
:check-boxes (= status :unpaid) :check-boxes (= status :unpaid)
:checked checked :checked checked
:on-check-changed (fn [which invoice] :on-check-changed (fn [which invoice]
@@ -659,6 +618,7 @@
(r/create-class (r/create-class
{:display-name "invoices-page" {:display-name "invoices-page"
:component-will-unmount #(re-frame/dispatch [::unmounted]) :component-will-unmount #(re-frame/dispatch [::unmounted])
:component-did-mount #(re-frame/dispatch [::mounted])
:reagent-render :reagent-render
(fn [] (fn []
(let [{invoice-bar-active? :active?} @(re-frame/subscribe [::forms/form ::form/form]) (let [{invoice-bar-active? :active?} @(re-frame/subscribe [::forms/form ::form/form])