#7965 - unifyProblems #2990
|
@ -6,6 +6,7 @@ BEGIN
|
|||
/**
|
||||
* 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
|
||||
* @table tmp.sale(saleFk) Identificadores de los sale a calcular
|
||||
* @return tmp.saleProblems
|
||||
*/
|
||||
|
@ -76,9 +77,9 @@ BEGIN
|
|||
AND av.calc_id = vAvailableCache
|
||||
LEFT JOIN tItemShelving tis ON tis.itemFk = i.id
|
||||
AND tis.warehouseFk = t.warehouseFk
|
||||
WHERE IFNULL(v.visible, 0) < s.quantity
|
||||
AND IFNULL(av.available, 0) < s.quantity
|
||||
AND IFNULL(tis.visible, 0) < s.quantity
|
||||
WHERE (v.visible < s.quantity AND v.visible IS NOT NULL)
|
||||
jgallego marked this conversation as resolved
Outdated
jgallego
commented
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 (av.available < s.quantity AND av.available IS NOT NULL)
|
||||
AND (tis.visible < s.quantity AND tis.visible IS NOT NULL)
|
||||
AND NOT s.isPicked
|
||||
AND NOT s.reserved
|
||||
AND ic.merchandise
|
||||
|
@ -101,8 +102,8 @@ BEGIN
|
|||
AND v.calc_id = vVisibleCache
|
||||
LEFT JOIN tItemShelving tis ON tis.itemFk = i.id
|
||||
AND tis.warehouseFk = t.warehouseFk
|
||||
WHERE IFNULL(v.visible, 0) >= s.quantity
|
||||
AND IFNULL(tis.visible, 0) < s.quantity
|
||||
WHERE (v.visible >= s.quantity AND v.visible IS NOT NULL)
|
||||
AND (tis.visible < s.quantity AND tis.visible IS NOT NULL)
|
||||
AND s.quantity > 0
|
||||
AND NOT s.isPicked
|
||||
AND NOT s.reserved
|
||||
|
@ -129,9 +130,9 @@ BEGIN
|
|||
AND av.calc_id = vAvailableCache
|
||||
LEFT JOIN tItemShelving tis ON tis.itemFk = i.id
|
||||
AND tis.warehouseFk = t.warehouseFk
|
||||
WHERE IFNULL(v.visible, 0) < s.quantity
|
||||
AND IFNULL(av.available, 0) >= s.quantity
|
||||
AND IFNULL(tis.visible, 0) < s.quantity
|
||||
WHERE (v.visible < s.quantity AND v.visible IS NOT NULL)
|
||||
AND (av.available < s.quantity AND av.available IS NOT NULL)
|
||||
AND (tis.visible < s.quantity AND tis.visible IS NOT NULL)
|
||||
AND s.quantity > 0
|
||||
AND NOT s.isPicked
|
||||
AND NOT s.reserved
|
||||
|
|
|
@ -6,6 +6,7 @@ BEGIN
|
|||
/**
|
||||
* 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
jgallego
commented
vIsTodayRelative falta descripcio vIsTodayRelative falta descripcio
|
||||
* @table tmp.ticket(ticketFk) Identificadores de los tickets a calcular
|
||||
* @return tmp.ticketProblems, tmp.saleProblems
|
||||
*/
|
||||
|
@ -71,23 +72,22 @@ BEGIN
|
|||
WHERE FIND_IN_SET('hasComponentLack', s.problem)
|
||||
GROUP BY s.ticketFk
|
||||
)SELECT tt.ticketFk,
|
||||
IF(FIND_IN_SET('isFreezed', t.problem), TRUE, FALSE) isFreezed,
|
||||
FIND_IN_SET('isFreezed', t.problem) isFreezed,
|
||||
t.risk,
|
||||
jgallego marked this conversation as resolved
Outdated
jgallego
commented
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,
|
||||
IF(FIND_IN_SET('hasHighRisk', t.problem), TRUE, FALSE) hasHighRisk,
|
||||
IF(FIND_IN_SET('hasTicketRequest', t.problem), TRUE, FALSE) hasTicketRequest,
|
||||
IF(FIND_IN_SET('isTaxDataChecked', t.problem), TRUE, FALSE) isTaxDataChecked,
|
||||
IF(FIND_IN_SET('isTooLittle', t.problem)
|
||||
FIND_IN_SET('hasRisk', t.problem) hasRisk,
|
||||
FIND_IN_SET('hasHighRisk', t.problem) hasHighRisk,
|
||||
FIND_IN_SET('hasTicketRequest', t.problem) hasTicketRequest,
|
||||
FIND_IN_SET('isTaxDataChecked', t.problem) isTaxDataChecked,
|
||||
FIND_IN_SET('isTooLittle', t.problem)
|
||||
AND util.VN_NOW() < (util.VN_CURDATE() +
|
||||
INTERVAL HOUR(zc.`hour`) HOUR) +
|
||||
INTERVAL MINUTE(zc.`hour`) MINUTE,
|
||||
TRUE, FALSE) isTooLittle,
|
||||
IF(c.businessTypeFk = 'VIP', TRUE, FALSE) isVip,
|
||||
IF(his.ticketFk IS NULL, FALSE, TRUE) hasItemShortage,
|
||||
IF(hid.ticketFk IS NULL, FALSE, TRUE) hasItemDelay,
|
||||
IF(hil.ticketFk IS NULL, FALSE, TRUE) hasItemLost,
|
||||
IF(hcl.ticketFk IS NULL, FALSE, TRUE) hasComponentLack,
|
||||
IF(hr.ticketFk IS NULL, FALSE, TRUE) hasRounding,
|
||||
INTERVAL MINUTE(zc.`hour`) MINUTE isTooLittle,
|
||||
c.businessTypeFk = 'VIP' isVip,
|
||||
NOT (his.ticketFk IS NULL) hasItemShortage,
|
||||
NOT (hid.ticketFk IS NULL) hasItemDelay,
|
||||
jgallego marked this conversation as resolved
Outdated
jgallego
commented
aci pots posar NOT i la comparacio aci pots posar NOT i la comparacio
|
||||
NOT (hil.ticketFk IS NULL) hasItemLost,
|
||||
NOT (hcl.ticketFk IS NULL) hasComponentLack,
|
||||
NOT (hr.ticketFk IS NULL) hasRounding,
|
||||
0 totalProblems
|
||||
FROM tmp.ticket tt
|
||||
JOIN vn.ticket t ON t.id = tt.ticketFk
|
||||
|
|
Loading…
Reference in New Issue
falta vIsTodayRelative