From 4b5802202ddb0b20a2dc93f4b3bfc8769a864849 Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 12 Feb 2024 10:36:09 +0100 Subject: [PATCH] refactor: refs #6501 Minor change --- .../vn/procedures/entry_getTransfer.sql | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/db/routines/vn/procedures/entry_getTransfer.sql b/db/routines/vn/procedures/entry_getTransfer.sql index 426619463..10f14c681 100644 --- a/db/routines/vn/procedures/entry_getTransfer.sql +++ b/db/routines/vn/procedures/entry_getTransfer.sql @@ -120,6 +120,7 @@ BEGIN COALESCE(b2.packing, b.packing) packing, COALESCE(b3.groupingMode, b2.groupingMode, b.groupingMode) package, IFNULL(p.name, s.nickname) productor, + TRUE tinta, b.packagingFk, b2.id buyFk, b2.stickers, @@ -136,8 +137,8 @@ BEGIN e.commission, pa.isPackageReturnable, IFNULL(pa2.value, pa.value) `value`, - r.rate3, - r.rate2, + r.r3, + r.r2, it.promo, b.`grouping` groupingOrigin, b.packing packingOrigin, @@ -179,11 +180,17 @@ BEGIN SELECT *, quantity - MOD(quantity , `grouping`) subQuantity, MOD(quantity, `grouping`) soll, - ROUND((IF(volume > 0,volume, width * `depth` * IF(height = 0, `size` + 10, height))) / packing, 0) cm3, + ROUND((IF(volume > 0,volume, width * `depth` * + IF(height = 0, `size` + 10, height))) / + packing, 0) cm3, buyingValue + comissionValue + freightValue cost, - @carriage := ROUND((IF(volume > 0, volume, width * `depth` * IF(height = 0, `size` + 10, height))) * m3 / 1000000 / Packing, 3) carriage, - @comission := ROUND((buyingValue + comissionValue + freightValue) * commission / 100, 3) commission, - ROUND(@packaging := (returnCost + IF(isPackageReturnable != 0, 0, value)) / packing, 3) packaging, + @carriage := ROUND((IF(volume > 0, volume, width * `depth` * + IF(height = 0, `size` + 10, height))) * + m3 / 1000000 / Packing, 3) carriage, + @comission := ROUND((buyingValue + comissionValue + freightValue) * + commission / 100, 3) commission, + ROUND(@packaging := (returnCost + IF(isPackageReturnable != 0, 0, value)) + / packing, 3) packaging, @cost := IFNULL((buyingValue + comissionValue + freightValue), 0) + IFNULL(@packaging, 0) + IFNULL(@carriage, 0) +