payments should load again.

This commit is contained in:
2024-02-08 21:13:43 -08:00
parent f48c819a96
commit cecf021929
2 changed files with 173 additions and 168 deletions

View File

@@ -84,8 +84,7 @@
[[:cell {:colspan 9}]
[:cell {:colspan 3 :leading -10} date]]
[[:cell {:colspan 12 :size 14}]
]
[[:cell {:colspan 12 :size 14}]]
[[:cell {:size 13 :leading 13} "PAY"]
[:cell {:size 8 :leading 8} "TO THE ORDER OF"]
@@ -113,8 +112,7 @@
(:client/signature-file client)]
[:spacer])]]
#_[
#_[:cell {:colspan 5} #_memo ]
#_[#_[:cell {:colspan 5} #_memo]
#_[:cell {:colspan 6}]]
[[:cell {:colspan 2}]
@@ -143,8 +141,7 @@
" " vendor-name "\n"
" " (:address/street1 (:vendor/address vendor)) "\n"
(when (not (str/blank? (:address/street2 (:vendor/address vendor))))
(str " " (:address/street2 (:vendor/address vendor)) "\n")
)
(str " " (:address/street2 (:vendor/address vendor)) "\n"))
" " (:address/city (:vendor/address vendor)) ", " (:address/state (:vendor/address vendor)) " " (:address/zip (:vendor/address vendor))]]
[:cell {:align :right}
"Paid to:\n"
@@ -183,8 +180,7 @@
[:paragraph amount]
[:paragraph date]]]
[[:cell {:colspan 3} "Memo:"]
[:cell {:colspan 9} memo]]
])]
[:cell {:colspan 9} memo]]])]
output-stream)
(.toByteArray output-stream)))
@@ -197,8 +193,7 @@
make-check-pdf
)]
make-check-pdf)]
(s3/put-object :bucket-name (:data-bucket env)
:key (:payment/s3-key check)
:input-stream (io/make-input-stream check-bytes {})
@@ -313,8 +308,7 @@
(reduce + 0.0))
0.001)
(throw (ex-info "The selected invoices do not have an outstanding balance."
{:validation-error "The selected invoices do not have an outstanding balance."})))
)
{:validation-error "The selected invoices do not have an outstanding balance."}))))
(defmethod invoices->entities :payment-type/credit [invoices vendor client bank-account type index invoice-amounts]
(when (>= (->> invoices
@@ -380,8 +374,7 @@
(throw (ex-info "You can't pay for that invoice from this bank account."
{:validation-error "You can't pay for that invoice from this bank account."
:client-id client-id
:invoices (map :invoice/invoice-number invoices)}))
)
:invoices (map :invoice/invoice-number invoices)})))
(when-not (= client-id (:db/id (:client/_bank-accounts bank-account)))
(throw (ex-info "The selected bank doesn't belong to this client"
{:validation-error "The selected bank doesn't belong to this client"
@@ -534,8 +527,7 @@
[?p :payment/client ?c]
[(get-else $ ?c :client/locked-until #inst "2000-01-01") ?lu]
[?p :payment/date ?d]
[(>= ?d ?lu)]
]
[(>= ?d ?lu)]]
(dc/db conn))
(map first)
(mapcat (fn [{:keys [:db/id]
@@ -580,7 +572,8 @@
(assert-admin (:id context))
(map
->graphql
(first (d-checks/get-graphql (assoc (<-graphql args) :count Integer/MAX_VALUE)))))
(first (d-checks/get-graphql (assoc (<-graphql (assoc args :clients (:clients context))) :count Integer/MAX_VALUE)))))
(defn print-checks [context args _]
(assert-can-see-client (:id context) (:client_id args))

View File

@@ -0,0 +1,12 @@
(let [query [[:all_payments
{:client-code "VS"
:original-id nil}
[:id :check-number :amount :memo :date :status :type :original-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-account [:name :numeric-code :id]] [:address [:street1 :city :state :zip]]]]
[:client [:id :name :code]]]]]
payments (auto-ap.graphql/query {:user/role "admin"} (venia/graphql-query {:venia/queries (->graphql query)}))]
{:body
(list (:all-payments (:data payments)))})