feat: refs #7646 delete scannableCodeType #2782

Merged
guillermo merged 5 commits from 7646-deleteColumnsProductionConfig into dev 2024-08-12 06:07:00 +00:00
4 changed files with 6 additions and 29 deletions

View File

@ -0,0 +1,3 @@
ALTER TABLE vn.productionConfig
DROP COLUMN scannableCodeType,
DROP COLUMN scannablePreviusCodeType;

View File

@ -10,14 +10,10 @@
</td>
<td colspan="2" id="shipped">{{dashIfEmpty(labelData.shipped)}}</td>
</tr>
<tr v-if="labelData?.qrData">
<tr>
<td rowspan="3"><img :src="labelData.qrData" class="qr"/></td>
<td id="outline" class="ellipsize">{{dashIfEmpty(labelData.workerCode)}}</td>
</tr>
<tr v-else>
<td rowspan="3"><div v-html="getBarcode(labelData.ticketFk)" class="basrcode"></div></td>
<td id="outline" class="ellipsize">{{dashIfEmpty(labelData.workerCode)}}</td>
</tr>
<tr>
<td id="outline" class="ellipsize">{{labelCount || labelData.labelCount || 0}}</td>
</tr>

View File

@ -1,7 +1,5 @@
const {DOMImplementation, XMLSerializer} = require('xmldom');
const vnReport = require('../../../core/mixins/vn-report.js');
const {toDataURL} = require('qrcode');
const jsBarcode = require('jsbarcode');
module.exports = {
name: 'collection-label',
@ -30,11 +28,8 @@ module.exports = {
const labels = await this.rawSqlFromDef('labelsData', [ticketIds]);
const [{scannableCodeType}] = await this.rawSqlFromDef('barcodeType');
if (scannableCodeType === 'qr') {
for (const labelData of labels)
labelData.qrData = await this.getQr(labelData?.ticketFk, labelData?.workerFk);
}
for (const labelData of labels)
labelData.qrData = await this.getQr(labelData?.ticketFk, labelData?.workerFk);
this.labelsData = labels;
this.checkMainEntity(this.labelsData);
@ -50,20 +45,6 @@ module.exports = {
});
return toDataURL(QRdata, {margin: 0});
},
getBarcode(id) {
const xmlSerializer = new XMLSerializer();
const document = new DOMImplementation().createDocument('http://www.w3.org/1999/xhtml', 'html', null);
const svgNode = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
jsBarcode(svgNode, id, {
xmlDocument: document,
format: 'code128',
displayValue: false,
width: 3.8,
height: 115,
});
return xmlSerializer.serializeToString(svgNode);
},
getVertical(labelData) {
let value;
if (labelData.collectionFk) {

View File

@ -1,3 +0,0 @@
SELECT scannableCodeType
FROM productionConfig
LIMIT 1