@nerdjs/sales-kit 2.4.5 → 2.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/dist/entities/area/area.d.ts +6 -0
  2. package/dist/entities/area/area.js +29 -0
  3. package/dist/entities/area/area.js.map +1 -0
  4. package/dist/entities/area/helper.d.ts +5 -0
  5. package/dist/entities/area/helper.js +16 -0
  6. package/dist/entities/area/helper.js.map +1 -0
  7. package/dist/entities/area/index.d.ts +2 -0
  8. package/dist/entities/area/index.js +3 -0
  9. package/dist/entities/area/index.js.map +1 -0
  10. package/dist/entities/carrier/carrier.d.ts +17 -0
  11. package/dist/entities/carrier/carrier.js +64 -0
  12. package/dist/entities/carrier/carrier.js.map +1 -0
  13. package/dist/entities/carrier/helper.d.ts +5 -0
  14. package/dist/entities/carrier/helper.js +16 -0
  15. package/dist/entities/carrier/helper.js.map +1 -0
  16. package/dist/entities/carrier/index.d.ts +2 -0
  17. package/dist/entities/carrier/index.js +3 -0
  18. package/dist/entities/carrier/index.js.map +1 -0
  19. package/dist/entities/carrierTender/carrierTender.d.ts +47 -77
  20. package/dist/entities/carrierTender/carrierTender.js +118 -139
  21. package/dist/entities/carrierTender/carrierTender.js.map +1 -1
  22. package/dist/entities/carrierTender/helper.d.ts +0 -1
  23. package/dist/entities/carrierTender/helper.js +0 -10
  24. package/dist/entities/carrierTender/helper.js.map +1 -1
  25. package/dist/entities/carrierTenderChange/carrierTenderChange.d.ts +10 -0
  26. package/dist/entities/carrierTenderChange/carrierTenderChange.js +38 -0
  27. package/dist/entities/carrierTenderChange/carrierTenderChange.js.map +1 -0
  28. package/dist/entities/carrierTenderChange/helper.d.ts +5 -0
  29. package/dist/entities/carrierTenderChange/helper.js +16 -0
  30. package/dist/entities/carrierTenderChange/helper.js.map +1 -0
  31. package/dist/entities/carrierTenderChange/index.d.ts +2 -0
  32. package/dist/entities/carrierTenderChange/index.js +3 -0
  33. package/dist/entities/carrierTenderChange/index.js.map +1 -0
  34. package/dist/entities/carrierTenderV1/carrierTenderV1.d.ts +80 -0
  35. package/dist/entities/carrierTenderV1/carrierTenderV1.js +187 -0
  36. package/dist/entities/carrierTenderV1/carrierTenderV1.js.map +1 -0
  37. package/dist/entities/carrierTenderV1/helper.d.ts +6 -0
  38. package/dist/entities/carrierTenderV1/helper.js +26 -0
  39. package/dist/entities/carrierTenderV1/helper.js.map +1 -0
  40. package/dist/entities/carrierTenderV1/index.d.ts +2 -0
  41. package/dist/entities/carrierTenderV1/index.js +3 -0
  42. package/dist/entities/carrierTenderV1/index.js.map +1 -0
  43. package/dist/entities/index.d.ts +4 -0
  44. package/dist/entities/index.js +4 -0
  45. package/dist/entities/index.js.map +1 -1
  46. package/dist/hooks/lep/lepActionBar.js +1 -541
  47. package/dist/hooks/lep/lepActionBar.js.map +1 -1
  48. package/dist/hooks/lep/lepTenders.js.map +1 -1
  49. package/dist/hooks/lep/loadEditPanel.js +1 -7
  50. package/dist/hooks/lep/loadEditPanel.js.map +1 -1
  51. package/dist/hooks/load/constants.js +43 -40
  52. package/dist/hooks/load/constants.js.map +1 -1
  53. package/dist/hooks/load/loadsSearchInput.d.ts +1 -0
  54. package/dist/hooks/load/loadsSearchInput.js +18 -1
  55. package/dist/hooks/load/loadsSearchInput.js.map +1 -1
  56. package/dist/hooks/locationsForm/locationsFormSales.js +2 -2
  57. package/dist/hooks/locationsForm/locationsFormSales.js.map +1 -1
  58. package/dist/hooks/quote/constants.js +1 -0
  59. package/dist/hooks/quote/constants.js.map +1 -1
  60. package/dist/hooks/quote/form.js +2 -2
  61. package/dist/hooks/quote/form.js.map +1 -1
  62. package/dist/hooks/quote/helpers.js +2 -1
  63. package/dist/hooks/quote/helpers.js.map +1 -1
  64. package/dist/hooks/quote/result.js +192 -203
  65. package/dist/hooks/quote/result.js.map +1 -1
  66. package/dist/locales/en/common.json +2 -1
  67. package/dist/locales/index.d.ts +1 -0
  68. package/dist/redux/api/salesApi.d.ts +1 -1
  69. package/dist/redux/api/salesApi.js +10 -7
  70. package/dist/redux/api/salesApi.js.map +1 -1
  71. package/dist/redux/apiTender/apiTenderEndpoints.d.ts +10 -10
  72. package/dist/redux/appointmentArrival/appointmentArrivalEndpoints.d.ts +12 -12
  73. package/dist/redux/appointmentIssue/appointmentIssueEndpoints.d.ts +10 -10
  74. package/dist/redux/appointmentIssueCategory/appointmentIssueCategoryEndpoints.d.ts +11 -11
  75. package/dist/redux/appointmentIssueSubcategory/appointmentIssueSubcategoryEndpoints.d.ts +10 -10
  76. package/dist/redux/appointmentNote/appointmentNoteEndpoints.d.ts +10 -10
  77. package/dist/redux/appointmentNoteType/appointmentNoteTypeEndpoints.d.ts +10 -10
  78. package/dist/redux/appointmentTrip/appointmentTripEndpoints.d.ts +10 -10
  79. package/dist/redux/archerFile/archerFileEndpoints.d.ts +13 -13
  80. package/dist/redux/area/areaEndpoints.d.ts +29 -0
  81. package/dist/redux/area/areaEndpoints.js +64 -0
  82. package/dist/redux/area/areaEndpoints.js.map +1 -0
  83. package/dist/redux/area/index.d.ts +2 -0
  84. package/dist/redux/area/index.js +3 -0
  85. package/dist/redux/area/index.js.map +1 -0
  86. package/dist/redux/asset/assetEndpoints.d.ts +12 -12
  87. package/dist/redux/billingKickback/billingKickbackEndpoints.d.ts +11 -11
  88. package/dist/redux/billingKickbackResponse/billingKickbackResponseEndpoints.d.ts +10 -10
  89. package/dist/redux/billingKickbackResponseAccessorial/billingKickbackResponseAccessorialEndpoints.d.ts +10 -10
  90. package/dist/redux/billingMessage/billingMessageEndpoints.d.ts +9 -9
  91. package/dist/redux/billingNote/billingNoteEndpoints.d.ts +10 -10
  92. package/dist/redux/cargoConsolidation/cargoConsolidationEndpoints.d.ts +19 -19
  93. package/dist/redux/cargoConsolidationCommodityPiece/cargoConsolidationCommodityPieceEndpoints.d.ts +10 -10
  94. package/dist/redux/carrier/carrierEndpoints.d.ts +24 -24
  95. package/dist/redux/carrier/carrierEndpoints.js +5 -7
  96. package/dist/redux/carrier/carrierEndpoints.js.map +1 -1
  97. package/dist/redux/carrierInsurance/carrierInsuranceEndpoints.d.ts +10 -10
  98. package/dist/redux/carrierName/carrierNameEndpoints.d.ts +44 -0
  99. package/dist/redux/carrierName/carrierNameEndpoints.js +106 -0
  100. package/dist/redux/carrierName/carrierNameEndpoints.js.map +1 -0
  101. package/dist/redux/carrierName/index.d.ts +2 -0
  102. package/dist/redux/carrierName/index.js +3 -0
  103. package/dist/redux/carrierName/index.js.map +1 -0
  104. package/dist/redux/carrierPayContract/carrierPayContractEndpoints.d.ts +11 -11
  105. package/dist/redux/carrierTender/carrierTenderEndpoints.d.ts +14 -37
  106. package/dist/redux/carrierTender/carrierTenderEndpoints.js +9 -77
  107. package/dist/redux/carrierTender/carrierTenderEndpoints.js.map +1 -1
  108. package/dist/redux/carrierTenderAccessorial/carrierTenderAccessorialEndpoints.d.ts +10 -10
  109. package/dist/redux/carrierTenderDeduction/carrierTenderDeductionEndpoints.d.ts +10 -10
  110. package/dist/redux/carrierTenderEdge/carrierTenderEdgeEndpoints.d.ts +9 -9
  111. package/dist/redux/carrierTenderV1/carrierTenderV1Endpoints.d.ts +61 -0
  112. package/dist/redux/carrierTenderV1/carrierTenderV1Endpoints.js +141 -0
  113. package/dist/redux/carrierTenderV1/carrierTenderV1Endpoints.js.map +1 -0
  114. package/dist/redux/carrierTenderV1/index.d.ts +2 -0
  115. package/dist/redux/carrierTenderV1/index.js +3 -0
  116. package/dist/redux/carrierTenderV1/index.js.map +1 -0
  117. package/dist/redux/claim/claimEndpoints.d.ts +16 -16
  118. package/dist/redux/claimStatus/claimStatusEndpoints.d.ts +9 -9
  119. package/dist/redux/commodity/commodityEndpoints.d.ts +10 -10
  120. package/dist/redux/commodityV1/commodityV1Endpoints.d.ts +11 -11
  121. package/dist/redux/companyLocation/companyLocationEndpoints.d.ts +10 -10
  122. package/dist/redux/contact/contactEndpoints.d.ts +10 -10
  123. package/dist/redux/contract/contractEndpoints.d.ts +10 -10
  124. package/dist/redux/contractsRecord/contractsRecordEndpoints.d.ts +12 -12
  125. package/dist/redux/customer/customerEndpoints.d.ts +18 -18
  126. package/dist/redux/customerContract/customerContractEndpoints.d.ts +10 -10
  127. package/dist/redux/customersAccessorial/customersAccessorialEndpoints.d.ts +9 -9
  128. package/dist/redux/deduction/deductionEndpoints.d.ts +9 -9
  129. package/dist/redux/departmentPhone/departmentPhoneEndpoints.d.ts +10 -10
  130. package/dist/redux/dispatch/dispatchEndpoints.d.ts +10 -10
  131. package/dist/redux/driver/driverEndpoints.d.ts +10 -10
  132. package/dist/redux/driverName/driverNameEndpoints.d.ts +9 -9
  133. package/dist/redux/driverV1/driverV1Endpoints.d.ts +9 -9
  134. package/dist/redux/ediAccount/ediAccountEndpoints.d.ts +10 -10
  135. package/dist/redux/ediLoadTender/ediLoadTenderEndpoints.d.ts +10 -10
  136. package/dist/redux/employeeName/employeeNameEndpoints.d.ts +9 -9
  137. package/dist/redux/flag/flagEndpoints.d.ts +9 -9
  138. package/dist/redux/generalLedgerAccount/generalLedgerAccountEndpoints.d.ts +10 -10
  139. package/dist/redux/genericTender/genericTenderEndpoints.d.ts +12 -12
  140. package/dist/redux/holiday/holidayEndpoints.d.ts +10 -10
  141. package/dist/redux/index.d.ts +3 -0
  142. package/dist/redux/index.js +3 -0
  143. package/dist/redux/index.js.map +1 -1
  144. package/dist/redux/invoice/invoiceEndpoints.d.ts +10 -10
  145. package/dist/redux/invoiceAdjustment/invoiceAdjustmentEndpoints.d.ts +10 -10
  146. package/dist/redux/invoiceV1/invoiceV1Endpoints.d.ts +11 -11
  147. package/dist/redux/load/loadEndpoints.d.ts +12 -12
  148. package/dist/redux/loadAdjustment/loadAdjustmentEndpoints.d.ts +10 -10
  149. package/dist/redux/loadAdjustmentV1/loadAdjustmentV1Endpoints.d.ts +10 -10
  150. package/dist/redux/loadTender/loadTenderEndpoints.d.ts +12 -12
  151. package/dist/redux/loadTenderView/loadTenderViewEndpoints.d.ts +10 -10
  152. package/dist/redux/loadV1/loadV1Endpoints.d.ts +59 -59
  153. package/dist/redux/location/locationEndpoints.d.ts +15 -15
  154. package/dist/redux/locationV1/locationV1Endpoints.d.ts +19 -19
  155. package/dist/redux/manualCheckCall/manualCheckCallEndpoints.d.ts +10 -10
  156. package/dist/redux/mapUpdate/mapUpdateEndpoints.d.ts +3 -3
  157. package/dist/redux/nmfcClass/nmfcClassEndpoints.d.ts +9 -9
  158. package/dist/redux/nodeName/nodeNameEndpoints.d.ts +10 -10
  159. package/dist/redux/notification/notificationEndpoints.d.ts +13 -13
  160. package/dist/redux/otrDispatch/otrDispatchEndpoints.d.ts +23 -23
  161. package/dist/redux/person/personEndpoints.d.ts +12 -12
  162. package/dist/redux/personName/personNameEndpoints.d.ts +10 -10
  163. package/dist/redux/position/positionEndpoints.d.ts +10 -10
  164. package/dist/redux/possibleIssueItem/possibleIssueItemEndpoints.d.ts +10 -10
  165. package/dist/redux/quote/quoteAction.d.ts +1 -11
  166. package/dist/redux/quote/quoteAction.js +1 -19
  167. package/dist/redux/quote/quoteAction.js.map +1 -1
  168. package/dist/redux/quote/quoteCustomerPortalEndpoints.d.ts +19 -19
  169. package/dist/redux/quote/quoteCustomerPortalEndpoints.js +1 -1
  170. package/dist/redux/quote/quoteCustomerPortalEndpoints.js.map +1 -1
  171. package/dist/redux/quote/quoteHooks.d.ts +2 -2
  172. package/dist/redux/quote/quoteReducer.d.ts +1 -3
  173. package/dist/redux/quote/quoteReducer.js +4 -14
  174. package/dist/redux/quote/quoteReducer.js.map +1 -1
  175. package/dist/redux/quote/quoteSalesEndpoints.d.ts +18 -18
  176. package/dist/redux/quote/quoteSelectors.d.ts +1 -11
  177. package/dist/redux/quote/quoteSelectors.js +2 -6
  178. package/dist/redux/quote/quoteSelectors.js.map +1 -1
  179. package/dist/redux/quoteAccessorial/quoteAccessorialEndpoints.d.ts +9 -9
  180. package/dist/redux/quoteAccessorialV1/quoteAccessorialV1Endpoints.d.ts +10 -10
  181. package/dist/redux/rateReview/rateReviewEndpoints.d.ts +10 -10
  182. package/dist/redux/rejectionReason/rejectionReasonEndpoints.d.ts +9 -9
  183. package/dist/redux/relayCode/relayCodeEndpoints.d.ts +11 -11
  184. package/dist/redux/shipConDispatch/shipConDispatchEndpoints.d.ts +11 -11
  185. package/dist/redux/shipConETA/shipConETAEndpoints.d.ts +10 -10
  186. package/dist/redux/shipcon/shipconEndpoints.d.ts +11 -11
  187. package/dist/redux/shipconV1/shipconV1Endpoints.d.ts +18 -18
  188. package/dist/redux/tender/tenderEndpoints.d.ts +9 -9
  189. package/dist/redux/trailerAvailability/customerEndpoints.d.ts +4 -4
  190. package/dist/redux/trailerCode/trailerCodeEndpoints.d.ts +9 -9
  191. package/dist/redux/unitV1/unitV1Endpoints.d.ts +9 -9
  192. package/dist/redux/userNoteV1/userNoteV1Endpoints.d.ts +10 -10
  193. package/package.json +1 -1
