added sepa-core & letter-debtor

This commit is contained in:
Joan Sanchez 2019-02-04 10:10:57 +01:00
parent e1207edb95
commit 7986405a72
21 changed files with 524 additions and 412 deletions

View File

@ -147,8 +147,8 @@ class Controller {
this.$scope.descriptor.ticketFk = sale.origin; this.$scope.descriptor.ticketFk = sale.origin;
this.$scope.descriptor.parent = event.target; this.$scope.descriptor.parent = event.target;
this.$scope.descriptor.show(); this.$scope.descriptor.show();
event.preventDefault(); event.preventDefault();
event.stopImmediatePropagation();
} }
showClientDescriptor(event, sale) { showClientDescriptor(event, sale) {
@ -157,8 +157,8 @@ class Controller {
this.$scope.clientDescriptor.clientFk = sale.clientFk; this.$scope.clientDescriptor.clientFk = sale.clientFk;
this.$scope.clientDescriptor.parent = event.target; this.$scope.clientDescriptor.parent = event.target;
this.$scope.clientDescriptor.show(); this.$scope.clientDescriptor.show();
event.preventDefault(); event.preventDefault();
event.stopImmediatePropagation();
} }
onDescriptorLoad() { onDescriptorLoad() {

View File

@ -1,5 +1,5 @@
.container { .container {
font-family: verdana, sans-serif; font-family: arial, sans-serif;
font-size: 16px; font-size: 16px;
zoom: 0.55 zoom: 0.55
} }
@ -33,9 +33,18 @@
float: left float: left
} }
.clearfix {
overflow: hidden;
display: block;
clear: both
}
.row { .row {
white-space: nowrap; margin-bottom: 15px;
margin-bottom: 15px overflow: hidden;
display: block;
clear: both;
width: 100%
} }
.row.small { .row.small {
@ -52,13 +61,36 @@
box-sizing: border-box box-sizing: border-box
} }
.row:last-child {
margin-bottom: 0
}
.row.inline .text {
display: table-cell;
margin-bottom: 0;
width: 30%
}
.row.inline .control {
display: table-cell;
padding-left: 20px;
font-weight: bold;
color: #000;
width: 70%
}
.row.inline .description {
position: static;
overflow: visible
}
.row .description { .row .description {
position: relative; position: relative;
padding-top: 2px; padding-top: 2px;
overflow: hidden;
font-size: 9px; font-size: 9px;
overflow: hidden;
display: block; display: block;
color: #999 clear: both
} }
.row .line { .row .line {
@ -78,42 +110,17 @@
float: left float: left
} }
.row:last-child {
margin-bottom: 0
}
.row.inline .text {
display: inline-block;
margin-bottom: 0;
width: 40%;
}
.row.inline .control {
display: inline-block;
font-weight: bold;
padding-left: 20px;
color: #000;
width: 60%
}
.row.inline .description {
position: static;
overflow: visible
}
.panel { .panel {
position: relative position: relative
} }
.panel .header { .panel .header {
background-color: #FFF; background-color: #FFF;
position:absolute;
left: 17.5px;
top: -12px;
padding: 2.5px 5px; padding: 2.5px 5px;
position: absolute;
font-weight: bold; font-weight: bold;
left: 17.5px;
top: -12px
} }
.panel .body { .panel .body {
@ -127,22 +134,27 @@
margin-top: 0 margin-top: 0
} }
.box { .field {
border-top: 1px solid #CCC;
border-right: 1px solid #CCC;
border-bottom: 1px solid #CCC; border-bottom: 1px solid #CCC;
font-weight: bold; border-left: 1px solid #CCC;
text-align: center; border-top: 1px solid #CCC;
padding-top: 4px;
width: 25px;
height: 21px;
color: #000;
float: left float: left
} }
.box.crossed { .field span {
font-weight: 100; border-right: 1px solid #CCC;
font-size: 16px -webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: table-cell;
vertical-align: middle;
text-align: center;
font-weight: bold
}
.field.square span {
height: 35.4px;
width: 35.4px
} }
.pull-left { .pull-left {
@ -153,53 +165,89 @@
float: right float: right
} }
.verticalText { .vertical-text {
-moz-transform: rotate(90deg); -moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg); -webkit-transform: rotate(90deg);
transform: rotate(90deg); transform: rotate(90deg);
position: absolute; position: absolute;
text-align: center; text-align: center;
font-size: .65em; font-size: .65em;
right: -108px;
width: 200px; width: 200px;
border: 2px solid #000;
right: -110px;
top: 50% top: 50%
} }
vn-table { table {
border-collapse: collapse; border-collapse: collapse;
margin: 20px 0; border-spacing: 0;
display: table;
width: 100%;
} }
vn-thead { .row-oriented, .column-oriented {
text-align: left;
width: 100%
}
.row-oriented .description,
.column-oriented .description {
font-size: 0.6em;
color: #888;
padding: 0 !important
}
.row-oriented .description .line,
.column-oriented .description .line {
border-bottom: 1px solid #DDD;
border-right: 1px solid #DDD;
border-left: 1px solid #DDD;
margin-top: 10px;
color: #999;
padding: 5px
}
.row-oriented .description span,
.column-oriented .description span {
background-color: #FFF;
margin: -5px 0 0 50px;
display: block;
padding: 5px;
float: left
}
.column-oriented {
margin: 20px 0
}
.column-oriented tfoot {
border-top: 1px solid #808080;
}
.column-oriented td, .column-oriented th {
padding: 5px 10px
}
.column-oriented thead {
background-color: #c0c0c0
}
.column-oriented thead tr {
border-bottom: 1px solid #808080; border-bottom: 1px solid #808080;
border-top: 1px solid #808080; border-top: 1px solid #808080;
display: table-header-group background-color: #c0c0c0
} }
vn-tbody { .column-oriented tfoot tr:first-child td {
border-top: 3px solid #888888; padding-top: 20px !important;
display: table-row-group
} }
vn-tfoot { .panel .row-oriented td, .panel .row-oriented th {
border-top: 1px solid #808080; padding: 10px 0
display: table-footer-group
} }
vn-tr { .row-oriented > tbody > tr > td {
display: table-row width: 30%
}
vn-th {
font-weight: bold
} }
vn-td, vn-th { .row-oriented > tbody > tr > th {
vertical-align: middle; padding-left: 30px;
display: table-cell; width: 70%
text-align: left; }
padding: 5px 0
}

