Compare commits

...

34 Commits

Author SHA1 Message Date
Guillermo Bonet 3453aa0f8c Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good Details
2024-11-29 11:40:22 +01:00
Guillermo Bonet 3b73ffbd8a Merge branch 'master' into test
gitea/salix/pipeline/head This commit looks good Details
2024-11-29 11:40:05 +01:00
Sergio De la torre 76b12e73b9 Merge pull request 'fix: refs #7920 refs#7920 itemShelvingLogs' (!3263) from 7920-itemShelvingsLog into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3263
Reviewed-by: Guillermo Bonet <guillermo@verdnatura.es>
2024-11-29 10:38:30 +00:00
Sergio De la torre 009b4ab7b9 fix: refs #7920 refs#7920 itemShelvingLogs
gitea/salix/pipeline/pr-master This commit looks good Details
2024-11-29 11:31:31 +01:00
Alex Moreno 20b68b4b41 Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good Details
2024-11-29 07:28:55 +01:00
Alex Moreno b48beaf4b3 Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix into test
gitea/salix/pipeline/head This commit looks good Details
2024-11-29 07:28:24 +01:00
Carlos Andrés 97cdadac78 Merge pull request 'fix: refs #8221 duaInvoiceIn unique' (!3256) from 8221-duaInvoiceInUnique into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3256
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2024-11-28 17:58:39 +00:00
Alex Moreno d6a849727e fix: fix result test
gitea/salix/pipeline/head This commit looks good Details
2024-11-28 13:11:43 +01:00
Alex Moreno 838296e744 fix: add expected message result
gitea/salix/pipeline/head This commit looks good Details
2024-11-28 13:02:58 +01:00
Alex Moreno 6785779fe5 fix: add console log
gitea/salix/pipeline/head This commit looks good Details
2024-11-28 12:26:03 +01:00
Alex Moreno e730b5d4a1 fix: add debugAdd response axios
gitea/salix/pipeline/head This commit looks good Details
2024-11-28 11:53:42 +01:00
Alex Moreno 5923916cda fix: change debugAdd to console.error
gitea/salix/pipeline/head This commit looks good Details
2024-11-28 11:31:38 +01:00
Pablo Natek c8b0874e95 Merge pull request 'fix: refs #7404 add debug logging for cancelShipment and deleteExpeditions methods' (!3258) from 7404-add-debug into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3258
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-28 10:24:57 +00:00
Alex Moreno 8ef78818db Merge branch 'master' into 7404-add-debug
gitea/salix/pipeline/pr-master This commit looks good Details
2024-11-28 10:19:32 +00:00
Pablo Natek 00e5f86020 fix: refs #7404 add debug logging for cancelShipment and deleteExpeditions methods
gitea/salix/pipeline/pr-master This commit looks good Details
2024-11-28 11:18:09 +01:00
Guillermo Bonet 699c6553a0 Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good Details
2024-11-28 11:17:19 +01:00
Guillermo Bonet 46bd033336 Merge branch 'master' into test
gitea/salix/pipeline/head This commit looks good Details
2024-11-28 11:16:58 +01:00
Guillermo Bonet 51d96a89c5 fix: refs #7266 Increased size item id buy-label
gitea/salix/pipeline/head This commit looks good Details
2024-11-28 11:15:58 +01:00
Jorge Penadés eb97f6ef5f Merge pull request 'feat: refs #6818 define prefix model' (!3254) from 6818-hotfix-definePrefix into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3254
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2024-11-28 08:50:01 +00:00
Jorge Penadés 5ee4563ee7 Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix into 6818-hotfix-definePrefix
gitea/salix/pipeline/pr-master This commit looks good Details
2024-11-28 09:38:28 +01:00
Guillermo Bonet 71bc1adcba Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good Details
2024-11-28 09:00:38 +01:00
Guillermo Bonet ca4244527b Merge branch 'master' into test
gitea/salix/pipeline/head This commit looks good Details
2024-11-28 09:00:24 +01:00
Guillermo Bonet 847692f103 Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix
gitea/salix/pipeline/head This commit looks good Details
2024-11-28 08:59:11 +01:00
Guillermo Bonet 93388461d1 fix: refs #7266 Changed method name and corrections 2024-11-28 08:59:08 +01:00
Sergio De la torre cf237a1dd7 Merge pull request '8213-itemShelvingSalePicker' (!3248) from 8213-itemShelvingSalePicker into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3248
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-28 07:51:35 +00:00
Sergio De la torre 6f1bfd6787 Merge branch 'master' into 8213-itemShelvingSalePicker
gitea/salix/pipeline/pr-master This commit looks good Details
2024-11-28 07:50:06 +00:00
Alex Moreno 65c994e9d6 Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good Details
2024-11-28 08:42:36 +01:00
Alex Moreno 34348f50e8 Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix into test
gitea/salix/pipeline/head This commit looks good Details
2024-11-28 08:42:24 +01:00
Carlos Andrés 30cc7a49a0 Actualizar modules/entry/back/methods/entry/print.js
gitea/salix/pipeline/head This commit looks good Details
2024-11-27 15:38:50 +00:00
Carlos Andrés d872f164fd Actualizar modules/entry/back/models/entry.js
gitea/salix/pipeline/head This commit looks good Details
2024-11-27 14:55:30 +00:00
Carlos Andrés 15c755087c fix: refs #8221 duaInvoiceIn unique
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-27 14:28:50 +01:00
Jorge Penadés bab5a4fadb Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix into 6818-hotfix-definePrefix
gitea/salix/pipeline/pr-master This commit looks good Details
2024-11-27 13:09:29 +01:00
Jorge Penadés 8fd133c5e8 feat: refs #6818 define prefix model
gitea/salix/pipeline/pr-master This commit looks good Details
2024-11-27 12:51:09 +01:00
Sergio De la torre f4f5ab2651 Merge branch 'master' into 8213-itemShelvingSalePicker
gitea/salix/pipeline/pr-master This commit looks good Details
2024-11-26 11:46:54 +00:00
11 changed files with 56 additions and 16 deletions

