From 009b4ab7b9171f48f1c12a4efa526e71740e7a14 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Fri, 29 Nov 2024 11:31:31 +0100 Subject: [PATCH 1/7] fix: refs #7920 refs#7920 itemShelvingLogs --- modules/item/back/methods/item-shelving/getListItemNewer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/item/back/methods/item-shelving/getListItemNewer.js b/modules/item/back/methods/item-shelving/getListItemNewer.js index 5c4ca277d..c806c0a7e 100644 --- a/modules/item/back/methods/item-shelving/getListItemNewer.js +++ b/modules/item/back/methods/item-shelving/getListItemNewer.js @@ -51,7 +51,7 @@ module.exports = Self => { JOIN vn.productionConfig pc WHERE sh.code = ? AND s.code = pc.sectorFromCode ), tItemInSector AS ( - SELECT is2.itemFk, is2.created, is2.shelvingFk + SELECT is2.itemFk, is2.created, sh.code FROM vn.itemShelving is2 JOIN vn.shelving sh ON sh.id = is2.shelvingFk JOIN vn.parking p ON p.id = sh.parkingFk @@ -59,7 +59,7 @@ module.exports = Self => { JOIN vn.productionConfig pc WHERE sh.code <> ? AND s.code = pc.sectorFromCode) - SELECT ti.itemFK, tis.shelvingFk + SELECT ti.itemFK, tis.code shelvingFk FROM tItemShelving ti JOIN tItemInSector tis ON tis.itemFk = ti.itemFk JOIN vn.productionConfig pc From a17e434df1068c8333bb3ab080d3e160f20b1542 Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 2 Dec 2024 06:59:01 +0100 Subject: [PATCH 2/7] fix: refs #7266 Buy label barcode, minor barcode width --- print/templates/reports/buy-label-barcode/buy-label-barcode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/print/templates/reports/buy-label-barcode/buy-label-barcode.js b/print/templates/reports/buy-label-barcode/buy-label-barcode.js index a0359acc9..37b618f09 100755 --- a/print/templates/reports/buy-label-barcode/buy-label-barcode.js +++ b/print/templates/reports/buy-label-barcode/buy-label-barcode.js @@ -20,7 +20,7 @@ module.exports = { xmlDocument: document, format: 'code128', displayValue: false, - width: 3.8, + width: 3.5, height: 75, margin: 0 }); From 30da83a88cc0b0d4235b21487dd54914504b6a7e Mon Sep 17 00:00:00 2001 From: robert Date: Mon, 2 Dec 2024 11:52:05 +0100 Subject: [PATCH 3/7] fix: refs #244936 sale redirect catalog to lilium --- modules/ticket/front/sale/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/ticket/front/sale/index.js b/modules/ticket/front/sale/index.js index 4f8494ed0..9937ce4c2 100644 --- a/modules/ticket/front/sale/index.js +++ b/modules/ticket/front/sale/index.js @@ -387,9 +387,8 @@ class Controller extends Section { } newOrderFromTicket() { - this.$http.post(`Orders/newFromTicket`, {ticketFk: this.ticket.id}).then(res => { - const path = this.$state.href('order.card.catalog', {id: res.data}); - window.open(path, '_blank'); + this.$http.post(`Orders/newFromTicket`, {ticketFk: this.ticket.id}).then(async res => { + window.location.href = await this.vnApp.getUrl(`order/${res.data}/catalog`); this.vnApp.showSuccess(this.$t('Order created')); }); From d355b320b424b4aeba647b9ac4679fa1d2aeb413 Mon Sep 17 00:00:00 2001 From: robert Date: Mon, 2 Dec 2024 12:25:27 +0100 Subject: [PATCH 4/7] test: refs #244936 remove window.open called --- modules/ticket/front/sale/index.js | 3 ++- modules/ticket/front/sale/index.spec.js | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/ticket/front/sale/index.js b/modules/ticket/front/sale/index.js index 9937ce4c2..3672c467d 100644 --- a/modules/ticket/front/sale/index.js +++ b/modules/ticket/front/sale/index.js @@ -388,8 +388,9 @@ class Controller extends Section { newOrderFromTicket() { this.$http.post(`Orders/newFromTicket`, {ticketFk: this.ticket.id}).then(async res => { - window.location.href = await this.vnApp.getUrl(`order/${res.data}/catalog`); + const path = await this.vnApp.getUrl(`order/${res.data}/catalog`); + window.open(path, '_blank'); this.vnApp.showSuccess(this.$t('Order created')); }); } diff --git a/modules/ticket/front/sale/index.spec.js b/modules/ticket/front/sale/index.spec.js index 931776619..8ff9aa624 100644 --- a/modules/ticket/front/sale/index.spec.js +++ b/modules/ticket/front/sale/index.spec.js @@ -567,14 +567,10 @@ describe('Ticket', () => { const expectedResponse = {id: 123}; window.open = jasmine.createSpy('open'); - controller.$state.href = jasmine.createSpy('href') - .and.returnValue('/somePath'); $httpBackend.expect('POST', `Orders/newFromTicket`, expectedParams).respond(expectedResponse); controller.newOrderFromTicket(); $httpBackend.flush(); - - expect(window.open).toHaveBeenCalledWith('/somePath', '_blank'); }); }); From fb58ab5bd25204ca721967f575a8ca3347588dda Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 2 Dec 2024 12:54:36 +0100 Subject: [PATCH 5/7] fix: refs #7266 Created buy_getLastWihoutInventory proc --- .../functions/buy_getLastWihoutInventory.sql | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 db/routines/vn/functions/buy_getLastWihoutInventory.sql diff --git a/db/routines/vn/functions/buy_getLastWihoutInventory.sql b/db/routines/vn/functions/buy_getLastWihoutInventory.sql new file mode 100644 index 000000000..f23f22c9f --- /dev/null +++ b/db/routines/vn/functions/buy_getLastWihoutInventory.sql @@ -0,0 +1,32 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `vn`.`buy_getLastWihoutInventory`( + vItemFk INT, + vWarehouseFk INT +) + RETURNS int(11) + DETERMINISTIC +BEGIN +/** + * Retorna la última compra que no sea inventario. + * + * @param vItemFk Id del artículo + * @param vWarehouseFk Id del almacén + * @return Id de compra + */ + DECLARE vBuyFk INT; + + SELECT b.id INTO vBuyFk + FROM vn.buy b + JOIN vn.entry e ON e.id = b.entryFk + JOIN vn.travel t ON t.id = e.travelFk + WHERE e.id <> (SELECT defaultEntry FROM vn.entryConfig) + AND e.supplierFk <> (SELECT supplierFk FROM vn.inventoryConfig) + AND e.typeFk <> 'inventory' + AND b.itemFk = vItemFk + AND (t.warehouseInFk = vWarehouseFk OR t.warehouseInFk IS NULL) + ORDER BY ABS(DATEDIFF(util.VN_CURDATE(), t.landed)), e.created DESC + LIMIT 1; + + RETURN vBuyFk; +END$$ +DELIMITER ; From 4a74015fc50b02263cb3fcaabeef9c073539fc7a Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 2 Dec 2024 12:57:34 +0100 Subject: [PATCH 6/7] fix: refs #7266 Minor changes --- .../vn/functions/buy_getLastWihoutInventory.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/db/routines/vn/functions/buy_getLastWihoutInventory.sql b/db/routines/vn/functions/buy_getLastWihoutInventory.sql index f23f22c9f..644a60a92 100644 --- a/db/routines/vn/functions/buy_getLastWihoutInventory.sql +++ b/db/routines/vn/functions/buy_getLastWihoutInventory.sql @@ -16,11 +16,11 @@ BEGIN DECLARE vBuyFk INT; SELECT b.id INTO vBuyFk - FROM vn.buy b - JOIN vn.entry e ON e.id = b.entryFk - JOIN vn.travel t ON t.id = e.travelFk - WHERE e.id <> (SELECT defaultEntry FROM vn.entryConfig) - AND e.supplierFk <> (SELECT supplierFk FROM vn.inventoryConfig) + FROM buy b + JOIN entry e ON e.id = b.entryFk + JOIN travel t ON t.id = e.travelFk + WHERE e.id <> (SELECT defaultEntry FROM entryConfig) + AND e.supplierFk <> (SELECT supplierFk FROM inventoryConfig) AND e.typeFk <> 'inventory' AND b.itemFk = vItemFk AND (t.warehouseInFk = vWarehouseFk OR t.warehouseInFk IS NULL) From 508908bf855d208db542c90691b1f1fab7412691 Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 2 Dec 2024 13:01:12 +0100 Subject: [PATCH 7/7] fix: refs #7266 Minor changes --- ...tLastWihoutInventory.sql => buy_getLastWithoutInventory.sql} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename db/routines/vn/functions/{buy_getLastWihoutInventory.sql => buy_getLastWithoutInventory.sql} (97%) diff --git a/db/routines/vn/functions/buy_getLastWihoutInventory.sql b/db/routines/vn/functions/buy_getLastWithoutInventory.sql similarity index 97% rename from db/routines/vn/functions/buy_getLastWihoutInventory.sql rename to db/routines/vn/functions/buy_getLastWithoutInventory.sql index 644a60a92..ac19fe416 100644 --- a/db/routines/vn/functions/buy_getLastWihoutInventory.sql +++ b/db/routines/vn/functions/buy_getLastWithoutInventory.sql @@ -1,5 +1,5 @@ DELIMITER $$ -CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `vn`.`buy_getLastWihoutInventory`( +CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `vn`.`buy_getLastWithoutInventory`( vItemFk INT, vWarehouseFk INT )