Makes a vendor account acceptable even if the invoice account isn't.

This commit is contained in:
2023-02-04 19:57:42 -08:00
parent afa6b79fcc
commit f7d5454d2c
8 changed files with 229 additions and 46 deletions

View File

@@ -116,12 +116,12 @@
[:tr {:class (when (:warning (:account a))
"has-background-warning-light")}
[:td.expandable [:div.control
(println a)
[form-builder/raw-field-v2 {:field [:expense-accounts id :account]}
[search-backed-typeahead {:search-query (fn [i]
[:search_account
{:query i
:client-id (:id client)
:vendor-id (:id (:vendor (:invoice data)))
:allowance :invoice}
[:name :id :location :warning]])
:class "is-warn"}]]]]

View File

@@ -74,7 +74,7 @@
(defn expense-accounts-field-v2 [{value :value on-change :on-change allowance :allowance expense-accounts :value client :client max-value :max locations :locations disabled :disabled percentage-only? :percentage-only? :or {percentage-only? false}}]
(defn expense-accounts-field-v2 [{value :value on-change :on-change allowance :allowance expense-accounts :value client :client max-value :max locations :locations disabled :disabled percentage-only? :percentage-only? :or {percentage-only? false} vendor-id :vendor-id}]
[form-builder/virtual-builder {:value value
:schema schema
:on-change (fn [expense-accounts original-expense-accounts]
@@ -130,7 +130,8 @@
[:search_account
{:query i
:allowance allowance
:client-id (:id client)}
:client-id (:id client)
:vendor-id vendor-id}
[:name :id :location :warning]])
:disabled disabled}]]]]
[:div.column.is-narrow

View File

@@ -415,6 +415,7 @@
[form-builder/field-v2 {:field :expense-accounts}
"Expense Accounts"
[expense-accounts-field-v2 {:descriptor "expense account"
:vendor-id (:id (:vendor data))
:allowance :invoice
:locations (:locations (:client data))
:max (:total data)