Adds the ability to do a column per location

This commit is contained in:
2022-04-03 07:46:15 -07:00
parent 72a97532ee
commit 7739c18bc2
3 changed files with 303 additions and 259 deletions

View File

@@ -192,6 +192,9 @@
(throw (ex-info "Please select a client." {:validation-error "Please select a client."})))
_ (doseq [client-id client-ids]
(assert-can-see-client (:id context) client-id))
_ (when (and (:include_deltas args)
(:column_per_location args))
(throw (ex-info "Please select one of 'Include deltas' or 'Column per location'" {:validation-error "Please select one of 'Include deltas' or 'Column per location'"})))
all-ledger-entries (->> client-ids
(map (fn [client-id]
[client-id (full-ledger-for-client client-id)]))
@@ -584,14 +587,16 @@
:args {:client_id {:type :id}
:client_ids {:type '(list :id)}
:periods {:type '(list :date_range)}
:include_deltas {:type 'Boolean}}
:include_deltas {:type 'Boolean}
:column_per_location {:type 'Boolean}}
:resolve :get-profit-and-loss}
:profit_and_loss_pdf {:type :report_pdf
:args {:client_id {:type :id}
:client_ids {:type '(list :id)}
:periods {:type '(list :date_range)}
:include_deltas {:type 'Boolean}}
:include_deltas {:type 'Boolean}
:column_per_location {:type 'Boolean}}
:resolve :profit-and-loss-pdf}
:balance_sheet_pdf {:type :report_pdf