Fix for total employe
[auf_rh_dae.git] / project / dae / models.py
index 4098e1d..cc06308 100644 (file)
@@ -76,6 +76,21 @@ class Poste(PosteWorkflow, rh.Poste_):
         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()