Code: Select all
( cAliVta )->( DBSetOrder( "LIN" ) )
nTotRV := SumTotRV( cAliVta, .T. )
DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0, -05
DEFINE ICON oIcon RESOURCE "VENTAS"
DEFINE CURSOR oCursor RESOURCE "Mano"
DEFINE BRUSH oBrush NAME "GRADIEN"
DEFINE WINDOW oWChild;
TITLE OToA( "Registro de Ventas Mes de "+cMes+"/"+IIF( nAnio == 1, STR( cAnio ), ALLTRIM( STR( cAnio + 1 ) ) ) );
MDICHILD;
NOZOOM;
NOICONIZE;
COLOR "N/W";
ICON oIcon;
OF oVentana
SET FONT OF oWChild TO oFont
DEFINE BUTTONBAR oBarra;
OF oWChild;
SIZE 80, 60;
2007
oBarra:bClrGrad := { | lInvert | If( ! lInvert, ;
{ { 0.10,8404992,16777215 },;
{ 0.10,16777215,8404992 } },;
{ { 0.50,33023,16777215 },;
{ 0.50,16777215,33023 } } ) }
oBarra:nClrText := 0
DEFINE BUTTON oBar[ 1 ] OF oBarra;
RESOURCE "NEWDOC";
ACTION( MCLICK(), AMRegVentas( oBrw, .T., cMes, nAnio, nReg, cAliVta, cAliVde ), nTotRV:= SumTotRV( cAliVta, .F. ), oBrw:Refresh() );
GROUP;
PROMPT "Ingreso"
DEFINE BUTTON oBar[2] OF oBarra;
RESOURCE "WRITE";
ACTION( MCLICK(), AMRegVentas( oBrw, .F., cMes, nAnio, nReg, cAliVta, cAliVde ), nTotRV := SumTotRV( cAliVta, .F. ), oBrw:Refresh() );
PROMPT "Modifica"
DEFINE BUTTON oBar[3] OF oBarra;
RESOURCE "STOP";
ACTION( MCLICK(), BORegVentas( cAliVta, cAliVde, "esta Venta", cMes, nAnio ), nTotRV := SumTotRV( cAliVta, .F. ), oBrw:Refresh() );
PROMPT "Elimina"
DEFINE BUTTON oBar[4] OF oBarra;
RESOURCE "DOOR";
ACTION( MCLICK(), lSalir := .T., oBrw:cAlias := "",;
FErase( "TEMPRV"+LTRIM( STR( NREG ) )+".DBF" ), oWChild:End() );
PROMPT "Salir"
DEFINE BUTTON oBar[5] OF oBarra;
RESOURCE "IPRIMERO";
ACTION( MCLICK(), oBrw:GoTop() );
GROUP;
PROMPT "Primero"
DEFINE BUTTON oBar[6] OF oBarra;
RESOURCE "IULTIMO";
ACTION( MCLICK(), oBrw:GoBottom() );
PROMPT "Ultimo"
SET MESSAGE TO " Buscando : " OF oWChild 2007
* oWChild:oMsgBar:cMsgDef := " Buscando : "+oBrw:bSeek
* oWChild:oMsgBar:Refresh()
* oWChild:oMsgBar:Paint()
@ 00, 00 XBROWSE oBrw;
FIELDS ( cAliVta )->LIN, ( cAliVta )->DIA+( cAliVta )->MES+( cAliVta )->ANO, ( cAliVta )->CODDOC, ( cAliVta )->SERIE, ( cAliVta )->NRODOC, ( cAliVta )->RUC, IIF( ( cAliVta )->CLIENTE = " ", "Comprobante Anulado",( cAliVta )->CLIENTE ), STR( ( cAliVta )->CODVTA1, 1, 0 ), TransForm( ( cAliVta )->IMPORTE, "9,999,999.99" );
HEADERS OToA("L¡nea"), OToA("Emisi¢n"), "C/D", "SERIE", "No Documento", "RUC", "CLIENTE","OPE", "TOTAL";
FIELDSIZES 40, 60, 30, 40, 100, 80, 150, 30, 95;
JUSTIFY .T., .F., AL_CENTER, .F., .F., .F., .F., AL_CENTER, .T.;
COLOR CLR_BLACK, RGB( 200,200,200 );
UPDATE OF oWChild;
ALIAS cAliVta FOOTERS AUTOSORT;
ON LEFT DBLCLICK( MCLICK(), AMRegVentas( oBrw, .F., cMes, nAnio, nReg, cAliVta, cAliVde ), SumTotRV( cAliVta ), oBrw:Refresh() )
WITH OBJECT oBrw
:bSeek := {|c| DbSeek( Upper( c ) ) }
:oSeek := oWChild:oMsgBar // ---> aqui quiero que salga en la barra de mensajes de la ventana
:bKeyDown := { | nKey, nFlags | ;
IIF( nKey == 13,; // [Enter]
( MCLICK(), AMRegVentas( oBrw, .F., cMes, nAnio, nReg, cAliVta, cAliVde ) ),;
IIF( nKey == 46,; // [DEL]
( MCLICK(), BORegVentas( cAliVta, cAliVde, "esta Venta", cMes, nAnio ), oBrw:Refresh() ),;
IIF( nKey == ASC("N") .AND. GetKeyState( VK_CONTROL ),; // [CTRL+N]
( MCLICK(), AMRegVentas( oBrw, .T., cMes, nAnio, nReg, cAliVta, cAliVde ) ),;
IIF( nKey == ASC("M") .AND. GetKeyState( VK_CONTROL ),; // [CTRL+M]
( MCLICK(), AMRegVentas( oBrw, .F., cMes, nAnio, nReg, cAliVta, cAliVde ) ),;
IIF( nKey == ASC("S") .AND. GetKeyState( VK_CONTROL ),; // [CTRL+S]
( MCLICK(), lSalir := .T., oWChild:End() ), ) ) ) ) ) }
END
WITH OBJECT oBrw:TOTAL
:nTotal := nTotRV // variable que suma el total del campo importe
:lTotal := .t. // activa el total , pero al sali de un boton cualquiera no actualiza el footer....
:nFootStrAlign := AL_RIGHT
END
oBrw:oCol("CLIENTE"):cFooter := " TOTAL VENTAS : "
oBrw:oCol("CLIENTE"):nFootStrAlign := AL_RIGHT
oBrw:bClrGrad := { | lInvert | If( ! lInvert, ;
{ { 1.00,8388608,16054371 }, ;
{ 1.00,16054371,8388608 } }, ;
{ { 0.50,32768,16054371 }, ;
{ 0.50,16054371,32768 } } ) }
oBrw:bClrHeader := { || { 65535, 0 } }
oBrw:bClrfooter := { || { 65535, 0 } }
oBrw:nHeaderHeight := 35
oBrw:SetRdd()
oBrw:SetBackGround( oBrush )
oBrw:CreateFromCode()
oWChild:SetControl( oBrw )
oBar[1]:cToolTip = { "INGRESA VENTA NUEVA", "CiberSoft", 1, rgb(255,255,255), rgb(58,116,241) }
oBar[2]:cToolTip = { "MODIFICA UNA VENTA", "CiberSoft", 1, rgb(255,255,255), rgb(58,116,241) }
oBar[3]:cToolTip = { "ELIMINA VENTA", "CiberSoft", 1, rgb(255,255,255), rgb(58,116,241) }
oBar[4]:cToolTip = { "SALIR DE ESTA VENTANA", "CiberSoft", 1, rgb(255,255,255), rgb(58,116,241) }
ACTIVATE WINDOW oWChild;
VALID( lSalir )
Ayuda por favor ....