Makes running datomic cloud work again
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
(ns auto-ap.graphql.checks
|
||||
(:require
|
||||
[amazonica.aws.s3 :as s3]
|
||||
[auto-ap.datomic :refer [conn remove-nils plus]]
|
||||
[auto-ap.datomic :refer [conn remove-nils plus pull-many]]
|
||||
[auto-ap.datomic.accounts :as a]
|
||||
[auto-ap.datomic.bank-accounts :as d-bank-accounts]
|
||||
[auto-ap.datomic.checks :as d-checks]
|
||||
@@ -393,7 +393,7 @@
|
||||
client (d-clients/get-by-id client-id)
|
||||
invoice-amounts (by :invoice-id :amount invoice-payments)
|
||||
invoices-grouped-by-vendor (group-by (comp :db/id :invoice/vendor) invoices)
|
||||
vendors (->> (d/pull-many (d/db conn) d-vendors/default-read (keys invoices-grouped-by-vendor))
|
||||
vendors (->> (pull-many (dc/db conn) d-vendors/default-read (keys invoices-grouped-by-vendor))
|
||||
(by :db/id))
|
||||
bank-account (d-bank-accounts/get-by-id bank-account-id)
|
||||
_ (validate-belonging client-id invoices bank-account)
|
||||
@@ -516,10 +516,10 @@
|
||||
|
||||
(defn void-payments-internal [all-ids id]
|
||||
(transact-with-ledger (->> all-ids
|
||||
(d/q '[:find [(pull ?p [:db/id
|
||||
(dc/q '[:find (pull ?p [:db/id
|
||||
{:invoice-payment/_payment [:invoice-payment/amount
|
||||
:db/id
|
||||
{:invoice-payment/invoice [:db/id :invoice/outstanding-balance]}]}]) ...]
|
||||
{:invoice-payment/invoice [:db/id :invoice/outstanding-balance]}]}])
|
||||
:in $ [?p ...]
|
||||
:where
|
||||
(not [_ :transaction/payment ?p])
|
||||
@@ -529,7 +529,8 @@
|
||||
[?p :payment/date ?d]
|
||||
[(>= ?d ?lu)]
|
||||
]
|
||||
(d/db conn))
|
||||
(dc/db conn))
|
||||
(map first)
|
||||
(mapcat (fn [{:keys [:db/id]
|
||||
invoices :invoice-payment/_payment}]
|
||||
(into
|
||||
|
||||
Reference in New Issue
Block a user