diff --git a/src/clj/auto_ap/datomic/checks.clj b/src/clj/auto_ap/datomic/checks.clj index f21dd680..f9ecfcb4 100644 --- a/src/clj/auto_ap/datomic/checks.clj +++ b/src/clj/auto_ap/datomic/checks.clj @@ -68,7 +68,7 @@ (:sort-by args) (sort-by (sort-fn args)) (= (:asc args) false) (reverse) true (drop (:start args 0)) - true (take (:count args 20))))) + true (take (:count args 100))))) (defn count-graphql [args] (->> (raw-graphql args) diff --git a/src/clj/auto_ap/datomic/invoices.clj b/src/clj/auto_ap/datomic/invoices.clj index b0eb5364..a1edd0f9 100644 --- a/src/clj/auto_ap/datomic/invoices.clj +++ b/src/clj/auto_ap/datomic/invoices.clj @@ -65,7 +65,7 @@ (:sort-by args) (sort-by (sort-fn args)) (= (:asc args) false) (reverse) true (drop (:start args 0)) - true (take (:count args 20))))) + true (take (:count args 100))))) (defn count-graphql [args] diff --git a/src/clj/auto_ap/datomic/transactions.clj b/src/clj/auto_ap/datomic/transactions.clj index 9bfa62a0..021d0eaa 100644 --- a/src/clj/auto_ap/datomic/transactions.clj +++ b/src/clj/auto_ap/datomic/transactions.clj @@ -46,7 +46,7 @@ (:sort-by args) (sort-by (sort-fn args)) (= (:asc args) false) (reverse) true (drop (:start args 0)) - true (take (:count args 20))))) + true (take (:count args 100))))) (defn count-graphql [args] diff --git a/src/clj/auto_ap/datomic/users.clj b/src/clj/auto_ap/datomic/users.clj index e702bec6..64a7bf80 100644 --- a/src/clj/auto_ap/datomic/users.clj +++ b/src/clj/auto_ap/datomic/users.clj @@ -71,7 +71,7 @@ (:sort-by args) (sort-by (sort-fn args)) (= (:asc args) false) (reverse) true (drop (:start args 0)) - true (take (:count args 20))))) + true (take (:count args 100))))) (defn count-graphql [args] diff --git a/src/clj/auto_ap/graphql/checks.clj b/src/clj/auto_ap/graphql/checks.clj index 37b6cc02..4a4e55b4 100644 --- a/src/clj/auto_ap/graphql/checks.clj +++ b/src/clj/auto_ap/graphql/checks.clj @@ -339,7 +339,8 @@ (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-client (:id context) (:client-id check)) + (println "VOID CHECK" check) + (assert-can-see-client (:id context) (:db/id (:payment/client check))) (let [removing-payments (mapcat (fn [x] (let [invoice (:invoice-payment/invoice x) new-balance (+ (:invoice/outstanding-balance invoice) diff --git a/src/clj/auto_ap/graphql/invoices.clj b/src/clj/auto_ap/graphql/invoices.clj index 20232f27..c0f79ed1 100644 --- a/src/clj/auto_ap/graphql/invoices.clj +++ b/src/clj/auto_ap/graphql/invoices.clj @@ -82,7 +82,7 @@ (defn void-invoice [context {id :invoice_id} value] (let [invoice (d-invoices/get-by-id id) - _ (assert-can-see-client (:id context) (:client-id invoice)) + _ (assert-can-see-client (:id context) (:db/id (:invoice/client invoice))) updated-invoice (d-invoices/update {:db/id id :invoice/total 0.0 :invoice/outstanding-balance 0.0 diff --git a/src/clj/auto_ap/graphql/utils.clj b/src/clj/auto_ap/graphql/utils.clj index cb8eabbe..b5e683c5 100644 --- a/src/clj/auto_ap/graphql/utils.clj +++ b/src/clj/auto_ap/graphql/utils.clj @@ -48,6 +48,8 @@ (throw-unauthorized))) (defn can-see-client? [identity client] + (when (not client) + (println "WARNING - permission checking for null client")) (or (= "admin" (:user/role identity)) ((set (map :db/id (:user/clients identity))) (:db/id client)) ((set (map :db/id (:user/clients identity))) client))) diff --git a/src/cljs/auto_ap/views/components/invoice_table.cljs b/src/cljs/auto_ap/views/components/invoice_table.cljs index d9cd194b..f4be987e 100644 --- a/src/cljs/auto_ap/views/components/invoice_table.cljs +++ b/src/cljs/auto_ap/views/components/invoice_table.cljs @@ -47,7 +47,7 @@ [:expense_accounts [:amount :id :expense_account_id :location [:expense_account [:id :name :location [:parent [:id :name]]]]]] [:client [:name :id :locations]] - [:payments [:amount [:payment [:amount :s3_url :check_number ]]]] + [:payments [:amount :id [:payment [:id :amount :s3_url :check_number ]]]] ]] :total :start