Customised invoice index page

wagtailinvoices provides a default for the invoices index page which can be overridden by the user to display your custom fields, the default is

{% load i18n %}
<table class="listing full-width">
            <thead><tr class="table-headers">
                <th class="title">Name</th>
                <th class='issued_on'>Issued on</th>
                <th class="last_updated">Last Updated</th>
                <th class="date">Invoice No.</th>
            {% for invoice in invoice_list|dictsortreversed:"issue_date" %}
                    <td class="title">
                            <a href="{% url 'wagtailinvoices_edit' %}">
                                {% if not invoice.client_full_name %}{{invoice.client_organization}}{% else %}{{ invoice }}{% endif %}
                        <ul class="actions">
                            <li><a href="{% url 'wagtailinvoices_edit' %}" class="button button-small">{% trans 'Edit' %}</a></li>
                            <li><a href="{% url 'wagtailinvoices_delete' %}" class="button button-small button-secondary no">{% trans 'Delete' %}</a></li>
                    <td class='issued'> {{ invoice.issue_date|date:"d M Y H:i"}} </td>
                    <td class='updated'>
                        {% if invoice.last_updated %}
                        <div class="human-readable-date" title="{{ invoice.last_updated|date:"d M Y H:i" }}">
                        {{ invoice.last_updated|timesince }} ago</div>{% endif %}
                    <td class="date">
                        {{ }}
            {% endfor %}

You can define your own version of this inside templates/wagtailinvoices as invoice_list.html

Custom validation and overriding

Custom validation when saving an invoice can be done by defining a or similar, the name doesn't matter. Custom validation is done in this way as a work around for wagtail EditHandlers. Example usage

from django.contrib import messages
from wagtailinvoices.utils.validation import validation as wagtailinvoices_validation

def validation(request, invoice, is_sending_email):
    def is_invoice_address_fault():
        if invoice.client_organization or invoice.client_full_name:
            return False
            return True

    if is_invoice_address_fault() is True:
        messages.error(request, ('You cannot create an invoice without providing a client organization or client full name!'))
        return False

        return wagtailinvoices_validation(request, invoice, is_sending_email)

To tell your project to override the default validation and include yours you will need to include this in your settings, for example

WAGTAIL_INVOICES_VALIDATION = 'ccc.invoicelist.validation.validation'

WAGTAIL_INVOICES_VALIDATION will need to be provided with the string representation of the path to your validation class.