Merge pull request #449 from Tria-plc/freight/feature/first_mile_invoice

fix
This commit is contained in:
yaschalew10
2026-07-04 05:45:54 +03:00
committed by GitHub
2 changed files with 20 additions and 10 deletions

View File

@@ -20,6 +20,7 @@ import type { ColumnDef } from "@edr/ui-common";
import { DataTable, DataTableFooter, usePagination } from "@edr/ui-common"; import { DataTable, DataTableFooter, usePagination } from "@edr/ui-common";
import { import {
ActionIcon, ActionIcon,
Autocomplete,
Badge, Badge,
Box, Box,
Button, Button,
@@ -1307,17 +1308,21 @@ const FirstMilePage = () => {
clearable clearable
disabled={assignVehicleOptions.length === 0} disabled={assignVehicleOptions.length === 0}
/> />
<TextInput <Autocomplete
style={{ flex: 1 }} style={{ flex: 1 }}
label={i === 0 ? "Container no." : undefined} label={i === 0 ? "Container no." : undefined}
placeholder="Container number" placeholder="Container number"
data={(activeRecord ? bookingContainerNumbers(activeRecord) : []).filter(
(n) =>
n === row.containerNumber ||
!vehicleRows.some((r, idx) => idx !== i && r.containerNumber === n),
)}
value={row.containerNumber} value={row.containerNumber}
onChange={(e) => { onChange={(value) =>
const value = e.currentTarget.value;
setVehicleRows((prev) => setVehicleRows((prev) =>
prev.map((x, idx) => (idx === i ? { ...x, containerNumber: value } : x)), prev.map((x, idx) => (idx === i ? { ...x, containerNumber: value } : x)),
); )
}} }
/> />
{vehicleRows.length > 1 && ( {vehicleRows.length > 1 && (
<ActionIcon <ActionIcon

View File

@@ -19,6 +19,7 @@ import { DataTable, DataTableFooter, usePagination } from "@edr/ui-common";
import { import {
ActionIcon, ActionIcon,
Alert, Alert,
Autocomplete,
Badge, Badge,
Box, Box,
Button, Button,
@@ -1666,17 +1667,21 @@ const LastMilePage = () => {
clearable clearable
disabled={assignVehicleOptions.length === 0} disabled={assignVehicleOptions.length === 0}
/> />
<TextInput <Autocomplete
style={{ flex: 1 }} style={{ flex: 1 }}
label={i === 0 ? "Container no." : undefined} label={i === 0 ? "Container no." : undefined}
placeholder="Container number" placeholder="Container number"
data={(activeRecord ? bookingContainerNumbers(activeRecord) : []).filter(
(n) =>
n === row.containerNumber ||
!vehicleRows.some((r, idx) => idx !== i && r.containerNumber === n),
)}
value={row.containerNumber} value={row.containerNumber}
onChange={(e) => { onChange={(value) =>
const value = e.currentTarget.value;
setVehicleRows((prev) => setVehicleRows((prev) =>
prev.map((x, idx) => (idx === i ? { ...x, containerNumber: value } : x)), prev.map((x, idx) => (idx === i ? { ...x, containerNumber: value } : x)),
); )
}} }
/> />
{vehicleRows.length > 1 && ( {vehicleRows.length > 1 && (
<ActionIcon <ActionIcon