Reset the invoice identifier {{{ID}}} tag each month (closed due to heavy necroposting)

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,

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.

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?

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

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

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

1 Like

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

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).

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:

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

1 Like

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.

Would really love to see that feature!!

My Invoices are named like this:

R{{{yy}}}.{{{month}}}.{{{day}}}|{{{id}}}
R19.03.18|1 (unique ID is “1”)

The next day I want the first Invoice look like this:
R19.03.19|1 (unique ID is “2”)

Maybe this would make sence:
{{{did}}} (daily ID, reset every day)
{{{mid}}} (monthly ID, reset every month)
{{{yid}}} (yearly ID, reset every year)

So I would rename my Invoice names to:
R{{{yy}}}.{{{month}}}.{{{day}}}|{{{did}}}

would make sense.
otherwise Invoices have very ugly names over time…

Thats true, I would not change/modify {{{id}}}, but instead of doing this I would create the three ID-helpers I mentioned above.

Hi i’ve opened this back in 2016. Does anyone found a solution how to reset this? As I want to avoid a cronjob.

I’m using directadmin.

Do you know this platform on how to setup your input? because i have a field command:

where i put and changes everything from the database of invoiceplane. Except not Sure if have to change GROUP_ID to something else too. I press save. but it fails

mysql -u IPUSERNAME -pIPDBPASS IPDBNAME -e "UPDATE ip_invoice_groups SET invoice_group_next_id = '1' WHERE invoice_group_id='GROUP_ID'";

Do I need to do something else to let it work?

Thanks for re-opening a 2 year old topic man!
Just take a look at Martin’s solution Reset the invoice identifier {{{ID}}} tag each month - #12 by M4rt1n

I can barely understand your question after that, so better open a new topic for it.
Try to explain your problem and then tell what you think your solution would be
(What you posted, but then better explained)

Maybe it will help in getting an answer for you

Is it not possible to build this feature into invoiceplanes core? Instead of using a cronjob on the server.

I will update my question with some screenshots.

Why is this topic closed while other people liked it? But the past developer abonned this project. Now that you are here to keep the project going, you close this? That’s what makes this project really dead :slight_smile: This is such a slap in the face, for caring about this project and a feature like this. Now I even can post my time of making printscreen and explain it better like you asked…:confused: not sure why i’m wasting my time here.

Even what martin is saying doesn’t make no sense at all… the ID will go on and you will get in serious trouble with the taxes in a country like belgium for example in this way.

We should be able like many people seem to be looking for, to check mark to reset the ID each month.

Maybe it’s possible, see Martin’s solution.
I’m going to close this topic now