When used on order items, work with the given adjustments

Created on 10 January 2025, 20 days ago

Problem/Motivation

Like the parent class, the formatter uses the PriceCalculater.

What that does is create an order, an order item, apply quantity, recalculate adjustments and then return that information.

What the formatter currently does is get the purchased entity from the order item, and then calculate it.

There are cases when that's not the right, for example when viewing completed orders or generating invoices for them, as the promotions/adjustments might have changed in the meantime.

Steps to reproduce

Proposed resolution

Directly use the price and adjusted price API on the order item.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇨🇭Switzerland berdir Switzerland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @berdir
  • 🇨🇭Switzerland berdir Switzerland

    I created a first merge request, this still needs to be properly tested on our side.

    The logic is a bit convoluted now due all the if/else conditions, it might make sense to introduce two methods to abstract this, wanted to keep the changes minimal for now.

    At first I wasn't sure if the adjustment types setting works with order items then, but I think it actually works very well, all the API's we need allow to provide adjustment types, just have to be careful about when it ends up being empty.

Production build 0.71.5 2024