diff --git a/apps/edr-freight-api/src/modules/billing/billing.service.ts b/apps/edr-freight-api/src/modules/billing/billing.service.ts index bc79f8899..5afa30128 100644 --- a/apps/edr-freight-api/src/modules/billing/billing.service.ts +++ b/apps/edr-freight-api/src/modules/billing/billing.service.ts @@ -513,6 +513,17 @@ export class BillingService { // MoR EIMS reference — only once actually registered, never a placeholder row. if (invoice.eimsIrn) summary.push({ label: "EIMS IRN", value: invoice.eimsIrn }); + // PNR — the CBE_BILL reference the customer pays against, written onto the booking at + // payment-initiation time (see initiatePayment()). Not a column on Invoice/Payment, so + // look it up by source id; only shown once a payment actually generated one. + if (invoice.source === Freight.InvoiceSource.Booking) { + const booking = await this.dataSource.getRepository(Booking).findOne({ + where: { id: invoice.sourceId }, + select: ["id", "pnrCode"], + }); + if (booking?.pnrCode) summary.push({ label: "PNR", value: booking.pnrCode }); + } + return { kind, title,