mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 15:25:45 +00:00
fix issue -> consolidation
This commit is contained in:
@@ -2091,6 +2091,7 @@ export class ContractBookingService {
|
||||
): Promise<{
|
||||
overweightLines: Array<{
|
||||
containerTypeCode: string;
|
||||
containerLabel: string;
|
||||
totalVgmTons: number;
|
||||
maxAllowedTons: number;
|
||||
excessTons: number;
|
||||
@@ -2200,6 +2201,12 @@ export class ContractBookingService {
|
||||
: 0,
|
||||
vgmPerUnitTons: line.units.length ? totalVgmTons / line.units.length : 0,
|
||||
totalVgmTons,
|
||||
// Per-box weights drive the overweight check — the limit is per
|
||||
// container, so a heavy box is billed even when the line total fits.
|
||||
units: (line.units ?? []).map((u, idx) => ({
|
||||
vgmTons: Number(u.vgmTons ?? 0),
|
||||
sortOrder: idx,
|
||||
})) as BookingContainer['units'],
|
||||
wagonsRequired: Math.ceil(line.quantity * wagonsPerUnitForSize(ct.sizeFt)),
|
||||
}),
|
||||
),
|
||||
@@ -2233,6 +2240,7 @@ export class ContractBookingService {
|
||||
containerTypeId: ct.id,
|
||||
quantity: line.quantity,
|
||||
totalVgmTons,
|
||||
unitVgmTons: (line.units ?? []).map((u) => Number(u.vgmTons ?? 0)),
|
||||
})),
|
||||
contract.tradeDirection,
|
||||
);
|
||||
@@ -2312,7 +2320,12 @@ export class ContractBookingService {
|
||||
(s, u) => s + Number(u.vgmTons ?? 0),
|
||||
0,
|
||||
);
|
||||
return { containerTypeId: ct.id, quantity: line.quantity, totalVgmTons };
|
||||
return {
|
||||
containerTypeId: ct.id,
|
||||
quantity: line.quantity,
|
||||
totalVgmTons,
|
||||
unitVgmTons: (line.units ?? []).map((u) => Number(u.vgmTons ?? 0)),
|
||||
};
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user