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/modules/worker/back/models/worker-time-control-mail.json b/modules/worker/back/models/worker-time-control-mail.json index 81ca235d7..7f8522757 100644 --- a/modules/worker/back/models/worker-time-control-mail.json +++ b/modules/worker/back/models/worker-time-control-mail.json @@ -35,7 +35,7 @@ { "accessType": "READ", "principalType": "ROLE", - "principalId": "$everyone", + "principalId": "employee", "permission": "ALLOW" } ] 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..975115eef --- /dev/null +++ b/print/templates/reports/credit-request/credit-request.html @@ -0,0 +1,190 @@ + + + + + + + + + +
+ + + + +
+
+

{{$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..d04106493 --- /dev/null +++ b/print/templates/reports/credit-request/credit-request.js @@ -0,0 +1,20 @@ +const Component = require(`${appPath}/core/component`); +const reportHeader = new Component('report-header'); +const reportFooter = new Component('report-footer'); + +const rptCreditRequest = { + name: 'credit-request', + computed: { + dated: function() { + const filters = this.$options.filters; + + return filters.date(new Date(), '%d-%m-%Y'); + } + }, + components: { + 'report-header': reportHeader.build(), + 'report-footer': reportFooter.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