Details
-
Type: Sub-task
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 4.0.0-b5
-
Component/s: None
-
Labels:None
Description
Create Blesta\Core\Pricing\Presenter.
The pricing presenter should perform all of the necessary actions that the PricingPresenter component does, but should use MetaItemPrice from CORE-2207.
The presenter should also support functionality currently implemented in Invoices::getItemTotals, i.e. methods should exist that allow the items in the ItemPriceCollection, a set of totals (i.e. subtotal, total, total_after_tax, total_after_discount, tax_amount, discount_amount), a set of discounts, and a set of taxes to be fetched.
Blesta\Core\Pricing\Presenter\Build\ServiceChange\ServiceChangeBuilder has a function called pairCollections(). This function helps to determine whether new items have been added in a service change using keys that are created to identify each item. Currently setup fees and cancellation fees for configurable options have their own keys (service-##-option-##-setup/ service-##-option-##-cancel). This means that when a configurable option is is changed from a value without a setup fee to one with a setup fee, that setup fee is included in though total even though there was no new configurable option added. This applies to terms changes as well.