fix: refs #7760 tmp.ticketIPT
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
91fac11fa0
commit
750b83bb45
|
@ -105,7 +105,7 @@ proc: BEGIN
|
|||
AND DATE(t.shipped) = zc.dated
|
||||
LEFT JOIN ticketParking tp ON tp.ticketFk = t.id
|
||||
LEFT JOIN parking pk ON pk.id = tp.parkingFk
|
||||
LEFT JOIN tmp.ticketProblem tpr ON tpr.ticketFk = tt.ticketFk
|
||||
LEFT JOIN tmp.ticketProblems tpr ON tpr.ticketFk = tt.ticketFk
|
||||
WHERE t.warehouseFk = vWarehouseFk
|
||||
AND dm.code IN ('AGENCY', 'DELIVERY', 'PICKUP');
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ BEGIN
|
|||
* Calcula los problemas para un conjunto de tickets.
|
||||
* Agrupados por ticket
|
||||
*
|
||||
* @table tmp.tmp.ticket(ticketFk) Identificadores de los tickets a calcular
|
||||
* @table tmp.ticket(ticketFk) Identificadores de los tickets a calcular
|
||||
* @return tmp.ticketProblems
|
||||
*/
|
||||
DECLARE vWarehouseFk INT;
|
||||
|
@ -163,7 +163,7 @@ BEGIN
|
|||
END LOOP;
|
||||
CLOSE vCursor;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.ticketProblem (
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.ticketProblems (
|
||||
ticketFk INT(11),
|
||||
isFreezed BOOL DEFAULT FALSE,
|
||||
risk DECIMAL(10,1) DEFAULT 0,
|
||||
|
@ -199,13 +199,18 @@ BEGIN
|
|||
LEFT(CONCAT('F: ',GROUP_CONCAT(CONCAT(i.id, ' ', i.longName) SEPARATOR ', ')), 250) itemShortage,
|
||||
LEFT(CONCAT('R: ',GROUP_CONCAT(CONCAT(i2.id, ' ', i2.longName) SEPARATOR ', ')), 250) itemDelay,
|
||||
LEFT(CONCAT('I: ',GROUP_CONCAT(CONCAT(i3.id, ' ', i3.longName) SEPARATOR ', ')), 250) itemLost,
|
||||
LEFT(CONCAT('RE: ',GROUP_CONCAT(CONCAT(i4.id, ' ', i4.longName) SEPARATOR ', ')), 250) componentLack,
|
||||
LEFT(CONCAT('C: ',GROUP_CONCAT(CONCAT(i4.id, ' ', i4.longName) SEPARATOR ', ')), 250) componentLack,
|
||||
LEFT(CONCAT('RE: ',GROUP_CONCAT(CONCAT(i5.id, ' ', i5.longName) SEPARATOR ', ')), 250) rounding
|
||||
FROM tmp.ticket tt
|
||||
JOIN ticket t ON t.id = tt.ticketFk
|
||||
JOIN client c ON c.id = t.clientFk
|
||||
LEFT JOIN sale s ON s.ticketFk = t.id
|
||||
LEFT JOIN tmp.saleProblems ts ON ts.saleFk = s.id
|
||||
LEFT JOIN item i ON i.id = s.itemFk AND ts.hasItemShortage
|
||||
LEFT JOIN item i2 ON i2.id = s.itemFk AND ts.hasItemDelay
|
||||
LEFT JOIN item i3 ON i3.id = s.itemFk AND ts.hasItemLost
|
||||
LEFT JOIN item i4 ON i4.id = s.itemFk AND FIND_IN_SET('hasComponentLack', s.problem)
|
||||
LEFT JOIN item i5 ON i5.id = s.itemFk AND ts.hasRounding
|
||||
LEFT JOIN zoneClosure zc ON zc.zoneFk = t.zoneFk
|
||||
AND zc.dated = util.VN_CURDATE()
|
||||
WHERE s.problem <> '' OR t.problem <> '' OR t.risk
|
||||
|
|
|
@ -376,7 +376,7 @@ module.exports = Self => {
|
|||
stmts.push(`
|
||||
DROP TEMPORARY TABLE
|
||||
tmp.filter,
|
||||
tmp.ticketProblem,
|
||||
tmp.ticketProblems,
|
||||
tmp.sale_getWarnings,
|
||||
tmp.ticket_warnings
|
||||
`);
|
||||
|
|
Loading…
Reference in New Issue