Merge branch 'port-datomic-cloud' into try-tailwind
This commit is contained in:
@@ -419,7 +419,7 @@
|
||||
(dissoc % :payment/pdf-data)
|
||||
%) checks ) id)]
|
||||
|
||||
(doseq [i (:tempids result)]
|
||||
(doseq [[_ i] (:tempids result)]
|
||||
(solr/touch-with-ledger i)))
|
||||
{:invoices (d-invoices/get-multi (map :invoice-id invoice-payments))
|
||||
:pdf-url (if (= type :payment-type/check)
|
||||
@@ -485,7 +485,7 @@
|
||||
:payment/date (c/to-date (parse (:date args) iso-date)))]
|
||||
(invoice-payments invoices invoice-payment-lookup))
|
||||
(:id context))]
|
||||
(doseq [i (:tempids result)]
|
||||
(doseq [[_ i] (:tempids result)]
|
||||
(solr/touch-with-ledger i)))
|
||||
(->graphql
|
||||
{:s3-url nil
|
||||
@@ -655,7 +655,7 @@
|
||||
(let [result (audit-transact (-> []
|
||||
(conj payment)
|
||||
(into (invoice-payments invoices invoice-amounts))) (:id context))]
|
||||
(doseq [n (:tempids result)]
|
||||
(doseq [[_ n] (:tempids result)]
|
||||
(solr/touch-with-ledger n)))
|
||||
(->graphql {:invoices (d-invoices/get-multi (map :db/id invoices))})))
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[auto-ap.datomic.transaction-rules :as tr]
|
||||
[auto-ap.datomic.transactions :as d-transactions]
|
||||
[auto-ap.rule-matching :as rm]
|
||||
[auto-ap.solr :as solr]
|
||||
[auto-ap.time :as atime]
|
||||
[auto-ap.utils :refer [dollars=]]
|
||||
[clj-time.coerce :as coerce]
|
||||
@@ -13,8 +14,7 @@
|
||||
[clojure.core.cache :as cache]
|
||||
[clojure.tools.logging :as log]
|
||||
[datomic.api :as dc]
|
||||
[digest :as di]
|
||||
[auto-ap.solr :as solr]))
|
||||
[digest :as di]))
|
||||
|
||||
(defn rough-match [client-id bank-account-id amount]
|
||||
(if (and client-id bank-account-id amount)
|
||||
@@ -219,7 +219,8 @@
|
||||
:transaction/vendor (:db/id (:payment/vendor existing-payment))
|
||||
:transaction/location "A"
|
||||
:transaction/accounts [#:transaction-account
|
||||
{:account (:db/id (a/get-account-by-numeric-code-and-sets 21000 ["default"]))
|
||||
{:db/id (random-tempid)
|
||||
:account (:db/id (a/get-account-by-numeric-code-and-sets 21000 ["default"]))
|
||||
:location "A"
|
||||
:amount (Math/abs (double amount))}])))
|
||||
|
||||
@@ -234,7 +235,8 @@
|
||||
(assoc transaction
|
||||
:transaction/expected-deposit {:db/id (:db/id expected-deposit)
|
||||
:expected-deposit/status :expected-deposit-status/cleared}
|
||||
:transaction/accounts [{:transaction-account/account :account/ccp
|
||||
:transaction/accounts [{:db/id (random-tempid)
|
||||
:transaction-account/account :account/ccp
|
||||
:transaction-account/amount amount
|
||||
:transaction-account/location "A"}]
|
||||
:transaction/approval-status :transaction-approval-status/approved
|
||||
@@ -242,7 +244,7 @@
|
||||
))))
|
||||
|
||||
(defn maybe-code [{:transaction/keys [client amount] :as transaction} apply-rules valid-locations]
|
||||
(when (seq (match-transaction-to-unpaid-invoices amount client))
|
||||
(when-not (seq (match-transaction-to-unpaid-invoices amount client))
|
||||
(apply-rules transaction valid-locations)))
|
||||
|
||||
(defn transaction->txs [transaction bank-account apply-rules]
|
||||
@@ -323,7 +325,7 @@
|
||||
:import-batch/entry (:db/id transaction)}]
|
||||
{:user/name user
|
||||
:user/role ":admin"})]
|
||||
(doseq [n (:tempids result)]
|
||||
(doseq [[_ n] (:tempids result)]
|
||||
(solr/touch-with-ledger n))))))
|
||||
|
||||
(get-stats [_]
|
||||
|
||||
@@ -167,9 +167,12 @@
|
||||
(->RealSolrClient (:solr-uri env))
|
||||
(->MockSolrClient )))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(defn touch-with-ledger [i]
|
||||
(index-documents impl [i
|
||||
(pull-id (dc/db conn) [:journal-entry/original-entity i])]))
|
||||
(index-documents impl [i [:journal-entry/original-entity i]]))
|
||||
|
||||
(defn touch [i]
|
||||
(index-documents impl [i]))
|
||||
|
||||
Reference in New Issue
Block a user