Static | ZeroBOX

Original


                                        Attribute VB_Name = "ThisWorkbook"
Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

                                    

Deobfuscated


                                        Attribute VB_Name = "ThisWorkbook"
Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

                                    

Original


                                        Attribute VB_Name = "Feuil1"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

                                    

Deobfuscated


                                        Attribute VB_Name = "Feuil1"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

                                    

Original


                                        Attribute VB_Name = "Feuil2"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

                                    

Deobfuscated


                                        Attribute VB_Name = "Feuil2"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

                                    

Original


                                        Attribute VB_Name = "Feuil3"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

                                    

Deobfuscated


                                        Attribute VB_Name = "Feuil3"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

                                    

Original


                                        Attribute VB_Name = "Module1"
Sub EDI()


' On Error GoTo Erreurs

'             DECLARATIONS

Dim sChemin As String
Dim sFichier As String
Dim sEntete As String
Dim sDetail As String
Dim sPied As String
Dim sCommuneSte As String
Dim sDate2 As String

Dim nCptMois As Integer


Dim sReferenceFichier As String
Dim sNatureFichier As String
Dim sLibelleVirement As String
Dim nStart As Integer
Dim nEnd As Integer
Dim nEffectifPermanent As Integer
Dim nEffectifOccasionnel As Integer
Dim nEffectifStagiaire As Integer
Dim nTotBrutImpoPP As Double
Dim nTotNetImpoPP As Double
Dim nTotDeductionPP As Double
Dim nTotIrPrelevePP As Double
Dim nTotBrutSommePO As Double
Dim nTotIrPrelevePO As Double
Dim nTotBrutTraitSalaireSTG As Double
Dim nTotBrutIndemnitesSTG As Double
Dim nTotRetenuesSTG As Double
Dim nTotRevenuNetImpSTG As Double
Dim nTotSommePayeRTS As Double
Dim nMontantPermanent As Double
Dim nMontantStagiaire As Double
Dim nMontantOccasionnel As Double
Dim sDateAutorisation As String
Dim sDatePermis As String
Dim nFraisProf As Double
Dim nVar1 As Double
Dim nVar2 As Double
Dim nTotFraisProf As Double

nTotFraisProf = 0










'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++++++++++++++++++++++++++                     ++++++++++++++++++++++++++++++++++
'+++++++++++++++++++++++++++    Préalables       ++++++++++++++++++++++++++++++++++
'+++++++++++++++++++++++++++                     ++++++++++++++++++++++++++++++++++
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



'Récuprer le chemin ou sera stocké le fichier EDI

sChemin = ""



  'DateVir = Range("N11")
 
 


'Intitalisation

'nMontant_Total = 0

'Date sous format AAAAMMJJ
'sDate = fnFormatDate(CDate(sDateVir))
'sDate2 = fnFormatDate2(CDate(sDateVir))


'Format du fichier

sFichier = sChemin & "Traitementetsalaire_" & Right(Range("B5"), 4) & ".xml"


'Création du Fichier

Set Fsys = CreateObject("Scripting.FileSystemObject")
Set Monfic = Fsys.CreateTextFile(sFichier)
With Monfic 'Pour écrire dans le fichier texte
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++++++++++++++++++++++++++ ENTETE FICHIER EDI ++++++++++++++++++++++++++++++++++
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  
    
    sEntete = "<?xml version=""1.0"" encoding=""UTF-8""?>"
                .writeLine sEntete
                
    sEntete = "<TraitementEtSalaire xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:noNamespaceSchemaLocation=""traitementSalaire.xsd"">"
                .writeLine sEntete
                
                    
    '------------------------------------------------
    
    sEntete = "     <identifiantFiscal>"
    sEntete = sEntete & Range("B11")
    sEntete = sEntete & "</identifiantFiscal>"
    .writeLine sEntete
                
    sEntete = "     <nom>" & Replace(Range("C11"), "'", " ") & "</nom>"
    .writeLine sEntete
                
    sEntete = "     <prenom>" & Replace(Range("D11"), "'", " ") & "</prenom>"
    .writeLine sEntete
                
    sEntete = "     <raisonSociale>"
    sEntete = sEntete & Range("E11")
    sEntete = sEntete & "</raisonSociale>"
    .writeLine sEntete
                
    sEntete = "     <exerciceFiscalDu>"
    sEntete = sEntete & Right(Range("B5"), 4) & "-01-01"
    sEntete = sEntete & "</exerciceFiscalDu>"
    .writeLine sEntete
                
    sEntete = "     <exerciceFiscalAu>"
    sEntete = sEntete & Right(Range("B5"), 4) & "-12-31"
    sEntete = sEntete & "</exerciceFiscalAu>"
    .writeLine sEntete
                
    sEntete = "     <annee>" & Right(Range("B5"), 4) & "</annee>"
    .writeLine sEntete
   

    
    '------------------------------------------------
    
    
    
    sEntete = "     <commune><code>" & Range("H11") & "</code></commune>"
    .writeLine sEntete
    
    
    'sEntete = "     <profession>" & SUPPRACCENT(Range("I11")) & "</profession>"
    '.writeLine sEntete
    
    sEntete = "     <adresse>" & SUPPRACCENT(Range("J11")) & "</adresse>"
    .writeLine sEntete
    
    sEntete = "     <numeroCIN>" & Range("K11") & "</numeroCIN>"
    .writeLine sEntete
    
    sEntete = "     <numeroCNSS>" & Range("M11") & "</numeroCNSS>"
    .writeLine sEntete
        
    sEntete = "     <numeroCE>" & Range("L11") & "</numeroCE>"
    .writeLine sEntete
    

    sEntete = "     <numeroRC>" & Range("N11") & "</numeroRC>"
    .writeLine sEntete

    sEntete = "     <identifiantTP>" & Range("O11") & "</identifiantTP>"
    .writeLine sEntete
    
    sEntete = "     <numeroFax>" & Range(" P11") & "</numeroFax>"
    .writeLine sEntete
    
    sEntete = "     <numeroTelephone>" & Range("Q11") & "</numeroTelephone>"
    .writeLine sEntete
    
    sEntete = "     <email>" & Range("R11") & "</email>"
    .writeLine sEntete
    
  
    

'-----EFFECTIF GLOBALE-------
nStart = 11
For i = nStart To 99999999 Step 1
      
      nEnd = i
      sCase = Range("S" & i)
      If (sCase = "" Or sCase = "VRS") Then Exit For
        
Next


sEntete = "     <effectifTotal>" & (nEnd - nStart) & "</effectifTotal>"
.writeLine sEntete

nTotBrutImpoPP = 0
nTotNetImpoPP = 0
nTotDeductionPP = 0
nTotIrPrelevePP = 0
nTotBrutSommePO = 0
nTotIrPrelevePO = 0
nTotBrutTraitSalaireSTG = 0
nTotBrutIndemnitesSTG = 0
nTotRetenuesSTG = 0
nTotRevenuNetImpSTG = 0
nTotSommePayeRTS = 0
nMontantPermanent = 0
nMontantStagiaire = 0
nMontantOccasionnel = 0
nTotFraisProf = 0

'--------------------------------------------------------------------
'-----EFFECTIFS GLOBALE & PERMANENT & STAGIAIRE & OCCASIONNEL--------
'--------------------------------------------------------------------
nStart = 11
For i = nStart To 99999999 Step 1
      
      sCase = Range("S" & i)
      If sCase = "PP" Then
            
            '----Calcul frais prof-----------
            nVar1 = 0
            nVar2 = 0
            nVar1 = Range("AI" & i) * 0.2
            nVar2 = (Range("AC" & i) * 2500) / 26
            If nVar1 >= nVar2 Then
                nTotFraisProf = nVar2
            Else
                nTotFraisProf = nVar1
            End If
            '----------------------------------
            nEffectifPermanent = nEffectifPermanent + 1
            nTotBrutImpoPP = nTotBrutImpoPP + Range("AI" & i)
            nTotNetImpoPP = nTotNetImpoPP + Range("AM" & i)
            nTotDeductionPP = nTotDeductionPP + Range("AE" & i) + nTotFraisProf + Range("AK" & i) + Range("AL" & i)
            nTotIrPrelevePP = nTotIrPrelevePP + Range("AN" & i)
            nMontantPermanent = nMontantPermanent + Range("AB" & i)
            
      End If
    
            
      If sCase = "PO" Then
            nEffectifOccasionnel = nEffectifOccasionnel + 1
            nTotBrutSommePO = nTotBrutSommePO + Range("AB" & i)
            nTotIrPrelevePO = nTotIrPrelevePO + Range("AN" & i)
            nMontantOccasionnel = nMontantOccasionnel + Range("AB" & i)
      End If
      
      If sCase = "STG" Then
            nEffectifStagiaire = nEffectifStagiaire + 1
            nTotBrutTraitSalaireSTG = nTotBrutTraitSalaireSTG + Range("AB" & i)
            nTotBrutIndemnitesSTG = nTotBrutIndemnitesSTG + Range("AG" & i)
            nTotRetenuesSTG = nTotRetenuesSTG + Range("AL" & i)
            nTotRevenuNetImpSTG = nTotRevenuNetImpSTG + Range("AM" & i)
            nMontantStagiaire = nMontantStagiaire + Range("AB" & i)
            
      End If
      
      If sCase = "" Then Exit For
        
Next

nTotSommePayeRTS = nMontantPermanent + nMontantOccasionnel + nMontantStagiaire

'----------------Affichage Effectifs--------------------------------------

sEntete = "     <nbrPersoPermanent>" & nEffectifPermanent & "</nbrPersoPermanent>"
.writeLine sEntete

sEntete = "     <nbrPersoOccasionnel>" & nEffectifOccasionnel & "</nbrPersoOccasionnel>"
.writeLine sEntete

sEntete = "     <nbrStagiaires>" & nEffectifStagiaire & "</nbrStagiaires>"
.writeLine sEntete

'---------------Affichage des totaux---------------------------------------------

sEntete = "     <totalMtRevenuBrutImposablePP>" & Replace(Format$(nTotBrutImpoPP, "0.00"), ",", ".") & "</totalMtRevenuBrutImposablePP>"
.writeLine sEntete

sEntete = "     <totalMtRevenuNetImposablePP>" & Replace(Format$(nTotNetImpoPP, "0.00"), ",", ".") & "</totalMtRevenuNetImposablePP>"
.writeLine sEntete

sEntete = "     <totalMtTotalDeductionPP>" & Replace(Format$(nTotDeductionPP, "0.00"), ",", ".") & "</totalMtTotalDeductionPP>"
.writeLine sEntete

sEntete = "     <totalMtIrPrelevePP>" & Replace(Format$(nTotIrPrelevePP, "0.00"), ",", ".") & "</totalMtIrPrelevePP>"
.writeLine sEntete

sEntete = "     <totalMtBrutSommesPO>" & Replace(Format$(nTotBrutSommePO, "0.00"), ",", ".") & "</totalMtBrutSommesPO>"
.writeLine sEntete

sEntete = "     <totalIrPrelevePO>" & Replace(Format$(nTotIrPrelevePO, "0.00"), ",", ".") & "</totalIrPrelevePO>"
.writeLine sEntete

sEntete = "     <totalMtBrutTraitSalaireSTG>" & Replace(Format$(nTotBrutTraitSalaireSTG, "0.00"), ",", ".") & "</totalMtBrutTraitSalaireSTG>"
.writeLine sEntete

