Merge pull request #968 from Tria-plc/freight_feature/usermanagement

Freight feature/usermanagement
This commit is contained in:
marshal
2026-07-27 09:00:59 +03:00
committed by GitHub
12 changed files with 434 additions and 48 deletions

View File

@@ -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;

View File

@@ -116,8 +116,8 @@ const FreightDashboardHeader = ({
</Group>
{/* Right: actions + avatar. The doc-review alarm leads the group — it
only renders in the last half of a review phase that still has
undecided requests, so it never competes for space otherwise. */}
renders only during a review phase that still has undecided
requests, so it never competes for space otherwise. */}
<Group gap={10} wrap="nowrap" align="center">
<DocReviewAlertButton />

View File

@@ -391,6 +391,12 @@ const RuleEngineFormDialog = ({
// display order) is a non-negative magnitude — reject negatives outright
// rather than letting a typed "-" reach the API.
min={isNumber ? 0 : undefined}
// Without an explicit step the browser assumes 1 and refuses to submit
// anything fractional — which blocked decimal rates, tonnages and
// distances. The API is the one that decides which of these are whole
// numbers (@IsInt on points/sizes/order, @IsNumber on money, tons, km),
// so let the field carry decimals and let a 400 catch the rest.
step={isNumber ? "any" : undefined}
disabled={field.disabled || computed !== undefined}
value={String((computed !== undefined ? computed : values[field.name]) ?? "")}
onChange={(e) => {