fix ods affichage pour VACANT (sans dossier)
authorOlivier Larchevêque <olivier.larcheveque@auf.org>
Tue, 26 Jun 2012 18:49:52 +0000 (14:49 -0400)
committerOlivier Larchevêque <olivier.larcheveque@auf.org>
Tue, 26 Jun 2012 18:49:52 +0000 (14:49 -0400)
project/rh/ods.py

index bb76ae5..ca731a9 100644 (file)
@@ -84,7 +84,79 @@ def masse_salariale(lignes, annee, titres_traitements, titres_indemnites,
     )
 
     for ligne in lignes:
+
         row = table.add_row()
+
+        # GESTION de l'affichage des VACANTS
+        if 'dossier' not in ligne.keys():
+            row.add_cells([
+                ligne['poste'].implantation.region.code,
+                ligne['poste'].implantation.adresse_physique_pays.nom,
+                ligne['poste'].implantation.nom_court
+            ])
+            row.add_cell(ligne['valeur_point'], decimalplaces=2)
+            row.add_cells([
+                'VACANT', #ligne['dossier'].employe.id or 'VACANT',
+                '', #ligne['dossier'].employe.nom,
+                '', #ligne['dossier'].employe.prenom,
+                ligne['poste'].type_poste.nom,
+                ligne['poste'].nom,
+                '', #unicode(ligne['dossier'].classement),
+                '', #ligne['dossier'].classement
+                #and ligne['dossier'].classement.coefficient,
+                ligne['regime_travail'],
+                ligne['local_expatrie'],
+                '', #ligne['dossier'].statut.code,
+            ])
+            row.add_cell(
+                    '', #ligne['dossier'].date_fin, datastylename='iso-date'
+                    )
+            row.add_cell(backgroundcolor='#d3d3d3')
+            row.add_cells([
+                '', #ligne['date_debut'], ligne['date_fin']
+            ], datastylename='iso-date')
+            row.add_cell(ligne['jours'])
+            row.add_cell(backgroundcolor='#d3d3d3')
+            row.add_cell(ligne['devise'])
+            row.add_cells([
+                '', #ligne['salaire_bstg'], ligne['salaire_bstg_eur']
+            ], decimalplaces=2)
+            row.add_cell(
+                '', #ligne['dossier'].organisme_bstg
+                #and ligne['dossier'].organisme_bstg.nom,
+            )
+            row.add_cell(backgroundcolor='#d3d3d3')
+            row.add_cells(
+                [ligne['salaire_theorique']] + ligne['traitements'] +
+                [ligne['total_traitements']],
+                decimalplaces=2
+            )
+            row.add_cell(backgroundcolor='#d3d3d3')
+            row.add_cells(
+                ligne['indemnites'] + [ligne['total_indemnites']],
+                decimalplaces=2
+            )
+            row.add_cell(backgroundcolor='#d3d3d3')
+            row.add_cells(
+                ligne['primes'] + [ligne['total_primes']],
+                decimalplaces=2
+            )
+            row.add_cell(backgroundcolor='#d3d3d3')
+            row.add_cells(
+                ligne['charges'] + [ligne['total_charges']],
+                decimalplaces=2
+            )
+            row.add_cell(backgroundcolor='#d3d3d3')
+            row.add_cells([
+                ligne['total_traitements'], ligne['total_indemnites'],
+                ligne['total_primes'], ligne['total_charges']
+            ], decimalplaces=2)
+            row.add_cell(backgroundcolor='#d3d3d3')
+            row.add_cells([
+                ligne['masse_salariale'], ligne['masse_salariale_eur']
+            ], decimalplaces=2)
+            continue
+
         row.add_cells([
             ligne['poste'].implantation.region.code,
             ligne['poste'].implantation.adresse_physique_pays.nom,