excluding some stuff from PNL
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
:serialize (schema/as-conformer #(.toString %))}
|
||||
:ident {:parse (schema/as-conformer (fn [x] {:db/ident x}))
|
||||
:serialize (schema/as-conformer #(or (:ident %) (:db/ident %) %))}
|
||||
:iso_date {:parse (schema/as-conformer #(coerce/to-date-time %))
|
||||
:iso_date {:parse (schema/as-conformer #(time/parse % time/iso-date))
|
||||
:serialize (schema/as-conformer #(time/unparse % time/iso-date))}}
|
||||
:objects
|
||||
{
|
||||
@@ -284,13 +284,13 @@
|
||||
:resolve :get-potential-payments}
|
||||
:balance_sheet {:type :balance_sheet
|
||||
:args {:client_id {:type :id}
|
||||
:date {:type 'String}}
|
||||
:date {:type :iso_date}}
|
||||
:resolve :get-balance-sheet}
|
||||
|
||||
:profit_and_loss {:type :balance_sheet
|
||||
:args {:client_id {:type :id}
|
||||
:from_date {:type 'String}
|
||||
:to_date {:type 'String}}
|
||||
:from_date {:type :iso_date}
|
||||
:to_date {:type :iso_date}}
|
||||
:resolve :get-profit-and-loss}
|
||||
|
||||
:invoice_page {:type '(list :invoice_page)
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
(group-by (juxt :journal-entry-line/account :journal-entry-line/location))
|
||||
(reduce-kv (fn [result [account location] line-items]
|
||||
;; TODO fix
|
||||
(when-not (or (:bank-account/name account) (:account/name account))
|
||||
#_(when-not (or (:bank-account/name account) (:account/name account))
|
||||
(println "WARNING " account line-items))
|
||||
(conj result
|
||||
{:name (str (or (:bank-account/name account) (:account/name account)) (when-not (#{"A" } location)
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
|
||||
[comparable-results] (l/get-graphql {:client-id (:client_id args)
|
||||
:to-date (coerce/to-date (time/minus (parse (:date args) iso-date) (time/years 1)))
|
||||
:to-date (coerce/to-date (time/minus (:date args) (time/years 1)))
|
||||
:count Integer/MAX_VALUE})]
|
||||
(->graphql
|
||||
{:balance-sheet-accounts (roll-up results)
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
{:status 200
|
||||
:body (pr-str (ql/query (:identity r) (doto (if (= request-method :get) (query-params "query") body) println) variables ))
|
||||
:headers {"Content-Type" "application/edn"}})
|
||||
(catch Exception e
|
||||
(catch Throwable e
|
||||
|
||||
(if-let [result (:result (ex-data e))]
|
||||
{:status 400
|
||||
:body (pr-str result)
|
||||
@@ -25,9 +26,10 @@
|
||||
{:status 400
|
||||
:body (pr-str {:errors [(merge {:message message} (ex-data e))]})
|
||||
:headers {"Content-Type" "application/edn"}}
|
||||
{:status 500
|
||||
:body (pr-str {:errors [(merge {:message (.getMessage e)} (ex-data e))]})
|
||||
:headers {"Content-Type" "application/edn"}})))))
|
||||
(do (println e)
|
||||
{:status 500
|
||||
:body (pr-str {:errors [(merge {:message (.getMessage e)} (ex-data e))]})
|
||||
:headers {"Content-Type" "application/edn"}}))))))
|
||||
|
||||
|
||||
(defroutes routes
|
||||
|
||||
Reference in New Issue
Block a user