From 8679aefb4881b70f46659813e3e71e52cb40846e Mon Sep 17 00:00:00 2001 From: alexandre Date: Fri, 3 Mar 2023 07:36:04 +0100 Subject: [PATCH 1/3] refs #4713 procs deprecated, originalQuantity deleted --- back/methods/collection/setSaleQuantity.js | 3 +-- db/changes/231001/00-saleTracking.sql | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 db/changes/231001/00-saleTracking.sql diff --git a/back/methods/collection/setSaleQuantity.js b/back/methods/collection/setSaleQuantity.js index 4ac3d6d4b..0638539e3 100644 --- a/back/methods/collection/setSaleQuantity.js +++ b/back/methods/collection/setSaleQuantity.js @@ -40,8 +40,7 @@ module.exports = Self => { try { const sale = await models.Sale.findById(saleId, null, myOptions); const saleUpdated = await sale.updateAttributes({ - originalQuantity: sale.quantity, - quantity: quantity + quantity }, myOptions); if (tx) await tx.commit(); diff --git a/db/changes/231001/00-saleTracking.sql b/db/changes/231001/00-saleTracking.sql new file mode 100644 index 000000000..ce9bd8505 --- /dev/null +++ b/db/changes/231001/00-saleTracking.sql @@ -0,0 +1,5 @@ +DROP PROCEDURE `vn`.`sale_setQuantity`; +DROP PROCEDURE `vn`.`collection_updateSale`; +DROP PROCEDURE `vn`.`replaceMovimientosMark`; +DROP PROCEDURE `vn`.`saleTracking_Replace`; +DROP PROCEDURE `vn`.`sale_updateOriginalQuantity`; -- 2.40.1 From 106f96b9a6fb77f5b5b768a8fbe4527eb19cd441 Mon Sep 17 00:00:00 2001 From: alexandre Date: Wed, 8 Mar 2023 12:10:08 +0100 Subject: [PATCH 2/3] refs #4713 fixed front test --- back/methods/collection/spec/setSaleQuantity.spec.js | 2 +- db/changes/231001/.gitkeep | 0 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 db/changes/231001/.gitkeep diff --git a/back/methods/collection/spec/setSaleQuantity.spec.js b/back/methods/collection/spec/setSaleQuantity.spec.js index 63dc3bd2d..516382606 100644 --- a/back/methods/collection/spec/setSaleQuantity.spec.js +++ b/back/methods/collection/spec/setSaleQuantity.spec.js @@ -15,7 +15,7 @@ describe('setSaleQuantity()', () => { await models.Collection.setSaleQuantity(saleId, newQuantity, options); const updateSale = await models.Sale.findById(saleId, null, options); - expect(updateSale.originalQuantity).toEqual(originalSale.quantity); + expect(updateSale.quantity).not.toEqual(originalSale.quantity); expect(updateSale.quantity).toEqual(newQuantity); await tx.rollback(); diff --git a/db/changes/231001/.gitkeep b/db/changes/231001/.gitkeep deleted file mode 100644 index e69de29bb..000000000 -- 2.40.1 From 5844da44749291378f599209731f699b4c3b7fc4 Mon Sep 17 00:00:00 2001 From: alexandre Date: Wed, 26 Apr 2023 14:34:29 +0200 Subject: [PATCH 3/3] refs #4713 updated sql --- db/changes/231001/00-saleTracking.sql | 5 ----- db/changes/231601/00-saleTracking.sql | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 db/changes/231001/00-saleTracking.sql create mode 100644 db/changes/231601/00-saleTracking.sql diff --git a/db/changes/231001/00-saleTracking.sql b/db/changes/231001/00-saleTracking.sql deleted file mode 100644 index ce9bd8505..000000000 --- a/db/changes/231001/00-saleTracking.sql +++ /dev/null @@ -1,5 +0,0 @@ -DROP PROCEDURE `vn`.`sale_setQuantity`; -DROP PROCEDURE `vn`.`collection_updateSale`; -DROP PROCEDURE `vn`.`replaceMovimientosMark`; -DROP PROCEDURE `vn`.`saleTracking_Replace`; -DROP PROCEDURE `vn`.`sale_updateOriginalQuantity`; diff --git a/db/changes/231601/00-saleTracking.sql b/db/changes/231601/00-saleTracking.sql new file mode 100644 index 000000000..d651a2447 --- /dev/null +++ b/db/changes/231601/00-saleTracking.sql @@ -0,0 +1,5 @@ +DROP PROCEDURE IF EXISTS `vn`.`sale_setQuantity`; +DROP PROCEDURE IF EXISTS `vn`.`collection_updateSale`; +DROP PROCEDURE IF EXISTS `vn`.`replaceMovimientosMark`; +DROP PROCEDURE IF EXISTS `vn`.`saleTracking_Replace`; +DROP PROCEDURE IF EXISTS `vn`.`sale_updateOriginalQuantity`; -- 2.40.1