select formatId from tbl_EAI_inboundFileFormats with (nolock) where ownerId = and ownerType = and formatName = select formatId from tbl_EAI_inboundFileFormats with (nolock) where ownerId = 0 and ownerType = and formatName =

Outbound Check Request Processor

with clearingReferences as ( select rh.ownerId, rh.ownerType, rh.referenceNbr, rh.claimId, sum( rh.reconciliationAmount ) reconciliationAmount, sum( rh.altReconciliationAmount ) altReconciliationAmount from tbl_TPM_ReconciliationHistory rh with (nolock) where rh.ownerId = and rh.ownerType = group by rh.ownerId, rh.ownerType, rh.referenceNbr, rh.claimId ) select clearing.referenceNbr clearing_ref, min( cr.checkRequestId ) check_request_id, cr.checkAmount check_amount, cr.payableCode payable_vendor_id, cr.payableTo payable_to, cr.payableAddress1 payable_street_1, cr.payableAddress2 payable_street_2, cr.payableCity payable_city, cr.payableState payable_state, cr.payableZipCode payable_zipcode, cr.payableAttention payable_attention, cr.approvedBy approved_by, cr.approvedDate approved_date, cr.invoiceNumber invoice_number, cr.currencyCode currency_code, clearing.reconciliationAmount, clearing.altReconciliationAmount from tbl_TPM_CheckRequests cr with (nolock) inner join clearingReferences clearing on clearing.ownerId = cr.ownerId and clearing.ownerType = cr.ownerType and clearing.claimId = cr.claimId where cr.ownerId = and cr.ownerType = and cr.dateSent is null group by clearing.referenceNbr, cr.checkAmount, cr.payableCode, cr.payableTo, cr.payableAddress1, cr.payableAddress2, cr.payableCity, cr.payableState, cr.payableZipCode, cr.payableAttention, cr.approvedBy, cr.approvedDate, cr.invoiceNumber, cr.currencyCode, clearing.reconciliationAmount, clearing.altReconciliationAmount order by clearing_ref, check_request_id select clearing_ref, count(*) checkCount from qmd_checkRequestsToSend group by clearing_ref having count(*) > 1 select * from qmd_checkRequestsToSend where clearing_ref in ( ) select * from qmd_checkRequestsToSend where clearing_ref not in ( )

#qmd_checkRequestsToSend.recordCount# rows written to #htmleditformat( _exportFileName )#

update tbl_EAI_inboundBatches set fileName = where batchId = and ownerId = and ownerType = select ftpDirectory, ftpPassword, ftpServer, ftpUserName from tbl_EAI_InboundFTPSources where ownerId = and ownerType = and outbound = 'Y' and connectionName like '%CHECK[_]REQUESTS%' and coalesce( ftpDirectory, '' ) = and ftpServer = and ftpUserName =

#htmleditformat( _remoteFile )# sent to ftp:#htmleditformat( qmd_ftpSources.ftpUserName)#@#htmleditformat( qmd_ftpSources.ftpServer )#/#htmleditformat( qmd_ftpSources.ftpDirectory )#

update tbl_TPM_CheckRequests set dateSent = where ownerId = and ownerType = and checkRequestId in ( select distinct cr.checkRequestId from tbl_TPM_CheckRequests cr with (nolock) inner join tbl_TPM_ReconciliationHistory rh with (nolock) on rh.ownerId = cr.ownerId and rh.ownerType = cr.ownerType and rh.claimId = cr.claimId where cr.ownerId = and cr.ownerType = and rh.referenceNbr = )

#htmleditformat( listLast( _exportFileName, "\" ))# NOT sent to ftp:#htmleditformat( qmd_ftpSources.ftpUserName)#@#htmleditformat( qmd_ftpSources.ftpServer )#/#htmleditformat( qmd_ftpSources.ftpDirectory )#

#htmleditformat( listLast( _batchFilePath, "\" ) )# not sent!