diff --git a/modules/route/back/methods/route/getDeliveryPoint.js b/modules/route/back/methods/route/getDeliveryPoint.js index 59b22904f..e5a50805a 100644 --- a/modules/route/back/methods/route/getDeliveryPoint.js +++ b/modules/route/back/methods/route/getDeliveryPoint.js @@ -1,12 +1,12 @@ module.exports = Self => { Self.remoteMethod('getDeliveryPoint', { - description: 'get the deliveryPoint address ', + description: 'get the deliveryPoint address', accessType: 'WRITE', accepts: { arg: 'vehicleId', type: 'number', - required: true, description: 'vehicle id asigned in the route', + required: true, http: {source: 'path'} }, returns: { @@ -21,8 +21,9 @@ module.exports = Self => { Self.getDeliveryPoint = async vehicleId => { let vehicle = await Self.app.models.Vehicle.findById(vehicleId); - let deliveryPoint = await Self.app.models.DeliveryPoint.findById(vehicle.deliveryPointFk); + if (!vehicle.deliveryPointFk) return; + let deliveryPoint = await Self.app.models.DeliveryPoint.findById(vehicle.deliveryPointFk); return deliveryPoint.ubication; }; diff --git a/modules/route/front/tickets/index.html b/modules/route/front/tickets/index.html index 92a112747..306e4d94a 100644 --- a/modules/route/front/tickets/index.html +++ b/modules/route/front/tickets/index.html @@ -5,9 +5,12 @@ data="$ctrl.tickets" auto-load="true"> - -
- + + + - + @@ -31,14 +34,14 @@ model="model"> - Order - Ticket + Order + Street + City + PC Client Packages - Warehouse - PC - Street + Ticket @@ -50,21 +53,18 @@ ng-model="ticket.checked"> - + + class="dense" + display-controls=true> - - - {{ticket.id}} - - + {{ticket.address.street}} + {{ticket.address.city}} + {{ticket.address.postalCode}} {{ticket.packages}} {{::ticket.volume | number:1}} - {{ticket.warehouse.name}} - {{ticket.address.postalCode}} - {{ticket.address.street}} + + + {{ticket.id}} + + { - deliveryPointAddress = response.data; - }).then(() => { - addresses = deliveryPointAddress; + if (!response.data) + throw new UserError(`The route's vehicle doesn't have a departing warehouse`); + + return response.data; + }).then(address => { + let addresses; + if (address) addresses = address; let lines = this.getSelectedItems(this.tickets); let url = 'http://gps.buscalia.com/usuario/localizar.aspx?bmi=true&addr='; diff --git a/modules/route/front/tickets/locale/es.yml b/modules/route/front/tickets/locale/es.yml index 042f5227b..6fa29e5ca 100644 --- a/modules/route/front/tickets/locale/es.yml +++ b/modules/route/front/tickets/locale/es.yml @@ -8,4 +8,6 @@ Add ticket: Añadir ticket Tickets to add: Tickets a añadir Ticket not found: No se ha encontrado el ticket The selected ticket is not suitable for this route: El ticket seleccionado no es apto para esta ruta -PC: CP \ No newline at end of file +PC: CP +The route's vehicle doesn't have a departing warehouse: El vehículo de la ruta no tiene un almacén de salida +The route doesn't have a vehicle: La ruta no tiene un vehículo \ No newline at end of file diff --git a/print/templates/reports/sepa-core/assets/css/style.css b/print/templates/reports/sepa-core/assets/css/style.css index 89d458332..157ea59af 100644 --- a/print/templates/reports/sepa-core/assets/css/style.css +++ b/print/templates/reports/sepa-core/assets/css/style.css @@ -13,3 +13,15 @@ .wide { width: 900px !important } + +.content { + position: absolute; + margin-top: -200px; + height: 400px; + top: 50% +} + +p { + font-size: 1.2em; + margin: 0 +} diff --git a/print/templates/reports/sepa-core/locale/es.yml b/print/templates/reports/sepa-core/locale/es.yml index ac2d4d72f..bb9cc4e49 100644 --- a/print/templates/reports/sepa-core/locale/es.yml +++ b/print/templates/reports/sepa-core/locale/es.yml @@ -39,4 +39,9 @@ client: order: Ord. domiciliación {0} Francia: Francia España: España -Portugal: Portugal \ No newline at end of file +Portugal: Portugal +instructions: + title: Instrucciones + accountFields: Rellenar los campos relativos a la cuenta bancaria + signDocument: Firmar y sellar el documento. Para que tenga validez, en el sello debe aparecer el CIF/NIF. De no ser así, deberá acompañarse la solicitud de un certificado de titularidad de la cuenta. + thanks: ¡Gracias por su colaboración! \ No newline at end of file diff --git a/print/templates/reports/sepa-core/locale/fr.yml b/print/templates/reports/sepa-core/locale/fr.yml index bb213d93e..45a9039ea 100644 --- a/print/templates/reports/sepa-core/locale/fr.yml +++ b/print/templates/reports/sepa-core/locale/fr.yml @@ -36,4 +36,9 @@ client: order: Réf. mandat {0} Francia: France España: Espagne -Portugal: Portugal \ No newline at end of file +Portugal: Portugal +instructions: + title: instructions + accountFields: Remplissez les champs relatifs au compte bancaire + signDocument: Signez et scellez le document. Pour être valide, le CIF / NIF doit apparaître sur le cachet. Sinon, la demande de certificat de propriété du compte doit être jointe. + thanks: Merci de votre collaboration! \ No newline at end of file diff --git a/print/templates/reports/sepa-core/locale/pt.yml b/print/templates/reports/sepa-core/locale/pt.yml index b98cb5211..e7127d06b 100644 --- a/print/templates/reports/sepa-core/locale/pt.yml +++ b/print/templates/reports/sepa-core/locale/pt.yml @@ -39,4 +39,9 @@ client: order: Referência da ordem {0} Francia: França España: Espanha -Portugal: Portugal \ No newline at end of file +Portugal: Portugal +instructions: + title: instruções + accountFields: Preencha os campos relacionados à conta bancária + signDocument: Assine e lacre o documento. Para ser válido, o CIF / NIF deve constar no selo. Caso contrário, o pedido de um certificado de propriedade da conta deve ser anexado. + thanks: Obrigado pela sua cooperação! \ No newline at end of file diff --git a/print/templates/reports/sepa-core/sepa-core.html b/print/templates/reports/sepa-core/sepa-core.html index e0f8f03bc..c935bc2a8 100644 --- a/print/templates/reports/sepa-core/sepa-core.html +++ b/print/templates/reports/sepa-core/sepa-core.html @@ -5,6 +5,26 @@ + + + +
+
+
+

{{$t('instructions.title')}}

+

+ 1. {{$t('instructions.accountFields')}} +

+

+ 2. {{$t('instructions.signDocument')}} +

+

+ {{$t('instructions.thanks')}} +

+
+
+
+