shows the matching information.

This commit is contained in:
Bryce Covert
2019-11-17 12:07:06 -08:00
parent d2e48125d1
commit 141e5b06f1
5 changed files with 19 additions and 3 deletions

View File

@@ -46,6 +46,12 @@
:invoice-status/paid
:invoice-status/unpaid)]])})}]] )
(def add-client-identifier
[[{:db/ident :invoice/client-identifier
:db/doc "An identifier found in an uploaded invoice"
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}]])
(defn -main [& args]
(println "Creating database...")
(d/create-database uri)
@@ -78,6 +84,7 @@
:auto-ap/add-new-vendors {:txes-fn 'auto-ap.datomic.migrate.add-new-vendors/add-new-vendors :requires [:auto-ap/fix-check-numbers]}
:auto-ap/add-account-visibility-fields {:txes-fn 'auto-ap.datomic.migrate.account-sorting/add-account-visibility-fields :requires [:auto-ap/add-new-vendors]}
:auto-ap/make-every-account-visible {:txes-fn 'auto-ap.datomic.migrate.account-sorting/make-every-account-visible :requires [:auto-ap/add-account-visibility-fields]}
:auto-ap/add-client-identifier2 {:txes add-client-identifier :requires [:auto-ap/make-every-account-visible]}
}]
(println "Conforming database...")

View File

@@ -174,6 +174,7 @@
:invoice
{:fields {:id {:type :id}
:original_id {:type 'Int}
:client_identifier {:type 'String}
:total {:type 'String}
:outstanding_balance {:type 'String}
:invoice_number {:type 'String}

View File

@@ -199,6 +199,7 @@
:else
(conj result (remove-nils #:invoice {:invoice/client (:db/id matching-client)
:invoice/client-identifier customer-identifier
:invoice/vendor matching-vendor
:invoice/invoice-number invoice-number
:invoice/total (Double/parseDouble total)

View File

@@ -47,7 +47,7 @@
{:venia/queries [[:invoice_page
(assoc params
:client-id (:id @(re-frame/subscribe [::subs/client])))
[[:invoices [:id :total :outstanding-balance :invoice-number :date :status
[[:invoices [:id :total :outstanding-balance :invoice-number :date :status :client-identifier
[:vendor [:name :id]]
[:expense_accounts [:amount :id :expense_account_id :location
[:expense_account [:id :name :location [:parent [:id :name]]]]]]
@@ -58,7 +58,7 @@
:start
:end]]]})
(defn invoice-table [{:keys [id invoice-page status on-params-change vendors params check-boxes checked on-check-changed on-edit-invoice on-void-invoice on-unvoid-invoice expense-event]}]
(defn invoice-table [{:keys [id invoice-page status on-params-change vendors params check-boxes checked on-check-changed on-edit-invoice on-void-invoice on-unvoid-invoice expense-event overrides]}]
(let [visible-checks @(re-frame/subscribe [::visible-checks])
visible-expense-accounts @(re-frame/subscribe [::visible-expense-accounts])
selected-client @(re-frame/subscribe [::subs/client])
@@ -158,7 +158,9 @@
(on-check-changed id i)))} ]])
(when-not selected-client
[:td (:name client)])
[:td (if-let [client-override (:client overrides)]
(client-override i)
(:name client))])
[:td (:name vendor)]
[:td invoice-number]
[:td (date->str date) ]

View File

@@ -171,6 +171,11 @@
(if (seq (:invoices @invoice-page))
[invoice-table {:id :approved
:invoice-page invoice-page
:overrides {:client (fn [row]
[:p (:name (:client row))
[:p [:i.is-size-7 (:client-identifier row)]]]
)}
:check-boxes true
:checked (:checked @invoice-page)
:on-check-changed (fn [which invoice]