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
: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))})})

View File

@@ -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}]]))
)
[]