View File

@ -10,6 +10,14 @@
text-align: right text-align: right
} }
.gray { .font.gray {
color: #555 color: #555
}
.font.light-gray {
color: #888
}
.font.small {
font-size: 0.65em
} }

View File

@ -5,6 +5,7 @@
{"type": "email", "name": "letter-debtor-st"}, {"type": "email", "name": "letter-debtor-st"},
{"type": "email", "name": "letter-debtor-nd"}, {"type": "email", "name": "letter-debtor-nd"},
{"type": "email", "name": "claim-pickup-order"}, {"type": "email", "name": "claim-pickup-order"},
{"type": "email", "name": "sepa-core"},
{"type": "report", "name": "delivery-note"}, {"type": "report", "name": "delivery-note"},
{"type": "report", "name": "invoice"}, {"type": "report", "name": "invoice"},
{"type": "report", "name": "rpt-claim-pickup-order"}, {"type": "report", "name": "rpt-claim-pickup-order"},

View File

@ -107,7 +107,7 @@ module.exports = {
format: 'A4', format: 'A4',
border: '1.5cm', border: '1.5cm',
footer: { footer: {
height: '80px', height: '60px',
} }
}; };

View File

@ -13,7 +13,7 @@ module.exports = {
if (!params.clientFk) if (!params.clientFk)
throw new UserException('No client id specified'); throw new UserException('No client id specified');
return this.methods.fetchClientData(params.clientFk) return this.methods.fetchClient(params.clientFk)
.then(([result]) => { .then(([result]) => {
if (!result) if (!result)
throw new UserException('No client data found'); throw new UserException('No client data found');
@ -24,7 +24,7 @@ module.exports = {
this.$i18n.locale = this.locale; this.$i18n.locale = this.locale;
}, },
methods: { methods: {
fetchClientData(clientFk) { fetchClient(clientFk) {
return database.pool.query(` return database.pool.query(`
SELECT SELECT
u.lang locale, u.lang locale,

View File

@ -1,6 +1,4 @@
const database = require(`${appPath}/lib/database`); const database = require(`${appPath}/lib/database`);
const emailHeader = require('../email-header');
const emailFooter = require('../email-footer');
const UserException = require(`${appPath}/lib/exceptions/userException`); const UserException = require(`${appPath}/lib/exceptions/userException`);
module.exports = { module.exports = {
@ -13,7 +11,7 @@ module.exports = {
if (!params.clientFk) if (!params.clientFk)
throw new UserException('No client id specified'); throw new UserException('No client id specified');
return this.methods.fetchClientData(params.clientFk) return this.methods.fetchClient(params.clientFk)
.then(([result]) => { .then(([result]) => {
if (!result) if (!result)
throw new UserException('No client data found'); throw new UserException('No client data found');
@ -29,7 +27,7 @@ module.exports = {
}; };
}, },
methods: { methods: {
fetchClientData(clientFk) { fetchClient(clientFk) {
return database.pool.query(` return database.pool.query(`
SELECT SELECT
c.id, c.id,
@ -47,7 +45,7 @@ module.exports = {
}, },
}, },
components: { components: {
'email-header': emailHeader, 'email-header': require('../email-header'),
'email-footer': emailFooter, 'email-footer': require('../email-footer'),
}, },
}; };

View File

@ -1,13 +1,12 @@
footer { footer {
font-family: verdana, sans-serif; font-family: verdana, sans-serif;
font-size: 12px; font-size: 0.55em;
color: #555; color: #555;
zoom: 0.55 zoom: 0.65
} }
footer, footer p { footer, footer p {
text-align: center; text-align: center
font-size: 12px
} }
footer .page { footer .page {

View File

@ -3,11 +3,11 @@ header {
padding-bottom: 10px; padding-bottom: 10px;
margin-bottom: 40px; margin-bottom: 40px;
text-align: center; text-align: center;
font-size: 12px; font-size: 0.65em;
color: #555 color: #555
} }
header img { header img {
margin-bottom: 10px; margin-bottom: 10px;
width: 350px width: 350px
} }

View File

@ -9,7 +9,7 @@
font-size: 2em font-size: 2em
} }
vn-table { table.column-oriented {
margin-top: 50px !important margin-top: 50px !important
} }

View File

@ -8,18 +8,22 @@
<section class="size50"> <section class="size50">
<section class="size75"> <section class="size75">
<h1 class="title uppercase">{{$t('title')}}</h1> <h1 class="title uppercase">{{$t('title')}}</h1>
<section class="row inline small"> <table class="row-oriented">
<section class="text uppercase gray">{{$t('claimId')}}:</section> <tbody>
<section class="control">{{claimId}}</section> <tr>
</section> <td class="font gray uppercase">{{$t('claimId')}}</td>
<section class="row inline small"> <th>{{claimId}}</th>
<section class="text uppercase gray">{{$t('clientId')}}:</section> </tr>
<section class="control">{{clientId}}</section> <tr>
</section> <td class="font gray uppercase">{{$t('clientId')}}</td>
<section class="row inline small"> <th>{{clientId}}</th>
<section class="text uppercase gray">{{$t('date')}}:</section> </tr>
<section class="control">{{dated()}}</section> <tr>
</section> <td class="font gray uppercase">{{$t('date')}}</td>
<th>{{dated()}}</th>
</tr>
</tbody>
</table>
</section> </section>
</section> </section>
<section class="size50"> <section class="size50">
@ -41,24 +45,24 @@
</section> </section>
</section> </section>
<vn-table> <table class="column-oriented">
<vn-thead> <thead>
<vn-tr> <tr>
<vn-th>{{$t('reference')}}</vn-th> <th>{{$t('reference')}}</th>
<vn-th>{{$t('quantity')}}</vn-th> <th>{{$t('quantity')}}</th>
<vn-th>{{$t('claims')}}</vn-th> <th>{{$t('claims')}}</th>
<vn-th>{{$t('concept')}}</vn-th> <th>{{$t('concept')}}</th>
</vn-tr> </tr>
</vn-thead> </thead>
<vn-tbody> <tbody>
<vn-tr v-for="sale in sales" :key="sale.id"> <tr v-for="sale in sales" :key="sale.id">
<vn-td class="gray">{{sale.id}}</vn-td> <td class="font gray">{{sale.id}}</td>
<vn-td>{{sale.quantity}}</vn-td> <td>{{sale.quantity}}</td>
<vn-td>{{sale.claimQuantity}}</vn-td> <td>{{sale.claimQuantity}}</td>
<vn-td>{{sale.concept}}</vn-td> <td>{{sale.concept}}</td>
</vn-tr> </tr>
</vn-tbody> </tbody>
</vn-table> </table>
<section class="panel sign"> <section class="panel sign">
<section class="body centered"> <section class="body centered">

View File

@ -9,6 +9,6 @@
font-size: 2em font-size: 2em
} }
vn-table { table.column-oriented {
margin-top: 50px !important margin-top: 50px !important
} }

View File

@ -8,14 +8,18 @@
<section class="size50"> <section class="size50">
<section class="size75"> <section class="size75">
<h1 class="title uppercase">{{$t('title')}}</h1> <h1 class="title uppercase">{{$t('title')}}</h1>
<section class="row inline small"> <table class="row-oriented">
<section class="text uppercase gray">{{$t('clientId')}}:</section> <tbody>
<section class="control">{{clientId}}</section> <tr>
</section> <td class="font gray uppercase">{{$t('clientId')}}</td>
<section class="row inline small"> <th>{{clientId}}</th>
<section class="text uppercase gray">{{$t('date')}}:</section> </tr>
<section class="control">{{dated()}}</section> <tr>
</section> <td class="font gray uppercase">{{$t('date')}}</td>
<th>{{dated()}}</th>
</tr>
</tbody>
</table>
</section> </section>
</section> </section>
<section class="size50"> <section class="size50">
@ -37,35 +41,35 @@
</section> </section>
</section> </section>
<vn-table> <table class="column-oriented">
<vn-thead> <thead>
<vn-tr> <tr>
<vn-th>{{$t('date')}}</vn-th> <th>{{$t('date')}}</th>
<vn-th>{{$t('concept')}}</vn-th> <th>{{$t('concept')}}</th>
<vn-th class="number">{{$t('invoiced')}}</vn-th> <th class="number">{{$t('invoiced')}}</th>
<vn-th class="number">{{$t('payed')}}</vn-th> <th class="number">{{$t('payed')}}</th>
<vn-th class="number">{{$t('balance')}}</vn-th> <th class="number">{{$t('balance')}}</th>
</vn-tr> </tr>
</vn-thead> </thead>
<vn-tbody> <tbody>
<vn-tr v-for="sale in sales" :key="sale.id"> <tr v-for="sale in sales" :key="sale.id">
<vn-td>{{toISOString(sale.issued)}}</vn-td> <td>{{toISOString(sale.issued)}}</td>
<vn-td>{{sale.ref}}</vn-td> <td>{{sale.ref}}</td>
<vn-td class="number">{{sale.debtOut}}</vn-td> <td class="number">{{sale.debtOut}}</td>
<vn-td class="number">{{sale.debtIn}}</vn-td> <td class="number">{{sale.debtIn}}</td>
<vn-td class="number">{{getBalance(sale)}}</vn-td> <td class="number">{{getBalance(sale)}}</td>
</vn-tr> </tr>
</vn-tbody> </tbody>
<vn-tfoot> <tfoot>
<vn-tr> <tr>
<vn-td></vn-td> <td></td>
<vn-td><strong class="pull-right">Total</strong></vn-td> <td></td>
<vn-td class="number">{{getTotalDebtOut()}}</vn-td> <td class="number"><strong class="pull-left">Total</strong> {{getTotalDebtOut()}}</td>
<vn-td class="number">{{getTotalDebtIn()}}</vn-td> <td class="number">{{getTotalDebtIn()}}</td>
<vn-td class="number">{{totalBalance}}</vn-td> <td class="number">{{totalBalance}}</td>
</vn-tr> </tr>
</vn-tfoot> </tfoot>
</vn-table> </table>
</section> </section>
<report-footer id="pageFooter" <report-footer id="pageFooter"

View File

@ -3,12 +3,21 @@
} }
.title { .title {
margin-bottom: 10px;
font-weight: 100; font-weight: 100;
margin-top: 0; font-size: 1.5em;
margin-bottom: 20px; margin-top: 0
font-size: 2em }
.payment-type {
width: auto
}
.payment-type th:nth-child(2), .payment-type th:nth-child(5) {
padding: 10px !important
}
.payment-type th:nth-child(3){
padding: 0 50px !important
} }
vn-table {
margin-top: 50px !important
}

View File

@ -4,265 +4,144 @@
<section class="container"> <section class="container">
<report-header></report-header> <report-header></report-header>
<section class="main"> <section class="main">
<h1 class="title centered">{{$t('title')}}</h1>
<section class="panel supplierPanel"> <section class="panel supplierPanel">
<section class="body"> <section class="body">
<section class="verticalText">{{$t('supplier.toCompleteBySupplier')}}</section> <section class="vertical-text">
<section class="row inline"> {{$t('supplier.toCompleteBySupplier')}}
<section class="text">{{$t('supplier.orderReference')}}</section>
<section class="control">{{mandateCode}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.identifier')}}</section>
<section class="control">ES89000B97367486</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.name')}}</section>
<section class="control">{{supplierName}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.street')}}</section>
<section class="control">{{supplierStreet}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.location')}}</section>
<section class="control">{{supplierPostCode}}, {{supplierCity}} ({{supplierProvince}})</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.country')}}</section>
<section class="control">{{supplierCountry}}</section>
</section> </section>
<table class="row-oriented">
<tbody>
<tr>
<td>{{$t('supplier.orderReference')}}</td>
<th>{{mandateCode}}</td>
</tr>
<tr>
<td>{{$t('supplier.identifier')}}</td>
<th>ES89000B97367486</th>
</tr>
<tr>
<td>{{$t('supplier.name')}}</td>
<th>{{supplierName}}</th>
</tr>
<tr>
<td>{{$t('supplier.street')}}</td>
<th>{{supplierStreet}}</th>
</tr>
<tr>
<td>{{$t('supplier.location')}}</td>
<th>{{supplierPostCode}}, {{supplierCity}} ({{supplierProvince}})</th>
</tr>
<tr>
<td>{{$t('supplier.country')}}</td>
<th>{{supplierCountry}}</th>
</tr>
</tbody>
</table>
</section> </section>
</section> </section>
<section class="panel supplierPanel"> <p class="font small light-gray">{{$t('description')}}</p>
<p class="font small">
<strong>{{$t('documentCopy')}}</strong>
</p>
<section class="panel">
<section class="body"> <section class="body">
<section class="verticalText">{{$t('supplier.toCompleteBySupplier')}}</section> <section class="vertical-text">
<section class="row inline"> {{$t('client.toCompleteByClient')}}
<section class="text">{{$t('supplier.orderReference')}}</section>
<section class="control">{{mandateCode}}</section>
</section> </section>
<section class="row inline">
<section class="text">{{$t('supplier.identifier')}}</section>
<section class="control">ES89000B97367486</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.name')}}</section>
<section class="control">{{supplierName}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.street')}}</section>
<section class="control">{{supplierStreet}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.location')}}</section>
<section class="control">{{supplierPostCode}}, {{supplierCity}} ({{supplierProvince}})</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.country')}}</section>
<section class="control">{{supplierCountry}}</section>
</section>
</section>
</section>
<section class="panel supplierPanel"> <table class="row-oriented">
<section class="body"> <tbody>
<section class="verticalText">{{$t('supplier.toCompleteBySupplier')}}</section> <tr>
<section class="row inline"> <td>
<section class="text">{{$t('supplier.orderReference')}}</section> {{$t('client.name')}}
<section class="control">{{mandateCode}}</section> <section class="description">{{$t('client.accountHolder')}}</section>
</section> </td>
<section class="row inline"> <th>{{clientName}}</td>
<section class="text">{{$t('supplier.identifier')}}</section> </tr>
<section class="control">ES89000B97367486</section> <tr>
</section> <td>{{$t('client.street')}}</td>
<section class="row inline"> <th>{{clientStreet}}</td>
<section class="text">{{$t('supplier.name')}}</section> </tr>
<section class="control">{{supplierName}}</section> <tr>
</section> <td>{{$t('client.location')}}</td>
<section class="row inline"> <th>{{clientPostCode}}, {{clientCity}} ({{clientProvince}})</td>
<section class="text">{{$t('supplier.street')}}</section> </tr>
<section class="control">{{supplierStreet}}</section> <tr>
</section> <td>{{$t('client.country')}}</td>
<section class="row inline"> <th>{{clientCountry}}</td>
<section class="text">{{$t('supplier.location')}}</section> </tr>
<section class="control">{{supplierPostCode}}, {{supplierCity}} ({{supplierProvince}})</section> <tr>
</section> <td>{{$t('client.swift')}}</td>
<section class="row inline"> <th>
<section class="text">{{$t('supplier.country')}}</section> <section class="field square">
<section class="control">{{supplierCountry}}</section> <span v-for="i in 11"></span>
</section>
</section>
</section>
<section class="panel supplierPanel">
<section class="body">
<section class="verticalText">{{$t('supplier.toCompleteBySupplier')}}</section>
<section class="row inline">
<section class="text">{{$t('supplier.orderReference')}}</section>
<section class="control">{{mandateCode}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.identifier')}}</section>
<section class="control">ES89000B97367486</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.name')}}</section>
<section class="control">{{supplierName}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.street')}}</section>
<section class="control">{{supplierStreet}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.location')}}</section>
<section class="control">{{supplierPostCode}}, {{supplierCity}} ({{supplierProvince}})</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.country')}}</section>
<section class="control">{{supplierCountry}}</section>
</section>
</section>
</section>
<section class="panel supplierPanel">
<section class="body">
<section class="verticalText">{{$t('supplier.toCompleteBySupplier')}}</section>
<section class="row inline">
<section class="text">{{$t('supplier.orderReference')}}</section>
<section class="control">{{mandateCode}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.identifier')}}</section>
<section class="control">ES89000B97367486</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.name')}}</section>
<section class="control">{{supplierName}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.street')}}</section>
<section class="control">{{supplierStreet}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.location')}}</section>
<section class="control">{{supplierPostCode}}, {{supplierCity}} ({{supplierProvince}})</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.country')}}</section>
<section class="control">{{supplierCountry}}</section>
</section>
</section>
</section>
<section class="panel supplierPanel">
<section class="body">
<section class="verticalText">{{$t('supplier.toCompleteBySupplier')}}</section>
<section class="row inline">
<section class="text">{{$t('supplier.orderReference')}}</section>
<section class="control">{{mandateCode}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.identifier')}}</section>
<section class="control">ES89000B97367486</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.name')}}</section>
<section class="control">{{supplierName}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.street')}}</section>
<section class="control">{{supplierStreet}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.location')}}</section>
<section class="control">{{supplierPostCode}}, {{supplierCity}} ({{supplierProvince}})</section>
</section>
<section class="row inline">
<section class="text">{{$t('supplier.country')}}</section>
<section class="control">{{supplierCountry}}</section>
</section>
</section>
</section>
<!-- <p class="font small">{{$t('bodyDescription}}</p>
<p class="font small"><strong>{{$t('clientAdvice}}</strong></p>
<section class="panel">
<section class="verticalText">{{$t('toCompleteByClient}}</section>
<section class="row inline">
<section class="text">{{$t('clientName}}</section>
<section class="control">{{clientName}}</section>
<section class="description">{{$t('accountHolder}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('clientStreet}}</section>
<section class="control">{{clientStreet}}</section>
</section>
<section class="row inline">
<section class="text">{{$t('clientLocation}}</section>
<section class="control">{{clientPostCode}}, {{clientCity}} ({{clientProvince}})</section>
</section>
<section class="row inline">
<section class="text">{{$t('clientCountry}}</section>
<section class="control">{{clientCountry}}</section>
</section>
<section class="row inline">
<section class="text font verticalAlign">{{$t('swift}}</section>
<section class="control">
{{#swiftFields}}
<section class="box"></section>
{{/swiftFields}}
</section>
</section>
<section class="row">
<section class="text">{{$t('accountNumber}}</section>
<section class="control">
<section class="box">ES</section>
{{#accountNumberFields}}
<section class="box"></section>
{{/accountNumberFields}}
</section>
<section class="description">
<section class="line"><span>{{$t('accountNumberFormat}}</span></section>
</section>
</section>
<section class="row inline">
<section class="text font verticalAlign">{{$t('paymentType}}</section>
<section class="control">
<section class="columns">
<section class="size33">
<section class="size25">
<section class="box crossed">X</section>
</section>
<section class="size25 font verticalAlign">{{$t('recurrent}}</section>
</section>
<section class="size33 font centered">O</section>
<section class="size33">
<section class="size25">
<section class="box"></section>
</section>
<section class="size25 font verticalAlign">{{$t('unique}}</section>
</section>
</section> </section>
</section> </td>
</section> </tr>
<section class="row inline"> <tr>
<section class="text">{{$t('signLocation}}</section> <td colspan="2">{{$t('client.accountNumber')}}</td>
<section class="control">{{currentDate}}, {{supplierProvince}}</section> </tr>
</section> <tr>
<section class="row inline"> <td colspan="2">
<section class="text">{{$t('sign}}</section> <section class="field square">
<section class="control"></section> <span>E</span>
</section> <span>S</span>
</section> <span v-for="i in 22"></span>
<p class="font small">{{$t('mandatoryFields}}</p> </section>
<p class="font small">{{$t('sendOrder}}</p> --> </td>
</tr>
<tr>
<td class="description" colspan="2">
<section class="line">
<span>{{$t('client.accountNumberFormat')}}</span>
</section>
</td>
</tr>
<tr>
<td>{{$t('client.paymentType')}}</td>
<th>
<table class="payment-type">
<tr>
<td>
<section class="field square">
<span class="crossed">X</span>
</section>
</td>
<th>{{$t('client.recurrent')}}</th>
<th>O</th>
<td>
<section class="field square">
<span></span>
</section>
</td>
<th>{{$t('client.unique')}}</th>
</tr>
</table>
</td>
</tr>
<tr>
<td>{{$t('client.signLocation')}}</td>
<th>{{dated()}}, {{supplierProvince}}</td>
</tr>
<tr>
<td>{{$t('client.sign')}}</td>
<th></td>
</tr>
</tbody>
</table>
</section>
</section>
<p class="font small">{{$t('mandatoryFields')}}</p>
<p class="font small">{{$t('sendOrder')}}</p>
</section> </section>
<report-footer id="pageFooter" <report-footer id="pageFooter"
:left-text="$t('client', [clientId])" :left-text="$t('order', [mandateCode])"
:center-text="clientName"> :center-text="clientName">
</report-footer> </report-footer>
</section> </section>

View File

@ -2,6 +2,15 @@ module.exports = {
messages: { messages: {
es: { es: {
title: 'Orden de domiciliación de adeudo SEPA CORE', title: 'Orden de domiciliación de adeudo SEPA CORE',
description: `Mediante la firma de esta orden de domiciliación, el deudor autoriza (A) al acreedor a enviar instrucciones
a la entidad del deudor para adeudar su cuenta y (B) a la entidad para efectuar los adeudos en su cuenta siguiendo las
instrucciones del acreedor.Como parte de sus derechos, el deudor está legitimado al reembolso por su entidad en los
términos y condiciones del contrato suscrito con la misma. La solicitud de reembolso deberá efectuarse dentro de las
ocho semanas que adeudo en cuenta. Puede obtener información adicional sobre sus derechos en su entidad financiera.`,
documentCopy: `Debe llevar a su Entidad Bancaria una copia
del documento firmado para que lo registre y evitar la devolución.`,
mandatoryFields: `TODOS LOS CAMPOS HAN DE SER CUMPLIMENTADOS OBLIGATORIAMENTE.`,
sendOrder: `UNA VEZ FIRMADA ESTA ORDEN DE DOMICILIACIÓN DEBE SER ENVIADA AL ACREEDOR PARA SU CUSTODIA Y ES RECOMENDABLE FACILITAR UNA COPIA A SU ENTIDAD BANCARIA.`,
supplier: { supplier: {
toCompleteBySupplier: 'A cumplimentar por el acreedor', toCompleteBySupplier: 'A cumplimentar por el acreedor',
orderReference: 'Referencia de la orden de domiciliación', orderReference: 'Referencia de la orden de domiciliación',
@ -9,11 +18,25 @@ module.exports = {
name: 'Nombre del acreedor', name: 'Nombre del acreedor',
street: 'Dirección', street: 'Dirección',
location: 'CP - Población - Provincia', location: 'CP - Población - Provincia',
country: 'País', country: 'País'
}, },
client: { client: {
toCompleteByClient: 'A cumplimentar por el deudor', toCompleteByClient: 'A cumplimentar por el deudor',
name: 'Nombre del deudor/es',
street: 'Dirección del deudor',
location: 'CP - Población - Provincia',
country: 'País del deudor',
swift: 'Swift BIC',
accountNumber: 'Número de cuenta - IBAN',
accountHolder: '(Titular/es de la cuenta de cargo)',
accountNumberFormat: 'En España el IBAN consta de 24 posiciones comenzando siempre por ES',
paymentType: 'Tipo de pago',
recurrent: 'Recurrente',
unique: 'Único',
signLocation: 'Fecha - Localidad',
sign: 'Firma del deudor y sello',
}, },
order: 'Ord. domiciliación {0}',
}, },
}, },
}; };

View File

@ -0,0 +1,6 @@
const CssReader = require(`${appPath}/lib/cssReader`);
module.exports = new CssReader([
`${appPath}/common/css/layout.css`,
`${__dirname}/style.css`])
.mergeStyles();

View File

@ -0,0 +1,40 @@
body {
background-color: #EEE
}
.container {
max-width: 600px;
min-width: 320px;
margin: 0 auto;
color: #555
}
.main {
background-color: #FFF;
padding: 20px
}
.main a {
color: #8dba25
}
.main h1 {
color: #999
}
.main h3 {
font-size: 16px
}
.title {
background-color: #95d831;
text-transform: uppercase;
text-align: center;
padding: 35px 0
}
.title h1 {
font-size: 32px;
color: #333;
margin: 0
}

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="es">
<head>
<title>{{ $t('subject') }}</title>
</head>
<body>
<section class="container">
<!-- Header component -->
<email-header></email-header>
<!-- End header component -->
<section class="main">
<!-- Title block -->
<div class="title">
<h1>{{ $t('title') }}</h1>
</div>
<!-- Title block end -->
<p>{{$t('description.dear')}},</p>
<p>{{$t('description.instructions')}}</p>
<p>{{$t('description.conclusion')}}</p>
</section>
<!-- Footer component -->
<email-footer></email-footer>
<!-- End footer component -->
</section>
</body>
</html>

48
print/report/sepa-core/index.js Executable file
View File

@ -0,0 +1,48 @@
const database = require(`${appPath}/lib/database`);
const reportEngine = require(`${appPath}/lib/reportEngine.js`);
const UserException = require(`${appPath}/lib/exceptions/userException`);
module.exports = {
name: 'sepa-core',
async asyncData(ctx, params) {
const promises = [];
const data = {
isPreview: ctx.method === 'GET',
};
if (!params.clientFk)
throw new UserException('No client id specified');
promises.push(reportEngine.toPdf('rpt-sepa-core', ctx));
promises.push(this.methods.fetchClient(params.clientFk));
return Promise.all(promises).then(result => {
const stream = result[0];
const [[client]] = result[1];
Object.assign(data, client);
Object.assign(data, {attachments: [{filename: 'rpt-sepa-core.pdf', content: stream}]});
return data;
});
},
created() {
this.$i18n.locale = this.locale;
},
methods: {
fetchClient(clientFk) {
return database.pool.query(`
SELECT
u.lang locale,
c.email recipient
FROM client c
JOIN account.user u ON u.id = c.id
WHERE c.id = ?`, [clientFk]);
},
},
components: {
'email-header': require('../email-header'),
'email-footer': require('../email-footer'),
},
};

View File

@ -0,0 +1,16 @@
module.exports = {
messages: {
es: {
subject: 'Solicitud de domiciliación bancaria',
title: 'Domiciliación SEPA CORE',
description: {
dear: 'Estimado cliente',
instructions: `Para poder tramitar tu solicitud de cambio de tu forma de pago a giro bancario,
te adjuntamos los documentos correspondientes a la ley de pago, que tienes que cumplimentar y enviarnos.`,
conclusion: 'Gracias por tu atención.'
},
},
},
};