Add VAT Included line item for inclusive taxes - #1445
Open
pbennett1-godaddy wants to merge 3 commits into
Open
Conversation
🦋 Changeset detectedLatest commit: d0e428d The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a separate VAT Included line item to checkout and storefront order totals.
Inclusive taxes are already part of the displayed product price and are not included in
order.totals.taxTotal. As a result, they were not visible in the existing Estimated taxes row. Thischange derives the VAT amount from the order-level tax constituents and displays it separately without changing the amount due.
The VAT total:
amount.valuereturned by the tax calculation pipeline.included === true.additional === true.The checkout draft-order query now retrieves order-level tax constituent amounts. The storefront order query also retrieves the
additionalflag so additive taxes can be explicitly excluded.Localized labels were added for all supported locales, including GST Included for Australia.
Changeset
Test Plan
Added unit tests for inclusive tax total calculation:
Added checkout integration coverage verifying:
Verified the VAT row uses the existing tax-loading state.
Ran the following validation:
pnpm --filter @godaddy/localizations typecheck
pnpm --filter @godaddy/react typecheck
pnpm --filter @godaddy/react lint
pnpm --filter @godaddy/react exec vitest run src/components/checkout/totals/utils/get-included-tax-total.test.ts src/components/checkout/tests/checkout-totals-summary.test.tsx
All checks and 12 relevant tests passed.