shows the matching information.
This commit is contained in:
@@ -46,6 +46,12 @@
|
|||||||
:invoice-status/paid
|
:invoice-status/paid
|
||||||
:invoice-status/unpaid)]])})}]] )
|
: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]
|
(defn -main [& args]
|
||||||
(println "Creating database...")
|
(println "Creating database...")
|
||||||
(d/create-database uri)
|
(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-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/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/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...")
|
(println "Conforming database...")
|
||||||
|
|||||||
@@ -174,6 +174,7 @@
|
|||||||
:invoice
|
:invoice
|
||||||
{:fields {:id {:type :id}
|
{:fields {:id {:type :id}
|
||||||
:original_id {:type 'Int}
|
:original_id {:type 'Int}
|
||||||
|
:client_identifier {:type 'String}
|
||||||
:total {:type 'String}
|
:total {:type 'String}
|
||||||
:outstanding_balance {:type 'String}
|
:outstanding_balance {:type 'String}
|
||||||
:invoice_number {:type 'String}
|
:invoice_number {:type 'String}
|
||||||
|
|||||||
@@ -199,6 +199,7 @@
|
|||||||
|
|
||||||
:else
|
:else
|
||||||
(conj result (remove-nils #:invoice {:invoice/client (:db/id matching-client)
|
(conj result (remove-nils #:invoice {:invoice/client (:db/id matching-client)
|
||||||
|
:invoice/client-identifier customer-identifier
|
||||||
:invoice/vendor matching-vendor
|
:invoice/vendor matching-vendor
|
||||||
:invoice/invoice-number invoice-number
|
:invoice/invoice-number invoice-number
|
||||||
:invoice/total (Double/parseDouble total)
|
:invoice/total (Double/parseDouble total)
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
{:venia/queries [[:invoice_page
|
{:venia/queries [[:invoice_page
|
||||||
(assoc params
|
(assoc params
|
||||||
:client-id (:id @(re-frame/subscribe [::subs/client])))
|
: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]]
|
[:vendor [:name :id]]
|
||||||
[:expense_accounts [:amount :id :expense_account_id :location
|
[:expense_accounts [:amount :id :expense_account_id :location
|
||||||
[:expense_account [:id :name :location [:parent [:id :name]]]]]]
|
[:expense_account [:id :name :location [:parent [:id :name]]]]]]
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
:start
|
:start
|
||||||
:end]]]})
|
: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])
|
(let [visible-checks @(re-frame/subscribe [::visible-checks])
|
||||||
visible-expense-accounts @(re-frame/subscribe [::visible-expense-accounts])
|
visible-expense-accounts @(re-frame/subscribe [::visible-expense-accounts])
|
||||||
selected-client @(re-frame/subscribe [::subs/client])
|
selected-client @(re-frame/subscribe [::subs/client])
|
||||||
@@ -158,7 +158,9 @@
|
|||||||
|
|
||||||
(on-check-changed id i)))} ]])
|
(on-check-changed id i)))} ]])
|
||||||
(when-not selected-client
|
(when-not selected-client
|
||||||
[:td (:name client)])
|
[:td (if-let [client-override (:client overrides)]
|
||||||
|
(client-override i)
|
||||||
|
(:name client))])
|
||||||
[:td (:name vendor)]
|
[:td (:name vendor)]
|
||||||
[:td invoice-number]
|
[:td invoice-number]
|
||||||
[:td (date->str date) ]
|
[:td (date->str date) ]
|
||||||
|
|||||||
@@ -171,6 +171,11 @@
|
|||||||
(if (seq (:invoices @invoice-page))
|
(if (seq (:invoices @invoice-page))
|
||||||
[invoice-table {:id :approved
|
[invoice-table {:id :approved
|
||||||
:invoice-page invoice-page
|
:invoice-page invoice-page
|
||||||
|
:overrides {:client (fn [row]
|
||||||
|
[:p (:name (:client row))
|
||||||
|
[:p [:i.is-size-7 (:client-identifier row)]]]
|
||||||
|
|
||||||
|
)}
|
||||||
:check-boxes true
|
:check-boxes true
|
||||||
:checked (:checked @invoice-page)
|
:checked (:checked @invoice-page)
|
||||||
:on-check-changed (fn [which invoice]
|
:on-check-changed (fn [which invoice]
|
||||||
|
|||||||
Reference in New Issue
Block a user