Title: Duplicate Invoice Numbers
Last modified: August 30, 2016

---

# Duplicate Invoice Numbers

 *  Resolved [Garrett Hyder](https://wordpress.org/support/users/garrett-eclipse/)
 * (@garrett-eclipse)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/duplicate-invoice-numbers/)
 * Hello,
 * I have the plugin installed and was going back to previous orders to generate
   their invoices, when I click the pdf icon on the order listing in the backend
   I noticed that a couple times if I clicked two in succession both orders end 
   up with the same invoice number… screen;
 * Is there a way I can correct this from the admin while a fix is implemented?
 * Thanks
 * [https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)

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

 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/duplicate-invoice-numbers/#post-6633041)
 * 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](https://wordpress.org/support/users/garrett-eclipse/)
 * (@garrett-eclipse)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/duplicate-invoice-numbers/#post-6633114)
 * Thanks [@ewout](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

## Tags

 * [id](https://wordpress.org/support/topic-tag/id/)
 * [number](https://wordpress.org/support/topic-tag/number/)
 * [pdf](https://wordpress.org/support/topic-tag/pdf/)

 * 2 replies
 * 2 participants
 * Last reply from: [Garrett Hyder](https://wordpress.org/support/users/garrett-eclipse/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/duplicate-invoice-numbers/#post-6633114)
 * Status: resolved