From c8a7f05e28adc2a28e0e9ade3a05c56223481d43 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Mon, 30 Sep 2019 20:21:40 -0700 Subject: [PATCH] supporting some features for brian --- src/clj/auto_ap/datomic/ledger.clj | 6 ++++++ src/clj/auto_ap/routes/exports.clj | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/clj/auto_ap/datomic/ledger.clj b/src/clj/auto_ap/datomic/ledger.clj index 5d5d563f..43ab2aa3 100644 --- a/src/clj/auto_ap/datomic/ledger.clj +++ b/src/clj/auto_ap/datomic/ledger.clj @@ -41,6 +41,12 @@ :where ['[?e :journal-entry/client ?client-id]]} :args [(:client-id args)]}) + (:client-code args) + (merge-query {:query {:in ['?client-code] + :where ['[?e :journal-entry/client ?client-id] + '[?client-id :client/code ?client-code]]} + :args [(:client-code args)]}) + (:to-date args) (merge-query {:query {:in ['?to-date] :where ['[?e :journal-entry/date ?d] diff --git a/src/clj/auto_ap/routes/exports.clj b/src/clj/auto_ap/routes/exports.clj index b037e3cb..26898c00 100644 --- a/src/clj/auto_ap/routes/exports.clj +++ b/src/clj/auto_ap/routes/exports.clj @@ -61,7 +61,8 @@ (map <-graphql)) conj (list) - (first (d-ledger/get-graphql {})))) + (first (d-ledger/get-graphql {:count Integer/MAX_VALUE + :client-code (query-params "client-code")})))) (GET "/transactions/export" {:keys [query-params identity]} (assert-admin identity)