/
pt-reports.yml
1623 lines (1604 loc) · 52.8 KB
/
pt-reports.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
ReportDefinitions:
- reportName: ReceiptRegister
summary: Receipt Register
version: 1.0.0
moduleName: rainmaker-pt
sourceColumns:
- name: tenantid
label: reports.pt.tenantid
type: string
source: pt
total: false
- name: propertyid
label: reports.pt.propertyid
type: string
source: pt
total: false
- name: receiptnumber
label: reports.pt.receiptnumber
type: string
source: pt
total: false
- name: receiptdate
label: reports.pt.receiptdate
type: string
source: pt
total: false
- name: paymentmode
label: reports.pt.paymentmode
type: string
source: pt
total: false
- name: transactionnumber
label: reports.pt.transactionnumber
type: string
source: pt
total: false
- name: interest
label: reports.pt.interest
type: string
source: pt
total: true
- name: penalty
label: reports.pt.penalty
type: string
source: pt
total: true
- name: swatchathatax
label: reports.pt.swatchatatax
type: string
source: pt
total: true
- name: propertytax
label: reports.pt.propertytax
type: string
source: pt
total: true
- name: totalcollection
label: reports.pt.totalcollection
type: string
source: pt
total: true
- name: collectorname
label: reports.pt.collectorname
type: string
source: pt
total: false
- name: mohallaname
label: reports.pt.mohallaname
type: string
source: pt
total: false
- name: doorno
label: reports.pt.doorno
type: string
source: pt
total: false
- name: ownername
label: reports.pt.ownername
type: string
source: pt
total: false
searchParams:
- name: fromDate
label: reports.pt.fromDate
type: epoch
source: pt
isMandatory: false
searchClause: AND pd.receiptdate >= $fromDate
- name: toDate
label: reports.pt.toDate
type: epoch
source: pt
isMandatory: false
searchClause: AND pd.receiptdate <= $toDate
- name: paymentMode
label: Payment Mode
type: singlevaluelist
pattern: 'list://CASH:CASH,ONLINE:ONLINE,CARD:CARD,DD:DD,CHEQUE:CHEQUE,POS:POS,NEFT:NEFT,RTGS:RTGS'
source: pt
isMandatory: false
searchClause: AND trim(SUBSTRING(paymentmode , position('_' in paymentmode)+1,LENGTH(paymentmode))) = $paymentMode
- name: collectorname
label: Collector Name
type: singlevaluelist
pattern: http://egov-hrms:8080/egov-hrms/employees/_search?tenantId=$tenantid&roles=PTCEMP|$.Employees[*].user.id|$.Employees[*].user.name
source: pt
wrapper: true
isMandatory: false
searchClause: AND un.id = $collectorname::INTEGER
query: |
select initcap(split_part(pay.tenantid, '.', 2)) as tenantid,
bill.consumercode as propertyid,
pd.receiptnumber as receiptnumber,
To_char(To_timestamp(pd.receiptdate/1000 ), 'DD/MM/YYYY') AS receiptdate,
pay.paymentmode as paymentmode,
pay.transactionnumber as transactionnumber,
SUM(CASE WHEN taxheadcode LIKE 'PT_TIME_INTEREST%' THEN bad.amount ELSE 0 END) as interest,
SUM(CASE WHEN taxheadcode LIKE 'PT_TIME_PENALTY%' or taxheadcode LIKE 'PT_LATE_ASSESSMENT_PENALTY' THEN bad.amount ELSE 0 END) as penalty,
SUM(CASE WHEN taxheadcode LIKE 'SWATCHATHA_TAX%' THEN bad.amount ELSE 0 END) as swatchathatax,
SUM(CASE WHEN taxheadcode LIKE 'PT_TAX%' or taxheadcode like 'PT_TIME_REBATE' or taxheadcode like 'PT_PROMOTIONAL_REBATE' THEN bad.amount ELSE 0 END) as propertytax,
pd.amountpaid as totalcollection,
un.name as collectorname,
msg.message as mohallaname,
addr.doorno as doorno,
eu.name as ownername
from egcl_payment pay,
egcl_paymentdetail pd,
egcl_bill bill,
egcl_billdetial bd,
egcl_billaccountdetail bad,
eg_user un,
eg_pt_address addr,
eg_user eu,
message msg,
eg_pt_property pt
where pd.paymentid= pay.id and
pd.billid=bill.id and
bd.billid=bill.id and
bad.billdetailid=bd.id and
pay.createdby=CAST(un.id as varchar) and
addr.propertyid=pt.id and
pt.propertyid=bill.consumercode and
RIGHT(msg.code,5)=addr.locality and
msg.tenantid=pay.tenantid and
eu.uuid=(select poo.userid from eg_pt_owner poo where poo.propertyid=pt.id and poo.tenantid = $tenantid fetch first 1 row only) and
msg.locale='hi_IN' and
pay.tenantid LIKE $tenantid and
pd.businessservice='PT'and
pay.paymentstatus != 'CANCELLED' AND pay.tenantid != 'uk.testing'
groupby: GROUP BY pay.tenantid,pd.receiptnumber,bill.consumercode,pd.receiptdate,pay.transactionnumber,pay.paymentmode,un.name,msg.message,addr.doorno,eu.name,pd.amountpaid
- reportName: ReceiptRegister_v1
summary: Receipt Register
version: 1.0.0
moduleName: rainmaker-pt
sourceColumns:
- name: tenantid
label: reports.pt.tenantid
type: string
source: pt
total: false
- name: propertyid
label: reports.pt.propertyid
type: string
source: pt
total: false
- name: receiptnumber
label: reports.pt.receiptnumber
type: string
source: pt
total: false
- name: receiptdate
label: reports.pt.receiptdate
type: string
source: pt
total: false
- name: paymentmode
label: reports.pt.paymentmode
type: string
source: pt
total: false
- name: transactionnumber
label: reports.pt.transactionnumber
type: string
source: pt
total: false
- name: interest
label: reports.pt.interest
type: string
source: pt
total: true
- name: penalty
label: reports.pt.penalty
type: string
source: pt
total: true
- name: swatchathatax
label: reports.pt.swatchatatax
type: string
source: pt
total: true
- name: propertytax
label: reports.pt.propertytax
type: string
source: pt
total: true
- name: totalcollection
label: reports.pt.totalcollection
type: string
source: pt
total: true
- name: collectorname
label: reports.pt.collectorname
type: string
source: pt
total: false
- name: mohallaname
label: reports.pt.mohallaname
type: string
source: pt
total: false
- name: doorno
label: reports.pt.doorno
type: string
source: pt
total: false
- name: ownername
label: reports.pt.ownername
type: string
source: pt
total: false
searchParams:
- name: fromDate
label: reports.pt.fromDate
type: epoch
source: pt
isMandatory: false
searchClause: AND pd.receiptdate >= $fromDate
- name: toDate
label: reports.pt.toDate
type: epoch
source: pt
isMandatory: false
searchClause: AND pd.receiptdate <= $toDate
- name: paymentMode
label: Payment Mode
type: singlevaluelist
pattern: 'list://CASH:CASH,Online:Online,CARD:CARD,DD:DD,CHEQUE:CHEQUE,POS:POS,NEFT:NEFT,RTGS:RTGS'
source: pt
isMandatory: false
searchClause: AND paymentmode = $paymentMode
- name: collectorname
label: Collector Name
type: singlevaluelist
pattern: http://egov-hrms:8080/egov-hrms/employees/_search?tenantId=$tenantid&roles=PTCEMP|$.Employees[*].user.id|$.Employees[*].user.name
source: pt
wrapper: true
isMandatory: false
searchClause: AND un.id = $collectorname::INTEGER
query: |
select initcap(split_part(pay.tenantid, '.', 2)) as tenantid,
bill.consumercode as propertyid,
pd.receiptnumber as receiptnumber,
To_char(To_timestamp(pd.receiptdate/1000 ), 'DD/MM/YYYY') AS receiptdate,
pay.paymentmode as paymentmode,
pay.transactionnumber as transactionnumber,
SUM(CASE WHEN taxheadcode LIKE 'PT_TIME_INTEREST%' THEN bad.amount ELSE 0 END) as interest,
SUM(CASE WHEN taxheadcode LIKE 'PT_TIME_PENALTY%' or taxheadcode LIKE 'PT_LATE_ASSESSMENT_PENALTY' THEN bad.amount ELSE 0 END) as penalty,
SUM(CASE WHEN taxheadcode LIKE 'SWATCHATHA_TAX%' THEN bad.amount ELSE 0 END) as swatchathatax,
SUM(CASE WHEN taxheadcode LIKE 'PT_TAX%' or taxheadcode like 'PT_TIME_REBATE' or taxheadcode like 'PT_PROMOTIONAL_REBATE' THEN bad.amount ELSE 0 END) as propertytax,
(SUM(CASE WHEN taxheadcode LIKE 'PT_TIME_INTEREST' THEN bad.amount ELSE 0 END) + SUM(CASE WHEN taxheadcode LIKE 'PT_TIME_PENALTY%' or taxheadcode LIKE 'PT_LATE_ASSESSMENT_PENALTY' THEN bad.amount ELSE 0 END) +SUM(CASE WHEN taxheadcode LIKE 'SWATCHATHA_TAX' THEN bad.amount ELSE 0 END) +SUM(CASE WHEN taxheadcode LIKE 'PT_TAX' or taxheadcode like 'PT_TIME_REBATE' or taxheadcode like 'PT_PROMOTIONAL_REBATE' THEN bad.amount ELSE 0 END) ) as totalcollection,
un.name as collectorname,
msg.message as mohallaname,
addr.doorno as doorno,
eu.name as ownername
from egcl_payment pay,
egcl_paymentdetail pd,
egcl_bill bill,
egcl_billdetial bd,
egcl_billaccountdetail bad,
eg_user un,
eg_pt_address_v2 addr,
eg_user eu,
message msg
where pd.paymentid= pay.id and
pd.billid=bill.id and
bd.billid=bill.id and
bad.billdetailid=bd.id and
pay.createdby=CAST(un.id as varchar) and
addr.property=bill.consumercode and
RIGHT(msg.code,5)=addr.locality and
msg.tenantid=pay.tenantid and
eu.uuid=(select poo.userid from eg_pt_owner_v2 poo where poo.propertydetail=(select pdd.assessmentnumber from eg_pt_propertydetail_v2 pdd where pdd.property= bill.consumercode fetch first 1 row only) fetch first 1 row only) and
msg.locale='hi_IN' and
pay.tenantid LIKE $tenantid and
pd.businessservice='PT'and
pay.paymentstatus != 'CANCELLED' AND pay.tenantid != 'uk.testing'
groupby: GROUP BY pay.tenantid,pd.receiptnumber,bill.consumercode,pd.receiptdate,pay.transactionnumber,pay.paymentmode,un.name,msg.message,addr.doorno,eu.name
- reportName: CancelledReceiptRegister
summary: Receipt Register for cancelled Receipts
version: 1.0.0
moduleName: rainmaker-pt
sourceColumns:
- name: tenantid
label: reports.pt.tenantid
type: string
source: pt
total: false
- name: propertyid
label: reports.pt.propertyid
type: string
source: pt
total: false
- name: receiptnumber
label: reports.pt.receiptnumber
type: string
source: pt
total: false
- name: receiptdate
label: reports.pt.receiptdate
type: string
source: pt
total: false
- name: paymentmode
label: reports.pt.paymentmode
type: string
source: pt
total: false
- name: transactionnumber
label: reports.pt.transactionnumber
type: string
source: pt
total: false
- name: interest
label: reports.pt.interest
type: string
source: pt
total: false
- name: penalty
label: reports.pt.penalty
type: string
source: pt
total: false
- name: swatchathatax
label: reports.pt.swatchatatax
type: string
source: pt
total: false
- name: propertytax
label: reports.pt.propertytax
type: string
source: pt
total: false
- name: totalcollection
label: reports.pt.totalcollection
type: string
source: pt
total: false
searchParams:
- name: fromDate
label: reports.pt.fromDate
type: epoch
source: pt
isMandatory: false
searchClause: AND pd.receiptdate >= $fromDate
- name: toDate
label: reports.pt.toDate
type: epoch
source: pt
isMandatory: false
searchClause: AND pd.receiptdate <= $toDate
- name: paymentMode
label: Payment Mode
type: singlevaluelist
pattern: 'list://CASH:CASH,ONLINE:ONLINE,CARD:CARD,DD:DD,CHEQUE:CHEQUE'
source: pt
isMandatory: false
searchClause: AND paymentmode = $paymentMode
query: |
select initcap(split_part(pay.tenantid, '.', 2)) as tenantid,
bill.consumercode as propertyid,
pd.receiptnumber as receiptnumber,
To_char(To_timestamp(pd.receiptdate/1000 ), 'DD/MM/YYYY') AS receiptdate,
pay.paymentmode as paymentmode,
pay.transactionnumber as transactionnumber,
SUM(CASE WHEN taxheadcode LIKE 'PT_TIME_INTEREST%' THEN bad.amount ELSE 0 END) as interest,
SUM(CASE WHEN taxheadcode LIKE 'PT_TIME_PENALTY%' THEN bad.amount ELSE 0 END) as penalty,
SUM(CASE WHEN taxheadcode LIKE 'SWATCHATHA_TAX%' THEN bad.amount ELSE 0 END) as swatchathatax,
SUM(CASE WHEN taxheadcode LIKE 'PT_TAX%' THEN bad.amount ELSE 0 END) as propertytax,
(SUM(CASE WHEN taxheadcode LIKE 'PT_TIME_INTEREST' THEN bad.amount ELSE 0 END) + SUM(CASE WHEN taxheadcode LIKE 'PT_TIME_PENALTY%' THEN bad.amount ELSE 0 END) +SUM(CASE WHEN taxheadcode LIKE 'SWATCHATHA_TAX' THEN bad.amount ELSE 0 END) +SUM(CASE WHEN taxheadcode LIKE 'PT_TAX' THEN bad.amount ELSE 0 END) ) as totalcollection
from egcl_payment pay,
egcl_paymentdetail pd,
egcl_bill bill,
egcl_billdetial bd,
egcl_billaccountdetail bad
where pd.paymentid= pay.id and
pd.billid=bill.id and
bd.billid=bill.id and
bad.billdetailid=bd.id and
pay.tenantid LIKE $tenantid and
pd.businessservice='PT'and
pay.paymentstatus = 'CANCELLED' AND pay.tenantid != 'uk.testing'
groupby: GROUP BY pay.tenantid,pd.receiptnumber,bill.consumercode,pd.receiptdate,pay.transactionnumber,pay.paymentmode
- reportName: OldUlbWisePtCollection
summary: ULB-wise PT Collection
version: 1.0.0
moduleName: rainmaker-pt
sourceColumns:
- name: totalassessments
label: reports.pt.totalassessments
type: string
source: pt
total: true
- name: totalamountpaid
label: reports.pt.totalamountpaid
type: string
source: pt
total: true
- name: totalamountdue
label: reports.pt.totalamountdue
type: string
source: pt
total: true
searchParams:
- name: financialyear
label: Financial Year
type: singlevaluelist
pattern: http://egov-mdms-service:8080/egov-mdms-service/v1/_get?tenantId=$tenantid&moduleName=egf-master&masterName=FinancialYear|$.MdmsRes.egf-master.FinancialYear.[?(@.module=='PT')].code|$.MdmsRes.egf-master.FinancialYear.[?(@.module=='PT')].name
source: pt
wrapper: true
isMandatory: false
searchClause: AND financialyear = $financialyear
- name: usage
label: Usage
type: singlevaluelist
pattern: http://egov-mdms-service:8080/egov-mdms-service/v1/_get?tenantId=$tenantid&moduleName=PropertyTax&masterName=UsageCategoryMajor|$..code|$..name
source: pt
wrapper: true
isMandatory: false
searchClause: AND usagecategorymajor = $usage
query: |
SELECT
tenantid,
COUNT(*) AS totalassessments,
SUM(totalamount) AS totalamount,
SUM(amount) AS totalamountpaid,
(SUM(totalamount) - SUM(amount)) AS totalamountdue
FROM eg_pt_propertydetail_v2 AS pd
LEFT OUTER JOIN
(SELECT consumercode, totalamount, amount FROM egcl_receiptheader AS rh
LEFT OUTER JOIN egcl_receiptinstrument AS ri ON rh.id = ri.receiptheader
LEFT OUTER JOIN egcl_instrumentheader AS ih ON ri.instrumentheader = ih.id
and ih.instrumentstatus != 'CANCELLED'
where rh.status != 'Cancelled'
) AS instrument_data ON CONCAT(pd.property, ':', pd.assessmentnumber) = instrument_data.consumercode
WHERE tenantid = $tenantid AND tenantid != 'uk.testing'
groupby: GROUP BY tenantid
orderby: ORDER BY tenantid, totalamountpaid DESC NULLS LAST
- reportName: StateCancelledReceiptRegister
summary: Receipt Register for cancelled Receipts State
version: 1.0.0
moduleName: rainmaker-pt
sourceColumns:
- name: tenantid
label: reports.pt.ulbName
type: string
source: pt
total: false
- name: receiptnumber
label: reports.pt.receiptNo
type: string
source: pt
total: false
- name: status
label: reports.pt.status
type: string
source: pt
total: false
- name: transactiondate
label: reports.pt.receiptDate
type: string
source: pt
total: false
- name: g8issuedate
label: reports.pt.g8issuedate
type: string
source: pt
total: false
- name: g8receiptno
label: reports.pt.g8receiptno
type: string
source: pt
total: false
- name: amount
label: reports.pt.amount
type: string
source: pt
total: true
- name: propertytax
label: reports.pt.propertyTax
type: string
source: pt
total: true
- name: firecess
label: reports.pt.fireCess
type: string
source: pt
total: true
- name: cancercess
label: reports.pt.cancerCess
type: string
source: pt
total: true
- name: rebate
label: reports.pt.rebate
type: string
source: pt
total: true
- name: adhocrebate
label: reports.pt.adhocrebate
type: string
source: pt
total: true
- name: penalty
label: reports.pt.penalty
type: string
source: pt
total: true
- name: adhocpenalty
label: reports.pt.adhocpenalty
type: string
source: pt
total: true
- name: interest
label: reports.pt.interest
type: string
source: pt
total: true
- name: exemption
label: reports.pt.exemption
type: string
source: pt
total: true
- name: adjusment
label: reports.pt.roundoff
type: string
source: pt
total: true
- name: propertyid
label: reports.pt.propertyId
type: string
source: pt
total: false
- name: usagetype
label: reports.pt.usagetype
type: string
source: pt
total: false
- name: assessmentnumber
label: reports.pt.assessmentNo
type: string
source: pt
total: false
- name: financialyear
label: reports.pt.financialYear
type: string
source: pt
total: false
- name: instrumenttype
label: reports.pt.paymentMode
type: string
source: pt
total: false
- name: transactionnumber
label: reports.pt.ddChequeTransactionNo
type: string
source: pt
total: false
- name: bankname
label: reports.pt.bankName
type: string
source: pt
total: false
searchParams:
- name: fromDate
label: reports.pt.fromDate
type: epoch
source: pt
isMandatory: false
searchClause: AND rh.receiptdate >= $fromDate
- name: toDate
label: reports.pt.toDate
type: epoch
source: pt
isMandatory: false
searchClause: AND rh.receiptdate <= $toDate
- name: paymentMode
label: Payment Mode
type: singlevaluelist
pattern: 'list://CASH:CASH,Online:Online,CARD:CARD,DD:DD,CHEQUE:CHEQUE'
source: pt
isMandatory: false
searchClause: AND instrumenttype = $paymentMode
- name: financialyear
label: Financial Year
type: singlevaluelist
pattern: http://egov-mdms-service:8080/egov-mdms-service/v1/_get?tenantId=$tenantid&moduleName=egf-master&masterName=FinancialYear|$.MdmsRes.egf-master.FinancialYear.[?(@.module=='PT')].code|$.MdmsRes.egf-master.FinancialYear.[?(@.module=='PT')].name
source: pt
wrapper: true
isMandatory: false
searchClause: AND financialyear = $financialyear
query: |
-- Use CTE to force query plan, compute & use CTE later
WITH receipt_breakup AS (
SELECT
receiptheader,
SUM(CASE WHEN description LIKE 'PT_ADHOC_PENALTY%' THEN cramount ELSE 0 END) as adhocpenalty,
SUM(CASE WHEN description LIKE 'PT_ADHOC_PENALTY%' THEN -dramount ELSE 0 END) as adhocrebate,
SUM(CASE WHEN description LIKE 'PT_FIRE_CESS%' THEN cramount ELSE 0 END) as firecess,
SUM(CASE WHEN description LIKE 'PT_FIRE_CESS%' THEN cramount ELSE 0 END) as firecess,
SUM(CASE WHEN description LIKE 'PT_CANCER_CESS%' THEN cramount ELSE 0 END) as cancercess, SUM(CASE WHEN description LIKE 'PT_TIME_INTEREST%' THEN cramount ELSE 0 END) as interest, SUM(CASE WHEN description LIKE 'PT_TIME_PENALTY%' THEN cramount ELSE 0 END) as penalty,
SUM(CASE WHEN description LIKE 'PT_TIME_REBATE%' THEN -dramount ELSE 0 END) as rebate,
(SUM(CASE WHEN description LIKE 'PT_TAX%' THEN cramount ELSE 0 END)
+ SUM(CASE WHEN description LIKE 'PT_DECIMAL_CEILING_DEBIT%' THEN dramount ELSE 0 END))
as propertytax,
SUM(CASE WHEN description LIKE 'PT_UNIT_USAGE_EXEMPTION%' THEN -dramount ELSE 0 END) as exemption,
(SUM(CASE WHEN description LIKE 'PT_DECIMAL_CEILING_CREDIT%' THEN cramount ELSE 0 END)
- SUM(CASE WHEN description LIKE 'PT_DECIMAL_CEILING_DEBIT%' THEN dramount ELSE 0 END)) as adjusment
FROM egcl_receiptdetails
WHERE tenantid != 'uk.testing'
GROUP BY receiptheader
)
SELECT
initcap(split_part(rh.tenantid, '.', 2)) as tenantid,
rh.id,
Substring(rh.consumercode, '(.*):') AS propertyid,
Substring(rh.consumercode, ':(.*)') AS assessmentnumber,
rh.status,
rh.consumercode,
rh.receiptdate,
To_char(To_timestamp(rh.receiptdate / 1000), 'DD/MM/YYYY') AS transactiondate,
bankid AS bankname,
receiptnumber,
amount,
instrumenttype,
transactionnumber,
receipt_breakup.*,
pt_detail.financialyear,
To_char(To_timestamp(rh.manualreceiptdate / 1000), 'DD/MM/YYYY') AS g8issuedate,
Initcap(COALESCE(pt_detail.usagecategoryminor, pt_detail.usagecategorymajor)) as usagetype,
manualreceiptnumber as g8receiptno
FROM egcl_receiptheader AS rh
JOIN egcl_receiptinstrument AS ri ON rh.id = ri.receiptheader
JOIN egcl_instrumentheader AS ih ON ih.id = ri.instrumentheader
JOIN receipt_breakup ON rh.id = receipt_breakup.receiptheader
JOIN eg_pt_propertydetail_v2 pt_detail ON CONCAT(pt_detail.property, ':', pt_detail.assessmentnumber) = rh.consumercode
JOIN eg_pt_address_v2 pt_addr ON pt_detail.property = pt_addr.property
WHERE rh.tenantid != 'uk.testing' and rh.status = 'Cancelled'
orderby: ORDER BY rh.receiptdate DESC
- reportName: StateWidePtCollection
summary: State Wide PT Collection
version: 1.0.0
moduleName: rainmaker-pt
sourceColumns:
- name: tenantid
label: reports.pt.ulbName
type: string
source: pt
total: false
- name: totalassessments
label: reports.pt.totalassessments
type: string
source: pt
total: true
- name: totalamountpaid
label: reports.pt.totalamountpaid
type: string
source: pt
total: true
- name: totaloffline
label: reports.pt.totaloffline
type: string
source: pt
total: true
- name: totalonline
label: reports.pt.totalonline
type: string
source: pt
total: true
- name: totalamountdue
label: reports.pt.totalamountdue
type: string
source: pt
total: true
searchParams:
- name: fromDate
label: reports.pt.fromDate
type: epoch
source: pt
isMandatory: false
searchClause: AND receiptdate >= $fromDate
- name: toDate
label: reports.pt.toDate
type: epoch
source: pt
isMandatory: false
searchClause: AND receiptdate <= $toDate
- name: ulb
label: ULB
type: singlevaluelist
pattern: http://egov-mdms-service:8080/egov-mdms-service/v1/_get?tenantId=$tenantid&moduleName=tenant&masterName=tenants|$.MdmsRes.tenant.tenants.*.code|$.MdmsRes.tenant.tenants.*.name
source: pt
wrapper: true
isMandatory: false
searchClause: AND tenantid = $ulb
- name: financialyear
label: Financial Year
type: singlevaluelist
pattern: http://egov-mdms-service:8080/egov-mdms-service/v1/_get?tenantId=$tenantid&moduleName=egf-master&masterName=FinancialYear|$.MdmsRes.egf-master.FinancialYear.[?(@.module=='PT')].code|$.MdmsRes.egf-master.FinancialYear.[?(@.module=='PT')].name
source: pt
wrapper: true
isMandatory: false
searchClause: AND financialyear = $financialyear
- name: usage
label: Usage
type: singlevaluelist
pattern: http://egov-mdms-service:8080/egov-mdms-service/v1/_get?tenantId=$tenantid&moduleName=PropertyTax&masterName=UsageCategoryMajor|$..code|$..name
source: pt
wrapper: true
isMandatory: false
searchClause: AND usagecategorymajor = $usage
query: |
SELECT
initcap(split_part(tenantid, '.', 2)) as tenantid,
COUNT(*) AS totalassessments,
SUM(totalamount) AS totalamount,
SUM(amount) AS totalamountpaid,
SUM(CASE WHEN collectiontype LIKE 'ONLINE' THEN amount ELSE 0 END) AS totalonline,
SUM(CASE WHEN collectiontype LIKE 'COUNTER' THEN amount ELSE 0 END) AS totaloffline,
(SUM(totalamount) - SUM(amount)) AS totalamountdue
FROM eg_pt_propertydetail_v2 AS pd
LEFT OUTER JOIN (SELECT consumercode, totalamount, amount, collectiontype, receiptdate FROM egcl_receiptheader AS rh
LEFT OUTER JOIN egcl_receiptinstrument AS ri ON rh.id = ri.receiptheader
LEFT OUTER JOIN egcl_instrumentheader AS ih ON ri.instrumentheader = ih.id and ih.instrumentstatus != 'CANCELLED'
where rh.status != 'Cancelled'
) AS tbl_amounts ON CONCAT(pd.property, ':', pd.assessmentnumber) = tbl_amounts.consumercode
WHERE tenantid LIKE CONCAT(SPLIT_PART($tenantid, '.', 1), '%') and tenantid != 'uk.testing'
groupby: GROUP BY tenantid
orderby: ORDER BY tenantid, totalamountpaid DESC NULLS LAST
- reportName: UlbWisePtCollection
summary: State Wide PT Collection
version: 1.0.0
moduleName: rainmaker-pt
sourceColumns:
- name: totalassessments
label: reports.pt.totalassessments
type: string
source: pt
total: true
- name: totalamountpaid
label: reports.pt.totalamountpaid
type: string
source: pt
total: true
- name: totaloffline
label: reports.pt.totaloffline
type: string
source: pt
total: true
- name: totalonline
label: reports.pt.totalonline
type: string
source: pt
total: true
- name: totalamountdue
label: reports.pt.totalamountdue
type: string
source: pt
total: true
searchParams:
- name: fromDate
label: reports.pt.fromDate
type: epoch
source: pt
isMandatory: false
searchClause: AND receiptdate >= $fromDate
- name: toDate
label: reports.pt.toDate
type: epoch
source: pt
isMandatory: false
searchClause: AND receiptdate <= $toDate
- name: usage
label: Usage
type: singlevaluelist
pattern: http://egov-mdms-service:8080/egov-mdms-service/v1/_get?tenantId=$tenantid&moduleName=PropertyTax&masterName=UsageCategoryMajor|$..code|$..name
source: pt
wrapper: true
isMandatory: false
searchClause: AND split_part(usagecategory, '.', 1) = $usage
query: |
SELECT
initcap(split_part(tenantid, '.', 2)) as tenantid,
COUNT(*) AS totalassessments,
SUM(totalamount) AS totalamount,
SUM(amount) AS totalamountpaid,
SUM(CASE WHEN collectiontype LIKE 'ONLINE' THEN amount ELSE 0 END) AS totalonline,
SUM(CASE WHEN collectiontype LIKE 'COUNTER' THEN amount ELSE 0 END) AS totaloffline,
(SUM(totalamount) - SUM(amount)) AS totalamountdue
FROM eg_pt_property AS pd
LEFT OUTER JOIN (SELECT consumercode, totalamount, amount, collectiontype, receiptdate FROM egcl_receiptheader_v1 AS rh
LEFT OUTER JOIN egcl_receiptinstrument_v1 AS ri ON rh.id = ri.receiptheader
LEFT OUTER JOIN egcl_instrumentheader_v1 AS ih ON ri.instrumentheader = ih.id and ih.instrumentstatus != 'CANCELLED'
where rh.status != 'Cancelled'
) AS tbl_amounts ON pd.propertyid = tbl_amounts.consumercode
WHERE tenantid LIKE CONCAT(SPLIT_PART($tenantid, '.', 1), '%') and tenantid = $tenantid and tenantid != 'uk.testing'
groupby: GROUP BY tenantid
orderby: ORDER BY tenantid, totalamountpaid DESC NULLS LAST
- reportName: ULBPTDataDumpReport
summary: ULB level report
version: 1.0.0
moduleName: rainmaker-pt
sourceColumns:
- name: ulb
label: reports.pt.ulb
type: string
source: pt
total: false
- name: propertytaxuniqueid
label: reports.pt.propertytaxuniqueid
type: string
source: pt
total: false
- name: transcationdate
label: reports.pt.transcationdate
type: string
source: pt
total: false
- name: receiptnumber
label: reports.pt.receiptnumber
type: string
source: pt
total: false
- name: existingpropertyid
label: reports.pt.existingpropertyid
type: string
source: pt
total: false
- name: ownername
label: reports.pt.ownername
type: string
source: pt
total: false
- name: guardianname
label: reports.pt.guardianname
type: string
source: pt
total: false
- name: totalarea
label: reports.pt.totalarea
type: string
source: pt
total: false
- name: builtarea
label: reports.pt.builtarea
type: string
source: pt
total: false
- name: floors
label: reports.pt.floors
type: string
source: pt
total: false
- name: occupancy
label: reports.pt.occupancy
type: string
source: pt
total: false
- name: propertytype
label: reports.pt.propertytype
type: string
source: pt
total: false
- name: mobileno
label: reports.pt.mobileno
type: string
source: pt
total: false
- name: transcationmode
label: reports.pt.transcationmode
type: string
source: pt
total: false
- name: paymentamount
label: reports.pt.paymentamount
type: string
source: pt
total: true
- name: paymentdate
label: reports.pt.paymentdate
type: string
source: pt
total: false
- name: emailid
label: reports.pt.emailid
type: string
source: pt
total: false
- name: address
label: reports.pt.address
type: string
source: pt
total: false
searchParams:
- name: fromDate
label: reports.pt.fromDate
type: epoch
source: pt
isMandatory: false
searchClause: AND rh.receiptdate >= $fromDate
- name: toDate
label: reports.pt.toDate
type: epoch
source: pt
isMandatory: false
searchClause: AND rh.receiptdate <= $toDate
query: |
--S.no Service Name ULB Property Tax Unique ID Date Of Transcation Receipt Number Existing Property ID Owner Name Guardian Name Total Area (SQ.YARD) Covered Area/Built Area (SQ.FEET) Floors Occupancy (Rented,Self /Unoccupied) Type Of Property Mobile Number Transcation Mode of Payment Payment Amount Payment Date Email Id Address
with eg_pt_unit_v2_ot as (
select
propertydetail,
string_agg(distinct pu.occupancytype, ',') as occupancytype,
string_agg(distinct coalesce(usagecategoryminor, usagecategorymajor), ',') as propertytype
from eg_pt_unit_v2 as pu
where pu.tenantid = $tenantid AND pu.tenantid != 'uk.testing'
group by propertydetail
)
select
distinct on (rh.receiptnumber)
initcap(split_part(rh.tenantid, '.', 2)) as "ulb",
split_part(consumercode, ':', 1) as "propertytaxuniqueid",
to_timestamp(receiptdate/1000) at time zone 'Asia/Kolkata' as "transcationdate",
receiptnumber as "receiptnumber",
pt.oldpropertyid as "existingpropertyid",
eu."name" as "ownername",
eu.guardian as "guardianname",
pd.landarea as "totalarea",
pd.builduparea * 9 as "builtarea",
pd.nooffloors as "floors",
pot.occupancytype as "occupancy",
pot.propertytype as "propertytype",
eu.mobilenumber as "mobileno",
instrumenttype as "transcationmode",
ih.amount as "paymentamount",
to_timestamp(ih.transactiondate/1000) at time zone 'Asia/Kolkata' as "paymentdate",
eu.emailid as "emailid" ,
REGEXP_REPLACE(REGEXP_REPLACE(CONCAT(pta.doorno, ',', pta.addressline1, ',', pta.addressline2, ',', pta.buildingname, ',', pta.pincode), ',+', ','), '^,|,$', '') as "address"
from egcl_receiptheader as rh
inner join egcl_receiptinstrument as ri on ri.receiptheader = rh.id inner join egcl_instrumentheader as ih on ih.id = ri.instrumentheader
inner join eg_pt_property_v2 as pt on pt.propertyid = split_part(consumercode, ':', 1)
inner join eg_pt_propertydetail_v2 as pd on pd.assessmentnumber = split_part(consumercode, ':', 2)
inner join eg_pt_owner_v2 as po on po.propertydetail = pd.assessmentnumber
inner join eg_user as eu on eu.uuid = po.userid
inner join eg_pt_address_v2 as pta on pta.property = pt.propertyid
inner join eg_pt_unit_v2_ot as pot on pot.propertydetail = pd.assessmentnumber
where rh.tenantid = $tenantid AND rh.tenantid != 'uk.testing'
- reportName: DemandRegisterReport
summary: Reports for Reconcillation of data in PT
version: 1.0.0
moduleName: rainmaker-pt
sourceColumns:
- name: propertyid
label: reports.pt.PropertyId
type: string
source: pt
total: false
- name: oldpropertyid
label: reports.pt.oldPropertyId
type: string
source: pt
total: false
- name: doorno
label: reports.pt.DoorNo
type: string
source: pt
total: false
- name: mohalla
label: reports.pt.Mohallaname
type: string
source: pt
total: false