Merge remote-tracking branch 'origin/develop' into feature/CSR-1804
This commit is contained in:
commit
49fc0b7373
4 changed files with 35 additions and 38 deletions
|
|
@ -130,7 +130,7 @@ const endpoints = {
|
|||
},
|
||||
PriceOrderItems: {
|
||||
url: "/price/api/v1/price/order-items",
|
||||
method: "GET",
|
||||
method: "POST",
|
||||
},
|
||||
ValidatePromo: {
|
||||
url: "/price/api/v1/price/order-promo",
|
||||
|
|
|
|||
|
|
@ -1008,15 +1008,15 @@ export default {
|
|||
salesTax() {
|
||||
if (!this.lineItems || this.lineItems.length < 1) return;
|
||||
return this.isInsurance || !this.shouldHideRecalibration
|
||||
? baseMixin.methods.getSubTotal(this.lineItems) // calculate with recal (if on order)
|
||||
: baseMixin.methods.getSubTotal(this.lineItemsWithoutRecal); // calculated without recal
|
||||
? baseMixin.methods.getSalesTax(this.lineItems) // calculate with recal (if on order)
|
||||
: baseMixin.methods.getSalesTax(this.lineItemsWithoutRecal); // calculated without recal
|
||||
},
|
||||
amountDue() {
|
||||
if (!this.lineItems || this.lineItems.length < 1) return;
|
||||
if (this.showAsPaid) return 0;
|
||||
return this.isInsurance || !this.shouldHideRecalibration
|
||||
? baseMixin.methods.getSubTotal(this.lineItems) // calculate with recal (if on order)
|
||||
: baseMixin.methods.getSubTotal(this.lineItemsWithoutRecal); // calculated without recal
|
||||
? baseMixin.methods.getAmountDue(this.lineItems) // calculate with recal (if on order)
|
||||
: baseMixin.methods.getAmountDue(this.lineItemsWithoutRecal); // calculated without recal
|
||||
},
|
||||
amountPaid() {
|
||||
if (!this.showAsPaid) {
|
||||
|
|
|
|||
|
|
@ -666,7 +666,7 @@ export default {
|
|||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.isPiaEnabled && this.totalAmountDue > 0 && !this.isRecalibrationOnOrder) {
|
||||
if (this.isPiaEnabled && this.totalAmountDue > 0 && !this.shouldHideRecalibration) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2413,14 +2413,6 @@ export const actions = {
|
|||
context,
|
||||
{ payload: { availableLineItems, serviceZipCode, serviceZipCodeCtu }, pageNameToLog }
|
||||
) {
|
||||
const zipCodeToUse = serviceZipCode
|
||||
? serviceZipCode
|
||||
: context.getters.order.serviceLocation.zipCode;
|
||||
|
||||
const ctuToUse = serviceZipCodeCtu
|
||||
? serviceZipCodeCtu
|
||||
: context.getters.order.serviceLocation.zipCodeCtu;
|
||||
|
||||
const flattenedLineItemsWithChildParts =
|
||||
getFlattenedArrayOfLineItemsWithChildParts(availableLineItems);
|
||||
|
||||
|
|
@ -2428,34 +2420,39 @@ export const actions = {
|
|||
partNumber: lineItem.partNumber,
|
||||
}));
|
||||
|
||||
const availableLineItemsFormattedForRequest =
|
||||
buildQueryStringParameterFromArrayOfComplexObjects(
|
||||
lineItemsWithOnlyPartNumbers,
|
||||
"lineItems"
|
||||
);
|
||||
|
||||
const vehicle = context.getters.order.vehicle;
|
||||
|
||||
// TODO: Insurance pricing...`ParentAccountNumber=${context.getters.order.payment.parentAccountNumber}`
|
||||
let queryString =
|
||||
`ParentAccountNumber=${context.getters.order.payment.parentAccountNumber}` +
|
||||
`&CTU=${ctuToUse}` +
|
||||
`&CarId=${vehicle.carId}` +
|
||||
`&Make=${vehicle.make}` +
|
||||
`&Model=${vehicle.model}` +
|
||||
`&Year=${vehicle.year}` +
|
||||
`&EON=${context.getters.order.eon}` +
|
||||
`&ZipCode=${zipCodeToUse}` +
|
||||
`&${availableLineItemsFormattedForRequest}`;
|
||||
|
||||
const lineItemServerData = context.getters.order.lineItems.serverData;
|
||||
if (lineItemServerData) {
|
||||
queryString += `&ServerData=${encodeURIComponent(lineItemServerData)}`;
|
||||
const order = context.getters.order;
|
||||
|
||||
var providerNumber = order.serviceLocation?.provider?.providerNumber ?? order.serviceLocation?.zipCodeCtu;
|
||||
if (providerNumber.startsWith("00") && providerNumber.length > 5) {
|
||||
providerNumber = providerNumber.substring(1);
|
||||
}
|
||||
|
||||
const response = await globalMethods.callHttpClient({
|
||||
method: endpoints.PriceOrderItems.method,
|
||||
endpoint: `${endpoints.PriceOrderItems.url}?${queryString}`,
|
||||
endpoint: endpoints.PriceOrderItems.url,
|
||||
payload: {
|
||||
parentAccountNumber: order.payment?.parentAccountNumber,
|
||||
billToAccountNumber:
|
||||
order.payment?.billToAccountNumber ??
|
||||
applicationConfig.CASH_DEFAULT_BILL_TO_ACCOUNT_NUMBER,
|
||||
providerNumber: providerNumber,
|
||||
carId: order.vehicle.carId,
|
||||
year: order.vehicle.year,
|
||||
make: order.vehicle.make,
|
||||
model: order.vehicle.model,
|
||||
eon: order.eon,
|
||||
state: order.serviceLocation?.state,
|
||||
referralNumber: order.referralNumber,
|
||||
referralSequenceNumber: order.referralSequenceNumber,
|
||||
zipCode: order.serviceLocation?.zipCode,
|
||||
serviceZipCode: serviceZipCode ?? order.serviceLocation?.zipCode,
|
||||
referralDate: order.referralDate,
|
||||
isReplacement: !order.damage.isRepair,
|
||||
deductible: order.policy?.currentDeductible,
|
||||
coverageStatus: order.payment?.insuranceCoverage?.coverageStatus,
|
||||
lineItems: lineItemsWithOnlyPartNumbers,
|
||||
serverData: order.lineItems.serverData ? order.lineItems.serverData : "",
|
||||
},
|
||||
logApiCall: true,
|
||||
pageNameToLog: pageNameToLog,
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue