View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006312||OXID eShop (all versions)||2.6. Administer orders||public||2016-01-14 16:12||2022-02-02 09:33|
|Priority||normal||Severity||major||Reproducibility||unable to reproduce|
|Product Version||4.9.6 / 5.2.6|
|Target Version||Fixed in Version|
|Summary||0006312: Duplicate invoice numbers|
|Description||On our system duplicate invoice numbers are generated. OXID does not prevent this from happening. This is a serious issue, especially it is unnoticed.|
Suggestion: Create an unique index over OXSHOPID and OXBILLNR to prevent that from happening. An error with log entries is much better than silently creating duplicate invoice numbers.
|Tags||No tags attached.|
|PHP Version||Not defined|
|Database Version||Not defined|
Also, this issue happens only rarely so it's currently not possible to provide any information how to reproduce this issue, especially because it goes by unnoticed as OXID's database structure allows for duplicate invoice numbers.
From 64250 orders, 14 orders are affected. But that's 14 orders too many.
In fact the index alone is not enough, since by default there's no invoice number.
To me this looks like a race condition which is probably caused since we got multiple users working at the same time.
To solve this properly, a separate invoice table would be required.
||This is more a bug than a feature (IMHO)|
||Hello there. There is a pull request (https://github.com/OXID-eSales/oxideshop_ce/pull/553), which could help solve the problem, but its not prepared to merge. Please check the solution suggested there while working on fixing this issue.|
A few months back, we had a similar problem with duplicate values in the OXORDERNR column. It didn't happen again since then, but adding a UNIQUE constraint might help as a workaround (besides logging if there's a constraint violation for finding the root cause).
OXID version: 6.1.4
Additional payment types: PayPal
Reclassified as bug, as this is a legal issue. Duplicate bill or invoice numbers are not allowed by law (at least not in germany). So the shop should to everything to avoid something like that.
§14 (4) 4.