select operatorId, companyName from tbl_OPR_ClientOperators with (nolock) where ownerId = and fsltablecode = and fsl_choId =
Unable to find operator for 1fs ID: #_partnerChoId#
select partnerPayableId from tbl_TPM_PartnerPayables with (nolock) where ownerId = and ownerType = and partnerId = and partnerType = 'OPR' and status = 'A' order by partnerPayableId
Unable to find payable for : #htmleditformat( qmd_partner.companyName )#
update tbl_IMPORT_OperatorClaims set fsePartnerId = , fsePartnerType = 'OPR' where ownerId = and ownerType = and eai_batchId = and fsePartnerId is null and fsePartnerType is null select fsePartnerId, fsePartnerType, claim_year, claim_month, dateFromParts( claim_year, claim_month, 1 ) as claimPeriodStart, dateAdd( day, -1, dateadd( month, 1, dateFromParts( claim_year, claim_month, 1 ))) as claimPeriodEnd, dateadd( day, 14, dateadd( month, 1, dateFromParts( claim_year, claim_month, 1 ))) as claimDate, round( sum( round( total_rebate * 10000.0, 0 ) / 10000.0 ), 2) proofOfDeliveryTotal, round( sum( extra_fee ), 2 ) adminFee, round( sum( round( total_rebate * 10000.0, 0 ) / 10000.0 ), 2 ) + round( sum( extra_fee ), 2) claimAmount from tbl_IMPORT_OperatorClaims with (nolock) where ownerId = and ownerType = and eai_batchId = and coalesce( fseSkuIdStatus, '?' ) != 'R' group by fsePartnerId, fsePartnerType, claim_year, claim_month with subClaims as ( select contract_ref, round( sum( round( total_rebate * 10000.0, 0 ) / 10000.0 ), 2 ) as subClaimAmount from tbl_IMPORT_OperatorClaims where ownerId = and ownerType = and eai_batchId = and coalesce( fseSkuIdStatus, '?' ) != 'R' group by contract_ref ) select sum( subClaimAmount ) podTotal from subClaims select claimId, claimStatus from tbl_TPM_Claims with (nolock) where ownerId = and ownerType = and partnerId = and partnerType = and claimAmount = and claimPeriodStart = and claimPeriodEnd = select coalesce( nullif( mfrabbrev_name, '' ), mfr_name ) as mfrabbrev_name from tblManufacturers with (nolock) where mfr_id = insert into tbl_TPM_Claims ( createDate, createUserId, updateDate, updateUserId, ownerId, ownerType, payeeId, partnerId, partnerType, claimInvoice, claimDate, claimRef, claimType, claimStatus, statusReasonId, claimAmount, adminFee, claimDescription, claimPeriodStart, claimPeriodEnd, pod, claimStatusComment, partnerPayableId ) values ( , 0, , 0, , , , , , , , , 'B', 'OPEN', null, , , , , , 'E', 'Operator Claim Import: #lsdateformat( now(), "MM/dd/yyyy" )#', ) update tbl_TPM_Claims set adminFee = , pod = 'E', partnerPayableId = where ownerId = and ownerType = and claimId = update tbl_IMPORT_OperatorClaims set fseClaimId = , fseClaimIdStatus = where ownerId = and ownerType = and eai_batchId = and fsePartnerId = and fsePartnerType = and claim_month = and claim_year = with matches as ( select oc.ownerId, oc.eai_batchId, oc.ownerType, oc.eai_importId, oc.eai_lineNumber, oc.operator_name, opr.companyName, opr.address, opr.city, opr.state, opr.zipcode from tbl_IMPORT_OperatorClaims oc with (nolock) inner join tbl_OPR_ClientOperators opr with (nolock) on opr.ownerId = and opr.fsltablecode = 'CHO' and opr.fsl_choId > 0 and opr.oprCompanyType = '0' and opr.mfrCustNum = oc.operator_affiliate_nbr where oc.ownerId = and oc.ownerType = and oc.eai_batchId = and nullif( oc.operator_affiliate_nbr, '' ) is not null and nullif( oc.operator_address, '' ) is null and ( nullif( oc.operator_city, '' ) is null or nullif( oc.operator_zip, '' ) is null ) ) update oc set oc.operator_address = matches.address, oc.operator_city = matches.city, oc.operator_state = matches.state, oc.operator_zip = matches.zipcode from tbl_IMPORT_OperatorClaims oc inner join matches on matches.ownerId = oc.ownerId and matches.ownerType = oc.ownerType and matches.eai_batchId = oc.eai_batchId and matches.eai_importId = oc.eai_importId and matches.eai_lineNumber = oc.eai_lineNumber where oc.ownerId = and oc.ownerType = and oc.eai_batchId = with matches as ( select oc.ownerId, oc.ownerType, oc.eai_batchId, oc.eai_importId, oc.eai_lineNUmber, opr.operatorId, opr.companyName, oc.operator_name from tbl_OPR_ClientOperators opr with (nolock) inner join tbl_CRM_Affiliations a with (nolock) on a.partnerId = opr.operatorId and a.ownerId = opr.ownerId and a.ownerType = opr.fsltablecode and a.partnerType = 'OPR' and a.orgType = 'OPR' inner join tbl_IMPORT_OperatorClaims oc with (nolock) on oc.operator_affiliate_nbr = a.partnerAffiliateNbr and oc.ownerId = a.ownerId and oc.ownerType = a.ownerType where oc.ownerId = and oc.ownerType = and oc.eai_batchId = and nullif( oc.operator_affiliate_nbr, '' ) is not null and a.orgId = ) update oc set oc.fseOperatorId = matches.operatorId from tbl_IMPORT_OperatorClaims oc inner join matches on matches.ownerId = oc.ownerId and matches.ownerType = oc.ownerType and matches.eai_batchId= oc.eai_batchId and matches.eai_lineNumber = oc.eai_LineNumber and matches.eai_importId = oc.eai_importId where oc.ownerId = and oc.ownerType = and oc.eai_batchId = with distributors as ( select distinct oc.distributor_name, mcdr.fsl_dstId from tbl_IMPORT_OperatorClaims oc with (nolock) inner join tbl_CDR_Distributors mcdr with (nolock) on mcdr.ownerId = and mcdr.fsl_tablecode = 'CHO' and mcdr.cdr_dstName = oc.distributor_name and mcdr.cdr_dstCompanyType = 'B' and mcdr.fsl_dstid > 0 where oc.eai_batchid = and oc.ownerId = and oc.ownerType = ) update oc set oc.fseDstId = distributors.fsl_dstId from tbl_IMPORT_OperatorClaims oc inner join distributors on distributors.distributor_name = oc.distributor_name where oc.eai_batchid = and oc.ownerId = and oc.ownerType = with matches as ( select oc.ownerId, oc.ownerType, oc.eai_batchId, oc.eai_importId, oc.eai_lineNumber,cdr.cdr_recordId from tbl_IMPORT_OperatorClaims oc with (nolock) inner join tbl_CDR_Distributors cdr with (nolock) on cdr.ownerId = oc.ownerId and cdr.fsl_tablecode = oc.ownerType and cdr.fsl_dstId = oc.fseDstId and cdr.cdr_dstCompanyType = 'B' where oc.eai_batchid = and oc.ownerId = and oc.ownerType = ) update oc set oc.fseCdrRecordId = matches.cdr_recordId from tbl_IMPORT_OperatorClaims oc inner join matches on matches.ownerId = oc.ownerId and matches.ownerType = oc.ownerType and matches.eai_batchId= oc.eai_batchId and matches.eai_lineNumber = oc.eai_LineNumber and matches.eai_importId = oc.eai_importId where oc.ownerId = and oc.ownerType = and oc.eai_batchId = select distinct fseClaimId from tbl_IMPORT_OperatorClaims with (nolock) where ownerId = and ownerType = and eai_batchId = and fseClaimId > 0 and fseClaimIdStatus != 'X' and 1 = 2 update tbl_IMPORT_OperatorClaims set fseEPODBatchId = where ownerId = and ownerType = and eai_batchId = and fseClaimId = insert into tbl_IMPORT_ProofOfDelivery ( ownerId, ownerType, eai_batchId, eai_lineNumber,#_childBatchAttrs.loadedColumns# ) values ( , , , , ) update tbl_EAI_inboundBatches set lineCount = where ownerId = and ownerType = and batchId = select c.claimId, c.claimDate, c.claimInvoice, c.claimAmount, c.claimPeriodStart, c.claimPeriodEnd, c.adminFee, c.claimStatus, case when oc.fseClaimIdStatus = 'A' then 'Added' when oc.fseClaimIdStatus = 'U' then 'Updated' else 'Skipped' end processingStatus, '' processingMessage, oc.fseEPODBatchId as ePODBatchId, oc.contract_ref, round( sum( oc.total_rebate ), 2 ) subClaimAmount from tbl_IMPORT_OperatorClaims oc with (nolock) inner join tbl_TPM_CLaims c with (nolock) on c.claimId= oc.fseClaimId and c.ownerId = oc.ownerId and c.ownerType = oc.ownerType where oc.eai_batchId = and oc.ownerId = and oc.ownerType = and coalesce( oc.fseSKuIdStatus, '?' ) != 'R' group by c.claimId, c.claimDate, c.claimInvoice, c.claimAmount, c.claimPeriodStart, c.claimPeriodEnd, c.claimStatus, oc.fseClaimIdStatus, oc.fseEPODBatchId, c.adminFee, oc.contract_ref select oc.fseOperatorId as fseOperatorId, oc.fseCdrRecordId as fseCdrRecordId, oc.operator_name as operator_name, oc.operator_address as operator_street, oc.operator_city as operator_city, oc.operator_state as operator_state, oc.operator_zip as operator_zip_code, oc.operator_affiliate_nbr as operator_member_id, oc.distributor_name as distributor_name, oc.item_code as mfr_item_code, oc.item_description as item_description, oc.item_qty as quantity, 'CA' as uom, case when oc.item_qty != 0 then oc.total_rebate / oc.item_qty else 0.0 end as rebate_unit_price, round( oc.total_rebate * 10000.0, 0 ) / 10000.0 as total_rebate_price, oc.contract_ref as contract_nbr, oc.contract_name as contract_description, oc.item_total_cost as total_vendor_cost, case when oc.item_qty != 0 then oc.item_total_cost / oc.item_qty else 0.0 end as vendor_cost, oc.fseSkuId, coalesce( oc.fseSkuIdStatus, '?' ) fseSkuIdStatus, oc.fseSKU from tbl_IMPORT_OperatorClaims oc with (nolock ) where oc.ownerType = and oc.ownerId = and oc.eai_batchid = and oc.fseClaimId = and coalesce( oc.fseSkuIdStatus, '?' ) != 'R'