{% extends "base.html" %} {% load crispy_forms_tags %} {% load crispy_forms_field %} {% block title %}Edit Invoice{% endblock title %} {% block subtitle %}Edit the invoice or its items.{% endblock subtitle %} {% block content %}
{% csrf_token %} {{ form|crispy }} {% if formset %} {% for form in formset.forms %} {% for fld in form.hidden_fields %}{{ fld }}{% endfor %} {% endfor %}
Description Hours Rate Amount
{% crispy_field form.description 'class' 'form-control form-control-sm' %} {% if form.description.errors %}
{% for error in form.description.errors %} {{ error }} {% endfor %}
{% endif %}
{% crispy_field form.hours 'class' 'form-control form-control-sm' %} {% if form.hours.errors %}
{% for error in form.hours.errors %} {{ error }} {% endfor %}
{% endif %}
{% crispy_field form.rate 'class' 'form-control form-control-sm' %} {% if form.rate.errors %}
{% for error in form.rate.errors %} {{ error }} {% endfor %}
{% endif %}
{% crispy_field form.amount 'class' 'form-control form-control-sm' %} {% if form.amount.errors %}
{% for error in form.amount.errors %} {{ error }} {% endfor %}
{% endif %}
{% if form.instance.pk %}{{ form.DELETE }}{% endif %}

{{ formset.management_form }}

{% else %}

The invoice items are not editable.

{% endif %}
Cancel
{% endblock content %}