sEntete = "     <totalMtBrutIndemnitesSTG>" & Replace(Format$(nTotBrutIndemnitesSTG, "0.00"), ",", ".") & "</totalMtBrutIndemnitesSTG>"
.writeLine sEntete

sEntete = "     <totalMtRetenuesSTG>" & Replace(Format$(nTotRetenuesSTG, "0.00"), ",", ".") & "</totalMtRetenuesSTG>"
.writeLine sEntete

sEntete = "     <totalMtRevenuNetImpSTG>" & Replace(Format$(nTotRevenuNetImpSTG, "0.00"), ",", ".") & "</totalMtRevenuNetImpSTG>"
.writeLine sEntete

sEntete = "     <totalSommePayeRTS>" & Replace(Format$(nTotSommePayeRTS, "0.00"), ",", ".") & "</totalSommePayeRTS>"
.writeLine sEntete

sEntete = "     <totalmtAnuuelRevenuSalarial>" & "0.00" & "</totalmtAnuuelRevenuSalarial>"
.writeLine sEntete

sEntete = "     <totalmtAbondement>" & "0.00" & "</totalmtAbondement>"
.writeLine sEntete

sEntete = "     <montantPermanent>" & Replace(Format$(nMontantPermanent, "0.00"), ",", ".") & "</montantPermanent>"
.writeLine sEntete

sEntete = "     <montantOccasionnel>" & Replace(Format$(nMontantOccasionnel, "0.00"), ",", ".") & "</montantOccasionnel>"
.writeLine sEntete

sEntete = "     <montantStagiaire>" & Replace(Format$(nMontantStagiaire, "0.00"), ",", ".") & "</montantStagiaire>"
.writeLine sEntete

sEntete = "     <referenceDeclaration>" & Range("A11") & "</referenceDeclaration>"
.writeLine sEntete

'--------Affichage Liste Personnel Permanent------------

sEntete = "     <listPersonnelPermanent>"
.writeLine sEntete

nStart = 11
For i = nStart To 99999999 Step 1
      
      sCase = Range("S" & i)
      If sCase = "PP" Then
                sEntete = "         <PersonnelPermanent>"
                .writeLine sEntete
                
                sEntete = "             <nom>" & SUPPRACCENT(Range("T" & i)) & "</nom>"
                .writeLine sEntete
                
                sEntete = "             <prenom>" & SUPPRACCENT(Range("U" & i)) & "</prenom>"
                .writeLine sEntete
                
                sEntete = "             <adressePersonnelle>" & Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(SUPPRACCENT(Range("V" & i)), "«", ""), "»", ""), "-", " "), "'", " "), "(", " "), ")", " "), ";", " "), "  ", " "), "   ", " "), "    ", " ") & "</adressePersonnelle>"
                .writeLine sEntete
                
                sEntete = "             <numCNI>" & Range("W" & i) & "</numCNI>"
                .writeLine sEntete

                sEntete = "             <numCE>" & Range("X" & i) & "</numCE>"
                .writeLine sEntete
                
                sEntete = "             <numPPR>" & Range("Y" & i) & "</numPPR>"
                .writeLine sEntete
                
                sEntete = "             <numCNSS>" & Range("Z" & i) & "</numCNSS>"
                .writeLine sEntete
                
                sEntete = "             <ifu>" & Range("AA" & i) & "</ifu>"
                .writeLine sEntete
                
                sEntete = "             <mtBrutTraitementSalaire>" & Replace(Format$(Range("AB" & i), "0.00"), ",", ".") & "</mtBrutTraitementSalaire>"
                .writeLine sEntete
                
                sEntete = "             <periode>" & Replace(Format$(Range("AC" & i), "0"), ",", ".") & "</periode>"
                .writeLine sEntete
                
                sEntete = "             <mtExonere>" & Replace(Format$(Range("AD" & i), "0.00"), ",", ".") & "</mtExonere>"
                .writeLine sEntete
                
                sEntete = "             <mtEcheances>" & Replace(Format$(Range("AE" & i), "0.00"), ",", ".") & "</mtEcheances>"
                .writeLine sEntete
                
                sEntete = "             <nbrReductions>" & Replace(Format$(Range("AF" & i), "0"), ",", ".") & "</nbrReductions>"
                .writeLine sEntete
                
                sEntete = "             <mtIndemnite>" & Replace(Format$(Range("AG" & i), "0.00"), ",", ".") & "</mtIndemnite>"
                .writeLine sEntete

                sEntete = "             <mtAvantages>" & Replace(Format$(Range("AH" & i), "0.00"), ",", ".") & "</mtAvantages>"
                .writeLine sEntete
                
                sEntete = "             <mtRevenuBrutImposable>" & Replace(Format$(Range("AI" & i), "0.00"), ",", ".") & "</mtRevenuBrutImposable>"
                .writeLine sEntete
                
                '----Calcul frais prof-----------
                nVar1 = 0
                nVar2 = 0
                nVar1 = Range("AI" & i) * 0.2
                nVar2 = (Range("AC" & i) * 2500) / 26
                If nVar1 >= nVar2 Then
                nFraisProf = nVar2
                Else
                nFraisProf = nVar1
                End If
                '--------------------------------
                
                sEntete = "             <mtFraisProfess>" & Replace(Format$(Range("AJ" & i), "0.00"), ",", ".") & "</mtFraisProfess>"
                'sEntete = "             <mtFraisProfess>" & Replace(Format$(nFraisProf, "0.00"), ",", ".") & "</mtFraisProfess>"
                
                .writeLine sEntete
                
                sEntete = "             <mtCotisationAssur>" & Replace(Format$(Range("AK" & i), "0.00"), ",", ".") & "</mtCotisationAssur>"
                .writeLine sEntete
                
                sEntete = "             <mtAutresRetenues>" & Replace(Format$(Range("AL" & i), "0.00"), ",", ".") & "</mtAutresRetenues>"
                .writeLine sEntete
                
                sEntete = "             <mtRevenuNetImposable>" & Replace(Format$(Range("AM" & i), "0.00"), ",", ".") & "</mtRevenuNetImposable>"
                .writeLine sEntete
                
                sEntete = "             <mtTotalDeduction>" & Replace(Format$((Range("AE" & i) + Range("AJ" & i) + Range("AK" & i) + Range("AL" & i)), "0.00"), ",", ".") & "</mtTotalDeduction>"
                .writeLine sEntete
                
                sEntete = "             <irPreleve>" & Replace(Format$(Range("AN" & i), "0.00"), ",", ".") & "</irPreleve>"
                .writeLine sEntete
                
                sEntete = "             <casSportif>" & "false" & "</casSportif>"
                .writeLine sEntete
                
                
                
                sEntete = "             <numMatricule>" & Range("AO" & i) & "</numMatricule>"
                .writeLine sEntete
                

                sDatePermis = Range("AP" & i)
                If sDatePermis = "" Then
                    sDatePermis = "1900-01-01"
                    Else
                    sDatePermis = fnFormatDate2(Range("AP" & i))
                End If
                
                sEntete = "             <datePermis>" & sDatePermis & "</datePermis>"
                .writeLine sEntete
                
                sDateAutorisation = Range("AQ" & i)
                If sDateAutorisation = "" Then
                    sDateAutorisation = "1900-01-01"
                    Else
                    sDateAutorisation = fnFormatDate2(Range("AQ" & i))
                End If

                sEntete = "             <dateAutorisation>" & sDateAutorisation & "</dateAutorisation>"
                .writeLine sEntete
                
                sEntete = "             <refSituationFamiliale><code>" & UCase((Range("AR" & i))) & "</code></refSituationFamiliale>"
                .writeLine sEntete
                
                sEntete = "             <refTaux><code>" & Range("AS" & i) & "</code></refTaux>"
                .writeLine sEntete
                
                sEntete = "         </PersonnelPermanent>"
                .writeLine sEntete
      End If
      If sCase = "" Then Exit For

Next
sEntete = "     </listPersonnelPermanent>"
.writeLine sEntete

'--------Affichage Liste Personnel Occasionnel------------

If nEffectifOccasionnel > 0 Then
sEntete = "     <listPersonnelOccasionnel>"
.writeLine sEntete
End If

nStart = 11
For i = nStart To 99999999 Step 1
      
      sCase = Range("S" & i)
      If sCase = "PO" Then
                sEntete = "         <PersonnelOccasionnel>"
                .writeLine sEntete
                
                sEntete = "             <nom>" & Range("T" & i) & "</nom>"
                .writeLine sEntete
                
                sEntete = "             <prenom>" & Range("U" & i) & "</prenom>"
                .writeLine sEntete
                
                sEntete = "             <adressePersonnelle>" & Replace(Replace(Replace((Range("V" & i)), "   ", ""), "°", " "), "é", "e") & "</adressePersonnelle>"
                .writeLine sEntete
                
                sEntete = "             <numCNI>" & Range("W" & i) & "</numCNI>"
                .writeLine sEntete

                sEntete = "             <numCE>" & Range("X" & i) & "</numCE>"
                .writeLine sEntete
                
                sEntete = "             <ifu>" & Range("AA" & i) & "</ifu>"
                .writeLine sEntete

                sEntete = "             <mtBrutSommes>" & Replace(Format$(Range("AB" & i), "0.00"), ",", ".") & "</mtBrutSommes>"
                .writeLine sEntete

                sEntete = "             <irPreleve>" & Replace(Format$(Range("AN" & i), "0.00"), ",", ".") & "</irPreleve>"
                .writeLine sEntete
                
                
                sEntete = "             <profession>" & Replace(Range("AT" & i), "é", "e") & "</profession>"
                .writeLine sEntete


                sEntete = "         </PersonnelOccasionnel>"
                .writeLine sEntete
      End If
      If sCase = "" Then Exit For

Next

If nEffectifOccasionnel > 0 Then
sEntete = "     </listPersonnelOccasionnel>"
.writeLine sEntete
End If



'--------Affichage Liste Personnel Stagiaire------------

If nEffectifStagiaire > 0 Then
sEntete = "     <listStagiaires>"
.writeLine sEntete
End If


nStart = 11
For i = nStart To 99999999 Step 1
      
      sCase = Range("S" & i)
      If sCase = "STG" Then
                sEntete = "         <Stagiaire>"
                .writeLine sEntete

                sEntete = "             <nom>" & Range("T" & i) & "</nom>"
                .writeLine sEntete
                
                sEntete = "             <prenom>" & Range("U" & i) & "</prenom>"
                .writeLine sEntete
                
                sEntete = "             <adressePersonnelle>" & Replace(Replace(Replace((Range("V" & i)), "   ", ""), "°", " "), "é", "e") & "</adressePersonnelle>"
                .writeLine sEntete
                
                sEntete = "             <numCNI>" & Range("W" & i) & "</numCNI>"
                .writeLine sEntete

                sEntete = "             <numCE>" & Range("X" & i) & "</numCE>"
                .writeLine sEntete
                
                sEntete = "             <numCNSS>" & Range("Z" & i) & "</numCNSS>"
                .writeLine sEntete
                
                sEntete = "             <ifu>" & Range("AA" & i) & "</ifu>"
                .writeLine sEntete


                sEntete = "             <mtBrutTraitementSalaire>" & Replace(Format$(Range("AB" & i), "0.00"), ",", ".") & "</mtBrutTraitementSalaire>"
                .writeLine sEntete
                
                sEntete = "             <mtBrutIndemnites>" & Replace(Format$(Range("AG" & i), "0.00"), ",", ".") & "</mtBrutIndemnites>"
                .writeLine sEntete
                
                sEntete = "             <mtRetenues>" & Replace(Format$(Range("AL" & i), "0.00"), ",", ".") & "</mtRetenues>"
                .writeLine sEntete
                
                sEntete = "             <mtRevenuNetImposable>" & Replace(Format$(Range("AM" & i), "0.00"), ",", ".") & "</mtRevenuNetImposable>"
                .writeLine sEntete
                
                sEntete = "             <periode>" & Replace(Format$(Range("AC" & i), "0"), ",", ".") & "</periode>"
                .writeLine sEntete
                

                sEntete = "         </Stagiaire>"
                .writeLine sEntete
      End If
      If sCase = "" Then Exit For

