mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 01:48:12 +00:00
changes
This commit is contained in:
@@ -128,7 +128,10 @@ export function computeGlShipmentTotal(
|
||||
const qty = q.bulkQuantity;
|
||||
const rate =
|
||||
rateFor(
|
||||
(i) => (i.unit === "per_ton" || i.unit === "per_item") && !i.isClearance,
|
||||
(i) =>
|
||||
(i.unit === "per_ton" || i.unit === "per_item") &&
|
||||
!i.isClearance &&
|
||||
!i.conditionalOn,
|
||||
) ?? items[0];
|
||||
if (rate && qty > 0) {
|
||||
lines.push({
|
||||
@@ -165,6 +168,23 @@ export function computeGlShipmentTotal(
|
||||
}
|
||||
}
|
||||
|
||||
// Lashing / cargo securing — bulk-only, applies whenever the contract shows
|
||||
// it (the commodity needs lashing). Per-ton scales by tonnage; per-wagon
|
||||
// depends on the wagon capacity the train stocks — shown at real pricing.
|
||||
const lashing = items.find((i) => i.conditionalOn === "has_lashing");
|
||||
if (lashing && lashing.unit === "per_ton") {
|
||||
const tons = q.bulkQuantity;
|
||||
if (tons > 0) {
|
||||
lines.push({
|
||||
label: lashing.label,
|
||||
unitPrice: lashing.unitPrice,
|
||||
unit: lashing.unit,
|
||||
quantity: tons,
|
||||
amount: lashing.unitPrice * tons,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Customs clearance service fee — billed on the booking invoice with the
|
||||
// freight. Container fees estimate per size (per box, or per wagon: two 20ft
|
||||
// share one); bulk per-ton scales by tonnage. Bulk per-wagon fees depend on
|
||||
|
||||
Reference in New Issue
Block a user