I have set up a magento store with 5 stores for different sections of the charity. My problem exists in one store only 'fundraising'. The issue is this:

when a ticket is purchased through the store and paid for via PayPal standard, the transaction is not captured and no invoice is created. If I try to manually create the invoice I get the following error 'Unable to save the invoice'.

Please see contents of the log file below:

2015-05-05T11:20:34+00:00 ERR (3):
exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'INV100000001' for key 'UNQ_SALES_FLAT_INVOICE_INCREMENT_ID'' in lib/Zend/Db/Statement/Pdo.php:228
Stack trace:

There is lots more the log is huge, I thought that line was the problem. I seriously stuck here so any help would be massively appreciated

1 Answer 1


Somehow your system tries to create an invoice id which already exists - as you might know.

The number is created from the content of eav_entity_store. So it might help to just raise the entry of eav_entity_store by 1.

eav_entity_type has the list of entity type ids. You need the id of invoice.

Then you need the website id and has to change the increment_last_id. But PLEASE make a backup before.

And btw, I expect the current value to be 100000000

  • You were right I found the store id, looked up the last used invoice id and raised it by one in the relevant field you sir are a legend! Commented May 5, 2015 at 14:40
  • updated the answer Commented May 5, 2015 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.