various fixes.
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
(defn raw-graphql-ids [db args]
|
||||
(->> (doto (cond-> {:query {:find []
|
||||
:in ['$]
|
||||
:where []}
|
||||
:where ['[?e :invoice/client]]}
|
||||
:args [(d/db (d/connect uri))]}
|
||||
|
||||
(limited-clients (:id args))
|
||||
@@ -105,6 +105,14 @@
|
||||
'[(.contains ^String ?invoice-number ?invoice-number-like)]]}
|
||||
: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))
|
||||
(merge-query {:query {:in ['?location]
|
||||
:where ['[?e :invoice/expense-accounts ?eas]
|
||||
|
||||
@@ -481,6 +481,7 @@
|
||||
:date_range {:type :date_range}
|
||||
:due_range {:type :date_range}
|
||||
:status {:type :invoice_status}
|
||||
:unresolved {:type 'Boolean}
|
||||
:client_id {:type :id}
|
||||
:vendor_id {:type :id}
|
||||
:amount_lte {:type :money}
|
||||
|
||||
@@ -308,9 +308,10 @@
|
||||
|
||||
:journal-entry/line-items
|
||||
(mapv (fn [ea]
|
||||
(when-not (get
|
||||
(get all-client-locations (:client_code entry))
|
||||
(:location ea))
|
||||
(when (and (not (get
|
||||
(get all-client-locations (:client_code entry))
|
||||
(:location ea)))
|
||||
(not= "A" (:location ea)))
|
||||
(throw (ex-info (str "Location '" (:location ea) "' not found.")
|
||||
{:status :error})))
|
||||
(when (and (<= (:debit ea 0.0) 0.0)
|
||||
|
||||
@@ -196,6 +196,7 @@
|
||||
|
||||
|
||||
(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")
|
||||
|
||||
|
||||
|
||||
@@ -361,12 +361,13 @@
|
||||
user-session (login-user cob-session)
|
||||
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)})
|
||||
:body (json/write-str data)
|
||||
:as :json}
|
||||
other-config)))
|
||||
(client/put (merge {:headers (merge base-headers {"Authorization" (auth-header cob-session user-session)})
|
||||
:body (json/write-str data)
|
||||
:as :json}
|
||||
other-config)))
|
||||
log/info)
|
||||
(refresh-provider-account pa)))
|
||||
|
||||
#_(defn get-users []
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
:amount-gte (:amount-gte (:amount-range params))
|
||||
:amount-lte (:amount-lte (:amount-range params))
|
||||
:location (:location params)
|
||||
:unresolved (:unresolved params)
|
||||
:invoice-number-like (:invoice-number-like params)
|
||||
:client-id (:id @(re-frame/subscribe [::subs/client]))
|
||||
:import-status (:import-status params)
|
||||
|
||||
@@ -1,20 +1,14 @@
|
||||
(ns auto-ap.views.components.invoices.side-bar
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[reagent.core :as r]
|
||||
[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]
|
||||
(:require [auto-ap.routes :as routes]
|
||||
[auto-ap.subs :as subs]
|
||||
[auto-ap.views.components.date-range-filter :refer [date-range-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.utils :refer [active-when dispatch-event bind-field horizontal-field date->str str->date pretty standard query-params dispatch-value-change]]
|
||||
[auto-ap.subs :as subs]
|
||||
[auto-ap.events :as events]
|
||||
[auto-ap.views.pages.data-page :as data-page]))
|
||||
[auto-ap.views.pages.data-page :as data-page]
|
||||
[auto-ap.views.utils :refer [active-when dispatch-value-change]]
|
||||
[bidi.bidi :as bidi]
|
||||
[re-frame.core :as re-frame]))
|
||||
|
||||
(defn invoice-number-filter [{:keys [data-page]}]
|
||||
[:div.field
|
||||
@@ -97,4 +91,21 @@
|
||||
|
||||
[:p.menu-label "Invoice #"]
|
||||
[: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