Enables Cash flows

This commit is contained in:
2023-04-05 21:46:32 -07:00
parent 6b30da6195
commit 754bfa1848
5 changed files with 108 additions and 16 deletions

View File

@@ -10,7 +10,7 @@
[auto-ap.graphql.utils
:refer [->graphql <-graphql assert-admin assert-can-see-client result->page]]
[auto-ap.parse.util :as parse]
[auto-ap.pdf.ledger :refer [print-balance-sheet print-pnl print-journal-detail-report]]
[auto-ap.pdf.ledger :refer [print-balance-sheet print-pnl print-journal-detail-report print-cash-flows]]
[auto-ap.utils :refer [by dollars= heartbeat]]
[clj-time.coerce :as coerce]
[clj-time.core :as t]
@@ -240,6 +240,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)]
@@ -804,6 +809,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}
@@ -884,6 +897,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