feat: previas con sitema de reservas refs #6861
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Carlos Andrés 2024-06-24 13:30:03 +02:00
parent f7b8bd2df6
commit cf79711f6a
4 changed files with 7 additions and 7 deletions

View File

@ -2,7 +2,7 @@ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_doReserve`()
proc: BEGIN
/**
* Genera reservas de la tabla itemShelvingSaleReserv
* Genera reservas de la tabla vn.itemShelvingSaleReserve
*/
DECLARE vDone BOOL;
DECLARE vSaleFk INT;
@ -26,7 +26,7 @@ proc: BEGIN
CREATE OR REPLACE TEMPORARY TABLE tSale
ENGINE = MEMORY
SELECT id, saleFk FROM itemShelvingSaleReserv;
SELECT id, saleFk FROM itemShelvingSaleReserve;
OPEN vSales;
@ -43,7 +43,7 @@ proc: BEGIN
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;

View File

@ -28,7 +28,7 @@ BEGIN
WHERE id = vItemShelvingFk
AND itemFk = vItemFk;
INSERT INTO itemShelvingSaleReserv (saleFk)
INSERT INTO itemShelvingSaleReserve (saleFk)
SELECT DISTINCT iss.saleFk
FROM itemShelvingSale iss
JOIN itemShelving ish ON ish.id = iss.itemShelvingFk

View File

@ -86,7 +86,7 @@ BEGIN
COMMIT;
IF vIsItemShelvingSaleEmpty AND vQuantity <> vReservedQuantity THEN
INSERT INTO itemShelvingSaleReserv (saleFk)
INSERT INTO itemShelvingSaleReserve (saleFk)
SELECT vSaleFk;
CALL itemShelvingSale_reallocate(vItemShelvingFk, vItemFk);
END IF;

View File

@ -16,11 +16,11 @@ ALTER TABLE vn.itemShelving ADD available INT NULL;
UPDATE vn.itemShelving SET available = visible;
CREATE TABLE vn.itemShelvingSaleReserv (
CREATE TABLE vn.itemShelvingSaleReserve (
`id` int(11) NOT NULL AUTO_INCREMENT,
`saleFk` int(11) NOT NULL,
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
COMMENT='Queue of changed itemShelvingSale to reserve';