8032-devToTest_2440 #3009
|
@ -126,7 +126,10 @@ BEGIN
|
|||
AND a.available > 0
|
||||
AND (sub.itemAllowed OR NOT it.isFloramondo OR anr.available > 0)
|
||||
AND (ag.isAnyVolumeAllowed OR NOT itt.isUnconventionalSize)
|
||||
AND (itc.isReclining OR it.`size` IS NULL OR it.`size` < z.itemMaxSize OR z.itemMaxSize IS NULL)
|
||||
AND (it.`size` IS NULL
|
||||
OR IF(itc.isReclining,
|
||||
it.size <= z.itemMaxLength OR z.itemMaxLength IS NULL,
|
||||
it.size <= z.itemMaxSize OR z.itemMaxSize IS NULL))
|
||||
AND cit.id IS NULL
|
||||
AND zit.id IS NULL
|
||||
AND ait.id IS NULL;
|
||||
|
|
|
@ -1,58 +1,64 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`previousSticker_get`(vSaleGroupFk INT)
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`previousSticker_get`(
|
||||
vSaleGroupFk INT
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Devuelve los campos a imprimir en una etiqueta de preparación previa.
|
||||
* Actualiza el valor de vn.saleGroup.parkingFk en el caso de que exista un
|
||||
* Actualiza el valor de saleGroup.parkingFk en el caso de que exista un
|
||||
* saleGroup del mismo ticket con parking, del mismo sector, para que todos se
|
||||
* pongan juntos.
|
||||
*
|
||||
* @param vSaleGroupFk Identificador de vn.saleGroup
|
||||
* @param vSaleGroupFk Identificador de saleGroup
|
||||
*/
|
||||
DECLARE vTicketFk INT;
|
||||
DECLARE vParkingFk INT;
|
||||
DECLARE vSectorFk INT;
|
||||
DECLARE vTicketLines INT;
|
||||
|
||||
SELECT s.ticketFk
|
||||
INTO vTicketFk
|
||||
FROM vn.saleGroupDetail sgd
|
||||
JOIN vn.sale s ON s.id = sgd.saleFk
|
||||
WHERE sgd.saleGroupFk = vSaleGroupFk
|
||||
LIMIT 1;
|
||||
WITH ticketData AS(
|
||||
SELECT DISTINCT s.ticketFk
|
||||
FROM vn.saleGroupDetail sgd
|
||||
JOIN vn.sale s ON s.id = sgd.saleFk
|
||||
WHERE sgd.saleGroupFk = vSaleGroupFk
|
||||
)
|
||||
SELECT COUNT(*), s.ticketFk INTO vTicketLines, vTicketFk
|
||||
FROM vn.sale s
|
||||
JOIN ticketData td ON td.ticketFk = s.ticketFk;
|
||||
|
||||
SELECT sg.parkingFk, sc.sectorFk
|
||||
INTO vParkingFk, vSectorFk
|
||||
FROM vn.saleGroup sg
|
||||
JOIN vn.sectorCollectionSaleGroup scsg ON scsg.saleGroupFk = sg.id
|
||||
JOIN vn.sectorCollection sc ON sc.id = scsg.sectorCollectionFk
|
||||
JOIN vn.saleGroupDetail sgd ON sgd.saleGroupFk = sg.id
|
||||
JOIN vn.sale s ON s.id = sgd.saleFk
|
||||
FROM saleGroup sg
|
||||
JOIN sectorCollectionSaleGroup scsg ON scsg.saleGroupFk = sg.id
|
||||
JOIN sectorCollection sc ON sc.id = scsg.sectorCollectionFk
|
||||
JOIN saleGroupDetail sgd ON sgd.saleGroupFk = sg.id
|
||||
JOIN sale s ON s.id = sgd.saleFk
|
||||
WHERE s.ticketFk = vTicketFk
|
||||
AND sg.parkingFk IS NOT NULL
|
||||
LIMIT 1;
|
||||
|
||||
UPDATE vn.saleGroup sg
|
||||
UPDATE saleGroup sg
|
||||
SET sg.parkingFk = vParkingFk
|
||||
WHERE sg.id = vSaleGroupFk
|
||||
AND sg.sectorFk = vSectorFk;
|
||||
|
||||
SELECT sgd.saleGroupFk,
|
||||
t.id ticketFk,
|
||||
p.code as location,
|
||||
t.observations,
|
||||
COUNT(*) previousLines,
|
||||
IF(HOUR(t.shipped), HOUR(t.shipped), HOUR(z.`hour`)) shippingHour,
|
||||
IF(MINUTE(t.shipped), MINUTE(t.shipped), MINUTE(z.`hour`)) shippingMinute ,
|
||||
IFNULL(MAX(i.itemPackingTypeFk),'H') itemPackingTypeFk ,
|
||||
count(*) items,
|
||||
vTicketLines ticketLines,
|
||||
p.code `location`,
|
||||
sc.description sector
|
||||
FROM vn.sale s
|
||||
JOIN vn.item i ON i.id = s.itemFk
|
||||
JOIN vn.saleGroupDetail sgd ON sgd.saleFk = s.id
|
||||
JOIN vn.saleGroup sg ON sg.id = sgd.saleGroupFk
|
||||
JOIN vn.sector sc ON sc.id = sg.sectorFk
|
||||
JOIN vn.ticket t ON t.id = s.ticketFk
|
||||
LEFT JOIN vn.parking p ON p.id = sg.parkingFk
|
||||
LEFT JOIN vn.`zone` z ON z.id = t.zoneFk
|
||||
FROM sale s
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
JOIN saleGroupDetail sgd ON sgd.saleFk = s.id
|
||||
JOIN saleGroup sg ON sg.id = sgd.saleGroupFk
|
||||
JOIN sector sc ON sc.id = sg.sectorFk
|
||||
JOIN ticket t ON t.id = s.ticketFk
|
||||
LEFT JOIN parking p ON p.id = sg.parkingFk
|
||||
LEFT JOIN `zone` z ON z.id = t.zoneFk
|
||||
WHERE sgd.saleGroupFk = vSaleGroupFk;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -25,8 +25,9 @@ UPDATE shelving sh
|
|||
AND (
|
||||
sh.parked IS NULL
|
||||
OR
|
||||
sh.parked < TIMESTAMPADD(MONTH,-1,util.VN_CURDATE())
|
||||
)
|
||||
sh.parked < util.VN_CURDATE() - INTERVAL 2 WEEK
|
||||
)
|
||||
|
||||
AND IF(code REGEXP '^[A-Za-z]{2}[0-9]', LEFT (code, 2) NOT IN (
|
||||
SELECT DISTINCT LEFT(its.shelvingFk, 2)
|
||||
FROM itemShelving its
|
||||
|
|
|
@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`ticket_splitItemPacki
|
|||
vSelf INT,
|
||||
vOriginalItemPackingTypeFk VARCHAR(1)
|
||||
)
|
||||
proc: BEGIN
|
||||
BEGIN
|
||||
/**
|
||||
* Clona y reparte las ventas de un ticket en funcion del tipo de empaquetado.
|
||||
* Respeta el id inicial para el tipo propuesto.
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE vn.`zone`
|
||||
ADD COLUMN IF NOT EXISTS itemMaxLength int(11) NULL COMMENT 'Longitud maxima para articulos acostados que esa agencia puede transportar',
|
||||
MODIFY COLUMN itemMaxSize int(11) DEFAULT NULL NULL COMMENT 'Altura maxima de los articulos que esa agencia puede transportar';
|
|
@ -0,0 +1,3 @@
|
|||
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
|
||||
VALUES ('Postcode','*','WRITE','ALLOW','ROLE','administrative');
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
|
||||
VALUES ('Province','*','WRITE','ALLOW','ROLE','administrative');
|
||||
|
||||
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
|
||||
VALUES ('Town','*','WRITE','ALLOW','ROLE','administrative');
|
||||
|
|
@ -63,8 +63,7 @@ module.exports = Self => {
|
|||
FROM tItemShelving ti
|
||||
JOIN tItemInSector tis ON tis.itemFk = ti.itemFk
|
||||
JOIN vn.productionConfig pc
|
||||
WHERE ti.created + INTERVAL pc.itemOlderReviewHours HOUR < tis.created
|
||||
LIMIT 10;`,
|
||||
WHERE ti.created + INTERVAL pc.itemOlderReviewHours HOUR < tis.created;`,
|
||||
[shelvingFk, shelvingFk], myOptions);
|
||||
return result;
|
||||
};
|
||||
|
|
|
@ -92,10 +92,13 @@ module.exports = Self => {
|
|||
s.payDay,
|
||||
s.phone,
|
||||
s.city,
|
||||
s.countryFk,
|
||||
c.name country,
|
||||
pm.name AS payMethod,
|
||||
pd.payDem AS payDem
|
||||
FROM vn.supplier s
|
||||
LEFT JOIN vn.payMethod pm ON pm.id = s.payMethodFk
|
||||
LEFT JOIN vn.country c ON c.id = s.countryFk
|
||||
LEFT JOIN vn.payDem pd ON pd.id = s.payDemFk`
|
||||
);
|
||||
|
||||
|
|
|
@ -42,6 +42,9 @@
|
|||
},
|
||||
"itemMaxSize": {
|
||||
"type": "number"
|
||||
},
|
||||
"itemMaxLength": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<div class="packing">{{previa.itemPackingTypeFk}}</div>
|
||||
<div class="dated">{{previa.shippingHour}}:{{previa.shippingMinute}}</div>
|
||||
</div>
|
||||
<div class="size">{{previa.items}}</div>
|
||||
<div class="size">{{previa.previousLines}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue