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)