adds creator.
This commit is contained in:
@@ -210,31 +210,9 @@
|
||||
|
||||
(defn profit-and-loss-pdf [context args value]
|
||||
(let [data (get-profit-and-loss context args value)
|
||||
result (print-pnl args data)]
|
||||
result (print-pnl (:id context) args data)]
|
||||
|
||||
(->graphql {:report_url result}))
|
||||
#_(let [client-id (:client_id args)
|
||||
client-ids (or (some-> client-id vector)
|
||||
(filter identity (:client_ids args)))
|
||||
_ (when (not (seq client-ids))
|
||||
(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))
|
||||
all-ledger-entries (->> client-ids
|
||||
(map (fn [client-id]
|
||||
[client-id (full-ledger-for-client client-id)]))
|
||||
(into {}))
|
||||
lookup-account (->> client-ids
|
||||
(map (fn [client-id]
|
||||
[client-id (build-account-lookup client-id)]))
|
||||
(into {}))]
|
||||
(->graphql
|
||||
{:periods
|
||||
(->> (:periods args)
|
||||
(mapv (fn [{:keys [start end]}]
|
||||
{:accounts (mapcat
|
||||
#(roll-up-until (lookup-account %) (all-ledger-entries %) (coerce/to-date end) (coerce/to-date start) )
|
||||
client-ids)})))})))
|
||||
(->graphql {:report_url result})))
|
||||
|
||||
|
||||
(defn assoc-error [f]
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
{:fields {:url {:type 'String}
|
||||
:name {:type 'String}
|
||||
:created {:type :iso_date}
|
||||
:creator {:type 'String}
|
||||
:id {:type :id}}}
|
||||
|
||||
:report_page
|
||||
|
||||
Reference in New Issue
Block a user