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() {
if (!this.lineItems || this.lineItems.length < 1) return;
if (this.isInsurance && !this.showCoverageAsVerified) {
return 0;
}
return this.isInsurance || !this.shouldHideRecalibration
? baseMixin.methods.getSalesTax(this.lineItems) // calculate with recal (if on order)
: 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 }) {
const log = getQuerystringParameter(queryStrings.LOG);
if (eval(log)) {
console.log("------------- Navigate to heritage start -----------------");
console.log(new Date() + " applicationConfig: " + JSON.stringify(applicationConfig));
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.

View file

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

View file

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

View file

@ -98,6 +98,9 @@ import store from "@/store";
import { storeActions } from "@/constants/store-actions.js";
import baseMixin from "@/mixins/base-mixin.js";
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
defineRule("year-required", required(errorMessages.YEAR_REQUIRED));
@ -127,6 +130,12 @@ export default {
},
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
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
const experimentForLogging = store.getters.applicationUser.experiments.find(

View file

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