refactor: refs #6453 order_confirmWithUser #2694
|
@ -37,13 +37,13 @@ BEGIN
|
||||||
DECLARE vAvailable INT;
|
DECLARE vAvailable INT;
|
||||||
|
|
||||||
DECLARE cDates CURSOR FOR
|
DECLARE cDates CURSOR FOR
|
||||||
SELECT zgs.shipped, r.warehouse_id
|
SELECT zgs.shipped, r.warehouseFk
|
||||||
FROM `order` o
|
FROM `order` o
|
||||||
JOIN order_row r ON r.order_id = o.id
|
JOIN orderRow r ON r.orderFk = o.id
|
||||||
LEFT JOIN tmp.zoneGetShipped zgs ON zgs.warehouseFk = r.warehouse_id
|
LEFT JOIN tmp.zoneGetShipped zgs ON zgs.warehouseFk = r.warehouseFk
|
||||||
WHERE o.id = vSelf
|
WHERE o.id = vSelf
|
||||||
AND r.amount
|
AND r.amount
|
||||||
GROUP BY r.warehouse_id;
|
GROUP BY r.warehouseFk;
|
||||||
|
|
||||||
DECLARE cRows CURSOR FOR
|
DECLARE cRows CURSOR FOR
|
||||||
SELECT r.id, r.itemFk, i.name, r.amount, r.price, r.rate, i.isFloramondo
|
SELECT r.id, r.itemFk, i.name, r.amount, r.price, r.rate, i.isFloramondo
|
||||||
|
@ -101,8 +101,8 @@ BEGIN
|
||||||
|
|
||||||
-- Check order is not empty
|
-- Check order is not empty
|
||||||
SELECT COUNT(*) > 0 INTO vIsOk
|
SELECT COUNT(*) > 0 INTO vIsOk
|
||||||
FROM order_row
|
FROM orderRow
|
||||||
WHERE order_id = vSelf
|
WHERE orderFk = vSelf
|
||||||
AND amount > 0;
|
AND amount > 0;
|
||||||
|
|
||||||
IF NOT vIsOk THEN
|
IF NOT vIsOk THEN
|
||||||
|
@ -233,8 +233,8 @@ BEGIN
|
||||||
GROUP BY vSaleFk, rc.componentFk;
|
GROUP BY vSaleFk, rc.componentFk;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
UPDATE order_row
|
UPDATE orderRow
|
||||||
SET Id_Movimiento = vSaleFk
|
SET saleFk = vSaleFk
|
||||||
WHERE id = vRowFk;
|
WHERE id = vRowFk;
|
||||||
|
|
||||||
-- Inserta en putOrder si la compra es de Floramondo
|
-- Inserta en putOrder si la compra es de Floramondo
|
||||||
|
|
Loading…
Reference in New Issue