various fixes.
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
(defn raw-graphql-ids [db args]
|
(defn raw-graphql-ids [db args]
|
||||||
(->> (doto (cond-> {:query {:find []
|
(->> (doto (cond-> {:query {:find []
|
||||||
:in ['$]
|
:in ['$]
|
||||||
:where []}
|
:where ['[?e :invoice/client]]}
|
||||||
:args [(d/db (d/connect uri))]}
|
:args [(d/db (d/connect uri))]}
|
||||||
|
|
||||||
(limited-clients (:id args))
|
(limited-clients (:id args))
|
||||||
@@ -105,6 +105,14 @@
|
|||||||
'[(.contains ^String ?invoice-number ?invoice-number-like)]]}
|
'[(.contains ^String ?invoice-number ?invoice-number-like)]]}
|
||||||
:args [(:invoice-number-like args)]})
|
:args [(:invoice-number-like args)]})
|
||||||
|
|
||||||
|
(:unresolved args)
|
||||||
|
(merge-query {:query {:in []
|
||||||
|
:where ['(or-join [?e]
|
||||||
|
(not [?e :invoice/expense-accounts ])
|
||||||
|
(and [?e :invoice/expense-accounts ?ea]
|
||||||
|
(not [?ea :invoice-expense-account/account])))]}
|
||||||
|
:args []})
|
||||||
|
|
||||||
(seq (:location args))
|
(seq (:location args))
|
||||||
(merge-query {:query {:in ['?location]
|
(merge-query {:query {:in ['?location]
|
||||||
:where ['[?e :invoice/expense-accounts ?eas]
|
:where ['[?e :invoice/expense-accounts ?eas]
|
||||||
|
|||||||
@@ -481,6 +481,7 @@
|
|||||||
:date_range {:type :date_range}
|
:date_range {:type :date_range}
|
||||||
:due_range {:type :date_range}
|
:due_range {:type :date_range}
|
||||||
:status {:type :invoice_status}
|
:status {:type :invoice_status}
|
||||||
|
:unresolved {:type 'Boolean}
|
||||||
:client_id {:type :id}
|
:client_id {:type :id}
|
||||||
:vendor_id {:type :id}
|
:vendor_id {:type :id}
|
||||||
:amount_lte {:type :money}
|
:amount_lte {:type :money}
|
||||||
|
|||||||
@@ -308,9 +308,10 @@
|
|||||||
|
|
||||||
:journal-entry/line-items
|
:journal-entry/line-items
|
||||||
(mapv (fn [ea]
|
(mapv (fn [ea]
|
||||||
(when-not (get
|
(when (and (not (get
|
||||||
(get all-client-locations (:client_code entry))
|
(get all-client-locations (:client_code entry))
|
||||||
(:location ea))
|
(:location ea)))
|
||||||
|
(not= "A" (:location ea)))
|
||||||
(throw (ex-info (str "Location '" (:location ea) "' not found.")
|
(throw (ex-info (str "Location '" (:location ea) "' not found.")
|
||||||
{:status :error})))
|
{:status :error})))
|
||||||
(when (and (<= (:debit ea 0.0) 0.0)
|
(when (and (<= (:debit ea 0.0) 0.0)
|
||||||
|
|||||||
@@ -196,6 +196,7 @@
|
|||||||
|
|
||||||
|
|
||||||
(when (seq repairs)
|
(when (seq repairs)
|
||||||
|
(log/info (take 3 repairs))
|
||||||
(log/warn "repairing " (count txes-missing-ledger-entries) " missing transactions, " (count invoices-missing-ledger-entries) " missing invoices that were missing ledger entries")
|
(log/warn "repairing " (count txes-missing-ledger-entries) " missing transactions, " (count invoices-missing-ledger-entries) " missing invoices that were missing ledger entries")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -361,12 +361,13 @@
|
|||||||
user-session (login-user cob-session)
|
user-session (login-user cob-session)
|
||||||
batch-size 100]
|
batch-size 100]
|
||||||
|
|
||||||
(-> (str (:yodlee-base-url env) "/providerAccounts?providerAccountIds=" pa)
|
(doto (-> (str (:yodlee-base-url env) "/providerAccounts?providerAccountIds=" pa)
|
||||||
|
|
||||||
(client/put (merge {:headers (merge base-headers {"Authorization" (auth-header cob-session user-session)})
|
(client/put (merge {:headers (merge base-headers {"Authorization" (auth-header cob-session user-session)})
|
||||||
:body (json/write-str data)
|
:body (json/write-str data)
|
||||||
:as :json}
|
:as :json}
|
||||||
other-config)))
|
other-config)))
|
||||||
|
log/info)
|
||||||
(refresh-provider-account pa)))
|
(refresh-provider-account pa)))
|
||||||
|
|
||||||
#_(defn get-users []
|
#_(defn get-users []
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
:amount-gte (:amount-gte (:amount-range params))
|
:amount-gte (:amount-gte (:amount-range params))
|
||||||
:amount-lte (:amount-lte (:amount-range params))
|
:amount-lte (:amount-lte (:amount-range params))
|
||||||
:location (:location params)
|
:location (:location params)
|
||||||
|
:unresolved (:unresolved params)
|
||||||
:invoice-number-like (:invoice-number-like params)
|
:invoice-number-like (:invoice-number-like params)
|
||||||
:client-id (:id @(re-frame/subscribe [::subs/client]))
|
:client-id (:id @(re-frame/subscribe [::subs/client]))
|
||||||
:import-status (:import-status params)
|
:import-status (:import-status params)
|
||||||
|
|||||||
@@ -1,20 +1,14 @@
|
|||||||
(ns auto-ap.views.components.invoices.side-bar
|
(ns auto-ap.views.components.invoices.side-bar
|
||||||
(:require [re-frame.core :as re-frame]
|
(:require [auto-ap.routes :as routes]
|
||||||
[reagent.core :as r]
|
[auto-ap.subs :as subs]
|
||||||
[clojure.string :as str]
|
|
||||||
[clojure.spec.alpha :as s]
|
|
||||||
[cljs-time.core :as c]
|
|
||||||
[goog.string :as gstring]
|
|
||||||
[bidi.bidi :as bidi]
|
|
||||||
[auto-ap.utils :refer [deep-merge ]]
|
|
||||||
[auto-ap.routes :as routes]
|
|
||||||
[auto-ap.views.components.date-range-filter :refer [date-range-filter]]
|
[auto-ap.views.components.date-range-filter :refer [date-range-filter]]
|
||||||
[auto-ap.views.components.number-filter :refer [number-filter]]
|
[auto-ap.views.components.number-filter :refer [number-filter]]
|
||||||
|
[auto-ap.views.components.switch-field :refer [switch-field]]
|
||||||
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
|
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
|
||||||
[auto-ap.views.utils :refer [active-when dispatch-event bind-field horizontal-field date->str str->date pretty standard query-params dispatch-value-change]]
|
[auto-ap.views.pages.data-page :as data-page]
|
||||||
[auto-ap.subs :as subs]
|
[auto-ap.views.utils :refer [active-when dispatch-value-change]]
|
||||||
[auto-ap.events :as events]
|
[bidi.bidi :as bidi]
|
||||||
[auto-ap.views.pages.data-page :as data-page]))
|
[re-frame.core :as re-frame]))
|
||||||
|
|
||||||
(defn invoice-number-filter [{:keys [data-page]}]
|
(defn invoice-number-filter [{:keys [data-page]}]
|
||||||
[:div.field
|
[:div.field
|
||||||
@@ -97,4 +91,21 @@
|
|||||||
|
|
||||||
[:p.menu-label "Invoice #"]
|
[:p.menu-label "Invoice #"]
|
||||||
[:div
|
[:div
|
||||||
[invoice-number-filter params]]])]))
|
[invoice-number-filter params]]
|
||||||
|
|
||||||
|
(when (= "admin" (:user/role user))
|
||||||
|
[:<>
|
||||||
|
[:p.menu-label "Admin only"]
|
||||||
|
[:div
|
||||||
|
[switch-field {:id "unresolved-only"
|
||||||
|
:checked (boolean @(re-frame/subscribe [::data-page/filter data-page :unresolved]))
|
||||||
|
|
||||||
|
:on-change (fn [e]
|
||||||
|
(re-frame/dispatch [::data-page/filter-changed data-page :unresolved (.-checked (.-target e))])
|
||||||
|
|
||||||
|
|
||||||
|
)
|
||||||
|
:label "Unresolved only"
|
||||||
|
:type "checkbox"}]]]
|
||||||
|
)
|
||||||
|
])]))
|
||||||
|
|||||||
Reference in New Issue
Block a user