Fix for total employe
authorBenoit C. Sirois <benoit.clennett-sirois@auf.org>
Tue, 23 Apr 2013 20:33:13 +0000 (16:33 -0400)
committerBenoit C. Sirois <benoit.clennett-sirois@auf.org>
Tue, 23 Apr 2013 20:33:13 +0000 (16:33 -0400)
project/assets/js/remun.js
project/dae/models.py
project/dae/templates/dae/poste_resume.html

index 27ae64e..06e0354 100644 (file)
@@ -99,6 +99,4 @@ $(document).ready(function(){
        ajouterLigne(el);
     });
     remun_totaux();
        ajouterLigne(el);
     });
     remun_totaux();
-
-
 });
 });
index 4098e1d..cc06308 100644 (file)
@@ -76,6 +76,21 @@ class Poste(PosteWorkflow, rh.Poste_):
         max_digits=12, decimal_places=2, default=0
     )
 
         max_digits=12, decimal_places=2, default=0
     )
 
+    @property
+    def total_employe_min(self):
+        res = ((self.salaire_min or Decimal('0')) +
+               (self.indemn_fct_min or Decimal('0')) +
+               (self.indemn_expat_min or Decimal('0'))
+               )
+        return res
+                
+    @property
+    def total_employe_max(self):
+        return ((self.salaire_max or Decimal('0')) +
+                (self.indemn_fct_max or Decimal('0')) +
+                (self.indemn_expat_max or Decimal('0'))
+                )
+
     # Managers
     objects = PosteManager()
 
     # Managers
     objects = PosteManager()
 
index a137956..46e2ff7 100644 (file)
       <td class="montant">{{ poste.indemn_expat_max|floatformat:0 }}</td>
       <td class="montant">{{ poste.indemn_expat_max|euros:poste.devise_max|floatformat:0 }}</td>
     </tr>
       <td class="montant">{{ poste.indemn_expat_max|floatformat:0 }}</td>
       <td class="montant">{{ poste.indemn_expat_max|euros:poste.devise_max|floatformat:0 }}</td>
     </tr>
+    <tr class="total-row">
+      <th><strong>Total employé</strong></th>
+      <th class="montant">{{ poste.total_employe_min|floatformat:0 }}</th>
+      <th class="montant">{{ poste.total_employe_min|euros:poste.devise_max|floatformat:0 }}</th>
+      <th class="montant">{{ poste.total_employe_max|floatformat:0 }}</th>
+      <th class="montant">{{ poste.total_employe_max|euros:poste.devise_max|floatformat:0 }}</th>
+    </tr>
     <tr>
       <th colspan="5">
        Charges patronales
     <tr>
       <th colspan="5">
        Charges patronales
       <td class="montant">{{ poste.autre_max|euros:poste.devise_max|floatformat:0 }}</td>
     </tr>
     <tr class="total-row" >
       <td class="montant">{{ poste.autre_max|euros:poste.devise_max|floatformat:0 }}</td>
     </tr>
     <tr class="total-row" >
-      <th>TOTAL</th>
+      <th>Total AUF</th>
       <td class="montant">{{ poste.get_couts_minimum|floatformat:0 }}</td>
       <td class="montant">{{ poste.get_couts_minimum_euros|floatformat:0 }}</td>
       <td class="montant">{{ poste.get_couts_maximum|floatformat:0 }}</td>
       <td class="montant">{{ poste.get_couts_minimum|floatformat:0 }}</td>
       <td class="montant">{{ poste.get_couts_minimum_euros|floatformat:0 }}</td>
       <td class="montant">{{ poste.get_couts_maximum|floatformat:0 }}</td>