update tbl_IMPORT_PrincipalBudgets set fsePrincipalId = where ownerType = and ownerId = and eai_batchId = select fiscal_year, fiscal_week, eai_importId, eai_lineNumber, fseMessage from tbl_IMPORT_PrincipalBudgets where ownerType = and ownerId = and eai_batchId = update tbl_IMPORT_PrincipalBudgets set fseValidPeriod = , fseMessage = where ownerType = and ownerId = and eai_batchId = and eai_importId = and eai_lineNumber = select mfr_territory_nbr, mfr_territory_name, fsePrincipalId, eai_importId, eai_lineNumber, fseMessage from tbl_IMPORT_PrincipalBudgets where ownerType = and ownerId = and eai_batchId = select principalTerritoryId from tbl_BRO_PrincipalTerritories where ownerType = and ownerId = and principalId = and mfrTerritoryNbr = update tbl_IMPORT_PrincipalBudgets set fsePrincipalTerritoryId = , fseMessage = where ownerType = and ownerId = and eai_batchId = and eai_importId = and eai_lineNumber = select mfr_budget_category, fsePrincipalId, eai_importId, eai_lineNumber, fseMessage from tbl_IMPORT_PrincipalBudgets where ownerType = and ownerId = and eai_batchId = update tbl_IMPORT_PrincipalBudgets set fseBgtCategoryId = , fseMessage = where ownerType = and ownerId = and eai_batchId = and eai_importId = and eai_lineNumber = select eai_LineNumber, fiscal_year, fiscal_week, fsePrincipalTerritoryId, fsePrincipalId, fseBgtCategoryId, plan_amt, current_amt, fseMessage, m.mfr_name, pt.mfrTerritoryNbr, pt.mfrTerritoryName, bgt.attrDescription bgtCategory, mfr_territory_nbr, mfr_territory_name, mfr_budget_category, fseValidPeriod from tbl_IMPORT_PrincipalBudgets pb left outer join tbl_BRO_principalTerritories pt on pt.principalTerritoryId = pb.fsePrincipalTerritoryId and pt.ownerId = pb.ownerId and pt.ownerType = pb.ownerType left outer join tbl_BRO_Principals p on p.principalId = pb.fsePrincipalId and p.ownerid = pb.ownerId and p.ownerType = pb.ownerType left outer join tblManufacturers m on m.mfr_id = p.mfrId left outer join tbl_ORG_Attributes bgt on bgt.attrId = pb.fseBgtCategoryId and bgt.ownerId = pb.ownerId and bgt.fsl_tablecode = pb.ownerType where pb.ownerType = and pb.ownerId = and pb.eai_batchId = order by fiscal_year, fiscal_week, mfr_territory_nbr, mfr_territory_name, mfr_budget_category select * from tbl_IMPORT_PrincipalBudgets pb where pb.ownerType = and pb.ownerId = and pb.eai_batchId = and ( coalesce( fsePrincipalTerritoryId, 0 ) = 0 or coalesce( fsePrincipalId, 0 ) = 0 or coalesce( fseBgtCategoryId, 0 ) = 0 or coalesce( fseValidPeriod, 'N' ) <> 'Y' or coalesce( fseMessage, '' ) <> '' ) select fiscal_year, fiscal_week from tbl_IMPORT_PrincipalBudgets pb where pb.ownerType = and pb.ownerId = and pb.eai_batchId = and fsePrincipalTerritoryId > 0 and fseBgtCategoryId > 0 and fseValidPeriod = 'Y' order by fiscal_year desc, fiscal_week desc select currentFiscalYear, currentFiscalWeek from tbl_BRO_Principals where principalId = and ownerId = and ownerType = update tbl_BRO_Principals set currentFiscalYear = , currentFiscalWeek = where principalId = and ownerId = and ownerType = Fiscal Period changed from FY#qmd_currentFiscalPeriod.currentFiscalYear# week #qmd_currentFiscalPeriod.currentFiscalWeek# to FY#qmd_fileFiscalPeriod.fiscal_year# week #qmd_fileFiscalPeriod.fiscal_week# Fiscal Period FY#qmd_currentFiscalPeriod.currentFiscalYear# week #qmd_currentFiscalPeriod.currentFiscalWeek# not changed. Fiscal Period FY#qmd_currentFiscalPeriod.currentFiscalYear# week #qmd_currentFiscalPeriod.currentFiscalWeek# not changed. select * from qmd_import order by eai_lineNumber
#htmleditformat( mfr_name )# #htmleditformat( _periodChangeTxt )#
Line ## MFR Fiscal Year Week ## Terr. ## Terr. Name Budget Category Plan YTD Actuals YTD Messages
#lsnumberformat( eai_lineNumber, "0000" )# #fiscal_year# #fiscal_week# #htmleditformat( mfr_territory_nbr )# #htmleditformat( mfr_territory_name )# #htmleditformat( mfr_budget_category )# #lsnumberformat( plan_amt )# #lsnumberformat( current_amt )#
Processed
#htmleditformat( _messageText )#
#_resultsHTML#
Batch ID: #lsnumberformat( qmd_batch.batchId, "0000000" )# Status: #_results.status# #_results.message#
#_resultsHTML#
set nocount on update tbl_BRO_PrincipalBudgets set currentAmt = , planAmt = , lastUpdated = , lastUpdatedBy = where ownerId = and ownerType = and principalId = and principalTerritoryId = and bgtCategoryId = and budgetCode = and fiscalyear = and weekNumber = select rowsAffected = @@rowCount set nocount off insert into tbl_BRO_PrincipalBudgets ( ownerId, ownerType, principalId, principalTerritoryId, fiscalyear, weekNumber, bgtCategoryId, budgetCode, currentAmt, planAmt, lastUpdated, lastUpdatedBy ) values ( , , ,, , , , , , , , )