# Sales return management and Litium upgrade

**URL:** <https://forum.litium.com/t/sales-return-management-and-litium-upgrade/1176>\
**Category:** Questions\
**Tags:** litium-7\
**Created:** [October 29, 2019, 2:55pm UTC](https://forum.litium.com/t/sales-return-management-and-litium-upgrade/1176 "2019-10-29T14:55:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rickard.niklasson](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@rickard.niklasson](https://forum.litium.com/u/rickard.niklasson)\
**Post date:** [October 29, 2019, 2:55pm UTC](https://forum.litium.com/t/sales-return-management-and-litium-upgrade/1176/1 "2019-10-29T14:55:44Z")

</div>

We are developing an implementation of the return management introduced in 7.2 for an existing site that has been upgraded from a previous Litium version.  
All our orders however have the OrderType=“None” which is causing problems in the RMA services which expect the value to be “SalesOrder”.  
This affects both orders which were created before and after the upgrade.

In a new Accelerator project setup I can see that the created orders have OrderType=SalesOrder but I have not been able to identify what is causing this so I can get the same behavior.

So what extra steps are needed, in addition to the nuget packages, for our upgrade to be complete with the correct OrderType and RMA support?  
I can see that there are additional OrderType-checks, conditions and transition in the state builders. Is there anything else we need to do? Is there an upgrade release note that I have missed?

Litium version: 7.2

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [October 30, 2019, 8:11am UTC](https://forum.litium.com/t/sales-return-management-and-litium-upgrade/1176/2 "2019-10-30T08:11:36Z")

</div>

To solve the problem with wrong order type you can run the below SQL script, this will be tracked by bug 47576

```sql
update dbo.ECommerce_Order
set Type = 1 -- SalesOrder
where Type = 0 -- None

```

---

<div class="post-metadata">

**Author:** ![rickard.niklasson](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@rickard.niklasson](https://forum.litium.com/u/rickard.niklasson)\
**Post date:** [October 30, 2019, 10:24am UTC](https://forum.litium.com/t/sales-return-management-and-litium-upgrade/1176/3 "2019-10-30T10:24:18Z")

</div>

OK. That should fix the existing orders but our new orders are getting OrderType=None as well.

In this site we are using the payment providers and widgets for Klarna (4.7.105) and Adyen (4.7.105).  
As far as I understand both of these providers work by serializing the OrderCarrier and storing the result on disk to be used at a later point.  
My OrderCarrier.Type is “SalesOrder” before this serialization but is stored as an empty xml node in the files for both Klarna and Adyen ("`<Type />`") and when the order is finally placed the OrderType is back to None.

This feels like a bug to me or am I misunderstanding some part of the process?

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [October 30, 2019, 12:30pm UTC](https://forum.litium.com/t/sales-return-management-and-litium-upgrade/1176/4 "2019-10-30T12:30:51Z")

</div>

We are investigating this, can you create a separate bug report on docs-site about this behavior?

---

<div class="post-metadata">

**Author:** ![rickard.niklasson](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@rickard.niklasson](https://forum.litium.com/u/rickard.niklasson)\
**Post date:** [October 30, 2019, 1:36pm UTC](https://forum.litium.com/t/sales-return-management-and-litium-upgrade/1176/5 "2019-10-30T13:36:52Z")

</div>

I have created a new bug report for this behavior and included some additional data, bug 47594

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [October 31, 2019, 12:49pm UTC](https://forum.litium.com/t/sales-return-management-and-litium-upgrade/1176/6 "2019-10-31T12:49:09Z")

</div>

Add the

```auto
paymentWidgetOrder.OrderCarrier.Type = OrderType.SalesOrder;

```

before the

```auto
_cartAccessor.Cart.OrderCarrier = paymentWidgetOrder.OrderCarrier;

```

in `PaymentWidgetService` as a workaround so your order will be created with the correct order type.

---

<div class="post-metadata">

**Author:** ![rickard.niklasson](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@rickard.niklasson](https://forum.litium.com/u/rickard.niklasson)\
**Post date:** [November 1, 2019, 7:49am UTC](https://forum.litium.com/t/sales-return-management-and-litium-upgrade/1176/7 "2019-11-01T07:49:37Z")

</div>

Great, that was basically the workaround I had implemented myself in our AdyenPaymentService and KlarnaPaymentService and it seems to be working as intended.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [November 29, 2019, 7:49am UTC](https://forum.litium.com/t/sales-return-management-and-litium-upgrade/1176/8 "2019-11-29T07:49:39Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
