Reset the invoice identifier {{{ID}}} tag each month


#1

Hello,

I have created this Invoice group with this invoice numbering.
EUR/{{{year}}}/{{{month}}}/{{{id}}}

Now how, can i make the {{{id}}} reset back to 1 each new month.

Example:
In the month november i created 3 invoices.

  • EUR/2016/11/1
  • EUR/2016/11/2
  • EUR/2016/11/3

The next month in december, the ID must start with 1 again automatically. And not with 4, otherwise where are invoice 1, 2, 3 of the month December and thats illegal in my country.

I don’t know if this is possible already or to create this with a cron job some way?

Already thank you and keep up the amazing work.
best regards,


#2

Hi there,
At the moment you can only do this manually by setting the Next ID for the invoice group to 1 at the start of each month. Cribs would not work because you have to be logged in to change this setting.

But an additional API for invoice groups to change these settings may be a good idea for InvoicePlane 2.


#3

Hi Kovah,

Yes it will indeed. A simple checkbox or dropdown in the invoice group. Would be helpful for people who are using year and month in their invoice number. Also in some countries the Id follop number must follow, like in my country. I made a few mistakes already, to forget to manually reset the id each month, thats why i’m asking.

Dropdown options.

  • Reset Id each day.
  • Reset id each week
  • Reest id each month
  • Reest id each quater
  • Reest id each 6 months
  • Reest id each year

ps: Can I submit this feature request somewhere?


#4

Hey guys,
any news on this “automatic” resetting (each day, each month, …) of the id?


#5

Hey,
As far as I know nothing has changed, maybe @Kovah will have another answer (maybe it’s in the dev ticket system I didn’t check it to be honest)

Regards


#6

Nope. Not possible with the current system because IDs are the important part of the invoice system as the ID makes an invoice unique.


#7

I was expecting the quote ID and the invoice ID to be reset every year.


#8

Nope. The ID is and will always be one incremental number.

If you want to reset it you can do so in the invoice group settings but have to make sure that the ID will not be a duplicate (with a year prefix for example).


#9

Yes, I am using a year prefix like <Year><ID> and since that I somehow assumed that it would jump from 20170123 to 20180001. But of course it did not. :slight_smile:


#10

As you are using an invoice prefix, this could be achieved with a cron job on the server running on the first of the month, to run a bash script:

#!/bin/bash
mysql -u IPUSERNAME -pIPDBPASS IPDBNAME -e "UPDATE ip_invoice_groups SET invoice_group_next_id = '1' WHERE invoice_group_id='GROUP_ID'";

IPUSERNAME being your database user, IPDBPASS the relevant mysql password, IPDBNAME being your InvoicePlane database, and GROUP_ID being the numeric ID for the InvoicePlane group.

It’s a messy / dirty way to do it, but it should work.

Cron:

0 0 1 * * /path/to/script.sh


#11

I also vote for this feature. I’d like to set it to reset every day. Our invoice number is the full date with an extra 2 digits for uniqueness.