cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate orders for B2B

bikrambsinha
Participant
0 Kudos

When we are submitting an order from B2B portal, there are 2 orders getting created (one with a version number and other without version number). We haven't done any customization for order submission process. Is this an out-of-the-box behavior ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Bikram,

This should be related to the order history snapshot functionality. By default, there are some order history entries that add a snapshot of the order, meaning it creates a copy of the order with all the data.

I think in the B2B scenario this happens as you enter the approval process. You can override this and avoid creating a snapshot (but still create a order history entry) but it should not affect normal behaviour like: hmc order search, customer order history, etc.

You can check the Order History & Versioning documentation for more information.

Regards, Leandro

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Bikram, Even i noticed this from 5.3. But we need to consider only version id is null. even thought we see two entries in database. But only one order data will be processed. Even when you search from HMC you can see one order. Because by default version id is empty selected.

bikrambsinha
Participant
0 Kudos

Hi Sumit/Leandro,

We have a strange situation now. Sometimes, it is creating 2 orders in Hybris but sometimes it is creating a single order without a version id.

Former Member
0 Kudos

Hi Bikram,

It may depend on how the order is processed (e.g: if the order needs approval or not, etc). The service that creates the snapshot (the one with the version_id) is OrderHistoryService.createHistorySnapshot. Maybe you can search in the code where this method is called.

As Vinay says, you should select the order with a null version_id as that is the correct one. This is already done in hMC and should also work on the accelerator storefront, like the order history pages.

Best, Leandro

bikrambsinha
Participant
0 Kudos

Thanks Leonardo. I found out the issue. This was because of different approval process set at B2BUnit level.

Former Member
0 Kudos

Hi @Bikram,

What did you do in order to correct this issue ? Even I am facing this with 5.4 and have got special order approval case.

Thanks.

0 Kudos

How do you find this? help me please...

Former Member
0 Kudos

Yes,

You need to use an appropriate order taking strategy to avoid this as the second order is used for review before being discarded.