Merge branch 'dev' into 6496-cleanVn2008
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
d0d2a16303
|
@ -19,6 +19,7 @@ module.exports = Self => {
|
||||||
FROM ticketTracking tt
|
FROM ticketTracking tt
|
||||||
WHERE tt.userFk = ?
|
WHERE tt.userFk = ?
|
||||||
GROUP BY ticketFk
|
GROUP BY ticketFk
|
||||||
|
ORDER BY created DESC
|
||||||
LIMIT 5;`;
|
LIMIT 5;`;
|
||||||
return await Self.rawSql(query, [userId]);
|
return await Self.rawSql(query, [userId]);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salix-back",
|
"name": "salix-back",
|
||||||
"version": "24.10.0",
|
"version": "24.12.0",
|
||||||
"author": "Verdnatura Levante SL",
|
"author": "Verdnatura Levante SL",
|
||||||
"description": "Salix backend",
|
"description": "Salix backend",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
|
|
|
@ -3,7 +3,7 @@ html {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
.mainTable, .specialTable, .categoryTable {
|
.mainTable, .specialTable, .categoryTable, .observationTable {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
|
@ -99,3 +99,18 @@ img {
|
||||||
padding-bottom: 11px;
|
padding-bottom: 11px;
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.observationTable tr td {
|
||||||
|
border: none;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#qrSection {
|
||||||
|
text-align: center;
|
||||||
|
width: 30%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#truckPlateQr {
|
||||||
|
width: 125px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
|
@ -30,8 +30,11 @@
|
||||||
<span id="label">16. Transportista / Transporteur / Carrier</span>
|
<span id="label">16. Transportista / Transporteur / Carrier</span>
|
||||||
<hr>
|
<hr>
|
||||||
<b>{{data.carrierName}}</b><br>
|
<b>{{data.carrierName}}</b><br>
|
||||||
{{data.carrierStreet}}<br>
|
{{data.carrierStreet}} {{data.carrierPostalCode}}
|
||||||
{{data.carrierPostalCode}} {{data.carrierCity}} {{(data.carrierCountry) ? `(${data.carrierCountry})` : null}}
|
{{data.carrierCity}} {{(data.carrierCountry)
|
||||||
|
? `(${data.carrierCountry})`
|
||||||
|
: null}}<br>
|
||||||
|
<b>CIF:</b> {{data.carrierCif}}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -71,9 +74,20 @@
|
||||||
Carrier's reservations and observations
|
Carrier's reservations and observations
|
||||||
</span>
|
</span>
|
||||||
<hr>
|
<hr>
|
||||||
<b>{{data.truckPlate}}</b><br>
|
<table class="observationTable">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
{{data.observations}}
|
{{data.observations}}
|
||||||
</td>
|
</td>
|
||||||
|
<td id="qrSection">
|
||||||
|
<img id="truckPlateQr" v-bind:src="truckPlateQr"/>
|
||||||
|
<br>
|
||||||
|
<b>{{data.truckPlate}}</b>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -2,6 +2,7 @@ const config = require(`vn-print/core/config`);
|
||||||
const vnReport = require('../../../core/mixins/vn-report.js');
|
const vnReport = require('../../../core/mixins/vn-report.js');
|
||||||
const md5 = require('md5');
|
const md5 = require('md5');
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
|
const qrcode = require('qrcode');
|
||||||
|
|
||||||
const prefixBase64 = 'data:image/png;base64,';
|
const prefixBase64 = 'data:image/png;base64,';
|
||||||
|
|
||||||
|
@ -22,6 +23,7 @@ module.exports = {
|
||||||
this.deliveryStamp = (this.data.deliveryStamp)
|
this.deliveryStamp = (this.data.deliveryStamp)
|
||||||
? `${prefixBase64} ${this.data.deliveryStamp.toString('base64')}`
|
? `${prefixBase64} ${this.data.deliveryStamp.toString('base64')}`
|
||||||
: null;
|
: null;
|
||||||
|
this.truckPlateQr = await this.getQR(this.data.truckPlate);
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
id: {
|
id: {
|
||||||
|
@ -34,12 +36,17 @@ module.exports = {
|
||||||
signPath() {
|
signPath() {
|
||||||
if (!this.signature) return;
|
if (!this.signature) return;
|
||||||
|
|
||||||
const signatureName = this.signature.signature
|
const signatureName = this.signature.signature;
|
||||||
const hash = md5(signatureName.toString()).substring(0, 3);
|
const hash = md5(signatureName.toString()).substring(0, 3);
|
||||||
const file = `${config.storage.root}/${hash}/${signatureName}.png`;
|
const file = `${config.storage.root}/${hash}/${signatureName}.png`;
|
||||||
if (!fs.existsSync(file)) return null;
|
if (!fs.existsSync(file)) return null;
|
||||||
|
|
||||||
return `${prefixBase64} ${Buffer.from(fs.readFileSync(file), 'utf8').toString('base64')}`;
|
return `${prefixBase64} ${Buffer.from(fs.readFileSync(file), 'utf8').toString('base64')}`;
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getQR(id) {
|
||||||
|
return qrcode.toDataURL(String(id), {margin: 0});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -10,6 +10,7 @@ SELECT c.id cmrFk,
|
||||||
c.merchandiseDetail,
|
c.merchandiseDetail,
|
||||||
c.ead,
|
c.ead,
|
||||||
s.name carrierName,
|
s.name carrierName,
|
||||||
|
s.nif carrierCif,
|
||||||
s.street carrierStreet,
|
s.street carrierStreet,
|
||||||
s.postCode carrierPostCode,
|
s.postCode carrierPostCode,
|
||||||
s.city carrierCity,
|
s.city carrierCity,
|
||||||
|
|
Loading…
Reference in New Issue