one more tweak.
This commit is contained in:
@@ -553,7 +553,7 @@
|
||||
:client_id client-id
|
||||
:location location
|
||||
:account (or account
|
||||
{:name category})
|
||||
(str "All " {:name (name category)}))
|
||||
:journal_entries (when account (sort-by :date journal-entries))
|
||||
:total (- (or (reduce + 0.0 (map #(or (:credit %) 0.0) journal-entries)) 0.0)
|
||||
(or (reduce + 0.0 (map #(or (:debit %) 0.0) journal-entries)) 0.0))})})
|
||||
|
||||
@@ -565,33 +565,34 @@
|
||||
(fn [rows category]
|
||||
(into rows
|
||||
;; TODO colspan ?
|
||||
(concat [[{:value (str (client-codes (:client-id category)) " - " (:location category) " - " (name (:category category)) " - " (:name (:account category)) )
|
||||
(concat (when (seq (:journal-entries category))
|
||||
[[{:value (str (client-codes (:client-id category)) " - " (:location category) " - " (name (:category category)) " - " (:name (:account category)) )
|
||||
|
||||
}
|
||||
{:value "Total"}
|
||||
{:value ""}
|
||||
{:value ""}
|
||||
{:value (:total category)
|
||||
:format :dollar}]])
|
||||
(map
|
||||
(fn [je]
|
||||
[{:value (user-friendly-date (:date je))}
|
||||
{:value (:description je "")}
|
||||
{:value (get je :debit)
|
||||
:format :dollar}
|
||||
{:value (get je :credit)
|
||||
:format :dollar}
|
||||
{:value (get je :running-balance)
|
||||
:format :dollar}])
|
||||
(:journal-entries category))
|
||||
[[{:value (str (client-codes (:client-id category)) " - " (:location category) " - " (name (:category category)) " - " (:name (:account category)) )
|
||||
|
||||
}
|
||||
{:value "Total"}
|
||||
{:value ""}
|
||||
{:value ""}
|
||||
{:value (:total category)
|
||||
:format :dollar}]]
|
||||
(map
|
||||
(fn [je]
|
||||
[{:value (user-friendly-date (:date je))}
|
||||
{:value (:description je "")}
|
||||
{:value (get je :debit)
|
||||
:format :dollar}
|
||||
{:value (get je :credit)
|
||||
:format :dollar}
|
||||
{:value (get je :running-balance)
|
||||
:format :dollar}])
|
||||
(:journal-entries category))
|
||||
[[{:value (str (client-codes (:client-id category)) " - " (:location category) " - " (name (:category category)) " - " (:name (:account category)) )
|
||||
|
||||
}
|
||||
{:value "Total"}
|
||||
{:value ""}
|
||||
{:value ""}
|
||||
{:value (:total category)
|
||||
:format :dollar}]]))
|
||||
:format :dollar}]]))
|
||||
|
||||
)
|
||||
[]
|
||||
|
||||
Reference in New Issue
Block a user