@nerdjs/sales-kit 2.2.11 → 2.3.0

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 (147) hide show
  1. package/dist/entities/cargoConsolidation/cargoConsolidation.d.ts +1 -0
  2. package/dist/entities/cargoConsolidation/cargoConsolidation.js +2 -0
  3. package/dist/entities/cargoConsolidation/cargoConsolidation.js.map +1 -1
  4. package/dist/hooks/lep/checkList.js +14 -8
  5. package/dist/hooks/lep/checkList.js.map +1 -1
  6. package/dist/hooks/lep/helpers.js +2 -0
  7. package/dist/hooks/lep/helpers.js.map +1 -1
  8. package/dist/hooks/lep/index.d.ts +1 -0
  9. package/dist/hooks/lep/index.js +1 -0
  10. package/dist/hooks/lep/index.js.map +1 -1
  11. package/dist/hooks/lep/lepAccessorials.js +85 -63
  12. package/dist/hooks/lep/lepAccessorials.js.map +1 -1
  13. package/dist/hooks/lep/lepActionBar.js +602 -73
  14. package/dist/hooks/lep/lepActionBar.js.map +1 -1
  15. package/dist/hooks/lep/lepAdjustments.js +16 -23
  16. package/dist/hooks/lep/lepAdjustments.js.map +1 -1
  17. package/dist/hooks/lep/lepAppointmentArrivals.js +5 -5
  18. package/dist/hooks/lep/lepAppointmentArrivals.js.map +1 -1
  19. package/dist/hooks/lep/lepClaims.js +10 -10
  20. package/dist/hooks/lep/lepClaims.js.map +1 -1
  21. package/dist/hooks/lep/lepCommodities.js +65 -64
  22. package/dist/hooks/lep/lepCommodities.js.map +1 -1
  23. package/dist/hooks/lep/lepConsolidations.js +5 -5
  24. package/dist/hooks/lep/lepConsolidations.js.map +1 -1
  25. package/dist/hooks/lep/lepCustomerContacts.js +11 -13
  26. package/dist/hooks/lep/lepCustomerContacts.js.map +1 -1
  27. package/dist/hooks/lep/lepCustomerInfo.js +15 -12
  28. package/dist/hooks/lep/lepCustomerInfo.js.map +1 -1
  29. package/dist/hooks/lep/lepCustomerPeople.js +15 -20
  30. package/dist/hooks/lep/lepCustomerPeople.js.map +1 -1
  31. package/dist/hooks/lep/lepCustomerSalesNotes.js +7 -5
  32. package/dist/hooks/lep/lepCustomerSalesNotes.js.map +1 -1
  33. package/dist/hooks/lep/lepCustomersAccessorials.js +12 -5
  34. package/dist/hooks/lep/lepCustomersAccessorials.js.map +1 -1
  35. package/dist/hooks/lep/lepDateInputCell.js +11 -1
  36. package/dist/hooks/lep/lepDateInputCell.js.map +1 -1
  37. package/dist/hooks/lep/lepDispatches.js +6 -6
  38. package/dist/hooks/lep/lepDispatches.js.map +1 -1
  39. package/dist/hooks/lep/lepDocuments.js +41 -42
  40. package/dist/hooks/lep/lepDocuments.js.map +1 -1
  41. package/dist/hooks/lep/lepEDI.js +8 -8
  42. package/dist/hooks/lep/lepEDI.js.map +1 -1
  43. package/dist/hooks/lep/lepHosLogs.js +9 -9
  44. package/dist/hooks/lep/lepHosLogs.js.map +1 -1
  45. package/dist/hooks/lep/lepInvoiceAdjustment.d.ts +3 -0
  46. package/dist/hooks/lep/lepInvoiceAdjustment.js +9 -6
  47. package/dist/hooks/lep/lepInvoiceAdjustment.js.map +1 -1
  48. package/dist/hooks/lep/lepInvoiceDetails.d.ts +3 -0
  49. package/dist/hooks/lep/lepInvoiceDetails.js +37 -26
  50. package/dist/hooks/lep/lepInvoiceDetails.js.map +1 -1
  51. package/dist/hooks/lep/lepInvoiceLineItems.js +15 -22
  52. package/dist/hooks/lep/lepInvoiceLineItems.js.map +1 -1
  53. package/dist/hooks/lep/lepKickbacks.js +13 -13
  54. package/dist/hooks/lep/lepKickbacks.js.map +1 -1
  55. package/dist/hooks/lep/lepLoadChanges.js +10 -10
  56. package/dist/hooks/lep/lepLoadChanges.js.map +1 -1
  57. package/dist/hooks/lep/lepLoadInfo.js +213 -172
  58. package/dist/hooks/lep/lepLoadInfo.js.map +1 -1
  59. package/dist/hooks/lep/lepLoadLocation.d.ts +5 -0
  60. package/dist/hooks/lep/lepLoadLocation.js +13 -8
  61. package/dist/hooks/lep/lepLoadLocation.js.map +1 -1
  62. package/dist/hooks/lep/lepLoadNotes.js +14 -10
  63. package/dist/hooks/lep/lepLoadNotes.js.map +1 -1
  64. package/dist/hooks/lep/lepLoadSummary.d.ts +5 -0
  65. package/dist/hooks/lep/lepLoadSummary.js +37 -0
  66. package/dist/hooks/lep/lepLoadSummary.js.map +1 -0
  67. package/dist/hooks/lep/lepNotifications.js +5 -5
  68. package/dist/hooks/lep/lepNotifications.js.map +1 -1
  69. package/dist/hooks/lep/lepPossibleIssues.js +8 -6
  70. package/dist/hooks/lep/lepPossibleIssues.js.map +1 -1
  71. package/dist/hooks/lep/lepQuoteResult.d.ts +3 -0
  72. package/dist/hooks/lep/lepQuoteResult.js +20 -9
  73. package/dist/hooks/lep/lepQuoteResult.js.map +1 -1
  74. package/dist/hooks/lep/lepRateLogs.js +5 -5
  75. package/dist/hooks/lep/lepRateLogs.js.map +1 -1
  76. package/dist/hooks/lep/lepRateReviews.js +15 -23
  77. package/dist/hooks/lep/lepRateReviews.js.map +1 -1
  78. package/dist/hooks/lep/lepShipcons.d.ts +2 -0
  79. package/dist/hooks/lep/lepShipcons.js +215 -166
  80. package/dist/hooks/lep/lepShipcons.js.map +1 -1
  81. package/dist/hooks/lep/lepTendersWidget.js +7 -7
  82. package/dist/hooks/lep/lepTendersWidget.js.map +1 -1
  83. package/dist/hooks/lep/lepTimeInputCell.js +7 -1
  84. package/dist/hooks/lep/lepTimeInputCell.js.map +1 -1
  85. package/dist/hooks/lep/lepUserNotes.js +20 -22
  86. package/dist/hooks/lep/lepUserNotes.js.map +1 -1
  87. package/dist/hooks/lep/lepWidget.d.ts +1 -0
  88. package/dist/hooks/lep/lepWidget.js +22 -16
  89. package/dist/hooks/lep/lepWidget.js.map +1 -1
  90. package/dist/hooks/lep/lepWorkflowEvents.js +5 -5
  91. package/dist/hooks/lep/lepWorkflowEvents.js.map +1 -1
  92. package/dist/hooks/lep/loadEditPanel.d.ts +22 -0
  93. package/dist/hooks/lep/loadEditPanel.js +157 -139
  94. package/dist/hooks/lep/loadEditPanel.js.map +1 -1
  95. package/dist/hooks/lep/nerdMap/nerdMap.js +1 -0
  96. package/dist/hooks/lep/nerdMap/nerdMap.js.map +1 -1
  97. package/dist/hooks/load/loadsSearchInput.d.ts +1 -0
  98. package/dist/hooks/load/loadsSearchInput.js +16 -3
  99. package/dist/hooks/load/loadsSearchInput.js.map +1 -1
  100. package/dist/hooks/quote/constants.d.ts +1 -1
  101. package/dist/hooks/quote/constants.js +325 -42
  102. package/dist/hooks/quote/constants.js.map +1 -1
  103. package/dist/hooks/quote/helpers.js +3 -2
  104. package/dist/hooks/quote/helpers.js.map +1 -1
  105. package/dist/hooks/quote/result.js +8 -12
  106. package/dist/hooks/quote/result.js.map +1 -1
  107. package/dist/locales/en/common.json +2 -1
  108. package/dist/locales/en/components.json +1 -0
  109. package/dist/locales/en/entities.json +2 -2
  110. package/dist/locales/index.d.ts +2 -0
  111. package/dist/redux/archerFile/archerFileEndpoints.d.ts +2 -0
  112. package/dist/redux/archerFile/archerFileEndpoints.js +2 -0
  113. package/dist/redux/archerFile/archerFileEndpoints.js.map +1 -1
  114. package/dist/redux/commoditiesTasksSlice/commoditiesTasksSelectors.d.ts +2 -3
  115. package/dist/redux/commoditiesTasksSlice/commoditiesTasksSelectors.js +3 -4
  116. package/dist/redux/commoditiesTasksSlice/commoditiesTasksSelectors.js.map +1 -1
  117. package/dist/redux/commoditiesTasksSlice/commoditiesTasksSlice.d.ts +18 -4
  118. package/dist/redux/commoditiesTasksSlice/commoditiesTasksSlice.js +5 -3
  119. package/dist/redux/commoditiesTasksSlice/commoditiesTasksSlice.js.map +1 -1
  120. package/dist/redux/lep/lepSelectors.d.ts +6 -7
  121. package/dist/redux/lep/lepSelectors.js +11 -14
  122. package/dist/redux/lep/lepSelectors.js.map +1 -1
  123. package/dist/redux/lep/lepSlice.d.ts +33 -9
  124. package/dist/redux/lep/lepSlice.js +21 -14
  125. package/dist/redux/lep/lepSlice.js.map +1 -1
  126. package/dist/redux/loadInfoTasksSlice/loadInfoTasksSelectors.d.ts +2 -3
  127. package/dist/redux/loadInfoTasksSlice/loadInfoTasksSelectors.js +2 -2
  128. package/dist/redux/loadInfoTasksSlice/loadInfoTasksSelectors.js.map +1 -1
  129. package/dist/redux/loadInfoTasksSlice/loadInfoTasksSlice.d.ts +18 -4
  130. package/dist/redux/loadInfoTasksSlice/loadInfoTasksSlice.js +6 -3
  131. package/dist/redux/loadInfoTasksSlice/loadInfoTasksSlice.js.map +1 -1
  132. package/dist/redux/quote/quoteAction.d.ts +5 -1
  133. package/dist/redux/quote/quoteAction.js +3 -2
  134. package/dist/redux/quote/quoteAction.js.map +1 -1
  135. package/dist/redux/quote/quoteReducer.d.ts +1 -1
  136. package/dist/redux/quote/quoteReducer.js +2 -1
  137. package/dist/redux/quote/quoteReducer.js.map +1 -1
  138. package/dist/redux/quote/quoteSelectors.d.ts +1 -1
  139. package/dist/redux/quote/quoteSelectors.js +1 -1
  140. package/dist/redux/quote/quoteSelectors.js.map +1 -1
  141. package/dist/redux/shipconsTasksSlice/shipconsTasksSelectors.d.ts +2 -3
  142. package/dist/redux/shipconsTasksSlice/shipconsTasksSelectors.js +2 -2
  143. package/dist/redux/shipconsTasksSlice/shipconsTasksSelectors.js.map +1 -1
  144. package/dist/redux/shipconsTasksSlice/shipconsTasksSlice.d.ts +11 -3
  145. package/dist/redux/shipconsTasksSlice/shipconsTasksSlice.js +4 -2
  146. package/dist/redux/shipconsTasksSlice/shipconsTasksSlice.js.map +1 -1
  147. package/package.json +2 -2
