Adds new expense report, with ability to break down by vendor

This commit is contained in:
2024-04-19 21:48:28 -07:00
parent 706924c21c
commit 22e92c819b
12 changed files with 141 additions and 45 deletions

View File

@@ -342,8 +342,28 @@
db
[
[ (pull-attr db :db/id [:client/code "NGRV"])]
#inst "2024-03-01" #inst "2024-03-30"]))
[ (pull-attr db :db/id [:client/code "NGA1"])]
#inst "2023-01-01" #inst "2024-01-01"]))
:separator \tab)
(pull-attr (dc/db conn) :db/id [:client/code "NGRV"])
(clojure.data.csv/write-csv *out*
(let [db (dc/db conn)]
(dc/q '[:find ?d4 (sum ?a)
:in $ [?clients ?start-date ?end-date] ?v
:where
[(iol-ion.query/scan-transactions $ ?clients ?start-date ?end-date) [[?e _ ?sort-default] ...]]
[?e :transaction/date ?d]
[(iol-ion.query/excel-date ?d) ?d4]
[?e :transaction/amount ?a]
[?e :transaction/vendor ?v]]
db
[
[ (pull-attr db :db/id [:client/code "NGA1"])]
#inst "2023-01-01" #inst "2024-01-01"]
(ffirst (dc/q '[:find ?v :where [?v :vendor/name "CCP Doordash"]] db))))
:separator \tab)