This commit is contained in:
Carlos Jimenez Ruiz 2019-01-24 15:41:56 +01:00
commit 18d7d07f56
48 changed files with 2493 additions and 59 deletions

View File

@ -40,5 +40,8 @@
},
"Sip": {
"dataSource": "vn"
}
},
"PersonMedia": {
"dataSource": "vn"
}
}

View File

@ -0,0 +1,25 @@
{
"name": "PersonMedia",
"base": "VnModel",
"options": {
"mysql": {
"table": "personMedia"
}
},
"properties": {
"mediaValue": {
"type": "String"
},
"workerFk": {
"id": true,
"type": "Number"
}
},
"relations": {
"worker": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "workerFk"
}
}
}

View File

@ -6,7 +6,7 @@ describe('Client listWorkers', () => {
.then(result => {
let amountOfEmployees = Object.keys(result).length;
expect(amountOfEmployees).toEqual(41);
expect(amountOfEmployees).toEqual(43);
done();
})
.catch(done.fail);

185
print/common/css/layout.css Normal file
View File

@ -0,0 +1,185 @@
.columns {
overflow: hidden
}
.columns .size100 {
width: 100%;
float: left
}
.columns .size75 {
width: 75%;
float: left
}
.columns .size50 {
width: 50%;
float: left
}
.columns .size33 {
width: 33.33%;
float: left
}
.columns .size25 {
width: 25%;
float: left
}
.pull-left {
float: left
}
.pull-right {
float: right
}
.grid {
border-bottom: 3px solid #888888
}
.grid .row {
padding: 5px;
margin-bottom: 0
}
.grid .header {
border-bottom: 1px solid #808080;
border-top: 1px solid #808080;
background-color: #c0c0c0;
}
.grid .row.inline > div {
float: left;
}
.panel {
border: 1px solid #DDD;
margin-bottom: 10px;
position: relative;
padding:10px
}
.panel .header {
font-weight: bold
}
.row {
margin-bottom: 15px;
overflow: hidden
}
.row.small {
margin-bottom: 5px
}
.row .text {
margin-bottom: 5px
}
.row .control {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box
}
.row .text, .row .control {
overflow: hidden
}
.row .description {
position: relative;
padding-top: 2px;
overflow: hidden;
font-size: 9px;
display: block;
color: #999
}
.row .line {
border-bottom: 1px solid #DDD;
border-right: 1px solid #DDD;
border-left: 1px solid #DDD;
margin-top: 10px;
color: #999;
padding: 5px
}
.row .description span {
background-color: #FFF;
margin: -5px 0 0 50px;
display: block;
padding: 5px;
float: left
}
.row:last-child {
margin-bottom: 0
}
.row.inline .text {
margin-bottom: 0;
width: 40%;
float: left
}
.row.inline .control {
font-weight: bold;
padding-left: 20px;
color: #000;
width: 60%;
float: left
}
.row.inline .description {
position: static;
overflow: visible
}
.box {
border-top: 1px solid #CCC;
border-right: 1px solid #CCC;
border-bottom: 1px solid #CCC;
font-weight: bold;
text-align: center;
padding-top: 4px;
width: 25px;
height: 21px;
color: #000;
float: left
}
.box.crossed {
font-weight: 100;
font-size: 16px
}
.pull-left {
float: left
}
.pull-right {
float: right
}
.grid {
border-bottom: 3px solid #888888
}
.grid .row {
padding: 5px;
margin-bottom: 0
}
.grid .header {
border-bottom: 1px solid #808080;
border-top: 1px solid #808080;
background-color: #c0c0c0;
}
.grid .row.inline > div {
float: left;
}

View File

@ -6,6 +6,9 @@
{"type": "email", "name": "letter-debtor-nd"},
{"type": "report", "name": "delivery-note"},
{"type": "report", "name": "invoice"},
{"type": "report", "name": "claim-pickup"},
{"type": "static", "name": "email-header"},
{"type": "static", "name": "email-footer"}
{"type": "static", "name": "email-footer"},
{"type": "static", "name": "report-header"},
{"type": "static", "name": "report-footer"}
]

18
print/lib/cssReader.js Normal file
View File

@ -0,0 +1,18 @@
const fs = require('fs-extra');
class CssReader {
constructor(files) {
this.files = files;
this.css = [];
}
mergeStyles() {
this.files.forEach(file => {
this.css.push(fs.readFileSync(file));
});
return this.css.join('\n');
}
}
module.exports = CssReader;

View File

@ -120,10 +120,10 @@ module.exports = {
async attachAssets(component) {
const localePath = `${this.path}/${component.name}/locale.js`;
const templatePath = `${this.path}/${component.name}/index.html`;
const stylePath = `${this.path}/${component.name}/assets/css/style.css`;
const stylePath = `${this.path}/${component.name}/assets/css/index.js`;
const template = await fs.readFile(templatePath, 'utf8');
const css = await fs.readFile(stylePath, 'utf8');
const css = require(stylePath);
component.i18n = require(localePath);
component.template = juice.inlineContent(template, css);

View File

@ -2,7 +2,8 @@ const Vue = require('vue');
const VueI18n = require('vue-i18n');
const renderer = require('vue-server-renderer').createRenderer();
const fs = require('fs-extra');
const pdf = require('phantom-html2pdf');
// const pdf = require('phantom-html2pdf');
const pdf = require('html-pdf');
const juice = require('juice');
Vue.use(VueI18n);
@ -46,6 +47,7 @@ module.exports = {
let mergedData = {};
let asyncData = {};
let data = {};
let params = {};
if (Object.keys(ctx.body).length > 0)
params = ctx.body;
@ -80,24 +82,31 @@ module.exports = {
},
async attachAssets(component) {
const localePath = `${this.path}/${component.name}/locale.js`;
const localePath = `${this.path}/${component.name}/locale`;
const templatePath = `${this.path}/${component.name}/index.html`;
const stylePath = `${this.path}/${component.name}/assets/css/style.css`;
const stylePath = `${this.path}/${component.name}/assets/css/index`;
const template = await fs.readFile(templatePath, 'utf8');
const css = await fs.readFile(stylePath, 'utf8');
const css = require(stylePath);
component.i18n = require(localePath);
component.template = juice.inlineContent(template, css);
},
async toPdf(name, ctx) {
const html = await this.render(name, ctx);
const options = {
html: await this.render(name, ctx),
format: 'A4',
border: '1.5cm',
footer: {
height: '80px',
}
};
const result = await pdf.convert(options);
const stream = await result.toStream();
return stream;
return new Promise(resolve => {
pdf.create(html, options).toStream((err, stream) => {
resolve(stream);
});
});
},
};

1499
print/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -14,11 +14,11 @@
"license": "GPL-3.0",
"dependencies": {
"fs-extra": "^7.0.1",
"html-pdf": "^2.2.0",
"juice": "^5.0.1",
"mysql2": "^1.6.1",
"nodemailer": "^4.7.0",
"phantom": "^6.0.3",
"phantom-html2pdf": "^4.0.1",
"strftime": "^0.10.0",
"vue": "^2.5.17",
"vue-i18n": "^8.3.1",
"vue-server-renderer": "^2.5.17"

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,6 @@
.container {
font-family: arial, sans-serif;
font-size: 16px;
color: #555;
zoom: 0.55
}

View File

@ -0,0 +1,79 @@
<!DOCTYPE html>
<html lang="es">
<body>
<section class="container">
<report-header></report-header>
<section class="main">
<div class="columns">
<div class="size50">
<div class="size75">
<h1 style="margin-top:0" class="font extraLarge">{{$t('title')}}</h1>
<div class="row inline font normal">
<div class="text font gray">{{$t('claimId')}}:</div>
<div class="control">{{claimId}}</div>
</div>
<div class="row inline font normal">
<div class="text font gray">{{$t('clientId')}}:</div>
<div class="control">{{clientId}}</div>
</div>
<div class="row inline font normal">
<div class="text font gray">{{$t('date')}}:</div>
<div class="control">{{dated()}}</div>
</div>
</div>
</div>
<div class="size50">
<div class="panel">
<div class="header">{{$t('clientData')}}</div>
<p>
<strong>{{clientName}}</strong>
</p>
<div>
{{street}}
</div>
<div>
{{postcode}}, {{city}} ({{province}})
</div>
<div>
{{country}}
</div>
</div>
</div>
</div>
<div class="grid" style="margin-top:20px">
<div class="row header inline">
<div style="width: 15%">{{$t('quantity')}}</div>
<div style="width: 15%">{{$t('claims')}}</div>
<div style="width: 20%">{{$t('reference')}}</div>
<div style="width: 50%">{{$t('concept')}}</div>
</div>
<div class="row inline" v-for="sale in sales">
<div class="font bold" style="width: 15%">{{sale.quantity}}&nbsp;</div>
<div class="font bold" style="width: 15%">{{sale.claimQuantity}}&nbsp;</div>
<div class="font bold" style="width: 20%">{{sale.id}}&nbsp;</div>
<div class="font bold" style="width: 50%">{{sale.concept}}&nbsp;</div>
</div>
</div>
<div class="columns" style="margin-top: 50px">
<div class="size25">&nbsp;</div>
<div class="size50">
<div class="panel" style="height: 150px">
<div style="text-align: center">
<h3>{{clientName}}</h3>
</div>
</div>
</div>
<div class="size25">&nbsp;</div>
</div>
<p v-html="$t('sections.agency.description')"></p>
</section>
<report-footer id="pageFooter"
:left-text="$t('claim', [claimId])"
:center-text="clientName">
</report-footer>
</section>
</body>
</html>

View File

@ -0,0 +1,72 @@
const strftime = require('strftime');
const database = require(`${appPath}/lib/database`);
const UserException = require(`${appPath}/lib/exceptions/userException`);
module.exports = {
name: 'claim-pickup',
async asyncData(ctx, params) {
const promises = [];
const data = {};
if (!params.claimFk)
throw new UserException('No claim id specified');
promises.push(this.methods.fetchClaim(params.claimFk));
promises.push(this.methods.fetchSales(params.claimFk));
return Promise.all(promises).then(result => {
const [[claim]] = result[0];
const [sales] = result[1];
Object.assign(data, claim, {sales});
return data;
});
},
created() {
this.$i18n.locale = this.locale;
},
methods: {
dated: () => {
return strftime('%d-%m-%Y', new Date());
},
fetchClaim(claimFk) {
return database.pool.query(
`SELECT
u.lang locale,
c.id clientId,
cl.id claimId,
c.email AS recipient,
c.socialName,
c.name AS clientName,
c.street,
c.postcode,
c.city,
c.fi,
p.name AS province,
ct.country
FROM claim cl
JOIN client c ON c.id = cl.clientFk
JOIN account.user u ON u.id = c.id
JOIN country ct ON ct.id = c.countryFk
LEFT JOIN province p ON p.id = c.provinceFk
WHERE cl.id = ?`, [claimFk]);
},
fetchSales(claimFk) {
return database.pool.query(
`SELECT
s.id,
s.quantity,
s.concept,
cb.quantity claimQuantity
FROM claimBeginning cb
JOIN sale s ON s.id = cb.saleFk
WHERE cb.claimFk = ?`, [claimFk]);
},
},
components: {
'report-header': require('../report-header'),
'report-footer': require('../report-footer'),
},
};

View File

@ -0,0 +1,22 @@
module.exports = {
messages: {
es: {
title: 'ORD. RECOGIDA',
claimId: 'Reclamación',
clientId: 'Cliente',
date: 'Fecha',
clientData: 'Datos del cliente',
quantity: 'Cantidad',
claims: 'Reclama',
reference: 'Referencia',
concept: 'Concepto',
claim: 'Reclamación {0}',
sections: {
agency: {
description: `Para agilizar su recogida, por favor, póngase en contacto con la oficina de integrados. <br/>
Tlf: 96 166 77 88 - Ana Gómez <em>(agomezf@integra2.es)</em>`
}
}
},
},
};

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

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

View File

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

View File

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

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -1,5 +1,5 @@
<header>
<a href="https://www.verdnatura.es" target="_blank"/>
<img :src="embeded['/assets/images/logo.png']" alt="VerdNatura"/>
<img :src="embeded['/assets/images/email-logo.png']" alt="VerdNatura"/>
</a>
</header>

View File

@ -16,7 +16,7 @@ module.exports = {
data() {
return {
files: ['/assets/images/logo.png'],
files: ['/assets/images/email-logo.png'],
};
},
};

View File

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

View File

@ -0,0 +1,22 @@
footer {
font-family: arial, sans-serif;
margin-top: 30px;
font-size: 16px;
color: #555;
zoom: 0.55
}
footer, footer p {
text-align: center;
font-size: 12px
}
footer .page {
border-bottom: 2px solid #CCC;
padding-bottom: 2px
}
footer .page > section {
display: inline-block;
width: 33%
}

View File

@ -0,0 +1,9 @@
<footer>
<section class="page">
<section :if="leftText">{{leftText}}</section>
<section :if="centerText">{{centerText}}</section>
<section class="number">{{$t('numPages')}}</section>
</section>
<p>{{$t('law.phytosanitary')}}</p>
<p>{{$t('law.privacy')}}</p>
</footer>

View File

@ -0,0 +1,4 @@
module.exports = {
name: 'report-footer',
props: ['leftText', 'centerText']
};

View File

@ -0,0 +1,15 @@
module.exports = {
messages: {
es: {
numPages: 'Página {{page}} de {{pages}}',
law: {
phytosanitary: 'VERDNATURA LEVANTE SL - Pasaporte Fitosanitario R.P. Generalitat Valenciana - Nº Comerciante: ES17462130',
privacy: `En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal,
le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L.,
pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo
por escrito al domicilio social de la entidad. La finalidad del fichero
es la gestión administrativa, contabilidad, y facturación.`,
}
},
},
};

View File

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

View File

@ -0,0 +1,13 @@
header {
border-bottom: 1px solid #DDD;
padding-bottom: 10px;
margin-bottom: 40px;
text-align: center;
font-size: 12px;
color: #555
}
header img {
margin-bottom: 10px;
width: 350px
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" width="226.229px" height="31.038px" viewBox="0 0 226.229 31.038" enable-background="new 0 0 226.229 31.038" xml:space="preserve" id="svg2" inkscape:version="0.48.1 r9760" sodipodi:docname="logo.svg"><metadata id="metadata61"><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/></cc:Work></rdf:RDF></metadata><defs id="defs59"/><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="1366" inkscape:window-height="710" id="namedview57" showgrid="false" inkscape:zoom="4.0755163" inkscape:cx="138.56745" inkscape:cy="16.509992" inkscape:window-x="0" inkscape:window-y="26" inkscape:window-maximized="1" inkscape:current-layer="svg2"/>
<g id="Background">
</g>
<g id="Guides">
</g>
<g id="Foreground">
<g id="g7">
<g id="g9">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.417,30.321L0,0h8.233l4.26,15.582l0.349,1.276 c0.521,1.866,0.918,3.431,1.191,4.693c0.15-0.618,0.335-1.345,0.555-2.182c0.219-0.837,0.528-1.935,0.925-3.293L19.981,0h8.19 L17.671,30.321H10.417z" id="path11"/>
</g>
<g id="g13">
<path fill-rule="evenodd" clip-rule="evenodd" fill="#A0CE67" d="M139.809,19.787c-0.665,0.357-1.748,0.686-3.25,0.988 c-0.727,0.137-1.283,0.254-1.667,0.35c-0.95,0.247-1.661,0.563-2.134,0.947c-0.472,0.384-0.799,0.899-0.979,1.544 c-0.223,0.796-0.155,1.438,0.204,1.925c0.359,0.488,0.945,0.731,1.757,0.731c1.252,0,2.375-0.36,3.369-1.081 c0.994-0.721,1.653-1.665,1.98-2.831L139.809,19.787z M144.915,30.321h-7.458c0.017-0.356,0.048-0.726,0.094-1.11l0.159-1.192 c-1.318,1.026-2.627,1.786-3.927,2.279c-1.299,0.493-2.643,0.739-4.031,0.739c-2.158,0-3.7-0.593-4.625-1.779 c-0.925-1.187-1.106-2.788-0.542-4.804c0.519-1.851,1.431-3.356,2.737-4.515c1.307-1.159,3.021-1.972,5.142-2.438 c1.169-0.247,2.641-0.515,4.413-0.803c2.646-0.412,4.082-1.016,4.304-1.812l0.151-0.539c0.182-0.65,0.076-1.145-0.317-1.483 c-0.393-0.339-1.071-0.508-2.033-0.508c-1.045,0-1.934,0.214-2.666,0.643c-0.731,0.428-1.289,1.058-1.673,1.887h-6.748 c1.065-2.53,2.64-4.413,4.723-5.65s4.724-1.856,7.923-1.856c1.991,0,3.602,0.241,4.833,0.722s2.095,1.209,2.59,2.185 c0.339,0.701,0.483,1.536,0.432,2.504c-0.052,0.969-0.377,2.525-0.978,4.669l-2.375,8.483c-0.284,1.014-0.416,1.812-0.396,2.395 s0.188,0.962,0.503,1.141L144.915,30.321z" id="path15" style="fill:#8ed300;fill-opacity:1"/>
</g>
<g id="g17">
<path fill-rule="evenodd" clip-rule="evenodd" fill="#A0CE67" d="M185.7,30.321l6.27-22.393h7.049l-1.097,3.918 c1.213-1.537,2.502-2.659,3.867-3.366c1.365-0.707,2.951-1.074,4.758-1.101l-2.03,7.25c-0.304-0.042-0.608-0.072-0.912-0.093 c-0.303-0.02-0.592-0.03-0.867-0.03c-1.126,0-2.104,0.168-2.932,0.504c-0.829,0.336-1.561,0.854-2.197,1.555 c-0.406,0.467-0.789,1.136-1.149,2.007c-0.361,0.872-0.814,2.282-1.359,4.232l-2.104,7.516H185.7z" id="path19" style="fill:#8ed300;fill-opacity:1"/>
</g>
<g id="g21">
<path fill-rule="evenodd" clip-rule="evenodd" fill="#A0CE67" d="M217.631,19.787c-0.664,0.357-1.748,0.686-3.25,0.988 c-0.727,0.137-1.282,0.254-1.667,0.35c-0.95,0.247-1.661,0.563-2.134,0.947c-0.472,0.384-0.799,0.899-0.979,1.544 c-0.223,0.796-0.155,1.438,0.205,1.925c0.359,0.488,0.945,0.731,1.757,0.731c1.252,0,2.375-0.36,3.369-1.081 c0.994-0.721,1.654-1.665,1.98-2.831L217.631,19.787z M222.737,30.321h-7.458c0.017-0.356,0.048-0.726,0.094-1.11l0.159-1.192 c-1.318,1.026-2.627,1.786-3.927,2.279c-1.299,0.493-2.643,0.739-4.031,0.739c-2.158,0-3.7-0.593-4.625-1.779 c-0.926-1.187-1.106-2.788-0.542-4.804c0.519-1.851,1.431-3.356,2.737-4.515c1.306-1.159,3.02-1.972,5.142-2.438 c1.169-0.247,2.641-0.515,4.413-0.803c2.647-0.412,4.082-1.016,4.304-1.812l0.151-0.539c0.182-0.65,0.077-1.145-0.317-1.483 c-0.393-0.339-1.071-0.508-2.033-0.508c-1.045,0-1.934,0.214-2.666,0.643c-0.731,0.428-1.289,1.058-1.672,1.887h-6.748 c1.065-2.53,2.64-4.413,4.723-5.65s4.724-1.856,7.923-1.856c1.99,0,3.601,0.241,4.833,0.722s2.095,1.209,2.591,2.185 c0.339,0.701,0.483,1.536,0.431,2.504c-0.051,0.969-0.377,2.525-0.978,4.669l-2.375,8.483c-0.284,1.014-0.416,1.812-0.396,2.395 c0.02,0.583,0.188,0.962,0.503,1.141L222.737,30.321z" id="path23" style="fill:#8ed300;fill-opacity:1"/>
</g>
<g id="g25">
<path fill-rule="evenodd" clip-rule="evenodd" fill="#A0CE67" d="M188.386,7.928l-6.269,22.393h-7.174l0.864-3.085 c-1.227,1.246-2.476,2.163-3.746,2.751s-2.625,0.882-4.067,0.882c-2.471,0-4.154-0.634-5.048-1.901 c-0.895-1.268-0.993-3.149-0.294-5.644l4.31-15.396h7.338l-3.508,12.53c-0.516,1.842-0.641,3.109-0.375,3.803 s0.967,1.041,2.105,1.041c1.275,0,2.323-0.422,3.142-1.267c0.819-0.845,1.497-2.223,2.031-4.133l3.353-11.974H188.386z" id="path27" style="fill:#8ed300;fill-opacity:1"/>
</g>
<g id="g29">
<path fill-rule="evenodd" clip-rule="evenodd" fill="#A0CE67" d="M149.937,12.356l1.239-4.428h2.995l1.771-6.326h7.338 l-1.771,6.326h3.753l-1.24,4.428h-3.753l-2.716,9.702c-0.416,1.483-0.498,2.465-0.247,2.946c0.25,0.48,0.905,0.721,1.964,0.721 l0.549-0.011l0.39-0.031l-1.31,4.678c-0.811,0.148-1.596,0.263-2.354,0.344c-0.758,0.081-1.48,0.122-2.167,0.122 c-2.543,0-4.108-0.621-4.695-1.863c-0.587-1.242-0.313-3.887,0.82-7.936l2.428-8.672H149.937z" id="path31" style="fill:#8ed300;fill-opacity:1"/>
</g>
<g id="g33">
<path fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" d="M73.875,18.896c-0.561,2.004-0.616,3.537-0.167,4.601 s1.375,1.595,2.774,1.595c1.399,0,2.605-0.524,3.62-1.574s1.806-2.59,2.375-4.622c0.526-1.879,0.556-3.334,0.09-4.363 c-0.466-1.029-1.393-1.543-2.778-1.543c-1.304,0-2.487,0.528-3.551,1.585S74.386,17.071,73.875,18.896z M96.513,0l-8.489,30.321 h-7.337l0.824-2.944c-1.166,1.22-2.369,2.121-3.61,2.703s-2.583,0.874-4.025,0.874c-2.802,0-4.772-1.081-5.912-3.243 c-1.139-2.162-1.218-4.993-0.238-8.493c0.988-3.528,2.668-6.404,5.042-8.627c2.374-2.224,4.927-3.336,7.661-3.336 c1.47,0,2.695,0.296,3.676,0.887c0.981,0.591,1.681,1.465,2.099,2.62L89.217,0H96.513z" id="path35"/>
<g id="g37">
<path fill-rule="evenodd" clip-rule="evenodd" d="M73.875,18.896c-0.561,2.004-0.616,3.537-0.167,4.601s1.375,1.595,2.774,1.595 c1.399,0,2.605-0.524,3.62-1.574s1.806-2.59,2.375-4.622c0.526-1.879,0.556-3.334,0.09-4.363 c-0.466-1.029-1.393-1.543-2.778-1.543c-1.304,0-2.487,0.528-3.551,1.585S74.386,17.071,73.875,18.896z M96.513,0l-8.489,30.321 h-7.337l0.824-2.944c-1.166,1.22-2.369,2.121-3.61,2.703s-2.583,0.874-4.025,0.874c-2.802,0-4.772-1.081-5.912-3.243 c-1.139-2.162-1.218-4.993-0.238-8.493c0.988-3.528,2.668-6.404,5.042-8.627c2.374-2.224,4.927-3.336,7.661-3.336 c1.47,0,2.695,0.296,3.676,0.887c0.981,0.591,1.681,1.465,2.099,2.62L89.217,0H96.513z" id="path39"/>
</g>
</g>
<g id="g41">
<path fill-rule="evenodd" clip-rule="evenodd" d="M46.488,30.321l6.269-22.393h7.049l-1.098,3.918 c1.213-1.537,2.502-2.659,3.868-3.366s6.015-1.074,7.822-1.101l-2.03,7.25c-0.304-0.042-0.608-0.072-0.911-0.093 c-0.304-0.02-0.592-0.03-0.867-0.03c-1.126,0-5.167,0.168-5.997,0.504c-0.829,0.336-1.561,0.854-2.196,1.555 c-0.406,0.467-0.789,1.136-1.149,2.007c-0.361,0.872-0.814,2.282-1.36,4.232l-2.104,7.516H46.488z" id="path43"/>
</g>
<g id="g45">
<path fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" d="M32.673,16.742l8.351-0.021 c0.375-1.436,0.308-2.558-0.201-3.365s-1.402-1.211-2.68-1.211c-1.209,0-2.285,0.397-3.229,1.19S33.224,15.265,32.673,16.742z M38.817,23.278h7.043c-1.347,2.456-3.172,4.356-5.477,5.7c-2.305,1.345-4.885,2.017-7.74,2.017 c-3.473,0-5.923-1.054-7.351-3.161c-1.427-2.107-1.632-4.98-0.613-8.618c1.038-3.707,2.875-6.641,5.512-8.803 c2.637-2.163,5.678-3.244,9.123-3.244c3.555,0,6.04,1.099,7.456,3.298c1.417,2.198,1.582,5.234,0.498,9.109l-0.239,0.814 l-0.167,0.484H31.721c-0.441,1.575-0.438,2.777,0.01,3.606c0.448,0.829,1.332,1.244,2.65,1.244c0.975,0,1.836-0.206,2.583-0.617 S38.33,24.086,38.817,23.278z" id="path47"/>
<g id="g49">
<path fill-rule="evenodd" clip-rule="evenodd" d="M32.673,16.742l8.351-0.021c0.375-1.436,0.308-2.558-0.201-3.365 s-1.402-1.211-2.68-1.211c-1.209,0-2.285,0.397-3.229,1.19S33.224,15.265,32.673,16.742z M38.817,23.278h7.043 c-1.347,2.456-3.172,4.356-5.477,5.7c-2.305,1.345-4.885,2.017-7.74,2.017c-3.473,0-5.923-1.054-7.351-3.161 c-1.427-2.107-1.632-4.98-0.613-8.618c1.038-3.707,2.875-6.641,5.512-8.803c2.637-2.163,5.678-3.244,9.123-3.244 c3.555,0,6.04,1.099,7.456,3.298c1.417,2.198,1.582,5.234,0.498,9.109l-0.239,0.814l-0.167,0.484H31.721 c-0.441,1.575-0.438,2.777,0.01,3.606c0.448,0.829,1.332,1.244,2.65,1.244c0.975,0,1.836-0.206,2.583-0.617 S38.33,24.086,38.817,23.278z" id="path51"/>
</g>
</g>
<g id="g53">
<path fill="#A0CE67" d="M112.881,30.643l-6.404-18.639l-6.455,18.639h-7.254l9.565-30.321h8.19l4.434,15.582l0.35,1.276 c0.521,1.866,0.917,3.431,1.191,4.693l0.555-2.182c0.219-0.837,0.528-1.935,0.925-3.293l4.468-16.076h8.19l-10.501,30.321 H112.881z" id="path55" style="fill:#8ed300;fill-opacity:1"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -0,0 +1,5 @@
<header>
<img :src="embeded['/assets/images/report-logo.svg']" alt="Verdnatura"/>
<section>{{$t('company.registry')}}</section>
<section>{{$t('company.fiscalAddress')}}</section>
</header>

View File

@ -0,0 +1,15 @@
module.exports = {
name: 'report-header',
created() {
const embeded = [];
this.files.map(file => {
embeded[file] = `file://${__dirname + file}`;
});
this.embeded = embeded;
},
data() {
return {
files: ['/assets/images/report-logo.svg'],
};
},
};

View File

@ -0,0 +1,10 @@
module.exports = {
messages: {
es: {
company: {
fiscalAddress: 'VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla · www.verdnatura.es · clientes@verdnatura.es',
registry: `CIF: B97367486 Registro Mercantil de Valencia, Tomo 8041, Libro 5334, Folio 160, sección 8, Hoja V 102076`,
}
},
},
};

View File

@ -7,10 +7,12 @@ mysqldump --defaults-file=connect.ini --no-create-info salix ACL fieldAcl>> inst
echo "USE \`vn\`;" >> install/dump/dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info vn cplusInvoiceType477 cplusSubjectOp cplusTaxBreak bookingPlanner pgc tag alertLevel >> install/dump/dumpedFixtures.sql
echo "USE \`vn2008\`;" >> install/dump/dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info vn2008 accion_dits Gastos Tintas tarifa_componentes tarifa_componentes_series state bionic_updating_options Grupos Monedas container iva_group_codigo escritos cl_est cl_con cl_res cl_dev cl_mot >> install/dump/dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info vn2008 accion_dits Gastos Tintas tarifa_componentes tarifa_componentes_series state bionic_updating_options Grupos Monedas container iva_group_codigo escritos cl_est cl_con cl_res cl_dev cl_mot department businessReasonEnd>> install/dump/dumpedFixtures.sql
echo "USE \`bi\`;" >> install/dump/dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info bi tarifa_componentes tarifa_componentes_series >> install/dump/dumpedFixtures.sql
echo "USE \`cache\`;" >> install/dump/dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info cache cache >> install/dump/dumpedFixtures.sql
echo "USE \`hedera\`;" >> install/dump/dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info hedera tpvError tpvResponse tpvConfig >> install/dump/dumpedFixtures.sql
echo "USE \`postgresql\`;" >> install/dump/dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info postgresql profile_type media_type professional_category labour_agreement calendar_labour_type workcenter>> install/dump/dumpedFixtures.sql

View File

@ -0,0 +1,29 @@
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `vn2008`.`department`;
CREATE TABLE `vn2008`.`department` (
`department_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`lft` int(11) NOT NULL,
`rgt` int(11) NOT NULL,
`Id_Trabajador` int(11) DEFAULT NULL COMMENT 'Id_Trabajador es el jefe del departamento',
`company_id` int(11) NOT NULL,
`father_id` int(11) DEFAULT NULL,
`boss_id` int(11) DEFAULT NULL,
`x` int(11) DEFAULT NULL,
`y` int(11) DEFAULT NULL,
`production` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`department_id`),
UNIQUE KEY `lft_UNIQUE` (`lft`),
UNIQUE KEY `rgt_UNIQUE` (`rgt`),
UNIQUE KEY `name_UNIQUE` (`name`),
KEY `fk_department_Trabajadores1_idx` (`Id_Trabajador`),
KEY `dep_org_ibfk_3_idx` (`company_id`),
KEY `fk_department_department1_idx` (`father_id`),
KEY `fk_department_department1_idx_idx` (`father_id`),
CONSTRAINT `fk_department_Trabajadores1` FOREIGN KEY (`Id_Trabajador`) REFERENCES `Trabajadores` (`Id_Trabajador`) ON UPDATE CASCADE,
CONSTRAINT `fk_department_department1_idx` FOREIGN KEY (`father_id`) REFERENCES `department` (`department_id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=90 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SET FOREIGN_KEY_CHECKS=1;

View File

@ -1,24 +0,0 @@
INSERT INTO `salix`.`ACL`(`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES('CreditClassification', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
INSERT INTO `salix`.`ACL`(`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES('ClientObservation', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
INSERT INTO `salix`.`ACL`(`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES('ItemTag', '*', 'WRITE', 'ALLOW', 'ROLE', 'marketingBoss');
INSERT INTO `salix`.`ACL`(`id`,`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`) VALUES (104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss');
INSERT INTO `salix`.`ACL`(`id`,`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`) VALUES (105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss');
INSERT INTO `salix`.`ACL`(`id`,`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`) VALUES (106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss');
INSERT INTO `salix`.`ACL`(`id`,`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`) VALUES (107,'ItemNiche','*','WRITE','ALLOW','ROLE','marketingBoss');
INSERT INTO `salix`.`ACL`(`id`,`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`) VALUES (108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss');
INSERT INTO `salix`.`ACL`(`id`,`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`) VALUES (19,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss');
INSERT INTO `salix`.`ACL`(`id`,`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`) VALUES (59,'CreditInsurance','*','READ','ALLOW','ROLE','employee');
DELETE FROM `salix`.`ACL` WHERE `id`='67';
DELETE FROM `salix`.`ACL` WHERE `id`='74';
DELETE FROM `salix`.`ACL` WHERE `id`='92';
DELETE FROM `salix`.`ACL` WHERE `id`='93';
DELETE FROM `salix`.`ACL` WHERE `id`='95';
INSERT INTO `salix`.`ACL`(`id`,`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`) VALUES (133,'TicketLog', '*','READ', 'ALLOW','ROLE','employee');
INSERT INTO `salix`.`ACL`(`id`,`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`) VALUES (134,'TicketService', '*','*', 'ALLOW','ROLE','employee');

View File

@ -0,0 +1,13 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `department` AS
SELECT
`b`.`department_id` AS `id`,
`b`.`name` AS `name`,
`b`.`father_id` AS `fatherFk`,
`b`.`production` AS `isProduction`
FROM
`vn2008`.`department` `b`;

View File

@ -0,0 +1,17 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `personMedia` AS
SELECT
`p`.`id_trabajador` AS `workerFk`,
`m`.`value` AS `mediaValue`
FROM
((((`postgresql`.`person` `p`
JOIN `postgresql`.`profile` `po` ON ((`po`.`person_id` = `p`.`person_id`)))
JOIN `postgresql`.`profile_media` `pom` ON ((`pom`.`profile_id` = `po`.`profile_id`)))
JOIN `postgresql`.`media` `m` ON ((`m`.`media_id` = `pom`.`media_id`)))
JOIN `postgresql`.`media_type` `mt` ON ((`mt`.`media_type_id` = `m`.`media_type_id`)))
WHERE
(`mt`.`name` = 'movil empresa');

View File

@ -0,0 +1,30 @@
DROP TRIGGER IF EXISTS `vn2008`.`expeditionsBeforeInsert`;
DELIMITER $$
USE `vn2008`$$
CREATE DEFINER=`root`@`%` TRIGGER `expeditionsBeforeInsert`
BEFORE INSERT ON `expeditions` FOR EACH ROW
-- Edit trigger body code below this line. Do not edit lines above this one
BEGIN
DECLARE intcounter INT;
DECLARE vShipFk INT;
IF NEW.EsBulto > 0 THEN
UPDATE Tickets SET Bultos = nz(Bultos) + 1 WHERE Id_Ticket = NEW.ticket_id;
SELECT IFNULL(MAX(counter),0) +1 INTO intcounter FROM expeditions e
INNER JOIN Tickets t1 ON e.ticket_id = t1.Id_Ticket
LEFT JOIN vn.ticketState ts ON ts.ticket = t1.Id_Ticket
INNER JOIN Tickets t2 ON t2.Id_Consigna = t1.Id_Consigna AND DATE(t2.Fecha) = DATE(t1.Fecha) AND t1.warehouse_id = t2.warehouse_id
WHERE t2.Id_Ticket = NEW.ticket_id AND ts.alertLevel < 3 AND t1.empresa_id = t2.empresa_id AND t1.Id_Agencia = t2.Id_Agencia;
SET NEW.`counter` = intcounter;
END IF;
SET NEW.workerFk=get_Trabajador();
-- JGF 14/01/19 si existe un polizon queda anulado
SELECT shipFk INTO vShipFk FROM vn.stowaway WHERE id = NEW.ticket_id;
IF vShipFk THEN
CALL vn.stowawayUnBoarding(vShipFk, NEW.ticket_id);
END IF;
END$$
DELIMITER ;

View File

@ -0,0 +1,19 @@
DROP TRIGGER IF EXISTS `vn2008`.`expeditionsBeforeUpdate`;
DELIMITER $$
USE `vn2008`$$
CREATE DEFINER=`root`@`%` TRIGGER `vn2008`.`expeditionsBeforeUpdate`
BEFORE UPDATE ON `vn2008`.`expeditions`
FOR EACH ROW
-- Edit trigger body code below this line. Do not edit lines above this one
BEGIN
IF NEW.counter <> OLD.counter THEN
IF (SELECT COUNT(*) FROM expeditions e
INNER JOIN Tickets t1 ON e.ticket_id = t1.Id_Ticket
INNER JOIN Tickets t2 ON t2.Id_Consigna = t1.Id_Consigna AND DATE(t2.Fecha) = DATE(t1.Fecha)
WHERE t1.Id_Ticket = NEW.ticket_id AND counter = NEW.counter) > 0 THEN
SET NEW.expeditions_id = NULL;
END IF;
END IF;
END$$
DELIMITER ;

View File

@ -0,0 +1,72 @@
USE `vn`;
DROP procedure IF EXISTS `clientGetDebt`;
DELIMITER $$
USE `vn`$$
CREATE DEFINER=`root`@`%` PROCEDURE `clientGetDebt`(vDate DATE)
BEGIN
/**
* Calcula el riesgo para los clientes activos
*
* @table tmp.clientGetDebt(clientFk)
* @param vDate Fecha maxima de los registros
* @return tmp.risk
*/
DECLARE vStarted DATETIME DEFAULT TIMESTAMPADD(DAY, - DAYOFMONTH(CURDATE()) - 5, CURDATE());
DECLARE vEnded DATETIME;
SET vEnded = TIMESTAMP(IFNULL(vDate, CURDATE()), '23:59:59');
DROP TEMPORARY TABLE IF EXISTS tmp.ticket;
CREATE TEMPORARY TABLE tmp.ticket
(INDEX (ticketFk))
ENGINE = MEMORY
SELECT id ticketFk, c.clientFk
FROM ticket t
JOIN tmp.clientGetDebt c ON c.clientFk = t.clientFk
WHERE refFk IS NULL
AND shipped BETWEEN vStarted AND vEnded;
CALL ticketGetTotal();
DROP TEMPORARY TABLE IF EXISTS tClientRisk;
CREATE TEMPORARY TABLE tClientRisk
ENGINE = MEMORY
SELECT cr.customer_id clientFk, SUM(cr.amount) amount
FROM bi.customer_risk cr
JOIN tmp.clientGetDebt c ON c.clientFk = cr.customer_id
GROUP BY cr.customer_id;
INSERT INTO tClientRisk
SELECT c.clientFk, SUM(r.amountPaid)
FROM receipt r
JOIN tmp.clientGetDebt c ON c.clientFk = r.clientFk
WHERE r.payed > vEnded
GROUP BY c.clientFk;
INSERT INTO tClientRisk
SELECT t.clientFk, CAST(-SUM(t.amount) / 100 AS DECIMAL(10,2))
FROM hedera.tpvTransaction t
JOIN tmp.clientGetDebt c ON c.clientFk = t.clientFk
WHERE t.receiptFk IS NULL
AND t.status = 'ok'
GROUP BY t.clientFk;
INSERT INTO tClientRisk
SELECT t.clientFk, total
FROM tmp.ticketTotal tt
JOIN tmp.ticket t ON t.ticketFk = tt.ticketFk;
DROP TEMPORARY TABLE IF EXISTS tmp.risk;
CREATE TEMPORARY TABLE tmp.risk
(PRIMARY KEY (clientFk))
ENGINE = MEMORY
SELECT clientFk, SUM(amount) risk
FROM client c
JOIN tClientRisk cr ON cr.clientFk = c.id
WHERE c.isActive
GROUP BY c.id;
END$$
DELIMITER ;

View File

@ -0,0 +1,20 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `vn`.`personDepartment` AS
SELECT
`p`.`id_trabajador` AS `id_trabajador`,
`p`.`name` AS `name`,
`p`.`firstname` AS `firstname`,
`d`.`name` AS `department`
FROM
(((`postgresql`.`person` `p`
JOIN `postgresql`.`profile` `pr` ON ((`pr`.`person_id` = `p`.`person_id`)))
LEFT JOIN (`postgresql`.`business` `b`
LEFT JOIN `postgresql`.`business_labour` `bl` ON ((`b`.`business_id` = `bl`.`business_id`))) ON ((`pr`.`profile_id` = `b`.`client_id`)))
JOIN `vn`.`department` `d` ON ((`d`.`id` = `bl`.`department_id`)))
WHERE
(ISNULL(`b`.`date_end`)
OR (`b`.`date_end` > CURDATE()));

View File

@ -0,0 +1,11 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `vn`.`businessReasonEnd` AS
SELECT
`b`.`id` AS `id`,
`b`.`reason` AS `reason`
FROM
`vn2008`.`businessReasonEnd` `b`;

View File

@ -0,0 +1,13 @@
ALTER TABLE `postgresql`.`business_labour`
DROP FOREIGN KEY `business_labour_department`;
ALTER TABLE `postgresql`.`business_labour`
ADD INDEX `business_labour_department_idx` (`department_id` ASC);
ALTER TABLE `postgresql`.`business_labour`
ADD CONSTRAINT `business_labour_department`
FOREIGN KEY (`department_id`)
REFERENCES `vn2008`.`department` (`department_id`)
ON DELETE SET NULL
ON UPDATE CASCADE;

File diff suppressed because one or more lines are too long

View File

@ -1086,4 +1086,38 @@ INSERT INTO `pbx`.`sip`(`user_id`, `extension`, `secret`, `caller_id`)
(1, 1010, '123456', 'employee'),
(3, 1101, '123456', 'agency'),
(5, 1102, '123456', 'administrative'),
(9, 1201, '123456', 'developer');
(9, 1201, '123456', 'developer');
INSERT INTO `postgresql`.`person`(`person_id`, `name`, `nickname`, `nif`, `firstname`, `id_trabajador`)
VALUES
(1, 'Haller', 'DavidCharlesHaller', '53136686Q', 'David Charles', 106 ),
(2, 'Pym', 'HankPym', '09854837G', 'Hank', 107),
(3, 'VERDNATURA EVANTE SL', 'VNL', 'B78945612', NULL, NULL);
INSERT INTO `postgresql`.`profile`(`profile_id`, `person_id`, `profile_type_id`)
VALUES
(1, 1, 1),
(2, 2, 1),
(3, 3, 6);
INSERT INTO `postgresql`.`media`(`media_id`, `media_type_id`, `value`, `sort`)
VALUES
(1, 10, 600123321, 0),
(2, 10, 700987987, 0);
INSERT INTO `postgresql`.`profile_media`(`profile_media_id`, `profile_id`, `media_id`)
VALUES
(1, 1, 1),
(2, 2, 2);
INSERT INTO `postgresql`.`business`(`business_id`, `client_id`, `provider_id`, `date_start`, `date_end`, `workerBusiness`, `reasonEndFk`)
VALUES
(1, 1, 3, DATE_ADD(CURDATE(), INTERVAL -15 DAY), DATE_ADD(CURDATE(), INTERVAL +6 MONTH), 'E-46-12213123', NULL),
(2, 2, 3, DATE_ADD(CURDATE(), INTERVAL -10 DAY), NULL, 'E-46-87987933', NULL);
INSERT INTO `postgresql`.`business_labour`(`business_id`, `notes`, `department_id`, `professional_category_id`, `incentivo`, `calendar_labour_type_id`, `porhoras`, `labour_agreement_id`, `workcenter_id`)
VALUES
(1, NULL, 22, 4, 0, 1, 1, 1, 1),
(2, 'From las friday worker ownes the company 1 hour', 23, 1, 0, 1, 0, 1, 1);