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 | 2024-12-04 11:07 |
Reporter | vschmi | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | unable to reproduce |
Status | resolved | Resolution | won't fix | ||
Product Version | 4.9.6 / 5.2.6 | ||||
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. | ||||
Theme | Not defined | ||||
Browser | Not defined | ||||
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. https://www.gesetze-im-internet.de/ustg_1980/__14.html ยง14 (4) 4. |
|
We put some thoughts into this and we can't really do anything about the invoice numbers within the shop framework itself. As the OXID eShop is usually used within an environment where the Shop is only one of the sales channels and the ERP is responsible for generating the invoices (and their numbers), we can not enforce any numbering scheme, sequentiality and (especially with ideas for order splitting and merging) not even uniqueness of the invoice/bill number as there might be multiple orders that share an invoice in the future. We will have a closer look at the order numbers again to make sure they are unique (as they are documents as well), but the order numbers are not guarded by law this closely. |