Adds new ledger import page

This commit is contained in:
2024-08-26 20:53:21 -07:00
parent c0d173125c
commit 6fd609be3e
16 changed files with 665 additions and 111 deletions

View File

@@ -270,19 +270,19 @@
:when (and account-location (not= account-location location))]
(field-validation-error (str "must be " account-location)
[:transaction-rule/accounts i :transaction-rule-account/location]
:form form-params))
:form-params form-params))
(let [total (reduce + 0.0 (map :transaction-rule-account/percentage (:transaction-rule/accounts form-params)))]
(when-not (dollars= 1.0 total)
(form-validation-error (format "Expense accounts total (%d%%) must add to 100%%" (int (* 100.0 total)))
:form form-params)))
:form-params form-params)))
(when (and (:transaction-rule/bank-account form-params)
(not (bank-account-belongs-to-client? (:transaction-rule/bank-account form-params)
(:transaction-rule/client form-params))))
(field-validation-error "does not belong to client"
[:transaction-rule/bank-account]
:form form-params)))
:form-params form-params)))