*BGETSTO
*EDITION DES STOCKS VIN BOUT ET VRAC PAR PRODUITS
TITRE = "EDITION DU RECAPITULATIF STOCKS"
DO WHILE .T.
DO TITRE
SELE 2
USE SDFACTURE INDEX FACTURN
GO BOTT
VFAC=NUMERO
VNOMFAC=NOMCLI
USE
SELE 1
USE SDARTI INDEX SDARTI
GO TOP
pol1=CHR(27)+"&l0O"+chr(27)+"(s12U"+chr(27)+"(s0P"+chr(27)+"(s12H"+chr(27)+"(s12V"+chr(27)+"(s0S"+chr(27)+"(s0B"+chr(27)+"(s3T"
pol2=CHR(27)+"&l0O"+chr(27)+"(s12U"+chr(27)+"(s0P"+chr(27)+"(s16H"+chr(27)+"(s12V"+chr(27)+"(s0S"+chr(27)+"(s0B"+chr(27)+"(s3T"
pol3=CHR(27)+"&l0O"+chr(27)+"(s12U"+chr(27)+"(s1P"+chr(27)+"(s5H"+chr(27)+"(s24V"+chr(27)+"(s0S"+chr(27)+"(s0B"+chr(27)+"(s6T"
SET PRINT ON
set margin to 0
??chr(27)+"&l0L"+pol1
*+chr(27)+"&l0E"
totstock=0
totres=0
pp=1 
DO WHILE .NOT. EOF()
if prow()<4
?
? " SA DOMAINE AF GROS       STOCK AU ",DATE(),"page "+str(pp,2,0)
? "DERNIERE FACTURE ",VFAC,VNOMFAC
?
?"   article                    stock regie    stock btl    reserv‚       dispo           bt"
?
endi
IF FAMILLE ="B" .OR. FAMILLE ="CP".OR. FAMILLE="BTL".OR.FAMILLE ="VRA"
IF QUANTITE #0
if res <0
replace res with 0
endi
?"--------------------------------------------------------------------------------------------"
? pol2+designart+" :"+pol1+str(QUANTITE,10,2)+"  "+str(quantite/0.75,10,2)+"   "+str(res,9,2)+" ",quantite-res,(quantite-res)/0.75
if famille="B".or. famille ="VRA"
totstock=totstock+quantite
totres=totres+res
endi    
ENDI
ENDI
if prow()>60
pp=pp+1
eject
endi
SKIP
ENDDO
?
?pol1+"Totaux                       :"+str(totstock,10,2)+"     RESERVES           :"+str(totres,6,0)
?
GO TOP
totstock=0
totres=0
DO WHILE .NOT. EOF()
IF FAMILLE ="V"
IF QUANTITE #0
?"                     -----------------------------------------------------------------"
? pol2+designart+" :"+pol1+str(QUANTITE,10,2)+"  "+str(quantite/0.75,10,2),res," ",quantite-res,(quantite-res)/0.75
ENDI    
ENDI
SKIP
ENDDO
CLOSE DATA
eject
SET PRINT OFF
RETU


