fix: ticket #216260 buy_recalcPrices #2916
|
@ -17,7 +17,7 @@ BEGIN
|
|||
JOIN entry e ON e.id = b.entryFk
|
||||
JOIN travel t ON t.id = e.travelFk
|
||||
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;
|
||||
|
||||
|
@ -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.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:= 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;
|
||||
END LOOP;
|
||||
|
|
Loading…
Reference in New Issue