This commit is contained in:
parent
23bf9b2750
commit
4b5802202d
|
@ -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) +
|
||||
|
|
Loading…
Reference in New Issue