select listenerId from tbl_SYS_EventListeners where ownerId = and ownerType = and eventName = 'confirmPurchasingProfile' and listenerPath = '/mstrcfmod/TPM/workflow/listeners/confirmPurchasingProfileListener.cfm' and eventSubjectType = 'OPR' insert into tbl_SYS_EventListeners ( ownerId, ownerType, eventName, eventSubjectType, listenerPath, useTransaction ) values( , , 'confirmPurchasingProfile', 'OPR', '/mstrcfmod/TPM/workflow/listeners/confirmPurchasingProfileListener.cfm', 'N') select listenerId from tbl_SYS_EventListeners where ownerId = and ownerType = and eventName = 'updateContractedSales' and listenerPath = '/mstrcfmod/TPM/workflow/listeners/updateContractedSalesListener.cfm' and eventSubjectType = 'TCT' insert into tbl_SYS_EventListeners ( ownerId, ownerType, eventName, eventSubjectType, listenerPath, useTransaction ) values( , , 'updateContractedSales', 'TCT', '/mstrcfmod/TPM/workflow/listeners/updateContractedSalesListener.cfm', 'N' ) select ct.partnerId, ct.partnerType, ct.assignedContractNbr, ct.contractId, count( distinct cc.claimContractId ) claims from tbl_TPM_Contracts ct with (nolock) inner join tbl_TPM_Requests r with (nolock) on r.contractId = ct.contractId and r.ownerId = ct.ownerId and r.ownerType = ct.ownerType inner join tbl_TPM_ClaimContracts cc with (nolock) on cc.requestId = r.requestId and cc.ownerId = r.ownerId and cc.ownerType = r.ownerType and cc.reconciled = 'Y' inner join tbl_TPM_Claims c with (nolock) on c.claimId = cc.claimId and c.ownerId = cc.ownerId and c.ownerType = cc.ownerType where ct.ownerId = and ct.ownerType = and ct.flaggedForRecalc = 'Y' and coalesce( cc.firstDate, coalesce( cc.claimPeriodEnd, c.claimDate )) >= and ct.partnerId = and ct.partnerType = group by ct.partnerId, ct.partnerType, ct.assignedContractNbr, ct.contractId order by ct.partnerType, ct.partnerId, claims desc

#htmleditformat( assignedContractNbr )# Queued