started on expense accounts.
This commit is contained in:
@@ -20,7 +20,13 @@
|
||||
{:venia/queries [[:invoice_page
|
||||
(assoc params
|
||||
:company-id (:id @(re-frame/subscribe [::subs/company])))
|
||||
[[:invoices [:id :total :outstanding-balance :invoice-number :date [:vendor [:name :id]] [:company [:name :id]] [:checks [:amount [:check [:amount :s3_url :check_number ]]]]]]
|
||||
[[:invoices [:id :total :outstanding-balance :invoice-number :date
|
||||
[:vendor [:name :id]]
|
||||
[:expense_accounts [:amount :id
|
||||
[:expense_account [:id :name [:parent [:id :name]]]]]]
|
||||
[:company [:name :id]]
|
||||
[:checks [:amount [:check [:amount :s3_url :check_number ]]]]
|
||||
]]
|
||||
:total
|
||||
:start
|
||||
:end]]]})
|
||||
@@ -76,19 +82,27 @@
|
||||
:sort-by sort-by
|
||||
:asc asc}
|
||||
"Amount"]
|
||||
|
||||
[sorted-column {:on-sort opc
|
||||
:style {:width "10em" :cursor "pointer"}
|
||||
:sort-key "outstanding"
|
||||
:sort-by sort-by
|
||||
:asc asc}
|
||||
"Outstanding"]
|
||||
"Outstanding"]
|
||||
|
||||
[sorted-column {:on-sort opc
|
||||
:style {:width "8em" :cursor "pointer"}
|
||||
:sort-key "total"
|
||||
:sort-by sort-by
|
||||
:asc asc}
|
||||
"Expense Accounts"]
|
||||
[:th {:style {:width "10em"}} "" ]]]
|
||||
[:tbody
|
||||
(if (:loading @status)
|
||||
[:tr
|
||||
[:td {:col-span 5}
|
||||
[:i.fa.fa-spin.fa-spinner]]]
|
||||
(for [{:keys [company checks invoice-number date total outstanding-balance id vendor] :as i} (:invoices @invoice-page)]
|
||||
(for [{:keys [company checks expense-accounts invoice-number date total outstanding-balance id vendor] :as i} (:invoices @invoice-page)]
|
||||
^{:key id}
|
||||
[:tr {:class (:class i)}
|
||||
(when check-boxes
|
||||
@@ -105,6 +119,9 @@
|
||||
|
||||
[:td (gstring/format "$%.2f" total )]
|
||||
[:td (gstring/format "$%.2f" outstanding-balance )]
|
||||
[:td (for [e expense-accounts]
|
||||
^{:key (:id e)}
|
||||
[:a.tag (:name (:expense-account e)) " "(gstring/format "$%.2f" (:amount e) ) ])]
|
||||
[:td (for [check checks]
|
||||
^{:key (:id check)}
|
||||
[:a.tag {:href (:s3-url (:check check)) :target "_new"} [:i.fa.fa-money-check] [:span.icon [:i.fa.fa-money]] (str " " (:check-number (:check check)) " (" (gstring/format "$%.2f" (:amount check) ) ")")])]]))]]]))))
|
||||
|
||||
Reference in New Issue
Block a user