select dstName from tbl_DST_Distributors with (nolock) where dstId = Processing Stopped
Invalid 1FS Redistributor (#_redistDstId#)
select top 1 cdr.cdr_recordId, cdr.cdr_dstName, cdr.cdr_dstCode from tbl_CDR_Distributors cdr with (nolock) where cdr.ownerId= and cdr.fsl_tablecode = and cdr.fsl_dstId = and cdr.cdr_dstcompanyType = 'R' order by fsl_mapPriority Processing Stopped
Client #htmleditformat( qmd_redistributor.dstName )# not found!
select fileFormat from tbl_EAI_inboundFileProcessors with (nolock) where fileProcessor = '/mstrQueries/utilityQueries/DataImport/Sales/invoiceHistory.cfm' and ownerId = and ownerType = Processing Stopped
Invoice History Processor not installed for client!
select distinct ship_to_customer_number, ship_to_customer_name, ship_to_city, ship_to_region, ship_to_zip_code from tbl_IMPORT_DotRedistributions with (nolock) where eai_batchId = and ownerId = and ownerType = and nullif( #_lookupColumn#, '' ) is not null and fseCdrRecordId is null select dot.fsl_dstId, dst.dstname, dst.dstaddr1, dst.dstaddr2, dst.dstcity, dst.dststate, dst.dstzip, dot.fsl_mapPriority, dot.cdr_dstCompanyType from tbl_CDR_Distributors dot with (nolock) left outer join tbl_DST_Distributors dst with (nolock) on dst.dstid = dot.fsl_dstId where dot.ownerId = and dot.fsl_tablecode = and nullif( dot.cdr_dstCode, '' ) is not null and ( dot.cdr_dstCode = or exists ( select * from tbl_CDR_DstCodes dotCodes where dotCodes.ownerId = dot.ownerId and dotCodes.ownerType = dot.fsl_tablecode and dotCodes.cdr_recordId = dot.cdr_recordId and dotCodes.cdr_dstCode = ) ) and dot.cdr_dstName = and 1 = 2 order by dot.fsl_mapPriority select cdr.fsl_dstId, cdr.cdr_recordId, cdr.cdr_dstCompanyType, cdr.cdr_specialAcctType, cdr.cdr_redistAcctFor, cdr.fsl_mapPriority from tbl_CDR_Distributors cdr with (nolock) where cdr.ownerId = and cdr.fsl_tablecode = and cdr.cdr_redistAcctFor = and cdr.cdr_dstCode like and cdr.fsl_dstId = and cdr.cdr_specialAcctType = 'RDA' and cdr.cdr_dstCompanyType = 'S' order by cdr.fsl_mapPriority select cdr.fsl_dstId, cdr.cdr_recordId, cdr.cdr_dstCompanyType, cdr.cdr_specialAcctType, cdr.cdr_redistAcctFor, cdr.fsl_mapPriority, cdr.cdr_territoryId from tbl_CDR_Distributors cdr with (nolock) where cdr.ownerId = and cdr.fsl_tablecode = and cdr.fsl_dstId = and cdr.cdr_dstCode = and cdr.cdr_dstCompanyType = 'B' order by cdr.fsl_mapPriority insert into tbl_CDR_Distributors ( ownerId, fsl_tablecode, cdr_dstCompanyType, cdr_dstCode, cdr_dstName, cdr_dstAddress1, cdr_dstAddress2, cdr_dstCity, cdr_dstState, cdr_dstZip, recordSource, cdr_territoryId, crmActive, createDate, cdr_redistAcctFor, cdr_specialAcctType, fsl_mapPriority, fsl_dstId ) values( , , 'S', , ,,,, , , , , 'N', , , 'RDA', 2, ) insert into tbl_CDR_DstCodes ( ownerId, ownerType, cdr_recordId, cdr_dstCode, cdr_dstCode_type ) values( , , , , 'M' ) select cdr.fsl_dstId, cdr.cdr_recordId, cdr.cdr_dstCompanyType, cdr.cdr_specialAcctType, cdr.cdr_redistAcctFor, cdr.fsl_mapPriority from tbl_CDR_Distributors cdr with (nolock) where cdr.ownerId = and cdr.fsl_tablecode = and cdr.cdr_recordId = update tbl_IMPORT_DotRedistributions set fseCdrRecordId = , fseDstId = where ownerId = and ownerType = and eai_batchId = and ship_to_customer_name = and ship_to_customer_number = and 1 = 2 and fseCdrRecordId is null < select ter.territoryId from tbl_TER_Territories ter with (nolock) inner join tbl_TER_TerritoryLevels lvl with (nolock) on lvl.levelId = ter.levelId and lvl.ownerId = ter.ownerId and lvl.fsl_tablecode = ter.fsl_tablecode and lvl.BrokerLevel = 1 and lvl.zipCodeMapping = 'STANDARD' inner join tbl_TER_ZipCodeLink zcl with (nolock) on zcl.territoryId = ter.territoryId inner join tbl_UT_ZipCodes_3d z3 with (nolock) on z3.zip3d_id = zcl.zip3d_id where ter.ownerId = and ter.fsl_tablecode = and z3.zipcode_3d = select top 1 territoryId, name from tbl_TER_Territories with (nolock) where levelId = ( select top 1 levelId from tbl_TER_TerritoryLevels with (nolock) where ownerId = and fsl_tablecode = and rank = 1 order by levelId ) and ownerId = and fsl_tablecode = order by territoryId select distinct cdr.cdr_recordId, cdr.cdr_dstName, cdr.cdr_dstcompanytype from tbl_CDR_Distributors cdr with (nolock) left outer join tbl_DST_Distributors dst with (nolock) on dst.dstId = cdr.fsl_dstId where cdr.ownerId = and cdr.fsl_tableCode = and cdr.cdr_dstcode = and cdr.cdr_dstCompanytype = and cdr.cdr_redistAcctFor = and cdr.cdr_specialAcctType = 'RDA' insert into tbl_CDR_Distributors ( ownerId, fsl_tablecode, cdr_dstName, cdr_dstcity, cdr_dststate, cdr_dstzip, cdr_territoryId, fsl_dstId, cdr_dstCode, cdr_dstCompanyType, recordSource , createDate, fsl_mapPriority, cdr_specialAcctType, cdr_redistAcctFor, crmActive ) values ( , , , , , , , , , 'S', 'REDIST Batch #qmd_batch.batchId# #lsdateformat( now(), "MM/DD/YYYY" )#', , 2, 'RDA', , 'Y' ) insert into tbl_CDR_DstCodes ( ownerId, ownerType, cdr_recordId, cdr_dstCode, cdr_dstCode_type ) values( , , , , 'M' ) update tbl_IMPORT_DotRedistributions set fseCdrRecordId = where ownerId = and ownerType = and eai_batchId = and ship_to_customer_name = and ship_to_customer_number = and 1 = 2 and fseCdrRecordId is null select cdr.fsl_dstId, cdr.cdr_recordId, cdr.cdr_dstCompanyType, cdr.cdr_specialAcctType, cdr.cdr_redistAcctFor, cdr.fsl_mapPriority, cdr.cdr_territoryId from tbl_CDR_DstCodes cn with (nolock) inner join tbl_CDR_Distributors cdr with (nolock) on cdr.cdr_recordId = cn.cdr_recordId and cdr.ownerId = cn.ownerId and cdr.fsl_tablecode = cn.ownerType where cn.ownerId = and cn.ownerType = and cn.cdr_dstcode = and cdr.cdr_dstCompanyType in ('B', 'O') select cdr_recordId from tbl_CDR_DstCodes with (nolock) where cdr_dstCode = and ownerId = and ownerType = select cdr_recordId from tbl_CDR_Distributors with (nolock) where cdr_dstCode = and ownerId = and fsl_tablecode = insert into tbl_CDR_Distributors ( ownerId, fsl_tablecode, cdr_dstCompanyType, cdr_dstCode, cdr_dstName, cdr_dstCity, cdr_dstState, cdr_dstZip, recordSource, cdr_territoryId, crmActive,createDate, fsl_mapPriority, fsl_dstId ) values( , , 'B', , ,, , , , , 'Y', , 1, 0 ) insert into tbl_CDR_DstCodes ( ownerId, ownerType, cdr_recordId, cdr_dstCode, cdr_dstCode_type ) values( , , , , 'M' ) select distinct ship_to_customer_number from tbl_IMPORT_DotRedistributions with (nolock) where eai_batchId = and ownerId = and ownerType = and nullif( ship_to_customer_number, '' ) is not null and fseCdrRecordId is null select top 1 cdr.cdr_recordId, cdr.fsl_dstId from tbl_CDR_Distributors cdr with (nolock) inner join tbl_DST_Distributors dst with (nolock) on dst.dstId = cdr.fsl_dstId and dst.dstParentCo = and 'DST' = '#_redistOwnerType#' where cdr.ownerId = and cdr.fsl_tablecode = and cdr.cdr_dstCompanyType = 'B' and dst.#_idCol# = and cdr.fsl_MapPriority = 1 order by cdr.cdr_recordId update tbl_IMPORT_DotRedistributions set fseCdrRecordId = , fseDstId = where ownerId = and ownerType = and eai_batchId = and ship_to_customer_number = and fseCdrRecordId is null select distinct ship_from_customer_number from tbl_IMPORT_DotRedistributions with (nolock) where eai_batchId = and ownerId = and ownerType = and nullif( ship_from_customer_number, '' ) is not null and fseCdrRecordId_shipFrom is null select top 1 cdr.cdr_recordId, cdr.fsl_dstId from tbl_CDR_Distributors cdr with (nolock) inner join tbl_DST_Distributors dst with (nolock) on dst.dstId = cdr.fsl_dstId and 'DST' = '#_redistOwnerType#' where cdr.ownerId = and cdr.fsl_tablecode = and dst.#_idCol# = and cdr.fsl_MapPriority = 1 order by cdr.cdr_recordId update tbl_IMPORT_DotRedistributions set fseCdrRecordId_shipFrom = , fseDstId_shipFrom = where ownerId = and ownerType = and eai_batchId = and ship_from_customer_number = and fseCdrRecordId_shipFrom is null select ship_to_customer_number, ship_to_customer_name, '' as dstCompanyType, '' as fsl_dstId, min( eai_lineNumber ) firstLine, count(*) lines, '' reason, sum( case_qty ) as cases, sum( lb_qty ) as lbs, sum( extended_price ) as dollars from tbl_IMPORT_DOTRedistributions where ownerId = and ownerType = and eai_batchId = and fseCdrRecordId is null group by ship_to_customer_number, ship_to_customer_name order by cases desc, lbs desc, dollars desc, lines desc select * from tbl_CDR_Distributors dot with (nolock) where dot.ownerId = and dot.fsl_tablecode = and ( dot.cdr_dstCode like or exists ( select * from tbl_CDR_DstCodes dotCodes where dotCodes.ownerId = dot.ownerId and dotCodes.ownerType = dot.fsl_tablecode and dotCodes.cdr_recordId = dot.cdr_recordId and dotCodes.cdr_dstCode like ) ) select ship_from_customer_number, ship_from_customer_name, min( eai_lineNumber ) firstLine, count(*) lines, '' reason, sum( case_qty ) as cases, sum( lb_qty ) as lbs, sum( extended_price ) as dollars from tbl_IMPORT_DOTRedistributions where ownerId = and ownerType = and eai_batchId = and fseCdrRecordId_shipFrom is null group by ship_from_customer_number, ship_from_customer_name order by cases desc, lbs desc, dollars desc, lines desc select distinct nullif( material, '' ) customerSKU from tbl_IMPORT_DOTRedistributions with (nolock) where ownerId = and ownerType = and eai_batchId = and nullif( material, '' ) is not null and fseSkuId is null select s.skuId from tbl_PRD_SKUs s with (nolock) inner join tbl_PRD_CustomerSkus cs with (nolock) on cs.ownerId = s.ownerId and cs.fsl_tablecode = s.fsl_tablecode and cs.skuId = s.skuId and cs.linkType = 'SKU' and cs.customerType in ( 'DST', 'PDST' ) where s.ownerId = and s.fsl_tablecode = and cs.customerSKU = and cs.customerId = update tbl_IMPORT_DotRedistributions set fseSkuId = where eai_batchId = and ownerId = and ownerType = and material = and fseSkuId is null update tbl_IMPORT_DOTRedistributions set material = right( coalesce( material, '' ), 5 ) where ownerId = and ownerType = and eai_batchId = and len( material ) > 5 select distinct nullif( vendor_material_number, '' ) gtin, nullif( material, '' ) sku, material_description from tbl_IMPORT_DOTRedistributions with (nolock) where ownerId = and ownerType = and eai_batchId = and ( nullif( vendor_material_number, '' ) is not null or nullif( material, '' ) is not null ) and fseSkuId is null update tbl_IMPORT_DotRedistributions set fseSkuId = where eai_batchId = and ownerId = and ownerType = and vendor_material_number = is null and material = is null and fseSkuId is null with stuff as ( select case when s.skuId is null or d.cdr_recordId is null then 'unallocated' else 'allocated' end allocationStatus, case_qty, lb_qty, extended_price from tbl_IMPORT_DotRedistributions i left outer join tbl_PRD_SKus s on s.skuId = i.fseSkuId and s.ownerId = i.ownerId and s.fsl_tablecode = i.ownerType left outer join tbl_CDR_Distributors d on d.cdr_recordId = i.fseCdrRecordId and d.ownerId = i.ownerId and d.fsl_tablecode = i.ownerType where i.eai_batchId = and i.ownerId = and i.ownerType = ) , allocated as ( select 1 as link, sum( case_qty ) as allocated_cases, sum( lb_qty ) as allocated_lbs, sum( extended_price ) as allocated_dollars, count(*) as allocated_lines from stuff where allocationStatus = 'allocated' ) , unallocated as ( select 1 as link, sum( case_qty ) as unallocated_cases, sum( lb_qty ) as unallocated_lbs, sum( extended_price ) as unallocated_dollars, count(*) as unallocated_lines from stuff where allocationStatus = 'unallocated' ) select a.allocated_cases, a.allocated_lbs, a.allocated_dollars, a.allocated_lines, u.unallocated_cases, u.unallocated_lbs, u.unallocated_dollars, u.unallocated_lines from allocated a left outer join unallocated u on u.link = a.link select distinct vendor_material_number gtin, material sku, material_description, min( eai_lineNumber ) firstLine, count(*) lines, sum( case_qty ) as cases, sum( lb_qty ) as lbs, sum( extended_price ) as dollars from tbl_IMPORT_DOTRedistributions with (nolock) where ownerId = and ownerType = and eai_batchId = and fseSKUId is null group by vendor_material_number, material, material_description order by cases desc, lbs desc, dollars desc, lines desc select distinct cdr.cdr_dstName from tbl_IMPORT_DotRedistributions r with (nolock) inner join tbl_CDR_Distributors cdr with (nolock) on cdr.cdr_recordId= r.fseCdrRecordId and cdr.ownerId= r.ownerId and cdr.fsl_tablecode = r.ownerType where r.ownerId = and r.ownerType = and r.eai_batchId = and nullif( cdr.cdr_dstCode, '' ) is null select s.sku, s.skuDesc sku_description, cdr.cdr_dstCode customer_number, cdr.cdr_dstName customer_name, r.external_invoice_date invoice_date, '#_redistInvPrefix#-' + r.external_invoice_number invoice_number, case_qtycast( target_quantity as int ) as case_qty, extended_priceabs( r.external_unit_Price ) * cast( target_quantity as int ) as extended_price, lb_qty, fseCdrRecordId as fseCdr_RecordId, rdc.cdr_dstCode shipFrom_number, rdc.cdr_dstName shipFrom_name from tbl_IMPORT_DotRedistributions r with (nolock) inner join tbl_PRD_SKus s with (nolock) on s.skuId = r.fseSkuId and s.ownerId = r.ownerId and s.fsl_tablecode = r.ownerType inner join tbl_CDR_Distributors cdr with (nolock) on cdr.cdr_recordId= r.fseCdrRecordId and cdr.ownerId= r.ownerId and cdr.fsl_tablecode = r.ownerType left outer join tbl_CDR_Distributors rdc with (nolock) on rdc.cdr_recordId= r.fseCdrRecordId_shipFrom and rdc.ownerId= r.ownerId and rdc.fsl_tablecode = r.ownerType where r.ownerId = and r.ownerType = and r.eai_batchId = -- and nullif( cdr.cdr_dstCode, '' ) is not null and nullif( cdr.cdr_dstCode, '' ) is not null select sum( LB_QTY ) lb_qty from qmd_invoiceHistorySource where lb_qty > 0 select sum( LB_QTY - 1 ) lb_qty from qmd_invoiceHistorySource where lb_qty < 0 and lb_qty is not null insert into tbl_IMPORT_InvoiceHistory ( eai_batchId, eai_lineNumber, ownerId, ownerType , SKU , SKU_DESCRIPTION , CUSTOMER_NUMBER , CUSTOMER_NAME , INVOICE_DATE , INVOICE_NUMBER , CASE_QTY , EXTENDED_PRICE , LB_QTY ) values ( , , , , , , , , , , , , ) insert into tbl_IMPORT_InvoiceHistory ( eai_batchId, eai_lineNumber, ownerId, ownerType , SKU , SKU_DESCRIPTION , CUSTOMER_NUMBER , CUSTOMER_NAME , INVOICE_DATE , INVOICE_NUMBER , CASE_QTY , EXTENDED_PRICE , LB_QTY , REVERSEINVOICE ) values ( , , , , , , , , , , , ,, ) insert into tbl_IMPORT_InvoiceHistory ( eai_batchId, eai_lineNumber, ownerId, ownerType , SKU , SKU_DESCRIPTION , CUSTOMER_NUMBER , CUSTOMER_NAME , INVOICE_DATE , INVOICE_NUMBER , CASE_QTY , EXTENDED_PRICE , LB_QTY , REVERSEINVOICE ) values ( , , , , , , , , , , , ,, ) update tbl_EAI_InboundBatches set loadedColumns = , lineCount = where batchId = update tbl_EAI_inboundBatches set processingState = where batchId = and ownerId = and ownerType =

Invoice History Batch: #qmd_invHistBatch.batchId#: #qmd_invHistBatch.status# #htmleditformat( qmd_invHistBatch.message )#