WindowWidth = DisplayWidth : WindowHeight = DisplayHeight
groupbox #itemSell.gb1, "",15,5,600,100
STATICTEXT #itemSell.stDept, "Department", 30, 20, 90, 20
textBOX #itemSell.tbDept, 30,50,130,30
STATICTEXT #itemSell.stCtgy, "Category", 200, 20, 90, 20
textBOX #itemSell.tbCtgy, 200,50,130,30
STATICTEXT #itemSell.stType, " Type ", 370, 20, 60, 20
textBOX #itemSell.tbType, 370,50,130,30
BUTTON #itemSell.btnClr, "New", [itemSellLoop], UL, 540, 30, 50,50
STATICTEXT #itemSell.stDesc, "Description", 50, 160, 90, 20
comboBOX #itemSell.cbDesc, desc$(,[itemSellFile],160,160,200,50
STATICTEXT #itemSell.stUnit, "Units", 50, 210, 90, 20
TEXTBOX #itemSell.tbUnit, 160,210,90,25 : Stylebits #itemSell.tbUnit, _ES_READONLY, 0, 0, 0
STATICTEXT #itemSell.stPrice, "Price", 50, 260, 50, 20
TEXTBOX #itemSell.tbPrice, 160,260,90,25 : Stylebits #itemSell.tbPrice, _ES_READONLY, 0, 0, 0
STATICTEXT #itemSell.stQty, "Quanity", 50, 310, 60, 20
TEXTBOX #itemSell.tbQty, 160,308,90,27 : Stylebits #itemSell.tbQty, _ES_NUMBER, 0, 0, 0
BUTTON #itemSell.btnAdd, " Item Amount ", [itemSellGet], UL, 20, 360
TEXTBOX #itemSell.tbAmt, 160, 360, 90, 25 : Stylebits #itemSell.tbAmt, _ES_READONLY, 0, 0, 0
BUTTON #itemSell.btnAdd, " Order Amount ", [itemSellAccept], UL, 15, 410
textbox #itemSell.tbOrdTot, 160, 410, 90, 25 : Stylebits #itemSell.tbAmt, _ES_READONLY, 0, 0, 0
BUTTON #itemSell.btnChkOut, "Go To Check Out ", [itemSellChkOut], UL, 160, 510
open sellReturnTitle$ for dialog as #itemSell
#itemSell, "trapclose [itemSellExit]"
#itemSell, "font 12"
call cbLimit hwnd(#itemSell.cbDesc),20
x = 10 'val(onHand$(sellIndx))
y = hWnd(#itemSell)
z = hWnd(#itemSell.tbQty)
call spinner x,y,z
redim sellFile$(19) : redim sellRec$(19) : redim desc$(19)
orderFiles = 0 ' count of files in order
orderTot = 0 ' cost of items in order
[itemSellLoop]
gosub [comboThree]
redim desc$(19)
#itemSell.tbDept, word$(path3$,6,"\")
#itemSell.tbCtgy, word$(path3$,7,"\")
#itemSell.tbType, word$(path3$,8,"\")
files path3$, info$(
fc = val(info$(0, 0)) ' file level
for cf = 1 to fc
x$ = info$(cf,0)
desc$(cf) = left$(x$,len(x$)-4)
next
#itemSell.cbDesc, "reload"
#itemSell.cbDesc, "!Items List"
#itemSell.tbQty, "!setfocus"
wait
[itemSellFile]
#itemSell.cbDesc,"selectionindex? sellIndx" 'chosen file/item
fileName$ = path3$ + info$(sellIndx,0)
notice fileName$
open fileName$ for input as #itemFile
line input #itemFile , itemRec$
close #itemFile
notice itemRec$
#itemSell.tbUnit,word$(itemRec$,2,"|")
#itemSell.tbPrice,using("##.##",val(word$(itemRec$,3,"|")))
orderFiles = orderFiles + 1 'count of files used in this order
sellFile$(orderFiles) = fileName$
sellRec$(orderFiles) = itemRec$
wait