ÿ
TFRMUPDATEWH0u)TPF0TfrmUpdateWHfrmUpdateWHLeftÈToplWidth Height®CaptionUpdate Data WarehouseColor	clBtnFaceFont.CharsetDEFAULT_CHARSET
Font.ColorclWindowTextFont.Heightõ	Font.Name
MS Sans Serif
Font.StyleOldCreateOrder	OnClose	FormClose
PixelsPerInch`
TextHeight
TLabelLabel1LefthTop8WidthHeight
CaptionYearTLabelLabel2Left˜Top0WidthHeight
CaptionYearTLabelLabel3Left˜TopPWidthHeight
CaptionMonthTLabelLabel4LeftðTopWidthÓHeight
Caption)From yyyymm (Set for Updating Warehouses)TLabelLabel5Left¨Top(WidthZHeight
Captionfor quarterly reportsTButtonbtnUpdateFWSalesLeft@TopWidthaHeightCaptionUpdate FW SalesEnabledTabOrderOnClickbtnUpdateFWSalesClickTBitBtnbtnCloseLeft@TopWidthKHeightTabOrderOnClick
btnCloseClickKindbkClose
TStatusBar	StatusBarLeftTop€WidthHeightPanelsTextReadyWidth2SimplePanelTButtonbtnImportColourSelectionLeftToppWidthÁHeightCaption&Import Colour Selection From Text FileTabOrderOnClickbtnImportColourSelectionClickTButton	btnCreateLeft8Top˜Width¡HeightCaption1) Create Ave Sales WarehouseTabOrderOnClickbtnCreateClickTMemoMemo1LeftàToppWidth!Heightq
Lines.Strings&delete, insert, Update vbavesalestemp;insert stock quantitiesinsert contract sp, valueinsert stock price,value,calculate top 60 by sales value (or profit?)#insert export sales clients fabricsdisplay report*NB: Fix datebetween in price fetch queriesTabOrderTButtonbtnTop60ByNetLengthFwLeft8Top¸Width¡HeightCaption2) Top 60 By Net Length FwTabOrderOnClickbtnTop60ByNetLengthFwClickTButtonbtnUpdateOverseasLeft8TopØWidth¡HeightCaption3) Update Overseas ClientsTabOrderOnClickbtnUpdateOverseasClickTButtonbtnUpdateWHSalesPerCustLeft@TopHWidth!HeightCaption1Update WH Sales Per Cust (used by Stock Min, etc)TabOrderOnClickbtnUpdateWHSalesPerCustClickTEditedtStartingYearLefthTopHWidth)HeightTabOrder	Text1999TButtonbtnManuSoldLeft@Top@WidthKHeightCaption	Manu SoldTabOrder
OnClickbtnManuSoldClickTEditedtManuYearLeftÀTop(WidthyHeightTabOrderTEditedtManuMonthLeftÀTopHWidthyHeightTabOrderTButtonbtnWHSalesPerCustomerLeftTop WidthHeightCaption-Update SalesPerCustomer Warehouse (from date)TabOrder
OnClickbtnWHSalesPerCustomerClickTEdit
edtFromYYYYMMLeft(Top WidthyHeightTabOrderText200106TQueryqryGetVTPeriodsDatabaseNameVBStockSQL.Stringsselect *
from vtperiodwhere yyyymm>=:yyyymmorder by yearno,periodnoLeft¨	ParamDataDataType	ftIntegerNameyyyymm	ParamType	ptUnknownTSmallintFieldqryGetVTPeriodsYEARNO	FieldNameYEARNOOriginVTPERIOD.YEARNOTSmallintFieldqryGetVTPeriodsPERIODNO	FieldNamePERIODNOOriginVTPERIOD.PERIODNOTDateTimeFieldqryGetVTPeriodsFROMDATE	FieldNameFROMDATEOriginVTPERIOD.FROMDATETDateTimeFieldqryGetVTPeriodsTODATE	FieldNameTODATEOriginVTPERIOD.TODATE
TIntegerFieldqryGetVTPeriodsYYYYMM	FieldNameYYYYMMOriginVTPERIOD.YYYYMMTQueryqryInsertSalesPass1DatabaseNameVBStockSQL.Stringsinsert into whfwsalespass12select vr.vbstru,vr.vbcol,vr.vbfin,vr.metricwidth,  vt.yearno,vt.periodno,  sum(vr.netlength) netlength'from vbrcpt vr,vtperiod vt,vbdesphdr vh3where vr.despdate between vt.fromdate and vt.todate1and vt.yearno= :yearno and vt.periodno= :periodnoand vr.qlty=''and vr.despno=vh.despno5and (vh.custref<>'SAMPLE') and (vh.custref<>'ZSLITT')and (vh.custref<>'ADJUST')4group by vr.vbstru,vr.vbcol,vr.vbfin,vr.metricwidth,  vt.yearno,vt.periodnoLeftÈ	ParamDataDataType	ftIntegerNameyearno	ParamType	ptUnknownDataType	ftIntegerNameperiodno	ParamType	ptUnknown
TODDBImporterodiImporter
AllowComments	
CommentString//CustomDateFormat
dd-mm-yyyyExceptionLoggingExceptionLogMode	amReWrite
ExceptionFileNot UsedFieldSeparator,HeadersUsedImportQryText.Strings1Currently unused - reserved for future expansion.
ImportFile,C:\a_Dad\spreadsheets\stock days firsts1.csv
ImportTypeitDelimited	QuoteType"RaiseExceptions	RecordCountUseControlFileLeftÀTopxTQueryqryInsertColourSelectionDatabaseNameVBStockSQL.Stringsinsert into vbcolourselection$(vbstru,vbcol,vbfin,vbwidth,custref)values)(:vbstru,:vbcol,:vbfin,:vbwidth,:custref)LeftàTopx	ParamDataDataTypeftStringNamevbstru	ParamType	ptUnknownDataTypeftStringNamevbcol	ParamType	ptUnknownDataTypeftStringNamevbfin	ParamType	ptUnknownDataType	ftIntegerNamevbwidth	ParamType	ptUnknownDataTypeftStringNamecustref	ParamType	ptUnknownTQueryqryDeleteASTDatabaseNameVBStockSQL.Stringsdelete from vbavesalestempLeftàTopèTQueryqryInsertAST89DatabaseNameVBStockSQL.StringsAinsert into vbavesalestemp (vbstru,vbcol,vbfin,vbwidth,netlength,$  orignetlength,actualstock,onorder)<select vbstru,vbcol,vbfin,89,avesale89,avesale89,stk89,ord89from vbmake_finLeftTopèTQueryqryInsertAST127DatabaseNameVBStockSQL.StringsAinsert into vbavesalestemp (vbstru,vbcol,vbfin,vbwidth,netlength,$  orignetlength,actualstock,onorder)Aselect vbstru,vbcol,vbfin,127,avesale127,avesale127,stk127,ord127from vbmake_finLeft TopèTQueryqryInsertAST2070DatabaseNameVBStockSQL.StringsAinsert into vbavesalestemp (vbstru,vbcol,vbfin,vbwidth,netlength,$  orignetlength,actualstock,onorder)Fselect vbstru,vbcol,vbfin,2070,avesale2070,avesale2070,stk2070,ord2070from vbmake_finLeft@TopèTQueryqryUpdateASTZerosDatabaseNameVBStockSQL.Stringsupdate vbavesalestempset netlength=9999999where netlength=0Left`TopèTQueryqryUpdateSPDatabaseNameVBStockSQL.Stringsupdate vbavesalestemp vaset va.contractsellprice=(select vl.price
from vblsp vlwhere va.vbstru=vl.vbstruand va.vbfin=vl.vbfinand va.vbwidth=vl.vbwidthand vl.pricetype='C'and vl.qlty=''2and :currentdate between vl.fromdate and vl.todate)Left Topè	ParamDataDataType
ftDateTimeNamecurrentdate	ParamType	ptUnknownTQueryqryUpdateCPDatabaseNameVBStockSQL.Stringsupdate vbavesalestemp vaset va.stockprice=(select vp.stkpricefrom vbpricesstd vpwhere va.vbstru=vp.vbstruand va.vbfin=vp.vbfinand va.vbwidth=vp.vbwidthand vp.qlty=''2and :currentdate between vp.fromdate and vp.todate)Left€Topè	ParamDataDataType
ftDateTimeNamecurrentdate	ParamType	ptUnknownTQuery
qryCalcValuesDatabaseNameVBStockSQL.Stringsupdate vbavesalestemp(set stockvalue=orignetlength*stockprice,4  contractsellvalue=orignetlength*contractsellprice,)  actualstockvalue=actualstock*stockpriceLeftÀTopèTQuery	qryGetFWmDatabaseNameVBStockSQL.Stringsupdate vbavesalestemp vaset va.orignetlengthfw="(select va.orignetlength/vw.stripsfrom vbwidth vwwhere va.vbwidth=vw.metricwidth)LeftàTopèTQueryqryGetAveSalesByFWDatabaseNameVBStockSQL.StringsHselect vbstru,vbcol,vbfin,cast(sum(orignetlengthfw) as integer) totalfw,  vbstru||vbcol||vbfin vbtypefrom vbavesalestempgroup by vbstru,vbcol,vbfinorder by 4 descLeftTopTStringFieldqryGetAveSalesByFWVBSTRU	FieldNameVBSTRUSizeTStringFieldqryGetAveSalesByFWVBCOL	FieldNameVBCOLSizeTStringFieldqryGetAveSalesByFWVBFIN	FieldNameVBFINSize
TIntegerFieldqryGetAveSalesByFWTOTALFW	FieldNameTOTALFWTStringFieldqryGetAveSalesByFWVBTYPE	FieldNameVBTYPESizeTQueryqryResetTop60FlagDatabaseNameVBStockSQL.Stringsupdate vbavesalestempset top60flag = nullwhere top60flag is not null  or top60flag='N'LeftàTopTQueryqryUpdateTop60FlagDatabaseNameVBStockSQL.Stringsupdate vbavesalestempset top60flag='Y'where vbstru=:vbstruand vbcol=:vbcoland vbfin=:vbfinLeft Top	ParamDataDataTypeftStringNamevbstru	ParamType	ptUnknownDataTypeftStringNamevbcol	ParamType	ptUnknownDataTypeftStringNamevbfin	ParamType	ptUnknownTQueryqryUpdateOverseasDatabaseNameVBStockSQL.Stringsupdate vbavesalestemp vaset va.hdchuk=(select 'Y'from vbcolourselection vcwhere va.vbstru=vc.vbstruand va.vbcol=vc.vbcoland va.vbfin=vc.vbfinand va.vbwidth=vc.vbwidthand vc.custref='HDCHUK')Left`TopTQueryqryInsertWHSalesPerCustDatabaseNameVBStockSQL.Stringsinsert into whsalespercustomer4select vp.yearno,vp.periodno,vt.warptype,vt.warpcol,-  vt.vbstru,vt.vbcol,vt.vbfin,vr.metricwidth,
  vh.custref,N  sum(vr.netlength) netlength,sum(vr.netlength/vw.strips/vs.pcefinlength) pcs,V  sum(vr.netlength/11) avelength,sum(vr.netlength/vw.strips/vs.pcefinlength/11) avepcsIfrom vbrcpt vr,vtperiod vp,supplier su,vbdesphdr vh,vbtype vt,vbwidth vw,  vbstru vs%where (vr.qlty='' or vr.qlty is null)and vr.despdate>=vp.fromdateand vr.despdate<=vp.todateand vr.despno=vh.despnoand vh.despsent='Y'and vh.custref=su.suprefand su.saleclient='Y'and vr.vbstru=vt.vbstruand vr.vbcol=vt.vbcoland vr.vbfin=vt.vbfin!and vr.metricwidth=vw.metricwidthand vt.vbstru=vs.vbstruand vp.yearno=:yearnoJand ((vr.metricwidth=89) or (vr.metricwidth=127) or (vr.metricwidth=2070))Egroup by vp.yearno,vp.periodno,vt.warptype,vt.warpcol,vr.metricwidth,(  vh.custref,vt.vbstru,vt.vbcol,vt.vbfinLeft¨TopH	ParamDataDataType	ftIntegerNameyearno	ParamType	ptUnknownTQueryqryQueryDatabaseNameVBStockLeftHTopHTQueryqryInsertClientSalesWHDatabaseNameVBStockSQL.Strings insert into whsalespercustomerfw:(custref,yyyymm,vbstru,vbcol,vbfin,netlength,pcsnetlength),select vh.custref, cast(:yyyymm as integer),  vr.vbstru,vr.vbcol,vr.vbfin,7  cast(sum(vr.netlength/vw.strips)*100 as integer)/100,F  cast(sum(vr.netlength/vw.strips/vs.pcefinlength*100) as integer)/100<from vbrcpt vr,supplier su,vbdesphdr vh,vbwidth vw,vbstru vswhere vr.qlty=''and vr.despno=vh.despnoand vh.despsent='Y'and vh.custref=su.suprefand su.saleclient='Y'!and vr.metricwidth=vw.metricwidthand vr.vbstru=vs.vbstru-and vr.despdate between :fromdate and :todateJand ((vr.metricwidth=89) or (vr.metricwidth=127) or (vr.metricwidth=2070))/group by vh.custref,vr.vbstru,vr.vbcol,vr.vbfinLeftèTop	ParamDataDataType	ftIntegerNameyyyymm	ParamType	ptUnknownDataType
ftDateTimeNamefromdate	ParamType	ptUnknownDataType
ftDateTimeNametodate	ParamType	ptUnknown