diff --git a/print/templates/reports/vehicle-event-expired/assets/css/import.js b/print/templates/reports/vehicle-event-expired/assets/css/import.js new file mode 100644 index 000000000..fd8796c2b --- /dev/null +++ b/print/templates/reports/vehicle-event-expired/assets/css/import.js @@ -0,0 +1,9 @@ +const Stylesheet = require(`${appPath}/core/stylesheet`); + +module.exports = new Stylesheet([ + `${appPath}/common/css/spacing.css`, + `${appPath}/common/css/misc.css`, + `${appPath}/common/css/layout.css`, + `${appPath}/common/css/report.css`, + `${__dirname}/style.css`]) + .mergeStyles(); diff --git a/print/templates/reports/vehicle-event-expired/assets/css/style.css b/print/templates/reports/vehicle-event-expired/assets/css/style.css new file mode 100644 index 000000000..1b6428d3c --- /dev/null +++ b/print/templates/reports/vehicle-event-expired/assets/css/style.css @@ -0,0 +1,19 @@ +.column-oriented { + margin-top: 50px !important; +} + +.bottom-line > tr { + border-bottom: 1px solid #ccc; +} + +.bottom-line tr:nth-last-child() { + border-bottom: none; +} + +.report-info { + font-size: 20px +} + +.description strong { + text-transform: uppercase; +} \ No newline at end of file diff --git a/print/templates/reports/vehicle-event-expired/locale/es.yml b/print/templates/reports/vehicle-event-expired/locale/es.yml new file mode 100644 index 000000000..ba7685047 --- /dev/null +++ b/print/templates/reports/vehicle-event-expired/locale/es.yml @@ -0,0 +1,4 @@ +title: Expiración Tarjetas Vehículos +Plate: Matrícula +Concept: Concepto +expirationDate: Fecha caducidad \ No newline at end of file diff --git a/print/templates/reports/vehicle-event-expired/sql/vehicleEvents.sql b/print/templates/reports/vehicle-event-expired/sql/vehicleEvents.sql new file mode 100644 index 000000000..09f9e5853 --- /dev/null +++ b/print/templates/reports/vehicle-event-expired/sql/vehicleEvents.sql @@ -0,0 +1,7 @@ +SELECT + v.numberPlate, + ve.description, + ve.finished +FROM vehicleEvent ve + JOIN vehicle v ON v.id = ve.vehicleFk +WHERE ve.id IN (?) \ No newline at end of file diff --git a/print/templates/reports/vehicle-event-expired/vehicle-event-expired.html b/print/templates/reports/vehicle-event-expired/vehicle-event-expired.html new file mode 100644 index 000000000..2045f2adb --- /dev/null +++ b/print/templates/reports/vehicle-event-expired/vehicle-event-expired.html @@ -0,0 +1,39 @@ + + + + + + + + + +
+ + + +
+
+
+

{{$t('title')}}

+
+ + + + + + + + + + + + + + + +
{{$t('Plate')}}{{$t('Concept')}}{{$t('expirationDate')}}
{{vehicleEvent.numberPlate}}{{vehicleEvent.description}}{{vehicleEvent.finished | date('%d-%m-%Y')}}
+
+
+
+ + \ No newline at end of file diff --git a/print/templates/reports/vehicle-event-expired/vehicle-event-expired.js b/print/templates/reports/vehicle-event-expired/vehicle-event-expired.js new file mode 100755 index 000000000..33e60eab7 --- /dev/null +++ b/print/templates/reports/vehicle-event-expired/vehicle-event-expired.js @@ -0,0 +1,28 @@ +const Component = require(`${appPath}/core/component`); +const reportHeader = new Component('report-header'); +const reportFooter = new Component('report-footer'); + +module.exports = { + name: 'vehicle-event-expired', + async serverPrefetch() { + this.vehicleEvents = await this.fetchVehicleEvent(this.eventIds); + + if (!this.vehicleEvents) + throw new Error('Something went wrong'); + }, + methods: { + fetchVehicleEvent(vehicleEventIds) { + return this.rawSqlFromDef('vehicleEvents', [vehicleEventIds]); + }, + }, + components: { + 'report-header': reportHeader.build(), + 'report-footer': reportFooter.build() + }, + props: { + eventIds: { + type: [Array], + required: true + } + } +};