#7965 - unifyProblems #2990

Merged
jon merged 20 commits from 7965-unifyProblems into dev 2025-02-05 06:51:55 +00:00
2 changed files with 46 additions and 45 deletions
Showing only changes of commit 8f99b14510 - Show all commits

View File

@ -6,6 +6,7 @@ BEGIN
/** /**
* Calcula los problemas para un conjunto de sale * Calcula los problemas para un conjunto de sale
* *
* @param vIsTodayRelative Indica si se calcula el disponible como si todo saliera hoy
jgallego marked this conversation as resolved Outdated

falta vIsTodayRelative

falta vIsTodayRelative
* @table tmp.sale(saleFk) Identificadores de los sale a calcular * @table tmp.sale(saleFk) Identificadores de los sale a calcular
* @return tmp.saleProblems * @return tmp.saleProblems
*/ */
@ -76,9 +77,9 @@ BEGIN
AND av.calc_id = vAvailableCache AND av.calc_id = vAvailableCache
LEFT JOIN tItemShelving tis ON tis.itemFk = i.id LEFT JOIN tItemShelving tis ON tis.itemFk = i.id
AND tis.warehouseFk = t.warehouseFk AND tis.warehouseFk = t.warehouseFk
WHERE IFNULL(v.visible, 0) < s.quantity WHERE (v.visible < s.quantity AND v.visible IS NOT NULL)
jgallego marked this conversation as resolved Outdated

ja posats canvia el IFNULL que en la convencio ja no esta acceptat

ja posats canvia el IFNULL que en la convencio ja no esta acceptat
AND IFNULL(av.available, 0) < s.quantity AND (av.available < s.quantity AND av.available IS NOT NULL)
AND IFNULL(tis.visible, 0) < s.quantity AND (tis.visible < s.quantity AND tis.visible IS NOT NULL)
AND NOT s.isPicked AND NOT s.isPicked
AND NOT s.reserved AND NOT s.reserved
AND ic.merchandise AND ic.merchandise
@ -101,8 +102,8 @@ BEGIN
AND v.calc_id = vVisibleCache AND v.calc_id = vVisibleCache
LEFT JOIN tItemShelving tis ON tis.itemFk = i.id LEFT JOIN tItemShelving tis ON tis.itemFk = i.id
AND tis.warehouseFk = t.warehouseFk AND tis.warehouseFk = t.warehouseFk
WHERE IFNULL(v.visible, 0) >= s.quantity WHERE (v.visible >= s.quantity AND v.visible IS NOT NULL)
AND IFNULL(tis.visible, 0) < s.quantity AND (tis.visible < s.quantity AND tis.visible IS NOT NULL)
AND s.quantity > 0 AND s.quantity > 0
AND NOT s.isPicked AND NOT s.isPicked
AND NOT s.reserved AND NOT s.reserved
@ -129,9 +130,9 @@ BEGIN
AND av.calc_id = vAvailableCache AND av.calc_id = vAvailableCache
LEFT JOIN tItemShelving tis ON tis.itemFk = i.id LEFT JOIN tItemShelving tis ON tis.itemFk = i.id
AND tis.warehouseFk = t.warehouseFk AND tis.warehouseFk = t.warehouseFk
WHERE IFNULL(v.visible, 0) < s.quantity WHERE (v.visible < s.quantity AND v.visible IS NOT NULL)
AND IFNULL(av.available, 0) >= s.quantity AND (av.available < s.quantity AND av.available IS NOT NULL)
AND IFNULL(tis.visible, 0) < s.quantity AND (tis.visible < s.quantity AND tis.visible IS NOT NULL)
AND s.quantity > 0 AND s.quantity > 0
AND NOT s.isPicked AND NOT s.isPicked
AND NOT s.reserved AND NOT s.reserved

View File

