Compare commits

...

12 Commits

Author SHA1 Message Date
Pablo Natek 1d59d4eeef Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 8004-liliumStyleRemake
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-28 09:34:36 +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
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
2 changed files with 7 additions and 5 deletions

View File

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

View File

@ -12,7 +12,8 @@ module.exports = Self => {
require('../methods/entry/addFromPackaging')(Self);
require('../methods/entry/addFromBuy')(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) {
if (ctx.isNewInstance) return;