This commit is contained in:
parent
1cbba0b52f
commit
8f9a7802ab
|
@ -99,7 +99,7 @@ proc: BEGIN
|
|||
LEFT JOIN `zone` z ON z.id = t.zoneFk
|
||||
LEFT JOIN zoneClosure zc ON zc.zoneFk = t.zoneFk
|
||||
AND DATE(t.shipped) = zc.dated
|
||||
LEFT JOIN ticketParking tp ON tp.ticketFk = t.id
|
||||
LEFT JOIN ticketParking tp ON tp.ticketFk = t.id
|
||||
LEFT JOIN parking pk ON pk.id = tp.parkingFk
|
||||
WHERE t.warehouseFk = vWarehouseFk
|
||||
AND dm.code IN ('AGENCY', 'DELIVERY', 'PICKUP');
|
||||
|
@ -124,8 +124,8 @@ proc: BEGIN
|
|||
ADD COLUMN `collectionN` INT;
|
||||
|
||||
UPDATE tmp.productionBuffer pb
|
||||
JOIN tmp.ticket_problems tp ON tp.ticketFk = pb.ticketFk
|
||||
SET pb.problem = TRIM(CAST(CONCAT( IFNULL(tp.itemShortage, ''),
|
||||
JOIN tmp.ticket_problems tp ON tp.ticketFk = pb.ticketFk
|
||||
SET pb.problem = TRIM(CAST(CONCAT( IFNULL(tp.itemShortage, ''),
|
||||
IFNULL(tp.itemDelay, ''),
|
||||
IFNULL(tp.itemLost, ''),
|
||||
IF(tp.isFreezed, ' CONGELADO',''),
|
||||
|
@ -141,7 +141,7 @@ proc: BEGIN
|
|||
LEFT JOIN bs.clientNewBorn cnb ON cnb.clientFk = pb.clientFk
|
||||
JOIN productionConfig pc
|
||||
SET pb.problem = TRIM(CAST(CONCAT('NUEVO ', pb.problem) AS CHAR(255)))
|
||||
WHERE (cnb.clientFk IS NULL OR cnb.isRookie)
|
||||
WHERE (cnb.clientFk IS NULL OR cnb.isRookie)
|
||||
AND pc.rookieDays;
|
||||
|
||||
-- Líneas y volumen por ticket
|
||||
|
@ -268,16 +268,13 @@ proc: BEGIN
|
|||
UPDATE tmp.productionBuffer pb
|
||||
JOIN sale s ON s.ticketFk = pb.ticketFk
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
JOIN itemType it ON it.id = i.typeFk
|
||||
JOIN itemCategory ic ON ic.id = it.categoryFk
|
||||
JOIN cache.last_buy lb ON lb.warehouse_id = vWarehouseFk AND lb.item_id = s.itemFk
|
||||
JOIN cache.last_buy lb ON lb.warehouse_id = vWarehouseFk
|
||||
AND lb.item_id = s.itemFk
|
||||
JOIN buy b ON b.id = lb.buy_id
|
||||
JOIN packaging p ON p.id = b.packagingFk
|
||||
JOIN productionConfig pc
|
||||
SET hasPlantTray = TRUE
|
||||
WHERE ic.code = 'plant'
|
||||
AND p.`depth` >= pc.minPlantTrayLength
|
||||
AND pb.isOwn;
|
||||
SET pb.hasPlantTray = TRUE
|
||||
WHERE p.isPlantTray
|
||||
AND pb.isOwn;
|
||||
|
||||
DROP TEMPORARY TABLE
|
||||
tmp.productionTicket,
|
||||
|
|
|
@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`ticket_splitItemPacki
|
|||
vSelf INT,
|
||||
vOriginalItemPackingTypeFk VARCHAR(1)
|
||||
)
|
||||
BEGIN
|
||||
proc: BEGIN
|
||||
/**
|
||||
* Clona y reparte las líneas de ventas de un ticket en funcion del tipo de empaquetado.
|
||||
* Respeta el id de ticket inicial para el tipo de empaquetado propuesto.
|
||||
|
@ -31,7 +31,7 @@ BEGIN
|
|||
AND i.itemPackingTypeFk = vOriginalItemPackingTypeFk;
|
||||
|
||||
IF NOT vHasItemPackingType THEN
|
||||
CALL util.throw('The ticket has not sales with the itemPackingType');
|
||||
LEAVE proc;
|
||||
END IF;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tSalesToMove (
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE vn.packaging ADD IF NOT EXISTS isPlantTray BOOL DEFAULT FALSE NOT NULL
|
||||
COMMENT 'The container is a plant tray. Used to restrict the picking of full plant trays, to make previous picking.';
|
Loading…
Reference in New Issue