added suggestions

This commit is contained in:
2022-07-26 07:01:18 -07:00
parent 96c80853ef
commit 84f7e734f0
65 changed files with 130 additions and 1140 deletions

View File

@@ -5,52 +5,17 @@
[clj-time.coerce :as c]
[auto-ap.datomic.accounts :as d-accounts]))
(def export-read
[:journal-entry/external-id
:journal-entry/cleared
:journal-entry/alternate-description
:journal-entry/date
:journal-entry/note
:journal-entry/amount
:journal-entry/source
:journal-entry/cleared-against
:journal-entry/original-entity
{:journal-entry/client [:client/name :client/code :db/id]
:journal-entry/vendor [:vendor/name :db/id]
:journal-entry/line-items [:journal-entry-line/location
:journal-entry-line/debit
:journal-entry-line/credit
{:journal-entry-line/account [:bank-account/include-in-reports
:bank-account/bank-name
:bank-account/code
:bank-account/visible
:bank-account/name
:bank-account/number
:account/code
:account/name
:account/numeric-code
:account/location
{:account/client-overrides [:account-client-override/name
{:account-client-override/client [:db/id]}]}
{:account/type [:db/ident :db/id]}
{:bank-account/type [:db/ident :db/id]}]}]}])
(defn raw-graphql-ids [db args]
(let [query (cond-> {:query {:find []
:in ['$ ]
:where []}
:args [db]}
(:client-id args)
(merge-query {:query {:in ['?client-id]
:where ['[?e :journal-entry/client ?client-id]]}
:args [(:client-id args)]})
(:only-external args)
(merge-query {:query {:where ['(not [?e :journal-entry/original-entity ])]}})