SSR-1503 Fix unverified flow taxing invalid items

This commit is contained in:
Josh Dassinger 2024-09-19 14:04:27 -05:00
parent b0bc8c8219
commit 1caed930f5

View file

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