• Resolved pieca

    (@pieca)


    Hi,
    I’m using PDF Invoices & Packing Slips for WooCommerce on my website since march 2021 and I’ve never had any issue with it since last month.
    The invoice numbering has always be sequential without any trouble.

    I’m making sales once a month.
    Between the January and the February sale, my invoice number jumps 3 numbers…
    last January invoice n° : 2024010055
    Next invoice number in February : 2024020058

    I never touched any preferences… AND IT NEVER EVER HAPPENS…
    I’m not deleting any orders even if they are failed

    Version 3.7.7/ Woocommerce 8.6.1 / WordPress 6.4.3
    my settings :
    NumberFormat :
    Prefix : [invoice_year][invoice_month]
    Suffix : empty
    Padding : 4
    Reset Number invoice yearly : checked
    Sorry, no log enabled…

    ADVANCED :
    Calculate document numbers (slow) : UNCHECKED
    Enable debug output
    Enable automatic cleanup : Every 7 days


    Any help would be greatly appreciated!

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

    (@yordansoares)

    Hi @pieca,

    Our plugin will always create a sequential number for your invoices, so if you’re seeing gaps in your numbering invoices, it could be caused by one of the following, which are the most common reasons of this behavior:

    1. Order deleted (manually/automatically): If you delete an order with an invoice, this action will not decrease or restore the invoice numbering to -1. You’ll need to restore the invoice numbering under WooCommerce > PDF Invoices > Documents > Invoice > Next invoice number.

      WooCommerce also has a Personal data retention group of settings that allows you to automatically delete orders based on its order status and a specific number of days after its placement:

      woocommerce-personal-data-retention.png

      You may need to have these settings working, but then you’ll need to disable the automatic invoice creation, to avoid create invoices for order statuses different to Processing and/or Completed, under WooCommerce > PDF Invoices > Documents > Invoice > Attach to:

      ac58ffbe8293e8474fa8fabbfa476519.png
    2. Invoices deleted: If you delete not the order itself, but an invoice created for it, this action either will not decrease your invoice numbering to -1.
    3. PayPal race condition: This is 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).
      ?
    4. The next invoice number has been changed manually: It is possible to change the next invoice number in the PDF invoice settings. This is a useful setting when you are configuring the plugin or when an issue happens with a specific invoice. However, if you use it wrongly, it can create gaps into your invoice numbers, when you do not follow your last invoice number created. 

    That said, you can take advantage of the Numbers tracking tool, that you will find under WooCommerce > PDF Invoices > Advaced > Numbers, that allows you to track the document numbers (invoices, packing slips, etc.), including the creation date, related order, and order status:

    371bb5a3891be2493d68c08f76640932.png

    Please note that if you set manually the Next invoice number, within the document settings, the numbering log is restarted, so you’ll only see the new numbers created afterward.

    Hope it helps to understand what happened!

    Kind regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Invoice numbering issue’ is closed to new replies.