You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
Copy file name to clipboardexpand all lines: test/src/Queries.purs
+83-1
Original file line number
Diff line number
Diff line change
@@ -680,4 +680,86 @@ group by
680
680
cntrycode
681
681
order by
682
682
cntrycode
683
-
"""
683
+
"""
684
+
685
+
q22∷String
686
+
q22 = """
687
+
select clientdetails.name as name, clientdetails.surname as surname, clientdetails.email as email,
688
+
raw.txType as txType, raw.currency as currency, sum(raw.amount) as amount, count(raw.*) as cnt from
689
+
(
690
+
691
+
select distinct
692
+
clientdetails.clientID as clientID, transactions.dateTime as dateTime, (transactions).amount as amount, (transactions).currency as currency, (transactions).txType as txType
693
+
from
694
+
`/ourcustomer/employeepositions` as employeepositions inner join
695
+
`/ourcustomer/locationpositions` as locationpositions on employeepositions.locPosID = locationpositions.`_id` inner join
696
+
`/ourcustomer/locations` as locations on locationpositions.locID = locations.`_id` inner join
697
+
`/ourcustomer/transactions` as transactions on transactions.clientID = employeepositions.clientID inner join
698
+
`/ourcustomer/clientdetails` as clientdetails on clientdetails.clientID = transactions.clientID
699
+
where locations.hideFromKpi <> true
700
+
and transactions.txType in (10, 20, 30, 40, 50, 60, 100, 110)
701
+
and transactions.dateTime >= "2017-10-01T00:00:00.000Z"
702
+
and transactions.dateTime < "2017-11-15T23:59:59.999Z"
703
+
)
704
+
as raw
705
+
inner join `/ourcustomer/clientdetails` as clientdetails on clientdetails.clientID = raw.clientID
706
+
group by clientdetails.email, clientdetails.name, clientdetails.surname, raw.txType, raw.currency
from ( ( ( `/ourcustomer/employeepositions` as employeepositions inner join `/ourcustomer/locationpositions` as locationpositions on (((employeepositions).locPosID) = ((locationpositions).`_id`)) )
713
+
inner join `/ourcustomer/locations` as locations on (((locationpositions).locID) = ((locations).`_id`)) )
714
+
inner join `/ourcustomer/transactions` as transactions on (((transactions).clientID) = ((employeepositions).clientID)) )
715
+
where (((locations).hideFromKpi) <> (true))
716
+
and transactions.txType in (50,60,100,110)
717
+
and transactions.datenumber > 20170911
718
+
"""
719
+
720
+
q24∷String
721
+
q24 = """
722
+
select total.locations_name as `Location`, total.country as `Country`,
723
+
ip.amount as `OurCustomer Pay`,
724
+
pay.amount as `Balance of Pay`,
725
+
tips.amount as `Tips`,
726
+
dailyTips.amount as `Daily Tips`,
727
+
other.amount as `Other`,
728
+
total.amount as `Total` from
729
+
730
+
(
731
+
732
+
(SELECT sum(amount) as amount, country, locations_id, locations_name from `/work/view_mandeep` where dateTime >= :start and dateTime <= :end group by locations_id, locations_name, country) as total
733
+
734
+
left join
735
+
736
+
(SELECT sum(amount) as amount, locations_id from `/work/view_mandeep` where txType = 10 and dateTime >= :start and dateTime <= :end group by locations_id) as ip
737
+
738
+
on total.locations_id = ip.locations_id
739
+
740
+
left join
741
+
742
+
(SELECT sum(amount) as amount, locations_id from `/work/view_mandeep` where txType = 20 and dateTime >= :start and dateTime <= :end group by locations_id) as pay
743
+
744
+
on pay.locations_id = total.locations_id
745
+
746
+
left join
747
+
748
+
(SELECT sum(amount) as amount, locations_id from `/work/view_mandeep` where txType = 30 and payTipsDaily != true and dateTime >= :start and dateTime <= :end group by locations_id) as tips
749
+
750
+
on tips.locations_id = total.locations_id
751
+
752
+
left join
753
+
754
+
(SELECT sum(amount) as amount, locations_id from `/work/view_mandeep` where txType = 30 and payTipsDaily = true and dateTime >= :start and dateTime <= :end group by locations_id) as dailyTips
755
+
756
+
on dailyTips.locations_id = total.locations_id
757
+
758
+
left join
759
+
760
+
(SELECT sum(amount) as amount, locations_id from `/work/view_mandeep` where txType = 40 and dateTime >= :start and dateTime <= :end group by locations_id) as other
0 commit comments