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

@@ -211,7 +211,7 @@
(when (seq (dc/q '[:find ?x :in $ ?nc :where [?x :account/numeric-code ?nc]] (dc/db conn) (:account/numeric-code entity)))
(field-validation-error (format "The code %d is already in use." (:account/numeric-code entity))
[:account/numeric-code]
:form form-params)))
:form-params form-params)))
_ (some->> form-params
:account/client-overrides
(group-by :account-client-override/client)
@@ -226,7 +226,7 @@
:client/name
(-> client)))
) %)))
:form form-params)) ;; TODO shouldnt need to bubble this through. See if we can eliminate the passing of form and last-form.
:form-params form-params)) ;; TODO shouldnt need to bubble this through. See if we can eliminate the passing of form and last-form.
)
{:keys [tempids]} (audit-transact [[:upsert-entity (cond-> entity
(:account/numeric-code entity) (assoc :account/code (str (:account/numeric-code entity))))]]

View File

@@ -160,7 +160,7 @@
(dissoc form-params :name))]
{:message (str "task " (str new-job) " started.")})
(form-validation-error "This job is already running"
:form form-params)))
:form-params form-params)))
(defn subform* [{:keys [name]}]
(into [:div {:class "fade-in-settle transition"}]

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)))

View File

@@ -201,7 +201,7 @@
(if (= (:source-vendor form-params)
(:target-vendor form-params))
(form-validation-error "Please select two different vendors"
:form form-params))
:form-params form-params))
(let [transaction (->> (dc/q {:find '[?x ?a2]
:in '[$ ?vendor-from]
:where ['[?x ?a ?vendor-from]