From 31bd4d775b3487e4137d9c25672c9a52c2ca4d89 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 25 Jul 2022 17:37:00 +0200 Subject: [PATCH 1/2] fix fields number for print label --- ereuse_devicehub/static/js/print.pdf.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ereuse_devicehub/static/js/print.pdf.js b/ereuse_devicehub/static/js/print.pdf.js index b17f70ee..e0109d33 100644 --- a/ereuse_devicehub/static/js/print.pdf.js +++ b/ereuse_devicehub/static/js/print.pdf.js @@ -234,9 +234,9 @@ function printpdf() { if ($("#qrCheck").prop('checked')) { var h = hspace + border - img_side/2; var w = border*2 + img_side; - pdf.text(tag, w, h); + pdf.text(String(tag), w, h); } else { - pdf.text(tag, border, hspace); + pdf.text(String(tag), border, hspace); } hspace += line; }; @@ -244,26 +244,26 @@ function printpdf() { var sn = $(y).data('sid'); pdf.setFontSize(12); if (sn) { - pdf.text(sn, border, hspace); + pdf.text(String(sn), border, hspace); hspace += line; } }; if ($("#serialNumberCheck").prop('checked')) { var sn = $(y).data('serial-number'); pdf.setFontSize(12); - pdf.text(sn, border, hspace); + pdf.text(String(sn), border, hspace); hspace += line; }; if ($("#manufacturerCheck").prop('checked')) { var sn = $(y).data('manufacturer'); pdf.setFontSize(12); - pdf.text(sn, border, hspace); + pdf.text(String(sn), border, hspace); hspace += line; }; if ($("#modelCheck").prop('checked')) { var sn = $(y).data('model'); pdf.setFontSize(8); - pdf.text(sn, border, hspace); + pdf.text(String(sn), border, hspace); hspace += line; }; }); From ac9708c77967946821b1b2cd1835707d287fc8d7 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 25 Jul 2022 17:38:08 +0200 Subject: [PATCH 2/2] fix unlink tags --- ereuse_devicehub/static/js/main_inventory.build.js | 4 ++-- ereuse_devicehub/static/js/main_inventory.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ereuse_devicehub/static/js/main_inventory.build.js b/ereuse_devicehub/static/js/main_inventory.build.js index 1e1b21fd..7737a44c 100644 --- a/ereuse_devicehub/static/js/main_inventory.build.js +++ b/ereuse_devicehub/static/js/main_inventory.build.js @@ -216,7 +216,7 @@ function removeLot() { function removeTag() { const devices = TableController.getSelectedDevices(); - const devices_id = devices.map(dev => dev.data); + const devices_id = devices.map(dev => $(dev).attr('data')); if (devices_id.length == 1) { const url = "/inventory/tag/devices/".concat(devices_id[0], "/del/"); @@ -228,7 +228,7 @@ function removeTag() { function addTag() { const devices = TableController.getSelectedDevices(); - const devices_id = devices.map(dev => dev.data); + const devices_id = devices.map(dev => $(dev).attr('data')); if (devices_id.length == 1) { $("#addingTagModal .pol").hide(); diff --git a/ereuse_devicehub/static/js/main_inventory.js b/ereuse_devicehub/static/js/main_inventory.js index 9c9b8d0a..d80d6c66 100644 --- a/ereuse_devicehub/static/js/main_inventory.js +++ b/ereuse_devicehub/static/js/main_inventory.js @@ -207,7 +207,7 @@ function removeLot() { function removeTag() { const devices = TableController.getSelectedDevices(); - const devices_id = devices.map(dev => dev.data); + const devices_id = devices.map(dev => $(dev).attr("data")); if (devices_id.length == 1) { const url = `/inventory/tag/devices/${devices_id[0]}/del/`; window.location.href = url; @@ -218,7 +218,7 @@ function removeTag() { function addTag() { const devices = TableController.getSelectedDevices(); - const devices_id = devices.map(dev => dev.data); + const devices_id = devices.map(dev => $(dev).attr("data")); if (devices_id.length == 1) { $("#addingTagModal .pol").hide(); $("#addingTagModal .btn-primary").show();