More test coverage, also found a bug where bulk voided invoices were not unvoidable

This commit is contained in:
2023-03-27 13:25:43 -07:00
parent 8d6832e1fe
commit ca45795b11
3 changed files with 199 additions and 83 deletions

View File

@@ -319,7 +319,8 @@
}]
(map
(fn [iea]
[:db/retract (:db/id i) :invoice/expense-accounts (:db/id iea)])
{:db/id (:db/id iea)
:invoice-expense-account/amount 0.0})
(:invoice/expense-accounts i))))))
(:id context))
{:message (str "Succesfully voided " (count all-ids))}))
@@ -339,6 +340,8 @@
:in ['$ '?e]}
:args [history id]})
[last-transaction] (->> txs (sort-by first) (last))]
(mu/log ::here
:txes txs)
(transact-with-ledger [(->> txs
(filter (fn [[tx]] (= tx last-transaction)))
(reduce (fn [new-transaction [_ entity original-status original-outstanding total expense-account expense-account-amount]]