more conversion to datomic
This commit is contained in:
@@ -1,31 +1,40 @@
|
|||||||
(ns auto-ap.datomic.checks
|
(ns auto-ap.datomic.checks
|
||||||
(:require [datomic.api :as d]
|
(:require [datomic.api :as d]
|
||||||
[auto-ap.datomic :refer [uri]]
|
[auto-ap.datomic :refer [uri]]
|
||||||
|
[clojure.set :refer [rename-keys]]
|
||||||
[clj-time.coerce :as c]))
|
[clj-time.coerce :as c]))
|
||||||
|
|
||||||
(defn add-arg [query name value where]
|
(defn add-arg [query name value where & rest]
|
||||||
(-> query
|
(let [query (-> query
|
||||||
(update :args conj value)
|
(update :args conj value)
|
||||||
(update-in [:query :in] conj name)
|
(update-in [:query :in] conj name)
|
||||||
(update-in [:query :where] conj where)))
|
(update-in [:query :where] conj where))]
|
||||||
|
(reduce #(update-in %1 [:query :where] conj %2) query rest)))
|
||||||
|
|
||||||
(defn raw-graphql [args]
|
(defn raw-graphql [args]
|
||||||
(->> (d/query
|
(let [query (cond-> {:query {:find ['(pull ?e [*
|
||||||
(cond-> {:query {:find ['(pull ?e [*
|
{:invoice-payment/_payment [* {:invoice-payment/invoice [*]}]}
|
||||||
{:payment/client [:client/name :db/id]}
|
{:payment/client [:client/name :db/id]}
|
||||||
{:payment/vendor [:vendor/name :db/id]}
|
{:payment/vendor [:vendor/name :db/id]}
|
||||||
{:payment/status [:db/ident]}])]
|
{:payment/status [:db/ident]}])]
|
||||||
:in ['$]
|
:in ['$]
|
||||||
:where ['[?e :payment/original-id]]}
|
:where ['[?e :payment/original-id]]}
|
||||||
:args [(d/db (d/connect uri))]}
|
:args [(d/db (d/connect uri))]}
|
||||||
|
|
||||||
(:company-id args) (add-arg '?company-id (Long/parseLong (:company-id args))
|
(:client-id args) (add-arg '?client-id (cond-> (:client-id args) (string? (:client-id args)) Long/parseLong )
|
||||||
'[?e :payment/client ?company-id])))
|
'[?e :payment/client ?client-id])
|
||||||
(map first)
|
(:original-id args) (add-arg '?original-id (cond-> (:original-id args) (string? (:original-id args)) Long/parseLong )
|
||||||
|
'[?e :payment/client ?c]
|
||||||
(map #(update % :payment/date c/from-date))
|
'[?c :client/original-id ?original-id]))]
|
||||||
(map #(update % :payment/status :db/ident))
|
|
||||||
#_(map #(update % :transaction/post-date c/from-date))))
|
(->> (d/query
|
||||||
|
query)
|
||||||
|
(map first)
|
||||||
|
|
||||||
|
(map #(update % :payment/date c/from-date))
|
||||||
|
(map #(update % :payment/status :db/ident))
|
||||||
|
(map #(rename-keys % {:invoice-payment/_payment :payments/invoices}))
|
||||||
|
#_(map #(update % :transaction/post-date c/from-date)))))
|
||||||
|
|
||||||
(defn sort-fn [args]
|
(defn sort-fn [args]
|
||||||
(cond
|
(cond
|
||||||
|
|||||||
@@ -4,11 +4,12 @@
|
|||||||
[clj-time.coerce :as c]
|
[clj-time.coerce :as c]
|
||||||
[clojure.set :refer [rename-keys]]))
|
[clojure.set :refer [rename-keys]]))
|
||||||
|
|
||||||
(defn add-arg [query name value where]
|
(defn add-arg [query name value where & rest]
|
||||||
(-> query
|
(let [query (-> query
|
||||||
(update :args conj value)
|
(update :args conj value)
|
||||||
(update-in [:query :in] conj name)
|
(update-in [:query :in] conj name)
|
||||||
(update-in [:query :where] conj where)))
|
(update-in [:query :where] conj where))]
|
||||||
|
(reduce #(update-in %1 [:query :where] conj %2) query rest)))
|
||||||
|
|
||||||
(defn raw-graphql [args]
|
(defn raw-graphql [args]
|
||||||
(->> (d/query
|
(->> (d/query
|
||||||
@@ -23,8 +24,14 @@
|
|||||||
:args [(d/db (d/connect uri))]}
|
:args [(d/db (d/connect uri))]}
|
||||||
println)
|
println)
|
||||||
|
|
||||||
(:client-id args) (add-arg '?client-id (Long/parseLong (:client-id args))
|
(:client-id args) (add-arg '?client-id (cond-> (:client-id args)
|
||||||
'[?e :invoice/client ?client-id])
|
(string? (:client-id args))
|
||||||
|
Long/parseLong)
|
||||||
|
'[?e :invoice/client ?client-id])
|
||||||
|
|
||||||
|
(:original-id args) (add-arg '?original-id (cond-> (:original-id args) (string? (:original-id args)) Long/parseLong )
|
||||||
|
'[?e :invoice/client ?c]
|
||||||
|
'[?c :client/original-id ?original-id])
|
||||||
(:status args) (add-arg '?status (keyword "invoice-status" (:status args))
|
(:status args) (add-arg '?status (keyword "invoice-status" (:status args))
|
||||||
'[?e :invoice/status ?status])))
|
'[?e :invoice/status ?status])))
|
||||||
(map first)
|
(map first)
|
||||||
|
|||||||
@@ -3,11 +3,13 @@
|
|||||||
[auto-ap.datomic :refer [uri]]
|
[auto-ap.datomic :refer [uri]]
|
||||||
[clj-time.coerce :as c]))
|
[clj-time.coerce :as c]))
|
||||||
|
|
||||||
(defn add-arg [query name value where]
|
(defn add-arg [query name value where & rest]
|
||||||
(-> query
|
(let [query (-> query
|
||||||
(update :args conj value)
|
(update :args conj value)
|
||||||
(update-in [:query :in] conj name)
|
(update-in [:query :in] conj name)
|
||||||
(update-in [:query :where] conj where)))
|
(update-in [:query :where] conj where))]
|
||||||
|
(reduce #(update-in %1 [:query :where] conj %2) query rest)))
|
||||||
|
|
||||||
|
|
||||||
(defn raw-graphql [args]
|
(defn raw-graphql [args]
|
||||||
(->> (d/query
|
(->> (d/query
|
||||||
@@ -16,8 +18,11 @@
|
|||||||
:where ['[?e :transaction/original-id]]}
|
:where ['[?e :transaction/original-id]]}
|
||||||
:args [(d/db (d/connect uri))]}
|
:args [(d/db (d/connect uri))]}
|
||||||
|
|
||||||
(:company-id args) (add-arg '?company-id (Long/parseLong (:company-id args))
|
(:client-id args) (add-arg '?client-id (Long/parseLong (:client-id args))
|
||||||
'[?e :transaction/client ?company-id])))
|
'[?e :transaction/client ?client-id])
|
||||||
|
(:original-id args) (add-arg '?original-id (cond-> (:original-id args) (string? (:original-id args)) Long/parseLong )
|
||||||
|
'[?e :transaction/client ?c]
|
||||||
|
'[?c :client/original-id ?original-id])))
|
||||||
(map first)
|
(map first)
|
||||||
|
|
||||||
(map #(update % :transaction/date c/from-date))
|
(map #(update % :transaction/date c/from-date))
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
[auto-ap.db.vendors :as vendors]
|
[auto-ap.db.vendors :as vendors]
|
||||||
[auto-ap.db.companies :as companies]
|
[auto-ap.db.companies :as companies]
|
||||||
[auto-ap.datomic.clients :as d-clients]
|
[auto-ap.datomic.clients :as d-clients]
|
||||||
|
[auto-ap.datomic.checks :as d-checks]
|
||||||
[auto-ap.datomic.invoices :as d-invoices]
|
[auto-ap.datomic.invoices :as d-invoices]
|
||||||
[auto-ap.datomic.vendors :as d-vendors]
|
[auto-ap.datomic.vendors :as d-vendors]
|
||||||
[auto-ap.db.users :as users]
|
[auto-ap.db.users :as users]
|
||||||
@@ -101,8 +102,7 @@
|
|||||||
:vendor {:type :vendor}
|
:vendor {:type :vendor}
|
||||||
:company {:type :company}
|
:company {:type :company}
|
||||||
:date {:type 'String}
|
:date {:type 'String}
|
||||||
:bank_account {:type :bank_account
|
:bank_account {:type :bank_account}
|
||||||
:resolve :bank-account-for-check}
|
|
||||||
:memo {:type 'String}
|
:memo {:type 'String}
|
||||||
:s3_url {:type 'String}
|
:s3_url {:type 'String}
|
||||||
:check_number {:type 'Int}
|
:check_number {:type 'Int}
|
||||||
@@ -116,8 +116,7 @@
|
|||||||
:vendor {:type :vendor}
|
:vendor {:type :vendor}
|
||||||
:client {:type :client}
|
:client {:type :client}
|
||||||
:date {:type 'String}
|
:date {:type 'String}
|
||||||
:bank_account {:type :bank_account
|
:bank_account {:type :bank_account}
|
||||||
:resolve :bank-account-for-check}
|
|
||||||
:memo {:type 'String}
|
:memo {:type 'String}
|
||||||
:s3_url {:type 'String}
|
:s3_url {:type 'String}
|
||||||
:check_number {:type 'Int}
|
:check_number {:type 'Int}
|
||||||
@@ -139,7 +138,8 @@
|
|||||||
:amount {:type 'String}
|
:amount {:type 'String}
|
||||||
:invoice_id {:type 'String}
|
:invoice_id {:type 'String}
|
||||||
:payment_id {:type 'String}
|
:payment_id {:type 'String}
|
||||||
:payment {:type :payment}}}
|
:payment {:type :payment}
|
||||||
|
:invoice {:type :invoice}}}
|
||||||
|
|
||||||
:user
|
:user
|
||||||
{:fields {:id {:type 'Int}
|
{:fields {:id {:type 'Int}
|
||||||
@@ -160,8 +160,7 @@
|
|||||||
:expense_account_id {:type 'Int}
|
:expense_account_id {:type 'Int}
|
||||||
:location {:type 'String}
|
:location {:type 'String}
|
||||||
:expense_account {:type :expense_account
|
:expense_account {:type :expense_account
|
||||||
:resolve :get-expense-account
|
:resolve :get-expense-account
|
||||||
|
|
||||||
}
|
}
|
||||||
:amount {:type 'String}}}
|
:amount {:type 'String}}}
|
||||||
|
|
||||||
@@ -184,7 +183,7 @@
|
|||||||
:start {:type 'Int}
|
:start {:type 'Int}
|
||||||
:end {:type 'Int}}}
|
:end {:type 'Int}}}
|
||||||
|
|
||||||
:payment_page {:fields {:checks {:type '(list :payment)}
|
:payment_page {:fields {:payments {:type '(list :payment)}
|
||||||
:count {:type 'Int}
|
:count {:type 'Int}
|
||||||
:total {:type 'Int}
|
:total {:type 'Int}
|
||||||
:start {:type 'Int}
|
:start {:type 'Int}
|
||||||
@@ -218,12 +217,14 @@
|
|||||||
:resolve :get-invoice-page}
|
:resolve :get-invoice-page}
|
||||||
|
|
||||||
:all_invoices {:type '(list :invoice)
|
:all_invoices {:type '(list :invoice)
|
||||||
:args {:company_id {:type 'Int}}
|
:args {:client_id {:type 'String}
|
||||||
|
:original_id {:type 'Int}}
|
||||||
:resolve :get-all-invoices}
|
:resolve :get-all-invoices}
|
||||||
|
|
||||||
:all_checks {:type '(list :payment)
|
:all_payments {:type '(list :payment)
|
||||||
:args {:company_id {:type 'Int}}
|
:args {:client_id {:type 'String}
|
||||||
:resolve :get-all-checks}
|
:original_id {:type 'Int}}
|
||||||
|
:resolve :get-all-payments}
|
||||||
|
|
||||||
:transaction_page {:type '(list :transaction_page)
|
:transaction_page {:type '(list :transaction_page)
|
||||||
:args {:company_id {:type 'String}
|
:args {:company_id {:type 'String}
|
||||||
@@ -234,12 +235,12 @@
|
|||||||
:resolve :get-transaction-page}
|
:resolve :get-transaction-page}
|
||||||
|
|
||||||
:payment_page {:type '(list :payment_page)
|
:payment_page {:type '(list :payment_page)
|
||||||
:args {:company_id {:type 'Int}
|
:args {:client_id {:type 'String}
|
||||||
:start {:type 'Int}
|
:start {:type 'Int}
|
||||||
:sort_by {:type 'String}
|
:sort_by {:type 'String}
|
||||||
:asc {:type 'Boolean}}
|
:asc {:type 'Boolean}}
|
||||||
|
|
||||||
:resolve :get-check-page}
|
:resolve :get-payment-page}
|
||||||
:reminder_page {:type '(list :reminder_page)
|
:reminder_page {:type '(list :reminder_page)
|
||||||
:args {:start {:type 'Int}
|
:args {:start {:type 'Int}
|
||||||
:sort_by {:type 'String}
|
:sort_by {:type 'String}
|
||||||
@@ -377,34 +378,17 @@
|
|||||||
|
|
||||||
(defn get-all-invoices [context args value]
|
(defn get-all-invoices [context args value]
|
||||||
(assert-admin (:id context))
|
(assert-admin (:id context))
|
||||||
(let [extra-context
|
(map
|
||||||
(cond-> {}
|
->graphql
|
||||||
(executor/selects-field? context :invoice/vendor) (assoc :vendor-cache (by :id (vendors/get-all)))
|
(d-invoices/get-graphql (assoc (<-graphql args)
|
||||||
(executor/selects-field? context :invoice/company) (assoc :company-cache (by :id (companies/get-all))))
|
:limit Integer/MAX_VALUE))))
|
||||||
|
|
||||||
|
|
||||||
invoices (map
|
(defn get-all-payments [context args value]
|
||||||
->graphql
|
|
||||||
(invoices/get-graphql (assoc (<-graphql args)
|
|
||||||
:limit Integer/MAX_VALUE)))]
|
|
||||||
(resolve/with-context
|
|
||||||
invoices extra-context)))
|
|
||||||
|
|
||||||
(defn get-all-checks [context args value]
|
|
||||||
(assert-admin (:id context))
|
(assert-admin (:id context))
|
||||||
(let [extra-context
|
(map
|
||||||
(cond-> {}
|
->graphql
|
||||||
(executor/selects-field? context :invoice/vendor) (assoc :vendor-cache (by :id (vendors/get-all)))
|
(d-checks/get-graphql (assoc (<-graphql args)
|
||||||
(or (executor/selects-field? context :check/company)
|
:limit Integer/MAX_VALUE))))
|
||||||
(executor/selects-field? context :check/bank_account)) (assoc :company-cache (by :id (companies/get-all))))
|
|
||||||
|
|
||||||
|
|
||||||
checks (map
|
|
||||||
->graphql
|
|
||||||
(checks/get-graphql (assoc (<-graphql args)
|
|
||||||
:limit Integer/MAX_VALUE)))]
|
|
||||||
(resolve/with-context
|
|
||||||
checks extra-context)))
|
|
||||||
|
|
||||||
(defn get-reminder-page [context args value]
|
(defn get-reminder-page [context args value]
|
||||||
(assert-admin (:id context))
|
(assert-admin (:id context))
|
||||||
@@ -506,9 +490,9 @@
|
|||||||
(-> integreat-schema
|
(-> integreat-schema
|
||||||
(attach-resolvers {:get-invoice-page get-invoice-page
|
(attach-resolvers {:get-invoice-page get-invoice-page
|
||||||
:get-all-invoices get-all-invoices
|
:get-all-invoices get-all-invoices
|
||||||
:get-all-checks get-all-checks
|
:get-all-payments get-all-payments
|
||||||
:bank-account-for-check bank-account-for-check
|
:bank-account-for-check bank-account-for-check
|
||||||
:get-check-page gq-checks/get-check-page
|
:get-payment-page gq-checks/get-payment-page
|
||||||
:get-transaction-page gq-transactions/get-transaction-page
|
:get-transaction-page gq-transactions/get-transaction-page
|
||||||
:get-reminder-page get-reminder-page
|
:get-reminder-page get-reminder-page
|
||||||
:get-vendor-for-invoice get-vendor-for-invoice
|
:get-vendor-for-invoice get-vendor-for-invoice
|
||||||
|
|||||||
@@ -14,17 +14,17 @@
|
|||||||
[auto-ap.time :refer [parse normal-date iso-date]]))
|
[auto-ap.time :refer [parse normal-date iso-date]]))
|
||||||
|
|
||||||
|
|
||||||
(defn get-check-page [context args value]
|
(defn get-payment-page [context args value]
|
||||||
(let [args (assoc args :id (:id context))
|
(let [args (assoc args :id (:id context))
|
||||||
checks (map
|
payments (map
|
||||||
->graphql
|
->graphql
|
||||||
(d-checks/get-graphql (<-graphql args)))
|
(d-checks/get-graphql (<-graphql args)))
|
||||||
checks-count (d-checks/count-graphql (<-graphql args))]
|
checks-count (d-checks/count-graphql (<-graphql args))]
|
||||||
[{:checks checks
|
[{:payments payments
|
||||||
:total checks-count
|
:total checks-count
|
||||||
:count (count checks)
|
:count (count payments)
|
||||||
:start (:start args 0)
|
:start (:start args 0)
|
||||||
:end (+ (:start args 0) (count checks))}]))
|
:end (+ (:start args 0) (count payments))}]))
|
||||||
|
|
||||||
(defn add-handwritten-check [context args value]
|
(defn add-handwritten-check [context args value]
|
||||||
(let [invoice (invoices/get-by-id (:invoice_id args))
|
(let [invoice (invoices/get-by-id (:invoice_id args))
|
||||||
|
|||||||
@@ -4,12 +4,15 @@
|
|||||||
[auto-ap.db.checks :as checks]
|
[auto-ap.db.checks :as checks]
|
||||||
[auto-ap.db.transactions :as transactions]
|
[auto-ap.db.transactions :as transactions]
|
||||||
[auto-ap.db.companies :as companies]
|
[auto-ap.db.companies :as companies]
|
||||||
|
[auto-ap.datomic.clients :as d-clients]
|
||||||
|
[auto-ap.datomic.vendors :as d-vendors]
|
||||||
|
[auto-ap.datomic.transactions :as d-transactions]
|
||||||
[auto-ap.db.vendors :as vendors]
|
[auto-ap.db.vendors :as vendors]
|
||||||
[auto-ap.db.utils :refer [query]]
|
[auto-ap.db.utils :refer [query]]
|
||||||
[auto-ap.utils :refer [by]]
|
[auto-ap.utils :refer [by]]
|
||||||
[auto-ap.parse :as parse]
|
[auto-ap.parse :as parse]
|
||||||
[auto-ap.graphql :as graphql]
|
[auto-ap.graphql :as graphql]
|
||||||
[auto-ap.graphql.utils :refer [->graphql assert-admin]]
|
[auto-ap.graphql.utils :refer [<-graphql ->graphql assert-admin]]
|
||||||
[auto-ap.routes.utils :refer [wrap-secure]]
|
[auto-ap.routes.utils :refer [wrap-secure]]
|
||||||
[clj-time.coerce :refer [to-date]]
|
[clj-time.coerce :refer [to-date]]
|
||||||
[auto-ap.db.invoices-expense-accounts :as expense-accounts]
|
[auto-ap.db.invoices-expense-accounts :as expense-accounts]
|
||||||
@@ -25,39 +28,42 @@
|
|||||||
(GET "/invoices/export" {:keys [query-params identity] :as request}
|
(GET "/invoices/export" {:keys [query-params identity] :as request}
|
||||||
(assert-admin identity)
|
(assert-admin identity)
|
||||||
(let [query [[:all_invoices
|
(let [query [[:all_invoices
|
||||||
{:company-id (query-params "company")}
|
{:client-id (query-params "client")
|
||||||
|
:original-id (query-params "original")}
|
||||||
[:id :total :outstanding-balance :invoice-number :date
|
[:id :total :outstanding-balance :invoice-number :date
|
||||||
[:checks [:amount [:check [:check-number :memo [:bank_account [:id :number :bank-name :bank-code]]]]]]
|
[:payments [:amount [:payment [:check-number :memo [:bank_account [:id :number :bank-name :bank-code]]]]]]
|
||||||
[:vendor [:name :id :primary_contact [:address [:street1 :city :state :zip]]]]
|
[:vendor [:name :id [:primary_contact [:name]] [:address [:street1 :city :state :zip]]]]
|
||||||
[:expense_accounts [:amount :id :expense_account_id :location
|
[:expense_accounts [:amount :id :expense_account_id :location
|
||||||
[:expense_account [:id :name [:parent [:id :name]]]]]]
|
[:expense_account [:id :name [:parent [:id :name]]]]]]
|
||||||
[:company [:name :id :locations]]]]]
|
[:client [:name :id :locations]]]]]
|
||||||
invoices (graphql/query identity (venia/graphql-query {:venia/queries (->graphql query)}))]
|
invoices (graphql/query identity (venia/graphql-query {:venia/queries (->graphql query)}))]
|
||||||
(list (:all-invoices (:data invoices)))))
|
(list (:all-invoices (:data invoices)))))
|
||||||
(GET "/checks/export" {:keys [query-params identity]}
|
(GET "/payments/export" {:keys [query-params identity]}
|
||||||
(assert-admin identity)
|
(assert-admin identity)
|
||||||
(let [query [[:all_checks
|
(let [query [[:all_payments
|
||||||
{:company-id (query-params "company")}
|
{:client-id (query-params "client")
|
||||||
|
:original-id (query-params "original")}
|
||||||
[:id :check-number :amount :memo :date
|
[:id :check-number :amount :memo :date
|
||||||
[:invoices [:invoice-id :amount]]
|
[:invoices [[:invoice [:id]] :amount]]
|
||||||
[:bank-account [:number :bank-name :bank-code :id]]
|
[:bank-account [:number :bank-name :bank-code :id]]
|
||||||
[:vendor [:name :id :primary-contact :primary-email :primary-phone :default-expense-account [:address [:street1 :city :state :zip]]]]
|
[:vendor [:name :id [:primary-contact [:name :email :phone]] :default-expense-account [:address [:street1 :city :state :zip]]]]
|
||||||
[:company [:id :name]]
|
[:client [:id :name]]
|
||||||
]]]
|
]]]
|
||||||
checks (graphql/query identity (venia/graphql-query {:venia/queries (->graphql query)}))]
|
payments (graphql/query identity (venia/graphql-query {:venia/queries (->graphql query)}))]
|
||||||
(list (:all-checks (:data checks)))))
|
(list (:all-payments (:data payments)))))
|
||||||
|
|
||||||
(GET "/companies/export" {:keys [query-params identity]}
|
(GET "/clients/export" {:keys [query-params identity]}
|
||||||
(assert-admin identity)
|
(assert-admin identity)
|
||||||
(companies/get-all))
|
(map <-graphql (d-clients/get-all)))
|
||||||
|
|
||||||
(GET "/vendors/export" {:keys [query-params identity]}
|
(GET "/vendors/export" {:keys [query-params identity]}
|
||||||
(assert-admin identity)
|
(assert-admin identity)
|
||||||
(vendors/get-all))
|
(map <-graphql (d-vendors/get-graphql {})))
|
||||||
(GET "/transactions/export" {:keys [query-params identity]}
|
(GET "/transactions/export" {:keys [query-params identity]}
|
||||||
(assert-admin identity)
|
(assert-admin identity)
|
||||||
(let [transactions (transactions/get-graphql {:company-id (Integer/parseInt (query-params "company"))
|
(let [transactions (map <-graphql (d-transactions/get-graphql {:client-id (query-params "client")
|
||||||
:limit Integer/MAX_VALUE})]
|
:original-id (Integer/parseInt (query-params "original"))
|
||||||
|
:limit Integer/MAX_VALUE}))]
|
||||||
(map (fn [i]
|
(map (fn [i]
|
||||||
(-> i
|
(-> i
|
||||||
(update :date to-date)
|
(update :date to-date)
|
||||||
|
|||||||
@@ -35,8 +35,8 @@
|
|||||||
(assoc-in [::params] params))
|
(assoc-in [::params] params))
|
||||||
:graphql {:token (-> cofx :db :user)
|
:graphql {:token (-> cofx :db :user)
|
||||||
:query-obj {:venia/queries [[:payment_page
|
:query-obj {:venia/queries [[:payment_page
|
||||||
(assoc params :company-id (:id @(re-frame/subscribe [::subs/company])))
|
(assoc params :client-id (:id @(re-frame/subscribe [::subs/company])))
|
||||||
[[:checks [:id :status :amount :type :check_number :s3_url :date [:vendor [:name :id]] [:client [:name :id]]]]
|
[[:payments [:id :status :amount :type :check_number :s3_url :date [:vendor [:name :id]] [:client [:name :id]]]]
|
||||||
:total
|
:total
|
||||||
:start
|
:start
|
||||||
:end]]]}
|
:end]]]}
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
(on-params-change p))]
|
(on-params-change p))]
|
||||||
(fn [{:keys [id check-page status on-params-change vendors checked]}]
|
(fn [{:keys [id check-page status on-params-change vendors checked]}]
|
||||||
(let [{:keys [sort-by asc]} @state
|
(let [{:keys [sort-by asc]} @state
|
||||||
{:keys [checks start end count total]} @check-page
|
{:keys [payments start end count total]} @check-page
|
||||||
selected-company @(re-frame/subscribe [::subs/company])
|
selected-company @(re-frame/subscribe [::subs/company])
|
||||||
percentage-size (if selected-company "50%" "33%")]
|
percentage-size (if selected-company "50%" "33%")]
|
||||||
[:div
|
[:div
|
||||||
@@ -147,7 +147,7 @@
|
|||||||
[:tr
|
[:tr
|
||||||
[:td {:col-span 5}
|
[:td {:col-span 5}
|
||||||
[:i.fa.fa-spin.fa-spinner]]]
|
[:i.fa.fa-spin.fa-spinner]]]
|
||||||
(for [{:keys [client s3-url checks type check-number date amount id vendor status] :as i} (:checks @check-page)]
|
(for [{:keys [client s3-url payments type check-number date amount id vendor status] :as i} (:payments @check-page)]
|
||||||
^{:key id}
|
^{:key id}
|
||||||
[:tr {:class (:class i)}
|
[:tr {:class (:class i)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user