makes glimpse more forgiving and adds column headers
This commit is contained in:
@@ -90,11 +90,11 @@
|
||||
first)]))))
|
||||
deduplicate)
|
||||
vendor-name-options (->> (stack-rank #{"VENDOR_NAME"} lookup)
|
||||
(map (fn [t]
|
||||
[t (->> (solr/query solr/impl "vendors" {"query" (format "name:(%s) ", t) "fields" "score, *"})
|
||||
(filter (fn [d] (> (:score d) 4.0)))
|
||||
(map (comp #(Long/parseLong %) :id))
|
||||
first)]))
|
||||
(mapcat (fn [t]
|
||||
(for [m (->> (solr/query solr/impl "vendors" {"query" (format "name:(%s) ", t) "fields" "score, *"})
|
||||
(filter (fn [d] (> (:score d) 2.0)))
|
||||
(map (comp #(Long/parseLong %) :id)))]
|
||||
[t m])))
|
||||
(deduplicate))
|
||||
date-options (->> (stack-rank #{"INVOICE_RECEIPT_DATE" "ORDER_DATE" "DELIVERY_DATE"} lookup)
|
||||
(map (fn [t]
|
||||
@@ -189,6 +189,7 @@ invoice_dropzone = new Dropzone(\"#invoice\", {
|
||||
options]])))
|
||||
|
||||
(defn textract->invoice-form* [textract-invoice]
|
||||
(alog/info ::textract-invoiceform-rendering :textract-invoice textract-invoice)
|
||||
[:form {:hx-post (bidi/path-for ssr-routes/only-routes
|
||||
:invoice-glimpse-create-invoice
|
||||
:textract-invoice-id (:db/id textract-invoice))}
|
||||
@@ -231,7 +232,7 @@ invoice_dropzone = new Dropzone(\"#invoice\", {
|
||||
:textract-invoice/date
|
||||
second
|
||||
(coerce/to-date-time)
|
||||
(atime/unparse-local atime/iso-date))
|
||||
(atime/unparse-local atime/normal-date))
|
||||
:placeholder "Date"}))]
|
||||
(pill-list* {:selected (:textract-invoice/date textract-invoice)
|
||||
:options (:textract-invoice/date-options textract-invoice)
|
||||
@@ -240,7 +241,7 @@ invoice_dropzone = new Dropzone(\"#invoice\", {
|
||||
:->text (fn [[_ date]]
|
||||
(-> date
|
||||
(coerce/to-date-time)
|
||||
(atime/unparse-local atime/iso-date)))})
|
||||
(atime/unparse-local atime/normal-date)))})
|
||||
[:div.col-span-2.col-start-1
|
||||
(com/field {:label "Total"}
|
||||
(com/money-input {:name "total"
|
||||
@@ -358,7 +359,7 @@ invoice_dropzone = new Dropzone(\"#invoice\", {
|
||||
|
||||
(defn update-textract-invoice- [id {:strs [date total invoice-number client vendor]}]
|
||||
@(dc/transact-async conn [[:upsert-entity (cond-> {:db/id id}
|
||||
date (assoc :textract-invoice/date [date (coerce/to-date (atime/parse date atime/iso-date))])
|
||||
date (assoc :textract-invoice/date [date (coerce/to-date (atime/parse date atime/normal-date))])
|
||||
total (assoc :textract-invoice/total [total (Double/parseDouble total)])
|
||||
invoice-number (assoc :textract-invoice/invoice-number [invoice-number invoice-number])
|
||||
client (assoc :textract-invoice/customer-identifier [(pull-attr (dc/db conn) :client/name (Long/parseLong client)) (Long/parseLong client)])
|
||||
|
||||
@@ -786,17 +786,26 @@
|
||||
|
||||
|
||||
(defn balance-sheet-headers [pnl-data]
|
||||
(doto
|
||||
[(into [{:value "Period Ending"}]
|
||||
(cond-> []
|
||||
(> (count (set (map :client-id (:data pnl-data)))) 1)
|
||||
(conj (into [{:value "Client"}]
|
||||
|
||||
(mapcat identity
|
||||
(for [client (set (map :client-id (:data pnl-data))) ]
|
||||
(cond-> [{:value (date->str (:date (:args pnl-data)))}]
|
||||
(mapcat identity
|
||||
(for [client (set (map :client-id (:data pnl-data))) ]
|
||||
(cond-> [{:value (str (-> pnl-data :client-codes (get client)))}]
|
||||
|
||||
(:include-comparison (:args pnl-data))
|
||||
(into [{:value (date->str (:comparison-date (:args pnl-data)))}
|
||||
{:value "+/-"}])))))]
|
||||
println))
|
||||
(:include-comparison (:args pnl-data))
|
||||
(into ["" ""]))))))
|
||||
true
|
||||
(conj (into [{:value "Period Ending"}]
|
||||
|
||||
(mapcat identity
|
||||
(for [client (set (map :client-id (:data pnl-data))) ]
|
||||
(cond-> [{:value (date->str (:date (:args pnl-data)))}]
|
||||
|
||||
(:include-comparison (:args pnl-data))
|
||||
(into [{:value (date->str (:comparison-date (:args pnl-data)))}
|
||||
{:value "+/-"}]))))))))
|
||||
|
||||
(defn append-deltas [table]
|
||||
(->> table
|
||||
|
||||
Reference in New Issue
Block a user