fixes #4713 ENC - Modificar como se generan los avisos de cambios de cantidades al encajar #1374
|
@ -40,8 +40,7 @@ module.exports = Self => {
|
||||||
try {
|
try {
|
||||||
const sale = await models.Sale.findById(saleId, null, myOptions);
|
const sale = await models.Sale.findById(saleId, null, myOptions);
|
||||||
const saleUpdated = await sale.updateAttributes({
|
const saleUpdated = await sale.updateAttributes({
|
||||||
originalQuantity: sale.quantity,
|
quantity
|
||||||
quantity: quantity
|
|
||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
|
|
|
@ -30,7 +30,7 @@ describe('setSaleQuantity()', () => {
|
||||||
await models.Collection.setSaleQuantity(saleId, newQuantity, options);
|
await models.Collection.setSaleQuantity(saleId, newQuantity, options);
|
||||||
const updateSale = await models.Sale.findById(saleId, null, 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);
|
expect(updateSale.quantity).toEqual(newQuantity);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
|
|
@ -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`;
|
Loading…
Reference in New Issue