View Issue Details

IDProjectCategoryView StatusLast Update
0006312OXID eShop (all versions)2.6. Administer orderspublic2024-12-04 11:07
Reportervschmi Assigned To 
PrioritynormalSeveritymajorReproducibilityunable to reproduce
Status resolvedResolutionwon't fix 
Product Version4.9.6 / 5.2.6 
Summary0006312: Duplicate invoice numbers
DescriptionOn 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.
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined

Activities

vschmi

2016-01-14 16:13

reporter   ~0011430

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.

vschmi

2016-01-14 17:45

reporter   ~0011432

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.

FibreFoX

2016-01-14 17:59

reporter   ~0011433

This is more a bug than a feature (IMHO)

anton.fedurtsya

2019-04-23 16:12

administrator   ~0012863

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.

tte

2019-08-12 16:14

reporter   ~0012958

Last edited: 2019-08-12 16:24

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

SvenBrunk

2022-02-02 09:33

administrator   ~0013709

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.

SvenBrunk

2024-12-04 11:07

administrator   ~0017745

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.