mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 17:38:12 +00:00
Export Load on train
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user