CSR-2237 found another cart price issue.  Salestax was showing $13 on an order that was pending coverage.  Changed salestax to return 0 for not verified insurance
This commit is contained in:
CarlNation 2024-10-01 08:21:47 -04:00
parent 92e0e6e60d
commit c41fe3fcfc
6 changed files with 27 additions and 9 deletions

View file

@ -1007,6 +1007,11 @@ export default {
}, },
salesTax() { salesTax() {
if (!this.lineItems || this.lineItems.length < 1) return; if (!this.lineItems || this.lineItems.length < 1) return;
if (this.isInsurance && !this.showCoverageAsVerified) {
return 0;
}
return this.isInsurance || !this.shouldHideRecalibration return this.isInsurance || !this.shouldHideRecalibration
? baseMixin.methods.getSalesTax(this.lineItems) // calculate with recal (if on order) ? baseMixin.methods.getSalesTax(this.lineItems) // calculate with recal (if on order)
: baseMixin.methods.getSalesTax(this.lineItemsWithoutRecal); // calculated without recal : baseMixin.methods.getSalesTax(this.lineItemsWithoutRecal); // calculated without recal

View file

@ -109,8 +109,10 @@ export async function getImplicitNavigation(toRoute) {
export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLog }) { export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLog }) {
const log = getQuerystringParameter(queryStrings.LOG); const log = getQuerystringParameter(queryStrings.LOG);
if (eval(log)) { if (eval(log)) {
console.log("------------- Navigate to heritage start -----------------");
console.log(new Date() + " applicationConfig: " + JSON.stringify(applicationConfig)); console.log(new Date() + " applicationConfig: " + JSON.stringify(applicationConfig));
console.log(new Date() + " navigateToHeritageFunnel: " + applicationConfig.HERITAGE_FUNNEL); console.log(new Date() + " navigateToHeritageFunnel: " + applicationConfig.HERITAGE_FUNNEL);
console.log("------------- Navigate to heritage end -----------------");
} }
// Create the order (or save existing order) when navigating to Heritage Funnel. // Create the order (or save existing order) when navigating to Heritage Funnel.

View file

@ -60,6 +60,7 @@
v-model="lineItems" v-model="lineItems"
:showAsPaid="isPia" :showAsPaid="isPia"
servicePackageOptionsCmsName="ServicePackageTitle" servicePackageOptionsCmsName="ServicePackageTitle"
:isInsurance="isInsurance"
:insuranceDeductible="currentDeductible" :insuranceDeductible="currentDeductible"
:insuranceCompanyName="insuranceCompanyName" :insuranceCompanyName="insuranceCompanyName"
:showInsuranceCoverageAs="showInsuranceCoverageAs" :showInsuranceCoverageAs="showInsuranceCoverageAs"

View file

@ -438,7 +438,7 @@ export default {
const payment = store.getters.order.payment; const payment = store.getters.order.payment;
const log = getQuerystringParameter(queryStrings.LOG); const log = getQuerystringParameter(queryStrings.LOG);
if (eval(log)) { if (eval(log)) {
console.log("quote.vue pagePrereqs:"); console.log("------------- quote.vue pagePrereqs start -----------------");
console.log( console.log(
new Date() + new Date() +
" store.getters.order.serviceLocation.zipCode: " + " store.getters.order.serviceLocation.zipCode: " +
@ -464,6 +464,7 @@ export default {
" store.getters.order.payment.insuranceCoverage?.isVerified: " + " store.getters.order.payment.insuranceCoverage?.isVerified: " +
payment?.insuranceCoverage?.isVerified payment?.insuranceCoverage?.isVerified
); );
console.log("----------------- quote.vue pagePrereqs end -----------------");
} }
return ( return (
store.getters.order.serviceLocation.zipCode && store.getters.order.serviceLocation.zipCode &&

View file

@ -98,6 +98,9 @@ import store from "@/store";
import { storeActions } from "@/constants/store-actions.js"; import { storeActions } from "@/constants/store-actions.js";
import baseMixin from "@/mixins/base-mixin.js"; import baseMixin from "@/mixins/base-mixin.js";
import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper"; import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
import { applicationConfig } from "../../constants/application-config";
import { queryStrings } from "@/constants/query-strings";
import { getQuerystringParameter } from "@/helpers/querystring-helper";
//define validation rules //define validation rules
defineRule("year-required", required(errorMessages.YEAR_REQUIRED)); defineRule("year-required", required(errorMessages.YEAR_REQUIRED));
@ -127,6 +130,12 @@ export default {
}, },
async beforeRouteEnter(to, from, next) { async beforeRouteEnter(to, from, next) {
const log = getQuerystringParameter(queryStrings.LOG);
if (eval(log)) {
console.log("----------------- applicationConfig start -----------------");
console.log(new Date() + JSON.stringify(applicationConfig));
console.log("----------------- applicationConfig end -----------------");
}
// Call APIs // Call APIs
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage); const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
const experimentForLogging = store.getters.applicationUser.experiments.find( const experimentForLogging = store.getters.applicationUser.experiments.find(

View file

@ -83,7 +83,7 @@ export default {
}; };
}, },
getTierOnePackagePrice(lineItems) { getTierOnePackagePrice(lineItems) {
let lineItemsToPrice = lineItems.filter((lineItem) => { let lineItemsToPrice = lineItems?.filter((lineItem) => {
return ( return (
lineItem.partType != partTypeStrings.FRONT_WIPER && lineItem.partType != partTypeStrings.FRONT_WIPER &&
lineItem.partType != partTypeStrings.REAR_WIPER && lineItem.partType != partTypeStrings.REAR_WIPER &&
@ -95,7 +95,7 @@ export default {
return totalPrice; return totalPrice;
}, },
filterOutFees(lineItems) { filterOutFees(lineItems) {
const filteredLineItems = lineItems.filter((item) => { const filteredLineItems = lineItems?.filter((item) => {
return ( return (
(!item.partType.includes("FEE") && !item.partType.includes("EARLY BIRD")) || (!item.partType.includes("FEE") && !item.partType.includes("EARLY BIRD")) ||
(item.partType === "REPAIR FEE" && item.partNumber != "SUPPLIES-REPAIR") (item.partType === "REPAIR FEE" && item.partNumber != "SUPPLIES-REPAIR")
@ -108,7 +108,7 @@ export default {
}, },
getTotalPriceOfAllLineItemsAndChildParts(lineItems, includeTax) { getTotalPriceOfAllLineItemsAndChildParts(lineItems, includeTax) {
let totalPrice = 0; let totalPrice = 0;
lineItems.forEach((lineItem) => { lineItems?.forEach((lineItem) => {
totalPrice += this.getTotalLineItemPrice(lineItem, includeTax); totalPrice += this.getTotalLineItemPrice(lineItem, includeTax);
if (lineItem.childParts) { if (lineItem.childParts) {
totalPrice += this.getTotalPriceOfAllLineItemsAndChildParts( totalPrice += this.getTotalPriceOfAllLineItemsAndChildParts(
@ -139,14 +139,14 @@ export default {
}, },
getAmountDue(lineItems, includeTax = true) { getAmountDue(lineItems, includeTax = true) {
var amountDue = 0; var amountDue = 0;
if (lineItems.glassParts) { if (lineItems?.glassParts) {
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts( amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
lineItems.glassParts, lineItems.glassParts,
includeTax includeTax
); );
} }
if (lineItems.supportingItems) { if (lineItems?.supportingItems) {
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts( amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
lineItems.supportingItems, lineItems.supportingItems,
includeTax includeTax
@ -162,14 +162,14 @@ export default {
amountDue = order.policy.currentDeductible; amountDue = order.policy.currentDeductible;
} }
if (lineItems.vaps) { if (lineItems?.vaps) {
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts( amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
lineItems.vaps, lineItems.vaps,
includeTax includeTax
); );
} }
if (lineItems.promos) { if (lineItems?.promos) {
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts( amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
lineItems.promos, lineItems.promos,
includeTax includeTax