mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 22:18:12 +00:00
fix
This commit is contained in:
@@ -92,6 +92,7 @@ export class FirstMileController {
|
||||
const record = await this.firstMileService.update(id, dto);
|
||||
// Auto-generate invoice if distance or payment was updated
|
||||
const booking = await this.bookingsService.findById(record.bookingId);
|
||||
const currency = booking.paymentCurrency || "ETB";
|
||||
if (dto.exactKm !== undefined || dto.exactKm != record.exactKm || dto.remainingPayment !== undefined || dto.remainingPayment !== record.remainingPayment) {
|
||||
await this.billingService.generateInvoice({
|
||||
source: Freight.InvoiceSource.FirstMile,
|
||||
@@ -99,7 +100,7 @@ export class FirstMileController {
|
||||
type: "FIRST_MILE",
|
||||
companyId: booking.companyId,
|
||||
companyProfileId: booking.companyProfileId,
|
||||
currency: "ETB",
|
||||
currency,
|
||||
|
||||
lines: [
|
||||
{
|
||||
@@ -108,7 +109,7 @@ export class FirstMileController {
|
||||
quantity: 1,
|
||||
unitRate: record.remainingPayment,
|
||||
amount: record.remainingPayment,
|
||||
currency: "ETB",
|
||||
currency,
|
||||
},
|
||||
],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user