Next

If nEffectifStagiaire > 0 Then
sEntete = "     </listStagiaires>"
.writeLine sEntete
End If



'--------Affichage Liste Versement------------

nCptMois = 1

sEntete = "     <listVersements>"
.writeLine sEntete

nStart = 11
For i = nStart To 99999999 Step 1
      
      sCase = Range("S" & i)
      If (sCase = "VRS" And Range("AU" & i) = nCptMois) Then
                
                sEntete = "         <VersementTraitementSalaire>"
                .writeLine sEntete

                sEntete = "             <mois>" & Range("AU" & i) & "</mois>"
                .writeLine sEntete
                
                sEntete = "             <totalVersement>" & Replace(Format$(Range("AV" & i), "0.00"), ",", ".") & "</totalVersement>"
                .writeLine sEntete

                sEntete = "             <dateDerniereVersment>" & fnFormatDate2(Range("AW" & i)) & "</dateDerniereVersment>"
                .writeLine sEntete
                
                sEntete = "             <listDetailPaiement>"
                .writeLine sEntete
                
                For J = nStart To 99999999 Step 1
                
                sCase1 = Range("S" & J)
                If (sCase = "VRS" And Range("AU" & J) = nCptMois) Then
                
                sEntete = "                     <DetailPaiementTraitementSalaire>"
                .writeLine sEntete

                sEntete = "                              <reference>" & Range("AX" & J) & "</reference>"
                .writeLine sEntete
                
                sEntete = "                              <totalVerse>" & Replace(Format$(Range("AY" & J), "0.00"), ",", ".") & "</totalVerse>"
                .writeLine sEntete
                
                sEntete = "                              <principal>" & Replace(Format$(Range("AZ" & J), "0.00"), ",", ".") & "</principal>"
                .writeLine sEntete
                
                sEntete = "                              <penalite>" & Replace(Format$(Range("BA" & J), "0.00"), ",", ".") & "</penalite>"
                .writeLine sEntete
                
                sEntete = "                              <majorations>" & Replace(Format$(Range("BB" & J), "0.00"), ",", ".") & "</majorations>"
                .writeLine sEntete
                
                sEntete = "                              <dateVersement>" & fnFormatDate2(Range("BC" & J)) & "</dateVersement>"
                .writeLine sEntete
                
                sEntete = "                              <refMoyenPaiement><code>" & Range("BD" & J) & "</code></refMoyenPaiement>"
                .writeLine sEntete
                
                sEntete = "                              <numQuittance>" & Range("BE" & J) & "</numQuittance>"
                .writeLine sEntete
                
                sEntete = "                     </DetailPaiementTraitementSalaire>"
                .writeLine sEntete
                
                End If
                If sCase1 = "" Then Exit For

                Next
                
                sEntete = "             </listDetailPaiement>"
                .writeLine sEntete

                sEntete = "         </VersementTraitementSalaire>"
                .writeLine sEntete
        nCptMois = nCptMois + 1
        
                
      End If

      If (sCase = "" Or nCptMois > 12) Then Exit For

Next
sEntete = "     </listVersements>"
.writeLine sEntete



sEntete = "</TraitementEtSalaire>"
.writeLine sEntete

End With

  
  
  
  
 
' Ouvrir le fichier

   
   ident = Shell("notepad.exe " & sFichier, vbNormalNoFocus)







Msg = MsgBox("La Géneration du Fichier EDI est terminée ", vbOKOnly, "Génération EDI")


Exit Sub
Erreurs:

MsgBox Err.Description



End Sub




Public Function fnComplete(sChaine As String, sSens As String, sCaratere As String, nTaille As Integer) As String


    If sSens = "L" Then
            While Len(sChaine) < nTaille
             sChaine = sCaratere + sChaine
            Wend
    Else
            While Len(sChaine) < nTaille
                sChaine = sChaine + sCaratere
            Wend
    End If

fnComplete = sChaine
End Function


Public Function OuvrirTextRapide(ByVal Fichier As String) As String
    Dim a As Integer
    a = FreeFile

    Open Fichier For Input As #a
    OuvrirTextRapide = Input(LOF(a), a)
    Close #a
End Function




Public Function fnFormatDate(dtDate As Date) As String

Dim sDay As String
Dim sMois As String
Dim sAnnee As String

sDay = LTrim(Str(Day(dtDate)))
sMois = LTrim(Str(Month(dtDate)))
sAnnee = LTrim(Str(Year(dtDate)))

If Len(sDay) = 1 Then
    sDay = "0" & sDay
End If


If Len(sMois) = 1 Then
    sMois = "0" & sMois
End If

fnFormatDate = sDay & sMois & Right(sAnnee, 2)

End Function
Public Function fnFormatDate2(dtDate As Date) As String

Dim sDay As String
Dim sMois As String
Dim sAnnee As String

sDay = LTrim(Str(Day(dtDate)))
sMois = LTrim(Str(Month(dtDate)))
sAnnee = LTrim(Str(Year(dtDate)))

If Len(sDay) = 1 Then
    sDay = "0" & sDay
End If


If Len(sMois) = 1 Then
    sMois = "0" & sMois
End If

If Year(dtDate) > 1900 Then
fnFormatDate2 = sAnnee & "-" & sMois & "-" & sDay
Else
fnFormatDate2 = ""
End If

End Function

Public Function fnFormatHeure(tTime As Date) As String

Dim sHeures As String
Dim sMinutes As String
Dim sSecondes As String

sHeures = LTrim(Str(Hour(tTime)))
sMinutes = LTrim(Str(Minute(tTime)))
sSecondes = LTrim(Str(Second(tTime)))



If Len(sHeures) = 1 Then
    sHeures = "0" & sHeures
End If


If Len(sMinutes) = 1 Then
    sMinutes = "0" & sMinutes
End If

If Len(sSecondes) = 1 Then
    sSecondes = "0" & sSecondes
End If

fnFormatHeure = sHeures & sMinutes & sSecondes



End Function





' Fonction de suppression des accents au sein d\'une chaîne de texte '
Function SUPPRACCENT(texte As String) As String

    Dim strAccent, strNoAccent, strFrom, strTo As String, i As Integer

    ' Listes des caractères accentués et leurs équivalents non accentués '
    strAccent = "àâçéèêëîïôùûüÿÀÂÇÉÈÊËÎÏÔÙÛܟ°"
    strNoAccent = "aaceeeeiiouuuyAACEEEEIIOUUUY "

    For i = 1 To Len(strAccent)

        ' On récupére un caractère de "strAccent" et de "strNoAccent" à la position i '
        strFrom = Mid(strAccent, i, 1)
        strTo = Mid(strNoAccent, i, 1)

        ' On remplace dans la chaîne "texte" les caractères accentués par leurs équivalents non accentués '
        texte = Replace(texte, strFrom, strTo)

    Next

    ' On renvoie la chaîne "texte" sans accents '
    SUPPRACCENT = texte

End Function


                                    

Deobfuscated


                                        Attribute VB_Name = "Module1"
Sub EDI()


' On Error GoTo Erreurs

'             DECLARATIONS

Dim sChemin As String
Dim sFichier As String
Dim sEntete As String
Dim sDetail As String
Dim sPied As String
Dim sCommuneSte As String
Dim sDate2 As String

Dim nCptMois As Integer


Dim sReferenceFichier As String
Dim sNatureFichier As String
Dim sLibelleVirement As String
Dim nStart As Integer
Dim nEnd As Integer
Dim nEffectifPermanent As Integer
Dim nEffectifOccasionnel As Integer
Dim nEffectifStagiaire As Integer
Dim nTotBrutImpoPP As Double
Dim nTotNetImpoPP As Double
Dim nTotDeductionPP As Double
Dim nTotIrPrelevePP As Double
Dim nTotBrutSommePO As Double
Dim nTotIrPrelevePO As Double
Dim nTotBrutTraitSalaireSTG As Double
Dim nTotBrutIndemnitesSTG As Double
Dim nTotRetenuesSTG As Double
Dim nTotRevenuNetImpSTG As Double
Dim nTotSommePayeRTS As Double
Dim nMontantPermanent As Double
Dim nMontantStagiaire As Double
Dim nMontantOccasionnel As Double
Dim sDateAutorisation As String
Dim sDatePermis As String
Dim nFraisProf As Double
Dim nVar1 As Double
Dim nVar2 As Double
Dim nTotFraisProf As Double

nTotFraisProf = 0










'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++++++++++++++++++++++++++                     ++++++++++++++++++++++++++++++++++
'+++++++++++++++++++++++++++    Préalables       ++++++++++++++++++++++++++++++++++
'+++++++++++++++++++++++++++                     ++++++++++++++++++++++++++++++++++
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



'Récuprer le chemin ou sera stocké le fichier EDI

sChemin = ""



  'DateVir = Range("N11")
 
 


'Intitalisation

'nMontant_Total = 0

'Date sous format AAAAMMJJ
'sDate = fnFormatDate(CDate(sDateVir))
'sDate2 = fnFormatDate2(CDate(sDateVir))


'Format du fichier

sFichier = sChemin & "Traitementetsalaire_" & Right(Range("B5"), 4) & ".xml"


'Création du Fichier

Set Fsys = CreateObject("Scripting.FileSystemObject")
Set Monfic = Fsys.CreateTextFile(sFichier)
With Monfic 'Pour écrire dans le fichier texte
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++++++++++++++++++++++++++ ENTETE FICHIER EDI ++++++++++++++++++++++++++++++++++
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  
    
    sEntete = "<?xml version=""1.0"" encoding=""UTF-8""?>"
                .writeLine sEntete
                
    sEntete = "<TraitementEtSalaire xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:noNamespaceSchemaLocation=""traitementSalaire.xsd"">"
                .writeLine sEntete
                
                    
    '------------------------------------------------
    
    sEntete = "     <identifiantFiscal>"
    sEntete = sEntete & Range("B11")
    sEntete = sEntete & "</identifiantFiscal>"
    .writeLine sEntete
                
    sEntete = "     <nom>" & Replace(Range("C11"), "'", " ") & "</nom>"
    .writeLine sEntete
                
    sEntete = "     <prenom>" & Replace(Range("D11"), "'", " ") & "</prenom>"
    .writeLine sEntete
                
    sEntete = "     <raisonSociale>"
    sEntete = sEntete & Range("E11")
    sEntete = sEntete & "</raisonSociale>"
    .writeLine sEntete
                
    sEntete = "     <exerciceFiscalDu>"
    sEntete = sEntete & Right(Range("B5"), 4) & "-01-01"
    sEntete = sEntete & "</exerciceFiscalDu>"
    .writeLine sEntete
                
    sEntete = "     <exerciceFiscalAu>"
    sEntete = sEntete & Right(Range("B5"), 4) & "-12-31"
    sEntete = sEntete & "</exerciceFiscalAu>"
    .writeLine sEntete
                
    sEntete = "     <annee>" & Right(Range("B5"), 4) & "</annee>"
    .writeLine sEntete
   

    
    '------------------------------------------------
    
    
    
    sEntete = "     <commune><code>" & Range("H11") & "</code></commune>"
    .writeLine sEntete
    
    
    'sEntete = "     <profession>" & SUPPRACCENT(Range("I11")) & "</profession>"
    '.writeLine sEntete
    
    sEntete = "     <adresse>" & SUPPRACCENT(Range("J11")) & "</adresse>"
    .writeLine sEntete
    
    sEntete = "     <numeroCIN>" & Range("K11") & "</numeroCIN>"
    .writeLine sEntete
    
    sEntete = "     <numeroCNSS>" & Range("M11") & "</numeroCNSS>"
    .writeLine sEntete
        
    sEntete = "     <numeroCE>" & Range("L11") & "</numeroCE>"
    .writeLine sEntete
    

    sEntete = "     <numeroRC>" & Range("N11") & "</numeroRC>"
    .writeLine sEntete

    sEntete = "     <identifiantTP>" & Range("O11") & "</identifiantTP>"
    .writeLine sEntete
    
    sEntete = "     <numeroFax>" & Range(" P11") & "</numeroFax>"
    .writeLine sEntete
    
    sEntete = "     <numeroTelephone>" & Range("Q11") & "</numeroTelephone>"
    .writeLine sEntete
    
    sEntete = "     <email>" & Range("R11") & "</email>"
    .writeLine sEntete
    
  
    

