renamed company to client.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
(ns auto-ap.graphql.checks
|
||||
(:require [auto-ap.graphql.utils :refer [->graphql <-graphql assert-can-see-company]]
|
||||
(:require [auto-ap.graphql.utils :refer [->graphql <-graphql assert-can-see-client]]
|
||||
[datomic.api :as d]
|
||||
[clojure.edn :as edn]
|
||||
[com.walmartlabs.lacinia :refer [execute]]
|
||||
@@ -316,7 +316,7 @@
|
||||
(let [invoice (d-invoices/get-by-id (:invoice_id args))
|
||||
bank-account-id (:bank_account_id args)
|
||||
bank-account (d-bank-accounts/get-by-id bank-account-id)
|
||||
_ (assert-can-see-company (:id context) (:invoice/client invoice))
|
||||
_ (assert-can-see-client (:id context) (:invoice/client invoice))
|
||||
base-payment (base-payment [invoice] (:invoice/vendor invoice)
|
||||
(:invoice/client invoice)
|
||||
bank-account :payment-type/check 0 {(:invoice_id args) (:amount args)})]
|
||||
@@ -339,7 +339,7 @@
|
||||
(let [check (d-checks/get-by-id id)]
|
||||
(assert (or (= :payment-status/pending (:payment/status check))
|
||||
(#{:payment-type/cash :payment-type/debit} (:payment/type check))))
|
||||
(assert-can-see-company (:id context) (:client-id check))
|
||||
(assert-can-see-client (:id context) (:client-id check))
|
||||
(let [removing-payments (mapcat (fn [x]
|
||||
(let [invoice (:invoice-payment/invoice x)
|
||||
new-balance (+ (:invoice/outstanding-balance invoice)
|
||||
|
||||
Reference in New Issue
Block a user