feat(transactions): port manual bank-transaction import to SSR #8

Closed
notid wants to merge 133 commits from integreat-add-transaction-manual into master
Showing only changes of commit 8189a7648b - Show all commits

View File

@@ -1002,6 +1002,9 @@
(let [{:keys [base-amount remainder]} (calculate-spread (:transaction-account/amount account) (count locations))]
(map-indexed (fn [idx _]
(assoc account
:db/id (if (= idx 0)
(:db/id account)
(random-tempid))
:transaction-account/amount (+ base-amount (if (< idx remainder) 1 0))
:transaction-account/location (nth locations idx)))
locations))