Adds ability to find expected deposits and link them

This commit is contained in:
2021-11-24 16:50:13 -08:00
parent 42bd65357f
commit 06ea51a168
11 changed files with 250 additions and 27 deletions

View File

@@ -158,6 +158,7 @@
:transaction/vendor [:db/id :vendor/name]
:transaction/matched-rule [:db/id :transaction-rule/note]
:transaction/payment [:db/id :payment/date]
:transaction/expected-deposit [:db/id :expected-deposit/date]
:transaction/accounts [:transaction-account/amount
:db/id
:transaction-account/location
@@ -167,9 +168,10 @@
(map #(update % :transaction/date c/from-date))
(map #(update % :transaction/post-date c/from-date))
(map (fn [transaction]
(if (:transaction/payment transaction)
(update-in transaction [:transaction/payment :payment/date] c/from-date)
transaction)))
(cond-> transaction
(:transaction/payment transaction) (update-in [:transaction/payment :payment/date] c/from-date)
(:transaction/expected-deposit transaction) (update-in [:transaction/expected-deposit :expected-deposit/date] c/from-date))
))
(map #(dissoc % :transaction/id))
(group-by :db/id))]