Skip to main content

Fonction calcul complément de prime


Bonjour, 

J’ai voulu créer une fonction calcul (DO2) afin que se calcul un complément sur prime d’ancienneté. Ce calcul doit prendre en compte les majorations de nuit présentent dans le bulletin.

Je me suis aidé de l’IA mais il ne trouve pas de réponse….

 

Begin

ForceTauxS = 0
Include("DOMONLY_INIT-D02")

// ============================================================
// RECUPERATION DES MONTANTS C01 DE MAJORATION HEURES DE NUIT
// ============================================================

MONTANTNUIT10 = 0
MONTANTNUIT20 = 0

bs = 0.0
ts = 0.0
rs = 0.0
bp = 0.0
tp = 0.0
rp = 0.0

Call CumulLignesEmploi(15,"Majoration heures de nuit 10%","",bul.periode,bul.date,bs,ts,rs,bp,tp,rp)

MONTANTNUIT10 = rs

bs = 0.0
ts = 0.0
rs = 0.0
bp = 0.0
tp = 0.0
rp = 0.0

Call CumulLignesEmploi(15,"Majoration heures de nuit 20%","",bul.periode,bul.date,bs,ts,rs,bp,tp,rp)

MONTANTNUIT20 = rs

// Base D02 = uniquement les montants des majorations de nuit
BB = MONTANTNUIT10 + MONTANTNUIT20


// ============================================================
// CALCUL DE L'ANCIENNETE
// ============================================================

 

Tauxs = 0

If Emp.CcnDate[1] <> Date(0,0,0) then

    // Entreprises ayant mis en oeuvre les dérogations prévues dans le cadre de la RTT

    Select case Bul.Annee

    Case "2019":
        Tauxs = 10

    Case "2018":
        Do
            If Emp.CcnDate[1] <= Date(31,12,2003) then
                Tauxs = 10
                Exit
            Endif

            If Emp.CcnDate[1] >= Date(1,1,2004) then
                Tauxs = 8
                Exit
            Endif

        Exit
        Loop

    Case "2017":
        Do
            If Emp.CcnDate[1] <= Date(31,12,2002) then
                Tauxs = 10
                Exit
            Endif

            If Emp.CcnDate[1] >= Date(1,1,2003) then
                Tauxs = 8
                Exit
            Endif

        Exit
        Loop

    Case "2016":
        Do
            If Emp.CcnDate[1] <= Date(31,12,2001) then
                Tauxs = 10
                Exit
            Endif

            If Emp.CcnDate[1] <= Date(31,12,2003) then
                Tauxs = 8
                Exit
            Endif

            If Emp.CcnDate[1] >= Date(1,1,2004) then
                Tauxs = 6
                Exit
            Endif

        Exit
        Loop

    EndSelect

Else

    // Entreprises n'ayant pas mis en oeuvre les dérogations prévues dans le cadre de la RTT

    If Emp.Anciennete >= 24 then Tauxs = 2
    If Emp.Anciennete >= 48 then Tauxs = 4
    If Emp.Anciennete >= 72 then Tauxs = 6
    If Emp.Anciennete >= 96 then Tauxs = 8
    If Emp.Anciennete >= 120 then Tauxs = 10

EndIf


If ForceTauxS <> 0 Then TauxS = ForceTauxS


// ============================================================
// GENERATION DE LA PRIME D02
// ============================================================

If Tauxs > 0 and BB <> 0 Then
    Bases = BB
    Exec("GenereLprime")
EndIf

Include("DOMONLY_FIN-D02")

End