Allows resetting expense accounts
This commit is contained in:
@@ -375,7 +375,11 @@
|
|||||||
(conj "A")
|
(conj "A")
|
||||||
(conj "HQ"))))]
|
(conj "HQ"))))]
|
||||||
|
|
||||||
(when-not (dollars= (Math/abs (:transaction/amount existing-transaction)) account-total)
|
(when (and (not (dollars= (Math/abs (:transaction/amount existing-transaction)) account-total))
|
||||||
|
(or
|
||||||
|
(and (= approval_status :unapproved)
|
||||||
|
(> (count accounts) 0))
|
||||||
|
(not= approval_status :unapproved)))
|
||||||
(let [error (str "Expense account total (" account-total ") does not equal transaction total (" (Math/abs (:transaction/amount existing-transaction)) ")")]
|
(let [error (str "Expense account total (" account-total ") does not equal transaction total (" (Math/abs (:transaction/amount existing-transaction)) ")")]
|
||||||
(throw (ex-info error {:validation-error error}))))
|
(throw (ex-info error {:validation-error error}))))
|
||||||
(when missing-locations
|
(when missing-locations
|
||||||
|
|||||||
Reference in New Issue
Block a user