Fix 2 — lastmile should only be yes if EDR last mile.

This commit is contained in:
Hagernesh
2026-07-31 13:06:32 +00:00
parent be75a9e867
commit d229808fd8
5 changed files with 225 additions and 31 deletions

View File

@@ -150,8 +150,9 @@ function AllocationRules() {
.filter((yard) => yard.code)
.map((yard) => ({
value: yard.code,
label: `${yard.code} - ${yard.name}${yard.warehouse?.code ? ` (${yard.warehouse.code})` : ''}`,
label: `${yard.name} (${yard.code})${yard.warehouse?.code ? ` ${yard.warehouse.code}` : ''}`,
}));
const yardNameByCode = Object.fromEntries(yards.map((yard) => [yard.code, yard.name]));
const resetForm = () => {
setEditingId(null);
@@ -223,7 +224,11 @@ function AllocationRules() {
{
id: 'targetYard',
header: 'Target yard',
cell: ({ row }) => <Badge variant="light">{row.original.targetYardCode}</Badge>,
cell: ({ row }) => (
<Badge variant="light">
{yardNameByCode[row.original.targetYardCode] ?? row.original.targetYardCode}
</Badge>
),
},
{
id: 'active',
@@ -307,7 +312,8 @@ function AllocationRules() {
{anyLabel(form.freightType, 'freight type').toLowerCase()} booking
{form.cargoTypeCode.trim() ? ` with cargo code ${form.cargoTypeCode.trim()}` : ''}
{form.containerStatus.trim() ? ` and container status ${form.containerStatus.trim()}` : ''}{' '}
is received, <b>send it to</b> {form.targetYardCode || 'a selected target yard'}.
is received, <b>send it to</b>{' '}
{(form.targetYardCode && yardNameByCode[form.targetYardCode]) || form.targetYardCode || 'a selected target yard'}.
</Text>
</Stack>
</Card>