From 6f1d962db25fd2b3f536875cedd2393ca75673c0 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 13 Sep 2024 14:39:47 +0200 Subject: [PATCH 1/2] fix: refs #7644 Update in print method --- modules/entry/back/methods/entry/print.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/entry/back/methods/entry/print.js b/modules/entry/back/methods/entry/print.js index c155c3d8b..4d36dda7d 100644 --- a/modules/entry/back/methods/entry/print.js +++ b/modules/entry/back/methods/entry/print.js @@ -53,6 +53,13 @@ module.exports = Self => { } if (!merger._doc) throw new UserError('The entry not have stickers'); + + await Self.rawSql(` + UPDATE buy + SET printedStickers = stickers + WHERE entryFk = ? + `, [id], options); + return [await merger.saveAsBuffer(), 'application/pdf', `filename="entry-${id}.pdf"`]; }; }; From 635eb405a29b0d571f1b67650d7e7d83734f40a6 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 13 Sep 2024 14:53:44 +0200 Subject: [PATCH 2/2] fix: refs #7644 Update in print method --- modules/entry/back/methods/entry/print.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/entry/back/methods/entry/print.js b/modules/entry/back/methods/entry/print.js index 4d36dda7d..5b9de9a69 100644 --- a/modules/entry/back/methods/entry/print.js +++ b/modules/entry/back/methods/entry/print.js @@ -58,7 +58,7 @@ module.exports = Self => { UPDATE buy SET printedStickers = stickers WHERE entryFk = ? - `, [id], options); + `, [id], myOptions); return [await merger.saveAsBuffer(), 'application/pdf', `filename="entry-${id}.pdf"`]; };