last steps to preview credit request #692

Merged
joan merged 3 commits from 1939-add_client_credit_report into dev 2021-07-19 10:33:20 +00:00
12 changed files with 390 additions and 0 deletions

View File

@ -0,0 +1,2 @@
INSERT INTO `vn`.`sample` (`code`, `description`, `isVisible`, `hasCompany`, `hasPreview`)
VALUES ('credit-request', 'Solicitud de crédito', 1, 1, 1);

View File

@ -132,6 +132,16 @@
width: 8em width: 8em
} }
.field.wide-rectangle {
white-space: nowrap
}
.field.wide-rectangle span {
display: inline-block;
height: 2em;
width: 100%;
}
.pull-left { .pull-left {
float: left !important float: left !important
} }

View File

@ -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();

View File

@ -0,0 +1,6 @@
[
{
"filename": "credit-request.pdf",
"component": "credit-request"
}
]

View File

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html v-bind:lang="$i18n.locale">
<head>
<meta name="viewport" content="width=device-width">
<meta name="format-detection" content="telephone=no">
<title>{{ $t('subject') }}</title>
</head>
<body>
<table class="grid">
<tbody>
<tr>
<td>
<!-- Empty block -->
<div class="grid-row">
<div class="grid-block empty"></div>
</div>
<!-- Header block -->
<div class="grid-row">
<div class="grid-block">
<email-header v-bind="$props"></email-header>
</div>
</div>
<!-- Block -->
<div class="grid-row">
<div class="grid-block vn-pa-ml">
<h1>{{ $t('title') }}</h1>
<p>{{$t('description.instructions')}}</p>
</div>
</div>
<!-- Preview block -->
<div class="grid-row" v-if="isPreview">
<div class="grid-block vn-pa-ml">
<attachment v-for="attachment in attachments"
v-bind:key="attachment.filename"
v-bind:attachment="attachment"
v-bind:args="$props">
</attachment>
</div>
</div>
<!-- Footer block -->
<div class="grid-row">
<div class="grid-block">
<email-footer v-bind="$props"></email-footer>
</div>
</div>
<!-- Empty block -->
<div class="grid-row">
<div class="grid-block empty"></div>
</div>
</td>
</tr>
</tbody>
</table>
</body>
</html>

View File

@ -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};
},
};

View File

@ -0,0 +1,4 @@
subject: Solicitud de crédito
title: Solicitud de crédito
description:
instructions: Adjuntamos el formulario para solicitud de crédito.

View File

@ -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();

View File

@ -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
}

View File

@ -0,0 +1,190 @@
<!DOCTYPE html>
<html v-bind:lang="$i18n.locale">
<body>
<table class="grid">
<tbody>
<tr>
<td>
<!-- Header block -->
<report-header v-bind="$props"></report-header>
<!-- Block -->
<div class="grid-row info-panel">
<div class="grid-block">
<h1 class="title centered uppercase">{{$t('fields.title')}}</h1>
</div>
</div>
<!-- Block -->
<table>
<tbody>
<tr>
<td style="width: 70%; text-align: right; padding-right: 2em">{{$t('fields.date')}}:</td>
<th>
<div class="field wide-rectangle">
<span></span>
</div>
</th>
</tr>
</tbody>
</table>
<!-- Block -->
<div class="grid-row">
<div class="grid-block">
<div class="info-panel">
<div class="green-background">
<h3>{{$t('fields.companyInfo')}}</h3>
</div>
<div class="body">
<table style="width: 100%">
<tbody>
<tr>
<td>{{$t('fields.companyName')}}:</td>
<th colspan="3">
<div class="field wide-rectangle">
<span></span>
</div>
</th>
</tr>
<tr>
<td>{{$t('fields.businessType')}}:</td>
<th>
<div class="field wide-rectangle">
<span></span>
</div>
</th>
<td>{{$t('fields.antiquity')}}:</td>
<th>
<div class="field wide-rectangle">
<span></span>
</div>
</th>
</tr>
<tr>
<td>{{$t('fields.surface')}}:</td>
<th>
<div class="field wide-rectangle">
<span></span>
</div>
</th>
<td>{{$t('fields.numberOfEmployees')}}:</td>
<th>
<div class="field wide-rectangle">
<span></span>
</div>
</th>
</tr>
<tr>
<td>{{$t('fields.owner')}}:</td>
<th>
<div class="field wide-rectangle">
<span></span>
</div>
</th>
<td>{{$t('fields.phone')}}:</td>
<th>
<div class="field wide-rectangle">
<span></span>
</div>
</th>
</tr>
<tr>
<td>{{$t('fields.payer')}}:</td>
<th>
<div class="field wide-rectangle">
<span></span>
</div>
</th>
<td>{{$t('fields.phone')}}:</td>
<th>
<div class="field wide-rectangle">
<span></span>
</div>
</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Block -->
<div class="grid-row">
<div class="grid-block">
<div class="info-panel" style="width: 98%">
<div class="green-background">
<h3>{{$t('fields.economicInfo')}}</h3>
</div>
<div class="body">
<table>
<tbody>
<tr class="row-oriented">
<td>{{$t('fields.previousSalesVolume')}}:</td>
<th>
<div class="field wide-rectangle">
<span></span>
</div>
</th>
</tr>
<tr class="row-oriented">
<td>{{$t('fields.forecastedSalesVolume')}}:</td>
<th>
<div class="field wide-rectangle">
<span></span>
</div>
</th>
</tr>
<tr class="row-oriented">
<td>{{$t('fields.forecastedPurchases')}}:</td>
<th>
<div class="field wide-rectangle">
<span></span>
</div>
</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Block -->
<div class="grid-row">
<div class="grid-block">
<div>
<table style="border-top: 1px solid #DDD" class="info-panel">
<tbody>
<tr class="row-oriented" style="width: 100%">
<td>{{$t('fields.personFilling')}}:</td>
<th>
<div class="field wide-rectangle">
<span></span>
</div>
</th>
<td>{{$t('fields.phone')}}:</td>
<th>
<div class="field wide-rectangle">
<span></span>
</div>
</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Footer block -->
<report-footer
id="pageFooter"
v-bind:left-text="dated"
v-bind="$props">
</report-footer>
</td>
</tr>
</tbody>
</table>
</body>
</html>

View File

@ -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;

View File

@ -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