Create Return Programmatically

Vote:
 

Commerce 11.

I have used this as a reference point: https://world.episerver.com/documentation/developer-guides/commerce/orders/using-the-return-order-form/

And while I can create and process a return in code I am missing a few bits of information that I can't seem to set in code.

Specifically the Totals information and the Total Before Return value on the line items (see image) I can't see any documentation which indicate how these are done.

Any documentation or help would be great.

Image:

http://i64.tinypic.com/11wc7ie.jpg

#194701
Jun 28, 2018 12:49
Vote:
 

Could not view your picture - and which exactly version you are using?

#194702
Jun 28, 2018 13:00
Vote:
 

Commerce is on 11.8.2

Does this image work?

https://ibb.co/fjV078

#194703
Jun 28, 2018 13:09
Vote:
 

Hi JSpencer,

In "Total Information" group, it's includes 3 items:

  • Line Items: Is the total of return items(return quantity * placed price).
  • Invalidates Discounts: Is the negate total entry discount amount of order form. For example: If you have a promotion buy 2 get discount of 10% of each item, you buy 3 items with price is 50$ then discount of this is 10% of 3*50$ = 15$. So if you return 2 items then the promotion became invalid => Invalidates Discounts here will be -15$.
  • Return Total: Is total amount of items has returned(return quantity * placed price - total entry discount if it has).

And the "Total Before Return": Is the same with "Return Total" and included order level discount if has(return quantity * placed price - total entry discount if it has - order level discount if it has).

#200219
Edited, Jan 05, 2019 6:16
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.