From 9a2fe0260e3091d25a0111a5fab636abf23325b0 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Mon, 19 Jul 2021 10:16:15 +0200 Subject: [PATCH] last steps to preview credit request --- db/changes/10340-summer/01-credit_request.sql | 2 + print/common/css/layout.css | 10 + .../email/credit-request/assets/css/import.js | 8 + .../email/credit-request/attachments.json | 6 + .../email/credit-request/credit-request.html | 55 ++++++ .../email/credit-request/credit-request.js | 17 ++ .../email/credit-request/locale/es.yml | 4 + .../credit-request/assets/css/import.js | 9 + .../credit-request/assets/css/style.css | 52 +++++ .../credit-request/credit-request.html | 184 ++++++++++++++++++ .../reports/credit-request/credit-request.js | 11 ++ .../reports/credit-request/locale/es.yml | 17 ++ 12 files changed, 375 insertions(+) create mode 100644 db/changes/10340-summer/01-credit_request.sql create mode 100644 print/templates/email/credit-request/assets/css/import.js create mode 100644 print/templates/email/credit-request/attachments.json create mode 100644 print/templates/email/credit-request/credit-request.html create mode 100755 print/templates/email/credit-request/credit-request.js create mode 100644 print/templates/email/credit-request/locale/es.yml create mode 100644 print/templates/reports/credit-request/assets/css/import.js create mode 100644 print/templates/reports/credit-request/assets/css/style.css create mode 100644 print/templates/reports/credit-request/credit-request.html create mode 100755 print/templates/reports/credit-request/credit-request.js create mode 100644 print/templates/reports/credit-request/locale/es.yml diff --git a/db/changes/10340-summer/01-credit_request.sql b/db/changes/10340-summer/01-credit_request.sql new file mode 100644 index 000000000..821623326 --- /dev/null +++ b/db/changes/10340-summer/01-credit_request.sql @@ -0,0 +1,2 @@ +INSERT INTO `vn`.`sample` (`code`, `description`, `isVisible`, `hasCompany`, `hasPreview`) + VALUES ('credit-request', 'Solicitud de crédito', 1, 1, 1); \ No newline at end of file diff --git a/print/common/css/layout.css b/print/common/css/layout.css index c709191bb..57c5db9e3 100644 --- a/print/common/css/layout.css +++ b/print/common/css/layout.css @@ -132,6 +132,16 @@ width: 8em } +.field.wide-rectangle { + white-space: nowrap +} + +.field.wide-rectangle span { + display: inline-block; + height: 2em; + width: 100%; +} + .pull-left { float: left !important } diff --git a/print/templates/email/credit-request/assets/css/import.js b/print/templates/email/credit-request/assets/css/import.js new file mode 100644 index 000000000..b44d6bd37 --- /dev/null +++ b/print/templates/email/credit-request/assets/css/import.js @@ -0,0 +1,8 @@ +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/email.css`]) + .mergeStyles(); diff --git a/print/templates/email/credit-request/attachments.json b/print/templates/email/credit-request/attachments.json new file mode 100644 index 000000000..12b10df4c --- /dev/null +++ b/print/templates/email/credit-request/attachments.json @@ -0,0 +1,6 @@ +[ + { + "filename": "credit-request.pdf", + "component": "credit-request" + } +] \ No newline at end of file diff --git a/print/templates/email/credit-request/credit-request.html b/print/templates/email/credit-request/credit-request.html new file mode 100644 index 000000000..e63eba7f7 --- /dev/null +++ b/print/templates/email/credit-request/credit-request.html @@ -0,0 +1,55 @@ + + + + + + {{ $t('subject') }} + + + + + + + + +
+ +
+
+
+ +
+
+ +
+
+ +
+
+

{{ $t('title') }}

+

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

+
+
+ +
+
+ + +
+
+ +
+
+ +
+
+ +
+
+
+
+ + \ No newline at end of file diff --git a/print/templates/email/credit-request/credit-request.js b/print/templates/email/credit-request/credit-request.js new file mode 100755 index 000000000..69463f43a --- /dev/null +++ b/print/templates/email/credit-request/credit-request.js @@ -0,0 +1,17 @@ +const Component = require(`${appPath}/core/component`); +const emailHeader = new Component('email-header'); +const emailFooter = new Component('email-footer'); +const attachment = new Component('attachment'); +const attachments = require('./attachments.json'); + +module.exports = { + name: 'credit-request', + components: { + 'email-header': emailHeader.build(), + 'email-footer': emailFooter.build(), + 'attachment': attachment.build() + }, + data() { + return {attachments}; + }, +}; diff --git a/print/templates/email/credit-request/locale/es.yml b/print/templates/email/credit-request/locale/es.yml new file mode 100644 index 000000000..aa6e63dcb --- /dev/null +++ b/print/templates/email/credit-request/locale/es.yml @@ -0,0 +1,4 @@ +subject: Solicitud de crédito +title: Solicitud de crédito +description: + instructions: Adjuntamos el formulario para solicitud de crédito. \ No newline at end of file diff --git a/print/templates/reports/credit-request/assets/css/import.js b/print/templates/reports/credit-request/assets/css/import.js new file mode 100644 index 000000000..fd8796c2b --- /dev/null +++ b/print/templates/reports/credit-request/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/credit-request/assets/css/style.css b/print/templates/reports/credit-request/assets/css/style.css new file mode 100644 index 000000000..90bbfd103 --- /dev/null +++ b/print/templates/reports/credit-request/assets/css/style.css @@ -0,0 +1,52 @@ +.wide { + width: 900px !important +} + +.content { + position: absolute; + margin-top: -200px; + height: 400px; + top: 50% +} + +p { + font-size: 1.2em; + margin: 0 +} + +td > span { + width: 100%; + margin-bottom: 15px +} + +.green-background { + color: white; + background-color: #8dba25; + height: 2em; + line-height: 2em; + padding-left: 0.5em; +} + +.info-panel td, .info-panel th { + padding: 1em 1em; +} + +.info-panel { + margin-bottom: 5em; +} + +table { + width: 100%; +} + +th { + width: 30%; +} + +td { + width: 20%; +} + +.field { + float: none +} \ No newline at end of file diff --git a/print/templates/reports/credit-request/credit-request.html b/print/templates/reports/credit-request/credit-request.html new file mode 100644 index 000000000..c377ad81a --- /dev/null +++ b/print/templates/reports/credit-request/credit-request.html @@ -0,0 +1,184 @@ + + + + + + + + + +
+ + + + +
+
+

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

+
+
+ + + + + + + + + +
{{$t('fields.date')}}: +
+ +
+
+ + +
+
+
+
+

{{$t('fields.companyInfo')}}

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{$t('fields.companyName')}}: +
+ +
+
{{$t('fields.businessType')}}: +
+ +
+
{{$t('fields.antiquity')}}: +
+ +
+
{{$t('fields.surface')}}: +
+ +
+
{{$t('fields.numberOfEmployees')}}: +
+ +
+
{{$t('fields.owner')}}: +
+ +
+
{{$t('fields.phone')}}: +
+ +
+
{{$t('fields.payer')}}: +
+ +
+
{{$t('fields.phone')}}: +
+ +
+
+
+
+
+
+ + +
+
+
+
+

{{$t('fields.economicInfo')}}

+
+
+ + + + + + + + + + + + + + + +
{{$t('fields.previousSalesVolume')}}: +
+ +
+
{{$t('fields.forecastedSalesVolume')}}: +
+ +
+
{{$t('fields.forecastedPurchases')}}: +
+ +
+
+
+
+
+
+ + +
+
+
+ + + + + + + + + +
{{$t('fields.personFilling')}}: +
+ +
+
{{$t('fields.phone')}}: +
+ +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/print/templates/reports/credit-request/credit-request.js b/print/templates/reports/credit-request/credit-request.js new file mode 100755 index 000000000..09a170bd6 --- /dev/null +++ b/print/templates/reports/credit-request/credit-request.js @@ -0,0 +1,11 @@ +const Component = require(`${appPath}/core/component`); +const reportHeader = new Component('report-header'); + +const rptCreditRequest = { + name: 'credit-request', + components: { + 'report-header': reportHeader.build() + } +}; + +module.exports = rptCreditRequest; diff --git a/print/templates/reports/credit-request/locale/es.yml b/print/templates/reports/credit-request/locale/es.yml new file mode 100644 index 000000000..e4e9739a5 --- /dev/null +++ b/print/templates/reports/credit-request/locale/es.yml @@ -0,0 +1,17 @@ +fields: + title: Solicitud de crédito + date: Fecha + companyName: Nombre de la empresa + businessType: Tipo de negocio + antiquity: Antigüedad + surface: Superficie (m²) + numberOfEmployees: Número de empleados + owner: Contacto propietario o Administrador + phone: Teléfono + payer: Contacto responsable de pagos + previousSalesVolume: Previsión ventas ejercicio anterior + forecastedSalesVolume: Previsión ventas para el presente año + forecastedPurchases: Previsión de compras a Verdnatura + personFilling: Persona que rellena el formulario + companyInfo: Información general sobre la empresa + economicInfo: Información económica \ No newline at end of file