Created
July 25, 2019 18:21
-
-
Save debajyoti-thetaonelab/2520188a08d6c058f9fde1a4c3f58105 to your computer and use it in GitHub Desktop.
Effective sql when a BankCollectionRemitter search receipts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| sum(ih.instrumentamount) AS INSTRUMENTMAOUNT, | |
| date(ch.RECEIPTDATE) AS RECEIPTDATE, | |
| sd.NAME AS SERVICENAME, | |
| it.TYPE AS INSTRUMENTTYPE, | |
| fnd.name AS FUNDNAME, | |
| dpt.name AS DEPARTMENTNAME, | |
| fnd.code AS FUNDCODE, | |
| dpt.code AS DEPARTMENTCODE, | |
| us.name AS APPROVERNAME, | |
| us.id AS APPROVERID | |
| FROM | |
| EGCL_COLLECTIONHEADER ch, | |
| EGF_INSTRUMENTHEADER ih, | |
| EGCL_COLLECTIONINSTRUMENT ci, | |
| EGCL_SERVICEDETAILS sd, | |
| EGF_INSTRUMENTTYPE it, | |
| EGCL_COLLECTIONMIS cm, | |
| FUND fnd, | |
| EG_DEPARTMENT dpt, | |
| eg_user us | |
| WHERE | |
| us.id = ch.lastmodifiedby | |
| AND ch.id = cm.collectionheader | |
| AND fnd.id = cm.fund | |
| AND dpt.id = cm.department | |
| AND ci.INSTRUMENTHEADER = ih.ID | |
| AND ch.SERVICEDETAILS = sd.ID | |
| AND ch.ID = ci.COLLECTIONHEADER | |
| AND ih.INSTRUMENTTYPE = it.ID | |
| AND sd.code in('PT') | |
| AND fnd.code in('01') | |
| AND it.TYPE in('cash') | |
| AND ih.ID_STATUS = ( | |
| SELECT | |
| id | |
| FROM | |
| egw_status | |
| WHERE | |
| moduletype = 'Instrument' | |
| AND description = 'New') | |
| AND ih.ISPAYCHEQUE = '0' | |
| AND ch.STATUS = ( | |
| SELECT | |
| id | |
| FROM | |
| egw_status | |
| WHERE | |
| moduletype = 'ReceiptHeader' | |
| AND code = 'APPROVED') | |
| AND ch.source = 'SYSTEM' | |
| AND date(ch.receiptdate) BETWEEN '2019-04-01 00:00:00.0' | |
| AND '2020-03-31 00:00:00.0' | |
| AND cm.depositedbranch = 4 | |
| GROUP BY | |
| date(ch.RECEIPTDATE), | |
| sd.NAME, | |
| it.TYPE, | |
| fnd.name, | |
| dpt.name, | |
| fnd.code, | |
| dpt.code, | |
| ch.lastmodifiedby, | |
| us.name, | |
| us.id | |
| ORDER BY | |
| RECEIPTDATE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment