fix: ticket #216260 buy_recalcPrices #2916

Merged
robert merged 7 commits from ticket216260-buy_recalcPrices into master 2024-09-05 05:39:26 +00:00
1 changed files with 4 additions and 2 deletions
Showing only changes of commit 297eb30395 - Show all commits

View File

@ -17,7 +17,7 @@ BEGIN
JOIN entry e ON e.id = b.entryFk JOIN entry e ON e.id = b.entryFk
JOIN travel t ON t.id = e.travelFk JOIN travel t ON t.id = e.travelFk
JOIN warehouse w ON w.id = t.warehouseInFk JOIN warehouse w ON w.id = t.warehouseInFk
GROUP BY t.landed, t.warehouseInFk, (w.code = 'flm'); GROUP BY t.landed, t.warehouseInFk;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
@ -48,7 +48,9 @@ BEGIN
b.packageValue = @EF:= IF(vIsWarehouseFloramondo, 0, IFNULL(ROUND(IF(p.isPackageReturnable, p.returnCost / b.packing , p.`value` / b.packing), 3),0)), b.packageValue = @EF:= IF(vIsWarehouseFloramondo, 0, IFNULL(ROUND(IF(p.isPackageReturnable, p.returnCost / b.packing , p.`value` / b.packing), 3),0)),
b.price3 = @t3:= IF(r.rate3 = 0, b.buyingValue,ROUND((b.buyingValue + @CF + @EF + @PF) / ((100 - r.rate3 - it.promo ) /100) ,2)), -- He añadido que el coste sea igual a tarifa3 si t3 = 0 b.price3 = @t3:= IF(r.rate3 = 0, b.buyingValue,ROUND((b.buyingValue + @CF + @EF + @PF) / ((100 - r.rate3 - it.promo ) /100) ,2)), -- He añadido que el coste sea igual a tarifa3 si t3 = 0
b.price2 = @t2:= round(@t3 * (1 + ((r.rate2 - r.rate3)/100)),2), b.price2 = @t2:= round(@t3 * (1 + ((r.rate2 - r.rate3)/100)),2),
b.price2 = @t2:= IF(@t2 <= @t3,@t3 , @t2); b.price2 = @t2:= IF(@t2 <= @t3,@t3 , @t2)
WHERE t.landed = vLanded
AND t.warehouseInFk = vWarehouseFk;
DROP TEMPORARY TABLE tmp.rate; DROP TEMPORARY TABLE tmp.rate;
END LOOP; END LOOP;