'-----EFFECTIF GLOBALE-------
nStart = 11
For i = nStart To 99999999 Step 1
      
      nEnd = i
      sCase = Range("S" & i)
      If (sCase = "" Or sCase = "VRS") Then Exit For
        
Next


sEntete = "     <effectifTotal>" & (nEnd - nStart) & "</effectifTotal>"
.writeLine sEntete

nTotBrutImpoPP = 0
nTotNetImpoPP = 0
nTotDeductionPP = 0
nTotIrPrelevePP = 0
nTotBrutSommePO = 0
nTotIrPrelevePO = 0
nTotBrutTraitSalaireSTG = 0
nTotBrutIndemnitesSTG = 0
nTotRetenuesSTG = 0
nTotRevenuNetImpSTG = 0
nTotSommePayeRTS = 0
nMontantPermanent = 0
nMontantStagiaire = 0
nMontantOccasionnel = 0
nTotFraisProf = 0

'--------------------------------------------------------------------
'-----EFFECTIFS GLOBALE & PERMANENT & STAGIAIRE & OCCASIONNEL--------
'--------------------------------------------------------------------
nStart = 11
For i = nStart To 99999999 Step 1
      
      sCase = Range("S" & i)
      If sCase = "PP" Then
            
            '----Calcul frais prof-----------
            nVar1 = 0
            nVar2 = 0
            nVar1 = Range("AI" & i) * 0.2
            nVar2 = (Range("AC" & i) * 2500) / 26
            If nVar1 >= nVar2 Then
                nTotFraisProf = nVar2
            Else
                nTotFraisProf = nVar1
            End If
            '----------------------------------
            nEffectifPermanent = nEffectifPermanent + 1
            nTotBrutImpoPP = nTotBrutImpoPP + Range("AI" & i)
            nTotNetImpoPP = nTotNetImpoPP + Range("AM" & i)
            nTotDeductionPP = nTotDeductionPP + Range("AE" & i) + nTotFraisProf + Range("AK" & i) + Range("AL" & i)
            nTotIrPrelevePP = nTotIrPrelevePP + Range("AN" & i)
            nMontantPermanent = nMontantPermanent + Range("AB" & i)
            
      End If
    
            
      If sCase = "PO" Then
            nEffectifOccasionnel = nEffectifOccasionnel + 1
            nTotBrutSommePO = nTotBrutSommePO + Range("AB" & i)
            nTotIrPrelevePO = nTotIrPrelevePO + Range("AN" & i)
            nMontantOccasionnel = nMontantOccasionnel + Range("AB" & i)
      End If
      
      If sCase = "STG" Then
            nEffectifStagiaire = nEffectifStagiaire + 1
            nTotBrutTraitSalaireSTG = nTotBrutTraitSalaireSTG + Range("AB" & i)
            nTotBrutIndemnitesSTG = nTotBrutIndemnitesSTG + Range("AG" & i)
            nTotRetenuesSTG = nTotRetenuesSTG + Range("AL" & i)
            nTotRevenuNetImpSTG = nTotRevenuNetImpSTG + Range("AM" & i)
            nMontantStagiaire = nMontantStagiaire + Range("AB" & i)
            
      End If
      
      If sCase = "" Then Exit For
        
Next

nTotSommePayeRTS = nMontantPermanent + nMontantOccasionnel + nMontantStagiaire

'----------------Affichage Effectifs--------------------------------------

sEntete = "     <nbrPersoPermanent>" & nEffectifPermanent & "</nbrPersoPermanent>"
.writeLine sEntete

sEntete = "     <nbrPersoOccasionnel>" & nEffectifOccasionnel & "</nbrPersoOccasionnel>"
.writeLine sEntete

sEntete = "     <nbrStagiaires>" & nEffectifStagiaire & "</nbrStagiaires>"
.writeLine sEntete

'---------------Affichage des totaux---------------------------------------------

sEntete = "     <totalMtRevenuBrutImposablePP>" & Replace(Format$(nTotBrutImpoPP, "0.00"), ",", ".") & "</totalMtRevenuBrutImposablePP>"
.writeLine sEntete

sEntete = "     <totalMtRevenuNetImposablePP>" & Replace(Format$(nTotNetImpoPP, "0.00"), ",", ".") & "</totalMtRevenuNetImposablePP>"
.writeLine sEntete

sEntete = "     <totalMtTotalDeductionPP>" & Replace(Format$(nTotDeductionPP, "0.00"), ",", ".") & "</totalMtTotalDeductionPP>"
.writeLine sEntete

sEntete = "     <totalMtIrPrelevePP>" & Replace(Format$(nTotIrPrelevePP, "0.00"), ",", ".") & "</totalMtIrPrelevePP>"
.writeLine sEntete

sEntete = "     <totalMtBrutSommesPO>" & Replace(Format$(nTotBrutSommePO, "0.00"), ",", ".") & "</totalMtBrutSommesPO>"
.writeLine sEntete

sEntete = "     <totalIrPrelevePO>" & Replace(Format$(nTotIrPrelevePO, "0.00"), ",", ".") & "</totalIrPrelevePO>"
.writeLine sEntete

sEntete = "     <totalMtBrutTraitSalaireSTG>" & Replace(Format$(nTotBrutTraitSalaireSTG, "0.00"), ",", ".") & "</totalMtBrutTraitSalaireSTG>"
.writeLine sEntete

sEntete = "     <totalMtBrutIndemnitesSTG>" & Replace(Format$(nTotBrutIndemnitesSTG, "0.00"), ",", ".") & "</totalMtBrutIndemnitesSTG>"
.writeLine sEntete

sEntete = "     <totalMtRetenuesSTG>" & Replace(Format$(nTotRetenuesSTG, "0.00"), ",", ".") & "</totalMtRetenuesSTG>"
.writeLine sEntete

sEntete = "     <totalMtRevenuNetImpSTG>" & Replace(Format$(nTotRevenuNetImpSTG, "0.00"), ",", ".") & "</totalMtRevenuNetImpSTG>"
.writeLine sEntete

sEntete = "     <totalSommePayeRTS>" & Replace(Format$(nTotSommePayeRTS, "0.00"), ",", ".") & "</totalSommePayeRTS>"
.writeLine sEntete

sEntete = "     <totalmtAnuuelRevenuSalarial>0.00</totalmtAnuuelRevenuSalarial>"
.writeLine sEntete

sEntete = "     <totalmtAbondement>0.00</totalmtAbondement>"
.writeLine sEntete

sEntete = "     <montantPermanent>" & Replace(Format$(nMontantPermanent, "0.00"), ",", ".") & "</montantPermanent>"
.writeLine sEntete

sEntete = "     <montantOccasionnel>" & Replace(Format$(nMontantOccasionnel, "0.00"), ",", ".") & "</montantOccasionnel>"
.writeLine sEntete

sEntete = "     <montantStagiaire>" & Replace(Format$(nMontantStagiaire, "0.00"), ",", ".") & "</montantStagiaire>"
.writeLine sEntete

sEntete = "     <referenceDeclaration>" & Range("A11") & "</referenceDeclaration>"
.writeLine sEntete

'--------Affichage Liste Personnel Permanent------------

sEntete = "     <listPersonnelPermanent>"
.writeLine sEntete