@@ -1,20 +1,20 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Grid, Typography, Skeleton, Chip, IconButton, Button, Box, Table, Sheet, Modal, ModalDialog, FormControl, FormLabel, Input, Tooltip, Dropdown, MenuButton, Menu, MenuItem, ListItemDecorator, Divider, Select, Option, CircularProgress, Drawer, useTheme, } from "@mui/joy";
2
+ import { Box, Button, Chip, CircularProgress, Divider, Drawer, Dropdown, FormControl, FormLabel, Grid, IconButton, Input, ListItemDecorator, Menu, MenuButton, MenuItem, Modal, ModalDialog, Option, Select, Sheet, Skeleton, Table, Tooltip, Typography, } from "@mui/joy";
3
3
  import { NerdClickToCopy, NerdCurrencyField, NerdDatePicker, showNotification, useNerdConfirm, } from "@nerdjs/nerd-ui";
4
4
  import { DateTime } from "luxon";
5
- import { useEffect, useMemo, useRef, useState, } from "react";
6
- import salesKitI18n from "../../i18n";
5
+ import { useContext, useEffect, useMemo, useRef, useState, } from "react";
7
6
  import { useTranslation } from "react-i18next";
8
- import { Link, useParams } from "react-router-dom";
9
- import { CheckList } from "./checkList";
10
- import { quoteRecalculateBodySelector } from "../../redux/quote/quoteSelectors";
7
+ import { useDispatch, useSelector } from "react-redux";
8
+ import { Link, useNavigate } from "react-router-dom";
9
+ import salesKitI18n from "../../i18n";
10
+ import { getShipconsSelectors, setLoadDrawerSelectedLoadID, useDuplicateLoadV1Mutation, useGetLoadQuery, useGetShipconsQuery, useQuotesRecalculateMutation, useRecalculateQuoteMutation, useUpdateLoadV1Mutation, } from "../../redux";
11
11
  import { blockingTasksSelector } from "../../redux/lep/lepSelectors";
12
- import { useMediaQuery } from "@mui/system";
13
- import { useUpdateLoadV1Mutation, useRecalculateQuoteMutation, useGetLoadQuery, useQuotesRecalculateMutation, useDuplicateLoadV1Mutation, setLoadDrawerSelectedLoadID, useGetShipconsQuery, getShipconsSelectors, } from "../../redux";
12
+ import { quoteRecalculateBodySelector } from "../../redux/quote/quoteSelectors";
13
+ import { STATUS_MAP } from "../load/loadDrawer";
14
14
  import { usdFormatter } from "../quote";
