diff --git a/back/methods/notification/clean.js b/back/methods/notification/clean.js
index e6da58af8..bdc6737df 100644
--- a/back/methods/notification/clean.js
+++ b/back/methods/notification/clean.js
@@ -29,6 +29,9 @@ module.exports = Self => {
try {
const config = await models.NotificationConfig.findOne({}, myOptions);
+
+ if (!config.cleanDays) return;
+
const cleanDate = new Date();
cleanDate.setDate(cleanDate.getDate() - config.cleanDays);
@@ -36,11 +39,11 @@ module.exports = Self => {
where: {status: {inq: status}},
created: {lt: cleanDate}
}, myOptions);
-
- if (tx) await tx.commit();
} catch (e) {
if (tx) await tx.rollback();
throw e;
}
+
+ if (tx) await tx.commit();
};
};
diff --git a/back/methods/notification/send.js b/back/methods/notification/send.js
index 80faf0305..b2748477d 100644
--- a/back/methods/notification/send.js
+++ b/back/methods/notification/send.js
@@ -1,5 +1,4 @@
const {Email} = require('vn-print');
-const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
Self.remoteMethod('send', {
@@ -35,7 +34,10 @@ module.exports = Self => {
include: {
relation: 'user',
scope: {
- fields: ['name', 'email', 'lang']
+ fields: ['name', 'lang'],
+ include: {
+ relation: 'emailUser'
+ }
}
}
}
@@ -56,7 +58,7 @@ module.exports = Self => {
for (const notificationUser of queue.notification().subscription()) {
try {
const sendParams = {
- recipient: notificationUser.user().email,
+ recipient: notificationUser.user().emailUser().email,
lang: notificationUser.user().lang
};
diff --git a/db/changes/10503-november/00-alter_expedition_itemFk.sql b/db/changes/10503-november/00-alter_expedition_itemFk.sql
new file mode 100644
index 000000000..d2849481b
--- /dev/null
+++ b/db/changes/10503-november/00-alter_expedition_itemFk.sql
@@ -0,0 +1 @@
+Alter table `vn`.`expedition` RENAME COLUMN itemFk TO itemFk__;
\ No newline at end of file
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 11e1453a9..41cd84638 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -921,7 +921,7 @@ INSERT INTO `vn`.`expeditionStateType`(`id`, `description`, `code`)
(3, 'Perdida', 'LOST');
-INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `freightItemFk`, `created`, `itemFk`, `counter`, `workerFk`, `externalId`, `packagingFk`, `stateTypeFk`, `hostFk`)
+INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `freightItemFk`, `created`, `itemFk__`, `counter`, `workerFk`, `externalId`, `packagingFk`, `stateTypeFk`, `hostFk`)
VALUES
(1, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 15, 1, 18, 'UR9000006041', 94, 1, 'pc1'),
(2, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 16, 2, 18, 'UR9000006041', 94, 1, NULL),
diff --git a/modules/invoiceIn/front/descriptor/index.html b/modules/invoiceIn/front/descriptor/index.html
index 819615c20..a2b48b5cd 100644
--- a/modules/invoiceIn/front/descriptor/index.html
+++ b/modules/invoiceIn/front/descriptor/index.html
@@ -26,11 +26,13 @@
Clone Invoice
Show agricultural invoice as PDF
Send agricultural invoice as PDF
diff --git a/modules/ticket/back/methods/expedition/filter.js b/modules/ticket/back/methods/expedition/filter.js
index 65f840d80..fcf0bd1b3 100644
--- a/modules/ticket/back/methods/expedition/filter.js
+++ b/modules/ticket/back/methods/expedition/filter.js
@@ -37,7 +37,6 @@ module.exports = Self => {
i1.name packageItemName,
e.counter,
i2.name freightItemName,
- e.itemFk,
u.name userName,
e.created,
e.externalId,
@@ -50,10 +49,10 @@ module.exports = Self => {
est.description state
FROM vn.expedition e
LEFT JOIN vn.expeditionStateType est ON est.id = e.stateTypeFk
- LEFT JOIN vn.item i2 ON i2.id = e.itemFk
INNER JOIN vn.item i1 ON i1.id = e.freightItemFk
LEFT JOIN vn.packaging p ON p.id = e.packagingFk
LEFT JOIN vn.item i3 ON i3.id = p.itemFk
+ LEFT JOIN vn.item i2 ON i2.id = p.itemFk
LEFT JOIN account.user u ON u.id = e.workerFk
LEFT JOIN vn.expeditionScan es ON es.expeditionFk = e.id
LEFT JOIN account.user su ON su.id = es.workerFk
diff --git a/modules/ticket/back/models/expedition.json b/modules/ticket/back/models/expedition.json
index 324ad4609..d74c56d2c 100644
--- a/modules/ticket/back/models/expedition.json
+++ b/modules/ticket/back/models/expedition.json
@@ -37,11 +37,6 @@
"model": "agency-mode",
"foreignKey": "agencyModeFk"
},
- "packageItem": {
- "type": "belongsTo",
- "model": "Item",
- "foreignKey": "itemFk"
- },
"worker": {
"type": "belongsTo",
"model": "Worker",
diff --git a/print/package-lock.json b/print/package-lock.json
index 02c5fa77d..2a657269f 100644
--- a/print/package-lock.json
+++ b/print/package-lock.json
@@ -12,6 +12,7 @@
"fs-extra": "^7.0.1",
"intl": "^1.2.5",
"js-yaml": "^3.13.1",
+ "jsbarcode": "^3.11.5",
"jsonexport": "^3.2.0",
"juice": "^5.2.0",
"log4js": "^6.7.0",
@@ -22,7 +23,8 @@
"strftime": "^0.10.0",
"vue": "^2.6.10",
"vue-i18n": "^8.15.0",
- "vue-server-renderer": "^2.6.10"
+ "vue-server-renderer": "^2.6.10",
+ "xmldom": "^0.6.0"
}
},
"node_modules/@babel/parser": {
@@ -866,6 +868,66 @@
"js-yaml": "bin/js-yaml.js"
}
},
+ "node_modules/jsbarcode": {
+ "version": "3.11.5",
+ "resolved": "https://registry.npmjs.org/jsbarcode/-/jsbarcode-3.11.5.tgz",
+ "integrity": "sha512-zv3KsH51zD00I/LrFzFSM6dst7rDn0vIMzaiZFL7qusTjPZiPtxg3zxetp0RR7obmjTw4f6NyGgbdkBCgZUIrA==",
+ "bin": {
+ "auto.js": "bin/barcodes/CODE128/auto.js",
+ "Barcode.js": "bin/barcodes/Barcode.js",
+ "barcodes": "bin/barcodes",
+ "canvas.js": "bin/renderers/canvas.js",
+ "checksums.js": "bin/barcodes/MSI/checksums.js",
+ "codabar": "bin/barcodes/codabar",
+ "CODE128": "bin/barcodes/CODE128",
+ "CODE128_AUTO.js": "bin/barcodes/CODE128/CODE128_AUTO.js",
+ "CODE128.js": "bin/barcodes/CODE128/CODE128.js",
+ "CODE128A.js": "bin/barcodes/CODE128/CODE128A.js",
+ "CODE128B.js": "bin/barcodes/CODE128/CODE128B.js",
+ "CODE128C.js": "bin/barcodes/CODE128/CODE128C.js",
+ "CODE39": "bin/barcodes/CODE39",
+ "constants.js": "bin/barcodes/ITF/constants.js",
+ "defaults.js": "bin/options/defaults.js",
+ "EAN_UPC": "bin/barcodes/EAN_UPC",
+ "EAN.js": "bin/barcodes/EAN_UPC/EAN.js",
+ "EAN13.js": "bin/barcodes/EAN_UPC/EAN13.js",
+ "EAN2.js": "bin/barcodes/EAN_UPC/EAN2.js",
+ "EAN5.js": "bin/barcodes/EAN_UPC/EAN5.js",
+ "EAN8.js": "bin/barcodes/EAN_UPC/EAN8.js",
+ "encoder.js": "bin/barcodes/EAN_UPC/encoder.js",
+ "ErrorHandler.js": "bin/exceptions/ErrorHandler.js",
+ "exceptions": "bin/exceptions",
+ "exceptions.js": "bin/exceptions/exceptions.js",
+ "fixOptions.js": "bin/help/fixOptions.js",
+ "GenericBarcode": "bin/barcodes/GenericBarcode",
+ "getOptionsFromElement.js": "bin/help/getOptionsFromElement.js",
+ "getRenderProperties.js": "bin/help/getRenderProperties.js",
+ "help": "bin/help",
+ "index.js": "bin/renderers/index.js",
+ "index.tmp.js": "bin/barcodes/index.tmp.js",
+ "ITF": "bin/barcodes/ITF",
+ "ITF.js": "bin/barcodes/ITF/ITF.js",
+ "ITF14.js": "bin/barcodes/ITF/ITF14.js",
+ "JsBarcode.js": "bin/JsBarcode.js",
+ "linearizeEncodings.js": "bin/help/linearizeEncodings.js",
+ "merge.js": "bin/help/merge.js",
+ "MSI": "bin/barcodes/MSI",
+ "MSI.js": "bin/barcodes/MSI/MSI.js",
+ "MSI10.js": "bin/barcodes/MSI/MSI10.js",
+ "MSI1010.js": "bin/barcodes/MSI/MSI1010.js",
+ "MSI11.js": "bin/barcodes/MSI/MSI11.js",
+ "MSI1110.js": "bin/barcodes/MSI/MSI1110.js",
+ "object.js": "bin/renderers/object.js",
+ "options": "bin/options",
+ "optionsFromStrings.js": "bin/help/optionsFromStrings.js",
+ "pharmacode": "bin/barcodes/pharmacode",
+ "renderers": "bin/renderers",
+ "shared.js": "bin/renderers/shared.js",
+ "svg.js": "bin/renderers/svg.js",
+ "UPC.js": "bin/barcodes/EAN_UPC/UPC.js",
+ "UPCE.js": "bin/barcodes/EAN_UPC/UPCE.js"
+ }
+ },
"node_modules/jsbn": {
"version": "0.1.1",
"license": "MIT"
@@ -2092,6 +2154,14 @@
}
}
},
+ "node_modules/xmldom": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.6.0.tgz",
+ "integrity": "sha512-iAcin401y58LckRZ0TkI4k0VSM1Qg0KGSc3i8rU+xrxe19A/BN1zHyVSJY7uoutVlaTSzYyk/v5AmkewAP7jtg==",
+ "engines": {
+ "node": ">=10.0.0"
+ }
+ },
"node_modules/xtend": {
"version": "4.0.2",
"license": "MIT",
@@ -2685,6 +2755,11 @@
"esprima": "^4.0.0"
}
},
+ "jsbarcode": {
+ "version": "3.11.5",
+ "resolved": "https://registry.npmjs.org/jsbarcode/-/jsbarcode-3.11.5.tgz",
+ "integrity": "sha512-zv3KsH51zD00I/LrFzFSM6dst7rDn0vIMzaiZFL7qusTjPZiPtxg3zxetp0RR7obmjTw4f6NyGgbdkBCgZUIrA=="
+ },
"jsbn": {
"version": "0.1.1"
},
@@ -3464,6 +3539,11 @@
"peer": true,
"requires": {}
},
+ "xmldom": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.6.0.tgz",
+ "integrity": "sha512-iAcin401y58LckRZ0TkI4k0VSM1Qg0KGSc3i8rU+xrxe19A/BN1zHyVSJY7uoutVlaTSzYyk/v5AmkewAP7jtg=="
+ },
"xtend": {
"version": "4.0.2"
},
diff --git a/print/package.json b/print/package.json
index a6c53a28f..65a8687b3 100755
--- a/print/package.json
+++ b/print/package.json
@@ -16,6 +16,7 @@
"fs-extra": "^7.0.1",
"intl": "^1.2.5",
"js-yaml": "^3.13.1",
+ "jsbarcode": "^3.11.5",
"jsonexport": "^3.2.0",
"juice": "^5.2.0",
"log4js": "^6.7.0",
@@ -26,6 +27,7 @@
"strftime": "^0.10.0",
"vue": "^2.6.10",
"vue-i18n": "^8.15.0",
- "vue-server-renderer": "^2.6.10"
+ "vue-server-renderer": "^2.6.10",
+ "xmldom": "^0.6.0"
}
}
diff --git a/print/templates/reports/collection-label/collection-label.html b/print/templates/reports/collection-label/collection-label.html
index 35c0786b6..eeb82ac4a 100644
--- a/print/templates/reports/collection-label/collection-label.html
+++ b/print/templates/reports/collection-label/collection-label.html
@@ -2,7 +2,7 @@
-