This commit is contained in:
2023-04-05 21:48:26 -07:00
5 changed files with 106 additions and 17 deletions

View File

@@ -15,10 +15,9 @@
[auto-ap.ledger :refer [build-account-lookup]]
[auto-ap.ledger.reports :as l-reports]
[auto-ap.parse.util :as parse]
[auto-ap.pdf.ledger
:refer [print-balance-sheet print-journal-detail-report print-pnl]]
[auto-ap.time :as atime]
[auto-ap.utils :refer [by dollars=]]
[auto-ap.pdf.ledger :refer [print-balance-sheet print-pnl print-journal-detail-report print-cash-flows]]
[clj-time.coerce :as coerce]
[clj-time.core :as t]
[clojure.data.csv :as csv]
@@ -275,6 +274,11 @@
(->graphql result)))
(defn cash-flows-pdf [context args value]
(let [data (get-profit-and-loss context args value)
result (print-cash-flows (:id context) args data)]
(->graphql result)))
(defn balance-sheet-pdf [context args value]
(let [data (get-balance-sheet context args value)
result (print-balance-sheet (:id context) args data)]
@@ -750,6 +754,14 @@
:column_per_location {:type 'Boolean}}
:resolve :profit-and-loss-pdf}
:cash_flows_pdf {:type :report_pdf
:args {:client_id {:type :id}
:client_ids {:type '(list :id)}
:periods {:type '(list :date_range)}
:include_deltas {:type 'Boolean}
:column_per_location {:type 'Boolean}}
:resolve :cash-flows-pdf}
:balance_sheet_pdf {:type :report_pdf
:args {:client_id {:type :id}
:include_comparison {:type 'Boolean}
@@ -830,6 +842,7 @@
:get-balance-sheet get-balance-sheet
:get-profit-and-loss get-profit-and-loss
:profit-and-loss-pdf profit-and-loss-pdf
:cash-flows-pdf cash-flows-pdf
:journal-detail-report-pdf journal-detail-report-pdf
:balance-sheet-pdf balance-sheet-pdf
:get-ledger-csv get-ledger-csv