making clj-kondo happy
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
[datomic.api :as d]
|
||||
[mount.core :as mount]
|
||||
[unilog.context :as lc]
|
||||
#_{:clj-kondo/ignore [:unused-namespace]}
|
||||
[yang.scheduler :as scheduler]))
|
||||
|
||||
(defn datums->impacted-entity [db [e changes]]
|
||||
@@ -44,7 +43,7 @@
|
||||
type))
|
||||
|
||||
(defmethod entity-change->ledger :invoice
|
||||
[db [type id]]
|
||||
[db [_ id]]
|
||||
(when id
|
||||
(let [entity (d/pull db ['* {:invoice/vendor '[*]
|
||||
:invoice/payment '[*]
|
||||
@@ -83,7 +82,7 @@
|
||||
)})))))
|
||||
|
||||
(defmethod entity-change->ledger :transaction
|
||||
[db [type id]]
|
||||
[db [_ id]]
|
||||
(when id
|
||||
(let [entity (d/pull db ['* {:transaction/vendor '[*]
|
||||
:transaction/client '[*]
|
||||
@@ -91,7 +90,6 @@
|
||||
:transaction/bank-account '[* {:bank-account/type [:db/ident]}]
|
||||
:transaction/accounts '[*
|
||||
{:transaction-account/account [*]}] }] id)
|
||||
bank-account-type (-> entity :transaction/bank-account :bank-account/type :db/ident)
|
||||
decreasing? (< (:transaction/amount entity) 0.0)
|
||||
credit-from-bank? decreasing?
|
||||
debit-from-bank? (not decreasing?)]
|
||||
@@ -150,20 +148,14 @@
|
||||
:account :account/ccp}]}))
|
||||
|
||||
(defmethod entity-change->ledger :invoice-expense-account
|
||||
[db [entity changes]]
|
||||
[_ _]
|
||||
nil
|
||||
)
|
||||
|
||||
(defmethod entity-change->ledger nil
|
||||
[db [entity changes]]
|
||||
[_ _]
|
||||
nil)
|
||||
|
||||
(defn ledger-entries->transaction [entries]
|
||||
(into [[:replace-general-ledger (:journal-entry/original-entity (first entries))]]
|
||||
entries))
|
||||
|
||||
|
||||
|
||||
(mount/defstate tx-report-queue
|
||||
:start (d/tx-report-queue conn)
|
||||
:stop (d/remove-tx-report-queue conn))
|
||||
@@ -234,13 +226,9 @@
|
||||
(map first)
|
||||
(mapv #(entity-change->ledger (d/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")
|
||||
|
||||
|
||||
@(d/transact conn repairs))
|
||||
(log/info "Finished reconciling ledger"))
|
||||
(catch Exception e
|
||||
|
||||
Reference in New Issue
Block a user