---> 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 fsl_dstId, cdr_recordId, cdr_dstCode, cdr_dstName, redistInvPrefix FROM tbl_CDR_Distributors with (nolock) where ownerId = and fsl_tablecode = and redistIsActive = 'Y' AND cdr_dstcompanyType = 'R' and redistInvPrefix = select lineCount from tbl_EAI_inboundBatches where batchId = select distinct exclusionId from tbl_IMPORT_Exclusions with (nolock) where ownerId = and ownerType = and exclusionType = 'SKU' select cdr_recordId from tbl_CDR_distributors with (nolock) where ownerId = and FSL_TableCode = and cdr_dstcompanyType in ('R') and fsl_dstId = update tbl_IMPORT_RedistributionData set fseRedistCdrRecordId = where 1=1 and eai_batchId = and ownerId = and ownerType = select * from tbl_IMPORT_RedistributionData with (nolock) where 1=1 and eai_batchId = and ownerId = and ownerType = and fseRedistCdrRecordId > 0 SELECT cdr_recordId FROM TBL_CDR_Distributors with (nolock) where 1=1 and cdr_dstCode = and ownerId = and fsl_tableCode = and cdr_dstCompanyType = 'S' and cdr_specialAcctType = 'RDA' and cdr_redistAcctFor = 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 = insert into tbl_CDR_Distributors (ownerId, fsl_tableCode, cdr_dstName, cdr_dstAddress1, cdr_dstcity, cdr_dststate, cdr_dstzip, cdr_territoryId, fsl_dstId, recState, crmActive,FocusAccount, cdr_priority, useSysFields, hasSysFields, cdr_dstPath, cdr_dstCode, cdr_dstcompanyType, fsl_masterlinkYN, cdr_specialAcctType, cdr_redistAcctFor, recordSource, createDate ) values ( , , , , , , , , , 'A', 'Y', 'N', 'C', 'N', 'N', , , 'S' ,'N', , , , ) insert into tbl_CDR_DstCodes (ownerId, ownerType, cdr_recordId, cdr_dstCode, cdr_dstcode_type, cdr_dstCode_comments) values ( , , , , , ) update tbl_IMPORT_RedistributionData set fseCdrRecordId = where eai_importId = and eai_batchId = and ownerId = and ownerType = and invoice_number = and customer_number = update tbl_IMPORT_RedistributionData set fseSkuId = where eai_importId = and eai_batchId = and ownerId = and ownerType = and invoice_number = select * from tbl_CDR_InvoiceHistory with (nolock) where ownerId = and ownerType = and skuId = and cdr_recordId = and invoiceNumber = update tbl_IMPORT_RedistributionData set duplicate = where eai_importId = and eai_batchId = and ownerId = and ownerType = and invoice_number = and fseSkuId = and fseCdrRecordId = select distinct cdr_dstCode, cdr_dstName from tbl_CDR_Distributors with (nolock) where cdr_dstCode is not null and ownerId = and fsl_tableCode = and recordSource = select distinct sku,sku_description, count(*) as records from tbl_IMPORT_RedistributionData with (nolock) where eai_batchId = and ownerId = and ownerType = and coalesce(fseSkuId,null) = null group by sku,sku_description select distinct customer_number, customer_name, count(*) as records from tbl_IMPORT_RedistributionData with (nolock) where eai_batchId = and ownerId = and ownerType = and coalesce(fseCdrRecordId,0) = 0 group by customer_number, customer_name select distinct customer_number, customer_name, count(*) as records from tbl_IMPORT_RedistributionData imp with (nolock) INNER JOIN tbl_CDR_Distributors cdr with (nolock) ON cdr.cdr_recordId = imp.fseCdrRecordId and cdr.ownerId = imp.ownerId and cdr.fsl_tableCode = imp.ownerType where imp.eai_batchId = and imp.ownerId = and imp.ownerType = and coalesce(imp.fseCdrRecordId,0)> 0 and cdr.cdr_territoryId = 0 group by customer_number, customer_name select distinct customer_number, customer_name, invoice_number, count(*) as records from tbl_IMPORT_RedistributionData with (nolock) where eai_batchId = and ownerId = and ownerType = and coalesce(duplicate,'')= 'Y' group by invoice_number, customer_number, customer_name select s.sku, s.skuDesc sku_description, cdr.cdr_dstCode customer_number, cdr.cdr_dstName customer_name, r.invoice_date , r.invoice_number , case_qty, sales_price as extended_price,lb_qty, fseCdrRecordId as fseCdr_RecordId, fseRedistCdrRecordId from tbl_IMPORT_RedistributionData 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 where r.ownerId = and r.ownerType = and r.eai_batchId = and nullif( cdr.cdr_dstCode, '' ) is not null and fseSkuId is not null and coalesce(fseCdrRecordId,0) <> 0 and coalesce(duplicate,'') <> 'Y' select sum( LB_QTY ) lb_qty from qmd_invoiceHistorySource where lb_qty > 0 ---> 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 )#

select sku, customer_name ,invoice_number, case_qty as cases, extended_price as price ,lb_qty as LB from qmd_invoiceHistorySource