feat: previas con sitema de reservas refs #6861 #2176

Merged
carlosap merged 64 commits from 6861-Pasar-modo-trabajo-de-previa-a-reservas into dev 2024-06-25 11:21:03 +00:00
1 changed files with 9 additions and 2 deletions
Showing only changes of commit 611f907ef0 - Show all commits

View File

@ -2,7 +2,8 @@ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_addWithReservation`(
vItemFk INT,
vQuantity INT,
vTicketFk INT
vTicketFk INT,
vSaleGroupFk INT
)
BEGIN
/**
@ -12,7 +13,9 @@ BEGIN
* @param vItemFk id of item
* @param vQuantity quantity to be added to the ticket
* @param vTicketFk ticket to which the sales line is added
* @param vSaleGroupFk saleGroupFk id to add saleGroupDetail
*/
DECLARE vWarehouseFk INT;
DECLARE vCacheAvailableFk INT;
DECLARE vAvailable INT;
@ -72,7 +75,7 @@ BEGIN
CALL sale_calculateComponent(vSaleFk, NULL);
CALL itemShelvingSale_addBySale(vSaleFk);
carlosap marked this conversation as resolved Outdated

castella no.

castella no.
IF NOT EXISTS (SELECT TRUE FROM itemShelvingSale WHERE saleFk = vSaleFk LIMIT 1) THEN
SET vHasThrow = TRUE;
jgallego marked this conversation as resolved Outdated

no pots posar ací el throw?

no pots posar ací el throw?

No hi ha un error especific per a caada error, s'aprofita la variable vHasThrow en varios puestos

No hi ha un error especific per a caada error, s'aprofita la variable vHasThrow en varios puestos
END IF;
@ -81,6 +84,10 @@ BEGIN
IF vHasThrow THEN
CALL util.throw("No hay disponibilidad para el artículo seleccionado");
ELSE
IF vSaleGroupFk THEN
INSERT INTO saleGroupDetail
SET saleFk = vSaleFk,
saleGroupFk = vSaleGroupFk,
COMMIT;
END IF;
END$$