7658-devToTest_2428 #2663
|
@ -2,7 +2,7 @@ DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_doReserve`()
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_doReserve`()
|
||||||
proc: BEGIN
|
proc: BEGIN
|
||||||
/**
|
/**
|
||||||
* Genera reservas de la tabla itemShelvingSaleReserv
|
* Genera reservas de la tabla vn.itemShelvingSaleReserve
|
||||||
*/
|
*/
|
||||||
DECLARE vDone BOOL;
|
DECLARE vDone BOOL;
|
||||||
DECLARE vSaleFk INT;
|
DECLARE vSaleFk INT;
|
||||||
|
@ -26,7 +26,7 @@ proc: BEGIN
|
||||||
|
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tSale
|
CREATE OR REPLACE TEMPORARY TABLE tSale
|
||||||
ENGINE = MEMORY
|
ENGINE = MEMORY
|
||||||
SELECT id, saleFk FROM itemShelvingSaleReserv;
|
SELECT id, saleFk FROM itemShelvingSaleReserve;
|
||||||
|
|
||||||
OPEN vSales;
|
OPEN vSales;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ proc: BEGIN
|
||||||
|
|
||||||
CLOSE vSales;
|
CLOSE vSales;
|
||||||
|
|
||||||
DELETE iss FROM itemShelvingSaleReserv iss JOIN tSale s ON s.id = iss.id;
|
DELETE iss FROM itemShelvingSaleReserve iss JOIN tSale s ON s.id = iss.id;
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tSale;
|
DROP TEMPORARY TABLE tSale;
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ BEGIN
|
||||||
WHERE id = vItemShelvingFk
|
WHERE id = vItemShelvingFk
|
||||||
AND itemFk = vItemFk;
|
AND itemFk = vItemFk;
|
||||||
|
|
||||||
INSERT INTO itemShelvingSaleReserv (saleFk)
|
INSERT INTO itemShelvingSaleReserve (saleFk)
|
||||||
SELECT DISTINCT iss.saleFk
|
SELECT DISTINCT iss.saleFk
|
||||||
FROM itemShelvingSale iss
|
FROM itemShelvingSale iss
|
||||||
JOIN itemShelving ish ON ish.id = iss.itemShelvingFk
|
JOIN itemShelving ish ON ish.id = iss.itemShelvingFk
|
||||||
|
|
|
@ -86,7 +86,7 @@ BEGIN
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
IF vIsItemShelvingSaleEmpty AND vQuantity <> vReservedQuantity THEN
|
IF vIsItemShelvingSaleEmpty AND vQuantity <> vReservedQuantity THEN
|
||||||
INSERT INTO itemShelvingSaleReserv (saleFk)
|
INSERT INTO itemShelvingSaleReserve (saleFk)
|
||||||
SELECT vSaleFk;
|
SELECT vSaleFk;
|
||||||
CALL itemShelvingSale_reallocate(vItemShelvingFk, vItemFk);
|
CALL itemShelvingSale_reallocate(vItemShelvingFk, vItemFk);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
|
@ -16,11 +16,11 @@ ALTER TABLE vn.itemShelving ADD available INT NULL;
|
||||||
|
|
||||||
UPDATE vn.itemShelving SET available = visible;
|
UPDATE vn.itemShelving SET available = visible;
|
||||||
|
|
||||||
CREATE TABLE vn.itemShelvingSaleReserv (
|
CREATE TABLE vn.itemShelvingSaleReserve (
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`saleFk` int(11) NOT NULL,
|
`saleFk` int(11) NOT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `itemShelvingSaleReserv_ibfk_1` (`saleFk`)
|
KEY `itemShelvingSaleReserve_ibfk_1` (`saleFk`)
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci
|
||||||
COMMENT='Queue of changed itemShelvingSale to reserve';
|
COMMENT='Queue of changed itemShelvingSale to reserve';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue