|
版本: |
BeX5V3.5 |
小版本号: |
|
|
|
数据库: |
MySQL |
服务器操作系统: |
Windows |
应用服务器: |
Tomcat |
客户端操作系统: |
Windows 7 |
浏览器: |
IE9 |
|
|
本帖最后由 mabaor 于 2016-12-15 06:49 编辑
KSQL语句为下:
select FI_WhPosition.*,(customSub1.fInboundSum) as fInboundSum,(customSub4.fOutboundSum) as fOutboundSum,( SQL.IFNULL(customSub1.fInboundSum, 0) - SQL.IFNULL(customSub4.fOutboundSum, 0) ) as fcurrentStock
from FI_WhPosition FI_WhPosition optional
join (select FI_articleMoveDetail.fReceiverPositionID as fReceiverPositionID, (sum(FI_articleMoveDetail.fQuantity)) as fInboundSum from FI_articleMove FI_articleMove
join FI_articleMoveDetail FI_articleMoveDetail on FI_articleMove = FI_articleMoveDetail.fMainID
where FI_articleMove.fReceiverID = :p AND FI_articleMoveDetail.farticleID = :q AND FI_articleMove.fType = '入库单' AND FI_articleMove.fProcState = '已完成'
group by FI_articleMoveDetail.fReceiverPositionID) customSub1 on FI_WhPosition = customSub1.fReceiverPositionID optional
join (select FI_articleMoveDetail.fSenderPositionID as fSenderPositionID, (sum(FI_articleMoveDetail.fQuantity)) as fOutboundSum from FI_articleMove FI_articleMove
join FI_articleMoveDetail FI_articleMoveDetail on FI_articleMove = FI_articleMoveDetail.fMainID where FI_articleMove.fSenderID = :p AND FI_articleMoveDetail.farticleID = :q AND FI_articleMove.fType = '出库单' AND ( FI_articleMove.fProcState = '已完成' OR FI_articleMove.fProcState = '进行中' )
group by FI_articleMoveDetail.fSenderPositionID) customSub4 on FI_WhPosition = customSub4.fSenderPositionID where SQL.IFNULL(customSub1.fInboundSum, 0) - SQL.IFNULL(customSub4.fOutboundSum, 0) > 0
为空,库存无数据.
删除俩处的 AND FI_articleMoveDetail.farticleID = :q后,出库货位可用库存为空,
|
-
无可用库存
-
库存无数据
|