ssr sales

This commit is contained in:
2023-09-14 22:45:05 -07:00
parent 12c676629d
commit 85597fd9eb
7 changed files with 212 additions and 74 deletions

View File

@@ -48,6 +48,8 @@
[client end]))))
(defn can-see-client? [identity client]
(when (not client)
(println "WARNING - permission checking for null client"))
@@ -72,6 +74,15 @@
(time/plus (time/days 1))
coerce/to-date))
(defn scan-sales-orders [db clients start end]
(for [c clients
:let [c (entid db c)]
r (seq (dc/index-range db
:sales-order/client+date
[c (or start #inst "2001-01-01T08:00:00.000-00:00") ]
[c (or (next-day end) #inst "2030-03-05T08:00:00.000-00:00") ]))]
[(:e r) (first (:v r)) (second (:v r))]))
(defn scan-invoices [db clients start end]
(for [c clients
:let [c (entid db c)]