SET SYSMENU OFF
SET DATE FRENCH
SET DELETED OFF
SET SAFETY OFF
SELECT 1
USE recibo.dbf IN 1 ALIAS xrec shared
****en tu caso es la factura.dbf****
SELECT 2
USE art1rec.dbf IN 2 ALIAS art1rec shared
Thisform.olecontrol1._Value=DATE()
thisform.olecontrol2._Value=DATE()
3)En el click del botón listar:
SELECT 2
USE art1rec.dbf IN 2 ALIAS art1rec shared
thisform.combo3.value=""
THISFORM.check2.value=0
IF thisform.text1.Value=CTOD(' / / ') AND thisform.check2.Value=0 AND thisform.texto5.Value=0 AND thisform.texto7.Value=0
MESSAGEBOX("Debe ingresar Fecha",48,"Error")
thisform.text1.SetFocus
RETURN
ENDIF
IF thisform.text2.Value=CTOD(' / / ') AND thisform.check2.Value=0 AND thisform.texto5.Value=0 AND thisform.texto7.Value=0
MESSAGEBOX("Debe ingresar Fecha",48,"Error")
thisform.text2.SetFocus
RETURN
ENDIF
IF thisform.text3.Value=" " AND thisform.check2.Value=0 AND thisform.texto5.Value=0 AND thisform.texto7.Value=0
MESSAGEBOX("Debe ingresar Sr ",48,"Error")
thisform.text3.SetFocus
RETURN
ENDIF
IF thisform.text3.Value="" AND thisform.check2.Value=1 AND thisform.text1.Value=CTOD(' / / ') AND thisform.text2.Value=CTOD(' / / ') OR thisform.texto5.Value>0 OR thisform.texto7.Value>0
SELECT XREC.nro_clie,XREC.Nro,XREC.Tipo_op,XREC.Fecha,XREC.Sr,XREC.Nombre,XREC.Dni,XREC.Direccion,;
XREC.Ciudad,XREC.Nrocomb,ART1REC.Articulo,ART1REC.Descrip,;
ART1REC.Unid,ART1REC.Importe,ART1REC.Nrocomb;
FROM C:\GESTMAX4\RECIBO.DBF XREC INNER JOIN C:\GESTMAX4\ART1REC.DBF ART1REC ON XREC.NROCOMB = ART1REC.NROCOMB;
ORDER BY XREC.Nro,XREC.Fecha,XREC.Sr WHERE nro_clie>=thisform.texto5.value and nro_clie<=thisform.texto7.value
ENDIF
thisform.combo3.rowsource = ""
IF thisform.text3.Value#""
SELECT XREC.nro_clie,XREC.Nro,XREC.Tipo_op,XREC.Fecha,XREC.Sr,XREC.Nombre,XREC.Dni,XREC.Direccion,;
XREC.Ciudad,XREC.Nrocomb,ART1REC.Articulo,ART1REC.Descrip,;
ART1REC.Unid,ART1REC.Importe,ART1REC.Nrocomb;
FROM C:\GESTMAX4\RECIBO.DBF XREC INNER JOIN C:\GESTMAX4\ART1REC.DBF ART1REC ON XREC.NROCOMB = ART1REC.NROCOMB;
ORDER BY XREC.Nro,XREC.Fecha,XREC.Sr WHERE fecha>=thisform.text1.value and fecha<=thisform.text2.value AND Sr=thisform.text3.Value
ENDIF
thisform.combo3.rowsource = ""
lnFiles = _TALLY
nAnwer=6
nAnwer=7
IF lnFiles > 0
cMessageTitle = 'Mensaje'
cMessageText = '¿Desea Realizar un reporte?'
nDialogType = 4 + 32 + 256
* 4 = Botones Sí y No.
* 32 = Icono del signo de interrogación.
* 256 = El segundo botón es el predeterminado.
nAnswer = MESSAGEBOX(cMessageText, nDialogType, cMessageTitle)
DO CASE
CASE nAnswer = 6
CASE nAnswer = 7
thisform.Release
DO FORM formefechas
RETURN
ENDCASE
DEFINE WINDOW lw_Report FROM 0,0 TO SROWS(), ;
SCOLS() In SCREEN TITLE "Reporte Fecha Limite" ;
SYSTEM CLOSE NAME oPreview
ZOOM WINDOW lw_Report MAX
KEYBOARD '{CTRL+F10}' PLAIN CLEAR
IF thisform.text3.Value="" AND thisform.check2.Value=1 AND thisform.text1.Value=CTOD(' / / ') AND thisform.text2.Value=CTOD(' / / ') OR thisform.texto5.Value>0 OR thisform.texto7.Value>0
*REPORT ENTRE NRO CLIENTES
REPORT FORM repovtclie.frx FOR nro_clie>=thisform.texto5.value and nro_clie<=thisform.texto7.value PREVIEW IN SCREEN TO PRINTER prompt
ENDIF
IF thisform.text3.Value#""
REPORT FORM repovtclie.frx FOR fecha>=thisform.text1.value and fecha<=thisform.text2.value AND Sr=thisform.text3.Value PREVIEW IN SCREEN TO PRINTER prompt
ENDIF
thisform.Release
DO FORM FORMEFECHAS
ENDIF