Updating to include extra fields.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
(def default-read '(pull ?e [*
|
||||
{:invoice-payment/_payment [* {:invoice-payment/invoice [*]}]}
|
||||
{:payment/client [:client/name :db/id]}
|
||||
{:payment/client [:client/name :db/id :client/code]}
|
||||
{:payment/bank-account [*]}
|
||||
{:payment/vendor [:vendor/name :vendor/default-expense-account :db/id {:vendor/primary-contact [*]} {:vendor/address [*]}]}
|
||||
{:payment/status [:db/ident]}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
(reduce #(update-in %1 [:query :where] conj %2) query rest)))
|
||||
|
||||
(def default-read '(pull ?e [*
|
||||
{:invoice/client [:client/name :db/id :client/locations]}
|
||||
{:invoice/client [:client/name :db/id :client/locations :client/code]}
|
||||
{:invoice/vendor [* {:vendor/address [*]}]}
|
||||
{:invoice/status [:db/ident]}
|
||||
{:invoice-payment/_invoice [* {:invoice-payment/payment [* {:payment/status [*]}
|
||||
|
||||
@@ -112,8 +112,8 @@
|
||||
true (apply-pagination args))))
|
||||
|
||||
(defn graphql-results [ids db args]
|
||||
(->> (d/pull-many db '[* {:transaction/client [:client/name :db/id]
|
||||
:transaction/bank-account [:bank-account/name :bank-account/yodlee-account-id :db/id]}]
|
||||
(->> (d/pull-many db '[* {:transaction/client [:client/name :db/id :client/code]
|
||||
:transaction/bank-account [:bank-account/name :bank-account/code :bank-account/yodlee-account-id :db/id]}]
|
||||
ids)
|
||||
(map #(update % :transaction/date c/from-date))
|
||||
(map #(update % :transaction/post-date c/from-date))
|
||||
|
||||
@@ -161,6 +161,7 @@
|
||||
|
||||
:invoice
|
||||
{:fields {:id {:type :id}
|
||||
:original_id {:type 'Int}
|
||||
:total {:type 'String}
|
||||
:outstanding_balance {:type 'String}
|
||||
:invoice_number {:type 'String}
|
||||
@@ -424,7 +425,7 @@
|
||||
(map
|
||||
->graphql
|
||||
(d-checks/get-graphql (assoc (<-graphql args)
|
||||
:limit Integer/MAX_VALUE))))
|
||||
:count Integer/MAX_VALUE))))
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
(map
|
||||
->graphql
|
||||
(d-invoices/get-graphql (assoc (<-graphql args)
|
||||
:limit Integer/MAX_VALUE))))
|
||||
:count Integer/MAX_VALUE))))
|
||||
|
||||
(defn add-invoice [context {{:keys [total invoice_number location client_id vendor_id vendor_name date] :as in} :invoice} value]
|
||||
(when (seq (d-invoices/find-conflicting {:invoice/invoice-number invoice_number
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
(let [query [[:all_invoices
|
||||
{:client-code (query-params "client-code")
|
||||
:original-id (query-params "original")}
|
||||
[:id :total :outstanding-balance :invoice-number :date :status
|
||||
[:id :total :outstanding-balance :invoice-number :date :status :original-id
|
||||
[:payments [:amount [:payment [:check-number :memo [:bank_account [:id :name :number :bank-name :bank-code]]]]]]
|
||||
[:vendor [:name :id [:primary_contact [:name]] [:address [:street1 :city :state :zip]]]]
|
||||
[:expense_accounts [:amount :id :expense_account_id :location
|
||||
[:expense_account [:id :name [:parent [:id :name]]]]]]
|
||||
[:client [:name :id :locations]]]]]
|
||||
[:client [:name :id :code :locations]]]]]
|
||||
invoices (graphql/query identity (venia/graphql-query {:venia/queries (->graphql query)}))]
|
||||
|
||||
(doto (list (:all-invoices (:data invoices))) clojure.pprint/pprint)))
|
||||
@@ -38,10 +38,10 @@
|
||||
{:client-code (query-params "client-code")
|
||||
:original-id (query-params "original")}
|
||||
[:id :check-number :amount :memo :date :status :type
|
||||
[:invoices [[:invoice [:id]] :amount]]
|
||||
[:bank-account [:number :bank-name :bank-code :id]]
|
||||
[:invoices [[:invoice [:id :original-id]] :amount]]
|
||||
[:bank-account [:number :code :bank-name :bank-code :id]]
|
||||
[:vendor [:name :id [:primary-contact [:name :email :phone]] :default-expense-account [:address [:street1 :city :state :zip]]]]
|
||||
[:client [:id :name]]
|
||||
[:client [:id :name :code]]
|
||||
]]]
|
||||
payments (graphql/query identity (venia/graphql-query {:venia/queries (->graphql query)}))]
|
||||
(list (:all-payments (:data payments)))))
|
||||
|
||||
Reference in New Issue
Block a user