mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 14:15:44 +00:00
fix issue
This commit is contained in:
@@ -72,12 +72,19 @@ export function computeGlShipmentTotal(
|
||||
(i) => i.containerSize === line.containerSize && !i.isClearance,
|
||||
);
|
||||
if (rate) {
|
||||
// A per-wagon rate bills the wagons this line occupies — two 20ft share
|
||||
// one — not the box count. Mirrors the API's base-freight line so the
|
||||
// quote matches the invoice.
|
||||
const billedQty =
|
||||
rate.unit === "per_wagon"
|
||||
? Math.ceil(qty * (line.containerSize === "40ft" ? 1 : 0.5))
|
||||
: qty;
|
||||
lines.push({
|
||||
label: rate.label,
|
||||
unitPrice: rate.unitPrice,
|
||||
unit: rate.unit,
|
||||
quantity: qty,
|
||||
amount: rate.unitPrice * qty,
|
||||
quantity: billedQty,
|
||||
amount: rate.unitPrice * billedQty,
|
||||
});
|
||||
}
|
||||
hazardTotalQty += line.hazardousQuantity;
|
||||
|
||||
Reference in New Issue
Block a user