From 0c5225e3d00ff7ce066d7da222e83511050c765b Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 26 Jan 2024 07:42:53 +0100 Subject: [PATCH] fix: #6634 Line count previa collection-label --- print/templates/reports/collection-label/collection-label.js | 1 - print/templates/reports/collection-label/sql/labelsData.sql | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/print/templates/reports/collection-label/collection-label.js b/print/templates/reports/collection-label/collection-label.js index cd6ff719a1..db2adeb34a 100644 --- a/print/templates/reports/collection-label/collection-label.js +++ b/print/templates/reports/collection-label/collection-label.js @@ -18,7 +18,6 @@ module.exports = { } }, async serverPrefetch() { - await this.rawSql('SET @hasPrevia := 0'); let ticketIds; const res = await this.rawSqlFromDef('tickets', [this.id]); if (res.length) { diff --git a/print/templates/reports/collection-label/sql/labelsData.sql b/print/templates/reports/collection-label/sql/labelsData.sql index 7a12a56d33..61990812d6 100644 --- a/print/templates/reports/collection-label/sql/labelsData.sql +++ b/print/templates/reports/collection-label/sql/labelsData.sql @@ -16,7 +16,7 @@ SELECT c.itemPackingTypeFk code, DATE_FORMAT(t.shipped, '%d/%m/%y') shipped, tt.labelCount, t.nickName, - SUM(IF(sgd.id, IF(@hasPrevia, 0, @hasPrevia := 1), 1)) lineCount, + SUM(IF(sgd.id IS NULL, 1, 0)) + IF(sgd.id , 1, 0) lineCount, rm.routeFk FROM vn.ticket t JOIN vn.ticketCollection tc ON tc.ticketFk = t.id