@burdenoff/microfe-movethewheels 2026.930.4 → 2026.1010.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/MoveTheWheelsRoot.js +177 -102
- package/dist/MoveTheWheelsRoutes.js +55 -11
- package/dist/_virtual/_rolldown/runtime.js +1 -1
- package/dist/components/ContainerEvidencePicker.js +143 -0
- package/dist/components/FreeTimeAgreementForm.js +496 -0
- package/dist/components/ReturnInstructionForm.js +108 -0
- package/dist/components/ReuseControls.js +91 -0
- package/dist/components/ReusePermissionForm.js +114 -0
- package/dist/components/ReuseProposalForm.js +455 -0
- package/dist/components/ReuseSourceFields.js +78 -0
- package/dist/components/consolidation/ConsolidationHistory.js +244 -0
- package/dist/components/consolidation/ConsolidationLotEditor.js +133 -0
- package/dist/components/consolidation/ConsolidationManifestWorkbench.js +143 -0
- package/dist/components/consolidation/ConsolidationPlanForm.js +172 -0
- package/dist/components/consolidation/ConsolidationPlanWorkbench.js +321 -0
- package/dist/components/consolidation/ConsolidationReportForm.js +94 -0
- package/dist/components/consolidation/ConsolidationReportsWorkbench.js +195 -0
- package/dist/components/consolidation/ConsolidationSummary.js +76 -0
- package/dist/components/consolidation/OriginalConsolidationHistory.js +112 -0
- package/dist/components/freight-cost/FreightDraftForm.js +213 -0
- package/dist/components/freight-cost/FreightFields.js +70 -0
- package/dist/components/freight-cost/FreightFxEditor.js +90 -0
- package/dist/components/freight-cost/FreightHistory.js +164 -0
- package/dist/components/freight-cost/FreightLineEditor.js +191 -0
- package/dist/components/freight-cost/FreightScopeEditor.js +72 -0
- package/dist/components/freight-cost/FreightTotals.js +66 -0
- package/dist/components/logistics-procedure/ProcedureDecisionForm.js +197 -0
- package/dist/components/logistics-procedure/ProcedureFields.js +31 -0
- package/dist/components/logistics-procedure/ProcedureHistory.js +177 -0
- package/dist/components/logistics-procedure/ProcedurePolicyForm.js +227 -0
- package/dist/components/logistics-procedure/ProcedurePolicyWorkbench.js +155 -0
- package/dist/components/logistics-procedure/ProcedureReviewWorkbench.js +221 -0
- package/dist/components/logistics-procedure/ProcedureRunWorkbench.js +190 -0
- package/dist/components/logistics-procedure/ProcedureSubjectPicker.js +130 -0
- package/dist/components/pending-pick/PendingPickDraft.js +84 -0
- package/dist/components/pending-pick/PendingPickHistory.js +113 -0
- package/dist/components/pending-pick/PickCapture.js +166 -0
- package/dist/components/pending-pick/PickLineSelection.js +111 -0
- package/dist/components/stock-binding/StockAssessmentDraft.js +48 -0
- package/dist/components/stock-binding/StockAssessmentHistory.js +61 -0
- package/dist/components/stock-binding/StockAssessmentSummary.js +199 -0
- package/dist/components/stock-binding/StockFactForm.js +232 -0
- package/dist/components/stock-observation/StockIssueForm.js +148 -0
- package/dist/components/stock-observation/StockIssueHistory.js +116 -0
- package/dist/components/stock-observation/StockIssueReadPanel.js +70 -0
- package/dist/components/trip-utilization/TripReportForm.js +118 -0
- package/dist/components/trip-utilization/TripReportHistory.js +54 -0
- package/dist/components/trip-utilization/TripReportSummary.js +216 -0
- package/dist/components/trip-utilization/TripSegmentFields.js +166 -0
- package/dist/generated/consolidation-operations.d.ts +1060 -0
- package/dist/generated/container-condition-operations.d.ts +868 -0
- package/dist/generated/container-operations.d.ts +356 -0
- package/dist/generated/empty-reuse-operations.d.ts +1578 -0
- package/dist/generated/free-time-operations.d.ts +938 -0
- package/dist/generated/freight-cost-operations.d.ts +716 -0
- package/dist/generated/logistics-procedure-operations.d.ts +938 -0
- package/dist/generated/pending-pick-operations.d.ts +1969 -0
- package/dist/generated/stock-binding-operations.d.ts +930 -0
- package/dist/generated/stock-observation-operations.d.ts +476 -0
- package/dist/generated/trip-utilization-operations.d.ts +651 -0
- package/dist/generated/wspace-operations.d.ts +143 -50
- package/dist/hooks/useConsolidationAction.js +119 -0
- package/dist/hooks/useContainerCondition.js +105 -0
- package/dist/hooks/useContainerLifecycle.js +192 -0
- package/dist/hooks/useEmptyReuseAction.js +45 -0
- package/dist/hooks/useFreightRecoveryAction.js +117 -0
- package/dist/hooks/useInventory.js +12 -1
- package/dist/hooks/useProcedureAction.js +119 -0
- package/dist/hooks/useProcedureSelection.js +53 -0
- package/dist/hooks/useReuseRecoveryAction.js +116 -0
- package/dist/movethewheels/components/ContainerEvidencePicker.d.ts +10 -0
- package/dist/movethewheels/components/FreeTimeAgreementForm.d.ts +14 -0
- package/dist/movethewheels/components/ReturnInstructionForm.d.ts +8 -0
- package/dist/movethewheels/components/ReuseControls.d.ts +42 -0
- package/dist/movethewheels/components/ReusePermissionForm.d.ts +9 -0
- package/dist/movethewheels/components/ReuseProposalForm.d.ts +11 -0
- package/dist/movethewheels/components/ReuseSourceFields.d.ts +9 -0
- package/dist/movethewheels/components/consolidation/ConsolidationHistory.d.ts +13 -0
- package/dist/movethewheels/components/consolidation/ConsolidationLotEditor.d.ts +6 -0
- package/dist/movethewheels/components/consolidation/ConsolidationManifestWorkbench.d.ts +8 -0
- package/dist/movethewheels/components/consolidation/ConsolidationPlanForm.d.ts +8 -0
- package/dist/movethewheels/components/consolidation/ConsolidationPlanWorkbench.d.ts +5 -0
- package/dist/movethewheels/components/consolidation/ConsolidationReportForm.d.ts +9 -0
- package/dist/movethewheels/components/consolidation/ConsolidationReportsWorkbench.d.ts +7 -0
- package/dist/movethewheels/components/consolidation/ConsolidationSummary.d.ts +6 -0
- package/dist/movethewheels/components/consolidation/OriginalConsolidationHistory.d.ts +8 -0
- package/dist/movethewheels/components/freight-cost/FreightDraftForm.d.ts +8 -0
- package/dist/movethewheels/components/freight-cost/FreightFields.d.ts +23 -0
- package/dist/movethewheels/components/freight-cost/FreightFxEditor.d.ts +6 -0
- package/dist/movethewheels/components/freight-cost/FreightHistory.d.ts +5 -0
- package/dist/movethewheels/components/freight-cost/FreightLineEditor.d.ts +8 -0
- package/dist/movethewheels/components/freight-cost/FreightScopeEditor.d.ts +6 -0
- package/dist/movethewheels/components/freight-cost/FreightTotals.d.ts +6 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedureDecisionForm.d.ts +20 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedureFields.d.ts +17 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedureHistory.d.ts +7 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedurePolicyForm.d.ts +10 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedurePolicyWorkbench.d.ts +5 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedureReviewWorkbench.d.ts +5 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedureRunWorkbench.d.ts +6 -0
- package/dist/movethewheels/components/logistics-procedure/ProcedureSubjectPicker.d.ts +7 -0
- package/dist/movethewheels/components/pending-pick/PendingPickDraft.d.ts +16 -0
- package/dist/movethewheels/components/pending-pick/PendingPickHistory.d.ts +5 -0
- package/dist/movethewheels/components/pending-pick/PickCapture.d.ts +6 -0
- package/dist/movethewheels/components/pending-pick/PickLineSelection.d.ts +17 -0
- package/dist/movethewheels/components/stock-binding/StockAssessmentDraft.d.ts +13 -0
- package/dist/movethewheels/components/stock-binding/StockAssessmentHistory.d.ts +18 -0
- package/dist/movethewheels/components/stock-binding/StockAssessmentSummary.d.ts +9 -0
- package/dist/movethewheels/components/stock-binding/StockFactForm.d.ts +6 -0
- package/dist/movethewheels/components/stock-observation/StockIssueForm.d.ts +7 -0
- package/dist/movethewheels/components/stock-observation/StockIssueHistory.d.ts +7 -0
- package/dist/movethewheels/components/stock-observation/StockIssueReadPanel.d.ts +5 -0
- package/dist/movethewheels/components/trip-utilization/TripReportForm.d.ts +6 -0
- package/dist/movethewheels/components/trip-utilization/TripReportHistory.d.ts +14 -0
- package/dist/movethewheels/components/trip-utilization/TripReportSummary.d.ts +5 -0
- package/dist/movethewheels/components/trip-utilization/TripSegmentFields.d.ts +9 -0
- package/dist/movethewheels/hooks/useConsolidationAction.d.ts +19 -0
- package/dist/movethewheels/hooks/useContainerCondition.d.ts +21 -0
- package/dist/movethewheels/hooks/useContainerLifecycle.d.ts +40 -0
- package/dist/movethewheels/hooks/useEmptyReuseAction.d.ts +14 -0
- package/dist/movethewheels/hooks/useFreightRecoveryAction.d.ts +23 -0
- package/dist/movethewheels/hooks/useProcedureAction.d.ts +18 -0
- package/dist/movethewheels/hooks/useProcedureSelection.d.ts +51 -0
- package/dist/movethewheels/hooks/useReuseRecoveryAction.d.ts +18 -0
- package/dist/movethewheels/pages/ConsolidationPage.d.ts +1 -0
- package/dist/movethewheels/pages/ContainerConditionPage.d.ts +1 -0
- package/dist/movethewheels/pages/ContainersPage.d.ts +2 -0
- package/dist/movethewheels/pages/EmptyReusePage.d.ts +1 -0
- package/dist/movethewheels/pages/FreeTimePage.d.ts +1 -0
- package/dist/movethewheels/pages/FreightEstimatePage.d.ts +1 -0
- package/dist/movethewheels/pages/LogisticsProceduresPage.d.ts +1 -0
- package/dist/movethewheels/pages/PendingPickPage.d.ts +1 -0
- package/dist/movethewheels/pages/StockBindingPage.d.ts +1 -0
- package/dist/movethewheels/pages/StockObservationsPage.d.ts +1 -0
- package/dist/movethewheels/pages/TripUtilizationPage.d.ts +1 -0
- package/dist/movethewheels/utils/consolidationHistoryTarget.d.ts +12 -0
- package/dist/movethewheels/utils/consolidationInput.d.ts +15 -0
- package/dist/movethewheels/utils/consolidationLot.d.ts +3 -0
- package/dist/movethewheels/utils/consolidationPins.d.ts +20 -0
- package/dist/movethewheels/utils/consolidationRecovery.d.ts +5 -0
- package/dist/movethewheels/utils/consolidationReportHead.d.ts +5 -0
- package/dist/movethewheels/utils/freeTimeDate.d.ts +1 -0
- package/dist/movethewheels/utils/freightAcknowledgement.d.ts +2 -0
- package/dist/movethewheels/utils/freightDraft.d.ts +36 -0
- package/dist/movethewheels/utils/freightRecovery.d.ts +5 -0
- package/dist/movethewheels/utils/graphqlClient.d.ts +2 -1
- package/dist/movethewheels/utils/pendingPickDraft.d.ts +8 -0
- package/dist/movethewheels/utils/procedureInput.d.ts +18 -0
- package/dist/movethewheels/utils/procedureRecovery.d.ts +5 -0
- package/dist/movethewheels/utils/reuseAttempt.d.ts +7 -0
- package/dist/movethewheels/utils/reuseForm.d.ts +6 -0
- package/dist/movethewheels/utils/reuseRecovery.d.ts +26 -0
- package/dist/movethewheels/utils/stockBindingForm.d.ts +23 -0
- package/dist/movethewheels/utils/stockBindingLabels.d.ts +10 -0
- package/dist/movethewheels/utils/stockObservationForm.d.ts +5 -0
- package/dist/movethewheels/utils/tripDraftContext.d.ts +25 -0
- package/dist/movethewheels/utils/tripUtilizationForm.d.ts +6 -0
- package/dist/node_modules/@react-leaflet/core/lib/component.js +5 -5
- package/dist/node_modules/fast-equals/dist/es/index.js +87 -74
- package/dist/node_modules/leaflet/dist/leaflet-src.js +8 -5
- package/dist/node_modules/lodash/_Stack.js +2 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/clipboard-list.js +35 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/repeat-2.js +22 -0
- package/dist/node_modules/react-leaflet/lib/MapContainer.js +3 -3
- package/dist/node_modules/react-smooth/es6/Animate.js +2 -2
- package/dist/node_modules/recharts/es6/cartesian/Area.js +13 -13
- package/dist/node_modules/recharts/es6/cartesian/Bar.js +9 -9
- package/dist/node_modules/recharts/es6/cartesian/Brush.js +12 -12
- package/dist/node_modules/recharts/es6/cartesian/CartesianAxis.js +7 -7
- package/dist/node_modules/recharts/es6/cartesian/CartesianGrid.js +13 -13
- package/dist/node_modules/recharts/es6/cartesian/ErrorBar.js +4 -4
- package/dist/node_modules/recharts/es6/cartesian/Line.js +10 -10
- package/dist/node_modules/recharts/es6/cartesian/ReferenceArea.js +3 -3
- package/dist/node_modules/recharts/es6/cartesian/ReferenceDot.js +3 -3
- package/dist/node_modules/recharts/es6/cartesian/ReferenceLine.js +4 -4
- package/dist/node_modules/recharts/es6/cartesian/XAxis.js +3 -3
- package/dist/node_modules/recharts/es6/cartesian/YAxis.js +3 -3
- package/dist/node_modules/recharts/es6/chart/AccessibilityManager.js +1 -1
- package/dist/node_modules/recharts/es6/chart/generateCategoricalChart.js +22 -22
- package/dist/node_modules/recharts/es6/component/Cursor.js +1 -1
- package/dist/node_modules/recharts/es6/component/DefaultLegendContent.js +11 -11
- package/dist/node_modules/recharts/es6/component/DefaultTooltipContent.js +6 -6
- package/dist/node_modules/recharts/es6/component/Label.js +14 -14
- package/dist/node_modules/recharts/es6/component/LabelList.js +6 -6
- package/dist/node_modules/recharts/es6/component/Legend.js +5 -5
- package/dist/node_modules/recharts/es6/component/ResponsiveContainer.js +3 -3
- package/dist/node_modules/recharts/es6/component/Text.js +2 -2
- package/dist/node_modules/recharts/es6/component/Tooltip.js +3 -3
- package/dist/node_modules/recharts/es6/component/TooltipBoundingBox.js +2 -2
- package/dist/node_modules/recharts/es6/container/Layer.js +2 -2
- package/dist/node_modules/recharts/es6/container/Surface.js +2 -2
- package/dist/node_modules/recharts/es6/context/chartLayoutContext.js +2 -2
- package/dist/node_modules/recharts/es6/polar/Pie.js +13 -13
- package/dist/node_modules/recharts/es6/polar/PolarAngleAxis.js +8 -8
- package/dist/node_modules/recharts/es6/polar/PolarRadiusAxis.js +6 -6
- package/dist/node_modules/recharts/es6/shape/Cross.js +1 -1
- package/dist/node_modules/recharts/es6/shape/Curve.js +1 -1
- package/dist/node_modules/recharts/es6/shape/Dot.js +1 -1
- package/dist/node_modules/recharts/es6/shape/Polygon.js +4 -4
- package/dist/node_modules/recharts/es6/shape/Rectangle.js +4 -4
- package/dist/node_modules/recharts/es6/shape/Sector.js +1 -1
- package/dist/node_modules/recharts/es6/shape/Symbols.js +1 -1
- package/dist/node_modules/recharts/es6/shape/Trapezoid.js +4 -4
- package/dist/node_modules/recharts/es6/util/ActiveShapeUtils.js +9 -9
- package/dist/node_modules/recharts/es6/util/BarUtils.js +1 -1
- package/dist/node_modules/recharts/es6/util/CartesianUtils.js +1 -1
- package/dist/node_modules/recharts/es6/util/PolarUtils.js +1 -1
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +2 -2
- package/dist/node_modules/recharts/es6/util/ReduceCSSCalc.js +1 -1
- package/dist/node_modules/recharts/es6/util/types.js +1 -1
- package/dist/node_modules/{react-is → recharts/node_modules/react-is}/cjs/react-is.development.js +2 -2
- package/dist/node_modules/{react-is → recharts/node_modules/react-is}/cjs/react-is.production.min.js +2 -2
- package/dist/node_modules/{react-is → recharts/node_modules/react-is}/index.js +2 -2
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +97 -18
- package/dist/node_modules/zustand/esm/middleware.js +2 -2
- package/dist/pages/ConsolidationPage.js +76 -0
- package/dist/pages/ContainerConditionPage.js +972 -0
- package/dist/pages/ContainersPage.js +522 -0
- package/dist/pages/EmptyReusePage.js +777 -0
- package/dist/pages/FreeTimePage.js +657 -0
- package/dist/pages/FreightEstimatePage.js +284 -0
- package/dist/pages/InventoryPage.js +77 -73
- package/dist/pages/LogisticsProceduresPage.js +100 -0
- package/dist/pages/PendingPickPage.js +155 -0
- package/dist/pages/StockBindingPage.js +236 -0
- package/dist/pages/StockObservationsPage.js +168 -0
- package/dist/pages/TripUtilizationPage.js +227 -0
- package/dist/src/generated/consolidation-operations.js +505 -0
- package/dist/src/generated/container-condition-operations.js +208 -0
- package/dist/src/generated/container-operations.js +101 -0
- package/dist/src/generated/empty-reuse-operations.js +749 -0
- package/dist/src/generated/free-time-operations.js +235 -0
- package/dist/src/generated/freight-cost-operations.js +325 -0
- package/dist/src/generated/logistics-procedure-operations.js +362 -0
- package/dist/src/generated/pending-pick-operations.js +1128 -0
- package/dist/src/generated/stock-binding-operations.js +175 -0
- package/dist/src/generated/stock-observation-operations.js +93 -0
- package/dist/src/generated/trip-utilization-operations.js +140 -0
- package/dist/src/generated/wspace-operations.js +708 -0
- package/dist/utils/consolidationHistoryTarget.js +27 -0
- package/dist/utils/consolidationInput.js +21 -0
- package/dist/utils/consolidationLot.js +29 -0
- package/dist/utils/consolidationPins.js +13 -0
- package/dist/utils/consolidationRecovery.js +40 -0
- package/dist/utils/consolidationReportHead.js +18 -0
- package/dist/utils/freeTimeDate.js +26 -0
- package/dist/utils/freightAcknowledgement.js +8 -0
- package/dist/utils/freightDraft.js +125 -0
- package/dist/utils/freightRecovery.js +36 -0
- package/dist/utils/graphqlClient.js +28 -28
- package/dist/utils/pendingPickDraft.js +46 -0
- package/dist/utils/procedureInput.js +43 -0
- package/dist/utils/procedureRecovery.js +42 -0
- package/dist/utils/reuseAttempt.js +20 -0
- package/dist/utils/reuseForm.js +25 -0
- package/dist/utils/reuseRecovery.js +71 -0
- package/dist/utils/stockBindingForm.js +142 -0
- package/dist/utils/stockBindingLabels.js +23 -0
- package/dist/utils/stockObservationForm.js +55 -0
- package/dist/utils/tripDraftContext.js +19 -0
- package/dist/utils/tripUtilizationForm.js +60 -0
- package/package.json +19 -5
- package/src/generated/consolidation-operations.ts +1138 -0
- package/src/generated/container-condition-operations.ts +771 -0
- package/src/generated/container-operations.ts +376 -0
- package/src/generated/empty-reuse-operations.ts +1648 -0
- package/src/generated/free-time-operations.ts +814 -0
- package/src/generated/freight-cost-operations.ts +753 -0
- package/src/generated/logistics-procedure-operations.ts +1047 -0
- package/src/generated/pending-pick-operations.ts +1508 -0
- package/src/generated/stock-binding-operations.ts +631 -0
- package/src/generated/stock-observation-operations.ts +373 -0
- package/src/generated/trip-utilization-operations.ts +500 -0
- package/src/generated/wspace-operations.ts +116 -0
- package/src/movethewheels/MoveTheWheelsRoot.tsx +79 -0
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +22 -0
- package/src/movethewheels/components/ContainerEvidencePicker.tsx +146 -0
- package/src/movethewheels/components/FreeTimeAgreementForm.tsx +483 -0
- package/src/movethewheels/components/ReturnInstructionForm.tsx +102 -0
- package/src/movethewheels/components/ReuseControls.tsx +138 -0
- package/src/movethewheels/components/ReusePermissionForm.tsx +123 -0
- package/src/movethewheels/components/ReuseProposalForm.tsx +484 -0
- package/src/movethewheels/components/ReuseSourceFields.tsx +80 -0
- package/src/movethewheels/components/consolidation/ConsolidationHistory.tsx +159 -0
- package/src/movethewheels/components/consolidation/ConsolidationLotEditor.tsx +144 -0
- package/src/movethewheels/components/consolidation/ConsolidationManifestWorkbench.tsx +168 -0
- package/src/movethewheels/components/consolidation/ConsolidationPlanForm.tsx +185 -0
- package/src/movethewheels/components/consolidation/ConsolidationPlanWorkbench.tsx +395 -0
- package/src/movethewheels/components/consolidation/ConsolidationReportForm.tsx +124 -0
- package/src/movethewheels/components/consolidation/ConsolidationReportsWorkbench.tsx +233 -0
- package/src/movethewheels/components/consolidation/ConsolidationSummary.tsx +84 -0
- package/src/movethewheels/components/consolidation/OriginalConsolidationHistory.tsx +133 -0
- package/src/movethewheels/components/freight-cost/FreightDraftForm.tsx +224 -0
- package/src/movethewheels/components/freight-cost/FreightFields.tsx +91 -0
- package/src/movethewheels/components/freight-cost/FreightFxEditor.tsx +98 -0
- package/src/movethewheels/components/freight-cost/FreightHistory.tsx +91 -0
- package/src/movethewheels/components/freight-cost/FreightLineEditor.tsx +192 -0
- package/src/movethewheels/components/freight-cost/FreightScopeEditor.tsx +64 -0
- package/src/movethewheels/components/freight-cost/FreightTotals.tsx +68 -0
- package/src/movethewheels/components/logistics-procedure/ProcedureDecisionForm.tsx +204 -0
- package/src/movethewheels/components/logistics-procedure/ProcedureFields.tsx +43 -0
- package/src/movethewheels/components/logistics-procedure/ProcedureHistory.tsx +102 -0
- package/src/movethewheels/components/logistics-procedure/ProcedurePolicyForm.tsx +226 -0
- package/src/movethewheels/components/logistics-procedure/ProcedurePolicyWorkbench.tsx +174 -0
- package/src/movethewheels/components/logistics-procedure/ProcedureReviewWorkbench.tsx +278 -0
- package/src/movethewheels/components/logistics-procedure/ProcedureRunWorkbench.tsx +292 -0
- package/src/movethewheels/components/logistics-procedure/ProcedureSubjectPicker.tsx +111 -0
- package/src/movethewheels/components/pending-pick/PendingPickDraft.tsx +82 -0
- package/src/movethewheels/components/pending-pick/PendingPickHistory.tsx +93 -0
- package/src/movethewheels/components/pending-pick/PickCapture.tsx +70 -0
- package/src/movethewheels/components/pending-pick/PickLineSelection.tsx +130 -0
- package/src/movethewheels/components/stock-binding/StockAssessmentDraft.tsx +52 -0
- package/src/movethewheels/components/stock-binding/StockAssessmentHistory.tsx +56 -0
- package/src/movethewheels/components/stock-binding/StockAssessmentSummary.tsx +108 -0
- package/src/movethewheels/components/stock-binding/StockFactForm.tsx +186 -0
- package/src/movethewheels/components/stock-observation/StockIssueForm.tsx +103 -0
- package/src/movethewheels/components/stock-observation/StockIssueHistory.tsx +96 -0
- package/src/movethewheels/components/stock-observation/StockIssueReadPanel.tsx +72 -0
- package/src/movethewheels/components/trip-utilization/TripReportForm.tsx +116 -0
- package/src/movethewheels/components/trip-utilization/TripReportHistory.tsx +51 -0
- package/src/movethewheels/components/trip-utilization/TripReportSummary.tsx +127 -0
- package/src/movethewheels/components/trip-utilization/TripSegmentFields.tsx +118 -0
- package/src/movethewheels/hooks/useConsolidationAction.ts +196 -0
- package/src/movethewheels/hooks/useContainerCondition.ts +129 -0
- package/src/movethewheels/hooks/useContainerLifecycle.ts +291 -0
- package/src/movethewheels/hooks/useEmptyReuseAction.ts +72 -0
- package/src/movethewheels/hooks/useFreightRecoveryAction.ts +201 -0
- package/src/movethewheels/hooks/useInventory.ts +2 -20
- package/src/movethewheels/hooks/useProcedureAction.ts +196 -0
- package/src/movethewheels/hooks/useProcedureSelection.ts +75 -0
- package/src/movethewheels/hooks/useReuseRecoveryAction.ts +192 -0
- package/src/movethewheels/pages/ConsolidationPage.tsx +70 -0
- package/src/movethewheels/pages/ContainerConditionPage.tsx +959 -0
- package/src/movethewheels/pages/ContainersPage.tsx +490 -0
- package/src/movethewheels/pages/EmptyReusePage.tsx +823 -0
- package/src/movethewheels/pages/FreeTimePage.tsx +720 -0
- package/src/movethewheels/pages/FreightEstimatePage.tsx +353 -0
- package/src/movethewheels/pages/InventoryPage.tsx +16 -2
- package/src/movethewheels/pages/LogisticsProceduresPage.tsx +86 -0
- package/src/movethewheels/pages/PendingPickPage.tsx +226 -0
- package/src/movethewheels/pages/StockBindingPage.tsx +299 -0
- package/src/movethewheels/pages/StockObservationsPage.tsx +181 -0
- package/src/movethewheels/pages/TripUtilizationPage.tsx +315 -0
- package/src/movethewheels/utils/consolidationHistoryTarget.ts +39 -0
- package/src/movethewheels/utils/consolidationInput.ts +70 -0
- package/src/movethewheels/utils/consolidationLot.ts +24 -0
- package/src/movethewheels/utils/consolidationPins.ts +52 -0
- package/src/movethewheels/utils/consolidationRecovery.ts +88 -0
- package/src/movethewheels/utils/consolidationReportHead.ts +29 -0
- package/src/movethewheels/utils/freeTimeDate.ts +31 -0
- package/src/movethewheels/utils/freightAcknowledgement.ts +31 -0
- package/src/movethewheels/utils/freightDraft.ts +170 -0
- package/src/movethewheels/utils/freightRecovery.ts +79 -0
- package/src/movethewheels/utils/graphqlClient.ts +14 -5
- package/src/movethewheels/utils/pendingPickDraft.ts +61 -0
- package/src/movethewheels/utils/procedureInput.ts +98 -0
- package/src/movethewheels/utils/procedureRecovery.ts +92 -0
- package/src/movethewheels/utils/reuseAttempt.ts +29 -0
- package/src/movethewheels/utils/reuseForm.ts +30 -0
- package/src/movethewheels/utils/reuseRecovery.ts +151 -0
- package/src/movethewheels/utils/stockBindingForm.ts +209 -0
- package/src/movethewheels/utils/stockBindingLabels.ts +41 -0
- package/src/movethewheels/utils/stockObservationForm.ts +73 -0
- package/src/movethewheels/utils/tripDraftContext.ts +61 -0
- package/src/movethewheels/utils/tripUtilizationForm.ts +105 -0
- package/src/operations/condition/container-condition.graphql +41 -0
- package/src/operations/consolidation/consolidation.graphql +490 -0
- package/src/operations/container/container-lifecycle.graphql +80 -0
- package/src/operations/empty-reuse/empty-reuse.graphql +737 -0
- package/src/operations/free-time/free-time.graphql +47 -0
- package/src/operations/freight-cost/freight.graphql +6 -0
- package/src/operations/logistics-procedure/procedure.graphql +15 -0
- package/src/operations/pending-pick/pending-pick.graphql +1122 -0
- package/src/operations/stock-binding/stock-binding.graphql +160 -0
- package/src/operations/stock-observation/stock-observation.graphql +20 -0
- package/src/operations/trip-utilization/trip-utilization.graphql +126 -0
- package/src/operations/wspace/container-evidence.graphql +6 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { MtwFreightCurrencyInput } from '../../../generated/freight-cost-operations';
|
|
3
|
+
export const freightInput = 'mt-1 min-h-11 w-full rounded border p-2';
|
|
4
|
+
export function FreightText({
|
|
5
|
+
label,
|
|
6
|
+
value,
|
|
7
|
+
onChange,
|
|
8
|
+
required = false,
|
|
9
|
+
type = 'text',
|
|
10
|
+
disabled = false,
|
|
11
|
+
}: {
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
onChange: (value: string) => void;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
type?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}) {
|
|
19
|
+
return (
|
|
20
|
+
<label className="block text-sm">
|
|
21
|
+
{label}
|
|
22
|
+
<input
|
|
23
|
+
className={freightInput}
|
|
24
|
+
aria-label={label}
|
|
25
|
+
value={value}
|
|
26
|
+
type={type}
|
|
27
|
+
step={type === 'datetime-local' ? 1 : undefined}
|
|
28
|
+
required={required}
|
|
29
|
+
disabled={disabled}
|
|
30
|
+
onChange={(e) => onChange(e.target.value)}
|
|
31
|
+
/>
|
|
32
|
+
</label>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
export function FreightSelect({
|
|
36
|
+
label,
|
|
37
|
+
value,
|
|
38
|
+
onChange,
|
|
39
|
+
children,
|
|
40
|
+
}: {
|
|
41
|
+
label: string;
|
|
42
|
+
value: string;
|
|
43
|
+
onChange: (value: string) => void;
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
}) {
|
|
46
|
+
return (
|
|
47
|
+
<label className="block text-sm">
|
|
48
|
+
{label}
|
|
49
|
+
<select
|
|
50
|
+
className={freightInput}
|
|
51
|
+
aria-label={label}
|
|
52
|
+
value={value}
|
|
53
|
+
onChange={(e) => onChange(e.target.value)}
|
|
54
|
+
>
|
|
55
|
+
{children}
|
|
56
|
+
</select>
|
|
57
|
+
</label>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
export function FreightCurrency({
|
|
61
|
+
label,
|
|
62
|
+
value,
|
|
63
|
+
onChange,
|
|
64
|
+
}: {
|
|
65
|
+
label: string;
|
|
66
|
+
value: MtwFreightCurrencyInput;
|
|
67
|
+
onChange: (value: MtwFreightCurrencyInput) => void;
|
|
68
|
+
}) {
|
|
69
|
+
return (
|
|
70
|
+
<fieldset className="grid gap-3 md:grid-cols-2">
|
|
71
|
+
<legend className="mb-2 font-medium">{label}</legend>
|
|
72
|
+
<FreightText
|
|
73
|
+
label={`${label} code`}
|
|
74
|
+
value={value.code}
|
|
75
|
+
onChange={(code) => onChange({ ...value, code: code.toUpperCase() })}
|
|
76
|
+
required
|
|
77
|
+
/>
|
|
78
|
+
<FreightSelect
|
|
79
|
+
label={`${label} decimal places`}
|
|
80
|
+
value={String(value.minorUnitDigits)}
|
|
81
|
+
onChange={(digits) => onChange({ ...value, minorUnitDigits: Number(digits) })}
|
|
82
|
+
>
|
|
83
|
+
{[0, 1, 2, 3, 4].map((digits) => (
|
|
84
|
+
<option key={digits} value={digits}>
|
|
85
|
+
{digits}
|
|
86
|
+
</option>
|
|
87
|
+
))}
|
|
88
|
+
</FreightSelect>
|
|
89
|
+
</fieldset>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import type {
|
|
3
|
+
MtwFreightFactsInput,
|
|
4
|
+
MtwFreightFxInput,
|
|
5
|
+
} from '../../../generated/freight-cost-operations';
|
|
6
|
+
import { Button } from '../ui';
|
|
7
|
+
import { FreightCurrency, FreightText } from './FreightFields';
|
|
8
|
+
import { freightInstant, freightLocalTime, newFreightFx } from '../../utils/freightDraft';
|
|
9
|
+
export function FreightFxEditor({
|
|
10
|
+
value,
|
|
11
|
+
onChange,
|
|
12
|
+
}: {
|
|
13
|
+
value: MtwFreightFactsInput['fx'];
|
|
14
|
+
onChange: (value: MtwFreightFactsInput['fx']) => void;
|
|
15
|
+
}) {
|
|
16
|
+
const [keys, setKeys] = useState(() => value.map(() => crypto.randomUUID()));
|
|
17
|
+
const patch = (index: number, values: Partial<MtwFreightFxInput>) =>
|
|
18
|
+
onChange(value.map((row, i) => (i === index ? { ...row, ...values } : row)));
|
|
19
|
+
return (
|
|
20
|
+
<section className="space-y-4">
|
|
21
|
+
<h3 className="font-semibold">Dated currency conversion</h3>
|
|
22
|
+
<p className="text-sm">
|
|
23
|
+
One unit of the source currency equals the stated rate in the target currency. No reverse
|
|
24
|
+
rate is inferred.
|
|
25
|
+
</p>
|
|
26
|
+
{value.map((row, index) => (
|
|
27
|
+
<fieldset key={keys[index]} className="space-y-3 rounded border p-3">
|
|
28
|
+
<legend>Conversion {index + 1}</legend>
|
|
29
|
+
<FreightCurrency
|
|
30
|
+
label="From currency"
|
|
31
|
+
value={row.fromCurrency}
|
|
32
|
+
onChange={(fromCurrency) => patch(index, { fromCurrency })}
|
|
33
|
+
/>
|
|
34
|
+
<FreightCurrency
|
|
35
|
+
label="To reporting currency"
|
|
36
|
+
value={row.toCurrency}
|
|
37
|
+
onChange={(toCurrency) => patch(index, { toCurrency })}
|
|
38
|
+
/>
|
|
39
|
+
<FreightText
|
|
40
|
+
label="Conversion rate"
|
|
41
|
+
value={row.rate}
|
|
42
|
+
onChange={(rate) => patch(index, { rate })}
|
|
43
|
+
/>
|
|
44
|
+
<div className="grid gap-3 md:grid-cols-3">
|
|
45
|
+
{(['observedAt', 'effectiveFrom', 'effectiveUntil'] as const).map((field) => (
|
|
46
|
+
<FreightText
|
|
47
|
+
key={field}
|
|
48
|
+
label={
|
|
49
|
+
field === 'observedAt'
|
|
50
|
+
? 'Rate observed at'
|
|
51
|
+
: field === 'effectiveFrom'
|
|
52
|
+
? 'Rate applies from'
|
|
53
|
+
: 'Rate applies until'
|
|
54
|
+
}
|
|
55
|
+
type="datetime-local"
|
|
56
|
+
value={freightLocalTime(row[field])}
|
|
57
|
+
onChange={(v) => {
|
|
58
|
+
if (v) patch(index, { [field]: freightInstant(v) });
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
))}
|
|
62
|
+
</div>
|
|
63
|
+
<FreightText
|
|
64
|
+
label="Conversion source"
|
|
65
|
+
value={row.sourceReference}
|
|
66
|
+
onChange={(sourceReference) => patch(index, { sourceReference })}
|
|
67
|
+
/>
|
|
68
|
+
<FreightText
|
|
69
|
+
label="Conversion source version"
|
|
70
|
+
value={row.sourceRevision}
|
|
71
|
+
onChange={(sourceRevision) => patch(index, { sourceRevision })}
|
|
72
|
+
/>
|
|
73
|
+
<Button
|
|
74
|
+
type="button"
|
|
75
|
+
variant="outline"
|
|
76
|
+
onClick={() => {
|
|
77
|
+
setKeys(keys.filter((_, i) => i !== index));
|
|
78
|
+
onChange(value.filter((_, i) => i !== index));
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
Remove conversion
|
|
82
|
+
</Button>
|
|
83
|
+
</fieldset>
|
|
84
|
+
))}
|
|
85
|
+
<Button
|
|
86
|
+
type="button"
|
|
87
|
+
variant="outline"
|
|
88
|
+
disabled={value.length >= 20}
|
|
89
|
+
onClick={() => {
|
|
90
|
+
setKeys([...keys, crypto.randomUUID()]);
|
|
91
|
+
onChange([...value, newFreightFx()]);
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
Add sourced conversion
|
|
95
|
+
</Button>
|
|
96
|
+
</section>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { FreightVersionQuery } from '../../../generated/freight-cost-operations';
|
|
2
|
+
import { FreightTotals } from './FreightTotals';
|
|
3
|
+
import { freightLabel, freightMoney } from '../../utils/freightDraft';
|
|
4
|
+
export function FreightHistory({
|
|
5
|
+
record,
|
|
6
|
+
}: {
|
|
7
|
+
record: FreightVersionQuery['mtwFreightEstimateVersion'];
|
|
8
|
+
}) {
|
|
9
|
+
return (
|
|
10
|
+
<article className="min-w-0 space-y-4 break-words rounded border p-4">
|
|
11
|
+
<h2 className="text-lg font-semibold">
|
|
12
|
+
{record.facts.title} — version {record.version}
|
|
13
|
+
</h2>
|
|
14
|
+
<p>
|
|
15
|
+
{record.shipmentCapture.shipmentNumber} / {record.shipmentCapture.primaryMode} — captured
|
|
16
|
+
shipment context
|
|
17
|
+
</p>
|
|
18
|
+
<p>
|
|
19
|
+
{record.facts.kind === 'QUOTE' ? 'Reported quote' : 'Estimate'};{' '}
|
|
20
|
+
{freightLabel(record.validityAtRead)}. This record does not accept a quote or confirm
|
|
21
|
+
capacity.
|
|
22
|
+
</p>
|
|
23
|
+
<p>{record.facts.commercialScope}</p>
|
|
24
|
+
<p>
|
|
25
|
+
Source: {record.facts.sourceReference} / {record.facts.sourceRevision}
|
|
26
|
+
</p>
|
|
27
|
+
<p>
|
|
28
|
+
Price at {record.facts.pricingAt}; recorded {record.recordedAt} by {record.createdBy} (
|
|
29
|
+
{freightLabel(record.actorProvenance)}).
|
|
30
|
+
</p>
|
|
31
|
+
<FreightTotals value={record.totals} currency={record.facts.reportingCurrency} />
|
|
32
|
+
<details>
|
|
33
|
+
<summary className="min-h-11 cursor-pointer font-medium">
|
|
34
|
+
Cost facts and evidence recorded with this version
|
|
35
|
+
</summary>
|
|
36
|
+
<div className="space-y-3">
|
|
37
|
+
{record.facts.lines.map((line) => (
|
|
38
|
+
<div key={line.id} className="rounded border p-3">
|
|
39
|
+
<h3 className="font-medium">
|
|
40
|
+
{line.description} / {freightLabel(line.category)}
|
|
41
|
+
</h3>
|
|
42
|
+
<p>
|
|
43
|
+
{freightLabel(line.disposition)}; payer {line.payerLabel ?? 'Unknown'} (
|
|
44
|
+
{line.payerReference ?? 'Unknown reference'}).
|
|
45
|
+
</p>
|
|
46
|
+
<p>
|
|
47
|
+
Reported amount: {freightMoney(line.amountMinor, line.currency.minorUnitDigits)}{' '}
|
|
48
|
+
{line.currency.code}; {freightLabel(line.amountBasis)}. Quantity{' '}
|
|
49
|
+
{line.quantity ?? 'Unknown'} {line.unit ?? 'unknown unit'} × rate{' '}
|
|
50
|
+
{line.unitRateMajor ?? 'Unknown'}.
|
|
51
|
+
</p>
|
|
52
|
+
<p>
|
|
53
|
+
Source {line.sourceReference ?? 'Unknown'} /{' '}
|
|
54
|
+
{line.sourceRevision ?? 'Unknown version'}
|
|
55
|
+
{line.inclusionParentLineId
|
|
56
|
+
? `; included in recorded line ${line.inclusionParentLineId}`
|
|
57
|
+
: ''}
|
|
58
|
+
.
|
|
59
|
+
</p>
|
|
60
|
+
{line.zeroReason && <p>Zero reason: {line.zeroReason}</p>}
|
|
61
|
+
</div>
|
|
62
|
+
))}
|
|
63
|
+
{record.facts.requirements.map((row) => (
|
|
64
|
+
<p key={row.category}>
|
|
65
|
+
{freightLabel(row.category)}: {freightLabel(row.status)} —{' '}
|
|
66
|
+
{row.reason ?? 'No explanation recorded'}; source {row.sourceReference ?? 'Unknown'} /{' '}
|
|
67
|
+
{row.sourceRevision ?? 'Unknown'}
|
|
68
|
+
</p>
|
|
69
|
+
))}
|
|
70
|
+
<p>
|
|
71
|
+
Quote occurred {record.facts.quotedAt ?? 'Unknown'}; validity{' '}
|
|
72
|
+
{record.facts.validFrom ?? 'Unknown'} to {record.facts.validUntil ?? 'Unknown'}.
|
|
73
|
+
</p>
|
|
74
|
+
{record.facts.fx.map((row) => (
|
|
75
|
+
<p key={row.fromCurrency.code}>
|
|
76
|
+
1 {row.fromCurrency.code} = {row.rate} {row.toCurrency.code}; observed{' '}
|
|
77
|
+
{row.observedAt}; applicable {row.effectiveFrom} to {row.effectiveUntil}; source{' '}
|
|
78
|
+
{row.sourceReference}/{row.sourceRevision}
|
|
79
|
+
</p>
|
|
80
|
+
))}
|
|
81
|
+
{record.evidence.map((item) => (
|
|
82
|
+
<p key={JSON.stringify([item.fileId, item.versionId])}>
|
|
83
|
+
Recorded evidence: file {item.fileId}, version {item.versionId}; readable/integrity
|
|
84
|
+
check at {item.checkedAt}.
|
|
85
|
+
</p>
|
|
86
|
+
))}
|
|
87
|
+
</div>
|
|
88
|
+
</details>
|
|
89
|
+
</article>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import type { MtwFreightLineInput } from '../../../generated/freight-cost-operations';
|
|
2
|
+
import { Button } from '../ui';
|
|
3
|
+
import { FreightCurrency, FreightSelect, FreightText, freightInput } from './FreightFields';
|
|
4
|
+
import {
|
|
5
|
+
fixedFreightMinor,
|
|
6
|
+
isFreightDecimalZero,
|
|
7
|
+
freightCategories,
|
|
8
|
+
freightLabel,
|
|
9
|
+
freightMoney,
|
|
10
|
+
freightNullable,
|
|
11
|
+
} from '../../utils/freightDraft';
|
|
12
|
+
export function FreightLineEditor({
|
|
13
|
+
line,
|
|
14
|
+
others,
|
|
15
|
+
onChange,
|
|
16
|
+
onRemove,
|
|
17
|
+
}: {
|
|
18
|
+
line: MtwFreightLineInput;
|
|
19
|
+
others: MtwFreightLineInput[];
|
|
20
|
+
onChange: (line: MtwFreightLineInput) => void;
|
|
21
|
+
onRemove: () => void;
|
|
22
|
+
}) {
|
|
23
|
+
const patch = (values: Partial<MtwFreightLineInput>) => onChange({ ...line, ...values });
|
|
24
|
+
return (
|
|
25
|
+
<fieldset className="min-w-0 space-y-4 rounded border p-4">
|
|
26
|
+
<legend className="px-1 font-medium">{line.description || 'Cost item'}</legend>
|
|
27
|
+
<div className="grid gap-3 md:grid-cols-2">
|
|
28
|
+
<FreightText
|
|
29
|
+
label="Cost description"
|
|
30
|
+
value={line.description}
|
|
31
|
+
required
|
|
32
|
+
onChange={(description) => patch({ description })}
|
|
33
|
+
/>
|
|
34
|
+
<FreightSelect
|
|
35
|
+
label="Cost category"
|
|
36
|
+
value={line.category}
|
|
37
|
+
onChange={(category) => {
|
|
38
|
+
const found = freightCategories.find((item) => item === category);
|
|
39
|
+
if (found) patch({ category: found });
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
{freightCategories.map((item) => (
|
|
43
|
+
<option key={item} value={item}>
|
|
44
|
+
{freightLabel(item)}
|
|
45
|
+
</option>
|
|
46
|
+
))}
|
|
47
|
+
</FreightSelect>
|
|
48
|
+
</div>
|
|
49
|
+
<FreightSelect
|
|
50
|
+
label="How is this cost included?"
|
|
51
|
+
value={line.disposition}
|
|
52
|
+
onChange={(value) => {
|
|
53
|
+
if (
|
|
54
|
+
value === 'ADDITIONAL' ||
|
|
55
|
+
value === 'UNKNOWN' ||
|
|
56
|
+
value === 'EXCLUDED' ||
|
|
57
|
+
value === 'INCLUDED_IN_LINE'
|
|
58
|
+
)
|
|
59
|
+
patch({ disposition: value, inclusionParentLineId: null });
|
|
60
|
+
}}
|
|
61
|
+
>
|
|
62
|
+
<option value="UNKNOWN">Unknown</option>
|
|
63
|
+
<option value="ADDITIONAL">Added to the total</option>
|
|
64
|
+
<option value="INCLUDED_IN_LINE">Included in another cost item</option>
|
|
65
|
+
<option value="EXCLUDED">Excluded from this estimate</option>
|
|
66
|
+
</FreightSelect>
|
|
67
|
+
{line.disposition === 'INCLUDED_IN_LINE' && (
|
|
68
|
+
<FreightSelect
|
|
69
|
+
label="Included in cost item"
|
|
70
|
+
value={line.inclusionParentLineId ?? ''}
|
|
71
|
+
onChange={(value) => patch({ inclusionParentLineId: freightNullable(value) })}
|
|
72
|
+
>
|
|
73
|
+
<option value="">Choose the sourced parent cost</option>
|
|
74
|
+
{others
|
|
75
|
+
.filter((item) => item.id !== line.id && item.disposition === 'ADDITIONAL')
|
|
76
|
+
.map((item) => (
|
|
77
|
+
<option key={item.id} value={item.id}>
|
|
78
|
+
{item.description}
|
|
79
|
+
</option>
|
|
80
|
+
))}
|
|
81
|
+
</FreightSelect>
|
|
82
|
+
)}
|
|
83
|
+
<FreightCurrency
|
|
84
|
+
label="Cost currency convention"
|
|
85
|
+
value={line.currency}
|
|
86
|
+
onChange={(currency) => patch({ currency, amountMinor: null })}
|
|
87
|
+
/>
|
|
88
|
+
<FreightSelect
|
|
89
|
+
label="Amount source"
|
|
90
|
+
value={line.amountBasis}
|
|
91
|
+
onChange={(value) => {
|
|
92
|
+
if (value === 'UNKNOWN' || value === 'CALCULATED' || value === 'SOURCED_FIXED')
|
|
93
|
+
patch({
|
|
94
|
+
amountBasis: value,
|
|
95
|
+
amountMinor: null,
|
|
96
|
+
quantity: null,
|
|
97
|
+
unit: null,
|
|
98
|
+
unitRateMajor: null,
|
|
99
|
+
});
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
<option value="UNKNOWN">Amount unknown</option>
|
|
103
|
+
<option value="SOURCED_FIXED">Amount stated by the source</option>
|
|
104
|
+
<option value="CALCULATED">Quantity × sourced rate</option>
|
|
105
|
+
</FreightSelect>
|
|
106
|
+
{line.amountBasis === 'SOURCED_FIXED' && (
|
|
107
|
+
<label className="block text-sm">
|
|
108
|
+
Sourced amount
|
|
109
|
+
<input
|
|
110
|
+
key={`${line.currency.code}:${line.currency.minorUnitDigits}:${line.amountBasis}`}
|
|
111
|
+
className={freightInput}
|
|
112
|
+
aria-label="Sourced amount"
|
|
113
|
+
defaultValue={
|
|
114
|
+
line.amountMinor === null || line.amountMinor === undefined
|
|
115
|
+
? ''
|
|
116
|
+
: freightMoney(line.amountMinor, line.currency.minorUnitDigits)
|
|
117
|
+
}
|
|
118
|
+
onChange={(event) => {
|
|
119
|
+
try {
|
|
120
|
+
patch({
|
|
121
|
+
amountMinor: fixedFreightMinor(event.target.value, line.currency.minorUnitDigits),
|
|
122
|
+
});
|
|
123
|
+
event.target.setCustomValidity('');
|
|
124
|
+
} catch (failure) {
|
|
125
|
+
patch({ amountMinor: null });
|
|
126
|
+
event.target.setCustomValidity(
|
|
127
|
+
failure instanceof Error ? failure.message : 'Invalid amount'
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
}}
|
|
131
|
+
/>
|
|
132
|
+
</label>
|
|
133
|
+
)}
|
|
134
|
+
{line.amountBasis === 'CALCULATED' && (
|
|
135
|
+
<div className="grid gap-3 md:grid-cols-3">
|
|
136
|
+
<FreightText
|
|
137
|
+
label="Quantity (blank means unknown)"
|
|
138
|
+
value={line.quantity ?? ''}
|
|
139
|
+
onChange={(value) =>
|
|
140
|
+
patch({
|
|
141
|
+
quantity: freightNullable(value),
|
|
142
|
+
amountMinor: isFreightDecimalZero(value) ? '0' : null,
|
|
143
|
+
})
|
|
144
|
+
}
|
|
145
|
+
/>
|
|
146
|
+
<FreightText
|
|
147
|
+
label="Quantity unit"
|
|
148
|
+
value={line.unit ?? ''}
|
|
149
|
+
onChange={(value) => patch({ unit: freightNullable(value) })}
|
|
150
|
+
/>
|
|
151
|
+
<FreightText
|
|
152
|
+
label="Rate per quantity unit"
|
|
153
|
+
value={line.unitRateMajor ?? ''}
|
|
154
|
+
onChange={(value) => patch({ unitRateMajor: freightNullable(value) })}
|
|
155
|
+
/>
|
|
156
|
+
</div>
|
|
157
|
+
)}
|
|
158
|
+
{(isFreightDecimalZero(line.quantity) || line.amountMinor === '0') && (
|
|
159
|
+
<FreightText
|
|
160
|
+
label="Reason for the sourced zero"
|
|
161
|
+
value={line.zeroReason ?? ''}
|
|
162
|
+
onChange={(value) => patch({ zeroReason: freightNullable(value) })}
|
|
163
|
+
/>
|
|
164
|
+
)}
|
|
165
|
+
<div className="grid gap-3 md:grid-cols-2">
|
|
166
|
+
<FreightText
|
|
167
|
+
label="Payer reference"
|
|
168
|
+
value={line.payerReference ?? ''}
|
|
169
|
+
onChange={(value) => patch({ payerReference: freightNullable(value) })}
|
|
170
|
+
/>
|
|
171
|
+
<FreightText
|
|
172
|
+
label="Payer name"
|
|
173
|
+
value={line.payerLabel ?? ''}
|
|
174
|
+
onChange={(value) => patch({ payerLabel: freightNullable(value) })}
|
|
175
|
+
/>
|
|
176
|
+
<FreightText
|
|
177
|
+
label="Cost inclusion source"
|
|
178
|
+
value={line.sourceReference ?? ''}
|
|
179
|
+
onChange={(value) => patch({ sourceReference: freightNullable(value) })}
|
|
180
|
+
/>
|
|
181
|
+
<FreightText
|
|
182
|
+
label="Cost source version"
|
|
183
|
+
value={line.sourceRevision ?? ''}
|
|
184
|
+
onChange={(value) => patch({ sourceRevision: freightNullable(value) })}
|
|
185
|
+
/>
|
|
186
|
+
</div>
|
|
187
|
+
<Button type="button" variant="outline" onClick={onRemove}>
|
|
188
|
+
Remove cost item
|
|
189
|
+
</Button>
|
|
190
|
+
</fieldset>
|
|
191
|
+
);
|
|
192
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
MtwFreightFactsInput,
|
|
3
|
+
MtwFreightRequirementInput,
|
|
4
|
+
} from '../../../generated/freight-cost-operations';
|
|
5
|
+
import { FreightSelect, FreightText } from './FreightFields';
|
|
6
|
+
import { freightLabel, freightNullable } from '../../utils/freightDraft';
|
|
7
|
+
export function FreightScopeEditor({
|
|
8
|
+
value,
|
|
9
|
+
onChange,
|
|
10
|
+
}: {
|
|
11
|
+
value: MtwFreightFactsInput['requirements'];
|
|
12
|
+
onChange: (value: MtwFreightFactsInput['requirements']) => void;
|
|
13
|
+
}) {
|
|
14
|
+
const patch = (
|
|
15
|
+
category: MtwFreightRequirementInput['category'],
|
|
16
|
+
changes: Partial<MtwFreightRequirementInput>
|
|
17
|
+
) => onChange(value.map((item) => (item.category === category ? { ...item, ...changes } : item)));
|
|
18
|
+
return (
|
|
19
|
+
<section className="space-y-4">
|
|
20
|
+
<h3 className="font-semibold">Costs in scope</h3>
|
|
21
|
+
<p className="text-sm">
|
|
22
|
+
Declare what the source requires or excludes. Missing scope remains unknown.
|
|
23
|
+
</p>
|
|
24
|
+
{value.map((row) => (
|
|
25
|
+
<fieldset key={row.category} className="space-y-3 rounded border p-3">
|
|
26
|
+
<legend>{freightLabel(row.category)}</legend>
|
|
27
|
+
<FreightSelect
|
|
28
|
+
label={`${freightLabel(row.category)} scope`}
|
|
29
|
+
value={row.status}
|
|
30
|
+
onChange={(status) => {
|
|
31
|
+
if (status === 'REQUIRED' || status === 'NOT_APPLICABLE' || status === 'UNKNOWN')
|
|
32
|
+
patch(row.category, { status });
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<option value="UNKNOWN">Unknown</option>
|
|
36
|
+
<option value="REQUIRED">Required cost</option>
|
|
37
|
+
<option value="NOT_APPLICABLE">Source says not applicable</option>
|
|
38
|
+
</FreightSelect>
|
|
39
|
+
{row.status !== 'UNKNOWN' && (
|
|
40
|
+
<div className="grid gap-3 md:grid-cols-2">
|
|
41
|
+
<FreightText
|
|
42
|
+
label={`${freightLabel(row.category)} source`}
|
|
43
|
+
value={row.sourceReference ?? ''}
|
|
44
|
+
onChange={(v) => patch(row.category, { sourceReference: freightNullable(v) })}
|
|
45
|
+
/>
|
|
46
|
+
<FreightText
|
|
47
|
+
label={`${freightLabel(row.category)} source version`}
|
|
48
|
+
value={row.sourceRevision ?? ''}
|
|
49
|
+
onChange={(v) => patch(row.category, { sourceRevision: freightNullable(v) })}
|
|
50
|
+
/>
|
|
51
|
+
{row.status === 'NOT_APPLICABLE' && (
|
|
52
|
+
<FreightText
|
|
53
|
+
label={`${freightLabel(row.category)} exclusion reason`}
|
|
54
|
+
value={row.reason ?? ''}
|
|
55
|
+
onChange={(v) => patch(row.category, { reason: freightNullable(v) })}
|
|
56
|
+
/>
|
|
57
|
+
)}
|
|
58
|
+
</div>
|
|
59
|
+
)}
|
|
60
|
+
</fieldset>
|
|
61
|
+
))}
|
|
62
|
+
</section>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
PreviewFreightCostsQuery,
|
|
3
|
+
MtwFreightCurrencyInput,
|
|
4
|
+
} from '../../../generated/freight-cost-operations';
|
|
5
|
+
import { freightMoney } from '../../utils/freightDraft';
|
|
6
|
+
export function FreightTotals({
|
|
7
|
+
value,
|
|
8
|
+
currency,
|
|
9
|
+
}: {
|
|
10
|
+
value: PreviewFreightCostsQuery['previewMtwFreightTotal'];
|
|
11
|
+
currency: MtwFreightCurrencyInput | null | undefined;
|
|
12
|
+
}) {
|
|
13
|
+
return (
|
|
14
|
+
<section className="space-y-3 rounded border p-4" aria-label="Freight cost preview">
|
|
15
|
+
<h3 className="text-lg font-semibold">Cost preview</h3>
|
|
16
|
+
<p>
|
|
17
|
+
{value.completeRelativeToDeclarations
|
|
18
|
+
? 'Complete against the recorded cost scope'
|
|
19
|
+
: 'Missing cost facts remain'}
|
|
20
|
+
.
|
|
21
|
+
</p>
|
|
22
|
+
<p className="font-medium">
|
|
23
|
+
Reporting total:{' '}
|
|
24
|
+
{currency
|
|
25
|
+
? `${freightMoney(value.reportingTotalMinor, currency.minorUnitDigits)} ${currency.code}`
|
|
26
|
+
: 'No reporting currency recorded'}
|
|
27
|
+
</p>
|
|
28
|
+
<p className="text-sm">
|
|
29
|
+
A complete recorded scope does not establish an all-in price, capacity or quote acceptance.
|
|
30
|
+
</p>
|
|
31
|
+
{value.subtotals.map((group) => (
|
|
32
|
+
<div
|
|
33
|
+
key={JSON.stringify([group.currency, group.payerReference])}
|
|
34
|
+
className="rounded border p-3"
|
|
35
|
+
>
|
|
36
|
+
<p>
|
|
37
|
+
{group.payerLabel ?? 'Unknown payer'} — {group.currency.code}
|
|
38
|
+
</p>
|
|
39
|
+
<p>
|
|
40
|
+
Known subtotal: {freightMoney(group.knownAmountMinor, group.currency.minorUnitDigits)};
|
|
41
|
+
complete subtotal:{' '}
|
|
42
|
+
{freightMoney(group.totalAmountMinor, group.currency.minorUnitDigits)}
|
|
43
|
+
</p>
|
|
44
|
+
</div>
|
|
45
|
+
))}
|
|
46
|
+
{value.reasons.length > 0 && (
|
|
47
|
+
<div>
|
|
48
|
+
<h4 className="font-semibold">Missing facts</h4>
|
|
49
|
+
<ul className="list-disc pl-5">
|
|
50
|
+
{value.reasons.map((item) => (
|
|
51
|
+
<li key={JSON.stringify([item.code, item.lineId, item.detail])}>{item.detail}</li>
|
|
52
|
+
))}
|
|
53
|
+
</ul>
|
|
54
|
+
</div>
|
|
55
|
+
)}
|
|
56
|
+
{value.warnings.length > 0 && (
|
|
57
|
+
<div>
|
|
58
|
+
<h4 className="font-semibold">Rounding notes</h4>
|
|
59
|
+
<ul className="list-disc pl-5">
|
|
60
|
+
{value.warnings.map((item) => (
|
|
61
|
+
<li key={JSON.stringify([item.code, item.lineId, item.detail])}>{item.detail}</li>
|
|
62
|
+
))}
|
|
63
|
+
</ul>
|
|
64
|
+
</div>
|
|
65
|
+
)}
|
|
66
|
+
</section>
|
|
67
|
+
);
|
|
68
|
+
}
|