This commit is contained in:
Bryce Covert
2022-10-23 20:50:54 -07:00
parent 72d78abfca
commit 9378c8159d
3 changed files with 18 additions and 10 deletions

View File

@@ -553,10 +553,9 @@
:client_id client-id :client_id client-id
:location location :location location
:account account :account account
:journal_entries journal-entries :journal_entries (sort-by :date journal-entries)
:total (- (or (reduce + 0.0 (map #(or (:debit %) 0.0) journal-entries)) 0.0) :total (- (or (reduce + 0.0 (map #(or (:debit %) 0.0) journal-entries)) 0.0)
(or (reduce + 0.0 (map #(or (:credit %) 0.0) journal-entries)) 0.0)) (or (reduce + 0.0 (map #(or (:credit %) 0.0) journal-entries)) 0.0))})})
})})

View File

@@ -565,13 +565,13 @@
(fn [rows category] (fn [rows category]
(into rows (into rows
;; TODO colspan ? ;; TODO colspan ?
(cons [{:value (str (client-codes (:client-id category)) " - " (:location category) " - " (name (:category category)) " - " (:name (:account category)) ) (concat [[{:value (str (client-codes (:client-id category)) " - " (:location category) " - " (name (:category category)) " - " (:name (:account category)) )
} }
{:value ""} {:value ""}
{:value ""} {:value ""}
{:value ""} {:value ""}
{:value ""}] {:value ""}]]
(map (map
(fn [je] (fn [je]
[{:value (user-friendly-date (:date je))} [{:value (user-friendly-date (:date je))}
@@ -582,7 +582,15 @@
:format :dollar} :format :dollar}
{:value (get je :running-balance) {:value (get je :running-balance)
:format :dollar}]) :format :dollar}])
(:journal-entries category)))) (: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}]]))
) )
[] []

View File

@@ -52,6 +52,7 @@
[[:categories [[:journal-entries [:description [[:categories [[:journal-entries [:description
:date :date
:debit :credit :location :running-balance :debit :credit :location :running-balance
:total
[:account [:id :name]]]] [:account [:id :name]]]]
:category :category
:client-id :client-id