Merge pull request #849 from Safelite/defect/digital/SSR-1503

SSR-1503 Fix unverified flow taxing invalid items
This commit is contained in:
Josh Dassinger 2024-09-19 14:17:07 -05:00 committed by GitHub
commit 82f2a9ca41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1821,18 +1821,14 @@ export const useMainStore = defineStore({
},
async setPriceAndSalesTaxForOrderLineItems() {
const lineItemsToPrice = [
...(this.order.lineItems.supportingItems ?? []),
...(this.order.lineItems.glassParts ?? []),
...(this.order.lineItems.otherParts ?? []),
...(this.order.lineItems.vaps ?? []),
...(this.order.lineItems.feeItems ?? [])
];
let lineItemsToTax = [];
if (!this.isVerified || !this.isDeductible) {
let lineItemsToTax;
if (this.isVerified && !this.isDeductible) {
lineItemsToTax = [
...lineItemsToPrice
...(this.order.lineItems.supportingItems ?? []),
...(this.order.lineItems.glassParts ?? []),
...(this.order.lineItems.otherParts ?? []),
...(this.order.lineItems.vaps ?? []),
...(this.order.lineItems.feeItems ?? [])
];
} else {
lineItemsToTax = [