Export Load on train

This commit is contained in:
Hagernesh
2026-07-07 10:21:17 +00:00
parent 35ccf1bc95
commit 25c9bdeecd
4 changed files with 301 additions and 203 deletions

View File

@@ -1282,6 +1282,17 @@ const LastMilePage = () => {
Boolean(releaseRow?.releaseOrderReference) && !releaseRow?.releaseDate && !pastTransit;
return (
<Group gap={4} justify="flex-end" wrap="nowrap">
{pastTransit && (
<Button
size="compact-xs"
variant="light"
color="orange"
leftSection={<Receipt size={13} />}
onClick={() => setDetentionRecord(row.original)}
>
Detention
</Button>
)}
<Menu
position="bottom-end"
width={200}

View File

@@ -391,6 +391,8 @@ function FeeRules() {
// Truck detention: per truck per day after an HOURS-based grace (default 3h),
// with day tiers. Uses "free hours" instead of "free days".
const isTruckDetention = form.ruleType === 'TRUCK_DETENTION_FEE';
// Double handling + truck detention apply to IMPORT only — trade direction is locked.
const isImportOnly = isDoubleHandling || isTruckDetention;
const resetForm = () =>
setForm({
@@ -464,7 +466,7 @@ function FeeRules() {
name: form.name.trim(),
ruleType: form.ruleType,
freightType: clean(form.freightType) ?? null,
tradeDirection: clean(form.tradeDirection) ?? null,
tradeDirection: isImportOnly ? 'IMPORT' : clean(form.tradeDirection) ?? null,
cargoTypeCode: isBulkRule ? (clean(form.cargoTypeCode) ?? null) : null,
containerType: isContainerRule ? (clean(form.containerType) ?? null) : null,
// Double handling: flat basis × rate. Truck detention: HOURS-based grace.
@@ -636,10 +638,12 @@ function FeeRules() {
/>
<Select
label="Trade direction"
description={isImportOnly ? 'Import only for this fee type' : undefined}
data={TRADE}
value={form.tradeDirection || null}
value={isImportOnly ? 'IMPORT' : form.tradeDirection || null}
onChange={(value) => setForm((f) => ({ ...f, tradeDirection: selectValue(value) }))}
clearable
disabled={isImportOnly}
clearable={!isImportOnly}
/>
{isTruckDetention && (
<Select