[master → test] Hacer primero #1167

Merged
joan merged 8 commits from master into test 2022-11-22 12:52:46 +00:00
5 changed files with 95 additions and 8 deletions

View File

@ -29,6 +29,9 @@ module.exports = Self => {
try { try {
const config = await models.NotificationConfig.findOne({}, myOptions); const config = await models.NotificationConfig.findOne({}, myOptions);
if (!config.cleanDays) return;
const cleanDate = new Date(); const cleanDate = new Date();
cleanDate.setDate(cleanDate.getDate() - config.cleanDays); cleanDate.setDate(cleanDate.getDate() - config.cleanDays);
@ -36,11 +39,11 @@ module.exports = Self => {
where: {status: {inq: status}}, where: {status: {inq: status}},
created: {lt: cleanDate} created: {lt: cleanDate}
}, myOptions); }, myOptions);
if (tx) await tx.commit();
} catch (e) { } catch (e) {
if (tx) await tx.rollback(); if (tx) await tx.rollback();
throw e; throw e;
} }
if (tx) await tx.commit();
}; };
}; };

View File

@ -1,5 +1,4 @@
const {Email} = require('vn-print'); const {Email} = require('vn-print');
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => { module.exports = Self => {
Self.remoteMethod('send', { Self.remoteMethod('send', {
@ -35,7 +34,10 @@ module.exports = Self => {
include: { include: {
relation: 'user', relation: 'user',
scope: { 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()) { for (const notificationUser of queue.notification().subscription()) {
try { try {
const sendParams = { const sendParams = {
recipient: notificationUser.user().email, recipient: notificationUser.user().emailUser().email,
lang: notificationUser.user().lang lang: notificationUser.user().lang
}; };

View File

@ -12,6 +12,7 @@
"fs-extra": "^7.0.1", "fs-extra": "^7.0.1",
"intl": "^1.2.5", "intl": "^1.2.5",
"js-yaml": "^3.13.1", "js-yaml": "^3.13.1",
"jsbarcode": "^3.11.5",
"jsonexport": "^3.2.0", "jsonexport": "^3.2.0",
"juice": "^5.2.0", "juice": "^5.2.0",
"log4js": "^6.7.0", "log4js": "^6.7.0",
@ -22,7 +23,8 @@
"strftime": "^0.10.0", "strftime": "^0.10.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-i18n": "^8.15.0", "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": { "node_modules/@babel/parser": {
@ -866,6 +868,66 @@
"js-yaml": "bin/js-yaml.js" "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": { "node_modules/jsbn": {
"version": "0.1.1", "version": "0.1.1",
"license": "MIT" "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": { "node_modules/xtend": {
"version": "4.0.2", "version": "4.0.2",
"license": "MIT", "license": "MIT",
@ -2685,6 +2755,11 @@
"esprima": "^4.0.0" "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": { "jsbn": {
"version": "0.1.1" "version": "0.1.1"
}, },
@ -3464,6 +3539,11 @@
"peer": true, "peer": true,
"requires": {} "requires": {}
}, },
"xmldom": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.6.0.tgz",
"integrity": "sha512-iAcin401y58LckRZ0TkI4k0VSM1Qg0KGSc3i8rU+xrxe19A/BN1zHyVSJY7uoutVlaTSzYyk/v5AmkewAP7jtg=="
},
"xtend": { "xtend": {
"version": "4.0.2" "version": "4.0.2"
}, },

View File

@ -16,6 +16,7 @@
"fs-extra": "^7.0.1", "fs-extra": "^7.0.1",
"intl": "^1.2.5", "intl": "^1.2.5",
"js-yaml": "^3.13.1", "js-yaml": "^3.13.1",
"jsbarcode": "^3.11.5",
"jsonexport": "^3.2.0", "jsonexport": "^3.2.0",
"juice": "^5.2.0", "juice": "^5.2.0",
"log4js": "^6.7.0", "log4js": "^6.7.0",
@ -26,6 +27,7 @@
"strftime": "^0.10.0", "strftime": "^0.10.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-i18n": "^8.15.0", "vue-i18n": "^8.15.0",
"vue-server-renderer": "^2.6.10" "vue-server-renderer": "^2.6.10",
"xmldom": "^0.6.0"
} }
} }

View File

@ -2,7 +2,7 @@
<template v-slot:header> <template v-slot:header>
<span></span> <span></span>
</template> </template>
<table v-for="labelData in labelsData" style="break-before: page"> <table v-for="labelData in labelsData">
<tbody> <tbody>
<tr> <tr>
<td rowspan="6"><span id="vertical">{{labelData.levelV}}</span></td> <td rowspan="6"><span id="vertical">{{labelData.levelV}}</span></td>