*************************************************************************
*        		ATTESTATIONS ASSEDIC						*
*												*
* PR Cre le 04/09/01 : prise en charge des calculs / lectures		*
* des zones 7.1 et 7.3 des attestations ASSEDIC...				*
*												*
*************************************************************************

EXECUTE "SET-THOUS ."
EXECUTE "SET-DEC ,"
EXECUTE "DATE.FORMAT"
OPEN "", "CONTRAT" TO F.CONTRAT ELSE STOP
OPEN "", "CONTRATSPREV" TO F.CONTRATSPREV ELSE STOP
OPEN "", "RUBCHARGE" TO F.RUBCHARGE ELSE STOP
OPEN "", "TRANCHE" TO F.TRANCHE ELSE STOP
OPEN "", "DETAILCALCUL" TO F.DETAILCALCUL ELSE STOP
OPEN "", "ABSENCESAIDANT" TO F.ABSENCESAIDANT ELSE STOP
OPEN "", "CONSTANTESPAIE" TO F.CONSTANTESPAIE ELSE STOP
OPEN "", "TABLES" TO F.TABLES ELSE STOP
OPEN "", "REGRUBSAISIE" TO F.REGRUBSAISIE ELSE STOP
OPEN "", "CONVENTIONCOL" TO F.CONVENTIONCOL ELSE STOP
OPEN "", "RUBSAISIE" TO F.RUBSAISIE ELSE STOP
OPEN "", "TEMPO" TO F.TEMPO ELSE STOP

PROCREAD PARAMETRES ELSE STOP

W_Contrat = FIELD(PARAMETRES, "|", 2)
W_User = FIELD(PARAMETRES, "|", 3)

ENR_TEMPO = ""

READ ENR_CONTRAT FROM F.CONTRAT, W_Contrat ELSE ENR_CONTRAT = ""

IF ENR_CONTRAT = "" THEN
    PRINT "Erreur lecture contrat"
END ELSE
    
    READ ENR_CONSTANTESPAIE FROM F.CONSTANTESPAIE, "1" ELSE PRINT "Erreur ConstantesPaie"
    IF ENR_CONTRAT<58> < "200310" THEN
    	IF ENR_CONSTANTESPAIE<9> <= ICONV("01/":ENR_CONTRAT<58>[5,2]:"/":ENR_CONTRAT<58>[1,4], "D4/") THEN
	  	W_Monnaie = "EUROS"
   	END ELSE
	  	W_Monnaie = "FRANCS"
    	END
    END ELSE
	W_Monnaie = ""
    END

    READ ENR_TABLES FROM F.TABLES, "ABSENCES" ELSE PRINT "Erreur Tables"
    
    READ ENR_CONTRATSPREV FROM F.CONTRATSPREV, ENR_CONTRAT<29> ELSE ENR_CONTRATSPREV = ""
    W_RubriquesComplements = ""
    W_IndRub = 1
    i=1
    LOOP WHILE ENR_CONTRATSPREV<41,i> # "" 
	IF ENR_CONTRATSPREV<41,i> # "807" THEN
	    W_RubriquesComplements<W_IndRub> = ENR_CONTRATSPREV<41,i>
	    W_IndRub = W_IndRub + 1
	END
	i=i+1
    REPEAT
    i=1
    LOOP WHILE ENR_CONTRATSPREV<42,i> # "" 
	IF ENR_CONTRATSPREV<42,i> # "808" THEN
	    W_RubriquesComplements<W_IndRub> = ENR_CONTRATSPREV<42,i>
	    W_IndRub = W_IndRub + 1
	END
	i=i+1
    REPEAT

    * Pour tre sur que les rub "807" et "808" n'apparaissent 
    * qu'1 seule et unique fois dans la liste...

    W_RubriquesComplements<W_IndRub> = "807"
    W_IndRub = W_IndRub + 1
    W_RubriquesComplements<W_IndRub> = "808"

