Merge pull request 'hotfix-sale_getProblems-líneas-redondeo' (!2674) from hotfix-sale_getProblems-líneas-redondeo into master
Reviewed-on: #2674 Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
commit
e202bea92f
|
@ -278,12 +278,11 @@ BEGIN
|
|||
-- Redondeo: Cantidad pedida incorrecta en al grouping de la última compra
|
||||
CALL buyUltimate(vWarehouseFk, vDate);
|
||||
INSERT INTO tmp.sale_problems(ticketFk, hasRounding, saleFk)
|
||||
SELECT ticketFk, problem, saleFk
|
||||
SELECT ticketFk, problem ,saleFk
|
||||
FROM (
|
||||
SELECT tl.ticketFk,
|
||||
s.id saleFk ,
|
||||
LEFT(GROUP_CONCAT('RE: ',i.id, ' ', IFNULL(i.longName,''), ' '), 250) problem,
|
||||
MOD(s.quantity, b.`grouping`) hasRounding
|
||||
s.id saleFk,
|
||||
LEFT(GROUP_CONCAT('RE: ',i.id, ' ', IFNULL(i.longName,'') SEPARATOR ', '), 250) problem
|
||||
FROM tmp.ticket_list tl
|
||||
JOIN ticket t ON t.id = tl.ticketFk
|
||||
AND t.warehouseFk = vWarehouseFk
|
||||
|
@ -291,9 +290,9 @@ BEGIN
|
|||
JOIN item i ON i.id = s.itemFk
|
||||
JOIN tmp.buyUltimate bu ON bu.itemFk = s.itemFk
|
||||
JOIN buy b ON b.id = bu.buyFk
|
||||
WHERE MOD(s.quantity, b.`grouping`)
|
||||
GROUP BY tl.ticketFk
|
||||
HAVING hasRounding
|
||||
) sub
|
||||
)sub
|
||||
ON DUPLICATE KEY UPDATE hasRounding = sub.problem, saleFk = sub.saleFk;
|
||||
END LOOP;
|
||||
CLOSE vCursor;
|
||||
|
|
Loading…
Reference in New Issue