[#3142] Bugfix rapport de masse salariale
authorEric Mc Sween <eric.mcsween@auf.org>
Thu, 17 May 2012 19:38:42 +0000 (15:38 -0400)
committerEric Mc Sween <eric.mcsween@auf.org>
Thu, 17 May 2012 19:38:42 +0000 (15:38 -0400)
project/rh/masse_salariale.py

index 22b1c63..200fcb4 100644 (file)
@@ -291,17 +291,35 @@ class MasseSalariale():
             d.poste = p
             d.classement = p.classement_max
             d.point = p.valeur_point_max
+            if p.devise_max:
+                remunerations = [
+                    rh.Remuneration(
+                        montant=p.salaire_max, devise=p.devise_max,
+                        type=remuneration_base
+                    ),
+                    rh.Remuneration(
+                        montant=p.indemn_max, devise=p.devise_max,
+                        type=remuneration_indem
+                    ),
+                    rh.Remuneration(
+                        montant=p.autre_max, devise=p.devise_max,
+                        type=remuneration_charge
+                    )
+                ]
+            else:
+                remunerations = [
+                    rh.Remuneration(
+                        montant=0, devise=self.devise_base, type=type
+                    )
+                    for type in (
+                        remuneration_base, remuneration_indem,
+                        remuneration_charge
+                    )
+                ]
             contenu['p_%s' % p.id] = {
-                    'dossiers': set([d]),
-                    'remunerations': [
-                        rh.Remuneration(montant=p.salaire_max,
-                            devise=p.devise_max, type=remuneration_base),
-                        rh.Remuneration(montant=p.indemn_max,
-                            devise=p.devise_max, type=remuneration_indem),
-                        rh.Remuneration(montant=p.autre_max,
-                            devise=p.devise_max, type=remuneration_charge),
-                        ]
-                    }
+                'dossiers': set([d]),
+                'remunerations': remunerations
+            }
 
         for item in contenu.values():
             dossiers = item['dossiers']