*********************************************************************************
*				Procdure Zone 7.1				*
*										*
*********************************************************************************

    * Maj 22/11/01 : Historique en fonction de la date du dernier jour travaill...
    W_Periode = OCONV(ENR_CONTRAT<51>,"D4/")
    W_Periode = W_Periode[7,4]:W_Periode[4,2]
    W_DateFinPeriode = ICONV("01/":W_Periode[5, 2]:"/":W_Periode[1,4], "D4/") - 1

    W_Periode = (W_Periode[1, 4] - 1):W_Periode[5, 2]
    W_DateFin = W_Periode + 1
    
    IF W_DateFin[5,2] = "13" THEN
        W_DateFin = (W_DateFin[1,4] + 1):"01"
    END
    
    * premier jour periode
    W_DateDebut = "01/":W_Periode[5,2]:"/":W_Periode[1,4]
    * dernier jour periode
    W_DateFin = "01/":W_DateFin[5,2]:"/":W_DateFin[1,4]
    W_DateFin = OCONV(ICONV(W_DateFin, "D4/") - 1, "D4/")
        
    * selection des absences de l'aidant sur la periode considre
    
    GOSUB 100
    
    IF W_RequeteAbsence<1> <> "" THEN
        k = 1
        W_FinMal = "False"
    END ELSE
        W_FinMal = "True"
    END
            
    W_FinBoucle = "False"
    W_MemoireJour = 0
	
    ENR_TEMPO<-1> =  "7.1"    

    * debut de boucle sur 12 mois
    FOR W_Mois = 1 TO 12
           
       * MAJ 30/05/01 : gestion Euro
        IF ENR_CONSTANTESPAIE<9> > ICONV(W_DateDebut, "D4/") AND W_Monnaie = "EUROS" THEN
            W_ConvEuro = "True"
        END ELSE
            W_ConvEuro = "False"
        END
        
        W_DebutMois = ICONV(W_DateDebut, "D4/")
        W_FinMois = ICONV(W_DateFin,"D4/")
        W_CumulJourAbsence = 0
        
        IF W_FinMal = "False" THEN
        
            * parcours des absences
            LOOP WHILE W_DebutMois <= W_RequeteAbsence<k,2> AND W_FinMois >= W_RequeteAbsence<k,1>[8,5] AND W_FinBoucle = "False"
                *determination periode absence
                IF W_RequeteAbsence<k,2> <= W_FinMois THEN
                    W_FinAbs = W_RequeteAbsence<k,2>
                END ELSE
                    W_FinAbs = W_FinMois
                END
                IF W_RequeteAbsence<k,1>[8,5] <= W_DebutMois THEN
                    W_DebutAbs = W_DebutMois
                END ELSE
                    W_DebutAbs = W_RequeteAbsence<k,1>[8,5]
                END
                * cumul des jours d'absences
                W_JourAbs = W_FinAbs - W_DebutAbs + 1
			IF W_RequeteAbsence<k,1>[6,2] = "03" THEN
		    		W_JourAbs = W_JourAbs / 2 
			END
                W_CumulJourAbsence = W_CumulJourAbsence + W_JourAbs
                *determination jour abs + motif
                IF W_JourAbs > W_MemoireJour THEN
                    W_MemoireJour = W_JourAbs
                    IF W_RequeteAbsence<k,1>[6,2] = "22" OR W_RequeteAbsence<k,1>[6,2] = "23" THEN
			    i = 1
                      LOOP WHILE ENR_TABLES<2,i> # "12"
                        i = i + 1
                      REPEAT
			    * Nb : absences injustifies et absences en attente indiques comme du congs sans solde
			  END ELSE
                      i = 1
                      LOOP WHILE W_RequeteAbsence<k,1>[6,2] <> ENR_TABLES<2,i>
                        i = i + 1
                      REPEAT
			  END
                    W_MemoireMotif = ENR_TABLES<3,i>
                END
                * recherche eventuel d'une autre absence sur le mois
                IF W_RequeteAbsence<k,2> <= W_FinMois THEN
                    k = k + 1
                    IF W_RequeteAbsence<k,1> = "" THEN
                        W_FinMal = "True"
                        W_FinBoucle = "True"
                    END
                END ELSE
                    W_FinBoucle = "True"
                END
            REPEAT
            W_FinBoucle = "False"
        END
        
        READ ENR_DETAILCALCUL FROM F.DETAILCALCUL, W_Contrat:W_Periode ELSE ENR_DETAILCALCUL = ""
        
        IF ENR_DETAILCALCUL # "" THEN
            
            *periode du au et date paie
            W_Str = "Du ":W_DateDebut:" au ":W_DateFin:" ":W_DateFin
            
            W_Virgule = ENR_DETAILCALCUL<6> / 100
	      W_Virgule = W_Virgule"R2" 
            W_Str = W_Str:W_Virgule"R 21"
                       
            *jours absences
            IF W_CumulJourAbsence <> 0 THEN
		    W_CumulJourAbsence = W_CumulJourAbsence"R2"
                W_Str = W_Str:W_CumulJourAbsence"R 16"
            END ELSE
                W_Str = W_Str:SPACE(16)
            END
            
            *Salaire brut
            i = 1
            W_SalBrut = 0
            LOOP WHILE ENR_DETAILCALCUL<2,i> # ""
		FOR t = 1 TO W_IndRub
                    IF ENR_DETAILCALCUL<2,i> = W_RubriquesComplements<t> THEN
                        W_SalBrut = W_SalBrut + ENR_DETAILCALCUL<5,i>
                    END
                NEXT t
                i = i + 1
            REPEAT
            W_SalBrut = (ENR_DETAILCALCUL<7> - W_SalBrut) / 100
            W_Virgule = W_SalBrut
            W_Virgule = W_Virgule"R2"
            W_Str = W_Str:W_Virgule"R 17"

            *prcompte ASSEDIC
            i = 1
            W_CumulValeur = 0
            W_Bool = "False"
            LOOP WHILE ENR_DETAILCALCUL<8,i> # ""
                READ ENR_RUBCHARGE FROM F.RUBCHARGE, ENR_DETAILCALCUL<8,i> ELSE ENR_RUBCHARGE = ""
                IF ENR_RUBCHARGE<16> = "02" THEN
                    READ ENR_TRANCHE FROM F.TRANCHE, ENR_RUBCHARGE<2> ELSE ENR_TRANCHE<10> = "03"
                    IF ENR_TRANCHE<10> # "03" THEN
                        IF ENR_RUBCHARGE<10> # "" THEN
                            W_CumulValeur = W_CumulValeur + ENR_DETAILCALCUL<11,i>
                            W_Bool = "True"
                        END
                    END
                END
                i = i + 1
            REPEAT
            
            IF W_Bool = "False" THEN
                W_Str = W_Str:SPACE(20)
            END ELSE
                W_Virgule = (W_CumulValeur / 100) * (-1)
                W_Virgule = W_Virgule"R2"
                W_Str = W_Str:W_Virgule"R 20"
            END
            
		IF ENR_CONTRAT<58> < "200301" THEN
	            *devise
      	      IF W_ConvEuro = "True" THEN
			    W_Str = W_Str:SPACE(3):"FRANCS":"   "
			END ELSE
			    W_Str = W_Str:SPACE(3):W_Monnaie"L 6":"   "
			END
		END ELSE
			W_Str = W_Str:SPACE(3)
		END
            
            *observation
            IF W_CumulJourAbsence # 0 THEN 
                W_Str = W_Str:W_MemoireMotif
            END ELSE
                W_Str = W_Str:" "
            END
            ENR_TEMPO<-1> = W_Str
        END ELSE
            
		W_Str = "Du ":W_DateDebut:" au ":W_DateFin:" ":W_DateFin

	    	W_Virgule = SPACE(21) 
            W_Str = W_Str:W_Virgule"R 21"
                       
            *jours absences
            IF W_CumulJourAbsence <> 0 THEN
		    W_CumulJourAbsence = W_CumulJourAbsence"R2"
                W_Str = W_Str:W_CumulJourAbsence"R 16":SPACE(17+20+12):W_MemoireMotif
            END ELSE
                W_Str = W_Str:SPACE(16)
            END
		ENR_TEMPO<-1> = W_Str
        END
        
        W_MemoireJour = 0
        
        *changement de mois
        W_Periode = W_Periode + 1
        IF W_Periode[5, 2] = "13" THEN
            W_Periode = (W_Periode[1, 4] + 1):"01"
        END
        W_DateFin = W_Periode + 1
        
        IF W_DateFin[5, 2] = "13" THEN
            W_DateFin = (W_DateFin[1,4] + 1):"01"
        END
        
        W_DateDebut = "01/":W_Periode[5,2]:"/":W_Periode[1,4]
        W_DateFin = "01/":W_DateFin[5,2]:"/":W_DateFin[1,4]
        W_DateFin = OCONV(ICONV(W_DateFin, "D4/") - 1, "D4/")
        
    NEXT W_Mois	

