lots of QOL improvements.
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
(-> params
|
||||
(assoc
|
||||
:client-id (:id @(re-frame/subscribe [::subs/client]))))
|
||||
[[:invoices [:id :total :outstanding-balance :invoice-number :date :due :status :client-identifier
|
||||
[[:invoices [:id :total :outstanding-balance :invoice-number :date :due :status :client-identifier :automatically-paid-when-due
|
||||
[:vendor [:name :id]]
|
||||
[:expense_accounts [:amount :id :location
|
||||
[:account [:id ]]]]
|
||||
@@ -81,17 +81,20 @@
|
||||
{: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]}]
|
||||
(let [{:keys [client payments expense-accounts invoice-number date due total outstanding-balance id vendor] :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])
|
||||
account->name #(:name (accounts-by-id (:id %)))]
|
||||
[:tr {:class (:class i)}
|
||||
(when check-boxes
|
||||
[:td [:input.checkbox {:type "checkbox"
|
||||
:checked (if (get checked id)
|
||||
"checked"
|
||||
"")
|
||||
:on-change (fn [x e] (when on-check-changed
|
||||
(on-check-changed id i)))} ]])
|
||||
[:td.expandable
|
||||
[:input.checkbox (cond-> {:type "checkbox"
|
||||
|
||||
:checked (if (get checked id)
|
||||
"checked"
|
||||
"")
|
||||
:on-change (fn [x e] (when on-check-changed
|
||||
(on-check-changed id i)))}
|
||||
(boolean? checkable?) (assoc :disabled (not checkable?))) ]])
|
||||
(when-not selected-client
|
||||
[:td (if-let [client-override (:client overrides)]
|
||||
(client-override i)
|
||||
|
||||
Reference in New Issue
Block a user