Invoice number based on date input´s year date (SOLVED)

Ah, you aren’t in Italy by any chance ? I remember this from years back, VAT invoices must be sequential. No gaps allowed !

So I think Emmanuel is right, it is not going to be all that easy. But it will certainly be possible.

You will need two workflows on your “create invoice” button (or page). And you will also need some sort of “deleted invoice” table as well. Either that or have a status of “deleted” on your invoices.

The first workflow will be where there are no “deleted invoices” (search :count = 0 for the year) and you can create an invoice with the next sequential number.

The second workflow will be when there is a “deleted invoice”. In that case you will use the lowest deleted invoice number as you new invoice, and delete the row.

Or if you have a “deleted” status you would do a “make changes to thing” on the lowest invoice number instead. Change it to a “live” invoice and use that.

Hopefully that makes sense ?

1 Like