* anulation des resevations / jour ou / client
titre ="ANULATIONS RESERVATIONS"
niveau =2
************
*BASES SDARTI FICHIER ARTICLES INDEX CODEARTI
*BASES reserv LIGNES DE RESERVATION
*FENETRE POUR FAIRE DEFILER LES ARTICES L7 0 L17
CLEAR
SET DELET ON
DO titre
NLFAC=40
NLPG=66
NLET=5
SET ESCAP OFF
SELECT 1
USE RESERV   INDEX RESERV ,RESERVN ALIAS res
SELE 2
USE SDARTI INDEX SDARTI ALIAS AR
SELE 1
SET relation TO codearti into ar
WSET window clients TO 7,39,17,78
WSET window articles TO 7,1,17,38
WSET window saisie TO 19,1,24,78
WSELE 3
WUSE SAISIE
WSELE 2
WUSE articles
WSELE 1
WUSE clients
DO WHILE .T.
VCODE = SPACE(34)
GO TOP
WSELE 0
rep=" "
@ 7,12 SAY "ANULATION PAR CLIENT OU PAR DATE C/D"GET REP PICTURE "@!" HELP "ATTENTION !!! toutes les
READ
IF REP =" "
EXIT
ENDI
IF rep ="D"
SET EXACT OFF
date1 =CTOD("  /  /  ")
@ 10,2 SAY "date d'anulation " GET date1 VALID (date1 <date()+1)
vrech =date1
*SET order TO 2
FIND &Vrech
SET EXACT ON
***************************
champs ="QUANTITE,codearti,SUBSTR(NOMCLI,1,18),date"
ligne = "quantite,codearti,substr(nomcli,1,18),date"
WL=11
DO afpresw1
IF  CAR =KEYCR
DO WHILE date=date1
DO AFPRESF3
rep="R"
@ 5,2 SAY "Anuler reserv  Rien Fin" GET rep
rep =upper(rep)
DO CASE
CASE rep="A"
chx="N"
@ 4,2 SAY "Etes vous sr O/N" GET chx PICTURE "!"
IF chx="O"
DO afcalcm
DELETE
CASE REP="F"
endc
IF .NOT. EOF()
SKIP
endd
endi
ELSE
rep="N"
@ 10,12 SAY "CLIENT " GET VCODE PICTURE "@!"
IF VCODE  =SPACE(34)
vrech =VCODE
SET order TO 2
vcode=nomcli
DO WHILE nomcli=vcode
@ 5,2 SAY "Anuler reserv Rien Fin " GET rep
ENDC
enddo
ENDD
CLOSE DATA
WRELEASE ALL
RETU