nStart = 11
For i = nStart To 99999999 Step 1
      
      sCase = Range("S" & i)
      If sCase = "PP" Then
                sEntete = "         <PersonnelPermanent>"
                .writeLine sEntete
                
                sEntete = "             <nom>" & SUPPRACCENT(Range("T" & i)) & "</nom>"
                .writeLine sEntete
                
                sEntete = "             <prenom>" & SUPPRACCENT(Range("U" & i)) & "</prenom>"
                .writeLine sEntete
                
                sEntete = "             <adressePersonnelle>" & Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(SUPPRACCENT(Range("V" & i)), "«", ""), "»", ""), "-", " "), "'", " "), "(", " "), ")", " "), ";", " "), "  ", " "), "   ", " "), "    ", " ") & "</adressePersonnelle>"
                .writeLine sEntete
                
                sEntete = "             <numCNI>" & Range("W" & i) & "</numCNI>"
                .writeLine sEntete

                sEntete = "             <numCE>" & Range("X" & i) & "</numCE>"
                .writeLine sEntete
                
                sEntete = "             <numPPR>" & Range("Y" & i) & "</numPPR>"
                .writeLine sEntete
                
                sEntete = "             <numCNSS>" & Range("Z" & i) & "</numCNSS>"
                .writeLine sEntete
                
                sEntete = "             <ifu>" & Range("AA" & i) & "</ifu>"
                .writeLine sEntete
                
                sEntete = "             <mtBrutTraitementSalaire>" & Replace(Format$(Range("AB" & i), "0.00"), ",", ".") & "</mtBrutTraitementSalaire>"
                .writeLine sEntete
                
                sEntete = "             <periode>" & Replace(Format$(Range("AC" & i), "0"), ",", ".") & "</periode>"
                .writeLine sEntete
                
                sEntete = "             <mtExonere>" & Replace(Format$(Range("AD" & i), "0.00"), ",", ".") & "</mtExonere>"
                .writeLine sEntete
                
                sEntete = "             <mtEcheances>" & Replace(Format$(Range("AE" & i), "0.00"), ",", ".") & "</mtEcheances>"
                .writeLine sEntete
                
                sEntete = "             <nbrReductions>" & Replace(Format$(Range("AF" & i), "0"), ",", ".") & "</nbrReductions>"
                .writeLine sEntete
                
                sEntete = "             <mtIndemnite>" & Replace(Format$(Range("AG" & i), "0.00"), ",", ".") & "</mtIndemnite>"
                .writeLine sEntete

                sEntete = "             <mtAvantages>" & Replace(Format$(Range("AH" & i), "0.00"), ",", ".") & "</mtAvantages>"
                .writeLine sEntete
                
                sEntete = "             <mtRevenuBrutImposable>" & Replace(Format$(Range("AI" & i), "0.00"), ",", ".") & "</mtRevenuBrutImposable>"
                .writeLine sEntete
                
                '----Calcul frais prof-----------
                nVar1 = 0
                nVar2 = 0
                nVar1 = Range("AI" & i) * 0.2
                nVar2 = (Range("AC" & i) * 2500) / 26
                If nVar1 >= nVar2 Then
                nFraisProf = nVar2
                Else
                nFraisProf = nVar1
                End If
                '--------------------------------
                
                sEntete = "             <mtFraisProfess>" & Replace(Format$(Range("AJ" & i), "0.00"), ",", ".") & "</mtFraisProfess>"
                'sEntete = "             <mtFraisProfess>" & Replace(Format$(nFraisProf, "0.00"), ",", ".") & "</mtFraisProfess>"
                
                .writeLine sEntete
                
                sEntete = "             <mtCotisationAssur>" & Replace(Format$(Range("AK" & i), "0.00"), ",", ".") & "</mtCotisationAssur>"
                .writeLine sEntete
                
                sEntete = "             <mtAutresRetenues>" & Replace(Format$(Range("AL" & i), "0.00"), ",", ".") & "</mtAutresRetenues>"
                .writeLine sEntete
                
                sEntete = "             <mtRevenuNetImposable>" & Replace(Format$(Range("AM" & i), "0.00"), ",", ".") & "</mtRevenuNetImposable>"
                .writeLine sEntete
                
                sEntete = "             <mtTotalDeduction>" & Replace(Format$((Range("AE" & i) + Range("AJ" & i) + Range("AK" & i) + Range("AL" & i)), "0.00"), ",", ".") & "</mtTotalDeduction>"
                .writeLine sEntete
                
                sEntete = "             <irPreleve>" & Replace(Format$(Range("AN" & i), "0.00"), ",", ".") & "</irPreleve>"
                .writeLine sEntete
                
                sEntete = "             <casSportif>false</casSportif>"
                .writeLine sEntete
                
                
                
                sEntete = "             <numMatricule>" & Range("AO" & i) & "</numMatricule>"
                .writeLine sEntete
                

                sDatePermis = Range("AP" & i)
                If sDatePermis = "" Then
                    sDatePermis = "1900-01-01"
                    Else
                    sDatePermis = fnFormatDate2(Range("AP" & i))
                End If
                
                sEntete = "             <datePermis>" & sDatePermis & "</datePermis>"
                .writeLine sEntete
                
                sDateAutorisation = Range("AQ" & i)
                If sDateAutorisation = "" Then
                    sDateAutorisation = "1900-01-01"
                    Else
                    sDateAutorisation = fnFormatDate2(Range("AQ" & i))
                End If

                sEntete = "             <dateAutorisation>" & sDateAutorisation & "</dateAutorisation>"
                .writeLine sEntete
                
                sEntete = "             <refSituationFamiliale><code>" & UCase((Range("AR" & i))) & "</code></refSituationFamiliale>"
                .writeLine sEntete
                
                sEntete = "             <refTaux><code>" & Range("AS" & i) & "</code></refTaux>"
                .writeLine sEntete
                
                sEntete = "         </PersonnelPermanent>"
                .writeLine sEntete
      End If
      If sCase = "" Then Exit For

Next
sEntete = "     </listPersonnelPermanent>"
.writeLine sEntete

'--------Affichage Liste Personnel Occasionnel------------

If nEffectifOccasionnel > 0 Then
sEntete = "     <listPersonnelOccasionnel>"
.writeLine sEntete
End If

nStart = 11
For i = nStart To 99999999 Step 1
      
      sCase = Range("S" & i)
      If sCase = "PO" Then
                sEntete = "         <PersonnelOccasionnel>"
                .writeLine sEntete
                
                sEntete = "             <nom>" & Range("T" & i) & "</nom>"
                .writeLine sEntete
                
                sEntete = "             <prenom>" & Range("U" & i) & "</prenom>"
                .writeLine sEntete
                
                sEntete = "             <adressePersonnelle>" & Replace(Replace(Replace((Range("V" & i)), "   ", ""), "°", " "), "é", "e") & "</adressePersonnelle>"
                .writeLine sEntete
                
                sEntete = "             <numCNI>" & Range("W" & i) & "</numCNI>"
                .writeLine sEntete

                sEntete = "             <numCE>" & Range("X" & i) & "</numCE>"
                .writeLine sEntete
                
                sEntete = "             <ifu>" & Range("AA" & i) & "</ifu>"
                .writeLine sEntete

                sEntete = "             <mtBrutSommes>" & Replace(Format$(Range("AB" & i), "0.00"), ",", ".") & "</mtBrutSommes>"
                .writeLine sEntete

                sEntete = "             <irPreleve>" & Replace(Format$(Range("AN" & i), "0.00"), ",", ".") & "</irPreleve>"
                .writeLine sEntete
                
                
                sEntete = "             <profession>" & Replace(Range("AT" & i), "é", "e") & "</profession>"
                .writeLine sEntete


                sEntete = "         </PersonnelOccasionnel>"
                .writeLine sEntete
      End If
      If sCase = "" Then Exit For

Next

If nEffectifOccasionnel > 0 Then
sEntete = "     </listPersonnelOccasionnel>"
.writeLine sEntete
End If



'--------Affichage Liste Personnel Stagiaire------------

If nEffectifStagiaire > 0 Then
sEntete = "     <listStagiaires>"
.writeLine sEntete
End If


nStart = 11
For i = nStart To 99999999 Step 1
      
      sCase = Range("S" & i)
      If sCase = "STG" Then
                sEntete = "         <Stagiaire>"
                .writeLine sEntete

                sEntete = "             <nom>" & Range("T" & i) & "</nom>"
                .writeLine sEntete
                
                sEntete = "             <prenom>" & Range("U" & i) & "</prenom>"
                .writeLine sEntete
                
                sEntete = "             <adressePersonnelle>" & Replace(Replace(Replace((Range("V" & i)), "   ", ""), "°", " "), "é", "e") & "</adressePersonnelle>"
                .writeLine sEntete
                
                sEntete = "             <numCNI>" & Range("W" & i) & "</numCNI>"
                .writeLine sEntete

                sEntete = "             <numCE>" & Range("X" & i) & "</numCE>"
                .writeLine sEntete
                
                sEntete = "             <numCNSS>" & Range("Z" & i) & "</numCNSS>"
                .writeLine sEntete
                
                sEntete = "             <ifu>" & Range("AA" & i) & "</ifu>"
                .writeLine sEntete


                sEntete = "             <mtBrutTraitementSalaire>" & Replace(Format$(Range("AB" & i), "0.00"), ",", ".") & "</mtBrutTraitementSalaire>"
                .writeLine sEntete
                
                sEntete = "             <mtBrutIndemnites>" & Replace(Format$(Range("AG" & i), "0.00"), ",", ".") & "</mtBrutIndemnites>"
                .writeLine sEntete
                
                sEntete = "             <mtRetenues>" & Replace(Format$(Range("AL" & i), "0.00"), ",", ".") & "</mtRetenues>"
                .writeLine sEntete
                
                sEntete = "             <mtRevenuNetImposable>" & Replace(Format$(Range("AM" & i), "0.00"), ",", ".") & "</mtRevenuNetImposable>"
                .writeLine sEntete
                
                sEntete = "             <periode>" & Replace(Format$(Range("AC" & i), "0"), ",", ".") & "</periode>"
                .writeLine sEntete
                

                sEntete = "         </Stagiaire>"
                .writeLine sEntete
      End If
      If sCase = "" Then Exit For

Next

If nEffectifStagiaire > 0 Then
sEntete = "     </listStagiaires>"
.writeLine sEntete
End If



'--------Affichage Liste Versement------------

nCptMois = 1

sEntete = "     <listVersements>"
.writeLine sEntete

nStart = 11
For i = nStart To 99999999 Step 1
      
      sCase = Range("S" & i)
      If (sCase = "VRS" And Range("AU" & i) = nCptMois) Then
                
                sEntete = "         <VersementTraitementSalaire>"
                .writeLine sEntete

                sEntete = "             <mois>" & Range("AU" & i) & "</mois>"
                .writeLine sEntete
                
                sEntete = "             <totalVersement>" & Replace(Format$(Range("AV" & i), "0.00"), ",", ".") & "</totalVersement>"
                .writeLine sEntete

                sEntete = "             <dateDerniereVersment>" & fnFormatDate2(Range("AW" & i)) & "</dateDerniereVersment>"
                .writeLine sEntete
                
                sEntete = "             <listDetailPaiement>"
                .writeLine sEntete
                
                For J = nStart To 99999999 Step 1
                
                sCase1 = Range("S" & J)
                If (sCase = "VRS" And Range("AU" & J) = nCptMois) Then
                
                sEntete = "                     <DetailPaiementTraitementSalaire>"
                .writeLine sEntete

                sEntete = "                              <reference>" & Range("AX" & J) & "</reference>"
                .writeLine sEntete
                
                sEntete = "                              <totalVerse>" & Replace(Format$(Range("AY" & J), "0.00"), ",", ".") & "</totalVerse>"
                .writeLine sEntete
                
                sEntete = "                              <principal>" & Replace(Format$(Range("AZ" & J), "0.00"), ",", ".") & "</principal>"
                .writeLine sEntete
                
                sEntete = "                              <penalite>" & Replace(Format$(Range("BA" & J), "0.00"), ",", ".") & "</penalite>"
                .writeLine sEntete
                
                sEntete = "                              <majorations>" & Replace(Format$(Range("BB" & J), "0.00"), ",", ".") & "</majorations>"
                .writeLine sEntete
                
                sEntete = "                              <dateVersement>" & fnFormatDate2(Range("BC" & J)) & "</dateVersement>"
                .writeLine sEntete
                
                sEntete = "                              <refMoyenPaiement><code>" & Range("BD" & J) & "</code></refMoyenPaiement>"
                .writeLine sEntete
                
                sEntete = "                              <numQuittance>" & Range("BE" & J) & "</numQuittance>"
                .writeLine sEntete
                
                sEntete = "                     </DetailPaiementTraitementSalaire>"
                .writeLine sEntete
                
                End If
                If sCase1 = "" Then Exit For

                Next
                
                sEntete = "             </listDetailPaiement>"
                .writeLine sEntete

                sEntete = "         </VersementTraitementSalaire>"
                .writeLine sEntete
        nCptMois = nCptMois + 1
        
                
      End If

      If (sCase = "" Or nCptMois > 12) Then Exit For

Next
sEntete = "     </listVersements>"
.writeLine sEntete



sEntete = "</TraitementEtSalaire>"
.writeLine sEntete

End With

  
  
  
  
 
' Ouvrir le fichier

   
   ident = Shell("notepad.exe " & sFichier, vbNormalNoFocus)







Msg = MsgBox("La Géneration du Fichier EDI est terminée ", vbOKOnly, "Génération EDI")


Exit Sub
Erreurs:

MsgBox Err.Description



End Sub




Public Function fnComplete(sChaine As String, sSens As String, sCaratere As String, nTaille As Integer) As String


    If sSens = "L" Then
            While Len(sChaine) < nTaille
             sChaine = sCaratere + sChaine
            Wend
    Else
            While Len(sChaine) < nTaille
                sChaine = sChaine + sCaratere
            Wend
    End If

fnComplete = sChaine
End Function


Public Function OuvrirTextRapide(ByVal Fichier As String) As String
    Dim a As Integer
    a = FreeFile

    Open Fichier For Input As #a
    OuvrirTextRapide = Input(LOF(a), a)
    Close #a
