oRsReq:Filter := ""
oRsReq:Filter := "datereceived = null and datecancelled = null"
lOK := .F.
DEFINE ICON oICO RESOURCE "CLIENTS"
DEFINE WINDOW oWnd1 ;
FROM 0,0 to 35,100 ;
TITLE cTITLE ;
MENU Buildmenu( oRsReq ) ;
ICON oICO ;
NOSYSMENU ;
NOMINIMIZE ;
NOZOOM ;
MDICHILD
@ 0, 0 xBROWSE oBrw of oWnd1 ;
RECORDSET oRsReq ;
COLUMNS "PARTDESC", ; // insert for stock
"CPHONE1", ;
"VENDOR", ;
"VPHONE1", ;
"BIN", ;
"STOCKNO", ;
"DATEREQUESTED", ;
"DATEORDERED", ;
"DATESHIPPED", ;
"DATERECEIVED", ;
"DATECANCELLED", ;
"REQUESTNO" ;
COLSIZES 138,75,100,75,33,80,65,65,65,65,65,65;
HEADERS "Description", ; // insert for stock
"CustPhone", ;
"Vendor", ;
"VendPhone", ;
"Bin", ;
"Part Number", ;
"Requested", ;
"Ordered", ;
"Shipped", ;
"Received", ;
"Cancelled", ;
"Request" ;
AUTOSORT AUTOCOLS LINES CELL
oWnd1:oClient := oBrw
* oBrw:nRowHeight := 45
ADD oCol TO oBrw AT 1 DATA {|x| x := _ChkCust(oRsReq:Fields("clname"):Value,;
oRsReq:Fields("cfname"):Value) } HEADER "Customer" size 110
oBrw:lFooter := .t.
oCol := oBrw:aCols[ 1 ]
oCol:bFooter := { || Ltrim( Str( oBrw:KeyNo() ) ) + " / " + LTrim( Str( oBrw:KeyCount() ) ) }
oCol:cHeader := "Customer"
oBrw:bChange := { || oCol:RefreshFooter() }
ADD oCol TO oBrw AT 8 DATA {|x| x := _ChkStock(oRsReq:Fields("OutOfStock"):Value) } HEADER "For Stock" size 55
oCol := oBrw:aCols[ 9 ]
oCol:bStrData := { |x| x := if(oRsReq:eof,,oRsReq:Fields("DateRequested"):Value), If( Empty(x), '00/00/0000',DToC(x) ) }
oCol := oBrw:aCols[ 10 ]
oCol:bStrData := { |x| x := if(oRsReq:eof,,oRsReq:Fields("DateOrdered"):Value), If( Empty(x), '00/00/0000',DToC(x) ) }
oCol := oBrw:aCols[ 11 ]
oCol:bStrData := { |x| x := if(oRsReq:eof,,oRsReq:Fields("DateShipped"):Value), If( Empty(x), '00/00/0000',DToC(x) ) }
oCol := oBrw:aCols[ 12 ]
oCol:bStrData := { |x| x := if(oRsReq:eof,,oRsReq:Fields("DateReceived"):Value), If( Empty(x), '00/00/0000',DToC(x) ) }
oCol := oBrw:aCols[ 13 ]
oCol:bStrData := { |x| x := if(oRsReq:eof,,oRsReq:Fields("DateCancelled"):Value), If( Empty(x), '00/00/0000',DToC(x) ) }
oBrw:aCols[ 2 ]:cDataType := "M" // description
// Following two lines for vertical cell merging
oBrw:Customer:lMergeVert := .t.
oBrw:Description:lMergeVert := .t.
oBrw:bRClicked := { | nRow, nCol | ShowPopup(oBrw,nROW,nCOL,;
oRsReq,oBtn1,oBtn2,oBtn3,oBtn4,oBtn5,oBtn6 ) }
oBrw:bLDblClick := { |nRow,nCol | _ReqView( "V", oRsReq,oBtn1,oBtn2,oBtn3,oBtn4,oBtn5,oBtn6,oWndFind) }
oBrw:bKeyDown := { |nKey| _Manual( nKey,oRsReq,oBtn1,oBtn2,oBtn3,oBtn4,oBtn5,oBtn6,oBrw ) }
oBrw:bClrStd := {|| {CLR_BLACK, if( _CHkClosed(oRsReq) , RGB(179,203,204), CLR_WHITE ) } }
oBrw:CreateFromCode()
ACTIVATE WINDOW oWND1 ;
ON INIT( oBrw:SetFocus(), .F. ) ;
VALID ( IIF( !lOK, ReqClose(.T.,oWnd1,oRsReq,oBar1,oBar2 ), .F. ))
Return(nil)