*********************************************************************************
*                           Procdure Zone 7.3					        *
*													  *
*********************************************************************************

    W_CumulMontantIndSom = 0
    W_CumulSalaireBrut = 0
    W_Motif = ""
    W_Montant = 0
    
    * monnaie
    ENR_TEMPO<-1> =  "7.3"
    ENR_TEMPO<-1> =  W_Monnaie
        
    * MODIFICATION AU 13/09/00
    W_DateDebPer = "01/":ENR_CONTRAT<58>[5,2]:"/":ENR_CONTRAT<58>[1,4]
    W_DateFinPer = ENR_CONTRAT<58> + 1
    IF W_DateFinPer[5,2] = "13" THEN
        W_DateFinPer = (W_DateFinPer[1,4] + 1):"01"
    END
    W_DateFinPer = "01/":W_DateFinPer[5,2]:"/":W_DateFinPer[1,4]
    W_DateFinPer = OCONV(ICONV(W_DateFinPer, "D4/") - 1, "D4/")
    
    IF ENR_CONTRAT<8> <= ICONV(W_DateFinPer, "D4/") AND ENR_CONTRAT<8> >= ICONV(W_DateDebPer, "D4/") THEN
        W_DateFinPer = OCONV(ENR_CONTRAT<8>, "D4/")
    END
    
    W_Str = "Periode du ":W_DateDebPer:" au ":W_DateFinPer:SPACE(12):"Date paie : "
    *FIN MODIF AU 19/09/00
    
    READ ENR_DETAILCALCUL FROM F.DETAILCALCUL, W_Contrat:ENR_CONTRAT<58> ELSE ENR_DETAILCALCUL = ""
    
    W_HeuresTrav = 0
    i = 1
    LOOP WHILE ENR_DETAILCALCUL<2,i> # ""
    
        W_IndicRegroup = "False"
	  GOSUB 200
        IF W_NbRub # 0 THEN
            FOR k = 1 TO W_NbRub
                IF ENR_DETAILCALCUL<2,i> = ENR_REGRUBSAISIE<k> THEN
                    W_IndicRegroup = "True"
                END
            NEXT k
        END
    
        IF ENR_DETAILCALCUL<2,i> # "800" AND ENR_DETAILCALCUL<2,i> # "809" AND ENR_DETAILCALCUL<2,i> # "801" AND ENR_DETAILCALCUL<2,i> # "804" AND ENR_DETAILCALCUL<2,i> # "820" AND W_IndicRegroup = "False" THEN
            READ ENR_RUBSAISIE FROM F.RUBSAISIE, ENR_DETAILCALCUL<2,i> ELSE ENR_RUBSAISIE = ""
            IF ENR_RUBSAISIE<2> = "3" OR ENR_RUBSAISIE<2> = "4" OR ENR_RUBSAISIE<2> = "5" THEN

			IF ENR_CONTRAT<1> = "02" AND ENR_RUBSAISIE<8> ="2" AND ENR_RUBSAISIE<9> <1000000 THEN
				W_HeuresTrav = W_HeuresTrav + INT(ENR_DETAILCALCUL<3,i>*ENR_RUBSAISIE<9>/1000000+1/2)
			END ELSE
				W_HeuresTrav = W_HeuresTrav + ENR_DETAILCALCUL<3,i>

			END
                		W_CumulSalaireBrut = W_CumulSalaireBrut + ENR_DETAILCALCUL<5,i>                
            END ELSE
                IF ENR_DETAILCALCUL<2,i> = "810" OR ENR_RUBSAISIE<2> = "6" THEN
                    W_CumulSalaireBrut = W_CumulSalaireBrut + ENR_DETAILCALCUL<5,i>
                END
            END
        END
        
        i = i + 1
        
    REPEAT

    W_HeuresTrav = W_HeuresTrav / 100
    W_HeuresTrav = W_HeuresTrav"R2" 
    ENR_TEMPO<-1> = W_Str:W_DateFinPer:SPACE(12):"Heures travailles : ":W_HeuresTrav"R 7":"     ":"Salaire brut : "
    
    
    W_CumulHeurePreavis = 0
    W_Nb = DCOUNT(ENR_DETAILCALCUL<2>,CHAR(253))

    FOR i = 1 TO W_Nb
        IF ENR_DETAILCALCUL<2,i> = "820" THEN
            W_CumulHeurePreavis = W_CumulHeurePreavis + ENR_DETAILCALCUL<5,i>
        END ELSE
            FOR j = 1 TO W_NbRub
                IF ENR_DETAILCALCUL<2,i> = ENR_REGRUBSAISIE<j> THEN
                    W_CumulHeurePreavis = W_CumulHeurePreavis + ENR_DETAILCALCUL<5,i>
                END
            NEXT j
        END
    NEXT i

    IF W_CumulHeurePreavis <> 0 THEN
	  W_CumulMontantIndSom = W_CumulMontantIndSom + W_CumulHeurePreavis
	  W_CumulHeurePreavis = W_CumulHeurePreavis / 100
	  W_CumulHeurePreavis = W_CumulHeurePreavis"R2"
        ENR_TEMPO<-1> =  W_CumulHeurePreavis"R 9"
        
    END ELSE
        ENR_TEMPO<-1> =  SPACE(20)
    END

    *ligne indemnit compen + nb jours ouvrables
    
    i = 1
    LOOP WHILE ENR_DETAILCALCUL<2,i> # "804" AND ENR_DETAILCALCUL<2,i> # ""
        i = i + 1
    REPEAT
    IF ENR_DETAILCALCUL<2,i> # "" THEN
	  W_Temp = ENR_DETAILCALCUL<5,i>/100
	  W_Temp = W_Temp"R2"

        ENR_TEMPO<-1> =  W_Temp"R 9"
        W_CumulMontantIndSom = W_CumulMontantIndSom + ENR_DETAILCALCUL<5,i> / 100
    END ELSE
        ENR_TEMPO<-1> =  SPACE(10)
    END


    *'jours ouvrables
    
    READ ENR_CONVENTIONCOL FROM F.CONVENTIONCOL, ENR_CONTRAT<1> ELSE ENR_CONVENTIONCOL = ""

    IF ENR_DETAILCALCUL<2,i> <> "" THEN
        *MODIFICATION 25/10/00
	  * Modif 09 10 01 : arrondi  la 1/2 journe la plus proche...
        IF ENR_CONTRAT<42> # 0 AND ENR_CONTRAT<42> # "" THEN
		W_Temp = INT(ENR_DETAILCALCUL<5,i> / ENR_CONTRAT<43> + 0.99)
		W_Temp = W_Temp"R2"
            ENR_TEMPO<-1> =  W_Temp"R 7"
        END ELSE
	  IF ENR_CONTRAT<44> # "" AND INT(ENR_CONTRAT<44>) # 0 THEN
            IF ENR_CONVENTIONCOL<2> = 2 THEN
		    W_Temp = INT(ENR_CONTRAT<44> / 100 + 0.99)
                W_Temp = W_Temp"R2"
                ENR_TEMPO<-1> =  W_Temp"R 7"
            END ELSE
		    W_Temp = INT(ENR_CONTRAT<44> * 5 / 6 / 100 + 0.99)
                W_Temp = W_Temp"R2"
                ENR_TEMPO<-1> =  W_Temp"R 7"
            END
	  END ELSE
	    W_NbJrsTravailles = ICONV(W_DateFinPer,"D4/") - ICONV(W_DateDebPer,"D4/")
	    W_NbJrsTotal = W_DateFinPer[4,2] + 1
	    IF W_NbJrsTotal = "13" THEN
		W_NbJrsTotal = 31
	    END ELSE
		W_NbJrsTotal = OCONV(ICONV("01/":W_NbJrsTotal:W_DateFinPer[6,5], "D4/") - 1, "D4/")
		W_NbJrsTotal = W_NbJrsTotal[1,2]
	    END
	    W_Temp = INT(W_NbJrsTravailles / W_NbJrsTotal * 2.5  + 0.99)
	    W_Temp = W_Temp"R2"
            ENR_TEMPO<-1> =  W_Temp"R 7"
	  END
        END
        *FIN MODIFICATION 25/10/00
    END ELSE
        ENR_TEMPO<-1> =  " "
    END

    *'total somme
    *'dont
    *'montant correspondant aux indemnits conventionnelles
    *'calcul indemnites
    W_Montant = 0
    
    i = 1
    LOOP WHILE ENR_DETAILCALCUL<2,i> # "809" AND ENR_DETAILCALCUL<2,i> # "801" AND ENR_DETAILCALCUL<2,i> # "800" AND ENR_DETAILCALCUL<2,i> # ""
        i = i + 1
    REPEAT

    BEGIN CASE 
        CASE ENR_DETAILCALCUL<2,i> MATCHES "809"
            W_Montant = ENR_DETAILCALCUL<5,i>
            W_CumulMontantIndSom = W_CumulMontantIndSom + ENR_DETAILCALCUL<5,i> / 100
            W_Motif = "Fin de mission"
        CASE ENR_DETAILCALCUL<2,i> MATCHES "801"
            W_Montant = ENR_DETAILCALCUL<5,i>
            W_CumulMontantIndSom = W_CumulMontantIndSom + (ENR_DETAILCALCUL<5,i> / 100)
            W_Motif = "Dpart  la retraite"
        CASE ENR_DETAILCALCUL<2,i> MATCHES "800"
            W_Montant = ENR_DETAILCALCUL<5,i>
            W_CumulMontantIndSom = W_CumulMontantIndSom + ENR_DETAILCALCUL<5,i> / 100
            W_Motif = "Licenciement"
    END CASE

    i = 1
    LOOP WHILE ENR_DETAILCALCUL<17,i> # "809" AND ENR_DETAILCALCUL<17,i> # "801" AND ENR_DETAILCALCUL<17,i> # "800" AND ENR_DETAILCALCUL<17,i> # ""
        i = i + 1
    REPEAT

    BEGIN CASE
        CASE ENR_DETAILCALCUL<17,i> MATCHES "809"
            W_Montant = W_Montant + ENR_DETAILCALCUL<20,i>
            W_CumulMontantIndSom = W_CumulMontantIndSom + ENR_DETAILCALCUL<20,i> / 100
            W_Motif = "Fin de mission"
        CASE ENR_DETAILCALCUL<17,i> MATCHES "801"
            W_Montant = W_Montant + ENR_DETAILCALCUL<20,i>
            W_CumulMontantIndSom = W_CumulMontantIndSom + (ENR_DETAILCALCUL<20,i> / 100)
            W_Motif = "Dpart  la retraite"
        CASE ENR_DETAILCALCUL<17,i> MATCHES "800"
            W_Montant = W_Montant + ENR_DETAILCALCUL<20,i>
            W_CumulMontantIndSom = W_CumulMontantIndSom + ENR_DETAILCALCUL<20,i> / 100
            W_Motif = "Licenciement"
    END CASE
    W_Montant=W_Montant/100
    W_Montant=W_Montant"R2"
    ENR_TEMPO<-1> =  W_Montant"R 9"
    ENR_TEMPO<-1> =  W_Motif"R 96"
    W_CumulSalaireBrut=W_CumulSalaireBrut/100
    W_CumulSalaireBrut = W_CumulSalaireBrut"R2"
    
    ENR_TEMPO<-1> =  W_CumulSalaireBrut"R 9"

