######################
# Comparaison de poste
######################
+
+ def est_comparable(self):
+ """
+ Si on a au moins une valeur de saisie dans les comparaisons, alors le poste
+ est comparable.
+ """
+ if self.comp_universite_min is None and \
+ self.comp_fonctionpub_min is None and \
+ self.comp_locale_min is None and \
+ self.comp_ong_min is None and \
+ self.comp_autre_min is None and \
+ self.comp_universite_max is None and \
+ self.comp_fonctionpub_max is None and \
+ self.comp_locale_max is None and \
+ self.comp_ong_max is None and \
+ self.comp_autre_max is None:
+ return False
+ else:
+ return True
+
def get_taux_comparaison(self):
try:
return rh.TauxChange.objects.filter(implantation=self.implantation, devise=self.devise_comparaison)[0].taux
</tr>
</tbody>
</table>
+{% if poste.est_comparable %}
<table id="elements-comparaison">
<tbody>
<tr>
</tr>
<tr>
<th>Minimum</th>
- <td>{{ poste.comp_universite_min|floatformat:0 }} {{ poste.devise_comparaison.code }}
+ <td>
+ {% if poste.comp_universite_min %}
+ {{ poste.comp_universite_min|floatformat:0 }} {{ poste.devise_comparaison.code }}
({{ poste.get_comp_universite_min_euros|floatformat:0 }} EUR)
+ {% endif %}
</td>
- <td>{{ poste.comp_fonctionpub_min|floatformat:0 }} {{ poste.devise_comparaison.code }}
+ <td>
+ {% if poste.comp_fonctionpub_min %}
+ {{ poste.comp_fonctionpub_min|floatformat:0 }} {{ poste.devise_comparaison.code }}
({{ poste.get_comp_fonctionpub_min_euros|floatformat:0 }} EUR)
+ {% endif %}
</td>
- <td>{{ poste.comp_locale_min|floatformat:0 }} {{ poste.devise_comparaison.code }}
+ <td>
+ {% if poste.comp_locale_min %}
+ {{ poste.comp_locale_min|floatformat:0 }} {{ poste.devise_comparaison.code }}
({{ poste.get_comp_locale_min_euros|floatformat:0 }} EUR)
+ {% endif %}
</td>
- <td>{{ poste.comp_ong_min|floatformat:0 }} {{ poste.devise_comparaison.code }}
+ <td>
+ {% if poste.comp_ong_min %}
+ {{ poste.comp_ong_min|floatformat:0 }} {{ poste.devise_comparaison.code }}
({{ poste.get_comp_ong_min_euros|floatformat:0 }} EUR)
+ {% endif %}
</td>
- <td>{{ poste.comp_autre_min|floatformat:0 }} {{ poste.devise_comparaison.code }}
+ <td>
+ {% if poste.comp_autre_min %}
+ {{ poste.comp_autre_min|floatformat:0 }} {{ poste.devise_comparaison.code }}
({{ poste.get_comp_autre_min_euros|floatformat:0 }} EUR)
+ {% endif %}
</td>
</tr>
<tr>
<th>Maximum</th>
- <td>{{ poste.comp_universite_max }} {{ poste.devise_comparaison.code }}
+ <td>
+ {% if poste.comp_universite_max %}
+ {{ poste.comp_universite_max|floatformat:0 }} {{ poste.devise_comparaison.code }}
({{ poste.get_comp_universite_max_euros|floatformat:0 }} EUR)
+ {% endif %}
</td>
- <td>{{ poste.comp_fonctionpub_max }} {{ poste.devise_comparaison.code }}
+ <td>
+ {% if poste.comp_fonctionpub_max %}
+ {{ poste.comp_fonctionpub_max|floatformat:0 }} {{ poste.devise_comparaison.code }}
({{ poste.get_comp_fonctionpub_max_euros|floatformat:0 }} EUR)
+ {% endif %}
</td>
- <td>{{ poste.comp_locale_max }} {{ poste.devise_comparaison.code }}
+ <td>
+ {% if poste.comp_locale_max %}
+ {{ poste.comp_locale_max|floatformat:0 }} {{ poste.devise_comparaison.code }}
({{ poste.get_comp_locale_max_euros|floatformat:0 }} EUR)
+ {% endif %}
</td>
- <td>{{ poste.comp_ong_max }} {{ poste.devise_comparaison.code }}
+ <td>
+ {% if poste.comp_ong_max %}
+ {{ poste.comp_ong_max|floatformat:0 }} {{ poste.devise_comparaison.code }}
({{ poste.get_comp_ong_min_euros|floatformat:0 }} EUR)
+ {% endif %}
</td>
- <td>{{ poste.comp_autre_max }} {{ poste.devise_comparaison.code }}
+ <td>
+ {% if poste.comp_autre_max %}
+ {{ poste.comp_autre_max }} {{ poste.devise_comparaison.code }}
({{ poste.get_comp_autre_max_euros|floatformat:0 }} EUR)
+ {% endif %}
</td>
</tr>
</tbody>
</table>
+{% else %}
+ <p>Il n'y a pas de comparaisons disponibles</p>
+{% endif %}
</fieldset>
<fieldset>