Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Update pt-reports.yml #785

Open
wants to merge 1 commit into
base: UAT
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 57 additions & 2 deletions configs/reports/configs/pt-reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1143,9 +1143,9 @@ ReportDefinitions:
isMandatory: false
searchClause: AND p.tenantId = $ulb
query: |
select initcap(split_part(p.tenantId, '.', 2)) as tenantId, p.paymentmode ,sum(p.totalamountpaid), count(p.id)
select initcap(split_part(p.tenantId, '.', 2)) as tenantId, p.paymentmode, sum(p.totalamountpaid), count(p.id)
FROM egcl_payment p, egcl_paymentdetail pd
WHERE p.id=pd.paymentid and pd.businessservice ='PT'
WHERE p.id=pd.paymentid and pd.businessservice ='PT' and p.createdby in (select id::text from eg_user where username not in ('BBPS_ADMIN'))
groupby: GROUP BY p.tenantid, p.paymentmode
orderby: ORDER BY p.tenantId asc

Expand Down Expand Up @@ -1678,3 +1678,58 @@ ReportDefinitions:
WHERE pi.tenantid != 'uk.testing'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a single query with the UNION of both, BBPS and non-BBPS sub-queries, not as a separate report for BBPS counts.

groupby: GROUP BY tenantid
orderby: ORDER BY tenantid asc

- reportName: PTBBPSCollectionCount
reporptabel: report.state.level.pt.bbpscollection
summary: Shows the total properties and bbps collection
version: 1.0.0
moduleName: rainmaker-pt
sourceColumns:
- name: tenantId
label: reports.pt.tenantid
type: string
source: pt
total: false
- name: paymentmode
label: reports.pt.paymentmode
type: string
source: pt
total: false
- name: sum
label: reports.pt.total
type: string
source: pt
total: true
- name: count
label: reports.pt.count
type: string
source: pt
total: true
searchParams:
- name: fromDate
label: reports.pt.fromDate
type: epoch
source: pt
isMandatory: false
searchClause: AND p.lastmodifiedtime >= $fromDate
- name: toDate
label: reports.pt.toDate
type: epoch
source: pt
isMandatory: false
searchClause: AND p.lastmodifiedtime <= $toDate
- name: ulb
label: reports.pt.tenantid
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 p.tenantId = $ulb
query: |
select initcap(split_part(p.tenantId, '.', 2)) as tenantId, p.paymentmode, sum(p.totalamountpaid), count(p.id)
FROM egcl_payment p, egcl_paymentdetail pd
WHERE p.id=pd.paymentid and pd.businessservice ='PT' and p.createdby in (select id::text from eg_user where username in ('BBPS_ADMIN'))
groupby: GROUP BY p.tenantid, p.paymentmode
orderby: ORDER BY p.tenantId asc