• Resolved ds97

    (@ds97)


    Good day
    thanks for your plugin. So far it has worked very well, however my Accountant alerted me to the fact that my invoice and order numbers are completely jumbled with gaps in between. I can’t figure out any sort of pattern and I know we did manually add some invoices which could have been the cause for some of these, but it has happened so often that not all the gaps and strange numbers can be explained by this. I have consulted a previous post, and printed a list of all orders, as per the code that you provided in that post on the topic. Is there any way to retrospectively fix this for past orders, and more importantly, how can I fix this for future invoices?

    An example of the issue:

    590 53535 2020-12-29 15:18:51
    591 53536 2020-12-29 17:05:21
    592 53539 2021-01-01 19:32:38
    593 53541 2021-01-01 19:59:03
    594 47289 2020-12-09 18:07:25
    595 47482 2020-12-09 21:00:13
    596 42193 2020-12-03 08:39:28
    597 53545 2020-12-31 10:52:42
    598 53547 2021-01-02 11:09:41
    599 53555 2021-01-03 15:27:54
    600 53559 2021-01-04 13:04:23
    601 53569 2021-01-04 17:40:30
    602 53570 2021-01-04 18:00:26
    603 53571 2020-12-31 10:47:42
    604 53572 2021-01-05 16:27:37

    I can’t add an attachment here, but is there any way I could maybe double-check my settings to make sure they are correct?

    The settings are as follows:
    Next invoice number (without prefix/suffix etc.) – Set to 605 (Is this the problem?)

    If I set it back to one, I will surely get duplicate invoices. Should I just reset everything and start from scratch for the new year?

    Many thanks for your help.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter ds97

    (@ds97)

    * Additional info to the above question:
    We offer customers the option to pay with Paypal, Stripe (credit cards) and Sofort (EFT).

    Plugin Contributor Ewout

    (@pomegranate)

    For clarity, could you tell us where the gap is? I don’t see any missing numbers between 590 and 604 in your list. 605 is the correct number for “next invoice number” because 605 was your last number. Note that the order date is completely separate from the invoice date (unless you have set that to match the order date in the plugin settings). The invoice date is when the invoice is generated, which can be on a different day (or month or even year) than the order.

    I don’t know what code you used (you didn’t link to it), but we also have a tool to view the invoice numbers (and to renumber them if required): https://github.com/wpovernight/woocommerce-pdf-ips-number-tools/releases

    If you download and install the latest version (you need the woocommerce-pdf-ips-number-tools.zip file), you’ll get a new tab “Number Tools” in the PDF invoice settings, where you can go to the “Invoice numbers” section to see an overview of the invoice numbers since the last reset. (note that this will be gone as soon as you set the “next invoice number” to 1).

    Plugin Contributor Ewout

    (@pomegranate)

    This may also be helpful: When is the PDF invoice number assigned?

    Thread Starter ds97

    (@ds97)

    Hi Ewout, sorry, I am talking about the second column. If you read from the top, the first few numbers end in 35,36,39,41… and then there are more gaps as you go down.

    I used the code you suggested in this post: https://www.ads-software.com/support/topic/number-of-invoices-skipped/

    Thanks for the help, I am more interested in the invoice numbering than the order numbering. Is there maybe a way I can attach a screenshot here of the problem?

    Thanks again.

    Plugin Contributor Ewout

    (@pomegranate)

    That second column is the order number, not the invoice number (which is in the first column).

    See: Why is the PDF invoice number different from the woocommerce order number? (in addition to the title, it explains why order numbers are not sequential)

    There is no relation between the sequence (or date) of orders and the sequence (or date) of invoices, an invoice number is assigned when an invoice is created.
    It looks like you have set the Invoice Date to match the Order Date, that might be causing extra confusion here (since you are not actually creating the invoice on the same date as the order is created).

    You can post screenshots via imgbb.com for example, but I don’t think there’s anything “wrong” with your settings.

    In short:

    1. Order numbers (53535 etc. in your example) are not sequential and not linked to invoice numbers
    2. Invoice numbers (590 etc. in your example) are sequential but could have a completely different order than the order numbers. Unless you have set this to match the order number, but that would not be advisable for European shops.
    3. An invoice number is created when an invoice is created
    4. You appear to have set the invoice date to order date, which may be the source of the confusion here.
    Thread Starter ds97

    (@ds97)

    Hi Ewout,
    so sorry for the confusion, both the invoice numbers and the order numbers have gaps. I have read many articles about the order number gap problem, but that doesn’t concern me too much (I just couldn’t download a list of my invoice numbers).

    These are some of the invoice numbers in sequence, and then after the line, another sequence.

    120575BY Dec 22, 2020
    GAP
    120573BY Dec 21, 2020
    120572BY Dec 21, 2020
    ——————————
    120568BY Dec 20, 2020
    120567BY Dec 20, 2020
    120574BY Dec 20, 2020 (Strange to have this one here)
    120566BY Dec 19, 2020
    120565BY Dec 19, 2020
    120564BY Dec 19, 2020
    120563BY Dec 18, 2020
    GAP
    120557BY Dec 18, 2020
    120556BY Dec 18, 2020
    120555BY Dec 18, 2020

    So basically sometimes there are just gaps (as if a few numbers were skipped) and sometimes there’s a completely random invoice number in between the others. This problem repeats itself over the last four months or so, and wasn’t an issue when I first created the site in March, so not sure what I changed. Hmmm. I don’t know at what point I added paypal and stripe, not sure if that could be the culprit.
    Thanks again!

    Plugin Contributor Ewout

    (@pomegranate)

    Where did you get this list from, it doesn’t seem to come from the Number Tools plugin mentioned above, does it? (or from your code snippet)
    For as far I can tell, these gaps are simply when an number has been assigned to a newer or older order. Just like the 120574BY in your example, which you have noted as ‘GAP’ in the first sequence, but appears in the second sequence. Can you search for 120562BY ?

    This has nothing to do with the payment gateway (although it could be related to how many days it takes before an order is paid).

    See points 2-4 from my previous post. Simply put: an invoice can be created on a completely different date then the order.

    Thread Starter ds97

    (@ds97)

    Good day Ewout,
    the list above comes from the Woocomerce orders dashboard.

    I had a good look at the list generated from the code snippet. In this list, there are situations where the order number is the same for two orders and the time created is the same, but the invoice number is different.

    (Here the first two orders have the same order number and a different invoice number, but were created at the exact same time, the same with the second and third last order)

    536 51827 2020/12/15 20:19
    537 51827 2020/12/15 20:19
    538 51878 2020/12/15 21:26
    539 51986 2020/12/16 00:11
    540 51986 2020/12/16 00:11
    541 52104 2020/12/16 10:01

    When I search for the two invoice numbers in the system only one appears. This is where those gaps were created, as when I print the invoices, they then print in an order similar to this: 536,538,539,541) – Which obviously made our accountant question our invoices.
    From what I can see, this is only ever the case with PayPal payments.
    Like in this post: https://www.ads-software.com/support/topic/order-number-generates-2-different-invoice-numbers/

    I have disabled PDT to see if this makes a difference.

    As for the random orders in the middle of the other orders, this seems to be the case when an order failed or was returned from the shopper, where money was refunded. Not entirely sure what makes it jump to a different date, but I could at least explain this to the accountant, and find the place it would have fit in, in terms of the invoice numbering.
    So the orders are sequential, except for when PayPal is used, just with some random invoices where they shouldn’t be.

    Thanks for your help again!

    Plugin Contributor Ewout

    (@pomegranate)

    Thanks for reporting back, it looks like we’re honing in on a solution ??

    I have disabled PDT to see if this makes a difference.

    If you indeed had both IPN and PDT enabled, then this will quite likely fix that issue of duplicate invoices for a single order (and issues caused by the same duplicate setting in WooCommerce: emails twice, stock reduction twice etc… This will give improvement regardless!).

    just with some random invoices where they shouldn’t be.

    If the numbers are there, but simply with a different date that means the invoice was simply generated at a later date. To prevent creation of invoices for failed and cancelled orders, you could add those statuses to the ‘disable for:’ setting under Documents > Invoice.

    I hope that has answered all your questions!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Gaps in Invoice and Order numbers’ is closed to new replies.