@ -6,6 +6,7 @@ BEGIN
/** /**
* Calcula los problemas para un conjunto de tickets. * Calcula los problemas para un conjunto de tickets.
* *
* @param vIsTodayRelative Indica si se calcula el disponible como si todo saliera hoy
jgallego marked this conversation as resolved Outdated

vIsTodayRelative falta descripcio

vIsTodayRelative falta descripcio
* @table tmp.ticket(ticketFk) Identificadores de los tickets a calcular * @table tmp.ticket(ticketFk) Identificadores de los tickets a calcular
* @return tmp.ticketProblems, tmp.saleProblems * @return tmp.ticketProblems, tmp.saleProblems
*/ */
@ -71,23 +72,22 @@ BEGIN
WHERE FIND_IN_SET('hasComponentLack', s.problem) WHERE FIND_IN_SET('hasComponentLack', s.problem)
GROUP BY s.ticketFk GROUP BY s.ticketFk
)SELECT tt.ticketFk, )SELECT tt.ticketFk,
IF(FIND_IN_SET('isFreezed', t.problem), TRUE, FALSE) isFreezed, FIND_IN_SET('isFreezed', t.problem) isFreezed,
t.risk, t.risk,
jgallego marked this conversation as resolved Outdated

es posible que el if sobre si true es true, asignau directament no?

es posible que el if sobre si true es true, asignau directament no?
IF(FIND_IN_SET('hasRisk', t.problem), TRUE, FALSE) hasRisk, FIND_IN_SET('hasRisk', t.problem) hasRisk,
IF(FIND_IN_SET('hasHighRisk', t.problem), TRUE, FALSE) hasHighRisk, FIND_IN_SET('hasHighRisk', t.problem) hasHighRisk,
IF(FIND_IN_SET('hasTicketRequest', t.problem), TRUE, FALSE) hasTicketRequest, FIND_IN_SET('hasTicketRequest', t.problem) hasTicketRequest,
IF(FIND_IN_SET('isTaxDataChecked', t.problem), TRUE, FALSE) isTaxDataChecked, FIND_IN_SET('isTaxDataChecked', t.problem) isTaxDataChecked,
IF(FIND_IN_SET('isTooLittle', t.problem) FIND_IN_SET('isTooLittle', t.problem)
AND util.VN_NOW() < (util.VN_CURDATE() + AND util.VN_NOW() < (util.VN_CURDATE() +
INTERVAL HOUR(zc.`hour`) HOUR) + INTERVAL HOUR(zc.`hour`) HOUR) +
INTERVAL MINUTE(zc.`hour`) MINUTE, INTERVAL MINUTE(zc.`hour`) MINUTE isTooLittle,
TRUE, FALSE) isTooLittle, c.businessTypeFk = 'VIP' isVip,
IF(c.businessTypeFk = 'VIP', TRUE, FALSE) isVip, NOT (his.ticketFk IS NULL) hasItemShortage,
IF(his.ticketFk IS NULL, FALSE, TRUE) hasItemShortage, NOT (hid.ticketFk IS NULL) hasItemDelay,
jgallego marked this conversation as resolved Outdated

aci pots posar NOT i la comparacio

aci pots posar NOT i la comparacio
IF(hid.ticketFk IS NULL, FALSE, TRUE) hasItemDelay, NOT (hil.ticketFk IS NULL) hasItemLost,
IF(hil.ticketFk IS NULL, FALSE, TRUE) hasItemLost, NOT (hcl.ticketFk IS NULL) hasComponentLack,
IF(hcl.ticketFk IS NULL, FALSE, TRUE) hasComponentLack, NOT (hr.ticketFk IS NULL) hasRounding,
IF(hr.ticketFk IS NULL, FALSE, TRUE) hasRounding,
0 totalProblems 0 totalProblems
FROM tmp.ticket tt FROM tmp.ticket tt
JOIN vn.ticket t ON t.id = tt.ticketFk JOIN vn.ticket t ON t.id = tt.ticketFk