Merge pull request #698 from Tria-plc/accrualdashboard

Disabled Receive to warehouse button once items are recieved to warehouse
replaced booking uuid by booking reference in the warehouse.
Added live occupancy to warehouse zones
This commit is contained in:
Hagernesh Tadesse
2026-07-15 10:59:11 +03:00
committed by GitHub
3 changed files with 26 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
import { useState } from 'react';
import { Badge, Button, Card, Divider, Group, Stack, Text } from '@mantine/core';
import { Badge, Button, Card, Divider, Group, Stack, Text, Tooltip } from '@mantine/core';
import { PackagePlus, Train as TrainIcon, Warehouse as WarehouseIcon } from 'lucide-react';
import { useQuery } from '@tanstack/react-query';
@@ -126,14 +126,24 @@ export function WarehouseInfoCard({ bookingId, bookingReference }: WarehouseInfo
</>
)}
<Button
variant="light"
leftSection={<PackagePlus size={16} />}
onClick={() => setModalOpen(true)}
fullWidth
<Tooltip
label="This booking is already received at the warehouse"
disabled={!latest}
withArrow
>
Receive At Warehouse
</Button>
{/* span wrapper so the tooltip still fires on the disabled button */}
<span style={{ display: 'block' }}>
<Button
variant="light"
leftSection={<PackagePlus size={16} />}
onClick={() => setModalOpen(true)}
fullWidth
disabled={Boolean(latest)}
>
{latest ? 'Received At Warehouse' : 'Receive At Warehouse'}
</Button>
</span>
</Tooltip>
</Stack>
<ReceiveInventoryModal

View File

@@ -179,17 +179,17 @@ export function WarehouseInventoryTable({
{selectable && (
<Table.Td>
<Checkbox
aria-label={`Select ${item.bookingId ?? item.id}`}
aria-label={`Select ${item.bookingReference ?? item.booking?.reference ?? item.bookingId ?? item.id}`}
checked={selectedIds?.has(item.id) ?? false}
onChange={() => onToggleSelect?.(item.id)}
/>
</Table.Td>
)}
<Table.Td>
{item.bookingId ? (
<Tooltip label={item.bookingId} withArrow>
{item.bookingReference || item.booking?.reference || item.bookingId ? (
<Tooltip label={item.bookingId ?? ''} withArrow disabled={!item.bookingId}>
<Text size="sm" fw={600}>
{item.bookingId.slice(0, 8)}...
{item.bookingReference ?? item.booking?.reference ?? `${item.bookingId?.slice(0, 8)}...`}
</Text>
</Tooltip>
) : (

View File

@@ -217,6 +217,10 @@ export interface WarehouseInventoryItem {
yard?: WarehouseYard | null;
zone?: WarehouseZone | null;
booking?: InventoryBookingRef | null;
/** Flat booking summary fields attached by the inventory list (attachBookingSummaries). */
bookingReference?: string | null;
bookingStatus?: string | null;
customerName?: string | null;
}
/** Slim booking shape returned alongside inventory for the loading queue. */