Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi Garrett,
    This is probably a combination of many successive clicks in the backend and a slow database/server, and there’s not much I can ‘fix’ about this from the plugin side: The plugin stores the ‘next invoice number’ in the database, and when it creates an invoice, it gets this, adds +1 to the number and stores it again. When you have multiple processes accessing the database, it might happen that the second process gets the ‘next invoice number’ that was already used by the first process, before the first process was able to store it in the db. There is no way of telling this is happening/blocking access to this number (as that would similarly requiring something to be written to the db with the same possible sync issues). Normally this should be very rare though, as we ar talking milliseconds between retrieving and storing the number. If there’s a delay on your server, the requests may be queued up though, but I haven’t actually seen this before (remember that this plugin is used on 30.000+ sites). It’s probably much rarer that this would happen with an automated action (sending an email attachment).

    The good news is that you can edit the invoice number if you go into the order details (under “PDF Invoice Data”).

    Let me know if you have any other questions!
    Ewout

    Thread Starter Garrett Hyder

    (@garrett-eclipse)

    Thanks @ewout,

    Appreciate the information, figured it may be a race condition. Occurred a few times for me but that’s because I was going back to all existing orders and creating invoices for them in quick succession.

    I’ll go through the orders and attempt to fix the PDF Invoice Data, currently that information for Invoice Number and Invoice Date are empty, but that’s most likely as I heavily customized to convert PDF Invoices to PDF Receipts.

    Appreciate your update.

    Cheers

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Duplicate Invoice Numbers’ is closed to new replies.