PROC pIPRI022()
local oReport,Pagina:=nLinea := 1
local vTCRCos:=0,vTCRSal:=0,vTCRPub:=0,vTCRTot:=0
local vTentra:=0,vTsalid:=0,vTsaldo:=0
uFec:=dtoc(date())
uTim:=subs(time(),1,8)
vTRep:="REPORTE MOVIMIENTO DE INVENTARIO"
vTDes:="Fecha Desde: "+dtoc(vFecDE)+" Hasta: "+dtoc(vFecHA)
SELE d_inv01
SET FILT TO
SUM d_inv01->Entra TO vTentra
SUM d_inv01->Salid TO vTsalid
Dbgotop()
vTsaldo:=vTentra-vTsalid
EASYREPORT oVRD NAME ".\report\R_INVEN02.vrd" PREVIEW (.T.) //OF oDlg2
IF oVRD:lDialogCancel = .T.
RETURN( .F. )
ENDIF
PRINTAREA 1 OF oVRD;
ITEMIDS {101,102,103,104,106,107,105};
ITEMVALUES {alltrim(oLamcla:vGnom),"NIT: "+alltrim(oLamcla:vGnit),uFec,alltrim(uTim),vTRep,vTDes,Transform(Pagina,"999,999")}
PRINTAREA 2 OF oVRD
SELE d_inv01
SET FILT TO
Dbgotop()
Do While !EOF()
PRINTAREA 3 OF oVRD ;
ITEMIDS { 377, 390,378,305,307,309,308} ;
ITEMVALUES { if(d_inv01->Docum="LYM","INIC.",d_inv01->Docum),;
if(d_inv01->Conse="LYM","INIC.",d_inv01->Conse),;
Dtoc(d_inv01->Fecha),;
pDETIPDO(d_inv01->Contr),;
if(d_inv01->Entra#0,Transform(d_inv01->Entra,"999,999,999.99")," "),;
Transform(d_inv01->Subto,"999,999,999.99"),;
if(d_inv01->Salid#0,Transform(d_inv01->Salid,"999,999,999.99")," ")}
SELE d_inv01
d_inv01->(DBSKIP())
IF oVRD:nNextRow > oVRD:nPageBreak
PAGEBREAK oVRD
pagina:=pagina+1
PRINTAREA 1 OF oVRD;
ITEMIDS {101,102,103,104,106,107,105};
ITEMVALUES {alltrim(oLamcla:vGnom),"NIT: "+alltrim(oLamcla:vGnit),uFec,alltrim(uTim),vTRep,vTDes,Transform(Pagina,"999,999")}
PRINTAREA 2 OF oVRD
ENDIF
EndDo
PRINTAREA 4 OF oVRD ;
ITEMIDS {403,404,405};
ITEMVALUES {Transform(vTentra,"999,999,999.99"),Transform(vTsalid,"999,999,999.99"),Transform(vTsaldo,"999,999,999.99")}
END EASYREPORT oVRD