diff --git a/print/templates/reports/cmr-authorization/assets/css/import.js b/print/templates/reports/cmr-authorization/assets/css/import.js new file mode 100644 index 000000000..a2a9334cb --- /dev/null +++ b/print/templates/reports/cmr-authorization/assets/css/import.js @@ -0,0 +1,8 @@ +const Stylesheet = require(`${appPath}/core/stylesheet`); + +module.exports = new Stylesheet([ + `${appPath}/common/css/layout.css`, + `${appPath}/common/css/report.css`, + `${appPath}/common/css/misc.css`, + `${__dirname}/style.css`]) + .mergeStyles(); diff --git a/print/templates/reports/cmr-authorization/assets/css/style.css b/print/templates/reports/cmr-authorization/assets/css/style.css new file mode 100644 index 000000000..adfe4b4c9 --- /dev/null +++ b/print/templates/reports/cmr-authorization/assets/css/style.css @@ -0,0 +1,31 @@ +.grid-block { + font-size: 1.2em +} + +.signature .dummy-signature { + width: 400px; + height: 190px; + display: block; + content: ''; + overflow: hidden; + clear:both +} + +.signature img { + width: 400px +} + +.signature table { + width: 100%; + font-size: inherit; + border-collapse: separate; + border-spacing: 0 10px; +} + +.signature table tr > td:first-child { + width: 50% +} + +.signature table tr > td:last-child { + border-bottom: 1px dashed #CCC +} \ No newline at end of file diff --git a/print/templates/reports/cmr-authorization/assets/images/signature.png b/print/templates/reports/cmr-authorization/assets/images/signature.png new file mode 100644 index 000000000..c69cc4798 Binary files /dev/null and b/print/templates/reports/cmr-authorization/assets/images/signature.png differ diff --git a/print/templates/reports/cmr-authorization/cmr-authorization.html b/print/templates/reports/cmr-authorization/cmr-authorization.html new file mode 100644 index 000000000..2d8342a47 --- /dev/null +++ b/print/templates/reports/cmr-authorization/cmr-authorization.html @@ -0,0 +1,99 @@ + + + + + + + + + +
+ + + +
+
+

+

+

+

+ +
+
+

{{client.name}}

+
+

+ + + + + + + + + + + + + + + +
{{$t('signer.representative')}}:
{{$t('signer.representativeRole')}}:
{{$t('signer.signed')}}:
+

+
+
+

{{$t('signature')}}

+ +

+

Juan Vicente Ferrer Roig
+
Director
+

{{$t('issued', [ + 'Algemesí', + issued.getDate(), + $t('months')[issued.getMonth()], + issued.getFullYear()]) + }} +

+

+
+
+ +
+
+ + + +
+ + \ No newline at end of file diff --git a/print/templates/reports/cmr-authorization/cmr-authorization.js b/print/templates/reports/cmr-authorization/cmr-authorization.js new file mode 100755 index 000000000..da08b6ec8 --- /dev/null +++ b/print/templates/reports/cmr-authorization/cmr-authorization.js @@ -0,0 +1,29 @@ +const Component = require(`${appPath}/core/component`); +const reportHeader = new Component('report-header'); +const reportFooter = new Component('report-footer'); + +module.exports = { + name: 'cmr-authorization', + async serverPrefetch() { + this.ticket = await this.findOneFromDef('ticket', [this.ticketId]); + if (!this.ticket) + throw new Error('Something went wrong'); + + this.client = await this.findOneFromDef('client', [this.ticket.clientFk]); + + }, + computed: { + issued: function() { + return new Date(); + } + }, + components: { + 'report-header': reportHeader.build(), + 'report-footer': reportFooter.build() + }, + props: { + ticketId: { + required: true + } + } +}; diff --git a/print/templates/reports/cmr-authorization/locale/es.yml b/print/templates/reports/cmr-authorization/locale/es.yml new file mode 100644 index 000000000..779dc0c8f --- /dev/null +++ b/print/templates/reports/cmr-authorization/locale/es.yml @@ -0,0 +1,41 @@ +description: '{socialName} una sociedad debidamente constituida con responsabilidad limitada +y registrada conforme al derecho de sociedades de {country} y aquí representada por +___________________. {socialName}, con domicilio en {address}, +CIF {fiscalID}. En adelante denominada {name}.' +issued: 'En {0}, a {1} de {2} de {3}' +client: 'Client {0}' +declaration: '{socialName} declara por la presente que:' +declarations: + - 'Todas las compras realizadas por {socialName} con Verdnatura Levante, S.L. se +entregan, Ex Works (Incoterms), en el almacén de Verdnatura Levante, S.L. situado en +{destinationWarehouse}.' + - '{socialName} reconoce que es importante para Verdnatura Levante, S.L. tener +comprobante de la entrega intracomunitaria de la mercancía a {destinationCountry} para +poder facturar con 0% de IVA.' + - 'Por tanto, al firmar este acuerdo, {socialName} declara que todos los bienes que +se compren a Verdnatura Levante, S.L. serán entregados a {destinationCountry}.' + - 'Además, {socialName} deberá, a primera solicitud de Verdnatura Levante, S.L., +proporcionar una prueba de que todos los productos comprados a Verdnatura Levante, S.L. han +sido entregados en {destinationCountry}.' + - 'Además de lo anterior, Verdnatura Levante, S.L. proporcionará a {socialName} +un resumen mensual en el que se incluyen todas las facturas (y las entregas correspondientes). +{socialName} firmará y devolverá el resumen mensual a Verdnatura Levante, +S.L. dentro de los 5 días posteriores a la recepción del resumen.' +signature: Verdnatura Levante, S.L. +signer: + representative: Representante + representativeRole: Cargo del representante + signed: Fecha de firma +months: + - 'Enero' + - 'Febrero' + - 'Marzo' + - 'Abril' + - 'Mayo' + - 'Junio' + - 'Julio' + - 'Agosto' + - 'Septiembre' + - 'Octubre' + - 'Noviembre' + - 'Diciembre' \ No newline at end of file diff --git a/print/templates/reports/cmr-authorization/sql/client.sql b/print/templates/reports/cmr-authorization/sql/client.sql new file mode 100644 index 000000000..bb17afd1d --- /dev/null +++ b/print/templates/reports/cmr-authorization/sql/client.sql @@ -0,0 +1,10 @@ +SELECT + c.id, + c.socialName, + c.name, + c.fi, + c.street, + cty.country +FROM client c + JOIN country cty ON cty.id = c.countryFk +WHERE c.id = ? \ No newline at end of file diff --git a/print/templates/reports/cmr-authorization/sql/ticket.sql b/print/templates/reports/cmr-authorization/sql/ticket.sql new file mode 100644 index 000000000..c6c994f7d --- /dev/null +++ b/print/templates/reports/cmr-authorization/sql/ticket.sql @@ -0,0 +1,12 @@ +SELECT + t.id, + t.clientFk, + cty.country, + w.name AS warehouse +FROM ticket t + JOIN warehouse w ON w.id = t.warehouseFk + JOIN address a ON a.id = t.addressFk + JOIN province p ON p.id = a.provinceFk + JOIN autonomy au ON au.id = p.autonomyFk + JOIN country cty ON cty.id = au.countryFk +WHERE t.id = ? \ No newline at end of file