diff --git a/src/clj/auto_ap/graphql/transactions.clj b/src/clj/auto_ap/graphql/transactions.clj index e8398c27..ff92785c 100644 --- a/src/clj/auto_ap/graphql/transactions.clj +++ b/src/clj/auto_ap/graphql/transactions.clj @@ -374,8 +374,12 @@ set (conj "A") (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)) ")")] (throw (ex-info error {:validation-error error})))) (when missing-locations