@nerdjs/sales-kit 2.1.9 → 2.2.1
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.
- package/dist/entities/index.d.ts +4 -1
- package/dist/entities/index.js +4 -1
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/mapUpdate/helper.d.ts +1 -0
- package/dist/entities/mapUpdate/helper.js +9 -0
- package/dist/entities/mapUpdate/helper.js.map +1 -1
- package/dist/entities/mapUpdate/mapUpdate.d.ts +11 -22
- package/dist/entities/mapUpdate/mapUpdate.js +24 -28
- package/dist/entities/mapUpdate/mapUpdate.js.map +1 -1
- package/dist/entities/mapUpdateV1/helper.d.ts +5 -0
- package/dist/entities/mapUpdateV1/helper.js +16 -0
- package/dist/entities/mapUpdateV1/helper.js.map +1 -0
- package/dist/entities/mapUpdateV1/index.d.ts +2 -0
- package/dist/entities/mapUpdateV1/index.js +3 -0
- package/dist/entities/mapUpdateV1/index.js.map +1 -0
- package/dist/entities/mapUpdateV1/mapUpdateV1.d.ts +28 -0
- package/dist/entities/mapUpdateV1/mapUpdateV1.js +41 -0
- package/dist/entities/mapUpdateV1/mapUpdateV1.js.map +1 -0
- package/dist/entities/quoteV1/helper.d.ts +5 -0
- package/dist/entities/quoteV1/helper.js +16 -0
- package/dist/entities/quoteV1/helper.js.map +1 -0
- package/dist/entities/quoteV1/index.d.ts +2 -0
- package/dist/entities/quoteV1/index.js +3 -0
- package/dist/entities/quoteV1/index.js.map +1 -0
- package/dist/entities/quoteV1/quoteV1.d.ts +126 -0
- package/dist/entities/quoteV1/quoteV1.js +279 -0
- package/dist/entities/quoteV1/quoteV1.js.map +1 -0
- package/dist/entities/rejectionReason/helper.d.ts +5 -0
- package/dist/entities/rejectionReason/helper.js +16 -0
- package/dist/entities/rejectionReason/helper.js.map +1 -0
- package/dist/entities/rejectionReason/index.d.ts +2 -0
- package/dist/entities/rejectionReason/index.js +3 -0
- package/dist/entities/rejectionReason/index.js.map +1 -0
- package/dist/entities/rejectionReason/rejectionReason.d.ts +8 -0
- package/dist/entities/rejectionReason/rejectionReason.js +33 -0
- package/dist/entities/rejectionReason/rejectionReason.js.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/lep/checkList.d.ts +10 -0
- package/dist/hooks/lep/checkList.js +114 -0
- package/dist/hooks/lep/checkList.js.map +1 -0
- package/dist/hooks/lep/constants.d.ts +7 -0
- package/dist/hooks/lep/constants.js +56 -0
- package/dist/hooks/lep/constants.js.map +1 -0
- package/dist/hooks/lep/helpers.d.ts +4 -0
- package/dist/hooks/lep/helpers.js +45 -0
- package/dist/hooks/lep/helpers.js.map +1 -0
- package/dist/hooks/lep/index.d.ts +42 -0
- package/dist/hooks/lep/index.js +43 -0
- package/dist/hooks/lep/index.js.map +1 -0
- package/dist/hooks/lep/lepAccessorials.d.ts +7 -0
- package/dist/hooks/lep/lepAccessorials.js +213 -0
- package/dist/hooks/lep/lepAccessorials.js.map +1 -0
- package/dist/hooks/lep/lepActionBar.d.ts +10 -0
- package/dist/hooks/lep/lepActionBar.js +345 -0
- package/dist/hooks/lep/lepActionBar.js.map +1 -0
- package/dist/hooks/lep/lepAdjustments.d.ts +7 -0
- package/dist/hooks/lep/lepAdjustments.js +266 -0
- package/dist/hooks/lep/lepAdjustments.js.map +1 -0
- package/dist/hooks/lep/lepAppointmentArrivals.d.ts +6 -0
- package/dist/hooks/lep/lepAppointmentArrivals.js +103 -0
- package/dist/hooks/lep/lepAppointmentArrivals.js.map +1 -0
- package/dist/hooks/lep/lepClaims.d.ts +6 -0
- package/dist/hooks/lep/lepClaims.js +472 -0
- package/dist/hooks/lep/lepClaims.js.map +1 -0
- package/dist/hooks/lep/lepCommodities.d.ts +6 -0
- package/dist/hooks/lep/lepCommodities.js +473 -0
- package/dist/hooks/lep/lepCommodities.js.map +1 -0
- package/dist/hooks/lep/lepComponents.d.ts +7 -0
- package/dist/hooks/lep/lepComponents.js +13 -0
- package/dist/hooks/lep/lepComponents.js.map +1 -0
- package/dist/hooks/lep/lepConsolidations.d.ts +6 -0
- package/dist/hooks/lep/lepConsolidations.js +89 -0
- package/dist/hooks/lep/lepConsolidations.js.map +1 -0
- package/dist/hooks/lep/lepCustomerContacts.d.ts +6 -0
- package/dist/hooks/lep/lepCustomerContacts.js +418 -0
- package/dist/hooks/lep/lepCustomerContacts.js.map +1 -0
- package/dist/hooks/lep/lepCustomerInfo.d.ts +6 -0
- package/dist/hooks/lep/lepCustomerInfo.js +66 -0
- package/dist/hooks/lep/lepCustomerInfo.js.map +1 -0
- package/dist/hooks/lep/lepCustomerPeople.d.ts +6 -0
- package/dist/hooks/lep/lepCustomerPeople.js +293 -0
- package/dist/hooks/lep/lepCustomerPeople.js.map +1 -0
- package/dist/hooks/lep/lepCustomerSalesNotes.d.ts +6 -0
- package/dist/hooks/lep/lepCustomerSalesNotes.js +51 -0
- package/dist/hooks/lep/lepCustomerSalesNotes.js.map +1 -0
- package/dist/hooks/lep/lepCustomersAccessorials.d.ts +5 -0
- package/dist/hooks/lep/lepCustomersAccessorials.js +160 -0
- package/dist/hooks/lep/lepCustomersAccessorials.js.map +1 -0
- package/dist/hooks/lep/lepDateInputCell.d.ts +8 -0
- package/dist/hooks/lep/lepDateInputCell.js +48 -0
- package/dist/hooks/lep/lepDateInputCell.js.map +1 -0
- package/dist/hooks/lep/lepDispatches.d.ts +13 -0
- package/dist/hooks/lep/lepDispatches.js +206 -0
- package/dist/hooks/lep/lepDispatches.js.map +1 -0
- package/dist/hooks/lep/lepDocuments.d.ts +6 -0
- package/dist/hooks/lep/lepDocuments.js +304 -0
- package/dist/hooks/lep/lepDocuments.js.map +1 -0
- package/dist/hooks/lep/lepEDI.d.ts +11 -0
- package/dist/hooks/lep/lepEDI.js +226 -0
- package/dist/hooks/lep/lepEDI.js.map +1 -0
- package/dist/hooks/lep/lepHosLogs.d.ts +4 -0
- package/dist/hooks/lep/lepHosLogs.js +134 -0
- package/dist/hooks/lep/lepHosLogs.js.map +1 -0
- package/dist/hooks/lep/lepInvoiceAdjustment.d.ts +1 -0
- package/dist/hooks/lep/lepInvoiceAdjustment.js +101 -0
- package/dist/hooks/lep/lepInvoiceAdjustment.js.map +1 -0
- package/dist/hooks/lep/lepInvoiceDetails.d.ts +1 -0
- package/dist/hooks/lep/lepInvoiceDetails.js +185 -0
- package/dist/hooks/lep/lepInvoiceDetails.js.map +1 -0
- package/dist/hooks/lep/lepInvoiceLineItems.d.ts +6 -0
- package/dist/hooks/lep/lepInvoiceLineItems.js +124 -0
- package/dist/hooks/lep/lepInvoiceLineItems.js.map +1 -0
- package/dist/hooks/lep/lepKickbacks.d.ts +6 -0
- package/dist/hooks/lep/lepKickbacks.js +436 -0
- package/dist/hooks/lep/lepKickbacks.js.map +1 -0
- package/dist/hooks/lep/lepLoadChanges.d.ts +6 -0
- package/dist/hooks/lep/lepLoadChanges.js +67 -0
- package/dist/hooks/lep/lepLoadChanges.js.map +1 -0
- package/dist/hooks/lep/lepLoadInfo.d.ts +6 -0
- package/dist/hooks/lep/lepLoadInfo.js +246 -0
- package/dist/hooks/lep/lepLoadInfo.js.map +1 -0
- package/dist/hooks/lep/lepLoadLocation.d.ts +3 -0
- package/dist/hooks/lep/lepLoadLocation.js +189 -0
- package/dist/hooks/lep/lepLoadLocation.js.map +1 -0
- package/dist/hooks/lep/lepLoadNotes.d.ts +6 -0
- package/dist/hooks/lep/lepLoadNotes.js +43 -0
- package/dist/hooks/lep/lepLoadNotes.js.map +1 -0
- package/dist/hooks/lep/lepNotifications.d.ts +6 -0
- package/dist/hooks/lep/lepNotifications.js +105 -0
- package/dist/hooks/lep/lepNotifications.js.map +1 -0
- package/dist/hooks/lep/lepPossibleIssues.d.ts +6 -0
- package/dist/hooks/lep/lepPossibleIssues.js +140 -0
- package/dist/hooks/lep/lepPossibleIssues.js.map +1 -0
- package/dist/hooks/lep/lepQuoteResult.d.ts +1 -0
- package/dist/hooks/lep/lepQuoteResult.js +58 -0
- package/dist/hooks/lep/lepQuoteResult.js.map +1 -0
- package/dist/hooks/lep/lepRateLogs.d.ts +6 -0
- package/dist/hooks/lep/lepRateLogs.js +216 -0
- package/dist/hooks/lep/lepRateLogs.js.map +1 -0
- package/dist/hooks/lep/lepRateReviews.d.ts +6 -0
- package/dist/hooks/lep/lepRateReviews.js +183 -0
- package/dist/hooks/lep/lepRateReviews.js.map +1 -0
- package/dist/hooks/lep/lepShipcons.d.ts +13 -0
- package/dist/hooks/lep/lepShipcons.js +1353 -0
- package/dist/hooks/lep/lepShipcons.js.map +1 -0
- package/dist/hooks/lep/lepStyledDataGrid.d.ts +10 -0
- package/dist/hooks/lep/lepStyledDataGrid.js +82 -0
- package/dist/hooks/lep/lepStyledDataGrid.js.map +1 -0
- package/dist/hooks/lep/lepTendersWidget.d.ts +6 -0
- package/dist/hooks/lep/lepTendersWidget.js +100 -0
- package/dist/hooks/lep/lepTendersWidget.js.map +1 -0
- package/dist/hooks/lep/lepTimeInputCell.d.ts +8 -0
- package/dist/hooks/lep/lepTimeInputCell.js +48 -0
- package/dist/hooks/lep/lepTimeInputCell.js.map +1 -0
- package/dist/hooks/lep/lepUserNotes.d.ts +13 -0
- package/dist/hooks/lep/lepUserNotes.js +185 -0
- package/dist/hooks/lep/lepUserNotes.js.map +1 -0
- package/dist/hooks/lep/lepWidget.d.ts +14 -0
- package/dist/hooks/lep/lepWidget.js +62 -0
- package/dist/hooks/lep/lepWidget.js.map +1 -0
- package/dist/hooks/lep/lepWorkflowEvents.d.ts +6 -0
- package/dist/hooks/lep/lepWorkflowEvents.js +85 -0
- package/dist/hooks/lep/lepWorkflowEvents.js.map +1 -0
- package/dist/hooks/lep/loadEditPanel.d.ts +10 -0
- package/dist/hooks/lep/loadEditPanel.js +580 -0
- package/dist/hooks/lep/loadEditPanel.js.map +1 -0
- package/dist/hooks/lep/nerdMap/nerdMap.d.ts +10 -0
- package/dist/hooks/lep/nerdMap/nerdMap.js +69 -0
- package/dist/hooks/lep/nerdMap/nerdMap.js.map +1 -0
- package/dist/hooks/lep/virtualizedAutocompleteList.d.ts +9 -0
- package/dist/hooks/lep/virtualizedAutocompleteList.js +42 -0
- package/dist/hooks/lep/virtualizedAutocompleteList.js.map +1 -0
- package/dist/hooks/load/loadDrawer.d.ts +4 -0
- package/dist/hooks/load/loadDrawer.js +7 -26
- package/dist/hooks/load/loadDrawer.js.map +1 -1
- package/dist/hooks/load/loadsSearchInput.js +48 -8
- package/dist/hooks/load/loadsSearchInput.js.map +1 -1
- package/dist/hooks/quote/form.js +3 -3
- package/dist/hooks/quote/form.js.map +1 -1
- package/dist/hooks/quote/helpers.js +1 -1
- package/dist/hooks/quote/helpers.js.map +1 -1
- package/dist/hooks/quote/result.js +2 -2
- package/dist/hooks/quote/result.js.map +1 -1
- package/dist/redux/api/salesApi.d.ts +1 -1
- package/dist/redux/api/salesApi.js +3 -0
- package/dist/redux/api/salesApi.js.map +1 -1
- package/dist/redux/apiTender/apiTenderEndpoints.d.ts +14 -10
- package/dist/redux/appointmentArrival/appointmentArrivalEndpoints.d.ts +16 -12
- package/dist/redux/appointmentIssue/appointmentIssueEndpoints.d.ts +14 -10
- package/dist/redux/appointmentIssueCategory/appointmentIssueCategoryEndpoints.d.ts +15 -11
- package/dist/redux/appointmentIssueSubcategory/appointmentIssueSubcategoryEndpoints.d.ts +14 -10
- package/dist/redux/appointmentNote/appointmentNoteEndpoints.d.ts +14 -10
- package/dist/redux/appointmentNoteType/appointmentNoteTypeEndpoints.d.ts +14 -10
- package/dist/redux/appointmentTrip/appointmentTripEndpoints.d.ts +14 -10
- package/dist/redux/archerFile/archerFileEndpoints.d.ts +13 -13
- package/dist/redux/asset/assetEndpoints.d.ts +20 -12
- package/dist/redux/billingKickback/billingKickbackEndpoints.d.ts +15 -11
- package/dist/redux/billingKickbackResponse/billingKickbackResponseEndpoints.d.ts +14 -10
- package/dist/redux/billingKickbackResponseAccessorial/billingKickbackResponseAccessorialEndpoints.d.ts +14 -10
- package/dist/redux/billingMessage/billingMessageEndpoints.d.ts +13 -9
- package/dist/redux/billingNote/billingNoteEndpoints.d.ts +14 -10
- package/dist/redux/cargoConsolidation/cargoConsolidationEndpoints.d.ts +23 -19
- package/dist/redux/cargoConsolidationCommodityPiece/cargoConsolidationCommodityPieceEndpoints.d.ts +14 -10
- package/dist/redux/carrierName/carrierNameEndpoints.d.ts +21 -13
- package/dist/redux/carrierPayContract/carrierPayContractEndpoints.d.ts +14 -10
- package/dist/redux/carrierTender/carrierTenderEndpoints.d.ts +21 -17
- package/dist/redux/carrierTenderAccessorial/carrierTenderAccessorialEndpoints.d.ts +14 -10
- package/dist/redux/carrierTenderDeduction/carrierTenderDeductionEndpoints.d.ts +14 -10
- package/dist/redux/carrierTenderEdge/carrierTenderEdgeEndpoints.d.ts +13 -9
- package/dist/redux/claim/claimEndpoints.d.ts +20 -16
- package/dist/redux/claimStatus/claimStatusEndpoints.d.ts +13 -9
- package/dist/redux/commoditiesTasksSlice/commoditiesTasksSelectors.d.ts +11 -0
- package/dist/redux/commoditiesTasksSlice/commoditiesTasksSelectors.js +6 -0
- package/dist/redux/commoditiesTasksSlice/commoditiesTasksSelectors.js.map +1 -0
- package/dist/redux/commoditiesTasksSlice/commoditiesTasksSlice.d.ts +19 -0
- package/dist/redux/commoditiesTasksSlice/commoditiesTasksSlice.js +22 -0
- package/dist/redux/commoditiesTasksSlice/commoditiesTasksSlice.js.map +1 -0
- package/dist/redux/commodity/commodityEndpoints.d.ts +14 -10
- package/dist/redux/commodityV1/commodityV1Endpoints.d.ts +15 -11
- package/dist/redux/companyLocation/companyLocationEndpoints.d.ts +14 -10
- package/dist/redux/contact/contactEndpoints.d.ts +10 -10
- package/dist/redux/contract/contractEndpoints.d.ts +14 -10
- package/dist/redux/contractsRecord/contractsRecordEndpoints.d.ts +16 -12
- package/dist/redux/customer/customerEndpoints.d.ts +21 -17
- package/dist/redux/customerContract/customerContractEndpoints.d.ts +14 -10
- package/dist/redux/customersAccessorial/customersAccessorialEndpoints.d.ts +9 -9
- package/dist/redux/deduction/deductionEndpoints.d.ts +13 -9
- package/dist/redux/departmentPhone/departmentPhoneEndpoints.d.ts +14 -10
- package/dist/redux/dispatch/dispatchEndpoints.d.ts +14 -10
- package/dist/redux/driver/driverEndpoints.d.ts +14 -10
- package/dist/redux/driverName/driverNameEndpoints.d.ts +13 -9
- package/dist/redux/driverV1/driverV1Endpoints.d.ts +13 -9
- package/dist/redux/employeeName/employeeNameEndpoints.d.ts +13 -9
- package/dist/redux/flag/flagEndpoints.d.ts +13 -9
- package/dist/redux/generalLedgerAccount/generalLedgerAccountEndpoints.d.ts +14 -10
- package/dist/redux/genericTender/genericTenderEndpoints.d.ts +16 -10
- package/dist/redux/genericTender/genericTenderEndpoints.js +3 -2
- package/dist/redux/genericTender/genericTenderEndpoints.js.map +1 -1
- package/dist/redux/holiday/holidayEndpoints.d.ts +14 -10
- package/dist/redux/index.d.ts +6 -0
- package/dist/redux/index.js +6 -0
- package/dist/redux/index.js.map +1 -1
- package/dist/redux/invoice/invoiceEndpoints.d.ts +14 -10
- package/dist/redux/invoiceAdjustment/invoiceAdjustmentEndpoints.d.ts +14 -10
- package/dist/redux/invoiceV1/invoiceV1Endpoints.d.ts +15 -11
- package/dist/redux/lep/index.d.ts +2 -0
- package/dist/redux/lep/index.js +3 -0
- package/dist/redux/lep/index.js.map +1 -0
- package/dist/redux/lep/lepSelectors.d.ts +38 -0
- package/dist/redux/lep/lepSelectors.js +43 -0
- package/dist/redux/lep/lepSelectors.js.map +1 -0
- package/dist/redux/lep/lepSlice.d.ts +24 -0
- package/dist/redux/lep/lepSlice.js +34 -0
- package/dist/redux/lep/lepSlice.js.map +1 -0
- package/dist/redux/load/loadDrawerSlice.d.ts +4 -5
- package/dist/redux/load/loadDrawerSlice.js +6 -6
- package/dist/redux/load/loadDrawerSlice.js.map +1 -1
- package/dist/redux/load/loadEndpoints.d.ts +16 -12
- package/dist/redux/loadAdjustment/loadAdjustmentEndpoints.d.ts +14 -10
- package/dist/redux/loadAdjustmentV1/loadAdjustmentV1Endpoints.d.ts +14 -10
- package/dist/redux/loadInfoTasksSlice/index.d.ts +2 -0
- package/dist/redux/loadInfoTasksSlice/index.js +3 -0
- package/dist/redux/loadInfoTasksSlice/index.js.map +1 -0
- package/dist/redux/loadInfoTasksSlice/loadInfoTasksSelectors.d.ts +11 -0
- package/dist/redux/loadInfoTasksSlice/loadInfoTasksSelectors.js +6 -0
- package/dist/redux/loadInfoTasksSlice/loadInfoTasksSelectors.js.map +1 -0
- package/dist/redux/loadInfoTasksSlice/loadInfoTasksSlice.d.ts +20 -0
- package/dist/redux/loadInfoTasksSlice/loadInfoTasksSlice.js +22 -0
- package/dist/redux/loadInfoTasksSlice/loadInfoTasksSlice.js.map +1 -0
- package/dist/redux/loadTender/loadTenderEndpoints.d.ts +16 -12
- package/dist/redux/loadTenderView/index.d.ts +2 -0
- package/dist/redux/loadTenderView/index.js +3 -0
- package/dist/redux/loadTenderView/index.js.map +1 -0
- package/dist/redux/loadTenderView/loadTenderViewEndpoints.d.ts +45 -0
- package/dist/redux/loadTenderView/loadTenderViewEndpoints.js +63 -0
- package/dist/redux/loadTenderView/loadTenderViewEndpoints.js.map +1 -0
- package/dist/redux/loadV1/loadV1Endpoints.d.ts +62 -58
- package/dist/redux/location/locationEndpoints.d.ts +19 -15
- package/dist/redux/locationV1/locationV1Endpoints.d.ts +23 -19
- package/dist/redux/manualCheckCall/manualCheckCallEndpoints.d.ts +14 -10
- package/dist/redux/mapUpdate/index.d.ts +2 -0
- package/dist/redux/mapUpdate/index.js +3 -0
- package/dist/redux/mapUpdate/index.js.map +1 -0
- package/dist/redux/mapUpdate/mapUpdateEndpoints.d.ts +6 -0
- package/dist/redux/mapUpdate/mapUpdateEndpoints.js +15 -0
- package/dist/redux/mapUpdate/mapUpdateEndpoints.js.map +1 -0
- package/dist/redux/nmfcClass/nmfcClassEndpoints.d.ts +13 -9
- package/dist/redux/nodeName/nodeNameEndpoints.d.ts +14 -10
- package/dist/redux/notification/notificationEndpoints.d.ts +17 -13
- package/dist/redux/otrDispatch/otrDispatchEndpoints.d.ts +27 -23
- package/dist/redux/person/personEndpoints.d.ts +16 -12
- package/dist/redux/personName/personNameEndpoints.d.ts +14 -10
- package/dist/redux/position/positionEndpoints.d.ts +14 -10
- package/dist/redux/possibleIssueItem/possibleIssueItemEndpoints.d.ts +13 -9
- package/dist/redux/quote/index.d.ts +3 -2
- package/dist/redux/quote/index.js +3 -2
- package/dist/redux/quote/index.js.map +1 -1
- package/dist/redux/quote/quoteAction.d.ts +10 -4
- package/dist/redux/quote/quoteAction.js +9 -0
- package/dist/redux/quote/quoteAction.js.map +1 -1
- package/dist/redux/quote/quoteCustomerPortalEndpoints.d.ts +38 -0
- package/dist/redux/quote/quoteCustomerPortalEndpoints.js +83 -0
- package/dist/redux/quote/quoteCustomerPortalEndpoints.js.map +1 -0
- package/dist/redux/quote/quoteHooks.d.ts +6 -21
- package/dist/redux/quote/quoteHooks.js +3 -3
- package/dist/redux/quote/quoteHooks.js.map +1 -1
- package/dist/redux/quote/quoteReducer.d.ts +27 -0
- package/dist/redux/quote/quoteReducer.js +6 -1
- package/dist/redux/quote/quoteReducer.js.map +1 -1
- package/dist/redux/quote/quoteSalesEndpoints.d.ts +70 -0
- package/dist/redux/quote/{quoteEndpoints.js → quoteSalesEndpoints.js} +23 -43
- package/dist/redux/quote/quoteSalesEndpoints.js.map +1 -0
- package/dist/redux/quote/{quoteSelector.d.ts → quoteSelectors.d.ts} +5 -0
- package/dist/redux/quote/{quoteSelector.js → quoteSelectors.js} +3 -1
- package/dist/redux/quote/quoteSelectors.js.map +1 -0
- package/dist/redux/quoteAccessorial/quoteAccessorialEndpoints.d.ts +9 -9
- package/dist/redux/quoteAccessorialV1/quoteAccessorialV1Endpoints.d.ts +14 -10
- package/dist/redux/rateReview/rateReviewEndpoints.d.ts +14 -10
- package/dist/redux/rejectionReason/index.d.ts +2 -0
- package/dist/redux/rejectionReason/index.js +3 -0
- package/dist/redux/rejectionReason/index.js.map +1 -0
- package/dist/redux/rejectionReason/rejectionReasonEndpoints.d.ts +29 -0
- package/dist/redux/rejectionReason/rejectionReasonEndpoints.js +67 -0
- package/dist/redux/rejectionReason/rejectionReasonEndpoints.js.map +1 -0
- package/dist/redux/relayCode/relayCodeEndpoints.d.ts +15 -11
- package/dist/redux/salesKitReducer.d.ts +12 -0
- package/dist/redux/salesKitReducer.js +8 -0
- package/dist/redux/salesKitReducer.js.map +1 -1
- package/dist/redux/shipConDispatch/shipConDispatchEndpoints.d.ts +15 -11
- package/dist/redux/shipConETA/shipConETAEndpoints.d.ts +14 -10
- package/dist/redux/shipcon/shipconEndpoints.d.ts +15 -11
- package/dist/redux/shipconV1/shipconV1Endpoints.d.ts +23 -19
- package/dist/redux/shipconV1/shipconV1Endpoints.js.map +1 -1
- package/dist/redux/shipconsTasksSlice/index.d.ts +2 -0
- package/dist/redux/shipconsTasksSlice/index.js +3 -0
- package/dist/redux/shipconsTasksSlice/index.js.map +1 -0
- package/dist/redux/shipconsTasksSlice/shipconsTasksSelectors.d.ts +11 -0
- package/dist/redux/shipconsTasksSlice/shipconsTasksSelectors.js +6 -0
- package/dist/redux/shipconsTasksSlice/shipconsTasksSelectors.js.map +1 -0
- package/dist/redux/shipconsTasksSlice/shipconsTasksSlice.d.ts +19 -0
- package/dist/redux/shipconsTasksSlice/shipconsTasksSlice.js +22 -0
- package/dist/redux/shipconsTasksSlice/shipconsTasksSlice.js.map +1 -0
- package/dist/redux/tender/tenderEndpoints.d.ts +9 -9
- package/dist/redux/trailerAvailability/customerEndpoints.d.ts +4 -4
- package/dist/redux/trailerCode/trailerCodeEndpoints.d.ts +13 -9
- package/dist/redux/unitV1/unitV1Endpoints.d.ts +13 -9
- package/dist/redux/userNoteV1/userNoteV1Endpoints.d.ts +14 -10
- package/package.json +5 -2
- package/dist/redux/quote/quoteEndpoints.d.ts +0 -82
- package/dist/redux/quote/quoteEndpoints.js.map +0 -1
- package/dist/redux/quote/quoteSelector.js.map +0 -1
|
@@ -0,0 +1,1353 @@
|
|
|
1
|
+
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Autocomplete, AutocompleteOption, Button, Checkbox, CircularProgress, FormControl, FormLabel, Grid, Input, ListItemContent, Modal, ModalDialog, Option, Select, Skeleton, Switch, Textarea, Typography, Box, Tooltip, Sheet, } from "@mui/joy";
|
|
4
|
+
import { Popper } from "@mui/base";
|
|
5
|
+
import { ListItemIcon, Menu, MenuItem } from "@mui/material";
|
|
6
|
+
import { CopyInputDecorator, NerdDatePicker, NerdTimePicker, showNotification, } from "@nerdjs/nerd-ui";
|
|
7
|
+
import { DateTime } from "luxon";
|
|
8
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
9
|
+
import { useTranslation } from "react-i18next";
|
|
10
|
+
import { useParams } from "react-router-dom";
|
|
11
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
12
|
+
import { LepDateInputCell } from "./lepDateInputCell";
|
|
13
|
+
import { LepTimeInputCell } from "./lepTimeInputCell";
|
|
14
|
+
import { VirtualizedAutocompleteList } from "./virtualizedAutocompleteList";
|
|
15
|
+
import { addShipconsTask, setShipconsTasks, } from "../../redux/shipconsTasksSlice/shipconsTasksSlice";
|
|
16
|
+
import { nanoid } from "@reduxjs/toolkit";
|
|
17
|
+
import { GridActionsCellItem, useGridApiRef, } from "@mui/x-data-grid-premium";
|
|
18
|
+
import { LepStyledDataGrid } from "./lepStyledDataGrid";
|
|
19
|
+
import { NerdEmailValidator, useGetCurrentUserQuery, } from "@nerdjs/account-kit";
|
|
20
|
+
import { quoteRecalculateBodySelector } from "../../redux/quote/quoteSelectors";
|
|
21
|
+
import { setRecalculateBody } from "../../redux/quote";
|
|
22
|
+
import { addLoadInfoTask } from "../../redux/loadInfoTasksSlice/loadInfoTasksSlice";
|
|
23
|
+
import { getCSRS } from "./helpers";
|
|
24
|
+
import { locationEntityTypeGuard, Person, } from "../../entities";
|
|
25
|
+
import { useGetShipconsQuery, useGetLoadQuery, useGetPeopleQuery, useGetCustomerPeopleQuery, useUpdateShipconV1Mutation, useDeleteShipconV1Mutation, useReorderShipconsMutation, getShipconsSelectors, useShipconCreateUserNoteMutation, useEmailArcherFileMutation, useGetLoadFilesQuery, useGetShipconQuery, useCreateShipconV1Mutation, useGetAppointmentNotesQuery, getAppointmentNotesSelectors, useGetAppointmentNoteTypesQuery, useGetLocationV1Query, useUpdateLocationV1Mutation, useCreateAppointmentIssueMutation, useGetAppointmentIssueCategoryFilteredByRoleQuery, useLazyGetAppointmentIssueSubcategoriesQuery, getAppointmentIssueSubcategoriesSelectors, useGetCarrierNamesLiteQuery, useGetNodeNamesQuery, getNodeNamesSelectors, useGetDriverNamesQuery, getDriverNamesSelectors, getPeopleSelectors, useUpdateLoadV1Mutation, } from "../../redux";
|
|
26
|
+
import { LocationFormSales } from "../locationsForm";
|
|
27
|
+
import { LocationInputCell, LocationCell, LocationInput } from "../quote";
|
|
28
|
+
const KEYS_MAP = {
|
|
29
|
+
stopNumber: "stop_number",
|
|
30
|
+
shipConsType: "ship_cons_type",
|
|
31
|
+
dropStop: "drop_stop",
|
|
32
|
+
standbyAppointment: "standby_appointment",
|
|
33
|
+
stopDate: "stop_date",
|
|
34
|
+
timeFrom: "time_from",
|
|
35
|
+
timeTo: "time_to",
|
|
36
|
+
locationID: "location_id",
|
|
37
|
+
referenceNumber: "reference_number",
|
|
38
|
+
confirmationNumber: "confirmation_number",
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* LepShipcons
|
|
42
|
+
*
|
|
43
|
+
* @returns {null} LepShipcons
|
|
44
|
+
*/
|
|
45
|
+
export function LepShipcons({ quoteRoute }) {
|
|
46
|
+
const { id } = useParams();
|
|
47
|
+
const params = {
|
|
48
|
+
filters: JSON.stringify([
|
|
49
|
+
{ name: "ship_cons.load_id", comparison: "eq", value: id },
|
|
50
|
+
]),
|
|
51
|
+
sorter: JSON.stringify([{ name: "ship_cons.stop_number", asc: true }]),
|
|
52
|
+
};
|
|
53
|
+
const { isLoading } = useGetShipconsQuery(params, {
|
|
54
|
+
skip: Number.isNaN(Number(id)),
|
|
55
|
+
});
|
|
56
|
+
const { data: load, isLoading: isLoadingLoad } = useGetLoadQuery(Number(id), {
|
|
57
|
+
skip: Number.isNaN(Number(id)),
|
|
58
|
+
});
|
|
59
|
+
const params2 = {
|
|
60
|
+
filters: JSON.stringify([
|
|
61
|
+
{ name: "people.company_id", comparison: "eq", value: 1 },
|
|
62
|
+
{ name: "people.active", comparison: "eq", value: true },
|
|
63
|
+
]),
|
|
64
|
+
};
|
|
65
|
+
const { isFetching } = useGetPeopleQuery(params2);
|
|
66
|
+
const { isFetching: isFetchingContacts } = useGetCustomerPeopleQuery(load?.customerID || 0, {
|
|
67
|
+
skip: !load?.customerID,
|
|
68
|
+
});
|
|
69
|
+
if (isLoading || isFetchingContacts || isFetching || isLoadingLoad) {
|
|
70
|
+
return (_jsxs(Box, { height: "100%", children: [_jsx(Box, { display: "flex", sx: {
|
|
71
|
+
mb: 1,
|
|
72
|
+
}, children: _jsx(Box, { ml: { xs: "0", lg: "auto" }, children: _jsxs(Grid, { container: true, spacing: 1, alignItems: "center", children: [_jsx(Grid, { xs: 12, md: "auto", children: _jsx(Skeleton, { variant: "rectangular", width: 160, height: 35 }) }), _jsx(Grid, { xs: 12, md: "auto", children: _jsx(Skeleton, { variant: "rectangular", width: 160, height: 35 }) }), _jsx(Grid, { xs: 12, md: "auto", children: _jsx(Skeleton, { variant: "rectangular", width: 100, height: 35 }) })] }) }) }), _jsx(Skeleton, { variant: "rectangular", width: "100%", height: 80 }), _jsx(Box, { display: "flex", sx: {
|
|
73
|
+
mt: 2,
|
|
74
|
+
mb: 1,
|
|
75
|
+
}, children: _jsx(Skeleton, { variant: "rectangular", width: 92, height: 28 }) })] }));
|
|
76
|
+
}
|
|
77
|
+
else
|
|
78
|
+
return _jsx(Content, { quoteRoute: quoteRoute });
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* LepShipcons
|
|
82
|
+
*
|
|
83
|
+
* @returns {null} LepShipcons
|
|
84
|
+
*/
|
|
85
|
+
function Content({ quoteRoute }) {
|
|
86
|
+
const { t } = useTranslation();
|
|
87
|
+
const dispatch = useDispatch();
|
|
88
|
+
const [updateShipcon] = useUpdateShipconV1Mutation();
|
|
89
|
+
const [deleteShipcon] = useDeleteShipconV1Mutation();
|
|
90
|
+
const [reorderShipcons] = useReorderShipconsMutation();
|
|
91
|
+
const { id } = useParams();
|
|
92
|
+
const params = {
|
|
93
|
+
filters: JSON.stringify([
|
|
94
|
+
{ name: "ship_cons.load_id", comparison: "eq", value: id },
|
|
95
|
+
]),
|
|
96
|
+
sorter: JSON.stringify([{ name: "ship_cons.stop_number", asc: true }]),
|
|
97
|
+
};
|
|
98
|
+
const { isFetching } = useGetShipconsQuery(params, {
|
|
99
|
+
skip: Number.isNaN(Number(id)),
|
|
100
|
+
});
|
|
101
|
+
const selectAllShipcons = useMemo(() => getShipconsSelectors(params).selectAll, [params]);
|
|
102
|
+
const shipcons = useSelector(selectAllShipcons);
|
|
103
|
+
const apiRef = useGridApiRef();
|
|
104
|
+
const [aptNotesShipConID, setAptNotesShipConID] = useState(null);
|
|
105
|
+
const [contactLocationID, setContactLocationID] = useState(null);
|
|
106
|
+
const [notesLocationID, setNotesLocationID] = useState(null);
|
|
107
|
+
const [issueShipconID, setIssueShipconID] = useState();
|
|
108
|
+
const [showIssuesShipconID, setShowIssuesShipconID] = useState(null);
|
|
109
|
+
const [stagedShipcon, setStagedShipcon] = useState(null);
|
|
110
|
+
const [scheduleEmailStagedShipcon, setScheduleEmailStagedShipcon] = useState(null);
|
|
111
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
112
|
+
const [createNote] = useShipconCreateUserNoteMutation();
|
|
113
|
+
const openSchedulingMenu = Boolean(anchorEl);
|
|
114
|
+
const handleClose = () => {
|
|
115
|
+
setAnchorEl(null);
|
|
116
|
+
setStagedShipcon(null);
|
|
117
|
+
};
|
|
118
|
+
const [locationFormOpen, setLocationFormOpen] = useState({
|
|
119
|
+
open: false,
|
|
120
|
+
place: undefined,
|
|
121
|
+
});
|
|
122
|
+
const onRowUpdate = (newRow, oldRow) => {
|
|
123
|
+
const body = {};
|
|
124
|
+
Object.keys(newRow).forEach((key) => {
|
|
125
|
+
const k = key;
|
|
126
|
+
if (oldRow[k] !== newRow[k])
|
|
127
|
+
body[KEYS_MAP[k] || k] = newRow[k];
|
|
128
|
+
});
|
|
129
|
+
if (Object.entries(body).length > 0 && newRow.id) {
|
|
130
|
+
return updateShipcon({
|
|
131
|
+
id: newRow.id,
|
|
132
|
+
body: { shipcon: body },
|
|
133
|
+
})
|
|
134
|
+
.unwrap()
|
|
135
|
+
.then(() => {
|
|
136
|
+
dispatch(addShipconsTask(test(newRow)));
|
|
137
|
+
return newRow;
|
|
138
|
+
})
|
|
139
|
+
.catch(() => {
|
|
140
|
+
return oldRow;
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
return oldRow;
|
|
144
|
+
};
|
|
145
|
+
const test = (s) => {
|
|
146
|
+
const task = {
|
|
147
|
+
label: "",
|
|
148
|
+
status: "warning",
|
|
149
|
+
uuid: nanoid(),
|
|
150
|
+
order: 2,
|
|
151
|
+
};
|
|
152
|
+
if (s.quoteCity?.toLowerCase() != s.city?.toLowerCase() ||
|
|
153
|
+
s.quoteState != s.state ||
|
|
154
|
+
s.quoteZip != s.zip) {
|
|
155
|
+
const label = `Stop #${s.stopNumber} city, state, or zip differs from the quote. Recalculate the quote.`;
|
|
156
|
+
task.label = label;
|
|
157
|
+
task.step = {
|
|
158
|
+
content: label,
|
|
159
|
+
selector: ".ShipconsTaskItem-recalculate",
|
|
160
|
+
};
|
|
161
|
+
task.status = "danger";
|
|
162
|
+
}
|
|
163
|
+
else if (!s.locationID || !s.address?.verified) {
|
|
164
|
+
const label = `Stop #${s.stopNumber} location is not verified.`;
|
|
165
|
+
task.label = label;
|
|
166
|
+
task.step = {
|
|
167
|
+
content: label,
|
|
168
|
+
selector: `.ShipconsTaskItem-${s.id}-location`,
|
|
169
|
+
};
|
|
170
|
+
task.status = "danger";
|
|
171
|
+
}
|
|
172
|
+
else if (!s.referenceNumber) {
|
|
173
|
+
const label = `Stop #${s.stopNumber} has no reference number (If no reference please note 'No PO')`;
|
|
174
|
+
task.label = label;
|
|
175
|
+
task.step = {
|
|
176
|
+
content: label,
|
|
177
|
+
selector: `.ShipconsTaskItem-${s.id}-referenceNumber`,
|
|
178
|
+
};
|
|
179
|
+
task.status = "danger";
|
|
180
|
+
}
|
|
181
|
+
else if (!s.stopDate) {
|
|
182
|
+
const label = `Stop #${s.stopNumber} has no scheduled date.`;
|
|
183
|
+
task.label = label;
|
|
184
|
+
task.step = {
|
|
185
|
+
content: label,
|
|
186
|
+
selector: `.ShipconsTaskItem-${s.id}-date`,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
else if ((s.shipConsType == "shipper" && !s.timeTo) || !s.timeFrom) {
|
|
190
|
+
const label = `Stop #${s.stopNumber} has no scheduled time.`;
|
|
191
|
+
task.label = label;
|
|
192
|
+
task.step = {
|
|
193
|
+
content: label,
|
|
194
|
+
selector: s.shipConsType === "shipper"
|
|
195
|
+
? ".LepPanelRoot"
|
|
196
|
+
: `.ShipconsTaskItem-${s.id}-startTime`,
|
|
197
|
+
highlightedSelectors: s.shipConsType === "shipper"
|
|
198
|
+
? [
|
|
199
|
+
`.ShipconsTaskItem-${s.id}-startTime`,
|
|
200
|
+
`.ShipconsTaskItem-${s.id}-endTime`,
|
|
201
|
+
]
|
|
202
|
+
: [],
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
task.label = `Stop #${s.stopNumber} is valid.`;
|
|
207
|
+
task.status = "success";
|
|
208
|
+
}
|
|
209
|
+
if (task.step)
|
|
210
|
+
task.tabIndex = 0;
|
|
211
|
+
return {
|
|
212
|
+
shipconID: s.id,
|
|
213
|
+
task,
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
useEffect(() => {
|
|
217
|
+
if (shipcons) {
|
|
218
|
+
let tasks = {};
|
|
219
|
+
shipcons.forEach((s) => {
|
|
220
|
+
const item = test(s);
|
|
221
|
+
tasks = { ...tasks, [item.shipconID]: item.task };
|
|
222
|
+
});
|
|
223
|
+
dispatch(setShipconsTasks(tasks));
|
|
224
|
+
setTimeout(() => apiRef.current?.autosizeColumns({
|
|
225
|
+
includeHeaders: true,
|
|
226
|
+
includeOutliers: true,
|
|
227
|
+
}), 200);
|
|
228
|
+
}
|
|
229
|
+
}, [shipcons]);
|
|
230
|
+
const handleDeleteShipcon = (id) => {
|
|
231
|
+
deleteShipcon(id);
|
|
232
|
+
};
|
|
233
|
+
const handleRowOrderChange = useCallback((params) => {
|
|
234
|
+
const rowsClone = [...shipcons];
|
|
235
|
+
const row = rowsClone.splice(params.oldIndex, 1)[0];
|
|
236
|
+
rowsClone.splice(params.targetIndex, 0, row);
|
|
237
|
+
reorderShipcons(rowsClone.map((r) => r.id));
|
|
238
|
+
}, [shipcons]);
|
|
239
|
+
const columns = useMemo(() => [
|
|
240
|
+
{
|
|
241
|
+
field: "stopNumber",
|
|
242
|
+
headerName: "Stop #",
|
|
243
|
+
editable: true,
|
|
244
|
+
sortable: false,
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
field: "shipConsType",
|
|
248
|
+
headerName: "Kind",
|
|
249
|
+
type: "singleSelect",
|
|
250
|
+
editable: true,
|
|
251
|
+
valueOptions: [
|
|
252
|
+
{ value: "shipper", label: "Shipper" },
|
|
253
|
+
{ value: "consignee", label: "Consignee" },
|
|
254
|
+
],
|
|
255
|
+
sortable: false,
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
field: "dropStop",
|
|
259
|
+
headerName: "Drop Stop",
|
|
260
|
+
type: "boolean",
|
|
261
|
+
renderCell(params) {
|
|
262
|
+
return params.value ? (_jsx("i", { className: "fa-solid fa-check" })) : (_jsx("i", { className: "fa-solid fa-xmark" }));
|
|
263
|
+
},
|
|
264
|
+
editable: true,
|
|
265
|
+
sortable: false,
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
field: "standbyAppointment",
|
|
269
|
+
headerName: "Standby apt",
|
|
270
|
+
type: "boolean",
|
|
271
|
+
renderCell(params) {
|
|
272
|
+
return params.value ? (_jsx("i", { className: "fa-solid fa-check" })) : (_jsx("i", { className: "fa-solid fa-xmark" }));
|
|
273
|
+
},
|
|
274
|
+
editable: true,
|
|
275
|
+
sortable: false,
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
field: "stopDate",
|
|
279
|
+
headerName: "Date",
|
|
280
|
+
minWidth: 162,
|
|
281
|
+
editable: true,
|
|
282
|
+
renderCell: (p) => p.row.stopDate
|
|
283
|
+
? DateTime.fromISO(p.row.stopDate).toUTC().toFormat("LL/dd/yyyy")
|
|
284
|
+
: "",
|
|
285
|
+
renderEditCell(params) {
|
|
286
|
+
return _jsx(LepDateInputCell, { ...params });
|
|
287
|
+
},
|
|
288
|
+
cellClassName: (p) => `ShipconsTaskItem-${p.id}-date`,
|
|
289
|
+
sortable: false,
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
field: "timeFrom",
|
|
293
|
+
headerName: "From",
|
|
294
|
+
editable: true,
|
|
295
|
+
minWidth: 102,
|
|
296
|
+
renderCell: (p) => p.row.timeFrom
|
|
297
|
+
? DateTime.fromISO(p.row.timeFrom).toUTC().toFormat("HH:mm")
|
|
298
|
+
: "",
|
|
299
|
+
renderEditCell(params) {
|
|
300
|
+
return _jsx(LepTimeInputCell, { ...params });
|
|
301
|
+
},
|
|
302
|
+
cellClassName: (p) => `ShipconsTaskItem-${p.id}-startTime`,
|
|
303
|
+
sortable: false,
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
field: "timeTo",
|
|
307
|
+
headerName: "To",
|
|
308
|
+
editable: true,
|
|
309
|
+
minWidth: 102,
|
|
310
|
+
renderCell: (p) => p.row.timeTo
|
|
311
|
+
? DateTime.fromISO(p.row.timeTo).toUTC().toFormat("HH:mm")
|
|
312
|
+
: "",
|
|
313
|
+
renderEditCell(params) {
|
|
314
|
+
return _jsx(LepTimeInputCell, { ...params });
|
|
315
|
+
},
|
|
316
|
+
cellClassName: (p) => p.row.shipConsType === "shipper"
|
|
317
|
+
? `ShipconsTaskItem-${p.id}-endTime`
|
|
318
|
+
: "",
|
|
319
|
+
sortable: false,
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
field: "locationID",
|
|
323
|
+
headerName: "Location",
|
|
324
|
+
renderEditCell: (p) => (_jsx(Box, { display: "flex", width: "100%", id: `location${p.row.id}${p.row.stopNumber}`, children: _jsx(LocationInputCell, { customerPortal: false, ...p, onEditLocationClick: (location, id, field) => {
|
|
325
|
+
setLocationFormOpen({
|
|
326
|
+
open: true,
|
|
327
|
+
place: location,
|
|
328
|
+
id,
|
|
329
|
+
field,
|
|
330
|
+
});
|
|
331
|
+
} }) })),
|
|
332
|
+
renderCell: (p) => (_jsx(LocationCell, { ...p, onEditLocationClick: (location, id, field) => {
|
|
333
|
+
setLocationFormOpen({
|
|
334
|
+
open: true,
|
|
335
|
+
place: location,
|
|
336
|
+
id,
|
|
337
|
+
field,
|
|
338
|
+
});
|
|
339
|
+
} })),
|
|
340
|
+
valueSetter(params) {
|
|
341
|
+
if (params.value && typeof params.value != "string")
|
|
342
|
+
if (typeof params.value != "number")
|
|
343
|
+
return {
|
|
344
|
+
...params.row,
|
|
345
|
+
locationID: params.value.id,
|
|
346
|
+
};
|
|
347
|
+
else
|
|
348
|
+
return {
|
|
349
|
+
...params.row,
|
|
350
|
+
locationID: params.value,
|
|
351
|
+
};
|
|
352
|
+
else
|
|
353
|
+
return { ...params.row, locationID: 0 };
|
|
354
|
+
},
|
|
355
|
+
editable: true,
|
|
356
|
+
minWidth: 250,
|
|
357
|
+
cellClassName: (p) => `ShipconsTaskItem-${p.id}-location`,
|
|
358
|
+
sortable: false,
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
field: "line1",
|
|
362
|
+
headerName: "Address",
|
|
363
|
+
minWidth: 150,
|
|
364
|
+
valueGetter(params) {
|
|
365
|
+
return params.row.address?.line1;
|
|
366
|
+
},
|
|
367
|
+
sortable: false,
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
field: "zip",
|
|
371
|
+
headerName: "Zipcode",
|
|
372
|
+
type: "string",
|
|
373
|
+
editable: true,
|
|
374
|
+
sortable: false,
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
field: "city",
|
|
378
|
+
headerName: "City",
|
|
379
|
+
type: "string",
|
|
380
|
+
editable: false,
|
|
381
|
+
sortable: false,
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
field: "state",
|
|
385
|
+
headerName: "State",
|
|
386
|
+
type: "string",
|
|
387
|
+
editable: false,
|
|
388
|
+
sortable: false,
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
field: "referenceNumber",
|
|
392
|
+
headerName: "References",
|
|
393
|
+
type: "string",
|
|
394
|
+
editable: true,
|
|
395
|
+
cellClassName: (p) => `ShipconsTaskItem-${p.id}-referenceNumber`,
|
|
396
|
+
sortable: false,
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
field: "confirmationNumber",
|
|
400
|
+
headerName: "Confirmation",
|
|
401
|
+
type: "string",
|
|
402
|
+
editable: true,
|
|
403
|
+
sortable: false,
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
field: "actions",
|
|
407
|
+
type: "actions",
|
|
408
|
+
headerName: "Actions",
|
|
409
|
+
width: 100,
|
|
410
|
+
cellClassName: "actions",
|
|
411
|
+
getActions: ({ row }) => [
|
|
412
|
+
_jsx(GridActionsCellItem, { showInMenu: true, icon: _jsx("i", { className: "fa-duotone fa-notes" }), label: "Show Appointment Notes", onClick: () => {
|
|
413
|
+
if (row.id)
|
|
414
|
+
setAptNotesShipConID(row.id);
|
|
415
|
+
}, color: "inherit" }, "showAptNotes"),
|
|
416
|
+
_jsx(GridActionsCellItem, { showInMenu: true, icon: _jsx("i", { className: "fa-duotone fa-address-book" }), label: "Show Contact", disabled: !row.locationID, onClick: () => {
|
|
417
|
+
if (row.locationID)
|
|
418
|
+
setContactLocationID(row.locationID);
|
|
419
|
+
}, color: "inherit" }, "showContact"),
|
|
420
|
+
_jsx(GridActionsCellItem, { showInMenu: true, icon: _jsx("i", { className: "fa-duotone fa-note" }), label: "Show Notes", disabled: !row.locationID, onClick: () => {
|
|
421
|
+
if (row.locationID)
|
|
422
|
+
setNotesLocationID(row.locationID);
|
|
423
|
+
}, color: "inherit" }, "showNotes"),
|
|
424
|
+
_jsx(GridActionsCellItem, { showInMenu: true, icon: _jsx("i", { className: "fa-duotone fa-brake-warning" }), label: "Add Issue", onClick: () => {
|
|
425
|
+
if (row.id)
|
|
426
|
+
setIssueShipconID(row.id);
|
|
427
|
+
}, color: "inherit" }, "add issue"),
|
|
428
|
+
_jsx(GridActionsCellItem, { showInMenu: true, icon: _jsx("i", { className: "fa-duotone fa-trash" }), label: "Delete Stop", onClick: () => {
|
|
429
|
+
if (row.id) {
|
|
430
|
+
handleDeleteShipcon(row.id);
|
|
431
|
+
}
|
|
432
|
+
}, color: "inherit" }, "delete shipcon"),
|
|
433
|
+
_jsx(GridActionsCellItem, { onClick: (e) => {
|
|
434
|
+
setAnchorEl(e.currentTarget);
|
|
435
|
+
setStagedShipcon(row || null);
|
|
436
|
+
}, label: "Scheduling shortcuts", icon: _jsx(Tooltip, { title: "Scheduling shortcuts", size: "sm", children: _jsx("i", { className: "fa-duotone fa-calendar-days" }) }) }, "scheduling note"),
|
|
437
|
+
],
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
field: "appointmentIssues",
|
|
441
|
+
headerName: "Issues",
|
|
442
|
+
width: 60,
|
|
443
|
+
cellClassName: "actions",
|
|
444
|
+
renderCell(params) {
|
|
445
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
446
|
+
const handlePopoverOpen = (event) => {
|
|
447
|
+
setAnchorEl(event.currentTarget);
|
|
448
|
+
};
|
|
449
|
+
const handlePopoverClose = () => {
|
|
450
|
+
setAnchorEl(null);
|
|
451
|
+
};
|
|
452
|
+
const open = Boolean(anchorEl);
|
|
453
|
+
return params.value ? (_jsxs(_Fragment, { children: [_jsx(Typography, { color: "danger", "aria-owns": open ? "mouse-over-popover" : undefined, "aria-haspopup": "true", onMouseEnter: handlePopoverOpen, onMouseLeave: handlePopoverClose, children: _jsx("i", { className: "fa-solid fa-circle-exclamation", style: {
|
|
454
|
+
fontSize: "inherit",
|
|
455
|
+
} }) }), _jsx(Popper, { style: {
|
|
456
|
+
pointerEvents: "none",
|
|
457
|
+
}, open: open, anchorEl: anchorEl, children: _jsx(Sheet, { sx: (theme) => ({
|
|
458
|
+
boxShadow: theme.shadow.lg,
|
|
459
|
+
}), children: _jsx(Box, { sx: {
|
|
460
|
+
p: 1,
|
|
461
|
+
maxWidth: 300,
|
|
462
|
+
}, children: params.value.map((issue) => (_jsxs(Typography, { level: "body-xs", sx: {
|
|
463
|
+
wordBreak: "break-word",
|
|
464
|
+
}, children: [_jsxs(Typography, { fontWeight: "bold", children: [issue.appointment_issue_category_name, " -", " ", _jsx("b", { children: issue.appointment_issue_subcategory_name }), " "] }), issue.notes ? `: ${issue.notes}` : ""] }, issue.id))) }) }) })] })) : (_jsx(Typography, { color: "success", children: _jsx("i", { className: "fa-solid fa-circle-check" }) }));
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
], []);
|
|
468
|
+
return (_jsxs(Box, { sx: { display: "grid", width: "100%" }, children: [_jsx(Box, { display: "flex", sx: {
|
|
469
|
+
mb: 1,
|
|
470
|
+
}, children: _jsx(ActionBar, { quoteRoute: quoteRoute }) }), _jsx(LepStyledDataGrid, { loading: isFetching, rows: shipcons, autoHeight: true, rowReordering: true, onRowOrderChange: handleRowOrderChange, hideFooter: true, apiRef: apiRef, editMode: "row", onCellClick: (e) => {
|
|
471
|
+
if (apiRef.current.isCellEditable(e) &&
|
|
472
|
+
apiRef.current.getRowMode(e.id) === "view")
|
|
473
|
+
apiRef.current?.startRowEditMode({ id: e.id });
|
|
474
|
+
}, processRowUpdate: onRowUpdate, density: "compact", initialState: {
|
|
475
|
+
pinnedColumns: {
|
|
476
|
+
right: ["actions", "appointmentIssues"],
|
|
477
|
+
},
|
|
478
|
+
}, columns: columns, getRowClassName: (params) => {
|
|
479
|
+
if (params.row.quoteCity?.toLowerCase() !=
|
|
480
|
+
params.row.city?.toLowerCase() ||
|
|
481
|
+
params.row.quoteState != params.row.state ||
|
|
482
|
+
params.row.quoteZip != params.row.zip)
|
|
483
|
+
return "grid-row-red";
|
|
484
|
+
else if (!params.row.locationID ||
|
|
485
|
+
!params.row.stopDate ||
|
|
486
|
+
(params.row.shipConsType == "shipper" && !params.row.timeTo) ||
|
|
487
|
+
!params.row.timeFrom ||
|
|
488
|
+
!params.row.referenceNumber) {
|
|
489
|
+
return "grid-row-yellow";
|
|
490
|
+
}
|
|
491
|
+
else if (!params.row.address?.verified)
|
|
492
|
+
return "grid-row-green";
|
|
493
|
+
else
|
|
494
|
+
return "";
|
|
495
|
+
} }), _jsx(LocationFormSales, { onCreateLocation: (value) => {
|
|
496
|
+
if (locationFormOpen.id && locationFormOpen.field) {
|
|
497
|
+
apiRef.current.startRowEditMode({
|
|
498
|
+
fieldToFocus: locationFormOpen.field,
|
|
499
|
+
id: locationFormOpen.id,
|
|
500
|
+
});
|
|
501
|
+
setTimeout(() => {
|
|
502
|
+
if (locationFormOpen.id && locationFormOpen.field)
|
|
503
|
+
apiRef.current.setEditCellValue({
|
|
504
|
+
field: locationFormOpen.field,
|
|
505
|
+
id: locationFormOpen.id,
|
|
506
|
+
value: value.id,
|
|
507
|
+
});
|
|
508
|
+
}, 100);
|
|
509
|
+
}
|
|
510
|
+
}, open: locationFormOpen.open, place: locationFormOpen.place, onClose: () => setLocationFormOpen({ open: false }) }), _jsx(AptNotes, { close: () => setAptNotesShipConID(null), shipConID: aptNotesShipConID }), _jsx(LocationContact, { locationID: contactLocationID, close: () => setContactLocationID(null) }), _jsx(LocationNotes, { locationID: notesLocationID, close: () => setNotesLocationID(null) }), _jsx(AppointmentIssueForm, { shipconID: issueShipconID, loadID: Number.isNaN(Number(id)) ? undefined : Number(id), close: () => setIssueShipconID(undefined) }), _jsx(AppointmentIssues, { shipconID: showIssuesShipconID, close: () => setShowIssuesShipconID(null) }), _jsx(ScheduleEmail, { shipcon: scheduleEmailStagedShipcon, close: () => setScheduleEmailStagedShipcon(null), shipcons: shipcons }), _jsxs(Menu, { anchorEl: anchorEl, open: openSchedulingMenu, onClose: handleClose, slotProps: {
|
|
511
|
+
paper: {
|
|
512
|
+
elevation: 1,
|
|
513
|
+
},
|
|
514
|
+
}, children: [_jsxs(MenuItem, { onClick: () => {
|
|
515
|
+
if (stagedShipcon?.id)
|
|
516
|
+
createNote({
|
|
517
|
+
note: `Emailed ${stagedShipcon?.name}`,
|
|
518
|
+
shipconID: stagedShipcon.id,
|
|
519
|
+
});
|
|
520
|
+
handleClose();
|
|
521
|
+
}, children: [_jsx(ListItemIcon, { children: _jsx("i", { className: "fa-duotone fa-envelope" }) }), t("components:lepShipcons.email_note")] }), _jsxs(MenuItem, { onClick: () => {
|
|
522
|
+
if (stagedShipcon?.id)
|
|
523
|
+
createNote({
|
|
524
|
+
note: `Called ${stagedShipcon.name}`,
|
|
525
|
+
shipconID: stagedShipcon.id,
|
|
526
|
+
});
|
|
527
|
+
handleClose();
|
|
528
|
+
}, children: [_jsx(ListItemIcon, { children: _jsx("i", { className: "fa-duotone fa-phone" }) }), t("components:lepShipcons.call_note")] }), _jsxs(MenuItem, { onClick: () => {
|
|
529
|
+
if (stagedShipcon?.id)
|
|
530
|
+
createNote({
|
|
531
|
+
note: `Requested appt. on portal for ${stagedShipcon?.name}`,
|
|
532
|
+
shipconID: stagedShipcon.id,
|
|
533
|
+
});
|
|
534
|
+
handleClose();
|
|
535
|
+
}, children: [_jsx(ListItemIcon, { children: _jsx("i", { className: "fa-duotone fa-desktop" }) }), t("components:lepShipcons.portal_note")] }), _jsxs(MenuItem, { onClick: () => {
|
|
536
|
+
if (stagedShipcon?.id)
|
|
537
|
+
createNote({
|
|
538
|
+
note: `Customer will request appt. for ${stagedShipcon?.name}`,
|
|
539
|
+
shipconID: stagedShipcon.id,
|
|
540
|
+
});
|
|
541
|
+
handleClose();
|
|
542
|
+
}, children: [_jsx(ListItemIcon, { children: _jsx("i", { className: "fa-duotone fa-user-headset" }) }), t("components:lepShipcons.customer_note")] }), _jsxs(MenuItem, { onClick: () => {
|
|
543
|
+
setScheduleEmailStagedShipcon(stagedShipcon);
|
|
544
|
+
handleClose();
|
|
545
|
+
}, children: [_jsx(ListItemIcon, { children: _jsx("i", { className: "fa-duotone fa-paper-plane-top" }) }), t("components:lepShipcons.schedule_email")] }), _jsxs(MenuItem, { onClick: () => {
|
|
546
|
+
handleClose();
|
|
547
|
+
setShowIssuesShipconID(stagedShipcon?.id || null);
|
|
548
|
+
}, children: [_jsx(ListItemIcon, { children: _jsx("i", { className: "fa-duotone fa-circle-exclamation" }) }), t("components:lepShipcons.view_appointment_issues")] })] })] }));
|
|
549
|
+
}
|
|
550
|
+
const ScheduleEmail = ({ shipcon, shipcons, close, }) => {
|
|
551
|
+
const { t } = useTranslation();
|
|
552
|
+
const dispatch = useDispatch();
|
|
553
|
+
const [sendEmail, { isLoading }] = useEmailArcherFileMutation();
|
|
554
|
+
const { data: currentUser } = useGetCurrentUserQuery();
|
|
555
|
+
const { data: load } = useGetLoadQuery(Number(shipcon?.loadID), {
|
|
556
|
+
skip: Number.isNaN(Number(shipcon?.loadID)),
|
|
557
|
+
});
|
|
558
|
+
const { data: files } = useGetLoadFilesQuery(shipcon?.loadID || 0, {
|
|
559
|
+
skip: !shipcon?.loadID,
|
|
560
|
+
});
|
|
561
|
+
const [email, setEmail] = useState(shipcon?.address?.email || "");
|
|
562
|
+
const [isEmailValid, setIsEmailValid] = useState(true);
|
|
563
|
+
const [subject, setSubject] = useState(`${shipcon?.shipConsType == "shipper" ? "Pickup" : "Del"} Appt Req ${shipcon?.loadID || ""} - PO# ${shipcon?.referenceNumber || ""} (Del: ${shipcon?.finalDestination || ""})`);
|
|
564
|
+
const [fromEmail, setFromEmail] = useState(currentUser?.email || "");
|
|
565
|
+
const [isFromEmailValid, setIsFromEmailValid] = useState(true);
|
|
566
|
+
const [message, setMessage] = useState("");
|
|
567
|
+
const [selectedFiles, setSelectedFiles] = useState([]);
|
|
568
|
+
const getDefaultMessage = () => {
|
|
569
|
+
let message = `Requested ${shipcon?.shipConsType == "shipper" ? "pickup" : "delivery"} date ${shipcon?.stopDate
|
|
570
|
+
? DateTime.fromISO(shipcon.stopDate).toUTC().toFormat("LL/dd")
|
|
571
|
+
: ""}\n\n`;
|
|
572
|
+
const firstShipper = (shipcons ? [...shipcons] : [])
|
|
573
|
+
?.sort((a, b) => a.tripOrder && b.tripOrder ? a.tripOrder - b.tripOrder : 0)
|
|
574
|
+
.find((s) => s.shipConsType === "shipper");
|
|
575
|
+
const delivery = shipcons?.find((s) => s.shipConsType == "consignee");
|
|
576
|
+
const delAddress = delivery
|
|
577
|
+
? `${delivery.name} (${delivery.address?.line1} ${delivery.city} ${delivery.state}, ${delivery.zip})`
|
|
578
|
+
: "";
|
|
579
|
+
message += `PO#: ${shipcon?.referenceNumber || ""}\n`;
|
|
580
|
+
message += `Pallets: ${shipcon?.pallets || ""}\n`;
|
|
581
|
+
message += `Weight: ${shipcon?.weight || ""}\n`;
|
|
582
|
+
if (shipcon?.pieces && shipcon.pieces > 0)
|
|
583
|
+
message += `Pieces: ${shipcon.pieces}\n`;
|
|
584
|
+
message += `Shipper: ${shipcons
|
|
585
|
+
?.filter((s) => s.shipConsType === "shipper")
|
|
586
|
+
.map((s) => s.name)
|
|
587
|
+
.join(", ") || ""}\n${`${firstShipper?.city}, ${firstShipper?.state}` || ""}`;
|
|
588
|
+
message += `\n\nOur current records show the delivery as ${delAddress}, `;
|
|
589
|
+
message += `please advise if there are any discrepancies with location address, dock restrictions, pallet jack or liftgate needed.`;
|
|
590
|
+
return message;
|
|
591
|
+
};
|
|
592
|
+
useEffect(() => {
|
|
593
|
+
setMessage(getDefaultMessage());
|
|
594
|
+
setEmail(shipcon?.address?.email || "");
|
|
595
|
+
setSubject(`${shipcon?.shipConsType == "shipper" ? "Pickup" : "Del"} Appt Req ${shipcon?.loadID || ""} - PO# ${shipcon?.referenceNumber || ""} (Del: ${shipcon?.finalDestination || ""})`);
|
|
596
|
+
setIsEmailValid(true);
|
|
597
|
+
setIsFromEmailValid(true);
|
|
598
|
+
setSelectedFiles([]);
|
|
599
|
+
setFromEmail(currentUser?.email || "");
|
|
600
|
+
}, [shipcon?.id, shipcons, load]);
|
|
601
|
+
return (_jsx(Modal, { open: Boolean(shipcon), onClose: close, children: _jsxs(ModalDialog, { layout: "center", sx: (theme) => ({
|
|
602
|
+
[theme.breakpoints.only("xs")]: {
|
|
603
|
+
top: 0,
|
|
604
|
+
left: 0,
|
|
605
|
+
right: 0,
|
|
606
|
+
bottom: 0,
|
|
607
|
+
border: 0,
|
|
608
|
+
borderRadius: 0,
|
|
609
|
+
transform: "initial",
|
|
610
|
+
maxWidth: "initial",
|
|
611
|
+
maxHeight: "initial",
|
|
612
|
+
},
|
|
613
|
+
}), "aria-labelledby": "modal-title", children: [_jsx(Typography, { id: "modal-title", level: "h2", children: t("components:lepShipcons.schedule_email") }), _jsxs(Grid, { container: true, spacing: 1, overflow: "auto", children: [_jsx(Grid, { xs: 12, children: _jsxs(FormControl, { error: !isEmailValid, children: [_jsx(FormLabel, { children: t("components:lepShipcons.email") }), _jsx(Input, { value: email, onChange: async (e) => {
|
|
614
|
+
setEmail(e.target.value);
|
|
615
|
+
const isValid = await NerdEmailValidator(e.target.value);
|
|
616
|
+
setIsEmailValid(isValid);
|
|
617
|
+
} })] }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("components:lepShipcons.subject") }), _jsx(Input, { value: subject, onChange: (e) => setSubject(e.target.value) })] }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { error: !isFromEmailValid, children: [_jsx(FormLabel, { children: t("components:lepShipcons.from_email") }), _jsx(Input, { value: fromEmail, onChange: async (e) => {
|
|
618
|
+
setFromEmail(e.target.value);
|
|
619
|
+
const isValid = await NerdEmailValidator(e.target.value);
|
|
620
|
+
setIsFromEmailValid(isValid);
|
|
621
|
+
} })] }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("components:lepShipcons.file") }), _jsx(Autocomplete, { value: selectedFiles, onChange: (_e, v) => setSelectedFiles(v), multiple: true, options: files?.filter((f) => ["PickUp Document", "Location Form"].includes(f.description)) || [], getOptionLabel: (o) => o.name, renderOption: (props, option) => (_createElement(AutocompleteOption, { ...props, key: option.id },
|
|
622
|
+
_jsxs(ListItemContent, { sx: { fontSize: "sm" }, children: [_jsx("b", { children: option.description }), _jsxs(Typography, { level: "body-xs", children: ["(", option.name, ")"] })] }))) })] }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("components:lepShipcons.message") }), _jsx(Textarea, { value: message, onChange: (e) => setMessage(e.target.value), minRows: 8 })] }) })] }), _jsxs(Box, { sx: {
|
|
623
|
+
display: "flex",
|
|
624
|
+
gap: 1,
|
|
625
|
+
justifyContent: "flex-end",
|
|
626
|
+
alignItems: "end",
|
|
627
|
+
pt: 2,
|
|
628
|
+
}, children: [_jsx(Button, { onClick: close, color: "neutral", variant: "soft", children: t("global.cancel") }), _jsx(Button, { loading: isLoading, onClick: () => {
|
|
629
|
+
sendEmail({
|
|
630
|
+
cc: `scheduling@whitearrow.com, ${currentUser?.email || ""}`,
|
|
631
|
+
email,
|
|
632
|
+
file_ids: selectedFiles.map((f) => f.id).toString(),
|
|
633
|
+
from: fromEmail,
|
|
634
|
+
message,
|
|
635
|
+
model_id: "0",
|
|
636
|
+
model_name: "",
|
|
637
|
+
subject,
|
|
638
|
+
})
|
|
639
|
+
.unwrap()
|
|
640
|
+
.then(() => {
|
|
641
|
+
dispatch(showNotification({
|
|
642
|
+
autohide: true,
|
|
643
|
+
title: "Success",
|
|
644
|
+
body: "Your email was sent.",
|
|
645
|
+
severity: "success",
|
|
646
|
+
variant: "non-intrusive",
|
|
647
|
+
}));
|
|
648
|
+
close();
|
|
649
|
+
})
|
|
650
|
+
.catch(() => {
|
|
651
|
+
return;
|
|
652
|
+
});
|
|
653
|
+
}, startDecorator: _jsx("i", { className: "fa-solid fa-paper-plane-top" }), children: t("common:global.send") })] })] }) }));
|
|
654
|
+
};
|
|
655
|
+
const AppointmentIssues = ({ shipconID, close, }) => {
|
|
656
|
+
const { t } = useTranslation();
|
|
657
|
+
const { data: shipcon, isFetching } = useGetShipconQuery(shipconID || 0, {
|
|
658
|
+
skip: !shipconID,
|
|
659
|
+
});
|
|
660
|
+
const columns = [
|
|
661
|
+
{
|
|
662
|
+
field: "id",
|
|
663
|
+
headerName: "ID",
|
|
664
|
+
flex: 1,
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
field: "created_at",
|
|
668
|
+
headerName: "Date",
|
|
669
|
+
valueFormatter(params) {
|
|
670
|
+
return params.value
|
|
671
|
+
? DateTime.fromISO(params.value).toUTC().toFormat("L/dd/yyyy HH:mm")
|
|
672
|
+
: "";
|
|
673
|
+
},
|
|
674
|
+
flex: 1,
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
field: "appointment_issue_category_name",
|
|
678
|
+
headerName: "Category",
|
|
679
|
+
flex: 1,
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
field: "appointment_issue_subcategory_name",
|
|
683
|
+
headerName: "Sub Category",
|
|
684
|
+
flex: 1,
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
field: "notes",
|
|
688
|
+
headerName: "Notes",
|
|
689
|
+
flex: 1,
|
|
690
|
+
},
|
|
691
|
+
];
|
|
692
|
+
return (_jsx(Modal, { open: Boolean(shipconID), onClose: close, children: _jsx(ModalDialog, { layout: "center", sx: (theme) => ({
|
|
693
|
+
[theme.breakpoints.only("xs")]: {
|
|
694
|
+
top: 0,
|
|
695
|
+
left: 0,
|
|
696
|
+
right: 0,
|
|
697
|
+
bottom: 0,
|
|
698
|
+
border: 0,
|
|
699
|
+
borderRadius: 0,
|
|
700
|
+
transform: "initial",
|
|
701
|
+
maxWidth: "initial",
|
|
702
|
+
maxHeight: "initial",
|
|
703
|
+
},
|
|
704
|
+
}), "aria-labelledby": "modal-title", children: isFetching ? (_jsx(Box, { sx: {
|
|
705
|
+
display: "flex",
|
|
706
|
+
justifyContent: "center",
|
|
707
|
+
alignItems: "center",
|
|
708
|
+
height: "100%",
|
|
709
|
+
}, children: _jsx(CircularProgress, {}) })) : (_jsxs(_Fragment, { children: [_jsx(Typography, { id: "modal-title", level: "h2", children: "Appointment Issues" }), _jsx(Box, { sx: {
|
|
710
|
+
display: "grid",
|
|
711
|
+
width: { xs: "100%", sm: 800 },
|
|
712
|
+
height: { xs: "100%", sm: 450 },
|
|
713
|
+
}, children: _jsx(LepStyledDataGrid, { rows: shipcon?.appointmentIssues || [], columns: columns, hideFooter: true }) }), _jsx(Box, { sx: {
|
|
714
|
+
display: "flex",
|
|
715
|
+
gap: 1,
|
|
716
|
+
justifyContent: "flex-end",
|
|
717
|
+
alignItems: "end",
|
|
718
|
+
pt: 2,
|
|
719
|
+
}, children: _jsx(Button, { onClick: close, color: "neutral", variant: "soft", children: t("global.cancel") }) })] })) }) }));
|
|
720
|
+
};
|
|
721
|
+
const AddStop = ({ open, close }) => {
|
|
722
|
+
const { id } = useParams();
|
|
723
|
+
const params = {
|
|
724
|
+
filters: JSON.stringify([
|
|
725
|
+
{ name: "ship_cons.load_id", comparison: "eq", value: id },
|
|
726
|
+
]),
|
|
727
|
+
sorter: JSON.stringify([{ name: "ship_cons.stop_number", asc: true }]),
|
|
728
|
+
};
|
|
729
|
+
const { data: load } = useGetLoadQuery(Number(id), { skip: !id || !open });
|
|
730
|
+
const { t } = useTranslation();
|
|
731
|
+
const [zip, setZip] = useState("");
|
|
732
|
+
const [locationID, setLocationID] = useState();
|
|
733
|
+
const [type, setType] = useState("shipper");
|
|
734
|
+
const [dropStop, setDropStop] = useState(false);
|
|
735
|
+
const [createShipcon, { isLoading }] = useCreateShipconV1Mutation();
|
|
736
|
+
useGetShipconsQuery(params);
|
|
737
|
+
const selectAllShipcons = useMemo(() => getShipconsSelectors(params).selectAll, [params]);
|
|
738
|
+
const shipcons = useSelector(selectAllShipcons);
|
|
739
|
+
const handleClose = () => {
|
|
740
|
+
close();
|
|
741
|
+
setDropStop(false);
|
|
742
|
+
setType("shipper");
|
|
743
|
+
setZip("");
|
|
744
|
+
setLocationID(undefined);
|
|
745
|
+
};
|
|
746
|
+
const handleCreate = () => {
|
|
747
|
+
const stopNumber = shipcons?.reduce((prev, current) => {
|
|
748
|
+
if (prev?.stopNumber && current?.stopNumber) {
|
|
749
|
+
return prev?.stopNumber > current?.stopNumber ? prev : current;
|
|
750
|
+
}
|
|
751
|
+
else if (!prev?.stopNumber && !current?.stopNumber) {
|
|
752
|
+
return current;
|
|
753
|
+
}
|
|
754
|
+
else if (!prev?.stopNumber) {
|
|
755
|
+
return current;
|
|
756
|
+
}
|
|
757
|
+
else
|
|
758
|
+
return prev;
|
|
759
|
+
}, null)?.stopNumber || 0;
|
|
760
|
+
createShipcon({
|
|
761
|
+
shipcon: {
|
|
762
|
+
ship_cons_type: type || undefined,
|
|
763
|
+
quote_zip: zip,
|
|
764
|
+
location_id: locationID,
|
|
765
|
+
drop_stop: dropStop,
|
|
766
|
+
load_id: load?.id,
|
|
767
|
+
quote_id: load?.quoteID,
|
|
768
|
+
stop_number: stopNumber + 1,
|
|
769
|
+
},
|
|
770
|
+
})
|
|
771
|
+
.unwrap()
|
|
772
|
+
.then(() => {
|
|
773
|
+
handleClose();
|
|
774
|
+
})
|
|
775
|
+
.catch(() => {
|
|
776
|
+
handleClose();
|
|
777
|
+
});
|
|
778
|
+
};
|
|
779
|
+
return (_jsx(_Fragment, { children: _jsx(Modal, { open: open, onClose: handleClose, children: _jsxs(ModalDialog, { "aria-labelledby": "modal-dialog-title", layout: "center", sx: (theme) => ({
|
|
780
|
+
width: 500,
|
|
781
|
+
[theme.breakpoints.only("xs")]: {
|
|
782
|
+
top: 0,
|
|
783
|
+
left: 0,
|
|
784
|
+
right: 0,
|
|
785
|
+
bottom: 0,
|
|
786
|
+
border: 0,
|
|
787
|
+
borderRadius: 0,
|
|
788
|
+
transform: "initial",
|
|
789
|
+
maxWidth: "initial",
|
|
790
|
+
maxHeight: "initial",
|
|
791
|
+
width: "initial",
|
|
792
|
+
},
|
|
793
|
+
}), children: [_jsx(Typography, { id: "modal-dialog-title", level: "h2", children: t("components:lepShipcons.add_stop") }), _jsxs(Grid, { container: true, spacing: 1, overflow: "auto", height: "100%", children: [_jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("entities:load.attributes.type") }), _jsxs(Select, { value: type, onChange: (_e, v) => setType(v), children: [_jsx(Option, { value: "shipper", children: t("components:lepShipcons.shipper") }), _jsx(Option, { value: "consignee", children: t("components:lepShipcons.consignee") })] })] }) }), _jsx(Grid, { xs: 12, mt: 1, mb: 1, children: _jsx(FormControl, { children: _jsx(Checkbox, { label: t("components:lepShipcons.drop_stop"), checked: dropStop, onChange: (e) => setDropStop(e.target.checked) }) }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("entities:company.others.zip_code") }), _jsx(Input, { type: "number", value: zip, onChange: (e) => setZip(e.target.value) })] }) }), _jsx(Grid, { xs: 12, children: _jsx(LocationInput, { zip: zip, locationID: locationID, onChange: (l) => {
|
|
794
|
+
if (l) {
|
|
795
|
+
setLocationID(l.id);
|
|
796
|
+
if (locationEntityTypeGuard(l)) {
|
|
797
|
+
setZip(l.address.zip);
|
|
798
|
+
}
|
|
799
|
+
else if (l.zip) {
|
|
800
|
+
setZip(l.zip);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
else
|
|
804
|
+
setLocationID(undefined);
|
|
805
|
+
}, customerPortal: false, autoCompleteProps: {
|
|
806
|
+
size: "md",
|
|
807
|
+
} }) })] }), _jsxs(Box, { sx: {
|
|
808
|
+
display: "flex",
|
|
809
|
+
gap: 1,
|
|
810
|
+
justifyContent: "flex-end",
|
|
811
|
+
alignItems: "end",
|
|
812
|
+
pt: 2,
|
|
813
|
+
height: "100%",
|
|
814
|
+
}, children: [_jsx(Button, { onClick: handleClose, color: "neutral", variant: "soft", children: t("global.cancel") }), _jsx(Button, { loading: isLoading, onClick: handleCreate, children: t("global.create") })] })] }) }) }));
|
|
815
|
+
};
|
|
816
|
+
const AptNotes = ({ shipConID, close, }) => {
|
|
817
|
+
const params = {
|
|
818
|
+
filter: JSON.stringify([
|
|
819
|
+
{ property: "{LIKE}noteable_type", value: "ShipCon" },
|
|
820
|
+
{ property: "noteable_id", value: shipConID },
|
|
821
|
+
]),
|
|
822
|
+
};
|
|
823
|
+
const { isFetching } = useGetAppointmentNotesQuery(params);
|
|
824
|
+
const selectAllAptNotes = useMemo(() => getAppointmentNotesSelectors(params).selectAll, [params]);
|
|
825
|
+
const rows = useSelector(selectAllAptNotes);
|
|
826
|
+
const { data: aptNoteTypes } = useGetAppointmentNoteTypesQuery();
|
|
827
|
+
const { t } = useTranslation();
|
|
828
|
+
return (_jsx(Modal, { open: Boolean(shipConID), onClose: close, children: _jsxs(ModalDialog, { layout: "center", sx: (theme) => ({
|
|
829
|
+
width: "40vw",
|
|
830
|
+
height: 500,
|
|
831
|
+
[theme.breakpoints.only("xs")]: {
|
|
832
|
+
top: 0,
|
|
833
|
+
left: 0,
|
|
834
|
+
right: 0,
|
|
835
|
+
bottom: 0,
|
|
836
|
+
border: 0,
|
|
837
|
+
borderRadius: 0,
|
|
838
|
+
transform: "initial",
|
|
839
|
+
maxWidth: "initial",
|
|
840
|
+
maxHeight: "initial",
|
|
841
|
+
width: "initial",
|
|
842
|
+
height: "initial",
|
|
843
|
+
},
|
|
844
|
+
}), "aria-labelledby": "modal-dialog-title", children: [_jsx(Typography, { id: "modal-dialog-title", level: "h2", children: "Appointment Notes" }), _jsx(Box, { sx: { display: "grid", width: "100%", height: "100%" }, children: _jsx(LepStyledDataGrid, { loading: isFetching, columns: [
|
|
845
|
+
{ field: "person_id", headerName: "Person" },
|
|
846
|
+
{
|
|
847
|
+
field: "appointment_note_type_id",
|
|
848
|
+
headerName: "Type",
|
|
849
|
+
valueFormatter(params) {
|
|
850
|
+
return (aptNoteTypes?.entities[params.value]?.name || params.value);
|
|
851
|
+
},
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
field: "created_at",
|
|
855
|
+
headerName: "Date",
|
|
856
|
+
flex: 1,
|
|
857
|
+
valueFormatter(params) {
|
|
858
|
+
return DateTime.fromISO(params.value).toUTC().toFormat("ff");
|
|
859
|
+
},
|
|
860
|
+
},
|
|
861
|
+
{ field: "note", headerName: "Note", flex: 2 },
|
|
862
|
+
], rows: rows, hideFooter: true }) }), _jsx(Box, { sx: {
|
|
863
|
+
display: "flex",
|
|
864
|
+
gap: 1,
|
|
865
|
+
justifyContent: "flex-end",
|
|
866
|
+
pt: 2,
|
|
867
|
+
}, children: _jsx(Button, { onClick: close, color: "neutral", variant: "soft", children: t("global.close") }) })] }) }));
|
|
868
|
+
};
|
|
869
|
+
const LocationNotes = ({ locationID, close, }) => {
|
|
870
|
+
const { t } = useTranslation();
|
|
871
|
+
const { data: location, isFetching } = useGetLocationV1Query(locationID || 0, {
|
|
872
|
+
skip: !locationID,
|
|
873
|
+
});
|
|
874
|
+
const [updateLocation] = useUpdateLocationV1Mutation();
|
|
875
|
+
const [locationNotes, setLocationNotes] = useState(location?.notes);
|
|
876
|
+
const [schedulingNotes, setSchedulingNotes] = useState(location?.scheduling_notes);
|
|
877
|
+
useEffect(() => {
|
|
878
|
+
setLocationNotes(location?.notes);
|
|
879
|
+
setSchedulingNotes(location?.scheduling_notes);
|
|
880
|
+
}, [location]);
|
|
881
|
+
const handleSave = () => {
|
|
882
|
+
if (locationID) {
|
|
883
|
+
updateLocation({
|
|
884
|
+
id: locationID,
|
|
885
|
+
body: {
|
|
886
|
+
location: { notes: locationNotes, scheduling_notes: schedulingNotes },
|
|
887
|
+
},
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
handleClose();
|
|
891
|
+
};
|
|
892
|
+
const handleClose = () => {
|
|
893
|
+
setLocationNotes(location?.notes);
|
|
894
|
+
setSchedulingNotes(location?.scheduling_notes);
|
|
895
|
+
close();
|
|
896
|
+
};
|
|
897
|
+
return (_jsx(Modal, { open: Boolean(locationID), onClose: handleClose, children: _jsx(ModalDialog, { layout: "center", sx: (theme) => ({
|
|
898
|
+
[theme.breakpoints.only("xs")]: {
|
|
899
|
+
top: 0,
|
|
900
|
+
left: 0,
|
|
901
|
+
right: 0,
|
|
902
|
+
bottom: 0,
|
|
903
|
+
border: 0,
|
|
904
|
+
borderRadius: 0,
|
|
905
|
+
transform: "initial",
|
|
906
|
+
maxWidth: "initial",
|
|
907
|
+
maxHeight: "initial",
|
|
908
|
+
},
|
|
909
|
+
}), "aria-labelledby": "modal-dialog-title", children: isFetching ? (_jsx(Box, { sx: {
|
|
910
|
+
display: "flex",
|
|
911
|
+
justifyContent: "center",
|
|
912
|
+
alignItems: "center",
|
|
913
|
+
height: "100%",
|
|
914
|
+
}, children: _jsx(CircularProgress, {}) })) : (_jsxs(_Fragment, { children: [_jsx(Typography, { id: "modal-dialog-title", level: "h2", children: "Notes" }), _jsx(Box, { height: "100%", children: _jsxs(Grid, { container: true, spacing: 1, overflow: "auto", children: [_jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("components:lepShipcons.location_notes") }), _jsx(Textarea, { value: locationNotes || "", onChange: (e) => setLocationNotes(e.target.value) })] }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("components:lepShipcons.scheduling_notes") }), _jsx(Textarea, { value: schedulingNotes || "", onChange: (e) => setSchedulingNotes(e.target.value) })] }) })] }) }), _jsxs(Box, { sx: {
|
|
915
|
+
display: "flex",
|
|
916
|
+
gap: 1,
|
|
917
|
+
justifyContent: "flex-end",
|
|
918
|
+
pt: 2,
|
|
919
|
+
}, children: [_jsx(Button, { onClick: handleClose, color: "neutral", variant: "soft", children: t("global.cancel") }), _jsx(Button, { onClick: handleSave, children: t("global.save") })] })] })) }) }));
|
|
920
|
+
};
|
|
921
|
+
const LocationContact = ({ locationID, close, }) => {
|
|
922
|
+
const { t } = useTranslation();
|
|
923
|
+
const { data: location, isFetching } = useGetLocationV1Query(locationID || 0, {
|
|
924
|
+
skip: !locationID,
|
|
925
|
+
});
|
|
926
|
+
const contactRef = useRef(null);
|
|
927
|
+
const phoneRef = useRef(null);
|
|
928
|
+
return (_jsx(Modal, { open: Boolean(locationID), onClose: close, children: _jsx(ModalDialog, { layout: "center", sx: (theme) => ({
|
|
929
|
+
[theme.breakpoints.only("xs")]: {
|
|
930
|
+
top: 0,
|
|
931
|
+
left: 0,
|
|
932
|
+
right: 0,
|
|
933
|
+
bottom: 0,
|
|
934
|
+
border: 0,
|
|
935
|
+
borderRadius: 0,
|
|
936
|
+
transform: "initial",
|
|
937
|
+
maxWidth: "initial",
|
|
938
|
+
maxHeight: "initial",
|
|
939
|
+
},
|
|
940
|
+
}), "aria-labelledby": "modal-dialog-title", children: isFetching ? (_jsx(Box, { sx: {
|
|
941
|
+
display: "flex",
|
|
942
|
+
justifyContent: "center",
|
|
943
|
+
alignItems: "center",
|
|
944
|
+
height: "100%",
|
|
945
|
+
}, children: _jsx(CircularProgress, {}) })) : (_jsxs(_Fragment, { children: [_jsx(Typography, { id: "modal-dialog-title", level: "h2", children: "Contact" }), _jsx(Box, { height: "100%", children: _jsxs(Grid, { container: true, spacing: 1, overflow: "auto", children: [_jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("components:lepShipcons.contact") }), _jsx(Input, { readOnly: true, value: location?.contact || "", slotProps: {
|
|
946
|
+
input: {
|
|
947
|
+
ref: contactRef,
|
|
948
|
+
},
|
|
949
|
+
}, endDecorator: _jsx(CopyInputDecorator, { inputRef: contactRef }) })] }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("components:lepShipcons.phone") }), _jsx(Input, { readOnly: true, slotProps: {
|
|
950
|
+
input: {
|
|
951
|
+
ref: phoneRef,
|
|
952
|
+
},
|
|
953
|
+
}, value: location?.phone || "", endDecorator: _jsx(CopyInputDecorator, { inputRef: phoneRef }) })] }) })] }) }), _jsx(Box, { sx: {
|
|
954
|
+
display: "flex",
|
|
955
|
+
gap: 1,
|
|
956
|
+
justifyContent: "flex-end",
|
|
957
|
+
pt: 2,
|
|
958
|
+
}, children: _jsx(Button, { onClick: close, color: "neutral", variant: "soft", children: t("global.close") }) })] })) }) }));
|
|
959
|
+
};
|
|
960
|
+
export const AppointmentIssueForm = ({ loadID, shipconID, close, }) => {
|
|
961
|
+
const { t } = useTranslation();
|
|
962
|
+
const [createIssue] = useCreateAppointmentIssueMutation();
|
|
963
|
+
const { data: _categories, isFetching } = useGetAppointmentIssueCategoryFilteredByRoleQuery({
|
|
964
|
+
start: 0,
|
|
965
|
+
limit: 25,
|
|
966
|
+
}, {
|
|
967
|
+
skip: !open,
|
|
968
|
+
});
|
|
969
|
+
const categories = useMemo(() => _categories
|
|
970
|
+
? [..._categories].sort((a, b) => a.name && b.name ? a.name.localeCompare(b.name) : 0)
|
|
971
|
+
: [], [_categories]);
|
|
972
|
+
const [issueDate, setIssueDate] = useState(DateTime.now());
|
|
973
|
+
const [category, setCategory] = useState(null);
|
|
974
|
+
const [subcategory, setSubcategory] = useState(null);
|
|
975
|
+
const [faultingPerson, setFaultingPerson] = useState(null);
|
|
976
|
+
const [node, setNode] = useState(null);
|
|
977
|
+
const [carrier, setCarrier] = useState(null);
|
|
978
|
+
const [driver, setDriver] = useState(null);
|
|
979
|
+
const [notes, setNotes] = useState();
|
|
980
|
+
const [modifyTime, setModifyTime] = useState(false);
|
|
981
|
+
const [startTime, setStartTime] = useState(null);
|
|
982
|
+
const [endTime, setEndTime] = useState(null);
|
|
983
|
+
const [modifyDate, setModifyDate] = useState(false);
|
|
984
|
+
const [rescheduleDate, setRescheduleDate] = useState(null);
|
|
985
|
+
const carrierRef = useRef(null);
|
|
986
|
+
const driverRef = useRef(null);
|
|
987
|
+
const personRef = useRef(null);
|
|
988
|
+
const nodeRef = useRef(null);
|
|
989
|
+
const [getSubcategories, { data: subcategoriesMap, isFetching: fetchingSubcategories },] = useLazyGetAppointmentIssueSubcategoriesQuery();
|
|
990
|
+
const params = useMemo(() => ({
|
|
991
|
+
filter: JSON.stringify([
|
|
992
|
+
{
|
|
993
|
+
property: "appointment_issue_category_id",
|
|
994
|
+
value: category?.id,
|
|
995
|
+
},
|
|
996
|
+
]),
|
|
997
|
+
}), [category]);
|
|
998
|
+
const selectAllSubcategories = useMemo(() => getAppointmentIssueSubcategoriesSelectors(params).selectAll, [params]);
|
|
999
|
+
const subcategories = useSelector(selectAllSubcategories);
|
|
1000
|
+
const { isFetching: fetchingCarriers, data: carriers } = useGetCarrierNamesLiteQuery(undefined, { skip: !shipconID });
|
|
1001
|
+
const { isFetching: fetchingNodes } = useGetNodeNamesQuery(undefined, {
|
|
1002
|
+
skip: !shipconID,
|
|
1003
|
+
});
|
|
1004
|
+
const selectAllNodes = useMemo(() => getNodeNamesSelectors().selectAll, []);
|
|
1005
|
+
const nodes = useSelector(selectAllNodes);
|
|
1006
|
+
const { isFetching: fetchingDrivers } = useGetDriverNamesQuery(undefined, {
|
|
1007
|
+
skip: !shipconID,
|
|
1008
|
+
});
|
|
1009
|
+
const selectAllDrivers = useMemo(() => getDriverNamesSelectors().selectAll, []);
|
|
1010
|
+
const drivers = useSelector(selectAllDrivers);
|
|
1011
|
+
const params2 = {
|
|
1012
|
+
filters: JSON.stringify([
|
|
1013
|
+
{ name: "people.company_id", comparison: "eq", value: 1 },
|
|
1014
|
+
{ name: "people.active", comparison: "eq", value: true },
|
|
1015
|
+
]),
|
|
1016
|
+
};
|
|
1017
|
+
const { isFetching: fecthingPersonNames } = useGetPeopleQuery(params2, {
|
|
1018
|
+
skip: !shipconID,
|
|
1019
|
+
});
|
|
1020
|
+
const selectAllPersonNames = useMemo(() => getPeopleSelectors(params2).selectAll, [params2]);
|
|
1021
|
+
const personNames = useSelector(selectAllPersonNames);
|
|
1022
|
+
const handleSave = () => {
|
|
1023
|
+
if (shipconID && loadID)
|
|
1024
|
+
createIssue({
|
|
1025
|
+
appointmentissue: {
|
|
1026
|
+
appointment_issue_category_id: category?.id,
|
|
1027
|
+
appointment_issue_subcategory_id: subcategory?.id,
|
|
1028
|
+
faulting_person_id: faultingPerson?.id || 0,
|
|
1029
|
+
node_id: node?.id || 0,
|
|
1030
|
+
driver_id: driver?.id || 0,
|
|
1031
|
+
carrier_id: carrier?.id || 0,
|
|
1032
|
+
notes,
|
|
1033
|
+
modify_time: modifyTime,
|
|
1034
|
+
new_start_time: startTime || undefined,
|
|
1035
|
+
new_end_time: endTime || undefined,
|
|
1036
|
+
new_date: rescheduleDate?.toISO() || undefined,
|
|
1037
|
+
issue_date: issueDate?.toISO() || undefined,
|
|
1038
|
+
load_id: loadID,
|
|
1039
|
+
ship_con_id: shipconID,
|
|
1040
|
+
reschedule: modifyDate,
|
|
1041
|
+
},
|
|
1042
|
+
});
|
|
1043
|
+
handleClose();
|
|
1044
|
+
};
|
|
1045
|
+
const handleClose = () => {
|
|
1046
|
+
close();
|
|
1047
|
+
setCarrier(null);
|
|
1048
|
+
setCategory(null);
|
|
1049
|
+
setDriver(null);
|
|
1050
|
+
setEndTime(null);
|
|
1051
|
+
setFaultingPerson(null);
|
|
1052
|
+
setIssueDate(DateTime.now());
|
|
1053
|
+
setModifyDate(false);
|
|
1054
|
+
setModifyTime(false);
|
|
1055
|
+
setNode(null);
|
|
1056
|
+
setNotes(undefined);
|
|
1057
|
+
setRescheduleDate(null);
|
|
1058
|
+
setStartTime(null);
|
|
1059
|
+
setSubcategory(null);
|
|
1060
|
+
};
|
|
1061
|
+
return (_jsx(Modal, { open: Boolean(shipconID), onClose: handleClose, children: _jsx(ModalDialog, { layout: "center", sx: (theme) => ({
|
|
1062
|
+
[theme.breakpoints.only("xs")]: {
|
|
1063
|
+
top: 0,
|
|
1064
|
+
left: 0,
|
|
1065
|
+
right: 0,
|
|
1066
|
+
bottom: 0,
|
|
1067
|
+
border: 0,
|
|
1068
|
+
borderRadius: 0,
|
|
1069
|
+
transform: "initial",
|
|
1070
|
+
maxWidth: "initial",
|
|
1071
|
+
maxHeight: "initial",
|
|
1072
|
+
},
|
|
1073
|
+
}), "aria-labelledby": "modal-dialog-title", children: isFetching ? (_jsx(Box, { sx: {
|
|
1074
|
+
display: "flex",
|
|
1075
|
+
justifyContent: "center",
|
|
1076
|
+
alignItems: "center",
|
|
1077
|
+
height: "100%",
|
|
1078
|
+
}, children: _jsx(CircularProgress, {}) })) : (_jsxs(_Fragment, { children: [_jsx(Typography, { id: "modal-dialog-title", level: "h2", children: "Create Issue" }), _jsxs(Grid, { container: true, spacing: 1, width: { sx: 200, lg: 600 }, overflow: "auto", alignItems: "end", children: [_jsx(Grid, { xs: 12, children: _jsx(NerdDatePicker, { label: t("components:lepShipcons.issue_date"), value: issueDate, onChange: (newDate) => {
|
|
1079
|
+
setIssueDate(newDate);
|
|
1080
|
+
} }) }), _jsx(Grid, { xs: 12, mt: 2, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("components:lepShipcons.category") }), _jsx(Autocomplete, { value: category, getOptionLabel: (option) => option.name || "", options: categories, onChange: (_e, v) => {
|
|
1081
|
+
setCategory(v);
|
|
1082
|
+
if (v)
|
|
1083
|
+
getSubcategories({
|
|
1084
|
+
filter: JSON.stringify([
|
|
1085
|
+
{
|
|
1086
|
+
property: "appointment_issue_category_id",
|
|
1087
|
+
value: v.id,
|
|
1088
|
+
},
|
|
1089
|
+
]),
|
|
1090
|
+
});
|
|
1091
|
+
else
|
|
1092
|
+
setSubcategory(null);
|
|
1093
|
+
} })] }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { disabled: !category?.id, children: [_jsx(FormLabel, { children: t("components:lepShipcons.subcategory") }), _jsx(Autocomplete, { loading: fetchingSubcategories, onChange: (_e, v) => setSubcategory(v), value: subcategory, options: subcategories || [], getOptionLabel: (option) => option.name || "" })] }) }), subcategory?.id && subcategoriesMap ? (_jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("components:lepShipcons.subcategory_definition") }), _jsx(Textarea, { readOnly: true, value: subcategoriesMap.entities[subcategory.id]?.notes || "" })] }) })) : null, category?.name &&
|
|
1094
|
+
[
|
|
1095
|
+
"Accounting",
|
|
1096
|
+
"Brokerage",
|
|
1097
|
+
"CSR",
|
|
1098
|
+
"Dispatch/Operations",
|
|
1099
|
+
"Scheduling",
|
|
1100
|
+
"Warehouse",
|
|
1101
|
+
].includes(category?.name) ? (_jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("components:lepShipcons.faulting_user") }), _jsx(Autocomplete, { loading: fecthingPersonNames, options: personNames || [], slotProps: {
|
|
1102
|
+
input: {
|
|
1103
|
+
ref: personRef,
|
|
1104
|
+
},
|
|
1105
|
+
listbox: {
|
|
1106
|
+
renderRow: renderComplexRow,
|
|
1107
|
+
},
|
|
1108
|
+
}, slots: {
|
|
1109
|
+
listbox: VirtualizedAutocompleteList,
|
|
1110
|
+
}, getOptionLabel: (option) => {
|
|
1111
|
+
const person = new Person(option);
|
|
1112
|
+
return `${person.name()} (${person.email})`;
|
|
1113
|
+
}, onChange: (_e, v) => setFaultingPerson(v), renderOption: (props, option) => [props, option] })] }) })) : null, category?.name === "Driver" ? (_jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("components:lepShipcons.driver") }), _jsx(Autocomplete, { loading: fetchingDrivers, options: drivers || [], slotProps: {
|
|
1114
|
+
input: {
|
|
1115
|
+
ref: driverRef,
|
|
1116
|
+
},
|
|
1117
|
+
listbox: {
|
|
1118
|
+
renderRow: renderComplexRow,
|
|
1119
|
+
},
|
|
1120
|
+
}, slots: {
|
|
1121
|
+
listbox: VirtualizedAutocompleteList,
|
|
1122
|
+
}, getOptionLabel: (option) => {
|
|
1123
|
+
return `${option.name} (${option.email})`;
|
|
1124
|
+
}, onChange: (_e, v) => setDriver(v), renderOption: (props, option) => [props, option] })] }) })) : null, category?.name === "Equipment" ||
|
|
1125
|
+
category?.name === "Warehouse" ? (_jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("components:lepShipcons.node") }), _jsx(Autocomplete, { options: nodes || [], slotProps: {
|
|
1126
|
+
input: {
|
|
1127
|
+
ref: nodeRef,
|
|
1128
|
+
},
|
|
1129
|
+
listbox: {
|
|
1130
|
+
renderRow: renderSimpleRow,
|
|
1131
|
+
},
|
|
1132
|
+
}, slots: {
|
|
1133
|
+
listbox: VirtualizedAutocompleteList,
|
|
1134
|
+
}, loading: fetchingNodes, getOptionLabel: (option) => option.name || "", onChange: (_e, v) => setNode(v), renderOption: (props, option) => [props, option] })] }) })) : null, category?.name === "Outside Carrier" ||
|
|
1135
|
+
category?.name === "Railroads" ? (_jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("components:lepShipcons.carrier") }), _jsx(Autocomplete, { slotProps: {
|
|
1136
|
+
input: {
|
|
1137
|
+
ref: carrierRef,
|
|
1138
|
+
},
|
|
1139
|
+
listbox: {
|
|
1140
|
+
renderRow: renderSimpleRow,
|
|
1141
|
+
},
|
|
1142
|
+
}, slots: {
|
|
1143
|
+
listbox: VirtualizedAutocompleteList,
|
|
1144
|
+
}, loading: fetchingCarriers, options: carriers || [], getOptionLabel: (option) => option.name || "", onChange: (_e, v) => setCarrier(v), renderOption: (props, option) => [props, option] })] }) })) : null, _jsx(Grid, { xs: 12, lg: 6, mt: 2, children: _jsx(FormControl, { children: _jsx(Typography, { component: "label", endDecorator: _jsx(Switch, { sx: { ml: 1 }, onChange: (e) => {
|
|
1145
|
+
if (!e.target.checked)
|
|
1146
|
+
setRescheduleDate(null);
|
|
1147
|
+
setModifyDate(e.target.checked);
|
|
1148
|
+
} }), children: t("components:lepShipcons.reschedule_date") }) }) }), _jsx(Grid, { lg: 6, mt: { lg: 2 }, children: _jsx(NerdDatePicker, { label: t("components:lepShipcons.reschedule_date"), value: rescheduleDate, onChange: (newDate) => setRescheduleDate(newDate), formControlProps: { disabled: !modifyDate }, inputProps: {
|
|
1149
|
+
placeholder: "Date",
|
|
1150
|
+
} }) }), _jsx(Grid, { xs: 12, lg: 4, children: _jsx(FormControl, { children: _jsx(Typography, { component: "label", endDecorator: _jsx(Switch, { sx: { ml: 1 }, onChange: (e) => {
|
|
1151
|
+
if (!e.target.checked) {
|
|
1152
|
+
setStartTime(null);
|
|
1153
|
+
setEndTime(null);
|
|
1154
|
+
}
|
|
1155
|
+
setModifyTime(e.target.checked);
|
|
1156
|
+
} }), children: t("components:lepShipcons.modify_time") }) }) }), _jsx(Grid, { xs: "auto", ml: { xs: 0, lg: "auto" }, children: _jsx(NerdTimePicker, { label: t("components:lepShipcons.new_start_time"), onChange: (time) => setStartTime(time.value), value: startTime, formControlProps: {
|
|
1157
|
+
disabled: !modifyTime,
|
|
1158
|
+
}, inputProps: {
|
|
1159
|
+
sx: {
|
|
1160
|
+
width: 160,
|
|
1161
|
+
},
|
|
1162
|
+
placeholder: t("components:lepShipcons.start_time"),
|
|
1163
|
+
} }) }), _jsx(Grid, { xs: "auto", children: _jsx(NerdTimePicker, { label: t("components:lepShipcons.new_end_time"), onChange: (time) => setEndTime(time.value), value: endTime, formControlProps: {
|
|
1164
|
+
disabled: !modifyTime || !startTime,
|
|
1165
|
+
}, inputProps: {
|
|
1166
|
+
sx: {
|
|
1167
|
+
width: 160,
|
|
1168
|
+
},
|
|
1169
|
+
placeholder: t("components:lepShipcons.end_time"),
|
|
1170
|
+
} }) }), _jsx(Grid, { xs: 12, mt: 2, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("components:lepShipcons.note") }), _jsx(Textarea, { onChange: (e) => setNotes(e.target.value) })] }) })] }), _jsxs(Box, { sx: {
|
|
1171
|
+
display: "flex",
|
|
1172
|
+
gap: 1,
|
|
1173
|
+
justifyContent: "flex-end",
|
|
1174
|
+
pt: 2,
|
|
1175
|
+
}, children: [_jsx(Button, { onClick: handleClose, color: "neutral", variant: "soft", children: t("global.cancel") }), _jsx(Button, { onClick: handleSave, children: t("global.save") })] })] })) }) }));
|
|
1176
|
+
};
|
|
1177
|
+
const renderSimpleRow = (props) => {
|
|
1178
|
+
const { data, index, style } = props;
|
|
1179
|
+
const dataSet = data[index];
|
|
1180
|
+
const inlineStyle = {
|
|
1181
|
+
...style,
|
|
1182
|
+
top: style.top + 6,
|
|
1183
|
+
};
|
|
1184
|
+
return (_createElement(AutocompleteOption, { ...dataSet[0], style: inlineStyle, key: typeof dataSet === "string" ? dataSet : dataSet[1].id }, typeof dataSet === "string" ? dataSet : dataSet[1].name));
|
|
1185
|
+
};
|
|
1186
|
+
const renderComplexRow = (props) => {
|
|
1187
|
+
const { data, index, style } = props;
|
|
1188
|
+
const dataSet = data[index];
|
|
1189
|
+
const inlineStyle = {
|
|
1190
|
+
...style,
|
|
1191
|
+
top: style.top + 6,
|
|
1192
|
+
};
|
|
1193
|
+
return (_createElement(AutocompleteOption, { ...dataSet[0], style: inlineStyle, key: typeof dataSet === "string" ? dataSet : dataSet[1].id }, typeof dataSet[1] === "string" ? (dataSet) : (_jsxs(ListItemContent, { sx: {
|
|
1194
|
+
fontSize: "sm",
|
|
1195
|
+
color: (t) => t.getCssVar("palette-text-primary"),
|
|
1196
|
+
}, children: [dataSet[1].name || new Person(dataSet[1]).name(), _jsx(Typography, { level: "body-xs", children: dataSet[1].email })] }))));
|
|
1197
|
+
};
|
|
1198
|
+
const ActionBar = ({ quoteRoute }) => {
|
|
1199
|
+
const { t } = useTranslation();
|
|
1200
|
+
const { id } = useParams();
|
|
1201
|
+
const dispatch = useDispatch();
|
|
1202
|
+
const recalculateBody = useSelector(quoteRecalculateBodySelector);
|
|
1203
|
+
const { data: load } = useGetLoadQuery(Number(id), {
|
|
1204
|
+
skip: Number.isNaN(Number(id)),
|
|
1205
|
+
});
|
|
1206
|
+
const params = {
|
|
1207
|
+
filters: JSON.stringify([
|
|
1208
|
+
{ name: "ship_cons.load_id", comparison: "eq", value: id },
|
|
1209
|
+
]),
|
|
1210
|
+
sorter: JSON.stringify([{ name: "ship_cons.stop_number", asc: true }]),
|
|
1211
|
+
};
|
|
1212
|
+
useGetShipconsQuery(params, {
|
|
1213
|
+
skip: Number.isNaN(Number(id)),
|
|
1214
|
+
});
|
|
1215
|
+
const selectAllShipcons = useMemo(() => getShipconsSelectors(params).selectAll, [params]);
|
|
1216
|
+
const shipcons = useSelector(selectAllShipcons);
|
|
1217
|
+
const params2 = {
|
|
1218
|
+
filters: JSON.stringify([
|
|
1219
|
+
{ name: "people.company_id", comparison: "eq", value: 1 },
|
|
1220
|
+
{ name: "people.active", comparison: "eq", value: true },
|
|
1221
|
+
]),
|
|
1222
|
+
};
|
|
1223
|
+
const { isFetching } = useGetPeopleQuery(params2);
|
|
1224
|
+
const selectAllPeople = useMemo(() => getPeopleSelectors(params2).selectAll, [params2]);
|
|
1225
|
+
const people = useSelector(selectAllPeople);
|
|
1226
|
+
const csrs = useMemo(() => getCSRS(people), [people]);
|
|
1227
|
+
const { data: customerPeople, isFetching: isFetchingContacts } = useGetCustomerPeopleQuery(load?.customerID || 0, {
|
|
1228
|
+
skip: !load?.customerID,
|
|
1229
|
+
});
|
|
1230
|
+
const [_updateLoad] = useUpdateLoadV1Mutation();
|
|
1231
|
+
const [open, setOpen] = useState(false);
|
|
1232
|
+
const lastStopDate = useMemo(() => shipcons.find((s) => s.stopDate !== undefined)?.stopDate, [shipcons]);
|
|
1233
|
+
const updateLoad = useCallback((fieldV1, fieldV3, value) => {
|
|
1234
|
+
if (load?.id)
|
|
1235
|
+
_updateLoad({
|
|
1236
|
+
id: load.id,
|
|
1237
|
+
body: {
|
|
1238
|
+
load: {
|
|
1239
|
+
[fieldV1]: value,
|
|
1240
|
+
},
|
|
1241
|
+
},
|
|
1242
|
+
})
|
|
1243
|
+
.unwrap()
|
|
1244
|
+
.catch(() => {
|
|
1245
|
+
dispatch(setRecalculateBody({
|
|
1246
|
+
...recalculateBody,
|
|
1247
|
+
[fieldV1]: load[fieldV3],
|
|
1248
|
+
}));
|
|
1249
|
+
return;
|
|
1250
|
+
});
|
|
1251
|
+
}, [load, recalculateBody]);
|
|
1252
|
+
const checkContacts = useCallback(() => {
|
|
1253
|
+
if (recalculateBody.person_ids && recalculateBody.person_ids.length > 0)
|
|
1254
|
+
dispatch(addLoadInfoTask({
|
|
1255
|
+
task: {
|
|
1256
|
+
order: 1,
|
|
1257
|
+
label: "Customer contacts selected",
|
|
1258
|
+
status: "success",
|
|
1259
|
+
uuid: nanoid(),
|
|
1260
|
+
},
|
|
1261
|
+
field: "contacts",
|
|
1262
|
+
}));
|
|
1263
|
+
else {
|
|
1264
|
+
dispatch(addLoadInfoTask({
|
|
1265
|
+
task: {
|
|
1266
|
+
order: 1,
|
|
1267
|
+
label: "Please select at least one customer contact",
|
|
1268
|
+
status: "danger",
|
|
1269
|
+
uuid: nanoid(),
|
|
1270
|
+
step: {
|
|
1271
|
+
content: "Please select at least one customer contact",
|
|
1272
|
+
selector: ".LoadInfoTaskItem-contacts",
|
|
1273
|
+
},
|
|
1274
|
+
tabIndex: 0,
|
|
1275
|
+
},
|
|
1276
|
+
field: "contacts",
|
|
1277
|
+
}));
|
|
1278
|
+
}
|
|
1279
|
+
}, [recalculateBody]);
|
|
1280
|
+
const checkCSR = useCallback(() => {
|
|
1281
|
+
if (recalculateBody.booked_by_id) {
|
|
1282
|
+
dispatch(addLoadInfoTask({
|
|
1283
|
+
task: {
|
|
1284
|
+
order: 0,
|
|
1285
|
+
label: "CSR selected",
|
|
1286
|
+
status: "success",
|
|
1287
|
+
uuid: nanoid(),
|
|
1288
|
+
},
|
|
1289
|
+
field: "bookedBy",
|
|
1290
|
+
}));
|
|
1291
|
+
}
|
|
1292
|
+
else {
|
|
1293
|
+
dispatch(addLoadInfoTask({
|
|
1294
|
+
task: {
|
|
1295
|
+
order: 0,
|
|
1296
|
+
label: "Please select a CSR",
|
|
1297
|
+
status: "danger",
|
|
1298
|
+
uuid: nanoid(),
|
|
1299
|
+
step: {
|
|
1300
|
+
content: "Please select a CSR",
|
|
1301
|
+
selector: ".LoadInfoTaskItem-bookedBy",
|
|
1302
|
+
},
|
|
1303
|
+
tabIndex: 0,
|
|
1304
|
+
},
|
|
1305
|
+
field: "bookedBy",
|
|
1306
|
+
}));
|
|
1307
|
+
}
|
|
1308
|
+
}, [recalculateBody]);
|
|
1309
|
+
useEffect(() => {
|
|
1310
|
+
checkCSR();
|
|
1311
|
+
checkContacts();
|
|
1312
|
+
}, [recalculateBody.booked_by_id, recalculateBody.person_ids]);
|
|
1313
|
+
return (_jsxs(_Fragment, { children: [_jsx(AddStop, { open: open, close: () => setOpen(false) }), _jsxs(Grid, { container: true, spacing: 1, width: "100%", sx: {
|
|
1314
|
+
alignItems: "start",
|
|
1315
|
+
}, children: [_jsx(Grid, { children: _jsxs(Button, { size: "sm", variant: "soft", color: "neutral", onClick: () => setOpen(true), children: [_jsx("i", { className: "fa-solid fa-location-dot pright" }), t("components:lepShipcons.add_stop")] }) }), _jsxs(Grid, { xs: 12, md: "auto", ml: { xs: undefined, lg: "auto" }, container: true, alignItems: "center", children: [_jsx(Grid, { xs: 12, md: "auto", children: _jsx(FormLabel, { children: t("components:lepShipcons.booked_by") }) }), _jsx(Grid, { xs: 12, md: "auto", children: _jsx(Autocomplete, { className: "LoadInfoTaskItem-bookedBy", error: !recalculateBody.booked_by_id, sx: {
|
|
1316
|
+
maxWidth: 300,
|
|
1317
|
+
}, loading: isFetching, options: csrs || [], getOptionLabel: (p) => {
|
|
1318
|
+
return p ? new Person(p).name() : "";
|
|
1319
|
+
}, size: "sm", value: csrs.find((c) => c.id === recalculateBody.booked_by_id) || null, onChange: (_e, v) => {
|
|
1320
|
+
dispatch(setRecalculateBody({
|
|
1321
|
+
...recalculateBody,
|
|
1322
|
+
booked_by_id: v?.id || undefined,
|
|
1323
|
+
}));
|
|
1324
|
+
updateLoad("booked_by_id", "bookedByID", v?.id || null);
|
|
1325
|
+
} }) })] }), _jsxs(Grid, { xs: 12, md: "auto", container: true, alignItems: "center", children: [_jsx(Grid, { xs: 12, md: "auto", children: _jsx(FormLabel, { children: t("components:lepShipcons.contacts") }) }), _jsx(Grid, { xs: 12, md: "auto", children: _jsx(Autocomplete, { disableCloseOnSelect: true, className: "LoadInfoTaskItem-contacts", sx: {
|
|
1326
|
+
"& .MuiChip-label": {
|
|
1327
|
+
maxWidth: 160,
|
|
1328
|
+
},
|
|
1329
|
+
}, error: !recalculateBody.person_ids ||
|
|
1330
|
+
recalculateBody.person_ids.length === 0, loading: isFetchingContacts, options: customerPeople?.map((c) => c.id) || [], getOptionLabel: (id) => customerPeople?.find((c) => c.id === id)?.name || "", getOptionDisabled: (option) => !customerPeople?.find((p) => p.id === option)?.active
|
|
1331
|
+
? true
|
|
1332
|
+
: false, renderOption: (props, option) => {
|
|
1333
|
+
const person = customerPeople?.find((c) => c.id === option);
|
|
1334
|
+
return (_createElement(AutocompleteOption, { ...props, key: person?.id },
|
|
1335
|
+
_jsxs(ListItemContent, { sx: { fontSize: "sm", fontWeight: "md" }, children: [person?.name, _jsx(Typography, { level: "body-xs", sx: {
|
|
1336
|
+
color: props["aria-disabled"] ? "inherit" : undefined,
|
|
1337
|
+
}, children: person?.email })] })));
|
|
1338
|
+
}, size: "sm", limitTags: 1, value: recalculateBody.person_ids || [], multiple: true, onChange: (_e, v) => {
|
|
1339
|
+
dispatch(setRecalculateBody({
|
|
1340
|
+
...recalculateBody,
|
|
1341
|
+
person_ids: v,
|
|
1342
|
+
}));
|
|
1343
|
+
}, onBlur: () => {
|
|
1344
|
+
updateLoad("person_ids", "person_ids", recalculateBody.person_ids);
|
|
1345
|
+
} }) })] }), quoteRoute ? (_jsx(Grid, { xs: 12, md: "auto", children: _jsx(Button, { startDecorator: _jsx("i", { className: "fa-solid fa-arrow-up-right-from-square" }), size: "sm", component: "a", variant: "soft", href: `${quoteRoute}/${load?.quoteID}?date=${lastStopDate
|
|
1346
|
+
? DateTime.fromISO(lastStopDate).toUTC().toMillis()
|
|
1347
|
+
: "null"}&serviceLevel=${load?.serviceLevel}`, target: "_blank", rel: "noopener noreferrer", sx: {
|
|
1348
|
+
"&:hover": {
|
|
1349
|
+
textDecoration: "none",
|
|
1350
|
+
},
|
|
1351
|
+
}, children: t("components:lepShipcons.open_quote") }) })) : null] })] }));
|
|
1352
|
+
};
|
|
1353
|
+
//# sourceMappingURL=lepShipcons.js.map
|