New report progress
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
[auto-ap.datomic.accounts :as a]
|
||||
[auto-ap.datomic.clients :as d-clients]
|
||||
[auto-ap.datomic.ledger :as l]
|
||||
[auto-ap.ledger.reports :as l-reports]
|
||||
[auto-ap.datomic.vendors :as d-vendors]
|
||||
[auto-ap.graphql.utils
|
||||
:refer [->graphql <-graphql assert-admin assert-can-see-client result->page]]
|
||||
@@ -503,6 +504,18 @@
|
||||
:stop (scheduler/stop running-balance-cache-worker))
|
||||
|
||||
|
||||
(defn get-journal-detail-report [context input _]
|
||||
(clojure.pprint/pprint
|
||||
(for [category (:categories input)]
|
||||
{:category category
|
||||
:journal_entries (:journal_entries (get-ledger-page context {:filters (doto {:client_ids (:client_ids input)
|
||||
:date_range (:date_range input)
|
||||
:from_numeric_code (get-in l-reports/ranges [category 0])
|
||||
:to_numeric_code (get-in l-reports/ranges [category 1])
|
||||
:per_page Integer/MAX_VALUE}
|
||||
clojure.pprint/pprint)}
|
||||
nil))})))
|
||||
|
||||
|
||||
(def objects
|
||||
{:balance_sheet_account
|
||||
@@ -567,7 +580,13 @@
|
||||
{:fields {:successful {:type '(list :import_ledger_entry_result)}
|
||||
:existing {:type '(list :import_ledger_entry_result)}
|
||||
:ignored {:type '(list :import_ledger_entry_result)}
|
||||
:errors {:type '(list :import_ledger_entry_result)}}}})
|
||||
:errors {:type '(list :import_ledger_entry_result)}}}
|
||||
|
||||
:journal_detail_report_category
|
||||
{:fields {:category {:type :ledger_category}
|
||||
:journal_entries {:type '(list :journal_entry)}}}
|
||||
:journal_detail_report
|
||||
{:fields {:categories {:type '(list :journal_detail_report_category)}}}})
|
||||
|
||||
(def queries
|
||||
{:balance_sheet {:type :balance_sheet
|
||||
@@ -585,6 +604,13 @@
|
||||
:column_per_location {:type 'Boolean}}
|
||||
:resolve :get-profit-and-loss}
|
||||
|
||||
:journal_detail_report {:type :journal_detail_report
|
||||
:args {:client_id {:type :id}
|
||||
:client_ids {:type '(list :id)}
|
||||
:date_range {:type :date_range}
|
||||
:categories {:type '(list :ledger_category)}}
|
||||
:resolve :get-journal-detail-report}
|
||||
|
||||
:profit_and_loss_pdf {:type :report_pdf
|
||||
:args {:client_id {:type :id}
|
||||
:client_ids {:type '(list :id)}
|
||||
@@ -650,11 +676,12 @@
|
||||
:note {:type 'String}
|
||||
:cleared_against {:type 'String}
|
||||
:line_items {:type '(list :import_ledger_line_item)}}}
|
||||
|
||||
})
|
||||
|
||||
(def enums
|
||||
{})
|
||||
{:ledger_category {:values [{:enum-value :sales}
|
||||
{:enum-value :cogs}
|
||||
{:enum-value :payroll}]}})
|
||||
|
||||
|
||||
(def resolvers
|
||||
@@ -663,6 +690,7 @@
|
||||
:get-profit-and-loss get-profit-and-loss
|
||||
:profit-and-loss-pdf profit-and-loss-pdf
|
||||
:balance-sheet-pdf balance-sheet-pdf
|
||||
:get-journal-detail-report get-journal-detail-report
|
||||
:mutation/delete-external-ledger delete-external-ledger
|
||||
:mutation/import-ledger import-ledger})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user