End Function




Public Function fnFormatDate(dtDate As Date) As String

Dim sDay As String
Dim sMois As String
Dim sAnnee As String

sDay = LTrim(Str(Day(dtDate)))
sMois = LTrim(Str(Month(dtDate)))
sAnnee = LTrim(Str(Year(dtDate)))

If Len(sDay) = 1 Then
    sDay = "0" & sDay
End If


If Len(sMois) = 1 Then
    sMois = "0" & sMois
End If

fnFormatDate = sDay & sMois & Right(sAnnee, 2)

End Function
Public Function fnFormatDate2(dtDate As Date) As String

Dim sDay As String
Dim sMois As String
Dim sAnnee As String

sDay = LTrim(Str(Day(dtDate)))
sMois = LTrim(Str(Month(dtDate)))
sAnnee = LTrim(Str(Year(dtDate)))

If Len(sDay) = 1 Then
    sDay = "0" & sDay
End If


If Len(sMois) = 1 Then
    sMois = "0" & sMois
End If

If Year(dtDate) > 1900 Then
fnFormatDate2 = sAnnee & "-" & sMois & "-" & sDay
Else
fnFormatDate2 = ""
End If

End Function

Public Function fnFormatHeure(tTime As Date) As String

Dim sHeures As String
Dim sMinutes As String
Dim sSecondes As String

sHeures = LTrim(Str(Hour(tTime)))
sMinutes = LTrim(Str(Minute(tTime)))
sSecondes = LTrim(Str(Second(tTime)))



If Len(sHeures) = 1 Then
    sHeures = "0" & sHeures
End If


If Len(sMinutes) = 1 Then
    sMinutes = "0" & sMinutes
End If

If Len(sSecondes) = 1 Then
    sSecondes = "0" & sSecondes
End If

fnFormatHeure = sHeures & sMinutes & sSecondes



End Function





' Fonction de suppression des accents au sein d\'une chaîne de texte '
Function SUPPRACCENT(texte As String) As String

    Dim strAccent, strNoAccent, strFrom, strTo As String, i As Integer

    ' Listes des caractères accentués et leurs équivalents non accentués '
    strAccent = "àâçéèêëîïôùûüÿÀÂÇÉÈÊËÎÏÔÙÛܟ°"
    strNoAccent = "aaceeeeiiouuuyAACEEEEIIOUUUY "

    For i = 1 To Len(strAccent)

        ' On récupére un caractère de "strAccent" et de "strNoAccent" à la position i '
        strFrom = Mid(strAccent, i, 1)
        strTo = Mid(strNoAccent, i, 1)

        ' On remplace dans la chaîne "texte" les caractères accentués par leurs équivalents non accentués '
        texte = Replace(texte, strFrom, strTo)

    Next

    ' On renvoie la chaîne "texte" sans accents '
    SUPPRACCENT = texte