View File

@ -24,12 +24,13 @@ module.exports = Self => {
Self.cancelShipment = async expeditionFk => { Self.cancelShipment = async expeditionFk => {
const models = Self.app.models; const models = Self.app.models;
const mrw = await models.MrwConfig.findOne(); const mrw = await models.MrwConfig.findOne();
const {externalId} = await models.Expedition.findById(expeditionFk); const {externalId} = await models.Expedition.findById(expeditionFk);
const clientType = await models.MrwConfig.getClientType(expeditionFk); const clientType = await models.MrwConfig.getClientType(expeditionFk);
const template = fs.readFileSync(__dirname + '/cancelShipment.ejs', 'utf-8'); const template = fs.readFileSync(__dirname + '/cancelShipment.ejs', 'utf-8');
const renderedXml = ejs.render(template, {mrw, externalId, clientType}); const renderedXml = ejs.render(template, {mrw, externalId, clientType});
await Self.rawSql('CALL util.debugAdd(?,?);', ['cancelShipment', renderedXml]);
const response = await axios.post(mrw.url, renderedXml, { const response = await axios.post(mrw.url, renderedXml, {
headers: { headers: {
'Content-Type': 'application/soap+xml; charset=utf-8' 'Content-Type': 'application/soap+xml; charset=utf-8'
@ -37,12 +38,11 @@ module.exports = Self => {
}); });
const xmlString = response.data; const xmlString = response.data;
await Self.rawSql('CALL util.debugAdd(?,?);', ['cancelShipmentResponse', xmlString]);
const parser = new DOMParser(); const parser = new DOMParser();
const xmlDoc = parser.parseFromString(xmlString, 'text/xml'); const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
await Self.rawSql('CALL util.debugAdd(?,?);', ['cancelShipment', xmlDoc]);
const result = xmlDoc.getElementsByTagName('Mensaje')[0].textContent; const result = xmlDoc.getElementsByTagName('Mensaje')[0].textContent;
return result.toLowerCase().includes('se ha cancelado correctamente'); return ['no se ha encontrado', 'se ha cancelado correctamente'].some(res => result.toLowerCase().includes(res));
}; };
}; };

View File

@ -133,6 +133,9 @@
"Postcode": { "Postcode": {
"dataSource": "vn" "dataSource": "vn"
}, },
"Prefix": {
"dataSource": "vn"
},
"ReferenceRate": { "ReferenceRate": {
"dataSource": "vn" "dataSource": "vn"
}, },

27
back/models/prefix.json Normal file
View File

@ -0,0 +1,27 @@
{
"name": "Prefix",
"base": "VnModel",
"options": {
"mysql": {
"table": "pbx.prefix"
}
},
"properties": {
"country": {
"type": "string",
"id": true
},
"prefix": {
"type": "string"
}
},
"acls": [
{
"property": "*",
"accessType": "READ",
"principalType": "ROLE",
"principalId": "employee",
"permission": "ALLOW"
}
]
}

View File

@ -0,0 +1,5 @@
ALTER TABLE vn.duaInvoiceIn DROP KEY IF EXISTS duaFk_UNIQUE;
ALTER TABLE vn.duaInvoiceIn DROP KEY IF EXISTS duaInvoiceIn_unique;
ALTER TABLE vn.duaInvoiceIn ADD CONSTRAINT duaInvoiceIn_unique
UNIQUE KEY (invoiceInFk);

View File

@ -54,7 +54,7 @@ module.exports = Self => {
{ {
relation: 'country', relation: 'country',
scope: { scope: {
fields: ['id', 'name'], fields: ['id', 'name', 'code'],
include: { include: {
relation: 'saySimpleCountry', relation: 'saySimpleCountry',
} }

View File

@ -1,6 +1,6 @@
const UserError = require('vn-loopback/util/user-error'); const UserError = require('vn-loopback/util/user-error');
module.exports = Self => { module.exports = Self => {
Self.remoteMethodCtx('print', { Self.remoteMethodCtx('labelSupplier', {
description: 'Print stickers of all entries', description: 'Print stickers of all entries',
accessType: 'READ', accessType: 'READ',
accepts: [ accepts: [
@ -28,13 +28,13 @@ module.exports = Self => {
} }
], ],
http: { http: {
path: '/:id/print', path: '/:id/labelSupplier',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['DEFAULT', 'read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.print = async function(ctx, id, options) { Self.labelSupplier = async function(ctx, id, options) {
const models = Self.app.models; const models = Self.app.models;
const myOptions = {}; const myOptions = {};
if (typeof options == 'object') if (typeof options == 'object')
@ -48,7 +48,8 @@ module.exports = Self => {
for (const buy of buys) { for (const buy of buys) {
if (buy.stickers < 1) continue; if (buy.stickers < 1) continue;
ctx.args.id = buy.id; ctx.args.id = buy.id;
const pdfBuffer = await models.Entry.buyLabel(ctx, myOptions); ctx.args.copies = buy.stickers;
const pdfBuffer = await models.Entry.buyLabelSupplier(ctx, myOptions);
await merger.add(new Uint8Array(pdfBuffer[0])); await merger.add(new Uint8Array(pdfBuffer[0]));
} }

View File

@ -12,7 +12,8 @@ module.exports = Self => {
require('../methods/entry/addFromPackaging')(Self); require('../methods/entry/addFromPackaging')(Self);
require('../methods/entry/addFromBuy')(Self); require('../methods/entry/addFromBuy')(Self);
require('../methods/entry/buyLabel')(Self); require('../methods/entry/buyLabel')(Self);
require('../methods/entry/print')(Self); require('../methods/entry/labelSupplier')(Self);
require('../methods/entry/buyLabelSupplier')(Self);
Self.observe('before save', async function(ctx, options) { Self.observe('before save', async function(ctx, options) {
if (ctx.isNewInstance) return; if (ctx.isNewInstance) return;

View File

@ -51,7 +51,7 @@ module.exports = Self => {
JOIN vn.productionConfig pc JOIN vn.productionConfig pc
WHERE sh.code = ? AND s.code = pc.sectorFromCode WHERE sh.code = ? AND s.code = pc.sectorFromCode
), tItemInSector AS ( ), tItemInSector AS (
SELECT is2.itemFk, is2.created, is2.shelvingFk SELECT is2.itemFk, is2.created, sh.code
FROM vn.itemShelving is2 FROM vn.itemShelving is2
JOIN vn.shelving sh ON sh.id = is2.shelvingFk JOIN vn.shelving sh ON sh.id = is2.shelvingFk
JOIN vn.parking p ON p.id = sh.parkingFk JOIN vn.parking p ON p.id = sh.parkingFk
@ -59,7 +59,7 @@ module.exports = Self => {
JOIN vn.productionConfig pc JOIN vn.productionConfig pc
WHERE sh.code <> ? WHERE sh.code <> ?
AND s.code = pc.sectorFromCode) AND s.code = pc.sectorFromCode)
SELECT ti.itemFK, tis.shelvingFk SELECT ti.itemFK, tis.code shelvingFk
FROM tItemShelving ti FROM tItemShelving ti
JOIN tItemInSector tis ON tis.itemFk = ti.itemFk JOIN tItemInSector tis ON tis.itemFk = ti.itemFk
JOIN vn.productionConfig pc JOIN vn.productionConfig pc

View File

@ -52,7 +52,8 @@ module.exports = Self => {
const deletedExpedition = await models.Expedition.destroyById(expeditionId); const deletedExpedition = await models.Expedition.destroyById(expeditionId);
deletedExpeditions.push(deletedExpedition); deletedExpeditions.push(deletedExpedition);
} catch (e) { } catch (error) {
console.error('error: ', error);
notDeletedExpeditions.push(expeditionId); notDeletedExpeditions.push(expeditionId);
} }
} }

View File

@ -33,7 +33,9 @@ td {
font-size: 26px; font-size: 26px;
} }
.lg-txt { .lg-txt {
font-size: 32px; font-size: 40px;
padding: 0px;
line-height: 1;
} }
.xl-txt { .xl-txt {
font-size: 50px; font-size: 50px;

View File

@ -36,12 +36,12 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="lg-txt xl-width bold center"> <td class="bold center lg-txt xl-width">
<div class="overflow-line"> <div class="overflow-line">
{{formatNumber(buy.itemFk)}} {{formatNumber(buy.itemFk)}}
</div> </div>
</td> </td>
<td colspan="2" class="md-txt md-width center"> <td colspan="2" class="center md-txt md-width">
<div class="overflow-line"> <div class="overflow-line">
{{`${(packing || buy.packing)} x ${buy.stems || ''}`}} {{`${(packing || buy.packing)} x ${buy.stems || ''}`}}
</div> </div>