[Solved] Strange invoice order

I noticed, that the invoices are listed not in alphabetical order, like this:

QUO5
QUO7
QUO6

Why is that so?

Uhm, pretty good question. I’ll take a look at it.

Ok, and let us know the solution to fix it before new version if possible.

By default, invoices are sorted by creation date as stated in the function default_order_by() in file ~InvoicePlane/application/modules/invoices/models/mdl_invoices.php,

public function default_order_by()
{
    $this->db->order_by('ip_invoices.invoice_date_created DESC');
}

to display them sorted by invoice number, replace ip_invoices.invoice_date_created by ip_invoices.invoice_number in the above file to obtain,

public function default_order_by()
{
       $this->db->order_by('ip_invoices.invoice_number DESC');
}

In a similar way, quotes and payments are sorted by creation date and payment date respectively.

In the long term, a better solution would be to have sortable tables, for instance, using Ignited Datatables.

Miquel

4 Likes

Solved with commit e35177a
Will be included in release v1.1.2

Thank you, Miquel!
I can’t believe I couldn’t find this function…