one more tweak.

This commit is contained in:
Bryce Covert
2022-10-24 23:18:55 -07:00
parent 2f76f59f03
commit 91adf49e2a
2 changed files with 23 additions and 22 deletions

View File

@@ -553,7 +553,7 @@
:client_id client-id :client_id client-id
:location location :location location
:account (or account :account (or account
{:name category}) (str "All " {:name (name category)}))
:journal_entries (when account (sort-by :date journal-entries)) :journal_entries (when account (sort-by :date journal-entries))
:total (- (or (reduce + 0.0 (map #(or (:credit %) 0.0) journal-entries)) 0.0) :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))})}) (or (reduce + 0.0 (map #(or (:debit %) 0.0) journal-entries)) 0.0))})})

View File

@@ -565,14 +565,15 @@
(fn [rows category] (fn [rows category]
(into rows (into rows
;; TODO colspan ? ;; 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 "Total"}
{:value ""} {:value ""}
{:value ""} {:value ""}
{:value (:total category) {:value (:total category)
:format :dollar}]] :format :dollar}]])
(map (map
(fn [je] (fn [je]
[{:value (user-friendly-date (:date je))} [{:value (user-friendly-date (:date je))}