15
15
  import { StatusStepper } from "../statusStepper";
16
- import { useDispatch, useSelector } from "react-redux";
17
- import { STATUS_MAP } from "../load/loadDrawer";
16
+ import { CheckList } from "./checkList";
17
+ import { LoadIDContext } from "./loadEditPanel";
18
18
  /**
19
19
  *
20
20
  * @param {PropsWithChildren} props props
@@ -22,7 +22,7 @@ import { STATUS_MAP } from "../load/loadDrawer";
22
22
  * @returns {ReactElement} LepActionBar
23
23
  */
24
24
  export function LepActionBar({ children, onDuplicateLoad, backTo, }) {
25
- const { id } = useParams();
25
+ const id = useContext(LoadIDContext);
26
26
  const { t } = useTranslation("common", { i18n: salesKitI18n });
27
27
  const dispatch = useDispatch();
28
28
  const confirm = useNerdConfirm();
@@ -31,7 +31,7 @@ export function LepActionBar({ children, onDuplicateLoad, backTo, }) {
31
31
  const { data: load, isLoading: loadingLoad } = useGetLoadQuery(Number(id), {
32
32
  skip: !id,
33
33
  });
34
- const recalculateBody = useSelector(quoteRecalculateBodySelector);
34
+ const recalculateBody = useSelector(quoteRecalculateBodySelector(Number(id)));
35
35
  const [quoteTONU, { isLoading: tonuLoading }] = useQuotesRecalculateMutation();
36
36
  const [updateLoad, { isLoading: updateLoadLoading }] = useUpdateLoadV1Mutation();
37
37
  const [duplicateLoad, { isLoading: duplicateLoading }] = useDuplicateLoadV1Mutation();
@@ -41,9 +41,8 @@ export function LepActionBar({ children, onDuplicateLoad, backTo, }) {
41
41
  const [pickupDate, setPickupDate] = useState(null);
42
42
  const refNumberRef = useRef(null);
43
43
  const [totalRate, setTotalRate] = useState();
44
- const blockingTasks = useSelector(blockingTasksSelector);
45
- const theme = useTheme();
46
- const downLg = useMediaQuery(theme.breakpoints.down("lg"));
44
+ const blockingTasks = useSelector((s) => blockingTasksSelector(s, Number(id)));
45
+ const navigate = useNavigate();
47
46
  const handleClick = () => {
48
47
  setOpen(true);
49
48
  };
@@ -51,7 +50,7 @@ export function LepActionBar({ children, onDuplicateLoad, backTo, }) {
51
50
  setOpen(false);
52
51
  };
53
52
  const handleRecalculate = () => {
54
- if (load?.quoteID && load.id && recalculateBody.customer_id)
53
+ if (load?.quoteID && load.id && recalculateBody?.customer_id)
55
54
  recalculateQuote({
56
55
  quoteID: load?.quoteID,
57
56
  body: {
@@ -158,61 +157,49 @@ export function LepActionBar({ children, onDuplicateLoad, backTo, }) {
158
157
  }
159
158
  setTotalRate(load?.totalRate);
160
159
  }, [load]);
161
- return (_jsxs(_Fragment, { children: [_jsxs(Grid, { container: true, alignItems: "center", columnGap: 0.5, children: [_jsx(Grid, { xs: 6, md: backTo ? true : 2, lg: true, order: 1, children: !loadingLoad ? (_jsxs(Box, { display: "flex", gap: 0.5, children: [backTo ? (_jsx(Box, { mr: 0.5, mt: 0.5, display: { xs: "none", md: "block" }, children: _jsx(Button, { size: "sm", variant: "soft", color: "neutral", startDecorator: _jsx("i", { className: "fa-solid fa-arrow-left" }), component: Link, to: backTo, sx: {
162
- textDecoration: "none !important",
163
- }, children: t("global.back") }) })) : null, downLg ? (_jsx(IconButton, { variant: "plain", color: "neutral", size: "sm", onClick: handleClick, children: _jsx("i", { style: {
164
- fontSize: 18,
165
- }, className: "fa-regular fa-circle-info" }) })) : null, _jsxs(Box, { display: "flex", flexWrap: "wrap", children: [_jsxs(Typography, { level: "title-lg", display: "inline", children: ["#", _jsx(NerdClickToCopy, { typographyProps: {
166
- level: "title-lg",
167
- display: "inline",
168
- }, children: _jsx(Skeleton, { loading: loadingLoad, children: `${load?.id}` }) })] }), _jsx(NerdClickToCopy, { typographyProps: {
169
- sx: {
170
- width: "fit-content",
171
- display: "inline",
172
- },
173
- level: "body-xs",
174
- }, children: _jsx(Skeleton, { loading: loadingLoad, children: load?.referenceNumber
175
- ? `(${load?.referenceNumber})`
176
- : "(Not Set)" }) }), load?.status ? (_jsx(Box, { children: _jsx(Chip, { color: load?.status === "Cancelled"
177
- ? "danger"
178
- : load?.status === "Pending"
179
- ? "neutral"
180
- : "primary", size: "sm", children: load?.status }) })) : null, load?.customerDoNotContact ? (_jsx(Tooltip, { size: "sm", title: "Do not contact", children: _jsx(Chip, { color: "danger", children: _jsx("i", { className: "fa-solid fa-phone-slash" }) }) })) : null] }), !downLg ? (_jsxs(Box, { display: "flex", ml: "auto", mr: "auto", gap: 1, children: [_jsxs(Typography, { level: "body-sm", children: [_jsx(Typography, { level: "body-sm", fontWeight: "xl", children: "Quote #:" }), _jsx(NerdClickToCopy, { children: load?.quoteID })] }), _jsxs(Typography, { level: "body-sm", children: [_jsx(Typography, { level: "body-sm", fontWeight: "xl", children: "CSR:" }), _jsx(NerdClickToCopy, { children: load?.csrName })] }), _jsxs(Typography, { level: "body-sm", children: [_jsx(Typography, { level: "body-sm", fontWeight: "xl", children: "Customer:" }), _jsx(NerdClickToCopy, { children: load?.customer })] }), _jsxs(Typography, { level: "body-sm", children: [_jsxs(Typography, { level: "body-sm", fontWeight: "xl", children: ["Base Rate:", " "] }), load?.baserate ? usdFormatter.format(load?.baserate) : "-"] }), _jsxs(Typography, { level: "body-sm", children: [_jsxs(Typography, { level: "body-sm", fontWeight: "xl", children: ["Fuel Rate:", " "] }), load?.fuelCost ? usdFormatter.format(load?.fuelCost) : "-"] }), _jsxs(Typography, { level: "body-sm", children: [_jsxs(Typography, { level: "body-sm", fontWeight: "xl", children: ["Total Rate:", " "] }), load?.totalRate
181
- ? usdFormatter.format(load?.totalRate)
182
- : "-"] }), _jsxs(Typography, { level: "body-sm", color: load?.margin && load.margin < 0 ? "danger" : undefined, children: [_jsxs(Typography, { level: "body-sm", fontWeight: "xl", children: ["Margin:", " "] }), load?.margin ? usdFormatter.format(load?.margin) : "-"] }), " ", _jsxs(Typography, { level: "body-sm", children: [_jsxs(Typography, { level: "body-sm", fontWeight: "xl", children: ["Invoice Date:", " "] }), load?.invoiceDate
183
- ? DateTime.fromISO(load.invoiceDate)
184
- .toUTC()
185
- // eslint-disable-next-line i18next/no-literal-string
186
- .toFormat("LL/dd/yyyy")
187
- : "-"] })] })) : null] })) : null }), _jsx(Grid, { container: true, xs: 12, md: backTo ? 12 : true, lg: 12, justifyContent: "center", order: {
188
- xs: 3,
189
- md: backTo ? 3 : 2,
190
- lg: 3,
191
- }, children: _jsx(Grid, { children: children }) }), _jsxs(Grid, { container: true, spacing: 1, justifyContent: { xs: "start", md: "end" }, alignItems: "center", xs: "auto", ml: { xs: "auto", lg: 0 }, order: {
192
- xs: 2,
193
- md: backTo ? 2 : 3,
194
- lg: 2,
195
- }, children: [_jsx(Grid, { children: _jsx(CheckList, { loading: loadingLoad }) }), _jsx(Grid, { children: _jsxs(Dropdown, { children: [_jsx(MenuButton, { slots: { root: IconButton }, slotProps: {
196
- root: {
197
- variant: "outlined",
198
- color: "neutral",
199
- size: "sm",
200
- className: "ShipconsTaskItem-recalculate",
201
- },
202
- }, loading: recalculateLoading || tonuLoading || updateLoadLoading, children: recalculateLoading ||
203
- tonuLoading ||
204
- updateLoadLoading ? null : (_jsx("i", { className: "fa-solid fa-bars" })) }), _jsxs(Menu, { placement: "bottom-end", sx: {
205
- zIndex: (theme) => theme.zIndex.modal,
206
- }, children: [_jsxs(MenuItem, { onClick: () => setOpenDownload(true), children: [_jsx(ListItemDecorator, { sx: { color: "inherit" }, children: _jsx("i", { className: "fa-solid fa-download pright" }) }), t("entities:load.others.download_document")] }), load?.cancelled ? (_jsxs(MenuItem, { onClick: handleActivateLoad, children: [_jsx(ListItemDecorator, { sx: { color: "inherit" }, children: _jsx("i", { className: "fa-solid fa-check-circle pright" }) }), t("entities:load.others.activate_load")] })) : (_jsxs(MenuItem, { onClick: handleCancel, variant: "soft", color: "danger", children: [_jsx(ListItemDecorator, { children: _jsx("i", { className: "fa-solid fa-ban pright" }) }), t("entities:load.others.cancel_load")] })), load?.truckOrderNotUsed ? (_jsxs(MenuItem, { onClick: () => handleTONU(!load?.truckOrderNotUsed), children: [_jsx(ListItemDecorator, { children: _jsx("i", { className: "fa-solid fa-person-dolly pright" }) }), t("entities:load.others.undo_tonu")] })) : (_jsxs(MenuItem, { onClick: () => handleTONU(!load?.truckOrderNotUsed), children: [_jsx(ListItemDecorator, { children: _jsx("i", { className: "fa-solid fa-person-dolly-empty pright" }) }), t("entities:load.others.tonu")] })), _jsxs(MenuItem, { onClick: () => setOpenDuplicate(true), children: [_jsx(ListItemDecorator, { children: _jsx("i", { className: "fa-solid fa-clone pright" }) }), t("global.duplicate")] }), _jsx(Tooltip, { title: !recalculateBody.customer_id
207
- ? "The load has no customer selected"
208
- : "", children: _jsx("span", { children: _jsxs(MenuItem, { onClick: handleRecalculate, disabled: !recalculateBody.customer_id, children: [_jsx(ListItemDecorator, { children: _jsx("i", { className: "fa-solid fa-arrows-rotate pright" }) }), t("components:lepShipcons.recalculate")] }) }) }), !load?.cancelled ? (_jsx(Tooltip, { title: load?.active
209
- ? "The load is already active"
210
- : blockingTasks.length > 0
211
- ? "The load is not complete, check the Tasks List for more details"
212
- : "", children: _jsx("span", { children: _jsxs(MenuItem, { onClick: handleValidate, disabled: load?.active || blockingTasks.length > 0, children: [_jsx(ListItemDecorator, { children: _jsx("i", { className: "fa-solid fa-truck-fast pright" }) }), t("components:lepShipcons.validate")] }) }) })) : null] })] }) }), _jsx(Grid, { children: _jsx(Tooltip, { title: "Open Load Quick View", children: _jsx(IconButton, { size: "sm", variant: "soft", color: "primary", onClick: () => {
213
- if (load)
214
- dispatch(setLoadDrawerSelectedLoadID(load.id));
215
- }, children: _jsx("i", { className: "fa-solid fa-magnifying-glass" }) }) }) })] })] }), _jsx(Drawer, { open: open, anchor: "left", onClose: handleClose, sx: {
160
+ return (_jsxs(_Fragment, { children: [_jsxs(Grid, { container: true, sx: { gap: 0.5, alignItems: "center" }, children: [_jsxs(Grid, { order: 1, display: "flex", children: [backTo ? (_jsx(Box, { mr: 0.5, mt: 0.5, display: { xs: "none", md: "block" }, children: _jsx(Button, { size: "sm", variant: "soft", color: "neutral", startDecorator: _jsx("i", { className: "fa-solid fa-arrow-left" }), component: Link, to: backTo, sx: {
161
+ textDecoration: "none !important",
162
+ }, children: t("global.back") }) })) : null, _jsx(IconButton, { variant: "plain", color: "neutral", size: "sm", onClick: handleClick, sx: {
163
+ display: {
164
+ xs: "flex",
165
+ sm: "none",
166
+ },
167
+ }, children: _jsx("i", { style: {
168
+ fontSize: 18,
169
+ }, className: "fa-regular fa-circle-info" }) }), _jsxs(Typography, { level: "title-lg", display: "inline", children: ["#", _jsx(NerdClickToCopy, { typographyProps: {
170
+ level: "title-lg",
171
+ display: "inline",
172
+ }, children: _jsx(Skeleton, { loading: loadingLoad, children: `${load?.id}` }) })] }), _jsx(NerdClickToCopy, { typographyProps: {
173
+ sx: {
174
+ width: "fit-content",
175
+ display: "inline",
176
+ },
177
+ level: "body-xs",
178
+ }, children: _jsx(Skeleton, { loading: loadingLoad, children: load?.referenceNumber
179
+ ? `(${load?.referenceNumber})`
180
+ : "(Not Set)" }) }), load?.status ? (_jsx(Box, { children: _jsx(Chip, { color: load?.status === "Cancelled"
181
+ ? "danger"
182
+ : load?.status === "Pending"
183
+ ? "neutral"
184
+ : "primary", size: "sm", children: load?.status }) })) : null, load?.customerDoNotContact ? (_jsx(Tooltip, { size: "sm", title: "Do not contact", children: _jsx(Chip, { color: "danger", children: _jsx("i", { className: "fa-solid fa-phone-slash" }) }) })) : null] }), _jsx(Grid, { xs: 12, md: true, order: { xs: 3, md: 2 }, children: _jsx(Box, { sx: { flexGrow: 1, display: "flex", justifyContent: "center" }, children: children }) }), _jsxs(Grid, { display: "flex", gap: 0.5, order: { xs: 2, md: 3 }, ml: { xs: 0, sm: "auto" }, children: [_jsx(CheckList, { loading: loadingLoad }), _jsxs(Dropdown, { children: [_jsx(MenuButton, { slots: { root: IconButton }, slotProps: {
185
+ root: {
186
+ variant: "outlined",
187
+ color: "neutral",
188
+ size: "sm",
189
+ className: "ShipconsTaskItem-recalculate",
190
+ },
191
+ }, loading: recalculateLoading || tonuLoading || updateLoadLoading, children: recalculateLoading || tonuLoading || updateLoadLoading ? null : (_jsx("i", { className: "fa-solid fa-bars" })) }), _jsxs(Menu, { placement: "bottom-end", sx: {
192
+ zIndex: (theme) => theme.zIndex.modal,
193
+ }, children: [_jsxs(MenuItem, { onClick: () => setOpenDownload(true), children: [_jsx(ListItemDecorator, { sx: { color: "inherit" }, children: _jsx("i", { className: "fa-solid fa-download pright" }) }), t("entities:load.others.download_document")] }), load?.cancelled ? (_jsxs(MenuItem, { onClick: handleActivateLoad, children: [_jsx(ListItemDecorator, { sx: { color: "inherit" }, children: _jsx("i", { className: "fa-solid fa-check-circle pright" }) }), t("entities:load.others.activate_load")] })) : (_jsxs(MenuItem, { onClick: handleCancel, variant: "soft", color: "danger", children: [_jsx(ListItemDecorator, { children: _jsx("i", { className: "fa-solid fa-ban pright" }) }), t("entities:load.others.cancel_load")] })), load?.truckOrderNotUsed ? (_jsxs(MenuItem, { onClick: () => handleTONU(!load?.truckOrderNotUsed), children: [_jsx(ListItemDecorator, { children: _jsx("i", { className: "fa-solid fa-person-dolly pright" }) }), t("entities:load.others.undo_tonu")] })) : (_jsxs(MenuItem, { onClick: () => handleTONU(!load?.truckOrderNotUsed), children: [_jsx(ListItemDecorator, { children: _jsx("i", { className: "fa-solid fa-person-dolly-empty pright" }) }), t("entities:load.others.tonu")] })), _jsxs(MenuItem, { onClick: () => setOpenDuplicate(true), children: [_jsx(ListItemDecorator, { children: _jsx("i", { className: "fa-solid fa-clone pright" }) }), t("global.duplicate")] }), _jsx(Tooltip, { title: !recalculateBody?.customer_id
194
+ ? "The load has no customer selected"
195
+ : "", children: _jsx("span", { children: _jsxs(MenuItem, { onClick: handleRecalculate, disabled: !recalculateBody?.customer_id, children: [_jsx(ListItemDecorator, { children: _jsx("i", { className: "fa-solid fa-arrows-rotate pright" }) }), t("components:lepShipcons.recalculate")] }) }) }), _jsx("span", { children: _jsxs(MenuItem, { onClick: () => navigate(`/compare?ids=${id}`), children: [_jsx(ListItemDecorator, { children: _jsx("i", { className: "fa-solid fa-rectangle-vertical-history" }) }), t("components:lepShipcons.compareWith")] }) }), !load?.cancelled ? (_jsx(Tooltip, { title: load?.active
196
+ ? "The load is already active"
197
+ : blockingTasks.length > 0
198
+ ? "The load is not complete, check the Tasks List for more details"
199
+ : "", children: _jsx("span", { children: _jsxs(MenuItem, { onClick: handleValidate, disabled: load?.active || blockingTasks.length > 0, children: [_jsx(ListItemDecorator, { children: _jsx("i", { className: "fa-solid fa-truck-fast pright" }) }), t("components:lepShipcons.validate")] }) }) })) : null] })] }), _jsx(Tooltip, { title: "Open Load Quick View", children: _jsx(IconButton, { size: "sm", variant: "soft", color: "primary", onClick: () => {
200
+ if (load)
201
+ dispatch(setLoadDrawerSelectedLoadID(load.id));
202
+ }, children: _jsx("i", { className: "fa-solid fa-magnifying-glass" }) }) })] })] }), _jsx(Drawer, { open: open, anchor: "left", onClose: handleClose, sx: {
216
203
  zIndex: 1200,
217
204
  }, slotProps: {
218
205
  content: {
@@ -233,7 +220,9 @@ export function LepActionBar({ children, onDuplicateLoad, backTo, }) {
233
220
  display: "inline",
234
221
  }, children: load?.quoteID }) })] }), _jsxs("tr", { children: [_jsx("th", { scope: "row", children: t("entities:load.others.csr_name") }), _jsx("td", { children: load?.csrName })] }), _jsxs("tr", { children: [_jsx("th", { scope: "row", children: t("entities:load.others.customer") }), _jsx("td", { children: load?.customer })] }), _jsxs("tr", { children: [_jsx("th", { scope: "row", children: t("entities:load.others.base_rate") }), _jsx("td", { children: load?.baserate ? usdFormatter.format(load?.baserate) : "-" })] }), _jsxs("tr", { children: [_jsx("th", { scope: "row", children: t("entities:load.others.fuel_rate") }), _jsx("td", { children: load?.fuelCost ? usdFormatter.format(load?.fuelCost) : "-" })] }), _jsxs("tr", { children: [_jsx("th", { scope: "row", children: t("entities:load.others.total") }), _jsx("td", { children: load?.totalRate
235
222
  ? usdFormatter.format(load?.totalRate)
236
- : "-" })] }), _jsxs("tr", { children: [_jsx("th", { scope: "row", children: t("entities:load.others.margin") }), _jsx("td", { children: load?.margin ? usdFormatter.format(load?.margin) : "-" })] }), _jsxs("tr", { children: [_jsx("th", { scope: "row", children: t("entities:load.others.invoice_date") }), _jsx("td", { children: load?.invoiceDate
223
+ : "-" })] }), _jsxs("tr", { children: [_jsx("th", { scope: "row", children: t("entities:load.others.margin") }), _jsx("td", { style: {
224
+ color: load?.margin && load?.margin < 0 ? "red" : undefined,
225
+ }, children: load?.margin ? usdFormatter.format(load?.margin) : "-" })] }), _jsxs("tr", { children: [_jsx("th", { scope: "row", children: t("entities:load.others.invoice_date") }), _jsx("td", { children: load?.invoiceDate
237
226
  ? DateTime.fromISO(load.invoiceDate)
238
227
  .toUTC()
239
228
  // eslint-disable-next-line i18next/no-literal-string
@@ -264,9 +253,549 @@ export function LepActionBar({ children, onDuplicateLoad, backTo, }) {
264
253
  pt: 2,
265
254
  height: "100%",
266
255
  }, children: [_jsx(Button, { onClick: handleCloseDuplicate, color: "neutral", variant: "soft", children: t("global.Cancel") }), _jsx(Button, { loading: duplicateLoading, onClick: handleDuplicate, children: t("global.duplicate") })] })] }) }), _jsx(DownloadDocumentModal, { open: openDownload, onClose: () => setOpenDownload(false) }), _jsx(Divider, { sx: { height: 1 } })] }));
256
+ // return (
257
+ // <>
258
+ // <Grid container alignItems={"center"} columnGap={0.5}>
259
+ // <Grid xs={6} md={backTo ? true : 2} lg order={1}>
260
+ // {!loadingLoad ? (
261
+ // <Box display={"flex"} gap={0.5}>
262
+ // {backTo ? (
263
+ // <Box mr={0.5} mt={0.5} display={{ xs: "none", md: "block" }}>
264
+ // <Button
265
+ // size="sm"
266
+ // variant="soft"
267
+ // color="neutral"
268
+ // startDecorator={<i className="fa-solid fa-arrow-left" />}
269
+ // component={Link}
270
+ // to={backTo}
271
+ // sx={{
272
+ // textDecoration: "none !important",
273
+ // }}
274
+ // >
275
+ // {t("global.back")}
276
+ // </Button>
277
+ // </Box>
278
+ // ) : null}
279
+ // {downLg ? (
280
+ // <IconButton
281
+ // variant="plain"
282
+ // color="neutral"
283
+ // size="sm"
284
+ // onClick={handleClick}
285
+ // >
286
+ // <i
287
+ // style={{
288
+ // fontSize: 18,
289
+ // }}
290
+ // className="fa-regular fa-circle-info"
291
+ // ></i>
292
+ // </IconButton>
293
+ // ) : null}
294
+ // <Box display={"flex"} flexWrap="wrap">
295
+ // <Typography level="title-lg" display={"inline"}>
296
+ // #
297
+ // <NerdClickToCopy
298
+ // typographyProps={{
299
+ // level: "title-lg",
300
+ // display: "inline",
301
+ // }}
302
+ // >
303
+ // <Skeleton loading={loadingLoad}>{`${load?.id}`}</Skeleton>
304
+ // </NerdClickToCopy>
305
+ // </Typography>
306
+ // <NerdClickToCopy
307
+ // typographyProps={{
308
+ // sx: {
309
+ // width: "fit-content",
310
+ // display: "inline",
311
+ // },
312
+ // level: "body-xs",
313
+ // }}
314
+ // >
315
+ // <Skeleton loading={loadingLoad}>
316
+ // {load?.referenceNumber
317
+ // ? `(${load?.referenceNumber})`
318
+ // : "(Not Set)"}
319
+ // </Skeleton>
320
+ // </NerdClickToCopy>
321
+ // {load?.status ? (
322
+ // <Box>
323
+ // <Chip
324
+ // color={
325
+ // load?.status === "Cancelled"
326
+ // ? "danger"
327
+ // : load?.status === "Pending"
328
+ // ? "neutral"
329
+ // : "primary"
330
+ // }
331
+ // size="sm"
332
+ // >
333
+ // {load?.status}
334
+ // </Chip>
335
+ // </Box>
336
+ // ) : null}
337
+ // {load?.customerDoNotContact ? (
338
+ // <Tooltip size="sm" title="Do not contact">
339
+ // <Chip color="danger">
340
+ // <i className="fa-solid fa-phone-slash"></i>
341
+ // </Chip>
342
+ // </Tooltip>
343
+ // ) : null}
344
+ // </Box>
345
+ // {/* {!downLg ? (
346
+ // <Box display={"flex"} ml="auto" mr="auto" gap={1}>
347
+ // <Typography level="body-sm">
348
+ // <Typography level="body-sm" fontWeight="xl">
349
+ // Quote #:
350
+ // </Typography>
351
+ // <NerdClickToCopy>{load?.quoteID}</NerdClickToCopy>
352
+ // </Typography>
353
+ // <Typography level="body-sm">
354
+ // <Typography level="body-sm" fontWeight="xl">
355
+ // CSR:
356
+ // </Typography>
357
+ // <NerdClickToCopy>{load?.csrName}</NerdClickToCopy>
358
+ // </Typography>
359
+ // <Typography level="body-sm">
360
+ // <Typography level="body-sm" fontWeight="xl">
361
+ // Customer:
362
+ // </Typography>
363
+ // <NerdClickToCopy>{load?.customer}</NerdClickToCopy>
364
+ // </Typography>
365
+ // <Typography level="body-sm">
366
+ // <Typography level="body-sm" fontWeight="xl">
367
+ // Base Rate:{" "}
368
+ // </Typography>
369
+ // {load?.baserate ? usdFormatter.format(load?.baserate) : "-"}
370
+ // </Typography>
371
+ // <Typography level="body-sm">
372
+ // <Typography level="body-sm" fontWeight="xl">
373
+ // Fuel Rate:{" "}
374
+ // </Typography>
375
+ // {load?.fuelCost ? usdFormatter.format(load?.fuelCost) : "-"}
376
+ // </Typography>
377
+ // <Typography level="body-sm">
378
+ // <Typography level="body-sm" fontWeight="xl">
379
+ // Total Rate:{" "}
380
+ // </Typography>
381
+ // {load?.totalRate
382
+ // ? usdFormatter.format(load?.totalRate)
383
+ // : "-"}
384
+ // </Typography>
385
+ // <Typography level="body-sm">
386
+ // <Typography level="body-sm" fontWeight="xl">
387
+ // Margin:{" "}
388
+ // </Typography>
389
+ // {load?.margin ? usdFormatter.format(load?.margin) : "-"}
390
+ // </Typography>{" "}
391
+ // <Typography level="body-sm">
392
+ // <Typography level="body-sm" fontWeight="xl">
393
+ // Invoice Date:{" "}
394
+ // </Typography>
395
+ // {load?.invoiceDate
396
+ // ? DateTime.fromISO(load.invoiceDate)
397
+ // .toUTC()
398
+ // // eslint-disable-next-line i18next/no-literal-string
399
+ // .toFormat("LL/dd/yyyy")
400
+ // : "-"}
401
+ // </Typography>
402
+ // </Box>
403
+ // ) : null} */}
404
+ // </Box>
405
+ // ) : null}
406
+ // </Grid>
407
+ // <Grid
408
+ // container
409
+ // xs={12}
410
+ // md={backTo ? 12 : true}
411
+ // lg={12}
412
+ // justifyContent={"center"}
413
+ // order={{
414
+ // xs: 3,
415
+ // md: 3,
416
+ // lg: 3,
417
+ // }}
418
+ // >
419
+ // <Grid>{children}</Grid>
420
+ // </Grid>
421
+ // <Grid
422
+ // container
423
+ // spacing={1}
424
+ // justifyContent={{ xs: "start", md: "end" }}
425
+ // alignItems={"center"}
426
+ // xs={"auto"}
427
+ // ml={{ xs: "auto", lg: 0 }}
428
+ // order={{
429
+ // xs: 2,
430
+ // md: backTo ? 2 : 3,
431
+ // lg: 2,
432
+ // }}
433
+ // >
434
+ // <Grid>
435
+ // <CheckList loading={loadingLoad} />
436
+ // </Grid>
437
+ // <Grid>
438
+ // <Dropdown>
439
+ // <MenuButton
440
+ // slots={{ root: IconButton }}
441
+ // slotProps={{
442
+ // root: {
443
+ // variant: "outlined",
444
+ // color: "neutral",
445
+ // size: "sm",
446
+ // className: "ShipconsTaskItem-recalculate",
447
+ // },
448
+ // }}
449
+ // loading={recalculateLoading || tonuLoading || updateLoadLoading}
450
+ // >
451
+ // {recalculateLoading ||
452
+ // tonuLoading ||
453
+ // updateLoadLoading ? null : (
454
+ // <i className="fa-solid fa-bars"></i>
455
+ // )}
456
+ // </MenuButton>
457
+ // <Menu
458
+ // placement="bottom-end"
459
+ // sx={{
460
+ // zIndex: (theme) => theme.zIndex.modal,
461
+ // }}
462
+ // >
463
+ // <MenuItem onClick={() => setOpenDownload(true)}>
464
+ // <ListItemDecorator sx={{ color: "inherit" }}>
465
+ // <i className="fa-solid fa-download pright"></i>
466
+ // </ListItemDecorator>
467
+ // {t("entities:load.others.download_document")}
468
+ // </MenuItem>
469
+ // {load?.cancelled ? (
470
+ // <MenuItem onClick={handleActivateLoad}>
471
+ // <ListItemDecorator sx={{ color: "inherit" }}>
472
+ // <i className="fa-solid fa-check-circle pright"></i>
473
+ // </ListItemDecorator>
474
+ // {t("entities:load.others.activate_load")}
475
+ // </MenuItem>
476
+ // ) : (
477
+ // <MenuItem
478
+ // onClick={handleCancel}
479
+ // variant="soft"
480
+ // color="danger"
481
+ // >
482
+ // <ListItemDecorator>
483
+ // <i className="fa-solid fa-ban pright"></i>
484
+ // </ListItemDecorator>
485
+ // {t("entities:load.others.cancel_load")}
486
+ // </MenuItem>
487
+ // )}
488
+ // {load?.truckOrderNotUsed ? (
489
+ // <MenuItem
490
+ // onClick={() => handleTONU(!load?.truckOrderNotUsed)}
491
+ // >
492
+ // <ListItemDecorator>
493
+ // <i className="fa-solid fa-person-dolly pright"></i>
494
+ // </ListItemDecorator>
495
+ // {t("entities:load.others.undo_tonu")}
496
+ // </MenuItem>
497
+ // ) : (
498
+ // <MenuItem
499
+ // onClick={() => handleTONU(!load?.truckOrderNotUsed)}
500
+ // >
501
+ // <ListItemDecorator>
502
+ // <i className="fa-solid fa-person-dolly-empty pright"></i>
503
+ // </ListItemDecorator>
504
+ // {t("entities:load.others.tonu")}
505
+ // </MenuItem>
506
+ // )}
507
+ // <MenuItem onClick={() => setOpenDuplicate(true)}>
508
+ // <ListItemDecorator>
509
+ // <i className="fa-solid fa-clone pright"></i>
510
+ // </ListItemDecorator>
511
+ // {t("global.duplicate")}
512
+ // </MenuItem>
513
+ // <Tooltip
514
+ // title={
515
+ // !recalculateBody.customer_id
516
+ // ? "The load has no customer selected"
517
+ // : ""
518
+ // }
519
+ // >
520
+ // <span>
521
+ // <MenuItem
522
+ // onClick={handleRecalculate}
523
+ // disabled={!recalculateBody.customer_id}
524
+ // >
525
+ // <ListItemDecorator>
526
+ // <i className="fa-solid fa-arrows-rotate pright"></i>
527
+ // </ListItemDecorator>
528
+ // {t("components:lepShipcons.recalculate")}
529
+ // </MenuItem>
530
+ // </span>
531
+ // </Tooltip>
532
+ // {!load?.cancelled ? (
533
+ // <Tooltip
534
+ // title={
535
+ // load?.active
536
+ // ? "The load is already active"
537
+ // : blockingTasks.length > 0
538
+ // ? "The load is not complete, check the Tasks List for more details"
539
+ // : ""
540
+ // }
541
+ // >
542
+ // <span>
543
+ // <MenuItem
544
+ // onClick={handleValidate}
545
+ // disabled={load?.active || blockingTasks.length > 0}
546
+ // >
547
+ // <ListItemDecorator>
548
+ // <i className="fa-solid fa-truck-fast pright"></i>
549
+ // </ListItemDecorator>
550
+ // {t("components:lepShipcons.validate")}
551
+ // </MenuItem>
552
+ // </span>
553
+ // </Tooltip>
554
+ // ) : null}
555
+ // </Menu>
556
+ // </Dropdown>
557
+ // </Grid>
558
+ // <Grid>
559
+ // <Tooltip title="Open Load Quick View">
560
+ // <IconButton
561
+ // size="sm"
562
+ // variant="soft"
563
+ // color="primary"
564
+ // onClick={() => {
565
+ // if (load) dispatch(setLoadDrawerSelectedLoadID(load.id));
566
+ // }}
567
+ // >
568
+ // <i className="fa-solid fa-magnifying-glass" />
569
+ // </IconButton>
570
+ // </Tooltip>
571
+ // </Grid>
572
+ // </Grid>
573
+ // </Grid>
574
+ // <Drawer
575
+ // open={open}
576
+ // anchor={"left"}
577
+ // onClose={handleClose}
578
+ // sx={{
579
+ // zIndex: 1200,
580
+ // }}
581
+ // slotProps={{
582
+ // content: {
583
+ // sx: {
584
+ // width: "fit-content",
585
+ // },
586
+ // },
587
+ // }}
588
+ // >
589
+ // <Box mt={{ xs: "138px", sm: "98px" }} p={2} maxWidth={300}>
590
+ // <Grid container spacing={0} columnGap={1}>
591
+ // <Grid>
592
+ // <Box display={"flex"} alignItems={"center"}>
593
+ // <Typography level={"h4"}>#</Typography>
594
+ // <NerdClickToCopy typographyProps={{ level: "h4" }}>
595
+ // {`${load?.id}`}
596
+ // </NerdClickToCopy>
597
+ // </Box>
598
+ // </Grid>
599
+ // {load?.customerDoNotContact ? (
600
+ // <Grid>
601
+ // <Tooltip size="sm" title="Do not contact">
602
+ // <Chip color="danger">
603
+ // <i className="fa-solid fa-phone-slash"></i>
604
+ // </Chip>
605
+ // </Tooltip>
606
+ // </Grid>
607
+ // ) : null}
608
+ // <Grid xs={12}>
609
+ // <Box display={"flex"}>
610
+ // {load?.referenceNumber ? (
611
+ // <NerdClickToCopy typographyProps={{ level: "body-sm" }}>
612
+ // {`(${load?.referenceNumber})`}
613
+ // </NerdClickToCopy>
614
+ // ) : (
615
+ // "(Not Set)"
616
+ // )}
617
+ // </Box>
618
+ // </Grid>
619
+ // {load?.status ? (
620
+ // <Grid>
621
+ // <StatusStepper
622
+ // currentStep={STATUS_MAP[load?.status]}
623
+ // stepsLength={6}
624
+ // disableAnimation
625
+ // />
626
+ // </Grid>
627
+ // ) : null}
628
+ // </Grid>
629
+ // <Sheet
630
+ // variant="outlined"
631
+ // sx={{
632
+ // borderRadius: 5,
633
+ // p: 1,
634
+ // mt: 2,
635
+ // }}
636
+ // >
637
+ // <Table
638
+ // color="neutral"
639
+ // sx={{
640
+ // "& th": {
641
+ // whiteSpace: "normal",
642
+ // wordBreak: "break-word",
643
+ // },
644
+ // }}
645
+ // >
646
+ // <tbody>
647
+ // <tr>
648
+ // <th scope="row">{t("entities:quote.entity")} #</th>
649
+ // <td>
650
+ // <NerdClickToCopy
651
+ // typographyProps={{
652
+ // display: "inline",
653
+ // }}
654
+ // >
655
+ // {load?.quoteID}
656
+ // </NerdClickToCopy>
657
+ // </td>
658
+ // </tr>
659
+ // <tr>
660
+ // <th scope="row">{t("entities:load.others.csr_name")}</th>
661
+ // <td>{load?.csrName}</td>
662
+ // </tr>
663
+ // <tr>
664
+ // <th scope="row">{t("entities:load.others.customer")}</th>
665
+ // <td>{load?.customer}</td>
666
+ // </tr>
667
+ // <tr>
668
+ // <th scope="row">{t("entities:load.others.base_rate")}</th>
669
+ // <td>
670
+ // {load?.baserate ? usdFormatter.format(load?.baserate) : "-"}
671
+ // </td>
672
+ // </tr>
673
+ // <tr>
674
+ // <th scope="row">{t("entities:load.others.fuel_rate")}</th>
675
+ // <td>
676
+ // {load?.fuelCost ? usdFormatter.format(load?.fuelCost) : "-"}
677
+ // </td>
678
+ // </tr>
679
+ // <tr>
680
+ // <th scope="row">{t("entities:load.others.total")}</th>
681
+ // <td>
682
+ // {load?.totalRate
683
+ // ? usdFormatter.format(load?.totalRate)
684
+ // : "-"}
685
+ // </td>
686
+ // </tr>
687
+ // <tr>
688
+ // <th scope="row">{t("entities:load.others.margin")}</th>
689
+ // <td>
690
+ // {load?.margin ? usdFormatter.format(load?.margin) : "-"}
691
+ // </td>
692
+ // </tr>
693
+ // <tr>
694
+ // <th scope="row">{t("entities:load.others.invoice_date")}</th>
695
+ // <td>
696
+ // {load?.invoiceDate
697
+ // ? DateTime.fromISO(load.invoiceDate)
698
+ // .toUTC()
699
+ // // eslint-disable-next-line i18next/no-literal-string
700
+ // .toFormat("LL/dd/yyyy")
701
+ // : "-"}
702
+ // </td>
703
+ // </tr>
704
+ // </tbody>
705
+ // </Table>
706
+ // </Sheet>
707
+ // </Box>
708
+ // </Drawer>
709
+ // <Modal open={openDuplicate} onClose={handleCloseDuplicate}>
710
+ // <ModalDialog
711
+ // aria-labelledby="modal-dialog-title"
712
+ // layout="center"
713
+ // sx={(theme) => ({
714
+ // width: 500,
715
+ // [theme.breakpoints.only("xs")]: {
716
+ // top: 0,
717
+ // left: 0,
718
+ // right: 0,
719
+ // bottom: 0,
720
+ // border: 0,
721
+ // borderRadius: 0,
722
+ // transform: "initial",
723
+ // maxWidth: "initial",
724
+ // maxHeight: "initial",
725
+ // width: "initial",
726
+ // },
727
+ // })}
728
+ // >
729
+ // <Typography id="modal-dialog-title" level="h2">
730
+ // {t("entities:load.others.duplicate_load")}
731
+ // </Typography>
732
+ // <Grid container spacing={1} overflow={"auto"}>
733
+ // <Grid xs={12}>
734
+ // <FormControl>
735
+ // <FormLabel>
736
+ // {t("entities:invoice.attributes.referenceNumber")}
737
+ // </FormLabel>
738
+ // <Input
739
+ // slotProps={{
740
+ // input: {
741
+ // ref: refNumberRef,
742
+ // },
743
+ // }}
744
+ // />
745
+ // </FormControl>
746
+ // </Grid>
747
+ // <Grid xs={12}>
748
+ // <NerdDatePicker
749
+ // value={pickupDate}
750
+ // onChange={(newVal) => setPickupDate(newVal)}
751
+ // label={t("entities:load.others.pickup_date")}
752
+ // />
753
+ // </Grid>
754
+ // <Grid xs={12}>
755
+ // <FormControl>
756
+ // <FormLabel>{t("entities:load.others.total_rate")}</FormLabel>
757
+ // <NerdCurrencyField
758
+ // value={totalRate}
759
+ // onChange={(v) => setTotalRate(v)}
760
+ // maxDigitAfterDecimal={4}
761
+ // signed
762
+ // />
763
+ // </FormControl>
764
+ // </Grid>
765
+ // </Grid>
766
+ // <Box
767
+ // sx={{
768
+ // display: "flex",
769
+ // gap: 1,
770
+ // justifyContent: "flex-end",
771
+ // alignItems: "end",
772
+ // pt: 2,
773
+ // height: "100%",
774
+ // }}
775
+ // >
776
+ // <Button
777
+ // onClick={handleCloseDuplicate}
778
+ // color="neutral"
779
+ // variant="soft"
780
+ // >
781
+ // {t("global.Cancel")}
782
+ // </Button>
783
+ // <Button loading={duplicateLoading} onClick={handleDuplicate}>
784
+ // {t("global.duplicate")}
785
+ // </Button>
786
+ // </Box>
787
+ // </ModalDialog>
788
+ // </Modal>
789
+ // <DownloadDocumentModal
790
+ // open={openDownload}
791
+ // onClose={() => setOpenDownload(false)}
792
+ // />
793
+ // <Divider sx={{ height: 1 }} />
794
+ // </>
795
+ // );
267
796
  }
268
797
  const DownloadDocumentModal = ({ open, onClose, }) => {
269
- const { id } = useParams();
798
+ const id = useContext(LoadIDContext);
270
799
  const { t } = useTranslation("common", { i18n: salesKitI18n });
271
800
  const [type, setType] = useState("load_sheet");
272
801
  const params = {