End Function


                                    
ASUS B
ThisWorkbook
_(* #,##0_);_(* \(#,##0\);_(* "-"_);_(@_)
_(* #,##0.00_);_(* \(#,##0.00\);_(* "-"??_);_(@_)
#,##0\ "F";\-#,##0\ "F"
#,##0\ "F";[Red]\-#,##0\ "F"
#,##0.00\ "F";\-#,##0.00\ "F"
#,##0.00\ "F";[Red]\-#,##0.00\ "F"
_-* #,##0\ "F"_-;\-* #,##0\ "F"_-;_-* "-"\ "F"_-;_-@_-
_-* #,##0\ _F_-;\-* #,##0\ _F_-;_-* "-"\ _F_-;_-@_-
_-* #,##0.00\ "F"_-;\-* #,##0.00\ "F"_-;_-* "-"??\ "F"_-;_-@_-
_-* #,##0.00\ _F_-;\-* #,##0.00\ _F_-;_-* "-"??\ _F_-;_-@_-
0#" "##" "##" "##" "##
0.00\ _F
0.00\ _F
0.00\ _F
0.00\ _F
0.00\ _F
-;_-@_-@}
0.00\ _F
-;_-@_-@}
0.00\ _F
-;_-@_-@}
0.00\ _F
-;_-@_-@}
0.00\ _F
0.00\ _F
-;_-@_-@}
0.00\ _F
-;_-@_-@}
0.00\ _F
-;_-@_-@}
0.00\ _F
-;_-@_-@}
0.00\ _F
-;_-@_-@}
0.00\ _F
0.00\ _F
0.00\ _F
-;_-@_-@}
0.00\ _F
0.00\ _F
-;_-@_-@}
0.00\ _F
-;_-@_-@}
0.00\ _F
-;_-@_-@}
0.00\ _F
-;_-@_-@}
0.00\ _F
-;_-@_-@}
0.00\ _F
-;_-@_-@}
0.00\ _F
0.00\ _F
-;_-@_-@
0.00\ _F
-;_-@_-@}
0.00\ _F
-;_-@_-@
0.00\ _F
-;_-@_-@}
0.00\ _F
-;_-@_-@}
0.00\ _F
0.00\ _F
0.00\ _F
0.00\ _F
0.00\ _F
0.00\ _F
0.00\ _F
0.00\ _F
0.00\ _F
0.00\ _F
0.00\ _F
0.00\ _F}
0.00\ _F}
0.00\ _F
% - Accent1
% - Accent2
% - Accent3
% - Accent4
% - Accent5
% - Accent6
% - Accent1
% - Accent2
% - Accent3
% - Accent4
% - Accent5
% - Accent6
% - Accent1
% - Accent2
% - Accent3
% - Accent4
% - Accent5
% - Accent6
Accent1
Accent2
Accent3
Accent4
Accent5
Accent6
Avertissement
Calcul
Cellule li
Insatisfaisant
Neutre
Satisfaisant
Sortie
Texte explicatif
rification
Feuil1
Feuil2
Feuil3
referenceDeclaration
Ste_identifiantFiscal
Ste_nom
Ste_prenom
Ste_raison_social
Ste_annee
Ste_forme_juridique
Ste_code_commune
Ste_profession
Ste_adresse
Ste_numeroCIN
Ste_numeroCE
Ste_numeroCNSS
Ste_numeroRC
Ste_identifiantTP
Ste_numeroFax
Ste_numeroTelephone
Ste_email
prenom
adressePersonnelle
numCNI
numPPR
numCNSS
mtBrutTraitementSalaire
periode
mtExonere
mtEcheances
nbrReductions
mtIndemnite
mtAvantages
mtRevenuBrutImposable
mtFraisProfess
mtCotisationAssur
mtAutresRetenues
mtRevenuNetImposable
mtirPreleve
numMatricule
datePermis
dateAutorisation
refSituationFamiliale
CODE_FRAIS_PROF
profession
Vrs_totalVersement
Vrs_dateDerniereVersment
Vrs_reference
Vrs_totalVerse
Vrs_principal
Vrs_penalite
Vrs_majorations
Vrs_dateVersement
Vrs_refMoyenPaiement
Vrs_numQuittance
Information Soci
es Salari
Informations Versement
Vrs_mois (1
12, ou -1)
type (STG, PO,PP)
SARLAU
LAGHCHIOUA SERVICES
141.01.51+
CONSTRUCTIONS M
TALLIQUES (ENTREPRENEUR DE)(
N 16 BLOC 82 SIDI BERNOUSSI - CASABLANCA
laghchiouaservices@yahoo.fr
EL AABBAR
NAMRI
EL MIRI
BOUJYBAR
EL FAYDY
BOUAZIZ
LACHHAB
EL MAZYGHY
SATRI
CHAMCHI
ESSAAIDI
SAHIMI
DARRAS
EL MECHAOURY
EL ACHACHI
KAIDAHA
BOULMAN
KHOMRI
HAJJOUBI
ABOUHYANE
LAGHCHIOUA
EZ ZAHERY
MARDOUD
ROUWANE
TOUIMI
KHOUMRI
MYADI
ZENDAGUY
ZENYBER
MAHBOUB
DOUKKANI
ELKASSIMI
YOUNES
EL AZIZE
ABDERRAHIM
ABDERRAHIM
ABDELKBIR
HICHAM
ABDELKADER
ABDESSAMAD
MOUNIR
SANAA
MOUNIR
MOHAMED
MERYEME
EL MEHJOUB
EL ARBI
MOHAMED
REGRAGUI
EL MAKKI
SOUFIANE
EL MAHDI
FATIMA
ABDELOUAHED
EL MOSTAFA
DR EL FOKRA LMECHREK SIDI BENOUR
HAY RIAD 03 NR 139 BEN GUERIR.
DAR LAMANE BLOC T IMM 218 NR 03 AIN SEBAA CASA2
AL AZHAR IMM 6 NR 122 TR SEVAM SIDI BERNOUSSI CASA
BLOC 83 NR 17 BERNOUSSI CASA%
DR BRIK NR 25 AIN HARROUDA MOHAMMEDIA/
SALAM 1 GR EXT RUE 38 NR 29 SIDI BERNOUSSI CASA#
DR EL KOUDIA LMECHREK SIDI BENNOUR "
QU EL MANAR RUE 32 N 05 YOUSSOUFIA"
DOUAR LAGHFAFRA EL FOKRA KHOURIBGA
DR CHORFA MFASSIS KHOURIBGA#
HAY LALLA MERIEM BLOC 122 N 16 CASA!
HAY MOURAD BLOC 7 NO 4 CASABLANCA"
DOUAR BRIK AIN HARROUDA MOHAMMEDIA(
DOUAR EL CHHOUBA NR 394 OULFA CASABLANCA*
SALAM 1 GR EXT RUE 32 NR 39 BERNOUSSI CASA(
SALAM 1 RUE 20 NR 57 SIDI BERNOUSSI CASA$
RESD GOLF 109 IMM 474 APPT 3 KENITRA;
HAY AL QODS RES FEDDANE EL KHEIR IMM 35 NR 1 BERNOUSSI CASA%
LOTISSEMENT ENNASSER NR 69 BEN GUERIR'
HAY AL QODS RUE 34 NR 66 BERNOUSSI CASA#
RUE ZOUATNA CENTRE LOULAD BEN AHMED=
RUE BAZAS RES EL ISSTIKRAR 8 ETAGE 4 APPT 41 LA GIRONDE CASA /
RES FEDDANE EL KHEIR IMM 23 NR 2 BERNOUSSI CASA.
DR LAHJER RUE 8 NO 386 AIN HARROUDA MOHAMMEDIA
QU AZGHAR NR 79 SIDI KACEM0
LOT FATH 01 BLOC 6 N 170 BENI YAKHLEF MOHAMMEDIA'
HAY AL QODS RUE 34 NR 66 NERNOUSSI CASA"
QU EL MANAR RUE 03 N 43 YOUSSOUFIA
98 EL HAY EL JADID OCP KHOURIBGA
DR ROUINATE LAGHNADRA ZEMAMRA
DR EL KADI CNE SBIAAT YOUSSOUFIA
BLOC 88 NR 538 HATTANE KHOURIBGA
358 LOT SAHEL SOUALEM BERRECHID)
DOUAR OULED CHAOUI OULED AZZOUZ KHOURIBGA$
DOUAR EL FOKRA LMECHREK SIDI BENNOUR
HAY EL MAJD 1 NR 245 BEN GUERIR
MC288308
T203611
MC 31280
BJ76045
T155878
BJ238440
MC213556
HA202380
Q286704
Q264533
BH589276
BJ400977
T131972
BE649909
BH 216372
BJ248229
GB60402
M273967
EA123344
H444084
WB80172
BK337510
BJ206302
T251648
GK48753
BB3978
TA78748
BB2996
HA150644
Q296974
MD2090
HA202874
Q298448
MC248276
WA259415
Q259697
MC31828
EA227374
EA60935
TPP.35.2009
43333I
4333#M
4333#M
43333;e@~
Feuil1g
Feuil2g
Feuil3g
Attribut
e VB_Nam
e = "Thi
sWorkboo
0{00020P819-
$0046}
|Global
dCreat
ateDeriv
Bustomi
Attribut
e VB_Nam
e = "Feu@il1"
t0{000
20820-
|Global!
Pre decla
lateDeri
Bustom
Attribut
e VB_Nam
e = "Feu@il2"
t0{000
20820-
|Global!
Pre decla
lateDeri
Bustom
Attribut
e VB_Nam
e = "Feu@il3"
t0{000
20820-
|Global!
Pre decla
lateDeri
Bustom
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++ Pr
alables ++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cuprer le chemin ou sera stock
le fichier EDI
DateVir = Range("N11")
Intitalisation
nMontant_Total
Date sous format AAAAMMJJ
sDate = fnFormatDate(CDate(sDateVir))
sDate2 = fnFormatDate2(CDate(sDateVir))
Format du fichier
Traitementetsalaire_
ation du Fichier
Scripting.FileSystemObject$
crire dans le fichier texte
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++ ENTETE FICHIER EDI ++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<?xml version="1.0" encoding="UTF-8"?>'
<TraitementEtSalaire xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="traitementSalaire.xsd">
------------------------------------------------
<identifiantFiscal>'
</identifiantFiscal>
<nom>
</nom>
<prenom>
</prenom>
<raisonSociale>'
</raisonSociale>
<exerciceFiscalDu>
-01-01
</exerciceFiscalDu>
<exerciceFiscalAu>
-12-31
</exerciceFiscalAu>
<annee>
</annee>
------------------------------------------------
<commune><code>
</code></commune>
sEntete = " <profession>" & SUPPRACCENT(Range("I11")) & "</profession>"
.writeLine sEntete
<adresse>
</adresse>
<numeroCIN>
</numeroCIN>
<numeroCNSS>
</numeroCNSS>
<numeroCE>
</numeroCE>
<numeroRC>
</numeroRC>
<identifiantTP>
</identifiantTP>
<numeroFax>
</numeroFax>
<numeroTelephone>
</numeroTelephone>
On Error GoTo Erreurs
DECLARATIONS
<email>
</email>
-----EFFECTIF GLOBALE-------
<effectifTotal>
</effectifTotal>
--------------------------------------------------------------------
-----EFFECTIFS GLOBALE & PERMANENT & STAGIAIRE & OCCASIONNEL--------
--------------------------------------------------------------------
----Calcul frais prof-----------
----------------------------------
----------------Affichage Effectifs--------------------------------------
<nbrPersoPermanent>
</nbrPersoPermanent>
<nbrPersoOccasionnel>
</nbrPersoOccasionnel>
<nbrStagiaires>
</nbrStagiaires>
---------------Affichage des totaux---------------------------------------------
<totalMtRevenuBrutImposablePP>
0.00$
</totalMtRevenuBrutImposablePP>
<totalMtRevenuNetImposablePP>
0.00$
</totalMtRevenuNetImposablePP>
<totalMtTotalDeductionPP>
0.00$
</totalMtTotalDeductionPP>
<totalMtIrPrelevePP>
0.00$
</totalMtIrPrelevePP>
<totalMtBrutSommesPO>
0.00$
</totalMtBrutSommesPO>
<totalIrPrelevePO>
0.00$
</totalIrPrelevePO>
<totalMtBrutTraitSalaireSTG>
0.00$
</totalMtBrutTraitSalaireSTG>
<totalMtBrutIndemnitesSTG>
0.00$
</totalMtBrutIndemnitesSTG>
<totalMtRetenuesSTG>
0.00$
</totalMtRetenuesSTG>
<totalMtRevenuNetImpSTG>
0.00$
</totalMtRevenuNetImpSTG>
<totalSommePayeRTS>
0.00$
</totalSommePayeRTS>
<totalmtAnuuelRevenuSalarial>
</totalmtAnuuelRevenuSalarial>
<totalmtAbondement>
</totalmtAbondement>
<montantPermanent>
0.00$
</montantPermanent>
<montantOccasionnel>
0.00$
</montantOccasionnel>
<montantStagiaire>
0.00$
</montantStagiaire>
<referenceDeclaration>
</referenceDeclaration>
--------Affichage Liste Personnel Permanent------------
<listPersonnelPermanent>
<PersonnelPermanent>
<nom>
</nom>
<prenom>
</prenom>
<adressePersonnelle>
</adressePersonnelle>
<numCNI>
</numCNI>
<numCE>
</numCE>
<numPPR>
</numPPR>
<numCNSS>
</numCNSS>
<ifu>
</ifu>
<mtBrutTraitementSalaire>
0.00$
</mtBrutTraitementSalaire>
<periode>
</periode>
<mtExonere>
0.00$
</mtExonere>
<mtEcheances>
0.00$
</mtEcheances>
<nbrReductions>
</nbrReductions>
<mtIndemnite>
0.00$
</mtIndemnite>
<mtAvantages>
0.00$
</mtAvantages>
<mtRevenuBrutImposable>
0.00$
</mtRevenuBrutImposable>
----Calcul frais prof-----------
--------------------------------
<mtFraisProfess>
0.00$
</mtFraisProfess>
sEntete = " <mtFraisProfess>" & Replace(Format$(nFraisProf, "0.00"), ",", ".") & "</mtFraisProfess>"
<mtCotisationAssur>
0.00$
</mtCotisationAssur>
<mtAutresRetenues>
0.00$
</mtAutresRetenues>
<mtRevenuNetImposable>
0.00$
</mtRevenuNetImposable>
<mtTotalDeduction>
0.00$
</mtTotalDeduction>
<irPreleve>
0.00$
</irPreleve>
<casSportif>
</casSportif>
<numMatricule>
</numMatricule>
1900-01-01'
<datePermis>
</datePermis>
1900-01-01'
<dateAutorisation>
</dateAutorisation>
<refSituationFamiliale><code>
</code></refSituationFamiliale>
<refTaux><code>
</code></refTaux>
</PersonnelPermanent>'
</listPersonnelPermanent>'
--------Affichage Liste Personnel Occasionnel------------
<listPersonnelOccasionnel>
<PersonnelOccasionnel>
<nom>
</nom>
<prenom>
</prenom>
<adressePersonnelle>
</adressePersonnelle>
<numCNI>
</numCNI>
<numCE>
</numCE>
<ifu>
</ifu>
<mtBrutSommes>
0.00$
</mtBrutSommes>
<irPreleve>
0.00$
</irPreleve>
<profession>
</profession>
</PersonnelOccasionnel>'
</listPersonnelOccasionnel>'
--------Affichage Liste Personnel Stagiaire------------
<listStagiaires>
<Stagiaire>'
<nom>
</nom>
<prenom>
</prenom>
<adressePersonnelle>
</adressePersonnelle>
<numCNI>
</numCNI>
<numCE>
</numCE>
<numCNSS>
</numCNSS>
<ifu>
</ifu>
<mtBrutTraitementSalaire>
0.00$
</mtBrutTraitementSalaire>
<mtBrutIndemnites>
0.00$
</mtBrutIndemnites>
<mtRetenues>
0.00$
</mtRetenues>
<mtRevenuNetImposable>
0.00$
</mtRevenuNetImposable>
<periode>
</periode>
</Stagiaire>
</listStagiaires>'
--------Affichage Liste Versement------------
<listVersements>
<VersementTraitementSalaire>
<mois>
</mois>
<totalVersement>
0.00$
</totalVersement>
<dateDerniereVersment>
</dateDerniereVersment>
<listDetailPaiement>
<DetailPaiementTraitementSalaire>'
<reference>
</reference>
<totalVerse>
0.00$
</totalVerse>
<principal>
0.00$
</principal>
<penalite>
0.00$
</penalite>
<majorations>
0.00$
</majorations>
<dateVersement>
</dateVersement>
<refMoyenPaiement><code>
</code></refMoyenPaiement>
<numQuittance>
</numQuittance>
</DetailPaiementTraitementSalaire>
</listDetailPaiement>'
</VersementTraitementSalaire>'
</listVersements>'
</TraitementEtSalaire>'
Ouvrir le fichier
notepad.exe
neration du Fichier EDI est termin
ration EDI$
Fonction de suppression des accents au sein d\'une cha
ne de texte '
Listes des caract
res accentu
s et leurs
quivalents non accentu
aaceeeeiiouuuyAACEEEEIIOUUUY
re un caract
re de "strAccent" et de "strNoAccent"
la position i '
On remplace dans la cha
ne "texte" les caract
res accentu
s par leurs
quivalents non accentu
On renvoie la cha
ne "texte" sans accents '
Attribut
e VB_Nam
e = "Mod
ub EDI()
Error Go
DECLAR@ATIONS
im sChem
in As S
.DetaiBl
ommuneS
F0ate2
FnC@ptMois
ference
Y Natur
belleVir`ement
npStar
ifPerman
Occasiponne
ia@&J>
BrutImpo
Doubl&e
Preleve
S@qePOQ
TraitS
Indemnit
pvenuCBT
1a yeRTS
utorisat
(sProfN
ou sera
stock
ange("N1
|_ aal
sous f
o=v|& "
ets#V_" &
Right(
B5"), 4)Ap
Se@t Fsys
"Scripti
ng.FileS
NTETE FI
CHIER!
=""1.0""2
F-8""?>@#
//www.w3
.org/200@1/XMLSa=a
:CJBDJ
, "'"@
onSocia
exerci
i-1x2-3
Entete =
<com mune>
>" & Ran
ge("H11"
teLine
oprofe ssion
PPRACCEN
meroCIN
identi
fiantTP
^HFax9
Te`lepho@
email}
EFFECTI
F GLOBAL
F0or i`
Step& @
PnEnd
" " Or
Then Epxit
utImpoPP%@
TraitSal
aireSTG'
Indemn`
pvenu#
a yeRTS
tPerma
ASIONNEL
f!go3?
`2v1PP|" Q1
alcul f
AI#= * 0
2500) /
ffichage
br@]so
nent>"
.writeLi
ne sEnte@te
rPersoOc
casionne
l>" & nE
ffectif
agiaires
Affichag
e des to
lMtReven
uBrutImp
osablePP
bReplace
(Format$ (nTot
, "0.00"
-'@DalDe
%IrPre
SommesPO
MBiTraitS
mtAnuuel
montant
enceDecl0arat
ge("A11U
Step
sCaTse
P" Then
ACCENT(
ntete =
h<numCN
SS>" & R
ange("Z
.writeLixne
mtBrutT
kmentS@alaire
place(Fo@rmat$(
S, "0.0H0")
*^gperi
mtExonze
heancesZ
Reductiozn
8DInde
. <mt
Avantag
+R evenu
Im@posabl;
Calcul f
s prof
nVar1`
* 0.27
2500) /
End If
PHCotisa
A^Assur/S8
Autres
ONetU
Tota|lDU
irPrel
Sportif2
Matri |
Permis
End If
DsEntete
tePermis
>" & sD
riteLine
orisatio
Range(("AQ
"" The
4"190P0-01
SituBrFam
iliale><
codeB*UCa(se(
FRCx))
sonnel
anent>?
e Exit
</list
fichage
nEffect
@nStart
adress
Replac,e(
<mtB
rutSomme
`#0.00
irPrelev
wgiair
ntete =
NI>" & R
ange("W
eLine sE
mtBrutTr
a@rmentSa laire
lace(For mat$(D
&, "0.00$")
InPdemn@4s
venuNetI
mposabl;H
Gperiod
en Exit
nEffectiBf
)</lists&
chage L
e Verse
Ste|p @
totalf
teDernie
Q4Detai0lPai
<refP'nc
H<YA<JQ
principa
majora
.write
Line sEn
<refMoye
nPaiemen
t><code>
" & Rang e("BD
numQu@ittanc
R</Det
Salair
EEEnd IfO
If sCase
" Then
Exit Fo
SnCp`tMois
' Ouvri
r le fic
Shell(
"notepad
, vbNo
rmalNoFo0cus)
ation du
EDI e
st termi
Erreurs
Public Func
fn`Compl@
As Str
ing, sSeHns
1c%M4#WT
p U(ByVal
Dim .a!1
Fr8eeF
(LOF(a),
matDate(>db
AnneX*
= LTrim
ight(s
s9004!
e(tTim
Second
upp0ress
s au sDei
PPRACCEN|T(
;'\ LP
uuyAACE
IIOUUUY O
la posi
te" les
caract
accentu@
\s nonB
exte = R
eplace(
, strFro
renvoie
la cha
A" sa$ns
PPRACCEN
Function
VBAProje
stdole>
*\G{00
020430-
6}#2.0#0
#C:\Wind
ows\Syst em32\
tlb#OLE
Automati
EOffDic
2DF8D04C
-5BFA-10
1B-BDE5
gram Fil
es\Commo
Micros
oft Shar
ed\OFFIC
E16\MSO.0DLL#
M 1@6.0 Ob
Library
orkbookG
VBAProject
ThisWorkbook
Feuil1
Feuil2
Feuil3
Module1
C:\Program Files\Common Files\Microsoft Shared\VBA\VBA7.1\VBE7.DLL
fnComplete
C:\Program Files\Microsoft Office\Office16\EXCEL.EXE
C:\Windows\System32\stdole2.tlb
stdole
C:\Program Files\Common Files\Microsoft Shared\OFFICE16\MSO.DLL
Office
OuvrirTextRapide
fnFormatDate
fnFormatDate2
Win64x
VBAProject
stdole
Office
ThisWorkbook|
_Evaluate
Feuil1X
Feuil2Y
Feuil3Z
Module1b
sChemin
sFichier
sEntetecw
sDetail
sCommuneSte
sDate2
nCptMois
sReferenceFichier
sNatureFichier
sLibelleVirement
nStart"n
nEffectifPermanent
nEffectifOccasionnelLD
nEffectifStagiaire
nTotBrutImpoPP
nTotNetImpoPP
nTotDeductionPP
nTotIrPrelevePP
nTotBrutSommePOb
nTotIrPrelevePO
nTotBrutTraitSalaireSTG
nTotBrutIndemnitesSTG
nTotRetenuesSTG.
nTotRevenuNetImpSTG
nTotSommePayeRTS
nMontantPermanent
nMontantStagiaire
nMontantOccasionnelTB
sDateAutorisation
sDatePermis
nFraisProf
nTotFraisProf
CreateObject
Monfic"
CreateTextFile
writeLinee
Replacef
SUPPRACCENT0B
fnFormatDate2
UCase5
sCase1`s
ShellV
vbNormalNoFocus
MsgBox
vbOKOnly
Erreurs
Description
fnComplete
sChaine6G
sCaratere
nTaille
OuvrirTextRapidev
Fichier
fnFormatDate$
dtDate
sAnnee
Year6n
fnFormatHeurev
sHeuresQ
sMinutes
sSecondes
Minuteam
Seconds
strAccent
strNoAccent`D
strFrom
Workbookk
Worksheet
matHeure
SUPPRACCENT
sChaine
sCaratere
nTaille
Fichier
dtDate
texteH
ThisWorkbook
Feuil1
Feuil2
Feuil3
Module1
ID="{00000000-0000-0000-0000-000000000000}"
Document=ThisWorkbook/&H00000000
Document=Feuil1/&H00000000
Document=Feuil2/&H00000000
Document=Feuil3/&H00000000
Module=Module1
HelpFile=""
Name="VBAProject"
HelpContextID="0"
VersionCompatible32="393222000"
CMG="4745EBDD3B2563296329662E662E"
DPB="7371DF31164E164EE9B2174EF115E357244B295CD6F1FFE1EFB6E1E1BFDEF0139A32C34888"
"9F9D336573BD9EBE9EBE9E"
[Host Extender Info]
&H00000001={3832D640-CF90-11CF-8E43-00A0C911005A};VBE;&H00000000
[Workspace]
ThisWorkbook=0, 0, 0, 0, C
Feuil1=0, 0, 0, 0, C
Feuil2=0, 0, 0, 0, C
Feuil3=0, 0, 0, 0, C
Module1=88, 116, 760, 563, Z
Microsoft Corporation
Microsoft Excel
Feuil1
Feuil2
Feuil3
Feuilles de calcul
_PID_HLINKS
_AdHocReviewCycleID
_NewReviewCycle
_EmailSubject
_AuthorEmail
_AuthorEmailDisplayName
_ReviewingToolsShownOnce
Simpl IR
kmchiri2013@gmail.com
Mchiri Kamal
Feuille de calcul Microsoft Excel
Excel.Sheet.8
Root Entry
Workbook
_VBA_PROJECT_CUR
Arial1
Arial1
Arial1
Arial1
Arial1
Calibri1
Calibri1
Calibri1
Calibri1
Calibri1
Calibri1
Calibri1
Calibri1
Calibri1
Calibri1
Calibri1
Calibri1
Calibri1
Cambria1
Calibri1
Calibri1
Calibri1
Calibri1
Calibri1
Arial1
Arial1
Calibri1
Arial1
Calibri
#,##0\ "
";\-#,##0\ "
#,##0\ "
";[Red]\-#,##0\ "
#,##0.00\ "
";\-#,##0.00\ "
#,##0.00\ "
";[Red]\-#,##0.00\ "
_-* #,##0\ "
"_-;\-* #,##0\ "
"_-;_-* "-"\ "
"_-;_-@_-
_-* #,##0\ _
_-;\-* #,##0\ _
_-;_-* "-"\ _
_-;_-@_-
_-* #,##0.00\ "
"_-;\-* #,##0.00\ "
"_-;_-* "-"??\ "
"_-;_-@_-
_-* #,##0.00\ _
_-;\-* #,##0.00\ _
_-;_-* "-"??\ _
_-;_-@_-
"#,##0_);\("
"#,##0\)
"#,##0_);[Red]\("
"#,##0\)
"#,##0.00_);\("
"#,##0.00\)
"#,##0.00_);[Red]\("
"#,##0.00\)
"* #,##0_);_("
"* \(#,##0\);_("
"* "-"_);_(@_)
"* #,##0.00_);_("
"* \(#,##0.00\);_("
"* "-"??_);_(@_)
% - Accent1
% - Accent2
% - Accent3
% - Accent4
% - Accent5
% - Accent6
% - Accent1
% - Accent2
% - Accent3
% - Accent4
% - Accent5
% - Accent6
% - Accent1
% - Accent2
% - Accent3
% - Accent4
% - Accent5
% - Accent6
Accent1
Accent2
Accent3
Accent4
Accent5
Accent6
Avertissement
Calcul
Cellule li
Insatisfaisant
Lien hypertexte
Milliers
Milliers [0]
taire [0]
Neutre
Normal
Pourcentage
Satisfaisant
Sortie
Texte explicatif
rification
TableStyleMedium9PivotStyleLight16
Canon iP2700 series
Canon iP2700 series
IIIIIIIIIIIIIIII
JJJJJJJJJJJJJJJJJJJJJJJJJJJ-
/KKKKKKKKKK8
laghchiouaservices@yahoo.fr
mailto:laghchiouaservices@yahoo.fr
ThisWorkbook
Feuil1
Feuil2
Feuil3
N0{00020819-0000-0000-C000-000000000046}
N0{00020820-0000-0000-C000-000000000046}
N0{00020820-0000-0000-C000-000000000046}
N0{00020820-0000-0000-C000-000000000046}
Module1
__SRP_2
__SRP_3
_VBA_PROJECT
$*\Rffff*0;69ca8b22
\EXCEL.EXE#Microsoft Excel 16.0 Object Library
*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\Windows\System32\stdole2.tlb#OLE Automation
*\G{2DF8D04C-5BFA-101B-BDE5-00AA004dir
__SRP_0
__SRP_1
PROJECTwm
0;69ca8b22
Module1
*\G{000204EF-0000-0000-C000-000000000046}#4.2#9#C:\Program Files\Common Files\Microsoft Shared\VBA\VBA7.1\VBE7.DLL#Visual Basic For Applications
*\G{00020813-0000-0000-C000-000000000046}#1.9#0#C:\Program Files\Microsoft Office\Office16\EXCEL.EXE#Microsoft Excel 16.0 Object Library
*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\Windows\System32\stdole2.tlb#OLE Automation
*\G{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}#2.8#0#C:\Program Files\Common Files\Microsoft Shared\OFFICE16\MSO.DLL#Microsoft Office 16.0 Object Library
ThisWorkbook
0669ca8b21
ThisWorkbook
Feuil1
0769ca8b21
Feuil1
Feuil2
0869ca8b21
Feuil2
Feuil3
0969ca8b21
Feuil3
Module1
0;69ca8b22
Module1
kThisWorkbook
1Feuil1
2Feuil2
3Feuil3
1Module1
PROJECT
SummaryInformation
DocumentSummaryInformation
CompObj
mailto:laghchiouaservices@yahoo.fr
Antivirus Signature
Lionic Clean
Elastic Clean
ClamAV Clean
CTX Clean
CAT-QuickHeal Clean
Skyhigh BehavesLike.OLE2.Bad-VBA.nr
ALYac Clean
Malwarebytes Clean
Zillya Clean
Sangfor Clean
CrowdStrike Clean
K7GW Clean
K7AntiVirus Clean
huorong Clean
Baidu Clean
VirIT Clean
Symantec Clean
ESET-NOD32 Clean
TrendMicro-HouseCall Clean
Avast Clean
Cynet Clean
Kaspersky Clean
BitDefender Clean
NANO-Antivirus Clean
ViRobot Clean
MicroWorld-eScan Clean
Tencent Clean
Sophos Clean
F-Secure Clean
DrWeb Clean
VIPRE Clean
TrendMicro Clean
CMC Clean
Emsisoft Clean
Ikarus Clean
FireEye Clean
Jiangmin Clean
Varist Clean
Avira Clean
Fortinet Clean
Antiy-AVL Clean
Kingsoft Clean
Gridinsoft Clean
Xcitium Clean
Arcabit Clean
SUPERAntiSpyware Clean
Microsoft Clean
Google Clean
AhnLab-V3 Clean
Acronis Clean
McAfee Clean
TACHYON Clean
VBA32 Clean
Zoner Clean
Rising Clean
Yandex Clean
SentinelOne Clean
MaxSecure Clean
GData Clean
AVG Clean
Panda Clean
alibabacloud Clean
No IRMA results available.