diff --git a/src/helpers/querystring-helper.js b/src/helpers/querystring-helper.js index 59c1579c..0327071d 100644 --- a/src/helpers/querystring-helper.js +++ b/src/helpers/querystring-helper.js @@ -28,3 +28,12 @@ export function getLineItemQueryString(lineItems, parameterName) { `${parameterName}[${index}].partNumber=${lineItem.partNumber}`).join('&'); return queryString.length !== 0 ? `&${queryString}` : ''; } + +export function getTaxLineItemQueryString(lineItems, parameterName) { + const queryString = getLineItemsFlattened(lineItems).map((lineItem, index) => + `${parameterName}[${index}].partNumber=${lineItem.partNumber}` + + `&${parameterName}[${index}].laborAmount=${lineItem.laborAmount}` + + `&${parameterName}[${index}].sellingPrice=${lineItem.sellingPrice}` + + `&${parameterName}[${index}].kitPrice=${lineItem.kitPrice}`).join('&'); + return queryString.length !== 0 ? `&${queryString}` : ''; +} diff --git a/src/store/index.js b/src/store/index.js index e0d248cd..2bcee233 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -26,7 +26,7 @@ import bailoutMessage from '@/constants/bailoutMessage'; import bailoutCode from '@/constants/bailoutCode'; import partNumberStrings from '@/constants/part-number-strings'; import { getLineItemsFlattened } from '@/helpers/line-items-helper'; -import { buildQueryStringParameterFromArrayOfComplexObjects, getLineItemQueryString } from '@/helpers/querystring-helper'; +import { buildQueryStringParameterFromArrayOfComplexObjects, getLineItemQueryString, getTaxLineItemQueryString } from '@/helpers/querystring-helper'; const storeId = 'main'; @@ -2021,7 +2021,7 @@ export const useMainStore = defineStore({ const serviceLocationState = serviceLocation.state; const serviceLocationZipCode = serviceLocation.zipCode; - const lineItemsQueryString = getLineItemQueryString(pricedLineItems, 'lineItems'); + const lineItemsQueryString = getTaxLineItemQueryString(pricedLineItems, 'lineItems'); let queryString = ''; if (appointmentType === AppointmentTypeStrings.MOBILE