Merge branch 'feature/bugfix/CASH-501' into feature/CASH-464
This commit is contained in:
commit
44671d60fe
1 changed files with 12 additions and 13 deletions
|
|
@ -100,6 +100,7 @@ import {
|
||||||
PREMIUM_FEE_PART_TYPE,
|
PREMIUM_FEE_PART_TYPE,
|
||||||
PRICING_BY_DAY_PART_TYPE,
|
PRICING_BY_DAY_PART_TYPE,
|
||||||
} from "@/constants/schedule-constants";
|
} from "@/constants/schedule-constants";
|
||||||
|
import { DAYS_OF_WEEK } from "@/digital-components/date-picker/mixins/constants";
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
import { required } from "@/helpers/validation-rules";
|
import { required } from "@/helpers/validation-rules";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
|
@ -269,24 +270,22 @@ export default {
|
||||||
const priceString = getAmountDue(lineItemsToBePriced, false); // pass the IncludeTax param as false
|
const priceString = getAmountDue(lineItemsToBePriced, false); // pass the IncludeTax param as false
|
||||||
const priceStringIntegerRoundedDown = priceString?.split(".")[0]; // same method used as getDisplayPrice() in service-package-radio used on /quote
|
const priceStringIntegerRoundedDown = priceString?.split(".")[0]; // same method used as getDisplayPrice() in service-package-radio used on /quote
|
||||||
const pricingByDayBasePrice = parseInt(priceStringIntegerRoundedDown);
|
const pricingByDayBasePrice = parseInt(priceStringIntegerRoundedDown);
|
||||||
const payment = store.getters.order.payment;
|
|
||||||
const isInsurance = payment?.isInsurance;
|
|
||||||
|
|
||||||
// Check to see if includePricingByDayUpcharge should already be set (based on order lineItems)
|
|
||||||
let includePricingByDayUpcharge = false;
|
let includePricingByDayUpcharge = false;
|
||||||
if (supportingItemsFromStore) {
|
|
||||||
const pricingByDayUpchargeFeeIndex = supportingItemsFromStore?.findIndex(
|
|
||||||
(item) => item.partType == PRICING_BY_DAY_PART_TYPE
|
|
||||||
);
|
|
||||||
if (pricingByDayUpchargeFeeIndex > -1 && !isInsurance) {
|
|
||||||
includePricingByDayUpcharge = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load page with date already selected?
|
// Check to see if date should be pre-selected
|
||||||
let preSelectedDate = await store.getters.order.schedule.date;
|
let preSelectedDate = await store.getters.order.schedule.date;
|
||||||
if (!preSelectedDate || preSelectedDate.startTime === null) {
|
if (!preSelectedDate || preSelectedDate.startTime === null) {
|
||||||
preSelectedDate = null;
|
preSelectedDate = null;
|
||||||
|
} else {
|
||||||
|
// Check to see if pre-selected date should have pricing by day upcharge
|
||||||
|
if (showPricingByDay) {
|
||||||
|
// is this preSelectedDate a premium day?
|
||||||
|
const dayIndex = convertDateStringToDate(preSelectedDate).getDay();
|
||||||
|
const dayObject = DAYS_OF_WEEK[dayIndex];
|
||||||
|
if (dayObject.isPricingByDayUpchargeDay) {
|
||||||
|
includePricingByDayUpcharge = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up promises
|
// Set up promises
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue