tweaks to checkout.

This commit is contained in:
Bryce Covert
2018-07-12 19:12:40 -07:00
parent 2928b02eed
commit b95f43fd1d
5 changed files with 17 additions and 12 deletions

View File

@@ -46,6 +46,11 @@
:name {:type 'String}
:bank_code {:type 'String}
:bank_name {:type 'String}}}
:address
{:fields {:street1 {:type 'String}
:city {:type 'String}
:state {:type 'String}
:zip {:type 'String}}}
:vendor
{:fields {:id {:type 'Int}
:name {:type 'String}
@@ -53,6 +58,7 @@
:print_as {:type 'String}
:primary_contact {:type 'String}
:address {:type :address}
:primary_email {:type 'String}
:primary_phone {:type 'String}
@@ -176,10 +182,7 @@
:start {:type 'Int}
:end {:type 'Int}}}
:check_result {:fields {:invoices {:type '(list :invoice)}
:pdf_url {:type 'String}}}
}
:pdf_url {:type 'String}}}}

View File

@@ -27,21 +27,21 @@
(let [query [[:all_invoices
{:company-id (query-params "company")}
[:id :total :outstanding-balance :invoice-number :date
[:checks [:amount [:check [:check-number]]]]
[:vendor [:name :id]]
[:checks [:amount [:check [:check-number :memo [:bank_account [:id :number :bank-name :bank-code]]]]]]
[:vendor [:name :id :primary_contact [:address [:street1 :city :state :zip]]]]
[:expense_accounts [:amount :id :expense_account_id :location
[:expense_account [:id :name [:parent [:id :name]]]]]]
[:company [:name :id :locations]]]]]
invoices (graphql/query identity (venia/graphql-query {:venia/queries (->graphql query)}))]
(list (:all-invoices (:data invoices)))))
(GET "/checks/export" {:keys [query-params]}
(GET "/checks/export" {:keys [query-params identity]}
(assert-admin identity)
(let [query [[:all_checks
{:company-id (query-params "company")}
[:id :check-number :amount :memo :date
[:invoices [:invoice-id :amount]]
[:bank-account [:number :bank-name :bank-code]]
[:vendor [:name :id :primary-contact :primary-email :primary-phone :default-expense-account]]
[:vendor [:name :id :primary-contact :primary-email :primary-phone :default-expense-account [:address [:street1 :city :state :zip]]]]
[:company [:id :name]]
]]]
checks (graphql/query identity (venia/graphql-query {:venia/queries (->graphql query)}))]