Accounts don't need to be loaded
This commit is contained in:
@@ -6,13 +6,18 @@
|
||||
[clj-time.coerce :as coerce]
|
||||
[auto-ap.time-utils :refer [next-dom]]
|
||||
[clj-time.core :as time]
|
||||
[auto-ap.datomic.vendors :as d-vendors]))
|
||||
[auto-ap.datomic.vendors :as d-vendors]
|
||||
[clojure.tools.logging :as log]
|
||||
[auto-ap.datomic.accounts :as d-accounts]))
|
||||
|
||||
(def default-read '[*
|
||||
{:invoice/client [:client/name :db/id :client/locations :client/code]}
|
||||
{:invoice/vendor [* {:vendor/address [*]}]}
|
||||
{:invoice/status [:db/ident]}
|
||||
{:invoice/expense-accounts [* {:invoice-expense-account/account [*]}]}
|
||||
{:invoice/expense-accounts [* {:invoice-expense-account/account [:account/name :db/id
|
||||
:account/location
|
||||
{:account/client-overrides [:account-client-override/name
|
||||
{:account-client-override/client [:db/id]}]}]}]}
|
||||
{:invoice-payment/_invoice [* {:invoice-payment/payment [* {:payment/status [*]}
|
||||
{:payment/bank-account [*]}
|
||||
{:transaction/_payment [*]}]}]}])
|
||||
@@ -23,6 +28,10 @@
|
||||
(update :invoice/due coerce/from-date)
|
||||
(update :invoice/scheduled-payment coerce/from-date)
|
||||
(update :invoice/status :db/ident)
|
||||
(update :invoice/expense-accounts (fn [eas]
|
||||
(map
|
||||
#(update % :invoice-expense-account/account d-accounts/clientize (:db/id (:invoice/client x)))
|
||||
eas)))
|
||||
(rename-keys {:invoice-payment/_invoice :invoice/payments})))
|
||||
|
||||
(defn raw-graphql-ids
|
||||
|
||||
Reference in New Issue
Block a user