From dcebe94294d7abd8f1e952e58d9a1aac9b34e701 Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 18 May 2021 14:21:49 +0200 Subject: [PATCH] Show supplier name on route-driver report --- print/templates/reports/driver-route/sql/routes.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/print/templates/reports/driver-route/sql/routes.sql b/print/templates/reports/driver-route/sql/routes.sql index bdbabedea..3fbe59b0d 100644 --- a/print/templates/reports/driver-route/sql/routes.sql +++ b/print/templates/reports/driver-route/sql/routes.sql @@ -7,10 +7,12 @@ SELECT v.tradeMark vehicleTradeMark, v.model vehicleModel, v.numberPlate plateNumber, - am.name agencyName + IFNULL(s.name, am.name) AS agencyName FROM route r LEFT JOIN vehicle v ON v.id = r.vehicleFk LEFT JOIN worker w ON w.id = r.workerFk LEFT JOIN account.user u ON u.id = w.userFk LEFT JOIN agencyMode am ON am.id = r.agencyModeFk + LEFT JOIN agency a ON a.id = am.agencyFk + LEFT JOIN supplier s ON s.id = a.supplierFk WHERE r.id IN(?) \ No newline at end of file