From aedab1b4362bd0d2f2885be370d9b04d880a5130 Mon Sep 17 00:00:00 2001 From: Marshal Date: Sat, 8 Aug 2026 21:09:20 +0000 Subject: [PATCH] keep cents in CBE bills and prices --- .../src/modules/bookings/booking-pricing.service.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/edr-freight-api/src/modules/bookings/booking-pricing.service.ts b/apps/edr-freight-api/src/modules/bookings/booking-pricing.service.ts index ba6fece8c..4ebebe879 100644 --- a/apps/edr-freight-api/src/modules/bookings/booking-pricing.service.ts +++ b/apps/edr-freight-api/src/modules/bookings/booking-pricing.service.ts @@ -279,9 +279,10 @@ export class BookingPricingService { return { lineItems, - // Grand total is billed in whole currency units — fractional line sums - // (rate × tons can yield e.g. 260519.2) round to the nearest whole birr/USD. - totalAmount: Math.round(total), + // Grand total keeps its cents, matching the line items it sums — rounding + // to whole birr made the total disagree with the breakdown (135,375.61 of + // lines shown as a 135,376.00 total) and CBE bills this figure to the cent. + totalAmount: round2(total), currency: booking.paymentCurrency, usedRates: [...usedRatesMap.values()], appliedModifiers: ruleResult.appliedModifiers,