Caro, segue abaixo a tela q tenho o principal problema pois uso uma imagem no fundo.
Código: Selecionar todos
Function Vendas()
LOCAL oButton09
INIT DIALOG oFormVendas CLIPPER NOEXIT TITLE "Vendas "+iif(M->Tef_Uti="S",Space(202)+"T.E.F. ATIVADO",Space(198)+"T.E.F. DESATIVADO");
ON INIT {||oButton01:ENABLE(),oButton02:ENABLE(),oButton03:ENABLE(),;
iif(xitem#0,oButton04:ENABLE(),oButton04:DISABLE()),iif(xitem#0,oButton05:ENABLE(),oButton05:DISABLE()),;
iif(xitem#0,oButton06:ENABLE(),oButton06:DISABLE()),iif(xitem#0,oButton07:ENABLE(),oButton07:Disable()),;
oButton08:Disable(),Iif(Config->ECFINT="N",Veri_Transacao(),.T.),iif(M->Tef_Uti="S".AND.Config->ECFINT="N",VerificaGP(),.T.),iif(CONFIG->ECFINT="N".AND.M->Tef_Uti="S",VerificaTEF(),.T.),;
Iif(Config->ECFINT="N",VerificaECF(),.T.),;
Iif(Config->ECFINT="N".and.M->Tef_Uti="S",oButton10:Enable(),.T.),HideWindow( nHandleBarraDeTarefas ),;
oRef:SetFocus()};
ON EXIT {||IIF(xitem#0,CancelarVenda(),.T.)};
FONT HFont():Add( 'Courier New',0,-36,400,,,) ;
AT 0, 0 ;
SIZE GetDesktopWidth(), GetDesktopHeight();
STYLE DS_CENTER + WS_VISIBLE + WS_POPUP + WS_VISIBLE
//SET KEY FSHIFT,ASC("A") TO MsgInfo("SHIFT-A")
// SET KEY FCONTROL,VK_F3 TO MsgInfo("Ctrl-F3")
SET KEY 0,VK_F1 TO {||BuscPro("?"),oRef:SetFocus(),.T.}
SET KEY 0,VK_F2 TO {||IIF(XITEM#0,CancelarItem(),.T.),oRef:SetFocus(),.T.}
SET KEY 0,VK_F3 TO {||AbreGaveta(),oRef:SetFocus(),.T.}
SET KEY 0,VK_F4 TO {||iif(xitem#0,FinalizarVenda(),.T.),inicia:=1,oButton02:ENABLE(),oButton03:ENABLE(),oButton04:DISABLE(),oButton05:DISABLE(),oButton06:DISABLE(),oButton07:Disable(),oButton08:Disable()}
SET KEY 0,VK_F5 TO {||Desconto(),oRef:SetFocus(),.T.}
SET KEY 0,VK_F6 TO {||Iif(xItem=0,ConfigTef(),.T.),inicia:=1,oButton02:ENABLE(),oButton03:ENABLE(),oButton04:DISABLE(),oButton05:DISABLE(),oButton06:DISABLE(),oButton07:Disable(),oButton08:Disable()}
SET KEY 0,VK_F7 TO {||iif(xitem#0,Orcamento(),.T.),inicia:=1,oButton02:ENABLE(),oButton03:ENABLE(),oButton04:DISABLE(),oButton05:DISABLE(),oButton06:DISABLE(),oButton07:Disable(),oButton08:Disable()}
SET KEY 0,VK_F8 TO {||Iif(xItem=0,Config(),.T.),inicia:=1,oButton02:ENABLE(),oButton03:Enable(),oButton04:DISABLE(),oButton05:DISABLE(),oButton06:DISABLE(),oButton07:Disable(),oButton08:Disable()}
SET KEY 0,VK_F9 TO {||VerificaGP(),oRef:SetFocus(),.T.}
SET KEY 0,VK_F10 TO {||PADM(),oRef:SetFocus(),.T.}
@ 0,0 IMAGE oImage SHOW oVendas SIZE GetDesktopWidth(),GetDesktopHeight()
@ 737,650 GET oRef VAR vRef VALID {||Iif(Empty(vRef),.F.,BuscPro(vRef)),iif(empty(vref),.F.,oQuant:Setfocus()),.T.} MAXLENGTH 13 PICTURE "@!" Size 270,50 STYLE ES_AUTOHSCROLL TOOLTIP "F1 Pesquisar produto pela descricao"
@ 747,177 GET oQuant VAR vQuant VALID {||oPreco:SetFocus(),.T.} MAXLENGTH 08 PICTURE "9999.999" Size 257,60 FONT HFont():Add( 'Courier New',0,-38,400,,,) STYLE ES_AUTOHSCROLL + ES_RIGHT
@ 747,308 GET oPreco VAR vPreco VALID {||iif(!Empty(vRef),ValidPrc(vPreco),.T.),IIF(PEVENDE#0,LancItem(),.T.),oRef:SetFocus(),.T.} PICTURE "@E 9,999.99" Size 257,60 FONT HFont():Add( 'Courier New',0,-38,400,,,) STYLE ES_AUTOHSCROLL + ES_RIGHT
@ 30, 43 SAY oDescricao CAPTION Transform(vDescricao,"@!@S43") OF oFormVendas Size 950,50 FONT HFont():Add( 'Courier New',0,-36,800,,,) BACKCOLOR RGB(186,227,247)
@ 747,435 SAY oTotUnt CAPTION Transform(vTotUnt,"@E 99,999.99") OF oFormVendas Size 257,60 BACKCOLOR RGB(186,227,247) FONT HFont():Add( 'Courier New',0,-38,800,,,) STYLE ES_RIGHT
@ 747,560 SAY oTotal CAPTION Transform(vTotal,"@E 99,999.99") OF oFormVendas Size 257,60 COLOR x_RED FONT HFont():Add( 'Courier New',0,-38,800,,,) BACKCOLOR RGB(186,227,247) STYLE ES_RIGHT
@ 30,420 BROWSE oBrwItem DATABASE ON GETFOCUS {||oRef:SetFocus()} ON POSCHANGE {||oBrwItem:Refresh()} ON UPDATE {|| VerificaProd() } SIZE GetDesktopWidth()-375, 280 FONT HFont():Add( 'Courier New',0,-12,400,,,)
oBrwItem:alias:= ARQUITMP
oBrwItem:aColumns := {}
ADD COLUMN FieldBlock(Fieldname(4)) TO oBrwItem HEADER 'Codigo' TYPE 'C' LENGTH 5 PICTURE "99999" JUSTIFY HEAD DT_CENTER JUSTIFY LINE DT_CENTER
ADD COLUMN FieldBlock(Fieldname(5) ) TO oBrwItem HEADER 'Descrição' TYPE 'C' LENGTH 35 PICTURE "@!@S35" JUSTIFY HEAD DT_CENTER // JUSTIFY LINE DT_RIGHT
ADD COLUMN FieldBlock(Fieldname(6) ) TO oBrwItem HEADER 'Quant.' TYPE 'N' LENGTH 10 DEC 2 PICTURE "9999.99" VALID {||IIF(QUANT=0,MSGSTOP("Quantidade nao pode ser 0.00","Aviso"),.T.),.T.} JUSTIFY HEAD DT_CENTER JUSTIFY LINE DT_RIGHT
ADD COLUMN FieldBlock(Fieldname(7) ) TO oBrwItem HEADER 'Vlr.Unit.' TYPE 'N' LENGTH 12 DEC 2 PICTURE "@E 99,999.99" JUSTIFY HEAD DT_CENTER JUSTIFY LINE DT_RIGHT
ADD COLUMN FieldBlock(Fieldname(8) ) TO oBrwItem HEADER 'Total' TYPE 'N' LENGTH 12 DEC 2 PICTURE "@E 99,999.99" JUSTIFY HEAD DT_CENTER JUSTIFY LINE DT_RIGHT
oBrwItem:aColumns[3]:lEditable := .T.
oBrwItem:aColumns[4]:lEditable := .T.
oBrwItem:aColumns[1]:bColorBlock := {|| IF(&ARQUITMP->QUANT=0,{x_RED, x_WHITE, x_CYAN, x_DARKBLUE} ,{x_BLACK, x_WHITE , x_WHITE, x_DARKBLUE })}
oBrwItem:aColumns[2]:bColorBlock := {|| IF(&ARQUITMP->QUANT=0,{x_RED, x_WHITE, x_CYAN, x_DARKBLUE} ,{x_BLACK, x_WHITE , x_WHITE, x_DARKBLUE })}
oBrwItem:aColumns[3]:bColorBlock := {|| IF(&ARQUITMP->QUANT=0,{x_RED, x_WHITE, x_CYAN, x_DARKBLUE} ,{x_BLACK, x_WHITE , x_WHITE, x_DARKBLUE })}
oBrwItem:aColumns[4]:bColorBlock := {|| IF(&ARQUITMP->QUANT=0,{x_RED, x_WHITE, x_CYAN, x_DARKBLUE} ,{x_BLACK, x_WHITE , x_WHITE, x_DARKBLUE })}
oBrwItem:aColumns[1]:bColorBlock := {|| IF(&ARQUITMP->QUANT=0,{x_RED, x_WHITE, x_CYAN, x_DARKBLUE} ,{x_BLACK, x_WHITE , x_WHITE, x_DARKBLUE })}
@ 10,716 BUTTON oButton01 CAPTION "[F3] Abrir Gaveta" SIZE 160, 20 ON CLICK {||AbreGaveta(),oRef:SetFocus()} FONT HFont():Add( 'Courier New',0,-11,800,,,)
@ 170,716 BUTTON oButton02 CAPTION "[F6] Funcoes T.E.F." SIZE 160, 20 ON CLICK {||ConfigTef(),oRef:SetFocus(),.T.} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-11,800,,,)
@ 330,716 BUTTON oButton03 CAPTION "[F8] Funcoes E.C.F." SIZE 160, 20 ON CLICK {||Config(),oRef:SetFocus(),.T.} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-11,800,,,)
@ 490,716 BUTTON oButton04 CAPTION "[F4] Finalizar Venda" SIZE 160, 20 ON CLICK {||FinalizarVenda(),inicia:=1,oButton02:Enable(),oButton04:DISABLE(),oButton05:DISABLE(),oButton06:DISABLE(),oButton07:Disable(),oButton08:Disable(),oRef:SetFocus(),.T.} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-11,800,,,)
@ 650,716 BUTTON oButton05 CAPTION "[F2] Cancelar Item" SIZE 160, 20 ON CLICK {||CancelarItem(),oRef:SetFocus(),.T.} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-11,800,,,) COLOR x_BLUE
@ 810,716 BUTTON oButton06 CAPTION "[ESC] Cancelar Cupom" SIZE 150, 20 ON CLICK {||CancelarVenda(),EndDialog()} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-11,800,,,) COLOR x_BLUE
@ 170, 10 BUTTON oButton11 CAPTION "[F11] Consultar Cheque" SIZE 160, 20 ON CLICK {||ValidarCartao(3),oRef:SetFocus(),.T.} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-11,800,,,)
@ 330, 10 BUTTON oButton10 CAPTION "[F10] Funcoes ADM TEF" SIZE 160, 20 ON CLICK {||PADM(),oRef:SetFocus(),.T.} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-11,800,,,)
@ 490, 10 BUTTON oButton03 CAPTION "[F9] Verificar G.P." SIZE 160, 20 ON CLICK {||VerificaGP(),oRef:SetFocus(),.T.} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-11,800,,,)
@ 650, 10 BUTTON oButton08 CAPTION "[F7] Orcamento" SIZE 160, 20 ON CLICK {||iif(xitem#0,Orcamento(),.T.),inicia:=1,oButton04:DISABLE(),oButton05:DISABLE(),oButton06:DISABLE(),oButton07:Disable(),oButton08:Disable()} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-11,800,,,)
@ 810, 10 BUTTON oButton07 CAPTION "[F5] Desconto " SIZE 160, 20 ON CLICK {||Desconto(),oRef:SetFocus(),oBrwItem:Refresh(),.T.} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-11,800,,,)
@ 10,746 SAY oStatusSAY1 CAPTION "Status da E.C.F.: " SIZE 130, 20 FONT HFont():Add( 'Courier New',0,-11,800,,,) COLOR x_BLUE BACKCOLOR RGB(186,227,247)
@ 140,746 SAY oStatusECF CAPTION vStatusECF SIZE 450, 20 FONT HFont():Add( 'Courier New',0,-11,800,,,) COLOR x_RED BACKCOLOR RGB(186,227,247)
@ 600,746 SAY oStatusSAY2 CAPTION "Status do G.P.: " SIZE 110, 20 FONT HFont():Add( 'Courier New',0,-11,800,,,) COLOR x_BLUE BACKCOLOR RGB(186,227,247)
@ 710,746 SAY oStatusGP CAPTION vStatusGP SIZE 250, 20 FONT HFont():Add( 'Courier New',0,-11,800,,,) COLOR x_RED BACKCOLOR RGB(186,227,247)
// @ 620,746 SAY oStatusSAY2 CAPTION "Status do Banco de Dados.: " SIZE 200, 20 FONT HFont():Add( 'Courier New',0,-11,800,,,) COLOR x_BLUE BACKCOLOR RGB(186,227,247)
@ 1620,746 SAY oStatusSAY2 CAPTION "Status do Banco de Dados.: " SIZE 200, 20 FONT HFont():Add( 'Courier New',0,-11,800,,,) COLOR x_BLUE BACKCOLOR RGB(186,227,247)
@ 1810,746 SAY oStatusBD CAPTION vStatusBD SIZE 200, 20 FONT HFont():Add( 'Courier New',0,-11,800,,,) COLOR x_RED BACKCOLOR RGB(186,227,247)
// @ 810,746 SAY oStatusBD CAPTION vStatusBD SIZE 200, 20 FONT HFont():Add( 'Courier New',0,-11,800,,,) COLOR x_RED BACKCOLOR RGB(186,227,247)
//ReadExit( .T. )
ACTIVATE DIALOG oFormVendas
//oVendas:ACTIVATE()
ShowWindow( nHandleBarraDeTarefas )
RETURN NIL