{% extends "admin/change_form.html" %}
{% load admin_urls i18n %}

{% block object-tools %}
{% if change %}{% if not is_popup %}
<ul class="object-tools">
	{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
	<li><a href="{{ history_url }}" class="historylink">{% trans "History" %}</a></li>
	<li><a href="{% url "admin:eo_facture_client_change" original.client.id %}" class="historylink">Client</a></li>
	{% if original.contrat %}
	<li><a href="{% url "admin:eo_facture_contrat_change" original.contrat.id %}" class="historylink">Contrat</a></li>
	{% endif %}
	<li><a href="{{history_url}}../view_pdf/{{ original.code }}.pdf">Imprimer</a></li>
	{% if original.client.chorus_structure and not original.proforma %}
	<li><a href="{% url "admin:eo_facture_facture_send_to_chorus" original.id %}">Envoyer à Chorus</a></li>
	{% endif %}
	{% if not original.annulation %}
	<li><a href="{% url "admin:eo_facture_facture_cancel" original.id %}">Annuler</a></li>
	{% endif %}
</ul>
{% endif %}{% endif %}
{% endblock %}

