Settlement fixes and perf improvements

This commit is contained in:
2021-09-04 10:05:16 -07:00
parent 35d875dd2f
commit b026b2806b
2 changed files with 131 additions and 86 deletions

View File

@@ -42,7 +42,7 @@
[?s :expected-deposit/client ?c]
[?s :expected-deposit/total ?t]
[?s :expected-deposit/fee ?f]
[?s :expected-deposit/date ?date]
[?s :expected-deposit/sales-date ?date]
[(clj-time.coerce/to-date-time ?date) ?d2]
[(auto-ap.time/localize ?d2) ?d3]
[(auto-ap.time/unparse-local ?d3 auto-ap.time/normal-date) ?d4]
@@ -69,7 +69,7 @@
]
# Refunds
[:find ?d4 (sum ?total) (sum ?fee)
[:find ?d4 ?t (sum ?total) (sum ?fee)
:with ?r
:in $
:where
@@ -77,6 +77,7 @@
[?r :sales-refund/total ?total]
[?r :sales-refund/fee ?fee]
[?r :sales-refund/date ?date]
[?r :sales-refund/type ?t]
[(clj-time.coerce/to-date-time ?date) ?d2]
[(auto-ap.time/localize ?d2) ?d3]
[(auto-ap.time/unparse-local ?d3 auto-ap.time/normal-date) ?d4]