customized transactions.
This commit is contained in:
@@ -173,40 +173,44 @@
|
||||
(let [current-client @(re-frame/subscribe [::subs/client])
|
||||
user @(re-frame/subscribe [::subs/user])
|
||||
params @(re-frame/subscribe [::params])]
|
||||
[:div.is-inline
|
||||
[:h1.title "Balance Sheet"]
|
||||
[:div.report-controls
|
||||
[:p.help "Date"]
|
||||
[bind-field
|
||||
[date-picker {:class-name "input"
|
||||
:class "input"
|
||||
:format-week-number (fn [] "")
|
||||
:previous-month-button-label ""
|
||||
:placeholder "mm/dd/yyyy"
|
||||
:next-month-button-label ""
|
||||
:next-month-label ""
|
||||
:type "date"
|
||||
:field [:date]
|
||||
:event [::date-picked]
|
||||
:popper-props (clj->js {:placement "right"})
|
||||
:subscription params}]]]
|
||||
(if @(re-frame/subscribe [::loading])
|
||||
[:div [:i.icon.fa.fa-spin.fa-spinner]]
|
||||
[:table.table.compact.balance-sheet
|
||||
[:tr
|
||||
[:td.has-text-right "Period ending"]
|
||||
[:td.has-text-right (date->str (str->date (:date params) standard))]
|
||||
[:td.has-text-right (when (:date params)
|
||||
(date->str (t/minus (str->date (:date params) standard) (t/years 1))))]
|
||||
[:td]]
|
||||
(list
|
||||
(overall-grouping :asset "Assets")
|
||||
(overall-grouping :liability "Liabilities" )
|
||||
(overall-grouping :equity "Owner's Equity" )
|
||||
(retained-earnings))])
|
||||
|
||||
|
||||
]))
|
||||
(if current-client
|
||||
[:div.is-inline
|
||||
[:h1.title "Balance Sheet"]
|
||||
[:div.report-controls
|
||||
[:p.help "Date"]
|
||||
[bind-field
|
||||
[date-picker {:class-name "input"
|
||||
:class "input"
|
||||
:format-week-number (fn [] "")
|
||||
:previous-month-button-label ""
|
||||
:placeholder "mm/dd/yyyy"
|
||||
:next-month-button-label ""
|
||||
:next-month-label ""
|
||||
:type "date"
|
||||
:field [:date]
|
||||
:event [::date-picked]
|
||||
:popper-props (clj->js {:placement "right"})
|
||||
:subscription params}]]]
|
||||
(if @(re-frame/subscribe [::loading])
|
||||
[:div [:i.icon.fa.fa-spin.fa-spinner]]
|
||||
[:table.table.compact.balance-sheet
|
||||
[:tr
|
||||
[:td.has-text-right "Period ending"]
|
||||
[:td.has-text-right (date->str (str->date (:date params) standard))]
|
||||
[:td.has-text-right (when (:date params)
|
||||
(date->str (t/minus (str->date (:date params) standard) (t/years 1))))]
|
||||
[:td]]
|
||||
(list
|
||||
(overall-grouping :asset "Assets")
|
||||
(overall-grouping :liability "Liabilities" )
|
||||
(overall-grouping :equity "Owner's Equity" )
|
||||
(retained-earnings))])
|
||||
|
||||
|
||||
]
|
||||
[:div
|
||||
[:h1.title "Balance sheet"]
|
||||
[:h2.subtitle "Please choose a client first"]])))
|
||||
{:component-will-mount #(re-frame/dispatch-sync [::params-change {:date (date->str (local-now) standard)}]) }))
|
||||
|
||||
(defn balance-sheet-page []
|
||||
|
||||
Reference in New Issue
Block a user