Last active
July 25, 2019 18:33
-
-
Save debajyoti-thetaonelab/9011c824a8f30b529c2b6ac579efa28e to your computer and use it in GitHub Desktop.
Effective sql when a BankCollectionRemitter search receipts. Please check the parameter values
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; |
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 | |
| ih.instrumentamount AS INSTRUMENTMAOUNT, | |
| date(ch.RECEIPTDATE) AS RECEIPTDATE, | |
| ch.RECEIPTNUMBER AS RECEIPTNUMBER, | |
| ih.INSTRUMENTNUMBER AS INSTRUMENTNUMBER, | |
| ih.INSTRUMENTDATE AS INSTRUMENTDATE, | |
| sd.NAME AS SERVICENAME, | |
| it.TYPE AS INSTRUMENTTYPE, | |
| fnd.name AS FUNDNAME, | |
| dpt.name AS DEPARTMENTNAME, | |
| fnd.code AS FUNDCODE, | |
| dpt.code AS DEPARTMENTCODE, | |
| ih.ID AS INSTRUMENTID, | |
| ih.BANKBRANCHNAME AS bankbranchname, | |
| bank.NAME AS bankname, | |
| us. "name" AS APPROVERNAME | |
| FROM | |
| EGCL_COLLECTIONHEADER ch, | |
| EGF_INSTRUMENTHEADER ih, | |
| EGCL_COLLECTIONINSTRUMENT ci, | |
| EGCL_SERVICEDETAILS sd, | |
| eg_user us, | |
| EGF_INSTRUMENTTYPE it, | |
| EGCL_COLLECTIONMIS cm, | |
| FUND fnd, | |
| EG_DEPARTMENT dpt, | |
| BANK bank | |
| WHERE | |
| 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 ih.BANKID = bank.ID | |
| AND sd.code in('PT') | |
| AND fnd.code in('01') | |
| AND it.TYPE in('cheque', 'dd') | |
| AND ih.ID_STATUS = ( | |
| SELECT | |
| id | |
| FROM | |
| egw_status | |
| WHERE | |
| moduletype = 'Instrument' | |
| AND description = 'New') | |
| AND ih.ISPAYCHEQUE = '0' | |
| AND ch.STATUS in( | |
| SELECT | |
| id FROM egw_status | |
| WHERE | |
| moduletype = 'ReceiptHeader' | |
| AND code in('APPROVED', 'PARTIAL_REMITTED')) | |
| 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 | |
| ORDER BY | |
| RECEIPTDATE, bankname; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment