check printing

This commit is contained in:
Bryce Covert
2018-08-23 18:28:35 -07:00
parent 9629730403
commit 2ea6ca576f
8 changed files with 362 additions and 315 deletions

View File

@@ -18,7 +18,6 @@
[auto-ap.datomic.vendors :as d-vendors]
[auto-ap.db.users :as users]
[auto-ap.db.checks :as checks]
[auto-ap.routes.checks :as rchecks]
[auto-ap.graphql.users :as gq-users]
[auto-ap.graphql.checks :as gq-checks]
[auto-ap.graphql.expense-accounts :as expense-accounts]
@@ -291,9 +290,9 @@
:mutations
{:print_checks {:type :check_result
:args {:invoice_payments {:type '(list :invoice_payment_amount)}
:bank_account_id {:type 'Int}
:bank_account_id {:type 'String}
:type {:type 'String}
:company_id {:type 'Int}}
:client_id {:type 'String}}
:resolve :mutation/print-checks}
:add_handwritten_check {:type :check_result
@@ -454,14 +453,14 @@
(defn print-checks [context args value]
(assert-can-see-company (:id context) (:company_id args))
(assert-can-see-company (:id context) (:client_id args))
(->graphql
(rchecks/print-checks (map (fn [i] {:invoice-id (:invoice_id i)
:amount (:amount i)})
(:invoice_payments args))
(:company_id args)
(:bank_account_id args)
(:type args))))
(gq-checks/print-checks (map (fn [i] {:invoice-id (:invoice_id i)
:amount (:amount i)})
(:invoice_payments args))
(:client_id args)
(:bank_account_id args)
(:type args))))