@@ -1,22 +1,23 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Button, Chip, Table, Typography, LinearProgress, Alert, Link, useColorScheme, Menu, MenuItem, Dropdown, MenuButton, Sheet, useTheme, Box, CircularProgress, Modal, ModalDialog, DialogActions, DialogContent, DialogTitle, Divider, Grid, Tooltip, Accordion, AccordionDetails, AccordionSummary, AccordionGroup, accordionClasses, IconButton, } from "@mui/joy";
2
+ import { Button, Chip, Table, Typography, LinearProgress, Alert, Link, useColorScheme, Menu, MenuItem, Dropdown, MenuButton, Sheet, useTheme, Box, CircularProgress, Modal, ModalDialog, DialogActions, DialogContent, DialogTitle, Divider, Grid, Tooltip, Accordion, AccordionDetails, AccordionSummary, AccordionGroup, accordionClasses, IconButton, FormControl, FormLabel, } from "@mui/joy";
3
3
  import { alpha, styled } from "@mui/system";
4
4
  import { LocalizationProvider, PickersDay, StaticDatePicker, } from "@mui/x-date-pickers";
5
5
  import { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from "react";
6
6
  import salesKitI18n from "../../i18n";
7
7
  import { useTranslation } from "react-i18next";
8
8
  import { useDispatch, useSelector } from "react-redux";
9
- import { restartQuote, setCostBreakdownOpen, setFormOpen, setMarketCostOpen, setQuoteResult, setSelectedDate, setSelectedServiceLevel, } from "../../redux/quote";
10
- import { useLazyGetCostBreakdownQuery, useGetMarketCostQuery, useLazyGetMarketCostQuery, } from "../../redux/quote/quoteCustomerPortalEndpoints";
11
- import { costBreakdownOpenSelector, formOpenSelector, selectedDateSelector, selectedServiceLevelSelector, } from "../../redux/quote/quoteSelectors";
9
+ import { restartQuote, setCostBreakdownOpen, setCargoLiability, setFormOpen, setMarketCostOpen, setQuoteResult, setSelectedDate, setSelectedServiceLevel, } from "../../redux/quote";
10
+ import { useLazyGetCostBreakdownQuery, useGetMarketCostQuery, useLazyGetMarketCostQuery, useCalculateLoadLiabilityCostMutation, } from "../../redux/quote/quoteCustomerPortalEndpoints";
11
+ import { costBreakdownOpenSelector, cargoLiabilitySelector, formOpenSelector, quoteResultSelector, selectedDateSelector, selectedServiceLevelSelector, } from "../../redux/quote/quoteSelectors";
12
12
  import { SALES_QUOTE_EXPIRATION, CUSTOMER_PORTAL_QUOTE_EXPIRATION, LTL_DOC, TL_DOC, serviceLevelColors, serviceLevelIcons, usdFormatter, quoteResultToEmail, } from "./constants";
13
13
  import { DateTime } from "luxon";
14
14
  import { Link as RouterLink } from "react-router-dom";
15
15
  import { useHotkeys } from "react-hotkeys-hook";
16
16
  import { useGetCustomerCreditQuery } from "../../redux";
17
17
  import { nanoid } from "@reduxjs/toolkit";
18
- import { CustomAdapterLuxon } from "@nerdjs/nerd-ui";
18
+ import { CustomAdapterLuxon, NerdCurrencyField } from "@nerdjs/nerd-ui";
19
19
  const DATE_FORMAT = "LLL d";
20
+ const FIXED_CACHE_KEY = "cargoLiability";
20
21
  /**
21
22
  * QuoteResponse. A drawer that displays the quote response
22
23
  *
@@ -198,50 +199,29 @@ function ServiceLevelsDetails({ quoteResponse, }) {
198
199
  const { serviceLevels } = quoteResponse;
199
200
  const dispatch = useDispatch();
200
201
  const { t } = useTranslation("common", { i18n: salesKitI18n });
201
- // const [openEcoCargoLiabilityForm, setOpenEcoCargoLiabilityForm] =
202
- // useState(false);
203
- // const [openPreCargoLiabilityForm, setOpenPreCargoLiabilityForm] =
204
- // useState(false);
205
- // const [openGuaCargoLiabilityForm, setOpenGuaCargoLiabilityForm] =
206
- // useState(false);
202
+ const [openCargoLiabilityForm, setOpenCargoLiabilityForm] = useState({
203
+ open: false,
204
+ initialValue: 0,
205
+ });
207
206
  const { economy, guaranteed, premium } = useMemo(() => {
208
207
  const economy = serviceLevels?.find((s) => s.serviceLevel == "economy");
209
208
  const premium = serviceLevels?.find((s) => s.serviceLevel == "premium");
210
209
  const guaranteed = serviceLevels?.find((s) => s.serviceLevel == "guaranteed");
211
210
  return { economy, premium, guaranteed };
212
211
  }, [serviceLevels]);
213
- // const minEconomyLiabilityCoverage = useMemo(
214
- // () => economy?.liabilityCoverage || 0,
215
- // [economy?.liabilityCoverage]
216
- // );
217
- // const minPremiumLiabilityCoverage = useMemo(
218
- // () => premium?.liabilityCoverage || 0,
219
- // [premium?.liabilityCoverage]
220
- // );
221
- // const minGuaranteedLiabilityCoverage = useMemo(
222
- // () => guaranteed?.liabilityCoverage || 0,
223
- // [guaranteed?.liabilityCoverage]
224
- // );
225
- // const { data: economyCargoLiabilityCost } =
226
- // useCalculateLoadLiabilityCostMutation({ fixedCacheKey: "economy" })[1];
227
- // const { data: premiumCargoLiabilityCost } =
228
- // useCalculateLoadLiabilityCostMutation({ fixedCacheKey: "premium" })[1];
229
- // const { data: guaranteedCargoLiabilityCost } =
230
- // useCalculateLoadLiabilityCostMutation({ fixedCacheKey: "guaranteed" })[1];
231
- // const guaranteedCargoLiability = useSelector(
232
- // guaranteedCargoLiabilitySelector
233
- // );
234
- // const premiumCargoLiability = useSelector(premiumCargoLiabilitySelector);
235
- // const economyCargoLiability = useSelector(economyCargoLiabilitySelector);
236
- // useEffect(() => {
237
- // dispatch(setGuaranteedCargoLiability(minGuaranteedLiabilityCoverage));
238
- // dispatch(setPremiumCargoLiability(minPremiumLiabilityCoverage));
239
- // dispatch(setEconomyCargoLiability(minEconomyLiabilityCoverage));
240
- // }, [
241
- // minEconomyLiabilityCoverage,
242
- // minPremiumLiabilityCoverage,
243
- // minGuaranteedLiabilityCoverage,
244
- // ]);
212
+ const minEconomyLiabilityCoverage = useMemo(() => economy?.liabilityCoverage || 0, [economy?.liabilityCoverage]);
213
+ const minPremiumLiabilityCoverage = useMemo(() => premium?.liabilityCoverage || 0, [premium?.liabilityCoverage]);
214
+ const minGuaranteedLiabilityCoverage = useMemo(() => guaranteed?.liabilityCoverage || 0, [guaranteed?.liabilityCoverage]);
215
+ const { data: cargoLiabilityCost, reset } = useCalculateLoadLiabilityCostMutation({
216
+ fixedCacheKey: FIXED_CACHE_KEY,
217
+ })[1];
218
+ const cargoLiability = useSelector(cargoLiabilitySelector);
219
+ useEffect(() => {
220
+ return () => {
221
+ dispatch(setCargoLiability(0));
222
+ reset();
223
+ };
224
+ }, []);
245
225
  return (_jsx(Sheet, { sx: {
246
226
  borderRadius: "sm",
247
227
  boxShadow: "md",
@@ -275,7 +255,57 @@ function ServiceLevelsDetails({ quoteResponse, }) {
275
255
  }, children: t("global.Same Day Pickup") }), guaranteed && (_jsxs("td", { children: [_jsx(Typography, { children: "99.9%" }), _jsx(LinearProgress, { value: 99.9, determinate: true, thickness: 5 })] })), premium && (_jsxs("td", { children: [_jsx(Typography, { children: "85%" }), _jsx(LinearProgress, { value: 85, determinate: true, thickness: 5 })] })), economy && (_jsxs("td", { children: [_jsx(Typography, { children: "50%" }), _jsx(LinearProgress, { value: 50, determinate: true, thickness: 5 })] }))] }), _jsxs("tr", { children: [_jsx("th", { children: _jsx("i", { className: "fa-solid fa-truck-front" }) }), _jsx("th", { style: {
276
256
  whiteSpace: "normal",
277
257
  wordBreak: "break-word",
278
- }, children: t("global.Driver / Equipment Allocation") }), guaranteed && (_jsxs("td", { children: [_jsx(Typography, { children: "99.9%" }), _jsx(LinearProgress, { value: 99.9, determinate: true, thickness: 5 })] })), premium && (_jsxs("td", { children: [_jsx(Typography, { children: "85%" }), _jsx(LinearProgress, { value: 85, determinate: true, thickness: 5 })] })), economy && (_jsxs("td", { children: [_jsx(Typography, { children: "50%" }), _jsx(LinearProgress, { value: 50, determinate: true, thickness: 5 })] }))] }), _jsxs("tr", { children: [_jsx("th", {}), _jsx("th", { style: {
258
+ }, children: t("global.Driver / Equipment Allocation") }), guaranteed && (_jsxs("td", { children: [_jsx(Typography, { children: "99.9%" }), _jsx(LinearProgress, { value: 99.9, determinate: true, thickness: 5 })] })), premium && (_jsxs("td", { children: [_jsx(Typography, { children: "85%" }), _jsx(LinearProgress, { value: 85, determinate: true, thickness: 5 })] })), economy && (_jsxs("td", { children: [_jsx(Typography, { children: "50%" }), _jsx(LinearProgress, { value: 50, determinate: true, thickness: 5 })] }))] }), !quoteResponse.loadId && quoteResponse.type == "LTL" ? (_jsxs(_Fragment, { children: [_jsxs("tr", { children: [_jsx("th", {}), _jsxs("th", { style: {
259
+ whiteSpace: "normal",
260
+ wordBreak: "break-word",
261
+ }, children: ["Cargo Liability", _jsx(Button, { sx: {
262
+ mt: 0.5,
263
+ }, size: "sm", variant: "soft", onClick: () => setOpenCargoLiabilityForm({
264
+ open: true,
265
+ initialValue: minEconomyLiabilityCoverage,
266
+ }), startDecorator: _jsx("i", { className: "fa-solid fa-plus" }), children: "Add More" })] }), guaranteed && (_jsx("td", { children: _jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: 0.5, children: [_jsx(Chip, { color: cargoLiability > minGuaranteedLiabilityCoverage
267
+ ? "neutral"
268
+ : "primary", startDecorator: cargoLiability >
269
+ minGuaranteedLiabilityCoverage ? null : (_jsx("i", { className: "fa-solid fa-circle-check" })), sx: {
270
+ textDecoration: cargoLiability > minGuaranteedLiabilityCoverage
271
+ ? "line-through"
272
+ : undefined,
273
+ }, size: cargoLiability > minGuaranteedLiabilityCoverage
274
+ ? "sm"
275
+ : "md", children: usdFormatter.format(minGuaranteedLiabilityCoverage) }), cargoLiability > minGuaranteedLiabilityCoverage ? (_jsx(Chip, { color: "primary", startDecorator: _jsx("i", { className: "fa-solid fa-circle-check" }), children: usdFormatter.format(cargoLiability) })) : null] }) })), premium && (_jsx("td", { children: _jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: 0.5, children: [_jsx(Chip, { color: cargoLiability > minPremiumLiabilityCoverage
276
+ ? "neutral"
277
+ : "primary", startDecorator: cargoLiability >
278
+ minPremiumLiabilityCoverage ? null : (_jsx("i", { className: "fa-solid fa-circle-check" })), sx: {
279
+ textDecoration: cargoLiability > minPremiumLiabilityCoverage
280
+ ? "line-through"
281
+ : undefined,
282
+ }, size: cargoLiability > minPremiumLiabilityCoverage
283
+ ? "sm"
284
+ : "md", children: usdFormatter.format(minPremiumLiabilityCoverage) }), cargoLiability > minPremiumLiabilityCoverage ? (_jsx(Chip, { color: "primary", startDecorator: _jsx("i", { className: "fa-solid fa-circle-check" }), children: usdFormatter.format(cargoLiability) })) : null] }) })), economy && (_jsx("td", { children: _jsxs(Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: 0.5, children: [_jsx(Chip, { color: cargoLiability > minEconomyLiabilityCoverage
285
+ ? "neutral"
286
+ : "primary", startDecorator: cargoLiability >
287
+ minEconomyLiabilityCoverage ? null : (_jsx("i", { className: "fa-solid fa-circle-check" })), sx: {
288
+ textDecoration: cargoLiability > minEconomyLiabilityCoverage
289
+ ? "line-through"
290
+ : undefined,
291
+ }, size: cargoLiability > minEconomyLiabilityCoverage
292
+ ? "sm"
293
+ : "md", children: usdFormatter.format(minEconomyLiabilityCoverage) }), cargoLiability > minEconomyLiabilityCoverage ? (_jsx(Chip, { color: "primary", startDecorator: _jsx("i", { className: "fa-solid fa-circle-check" }), children: usdFormatter.format(cargoLiability) })) : null] }) })), _jsx(EditCargoLiabilityModal, { onClose: () => setOpenCargoLiabilityForm({ open: false, initialValue: 0 }), initialValue: openCargoLiabilityForm.initialValue, open: openCargoLiabilityForm.open, value: cargoLiability, setValue: (v) => dispatch(setCargoLiability(v)) })] }), _jsxs("tr", { children: [_jsx("th", {}), _jsx("th", { style: {
294
+ whiteSpace: "normal",
295
+ wordBreak: "break-word",
296
+ }, children: "Cargo Liability Cost" }), guaranteed && (_jsx("td", { children: _jsxs(Box, { display: "flex", alignItems: "center", flexDirection: "column", gap: 0.5, children: [_jsx(Chip, { sx: {
297
+ textDecoration: cargoLiabilityCost?.guaranteed
298
+ ? "line-through"
299
+ : undefined,
300
+ }, color: cargoLiabilityCost?.guaranteed ? "neutral" : "primary", size: "sm", startDecorator: cargoLiabilityCost?.guaranteed ? undefined : (_jsx("i", { className: "fa-solid fa-circle-check" })), children: "Included" }), cargoLiabilityCost?.guaranteed ? (_jsx(Chip, { color: "primary", size: "sm", startDecorator: _jsx("i", { className: "fa-solid fa-circle-check" }), children: usdFormatter.format(cargoLiabilityCost.guaranteed || 0) })) : null] }) })), premium && (_jsx("td", { children: _jsxs(Box, { display: "flex", alignItems: "center", flexDirection: "column", gap: 0.5, children: [_jsx(Chip, { sx: {
301
+ textDecoration: cargoLiabilityCost?.premium
302
+ ? "line-through"
303
+ : undefined,
304
+ }, color: cargoLiabilityCost?.premium ? "neutral" : "primary", size: "sm", startDecorator: cargoLiabilityCost?.premium ? undefined : (_jsx("i", { className: "fa-solid fa-circle-check" })), children: "Included" }), cargoLiabilityCost?.premium ? (_jsx(Chip, { color: "primary", size: "sm", startDecorator: _jsx("i", { className: "fa-solid fa-circle-check" }), children: usdFormatter.format(cargoLiabilityCost.premium || 0) })) : null] }) })), economy && (_jsx("td", { children: _jsxs(Box, { display: "flex", alignItems: "center", flexDirection: "column", gap: 0.5, children: [_jsx(Chip, { sx: {
305
+ textDecoration: cargoLiabilityCost?.economy
306
+ ? "line-through"
307
+ : undefined,
308
+ }, color: cargoLiabilityCost?.economy ? "neutral" : "primary", size: "sm", startDecorator: cargoLiabilityCost?.economy ? undefined : (_jsx("i", { className: "fa-solid fa-circle-check" })), children: "Included" }), cargoLiabilityCost?.economy ? (_jsx(Chip, { color: "primary", size: "sm", startDecorator: _jsx("i", { className: "fa-solid fa-circle-check" }), children: usdFormatter.format(cargoLiabilityCost.economy || 0) })) : null] }) }))] })] })) : null, _jsxs("tr", { children: [_jsx("th", {}), _jsx("th", { style: {
279
309
  whiteSpace: "normal",
280
310
  wordBreak: "break-word",
281
311
  }, children: t("global.Base") }), guaranteed && _jsx("td", { children: usdFormatter.format(guaranteed.baseRate) }), premium && _jsx("td", { children: usdFormatter.format(premium.baseRate) }), economy && _jsx("td", { children: usdFormatter.format(economy.baseRate) })] }), _jsxs("tr", { children: [_jsx("th", {}), _jsx("th", { style: {
@@ -287,7 +317,19 @@ function ServiceLevelsDetails({ quoteResponse, }) {
287
317
  }, children: t("global.Extra") }), guaranteed && _jsx("td", { children: usdFormatter.format(guaranteed.extra) }), premium && _jsx("td", { children: usdFormatter.format(premium.extra) }), economy && _jsx("td", { children: usdFormatter.format(economy.extra) })] }), _jsxs("tr", { children: [_jsx("th", {}), _jsx("th", { style: {
288
318
  whiteSpace: "normal",
289
319
  wordBreak: "break-word",
290
- }, children: t("global.Total") }), guaranteed && (_jsx("td", { children: usdFormatter.format(guaranteed.totalRate) })), premium && (_jsx("td", { children: usdFormatter.format(premium.totalRate) })), economy && (_jsx("td", { children: usdFormatter.format(economy.totalRate) }))] })] }), _jsx("tfoot", { style: {
320
+ }, children: t("global.Total") }), guaranteed && (_jsx("td", { children: _jsxs(Box, { display: "flex", alignItems: "center", flexDirection: "column", gap: 0.5, children: [_jsx(Chip, { size: "sm", sx: {
321
+ textDecoration: cargoLiabilityCost?.guaranteed
322
+ ? "line-through"
323
+ : undefined,
324
+ }, color: !cargoLiabilityCost?.guaranteed ? "primary" : "neutral", startDecorator: !cargoLiabilityCost?.guaranteed ? (_jsx("i", { className: "fa-solid fa-circle-check" })) : null, children: usdFormatter.format(guaranteed.totalRate) }), cargoLiabilityCost?.guaranteed ? (_jsx(Chip, { size: "sm", color: "primary", startDecorator: _jsx("i", { className: "fa-solid fa-circle-check" }), children: usdFormatter.format(guaranteed.totalRate + cargoLiabilityCost.guaranteed) })) : null] }) })), premium && (_jsx("td", { children: _jsxs(Box, { display: "flex", alignItems: "center", flexDirection: "column", gap: 0.5, children: [_jsx(Chip, { size: "sm", sx: {
325
+ textDecoration: cargoLiabilityCost?.premium
326
+ ? "line-through"
327
+ : undefined,
328
+ }, color: !cargoLiabilityCost?.premium ? "primary" : "neutral", startDecorator: !cargoLiabilityCost?.premium ? (_jsx("i", { className: "fa-solid fa-circle-check" })) : null, children: usdFormatter.format(premium.totalRate) }), cargoLiabilityCost?.premium ? (_jsx(Chip, { size: "sm", color: "primary", startDecorator: _jsx("i", { className: "fa-solid fa-circle-check" }), children: usdFormatter.format(premium.totalRate + cargoLiabilityCost.premium) })) : null] }) })), economy && (_jsx("td", { children: _jsxs(Box, { display: "flex", alignItems: "center", flexDirection: "column", gap: 0.5, children: [_jsx(Chip, { size: "sm", sx: {
329
+ textDecoration: cargoLiabilityCost?.economy
330
+ ? "line-through"
331
+ : undefined,
332
+ }, color: !cargoLiabilityCost?.economy ? "primary" : "neutral", startDecorator: !cargoLiabilityCost?.economy ? (_jsx("i", { className: "fa-solid fa-circle-check" })) : null, children: usdFormatter.format(economy.totalRate) }), cargoLiabilityCost?.economy ? (_jsx(Chip, { size: "sm", color: "primary", startDecorator: _jsx("i", { className: "fa-solid fa-circle-check" }), children: usdFormatter.format(economy.totalRate + cargoLiabilityCost.economy) })) : null] }) }))] })] }), _jsx("tfoot", { style: {
291
333
  height: 70,
292
334
  }, children: _jsxs("tr", { children: [_jsx("th", {}), _jsx("th", { style: {
293
335
  borderBottomRightRadius: 0,
@@ -314,133 +356,84 @@ function ServiceLevelsDetails({ quoteResponse, }) {
314
356
  ? ` - ${DateTime.fromFormat(economy.to, "yyyy-L-d").toFormat(DATE_FORMAT)}`
315
357
  : []] })] }) }) }))] }) })] }) }));
316
358
  }
317
- // const EditCargoLiabilityModal = ({
318
- // value,
319
- // setValue,
320
- // open,
321
- // onClose,
322
- // minValue,
323
- // serviceLevel,
324
- // }: {
325
- // value: number;
326
- // setValue: (value: number) => void;
327
- // open: boolean;
328
- // onClose: () => void;
329
- // minValue: number;
330
- // serviceLevel: "economy" | "premium" | "guaranteed";
331
- // }) => {
332
- // const { t } = useTranslation("common", { i18n: salesKitI18n });
333
- // const [_value, _setValue] = useState<number | undefined>(value);
334
- // const [error, setError] = useState(false);
335
- // const [calculateCost, { isLoading }] = useCalculateLoadLiabilityCostMutation({
336
- // fixedCacheKey: serviceLevel,
337
- // });
338
- // const result = useSelector(quoteResultSelector);
339
- // const handleSave = () => {
340
- // if (result && _value !== undefined) {
341
- // calculateCost({
342
- // amount: _value,
343
- // weight: result?.weight,
344
- // })
345
- // .unwrap()
346
- // .then(() => {
347
- // setValue(_value);
348
- // handleClose();
349
- // })
350
- // .catch(() => {
351
- // return;
352
- // });
353
- // }
354
- // };
355
- // const handleClose = () => {
356
- // onClose();
357
- // _setValue(undefined);
358
- // };
359
- // useEffect(() => {
360
- // _setValue(value);
361
- // }, [open]);
362
- // return (
363
- // <Modal open={open} onClose={handleClose}>
364
- // <ModalDialog
365
- // layout="center"
366
- // sx={(theme) => ({
367
- // width: 450,
368
- // [theme.breakpoints.only("xs")]: {
369
- // top: 0,
370
- // left: 0,
371
- // right: 0,
372
- // bottom: 0,
373
- // border: 0,
374
- // borderRadius: 0,
375
- // transform: "initial",
376
- // maxWidth: "initial",
377
- // maxHeight: "initial",
378
- // width: "initial",
379
- // },
380
- // })}
381
- // >
382
- // <DialogTitle>Cargo Liability</DialogTitle>
383
- // <DialogContent>
384
- // <Typography level="body-sm">
385
- // The minimum and included cargo liability amount for the selected
386
- // service level is{" "}
387
- // <Typography level="body-sm" color="primary" fontWeight={"md"}>
388
- // {usdFormatter.format(minValue)}
389
- // </Typography>
390
- // . Feel free to increase it; the cost will be calculated
391
- // automatically.
392
- // </Typography>
393
- // <Box mt={1}>
394
- // <FormControl>
395
- // <FormLabel>Cargo Liability</FormLabel>
396
- // <NerdCurrencyField
397
- // value={_value}
398
- // inputProps={{
399
- // fullWidth: true,
400
- // error,
401
- // endDecorator:
402
- // _value !== minValue ? (
403
- // <Tooltip title="Reset" size="sm">
404
- // <IconButton
405
- // size="sm"
406
- // onClick={() => _setValue(minValue)}
407
- // >
408
- // <i className="fa-solid fa-xmark" />
409
- // </IconButton>
410
- // </Tooltip>
411
- // ) : null,
412
- // }}
413
- // onChange={(v) => {
414
- // _setValue(v);
415
- // if (!v || v < minValue) setError(true);
416
- // else setError(false);
417
- // }}
418
- // />
419
- // <FormHelperText>
420
- // {error
421
- // ? `The minimum amount is ${usdFormatter.format(minValue)}`
422
- // : ""}
423
- // </FormHelperText>
424
- // </FormControl>
425
- // </Box>
426
- // </DialogContent>
427
- // <DialogActions>
428
- // <Button
429
- // loading={isLoading}
430
- // color="primary"
431
- // onClick={handleSave}
432
- // disabled={error}
433
- // >
434
- // {t("global.Confirm")}
435
- // </Button>
436
- // <Button color="neutral" variant="soft" onClick={handleClose}>
437
- // {t("global.Cancel")}
438
- // </Button>
439
- // </DialogActions>
440
- // </ModalDialog>
441
- // </Modal>
442
- // );
443
- // };
359
+ const EditCargoLiabilityModal = ({ value, setValue, open, onClose, initialValue, }) => {
360
+ const { t } = useTranslation("common", { i18n: salesKitI18n });
361
+ const [_value, _setValue] = useState(value ? value : undefined);
362
+ const [calculateCost] = useCalculateLoadLiabilityCostMutation({
363
+ fixedCacheKey: FIXED_CACHE_KEY,
364
+ });
365
+ const result = useSelector(quoteResultSelector);
366
+ //Cannot use the isLoading attribute from the useCalculateLoadLiabilityCostMutation hook
367
+ const [isLoading, setIsLoading] = useState(false);
368
+ const [isLoading2, setIsLoading2] = useState(false);
369
+ const handleSave = () => {
370
+ if (result && _value !== undefined) {
371
+ setIsLoading(true);
372
+ calculateCost({
373
+ statedValue: _value,
374
+ quoteID: result.id,
375
+ })
376
+ .unwrap()
377
+ .then(() => {
378
+ setValue(_value);
379
+ handleClose();
380
+ })
381
+ .catch(() => {
382
+ return;
383
+ })
384
+ .finally(() => setIsLoading(false));
385
+ }
386
+ };
387
+ const handleReset = () => {
388
+ if (result) {
389
+ setIsLoading2(true);
390
+ calculateCost({
391
+ statedValue: 0,
392
+ quoteID: result.id,
393
+ })
394
+ .unwrap()
395
+ .then(() => {
396
+ setValue(0);
397
+ handleClose();
398
+ })
399
+ .catch(() => {
400
+ return;
401
+ })
402
+ .finally(() => setIsLoading2(false));
403
+ }
404
+ };
405
+ const handleClose = () => {
406
+ onClose();
407
+ _setValue(value ? value : undefined);
408
+ };
409
+ useEffect(() => {
410
+ _setValue(value ? value : undefined);
411
+ }, [open]);
412
+ return (_jsx(Modal, { open: open, onClose: handleClose, children: _jsxs(ModalDialog, { layout: "center", sx: (theme) => ({
413
+ width: 450,
414
+ [theme.breakpoints.only("xs")]: {
415
+ top: 0,
416
+ left: 0,
417
+ right: 0,
418
+ bottom: 0,
419
+ border: 0,
420
+ borderRadius: 0,
421
+ transform: "initial",
422
+ maxWidth: "initial",
423
+ maxHeight: "initial",
424
+ width: "initial",
425
+ },
426
+ }), children: [_jsx(DialogTitle, { children: "Cargo Liability" }), _jsx(DialogContent, { children: _jsxs("form", { onSubmit: (event) => {
427
+ event.preventDefault();
428
+ if (_value)
429
+ handleSave();
430
+ }, children: [_jsx(Typography, { level: "body-sm", children: "Feel free to increase the Cargo Liability; the cost will be calculated automatically." }), _jsx(Box, { mt: 1, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Cargo Liability" }), _jsx(NerdCurrencyField, { value: _value, inputProps: {
431
+ fullWidth: true,
432
+ placeholder: usdFormatter.format(initialValue).substring(1),
433
+ }, onChange: (v) => {
434
+ _setValue(v);
435
+ } })] }) })] }) }), _jsxs(DialogActions, { children: [_jsx(Button, { loading: isLoading, color: "primary", onClick: handleSave, disabled: !_value, children: t("global.Confirm") }), _jsx(Button, { color: "neutral", variant: "soft", onClick: handleClose, children: t("global.Cancel") }), _jsx(Button, { loading: isLoading2, color: "neutral", variant: "soft", onClick: handleReset, children: t("global.Reset") })] })] }) }));
436
+ };
444
437
  /**
445
438
  * Quote toolbar. Contains actions like restart, run quote or find a quote.
446
439
  *
@@ -741,26 +734,22 @@ export const Summary = ({ handleOnTenderLoadClick, customerPortal, response, bod
741
734
  })
742
735
  : false;
743
736
  const { data: customerCredit } = useGetCustomerCreditQuery(response?.customerId || 0, { skip: !response?.customerId || customerPortal });
744
- // const { data: _cargoLiabilityCost } = useCalculateLoadLiabilityCostMutation({
745
- // fixedCacheKey: selectedServiceLevel?.serviceLevel,
746
- // })[1];
747
- // const cargoLiabilityCost = useMemo(() => {
748
- // switch (selectedServiceLevel?.serviceLevel) {
749
- // case "economy":
750
- // return _cargoLiabilityCost?.economy || 0;
751
- // case "premium":
752
- // return _cargoLiabilityCost?.premium || 0;
753
- // case "guaranteed":
754
- // return _cargoLiabilityCost?.guaranteed || 0;
755
- // default:
756
- // return 0;
757
- // }
758
- // }, [_cargoLiabilityCost]);
759
- // const guaranteedCargoLiability = useSelector(
760
- // guaranteedCargoLiabilitySelector
761
- // );
762
- // const premiumCargoLiability = useSelector(premiumCargoLiabilitySelector);
763
- // const economyCargoLiability = useSelector(economyCargoLiabilitySelector);
737
+ const { data: _cargoLiabilityCost } = useCalculateLoadLiabilityCostMutation({
738
+ fixedCacheKey: FIXED_CACHE_KEY,
739
+ })[1];
740
+ const cargoLiabilityCost = useMemo(() => {
741
+ switch (selectedServiceLevel?.serviceLevel) {
742
+ case "economy":
743
+ return _cargoLiabilityCost?.economy || 0;
744
+ case "premium":
745
+ return _cargoLiabilityCost?.premium || 0;
746
+ case "guaranteed":
747
+ return _cargoLiabilityCost?.guaranteed || 0;
748
+ default:
749
+ return 0;
750
+ }
751
+ }, [_cargoLiabilityCost, selectedServiceLevel?.serviceLevel]);
752
+ const cargoLiability = useSelector(cargoLiabilitySelector);
764
753
  if (!selectedDate || !selectedServiceLevel)
765
754
  return null;
766
755
  return (_jsxs(Sheet, { sx: { p: 2, borderRadius: "sm", boxShadow: "md" }, children: [_jsxs(Typography, { level: "title-lg", children: [_jsx("i", { className: "fa-duotone fa-truck pright" }), " ", t("global.Summary")] }), _jsxs(Grid, { container: true, spacing: 1, rowGap: 1.5, sx: {
@@ -771,11 +760,19 @@ export const Summary = ({ handleOnTenderLoadClick, customerPortal, response, bod
771
760
  ? DateTime.fromFormat(from.date, "yyyy-L-d").toFormat(DATE_FORMAT)
772
761
  : "" }) })] }), _jsxs(Grid, { xs: 4, container: true, children: [_jsxs(Grid, { xs: 12, children: [_jsx("i", { className: "fa-regular fa-arrow-down" }), _jsx(Typography, { ml: 1, display: "inline", level: "body-sm", children: t("global.To") })] }), _jsx(Grid, { xs: 12, children: _jsx(Typography, { children: to?.address.line1 || t("global.Unknown Location") }) }), _jsx(Grid, { xs: 12, children: _jsxs(Typography, { children: [to?.city, ", ", to?.state] }) }), _jsx(Grid, { xs: 12, children: _jsx(Typography, { children: to?.zip }) }), _jsx(Grid, { xs: 12, children: _jsx(Chip, { startDecorator: _jsx("i", { className: "fa-solid fa-calendar-days" }), variant: "soft", children: selectedServiceLevel.serviceLevel == "guaranteed"
773
762
  ? selectedDate?.toFormat(DATE_FORMAT)
774
- : `${DateTime.fromFormat(selectedServiceLevel.from, "yyyy-L-d").toFormat(DATE_FORMAT)} - ${DateTime.fromFormat(selectedServiceLevel.to, "yyyy-L-d").toFormat(DATE_FORMAT)}` }) })] })] }), _jsxs(Grid, { xs: 12, children: [_jsx(Typography, { level: "title-lg", children: t("global.Costs") }), _jsxs(Table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: t("global.Service Level") }), _jsx("th", { children: t("global.Description") }), _jsx("th", { children: t("global.Base Rate") }), _jsx("th", { children: t("global.Fuel Rate") }), _jsx("th", { children: t("global.Extra") })] }) }), _jsx("tbody", { children: _jsxs("tr", { children: [_jsx("td", { children: _jsx("img", { src: selectedServiceLevel.serviceLevel === "guaranteed"
763
+ : `${DateTime.fromFormat(selectedServiceLevel.from, "yyyy-L-d").toFormat(DATE_FORMAT)} - ${DateTime.fromFormat(selectedServiceLevel.to, "yyyy-L-d").toFormat(DATE_FORMAT)}` }) })] })] }), _jsxs(Grid, { xs: 12, children: [_jsx(Typography, { level: "title-lg", children: t("global.Costs") }), _jsxs(Table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: t("global.Service Level") }), _jsx("th", { children: t("global.Description") }), !response?.loadId && response?.type == "LTL" ? (_jsx("th", { style: {
764
+ width: 150,
765
+ }, children: "Cargo Liability Cost" })) : null, _jsx("th", { children: t("global.Base Rate") }), _jsx("th", { children: t("global.Fuel Rate") }), _jsx("th", { children: t("global.Extra") })] }) }), _jsx("tbody", { children: _jsxs("tr", { children: [_jsx("td", { children: _jsx("img", { src: selectedServiceLevel.serviceLevel === "guaranteed"
775
766
  ? response?.getGuaranteedIcon()
776
767
  : selectedServiceLevel.serviceLevel === "premium"
777
768
  ? response?.getPremiumIcon()
778
- : response?.getEconomyIcon(), style: { height: 20 } }) }), _jsx("td", { children: selectedServiceLevel?.description }), _jsx("td", { children: usdFormatter.format(selectedServiceLevel.baseRate) }), _jsx("td", { children: usdFormatter.format(selectedServiceLevel.fuelRate) }), _jsx("td", { children: usdFormatter.format(selectedServiceLevel.extra) })] }) })] })] }), _jsxs(Grid, { xs: 12, textAlign: "right", justifyContent: "end", container: true, children: [_jsxs(Grid, { children: [_jsx(Typography
769
+ : response?.getEconomyIcon(), style: { height: 20 } }) }), _jsx("td", { children: selectedServiceLevel?.description }), !response?.loadId && response?.type == "LTL" ? (_jsx("td", { children: _jsx(Chip, { size: "sm", color: cargoLiabilityCost ? "primary" : "neutral", sx: {
770
+ backgroundColor: cargoLiabilityCost
771
+ ? undefined
772
+ : "inherit",
773
+ }, children: cargoLiabilityCost === 0
774
+ ? "Included"
775
+ : usdFormatter.format(cargoLiabilityCost) }) })) : null, _jsx("td", { children: usdFormatter.format(selectedServiceLevel.baseRate) }), _jsx("td", { children: usdFormatter.format(selectedServiceLevel.fuelRate) }), _jsx("td", { children: usdFormatter.format(selectedServiceLevel.extra) })] }) })] })] }), _jsxs(Grid, { xs: 12, textAlign: "right", justifyContent: "end", container: true, children: [_jsxs(Grid, { children: [_jsx(Typography
779
776
  // sx={{
780
777
  // pr: 1,
781
778
  // }}
@@ -802,15 +799,7 @@ export const Summary = ({ handleOnTenderLoadClick, customerPortal, response, bod
802
799
  selectedServiceLevel.totalRate
803
800
  ? customerCredit.availableCredit -
804
801
  selectedServiceLevel.totalRate
805
- : undefined
806
- // cargoLiabilityCost !== 0
807
- // ? selectedServiceLevel.serviceLevel === "economy"
808
- // ? economyCargoLiability
809
- // : selectedServiceLevel.serviceLevel === "guaranteed"
810
- // ? guaranteedCargoLiability
811
- // : premiumCargoLiability
812
- // : undefined
813
- );
802
+ : undefined, cargoLiabilityCost !== 0 ? cargoLiability : undefined);
814
803
  dispatch(restartQuote());
815
804
  dispatch(setQuoteResult(undefined));
816
805
  }