|
@@ -12,7 +12,7 @@
|
|
|
wp.moq as moq,
|
|
wp.moq as moq,
|
|
|
wp.inventoryWarningQuantity as inventoryWarningQuantity,
|
|
wp.inventoryWarningQuantity as inventoryWarningQuantity,
|
|
|
wp.warningCoefficient as warningCoefficient,
|
|
wp.warningCoefficient as warningCoefficient,
|
|
|
- wp.inventory as surplusInventory,
|
|
|
|
|
|
|
+ ifnull(wp.inventory, 0) as surplusInventory,
|
|
|
wp.warehouseInfoId as warehouseId
|
|
wp.warehouseInfoId as warehouseId
|
|
|
from yr_warehouse_info as wi
|
|
from yr_warehouse_info as wi
|
|
|
left join yr_warehouse_product as wp on wi.id = wp.warehouseInfoId
|
|
left join yr_warehouse_product as wp on wi.id = wp.warehouseInfoId
|
|
@@ -56,7 +56,7 @@
|
|
|
wp.warningCoefficient as warningCoefficient,
|
|
wp.warningCoefficient as warningCoefficient,
|
|
|
round(wp.inventoryWarningQuantity * wp.warningCoefficient, 0) as warningQuantity,
|
|
round(wp.inventoryWarningQuantity * wp.warningCoefficient, 0) as warningQuantity,
|
|
|
ifnull(dg.machineInventory, 0) as machineInventory,
|
|
ifnull(dg.machineInventory, 0) as machineInventory,
|
|
|
- round(wp.surplusInventory / wp.unboxingPriority, 2) as surplusInventory,
|
|
|
|
|
|
|
+ ifnull(round(wp.surplusInventory / ifnull(wp.unboxingPriority, 1), 2), 0) as surplusInventory,
|
|
|
ifnull(dg.upShelfNum, 0) as upShelfNum,
|
|
ifnull(dg.upShelfNum, 0) as upShelfNum,
|
|
|
CASE
|
|
CASE
|
|
|
WHEN round(wp.surplusInventory / nullif(wp.unboxingPriority, 0), 2) >=
|
|
WHEN round(wp.surplusInventory / nullif(wp.unboxingPriority, 0), 2) >=
|