• Resolved pinhinha

    (@pinhinha)


    A have activated the “Display invoice number” option and the “Next invoice number (without prefix/suffix etc.)” is the correct next number but when I change the order status it generates an invoice with next+1, ex: next invoice number = 100, generated=102.

    Note: when I use the manual generate invoice button it works as expected.

    Any clue on this issue?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @pinhinha,

    This is likely due to a known WooCommerce issue with a specific PayPal configuration, and it affects more than just invoice creation. PayPal has two different methods for confirming payment of an order (name “PDT” and “IPN”). If you have enabled both of them, PayPal sends?two?notifications to WooCommerce at the same time. This results in what is called a “race condition”: the processes start in parallel (not being able to see the other yet), doing the same tasks. The client receives two emails for their order (each with an invoice), stock gets reduced twice, and other processes might be duplicated as well. Because an order can only have one invoice, only one of them ‘survives’ after the processes have finished.

    IPN and PDT serve the exact same purpose, so you only need one of them. Two options (choose one):

    • To disable PDT, clear the “PayPal identity token” in the PayPal gateway settings in WooCommerce
    • To disable IPN you will need to go to your PayPal merchant backend (where you can also disable PDT by the way).

    Let us know if this indeed is your case, and if the instructions above solves your issue!

    Thread Starter pinhinha

    (@pinhinha)

    hello @yordansoares and thanks for replying.
    I’ve read a similar post about that race condition but, I don’t have PayPal installed, I do have Stripe.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Could you please go to WooCommerce > Status > System Status, click on Get system report, then click on Copy for support, paste it on https://pastebin.com/ (set a paste expiration for one week, just in case), and finally paste the pastebin.com link in your reply here?

    Thread Starter pinhinha

    (@pinhinha)

    Here’s the system status.
    (If you can, please explain what you’re looking for.)

    https://pastebin.com/rg7X8Lxt
    pwd: yf654bjpqm

    Plugin Contributor Yordan Soares

    (@yordansoares)

    I wonder if the issue is produced by Klarna. Is this an active payment method in your store?

    While you answer the question above, I’d like to introduce a very useful tool to track your invoice numbers: Number Tools.

    Please follow the steps below to see your invoice logs:

    1. Download, install and active the last release of Number Tools.
    2. Now go to WooCommerce > PDF Invoices > Number Tools > Document Numbers, select Invoice en click on View button.
    3. Now you will be able to track the invoice number sequence by date and order number.

    Please send us a screenshot of your latest invoice numbers to try to understand what’s happening.

    I too have the same issue, it is skipping some invoices in between and upon looking up, I see that the missing invoice number is just the duplicate invoice of the previous one and sent to the same customer.

    Here’s the proof:

    missing invoices

    I’m not using paypal but 1 payment gateway https://www.cashfree.com/

    Please let me know what’s going on?

    Will enabling this help?

    View post on imgur.com

    WooCommerce > PDF Invoices > Status & enabling the setting in the above image

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @pbayad1974,

    Could you please create a new topic, copying and pasting your messages there, so we can provide you with personalized help for you? ??

    Dealing with the two cases here can quickly become a mess, because they may be about different things, and both will receive all the email notices, even the answers that are not for your case.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @pinhinha,

    I have a few questions:

    1. Is there a certain pattern in the orders where this happens? (e.g. it happens with one payment gateway but not with another)
    2. Do you have any custom code that interacts with PDF invoices (or a custom PDF template)?
    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @pinhinha,

    Since we haven’t heard back from you in the last two weeks, we’re assuming you solved this issue, so I’ll go ahead and mark this ticket as Resolved.

    Feel free to reply to this topic is you still need help with this, or open a new topic if you have any other questions!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Invoice skips a number’ is closed to new replies.