mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 05:25:41 +00:00
fix
This commit is contained in:
@@ -93,8 +93,6 @@ const cargoDesc = (r: FirstMileRecord) => {
|
|||||||
if (r.booking?.cargoTotalWeightVgm) parts.push(`${r.booking.cargoTotalWeightVgm} t`);
|
if (r.booking?.cargoTotalWeightVgm) parts.push(`${r.booking.cargoTotalWeightVgm} t`);
|
||||||
return parts.join(" · ") || "—";
|
return parts.join(" · ") || "—";
|
||||||
};
|
};
|
||||||
const priceAmount = (r: FirstMileRecord) =>
|
|
||||||
r.booking?.totalAmount ?? r.advancedPayment;
|
|
||||||
// First-mile destination is the origin yard (pickup → origin yard)
|
// First-mile destination is the origin yard (pickup → origin yard)
|
||||||
const destinationYardName = (r: FirstMileRecord) =>
|
const destinationYardName = (r: FirstMileRecord) =>
|
||||||
r.booking?.originYard?.label ?? "—";
|
r.booking?.originYard?.label ?? "—";
|
||||||
@@ -142,7 +140,8 @@ const BookingInfo = ({ record }: { record: FirstMileRecord }) => (
|
|||||||
<InfoRow label="Pickup location" value={pickupLocation(record)} />
|
<InfoRow label="Pickup location" value={pickupLocation(record)} />
|
||||||
<InfoRow label="Destination (origin yard)" value={destinationYardName(record)} />
|
<InfoRow label="Destination (origin yard)" value={destinationYardName(record)} />
|
||||||
<InfoRow label="Cargo" value={cargoDesc(record)} />
|
<InfoRow label="Cargo" value={cargoDesc(record)} />
|
||||||
<InfoRow label="Price" value={formatPrice(priceAmount(record))} />
|
<InfoRow label="Advanced Payment" value={formatPrice(record.advancedPayment)} />
|
||||||
|
<InfoRow label="Post Payment" value={formatPrice(record.remainingPayment)} />
|
||||||
<InfoRow label="Contact" value={contactPersonName(record)} />
|
<InfoRow label="Contact" value={contactPersonName(record)} />
|
||||||
<InfoRow label="Phone" value={contactPhone(record)} />
|
<InfoRow label="Phone" value={contactPhone(record)} />
|
||||||
<InfoRow label="Requested date" value={requestedDate(record)} />
|
<InfoRow label="Requested date" value={requestedDate(record)} />
|
||||||
@@ -158,7 +157,8 @@ const tripSlipRows = (record: FirstMileRecord): [string, string][] => [
|
|||||||
["Pickup location", pickupLocation(record)],
|
["Pickup location", pickupLocation(record)],
|
||||||
["Destination yard", destinationYardName(record)],
|
["Destination yard", destinationYardName(record)],
|
||||||
["Cargo", cargoDesc(record)],
|
["Cargo", cargoDesc(record)],
|
||||||
["Price", formatPrice(priceAmount(record))],
|
["Advanced Payment", formatPrice(record.advancedPayment)],
|
||||||
|
["Post Payment", formatPrice(record.remainingPayment)],
|
||||||
["Vehicle", vehicleLabel(record) ?? "Unassigned"],
|
["Vehicle", vehicleLabel(record) ?? "Unassigned"],
|
||||||
["Contact", `${contactPersonName(record)} · ${contactPhone(record)}`],
|
["Contact", `${contactPersonName(record)} · ${contactPhone(record)}`],
|
||||||
["Requested date", requestedDate(record)],
|
["Requested date", requestedDate(record)],
|
||||||
@@ -628,10 +628,16 @@ const FirstMilePage = () => {
|
|||||||
cell: ({ row }) => cargoDesc(row.original),
|
cell: ({ row }) => cargoDesc(row.original),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "price",
|
id: "advancedPayment",
|
||||||
header: "Price",
|
header: "Advanced Payment",
|
||||||
meta: { headerClassName, cellClassName },
|
meta: { headerClassName, cellClassName },
|
||||||
cell: ({ row }) => formatPrice(priceAmount(row.original)),
|
cell: ({ row }) => formatPrice(row.original.advancedPayment),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "postPayment",
|
||||||
|
header: "Post Payment",
|
||||||
|
meta: { headerClassName, cellClassName },
|
||||||
|
cell: ({ row }) => formatPrice(row.original.remainingPayment),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "vehicle",
|
id: "vehicle",
|
||||||
|
|||||||
Reference in New Issue
Block a user