Add net and gross purchase prices #1155
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an updated and improved version of #663 for the 6.3.1.0 release
1. Why is this change necessary?
Currently the product and the payload of the order line items have a purchase price field of type
float
. Many users want to manage their purchase prices as net prices. Some want to use different currencies when purchasing products.Hence the more complex
PriceField
with gross and net prices as well as currencies would be more suitable.2. What does this change do, exactly?
Adds a new purchase price field of the more complex type
PriceField
which supports purchases prices as net and gross prices as well as purchase prices in multiple currencies (even though the code right now only uses a single purchase price in the default currency).purchase_prices
of typePriceField
is added to the product definition as well as to the order line items (and some corresponding classes).float
purchase price field (and some corresponding functions) is marked as deprecated.LineItemPurchasePriceRule
improved to handle gross or net purchase prices. Existing rules are migrated.3. Describe each step to reproduce the issue or behaviour.
4. Please link to the relevant issues (if any).
5. Checklist