Adds unknown processor to payments

This commit is contained in:
2024-04-18 12:37:11 -07:00
parent 7b15b35eff
commit 58217158e3
3 changed files with 41 additions and 6 deletions

View File

@@ -135,6 +135,18 @@
(dc/db conn)
[[c] date date]))
0.0)
:sales-summary/total-unknown-processor-payments
(or (ffirst (dc/q '[:find (sum ?total)
:with ?c
:in $ [?clients ?start-date ?end-date]
:where [(iol-ion.query/scan-sales-orders $ ?clients ?start-date ?end-date) [[?e _ ?sort-default] ...]]
[?e :sales-order/charges ?c]
[?c :charge/type-name "OTHER"]
[?c :charge/processor :ccp-processor/na]
[?c :charge/total ?total]]
(dc/db conn)
[[c] date date]))
0.0)
:sales-summary/total-card-fees
(or (ffirst (dc/q '[:find ?f
:in $ ?client ?d
@@ -250,10 +262,24 @@
(dc/q '[:find (pull ?sos [* {:sales-summary/sales-items [*]}])
:in $
:where [?sos :sales-summary/client [:client/code "NGCL"]]
:where [?sos :sales-summary/client [:client/code "NGHW"]]
[?sos :sales-summary/date ?d]
[(= ?d #inst "2024-03-25T00:00:00-07:00")]]
(dc/db conn)))
[(= ?d #inst "2024-04-10T00:00:00-07:00")]]
(dc/db conn))
(dc/q '[:find ?n ?p2 (sum ?total)
:with ?c
:in $ [?clients ?start-date ?end-date]
:where [(iol-ion.query/scan-sales-orders $ ?clients ?start-date ?end-date) [[?e _ ?sort-default] ...]]
[?e :sales-order/charges ?c]
[?c :charge/type-name ?n]
[?c :charge/processor ?p]
[?p :db/ident ?p2]
[?c :charge/total ?total]]
(dc/db conn)
[[(auto-ap.datomic/pull-attr (dc/db conn) :db/id [:client/code "NGHW"])] #inst "2024-04-11T00:00:00-07:00" #inst "2024-04-11T00:00:00-07:00"])
)