From b7fa4dca4c450b47a65c886c2797e50963fa8797 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 29 Nov 2022 14:16:44 +0100 Subject: [PATCH 1/3] refs #4550 changed font-family of collection-label --- .../templates/reports/collection-label/assets/css/style.css | 3 ++- .../reports/collection-label/collection-label.html | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/print/templates/reports/collection-label/assets/css/style.css b/print/templates/reports/collection-label/assets/css/style.css index 597921c92..f62d35c97 100644 --- a/print/templates/reports/collection-label/assets/css/style.css +++ b/print/templates/reports/collection-label/assets/css/style.css @@ -1,5 +1,5 @@ html { - font-family: "Roboto"; + font-family: Arial, Helvetica, sans-serif; margin-top: -6px; } * { @@ -15,6 +15,7 @@ html { .outline { border: 1px solid black; padding: 5px; + height: 37px; } #nickname { font-size: 22px; diff --git a/print/templates/reports/collection-label/collection-label.html b/print/templates/reports/collection-label/collection-label.html index 6716d1fe5..c64c12aed 100644 --- a/print/templates/reports/collection-label/collection-label.html +++ b/print/templates/reports/collection-label/collection-label.html @@ -5,7 +5,7 @@ - {{labelData.collectionFk ? `${labelData.collectionFk} ~ ${labelData.wagon}-${labelData.level}` : '-'.repeat(23)}} + {{labelData.collectionFk ? `${labelData.collectionFk} ~ ${labelData.wagon}-${labelData.level}` : '-'.repeat(19)}} {{labelData.clientFk ? `${labelData.ticketFk} « ${labelData.clientFk}` : labelData.ticketFk}} @@ -23,11 +23,11 @@ {{labelData.code == 'plant' ? labelData.size + 'cm' : labelData.volume + 'm³'}} -
{{labelData.agencyDescription}}
+
{{labelData.agencyDescription.toUpperCase()}}
{{labelData.lineCount ? labelData.lineCount : 0}} - {{labelData.nickName ? labelData.nickName : '---'}} + {{labelData.nickName ? labelData.nickName.toUpperCase() : '---'}} {{labelData.shipped ? labelData.shippedHour : labelData.zoneHour}} -- 2.40.1 From d0acd3e4c0eee2c8a55d50908fd14af3a6bb4cbd Mon Sep 17 00:00:00 2001 From: guillermo Date: Wed, 30 Nov 2022 08:18:37 +0100 Subject: [PATCH 2/3] refs #4550 collection-label changes --- .../collection-label/assets/css/style.css | 7 ++++--- .../collection-label/collection-label.html | 16 ++++++++-------- .../reports/collection-label/collection-label.js | 9 ++++++++- .../reports/collection-label/sql/labelsData.sql | 16 ++++++++-------- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/print/templates/reports/collection-label/assets/css/style.css b/print/templates/reports/collection-label/assets/css/style.css index f62d35c97..f9ead378a 100644 --- a/print/templates/reports/collection-label/assets/css/style.css +++ b/print/templates/reports/collection-label/assets/css/style.css @@ -9,7 +9,8 @@ html { } #vertical { writing-mode: vertical-rl; - height: 240px; + height: 235px; + font-size: 30px; margin-left: -13px; } .outline { @@ -34,6 +35,6 @@ html { #shipped { font-weight: bold; } -#ticketFk, #vertical { - font-size: 34px; +#ticketFk { + font-size: 32px; } \ No newline at end of file diff --git a/print/templates/reports/collection-label/collection-label.html b/print/templates/reports/collection-label/collection-label.html index c64c12aed..de9e5fcc3 100644 --- a/print/templates/reports/collection-label/collection-label.html +++ b/print/templates/reports/collection-label/collection-label.html @@ -5,30 +5,30 @@ - {{labelData.collectionFk ? `${labelData.collectionFk} ~ ${labelData.wagon}-${labelData.level}` : '-'.repeat(19)}} + {{labelData.collectionFk ? `${labelData.collectionFk} ~ ${getVertical(labelData.code, labelData.wagon, labelData.level, labelData.color)}` : '-'.repeat(19)}} {{labelData.clientFk ? `${labelData.ticketFk} « ${labelData.clientFk}` : labelData.ticketFk}} - {{labelData.shipped ? labelData.shipped : '---'}} + {{labelData.shipped || '---'}}
- {{labelData.workerCode ? labelData.workerCode : '---'}} + {{labelData.workerCode || '---'}} - {{labelData.labelCount ? labelData.labelCount : 0}} + {{labelData.labelCount || 0}} - {{labelData.code == 'plant' ? labelData.size + 'cm' : labelData.volume + 'm³'}} + {{labelData.code == 'V' ? (labelData.size || 0) + 'cm' : (labelData.volume || 0) + 'm³'}} -
{{labelData.agencyDescription.toUpperCase()}}
- {{labelData.lineCount ? labelData.lineCount : 0}} +
{{labelData.agencyDescription ? labelData.agencyDescription.toUpperCase() : '---'}}
+ {{labelData.lineCount || 0}} {{labelData.nickName ? labelData.nickName.toUpperCase() : '---'}} - {{labelData.shipped ? labelData.shippedHour : labelData.zoneHour}} + {{labelData.shippedHour || labelData.zoneHour}} diff --git a/print/templates/reports/collection-label/collection-label.js b/print/templates/reports/collection-label/collection-label.js index d2d5f6417..93c13e49b 100644 --- a/print/templates/reports/collection-label/collection-label.js +++ b/print/templates/reports/collection-label/collection-label.js @@ -25,7 +25,6 @@ module.exports = { ticketIds = [this.id]; this.labelsData = await this.rawSqlFromDef('labelsData', [ticketIds]); - if (!this.labelsData.length) throw new UserError('Empty data source'); }, @@ -44,6 +43,14 @@ module.exports = { }); return xmlSerializer.serializeToString(svgNode); }, + getVertical(code, wagon, level, color) { + let value; + if (code == 'V') + value = `${wagon}-${level}`; + else + value = `${color.substring(0, 4)}`; + return value; + }, }, components: { 'report-body': reportBody.build() diff --git a/print/templates/reports/collection-label/sql/labelsData.sql b/print/templates/reports/collection-label/sql/labelsData.sql index b799b289b..d2dafea1d 100644 --- a/print/templates/reports/collection-label/sql/labelsData.sql +++ b/print/templates/reports/collection-label/sql/labelsData.sql @@ -1,13 +1,13 @@ -SELECT tc.collectionFk, +SELECT c.itemPackingTypeFk code, + tc.collectionFk, SUBSTRING('ABCDEFGH', tc.wagon, 1) wagon, tc.`level`, t.id ticketFk, COALESCE(et.description, zo.name, am.name) agencyDescription, - am.name, + cc.code color, t.clientFk, CAST(SUM(sv.volume) AS DECIMAL(5, 2)) volume, MAX(i.`size`) `size`, - ic.code, w.code workerCode, TIME_FORMAT(t.shipped, '%H:%i') shippedHour, TIME_FORMAT(zo.`hour`, '%H:%i') zoneHour, @@ -21,13 +21,13 @@ SELECT tc.collectionFk, LEFT JOIN vn.collectionColors cc ON cc.shelve = tc.`level` AND cc.wagon = tc.wagon AND cc.trainFk = c.trainFk - JOIN vn.sale s ON s.ticketFk = t.id + LEFT JOIN vn.sale s ON s.ticketFk = t.id LEFT JOIN vn.saleVolume sv ON sv.saleFk = s.id - JOIN vn.item i ON i.id = s.itemFk - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk + LEFT JOIN vn.item i ON i.id = s.itemFk + LEFT JOIN vn.itemType it ON it.id = i.typeFk + LEFT JOIN vn.itemCategory ic ON ic.id = it.categoryFk LEFT JOIN vn.worker w ON w.id = c.workerFk - JOIN vn.agencyMode am ON am.id = t.agencyModeFk + LEFT JOIN vn.agencyMode am ON am.id = t.agencyModeFk LEFT JOIN vn.ticketTrolley tt ON tt.ticket = t.id LEFT JOIN vn.`zone` zo ON t.zoneFk = zo.id LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk -- 2.40.1 From 497e3e54a2a171068543c3e91caadaf5db832fbc Mon Sep 17 00:00:00 2001 From: guillermo Date: Wed, 30 Nov 2022 10:52:52 +0100 Subject: [PATCH 3/3] refs #4550 changes --- .../collection-label/collection-label.html | 4 +--- .../reports/collection-label/collection-label.js | 15 ++++++++++----- .../reports/collection-label/sql/labelsData.sql | 16 ++++++++-------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/print/templates/reports/collection-label/collection-label.html b/print/templates/reports/collection-label/collection-label.html index de9e5fcc3..b7f783a88 100644 --- a/print/templates/reports/collection-label/collection-label.html +++ b/print/templates/reports/collection-label/collection-label.html @@ -4,9 +4,7 @@ - + diff --git a/print/templates/reports/collection-label/collection-label.js b/print/templates/reports/collection-label/collection-label.js index 93c13e49b..fd412791b 100644 --- a/print/templates/reports/collection-label/collection-label.js +++ b/print/templates/reports/collection-label/collection-label.js @@ -43,12 +43,17 @@ module.exports = { }); return xmlSerializer.serializeToString(svgNode); }, - getVertical(code, wagon, level, color) { + getVertical(labelData) { let value; - if (code == 'V') - value = `${wagon}-${level}`; - else - value = `${color.substring(0, 4)}`; + if (labelData.collectionFk) { + value = `${labelData.collectionFk} ~ `; + if (labelData.code == 'V') + value = value + `${labelData.wagon}-${labelData.level}`; + else + value = value + `${labelData.color.substring(0, 4)}`; + } else + value = '-'.repeat(19); + return value; }, }, diff --git a/print/templates/reports/collection-label/sql/labelsData.sql b/print/templates/reports/collection-label/sql/labelsData.sql index d2dafea1d..9afac79d0 100644 --- a/print/templates/reports/collection-label/sql/labelsData.sql +++ b/print/templates/reports/collection-label/sql/labelsData.sql @@ -16,18 +16,18 @@ SELECT c.itemPackingTypeFk code, tt.labelCount, COUNT(*) lineCount FROM vn.ticket t - LEFT JOIN vn.ticketCollection tc ON tc.ticketFk = t.id - LEFT JOIN vn.collection c ON c.id = tc.collectionFk + JOIN vn.ticketCollection tc ON tc.ticketFk = t.id + JOIN vn.collection c ON c.id = tc.collectionFk LEFT JOIN vn.collectionColors cc ON cc.shelve = tc.`level` AND cc.wagon = tc.wagon AND cc.trainFk = c.trainFk - LEFT JOIN vn.sale s ON s.ticketFk = t.id + JOIN vn.sale s ON s.ticketFk = t.id LEFT JOIN vn.saleVolume sv ON sv.saleFk = s.id - LEFT JOIN vn.item i ON i.id = s.itemFk - LEFT JOIN vn.itemType it ON it.id = i.typeFk - LEFT JOIN vn.itemCategory ic ON ic.id = it.categoryFk - LEFT JOIN vn.worker w ON w.id = c.workerFk - LEFT JOIN vn.agencyMode am ON am.id = t.agencyModeFk + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.worker w ON w.id = c.workerFk + JOIN vn.agencyMode am ON am.id = t.agencyModeFk LEFT JOIN vn.ticketTrolley tt ON tt.ticket = t.id LEFT JOIN vn.`zone` zo ON t.zoneFk = zo.id LEFT JOIN vn.routesMonitor rm ON rm.routeFk = t.routeFk -- 2.40.1
- {{labelData.collectionFk ? `${labelData.collectionFk} ~ ${getVertical(labelData.code, labelData.wagon, labelData.level, labelData.color)}` : '-'.repeat(19)}} - {{getVertical(labelData)}} {{labelData.clientFk ? `${labelData.ticketFk} « ${labelData.clientFk}` : labelData.ticketFk}}