END

WRITE ENR_TEMPO ON F.TEMPO, "ATTESTASSEDIC":W_User

STOP

100 * Equivalent ancienne procdure VB SelectionAbsences
IF ICONV(W_DateDebut,"D4/") < ENR_CONTRAT<7> THEN
	W_DateDebutAbs = ENR_CONTRAT<7>
END ELSE
	W_DateDebutAbs = ICONV(W_DateDebut,"D4/")
END
EXECUTE  'SSELECT ABSENCESAIDANT AVEC CodAbsAidant = "':W_Contrat[1,5]:']" AND AVEC DebAbsAidant <= "':W_DateFinPeriode:'" AND AVEC 2 >= "':W_DateDebutAbs:'"AND AVEC NumMotifAidant > "0" AND  < "7" OR = "13" OR = "12" OR = "22" OR = "23" PAR DebAbsAidant'
W_IndReq = 1
W_Fin = "F"
W_RequeteAbsence = ""
LOOP
	READNEXT W_Cle ELSE W_Fin = "V"
WHILE W_Fin = "F"
	READ ENR_ABSENCESAIDANT FROM F.ABSENCESAIDANT, W_Cle ELSE ENR_ABSENCESAIDANT = ""
	IF ENR_ABSENCESAIDANT # "" THEN
		W_RequeteAbsence<W_IndReq,1>=W_Cle
		W_RequeteAbsence<W_IndReq,2>=ENR_ABSENCESAIDANT<2>
		W_IndReq=W_IndReq + 1
	END    
REPEAT
RETURN

200 * remplissage de ENR_REGRUBSAISIE : rubriques types ASSEDIC
        
    READ ENR_REGRUBSAISIE FROM F.REGRUBSAISIE,"ASSEDIC" ELSE ENR_REGRUBSAISIE = ""
    
    IF ENR_REGRUBSAISIE = "" THEN
        W_NbRub = 0
    END ELSE
        W_NbRub = DCOUNT(ENR_REGRUBSAISIE, CHAR(254))
    END

RETURN
