diff --git a/src/clj/auto_ap/graphql/clients.clj b/src/clj/auto_ap/graphql/clients.clj index 0b307060..ae0b416a 100644 --- a/src/clj/auto_ap/graphql/clients.clj +++ b/src/clj/auto_ap/graphql/clients.clj @@ -196,8 +196,7 @@ (= b bank-account)))) (map :journal-entry-line/running-balance) (first)) - 0.0)})}))) - ) + 0.0)})})))) (defn get-client [context _ _] (->graphql diff --git a/src/clj/auto_ap/ledger.clj b/src/clj/auto_ap/ledger.clj index cc083feb..3250011d 100644 --- a/src/clj/auto_ap/ledger.clj +++ b/src/clj/auto_ap/ledger.clj @@ -193,9 +193,13 @@ (mapv #(entity-change->ledger (dc/db conn) [:invoice %]))) repairs (vec (concat txes-missing-ledger-entries invoices-missing-ledger-entries))] (when (seq repairs) - (log/info (take 3 repairs)) - (log/warn "repairing " (count txes-missing-ledger-entries) " missing transactions, " (count invoices-missing-ledger-entries) " missing invoices that were missing ledger entries") - (dc/transact conn {:tx-data repairs}))))) + (mu/log ::ledger-repairs-needed + :sample (take 3 repairs) + :transaction-count (count txes-missing-ledger-entries) + :invoice-count (count invoices-missing-ledger-entries)) + (dc/transact conn {:tx-data (map (fn [repair] + `(upsert-ledger ~repair)) + repairs) }))))) (defn touch-transaction [e] diff --git a/src/clj/auto_ap/server.clj b/src/clj/auto_ap/server.clj index 1480f7a3..aba46c4f 100644 --- a/src/clj/auto_ap/server.clj +++ b/src/clj/auto_ap/server.clj @@ -88,6 +88,7 @@ (defn -main [& _] (let [job (System/getenv "INTEGREAT_JOB")] + (println "JOB is" job) (cond (= job "square-import-job") (job-square/-main)