Jump to content

{number} in Sequential Invoice Number Format is slowly differentiating from ID in invoice URL


Recommended Posts

The {number} in Sequential Invoice Number Format is slowly differentiating from ID in the invoice URL.

In the beginning they where the same, but now, after about 4 months the ID in the URL is 5 digits further then then {number}  displayed on the invoice.

So basically we now have 2 invoice IDs/numbers.

Is there a way to use the ID from the invoice URL in "Sequential Invoice Number Format"?

We would like to avoid this potential cause for confusion.

Link to comment
Share on other sites

  • WHMCS Support Manager

Hi @OFCH,

Welcome to the community!

The behaviour your describing here is normal. The invoice IDs are always unique and based on the order in which the invoices are generated.

The Sequential Paid Invoice Numbering applies a different sequence to the Invoice Number field, based upon the order in which the invoices are paid.

As a result the two separate numbering sequences will diverge over time as you accumulate delinquent and written-off invoices.

Link to comment
Share on other sites

2 hours ago, WHMCS John said:

Hi @OFCH,

Welcome to the community!

The behaviour your describing here is normal. The invoice IDs are always unique and based on the order in which the invoices are generated.

The Sequential Paid Invoice Numbering applies a different sequence to the Invoice Number field, based upon the order in which the invoices are paid.

As a result the two separate numbering sequences will diverge over time as you accumulate delinquent and written-off invoices.

Hi, I am not using the Sequential Paid Invoice Numbering. I am using the Sequential Invoice Number Format (and in there the {number} field as part of our preferred invoice numbering scheme, our format is exactly "CP-{YEAR}-{NUMBER}" ) and it starts to differ from the Invoice ID in the URL.

To my knowledge both should be generated by invoice creation. So not really sure why they start to differ, but they do and it is starting to get confusing.

Link to comment
Share on other sites

There's a difference between an invoice ID an the invoice number.

The ID is how each invoice is identified in the database. It starts at 1 and increases by 1 for each generated invoice. The invoice number is just a number that can be anything.

If you go to General Settings > Invoices and change "Invoice Starting #" to 1000000 (prior to have generated any invoices), the invoice ID will be 1 while the invoice number will be 1000000.

Link to comment
Share on other sites

10 hours ago, DennisHermannsen said:

There's a difference between an invoice ID an the invoice number.

The ID is how each invoice is identified in the database. It starts at 1 and increases by 1 for each generated invoice. The invoice number is just a number that can be anything.

If you go to General Settings > Invoices and change "Invoice Starting #" to 1000000 (prior to have generated any invoices), the invoice ID will be 1 while the invoice number will be 1000000.

I understand, but they started out as the same and that is how we want it. Now they start to differ, already a difference of 5. So, is there a way to use the Invoice ID in the Sequential Invoice Number Format ?

Link to comment
Share on other sites

On 2/4/2022 at 5:08 AM, OFCH said:

I understand, but they started out as the same and that is how we want it. Now they start to differ, already a difference of 5. So, is there a way to use the Invoice ID in the Sequential Invoice Number Format ?

The ID is from the auto increment primary key in the database. It will keep increasing the number regardless if you delete a record or invoice and create a new one. Therefore, they will eventually not match. That ID should be discarded as reference or identifier, it's only used by the software and not only WHMCS but all softwares that uses databases.

The only reason you would use that ID is when it comes to identifying a unique record inside your code or software from the database. It's the ID that belongs to the row in the database, not the actual invoice number. You will see that ID keeps increasing with all records, domains, products, customers, invoices, etc., because it comes from your database, it's not generated by WHMCS but your MariaDB or MySQL database software as you keep adding records.

Edited by yggdrasil
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated