Fixed some calculation issues
This commit is contained in:
parent
ec431ecd59
commit
738ffbe843
3 changed files with 11 additions and 10 deletions
|
|
@ -7,6 +7,7 @@ const cartItemTypes = {
|
||||||
RECYCLE_FEE: "RECYCLE FEE",
|
RECYCLE_FEE: "RECYCLE FEE",
|
||||||
MOBILE_FEE: "MOBILE FEE",
|
MOBILE_FEE: "MOBILE FEE",
|
||||||
PROMOS: "PROMOS",
|
PROMOS: "PROMOS",
|
||||||
|
EARLY_BIRD: "EARLY BIRD",
|
||||||
};
|
};
|
||||||
|
|
||||||
export { cartItemTypes };
|
export { cartItemTypes };
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ const partTypeStrings = {
|
||||||
RECALIBRATION: "RECALIBRATION",
|
RECALIBRATION: "RECALIBRATION",
|
||||||
RECYCLE_FEE: "RECYCLE FEE",
|
RECYCLE_FEE: "RECYCLE FEE",
|
||||||
MOBILE_FEE: "MOBILE FEE",
|
MOBILE_FEE: "MOBILE FEE",
|
||||||
|
REPAIR_FEE: "REPAIR FEE",
|
||||||
|
EARLY_BIRD: "EARLY BIRD"
|
||||||
};
|
};
|
||||||
|
|
||||||
export { partTypeStrings };
|
export { partTypeStrings };
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
linkType="text"
|
linkType="text"
|
||||||
:text="removeLinkText"
|
:text="removeLinkText"
|
||||||
href="#!"
|
href="#!"
|
||||||
@click-event="removeItem(PREMIUM_FEE_PART_TYPE, 'supportingItems')" />
|
@click-event="removeItem(premiumAppointmentDiscountCartItem.cartItemType, 'supportingItems')" />
|
||||||
<span>{{
|
<span>{{
|
||||||
currencyFormatter.format(premiumAppointmentDiscountCartItem.subTotal)
|
currencyFormatter.format(premiumAppointmentDiscountCartItem.subTotal)
|
||||||
}}</span>
|
}}</span>
|
||||||
|
|
@ -107,7 +107,6 @@ import { getHighestFullySatisfiedTier, getPackageContents } from "@/helpers/serv
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
import { partTypeStrings } from "@/constants/part-type-strings";
|
import { partTypeStrings } from "@/constants/part-type-strings";
|
||||||
import { PREMIUM_FEE_PART_TYPE } from "@/constants/schedule-constants";
|
|
||||||
import { cartItemCategories } from "@/constants/cart-item-categories";
|
import { cartItemCategories } from "@/constants/cart-item-categories";
|
||||||
import { cartItemTypes } from "@/constants/cart-item-types";
|
import { cartItemTypes } from "@/constants/cart-item-types";
|
||||||
|
|
||||||
|
|
@ -177,6 +176,8 @@ export default {
|
||||||
return vapsTypeName.Text;
|
return vapsTypeName.Text;
|
||||||
},
|
},
|
||||||
removeItem(cartItemType, category) {
|
removeItem(cartItemType, category) {
|
||||||
|
console.log("removeItem")
|
||||||
|
console.log(`cartItemType: ${cartItemType}, category: ${category}`)
|
||||||
this.lineItems[category] = this.lineItems[category].filter(
|
this.lineItems[category] = this.lineItems[category].filter(
|
||||||
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
||||||
);
|
);
|
||||||
|
|
@ -520,7 +521,7 @@ export default {
|
||||||
let cartItem = null;
|
let cartItem = null;
|
||||||
|
|
||||||
const mobileFeeLineItem = this.supportingItems.find(
|
const mobileFeeLineItem = this.supportingItems.find(
|
||||||
(lineItem) => lineItem.partNumber == partTypeStrings.MOBILE_FEE
|
(lineItem) => lineItem.partType == partTypeStrings.MOBILE_FEE
|
||||||
);
|
);
|
||||||
|
|
||||||
if (mobileFeeLineItem) {
|
if (mobileFeeLineItem) {
|
||||||
|
|
@ -550,11 +551,8 @@ export default {
|
||||||
otherSupportingItemsCartItem() {
|
otherSupportingItemsCartItem() {
|
||||||
let cartItem = null;
|
let cartItem = null;
|
||||||
|
|
||||||
const otherSupportingItemsLineItems = this.supportingItems.filter(
|
let otherSupportingItemsLineItems = baseMixin.methods.filterOutFees(this.supportingItems);
|
||||||
(lineItem) =>
|
otherSupportingItemsLineItems = otherSupportingItemsLineItems.filter(lineItem => lineItem.partType != partTypeStrings.EARLY_BIRD);
|
||||||
lineItem.partNumber != partTypeStrings.MOBILE_FEE &&
|
|
||||||
lineItem.partNumber != partTypeStrings.RECYCLE_FEE
|
|
||||||
);
|
|
||||||
|
|
||||||
if (otherSupportingItemsLineItems.length > 0) {
|
if (otherSupportingItemsLineItems.length > 0) {
|
||||||
cartItem = {
|
cartItem = {
|
||||||
|
|
@ -589,14 +587,14 @@ export default {
|
||||||
let cartItem = null;
|
let cartItem = null;
|
||||||
|
|
||||||
const premiumAppointmentDiscountLineItem = this.supportingItems.find(
|
const premiumAppointmentDiscountLineItem = this.supportingItems.find(
|
||||||
(lineItem) => lineItem.partNumber == PREMIUM_FEE_PART_TYPE
|
(lineItem) => lineItem.partType == partTypeStrings.EARLY_BIRD
|
||||||
);
|
);
|
||||||
|
|
||||||
if (premiumAppointmentDiscountLineItem) {
|
if (premiumAppointmentDiscountLineItem) {
|
||||||
cartItem = {
|
cartItem = {
|
||||||
name: this.premiumAppointmentDiscountCartItemName,
|
name: this.premiumAppointmentDiscountCartItemName,
|
||||||
category: cartItemCategories.SUPPORTING_ITEMS,
|
category: cartItemCategories.SUPPORTING_ITEMS,
|
||||||
cartItemType: PREMIUM_FEE_PART_TYPE,
|
cartItemType: cartItemTypes.EARLY_BIRD,
|
||||||
isDisplayed: true,
|
isDisplayed: true,
|
||||||
subTotal: 0,
|
subTotal: 0,
|
||||||
salesTax: 0,
|
salesTax: 0,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue