This commit is contained in:
2023-08-31 23:24:42 -07:00
parent 1d82ec29e0
commit 7d251c8398
40 changed files with 333 additions and 286 deletions

View File

@@ -177,7 +177,6 @@
payments))
(defn get-graphql [args]
(log/info (:id args))
(let [db (dc/db conn)
{ids-to-retrieve :ids matching-count :count} (raw-graphql-ids db args)]

View File

@@ -165,15 +165,7 @@
:else
nil)
matching-ids (cond
(and name-like-ids (limited-clients (:id args)))
(set/intersection name-like-ids (limited-clients (:id args)))
name-like-ids
name-like-ids
:else
nil)
matching-ids name-like-ids
valid-ids (if matching-ids
(set/intersection (set (map :db/id (:clients args)))
matching-ids)

View File

@@ -60,10 +60,7 @@
:where ['[?e :invoice/client]]}
:args [db]}
(seq (:clients args))
(merge-query {:query {:in ['[?xx ...]]
:where ['[?e :invoice/client ?xx]]}
:args [ (map :db/id (:clients args))]})
(:client-id args)
(merge-query {:query {:in ['?client-id]
:where ['[?e :invoice/client ?client-id]]}
@@ -102,6 +99,10 @@
:where ['[?e :invoice/due ?due]
'[(<= ?due ?end-due)]]}
:args [(coerce/to-date (:end (:due-range args)))]})
(seq (:clients args))
(merge-query {:query {:in ['[?xx ...]]
:where ['[?e :invoice/client ?xx]]}
:args [ (map :db/id (:clients args))]})
(:import-status args)
(merge-query {:query {:in ['?import-status]

View File

@@ -119,10 +119,6 @@
:where ['[?li :journal-entry-line/location ?location]]}
:args [(:locations args)]})
(limited-clients (:id args))
(merge-query {:query {:in ['[?xx ...]]
:where ['[?e :journal-entry/client ?xx]]}
:args [(set (map :db/id (limited-clients (:id args))))]})
(:sort args) (add-sorter-fields {"client" ['[?e :journal-entry/client ?c]
'[?c :client/name ?sort-client]]
"date" ['[?e :journal-entry/date ?sort-date]]

View File

@@ -26,10 +26,6 @@
:where ['[?e :report/client ?xx]]}
:args [(set (map :db/id (:clients args)))]})
(limited-clients (:id args))
(merge-query {:query {:in ['[?xx ...]]
:where ['[?e :report/client ?xx]]}
:args [(set (map :db/id (limited-clients (:id args))))]})
(:sort args) (add-sorter-fields {"client" ['[?e :report/client ?c]
'[?c :client/name ?sort-client]]
"created" ['[?e :report/created ?sort-created]]