VCST-5104: Add OrderTotals#497
Conversation
| </div> | ||
| <div class="order-items-summary__item __total"> | ||
| <span class="order-items-summary__value">{{ orderTotal.total | currency:orderTotal.currencyCode | showPrice:blade.isVisiblePrices}}</span> | ||
| </div> |
There was a problem hiding this comment.
Alternate currency summary mismatch
Medium Severity
The extra-currency summary on the items blade binds orderTotal.discountTotal, orderTotal.taxTotal, and orderTotal.total, while the primary summary uses item-scoped fields (subTotalDiscount, subTotalTaxTotal, and net item total). Those OrderTotal values are order-wide per currency, so alternate-currency rows can show shipping, payment, and fee-inclusive totals that do not match the labeled item subtotal row above.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c081dee. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8425793. Configure here.
| { | ||
| item.ReduceDetails(responseGroup); | ||
| } | ||
|
|
There was a problem hiding this comment.
RestoreDetails skips OrderTotals
Low Severity
RestoreDetails copies scalar price fields from the persisted order when the caller lacks price-read permission, but it does not restore OrderTotals, which this PR adds and clears in ReduceDetails when prices or order totals are omitted from the response group.
Reviewed by Cursor Bugbot for commit 8425793. Configure here.
|





Description
References
QA-test:
Jira-link:
https://virtocommerce.atlassian.net/browse/VCST-5104
Artifact URL:
https://vc3prerelease.blob.core.windows.net/packages/VirtoCommerce.Orders_3.1010.0-pr-497-b4da.zip
Note
Medium Risk
Refactors order total calculation and rounding paths for multi-currency orders, which can change reported totals when items, shipments, or payments use different currencies.
Overview
Adds per-currency order totals so mixed-currency orders expose subtotal, tax, discount, and grand total for each currency involved, not only the order’s primary currency.
A new
OrderTotalmodel andCustomerOrder.OrderTotalscollection are populated when totals are calculated.DefaultCustomerOrderTotalsCalculatornow groups line items, shipments, and payments by currency, runs the existing rollup/rounding logic per currency (using each currency’s rounding policy), and maps the results intoOrderTotals. The primary-currency entry still updates the main order’s scalar total fields. API surface includesWithOrderTotalsonCustomerOrderResponseGroup, withReduceDetails,Clone, and price stripping handling the new collection.The admin customer order items blade shows a currency column, extra summary rows for non-primary
orderTotals, a wider layout, and localized currency labels. Unit tests set explicitCurrencyon test data to match the new calculation paths.Reviewed by Cursor Bugbot for commit b4dae47. Bugbot is set up for automated code reviews on this repo. Configure here.