Not sure if this should be classed a task/feature or bug, but it feels like something that just hasn't been done yet, so going with Task for now.
Use case: I want to use entity_print to generate a PDF of my order to send to the customer.
Currently there is no way to add Adjustments to the View mode, because the commerce_adjustment field type doesn't allow configuring via the UI and there is no FieldFormatter if it did. So showing the Order items table and the order total when there are adjustments on the order would give a different between the sum of all the items and the total that most customers would find a little confusing.
So this should add a FieldFormatter for commerce_adjustment and allow this to be configured in the UI, leading to something like this:

It's not pretty, but it's a start.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 2867289-5.patch | 8.79 KB | skyredwang |
| #4 | add-field-formatter-for-adjustments-2867289-2.patch | 8.13 KB | mattjones86 |
| #2 | 2867289-2.patch | 1.93 KB | lendude |
| adjustments-added-to-entity-viewmode.png | 61.95 KB | lendude |
Comments
Comment #2
lendudeSo something like this.
Comment #3
bojanz commentedThat won't be accurate, because the order total is affected by both order and order item adjustments.
So any order item level promotion for example won't be shown.
You have two options:
1) Use the commerce_order_total_summary formatter for the total_price field. It's built for your use case.
2) See the order receipt template, and how it gets the adjustments (also used by #2831952: Create an entity_print renderer for orders (to allow order PDF output)), then copy that approach.
Comment #4
mattjones86I happened to need this myself, so I extended your patch to have a few extra options.
I'm not worried about the order total, since the discounts are shown below as well - our client just wanted to see order line adjustments in the order item table as well.
Comment #5
skyredwangBased on #4, I changed the display a little bit to allow show
amountonly.#3 Thinks that the order level adjustment doesn't represent the total adjustment on the order. This is true, however, I do want the feature to only show order level adjustments. So, I reopened this feature request.
Comment #6
jsacksick commentedI believe this was addressed by #3544624: Add Adjustment Total Field Formatter.