Merge pull request 'MASTER_4689-hotFix(route_index): fix driverRoutePdf' (!1095) from hotFix_driverRoutePdf2 into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1095
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Alex Moreno 2022-10-20 07:22:07 +00:00
commit 3564cbe246
5 changed files with 12 additions and 13 deletions

View File

@ -6,9 +6,9 @@ module.exports = Self => {
accepts: [ accepts: [
{ {
arg: 'id', arg: 'id',
type: 'number', type: 'string',
required: true, required: true,
description: 'The client id', description: 'The route id',
http: {source: 'path'} http: {source: 'path'}
}, },
{ {

View File

@ -39,10 +39,7 @@ export default class Controller extends Section {
routes.push(route.id); routes.push(route.id);
const routesId = routes.join(','); const routesId = routes.join(',');
this.vnReport.show('driver-route', { this.vnReport.show(`Routes/${routesId}/driver-route-pdf`);
authorization: this.vnToken.token,
routeId: routesId
});
} }
openClonationDialog() { openClonationDialog() {

View File

@ -49,14 +49,12 @@ describe('Component vnRouteIndex', () => {
const data = controller.$.model.data; const data = controller.$.model.data;
data[0].checked = true; data[0].checked = true;
data[2].checked = true; data[2].checked = true;
const expectedParams = {
authorization: null, const routeIds = '1,3';
routeId: '1,3'
};
controller.showRouteReport(); controller.showRouteReport();
expect(controller.vnReport.show).toHaveBeenCalledWith('driver-route', expectedParams); expect(controller.vnReport.show).toHaveBeenCalledWith(`Routes/${routeIds}/driver-route-pdf`);
}); });
}); });

View File

@ -14,6 +14,9 @@ module.exports = {
const routes = await this.fetchRoutes(ids); const routes = await this.fetchRoutes(ids);
const tickets = await this.fetchTickets(ids); const tickets = await this.fetchTickets(ids);
if (!tickets || !tickets.id)
throw new Error('This route(s) not have ticket(s)');
const map = new Map(); const map = new Map();
for (let route of routes) for (let route of routes)

View File

@ -20,6 +20,7 @@ phone: Teléfono
warehouse: Almacén warehouse: Almacén
salesPerson: Comercial salesPerson: Comercial
import: Importe import: Importe
route: Ruta route: Ruta
routeId: Ruta {0} routeId: Ruta {0}
ticket: Ticket ticket: Ticket
This route(s) not have ticket(s): Esta ruta(s) no tiene ticket(s)