Browse Source

拣料过滤已出库行,并只计算剩余数量

master
陆晔 2 years ago
parent
commit
6c9190a84b
  1. 20
      WMS-BS/NFine.Application/WMS/PickMaterialApp.cs

20
WMS-BS/NFine.Application/WMS/PickMaterialApp.cs

@ -1643,11 +1643,11 @@ c.Sequence+'~'+a.Sequence as Sequence,
if (Type == "2" || Type == "12") if (Type == "2" || Type == "12")
{ {
sqls = @"select sqls = @"select
a.ApplyCode as Code,a.Sequence, a.InvCode, b.InvName, b.InvStd, b.InvUnit, SUM(ISNULL(a.Quantity, 0)) AS iQuantity, a.WhCode,a.ExtensionID
a.ApplyCode as Code,a.Sequence, a.InvCode, b.InvName, b.InvStd, b.InvUnit, (SUM(ISNULL(a.Quantity, 0))-SUM(ISNULL(a.IssueQuantity, 0))) AS iQuantity, a.WhCode,a.ExtensionID
FROM FROM
ICSMOApply a ICSMOApply a
LEFT JOIN ICSINVENTORY b ON a.InvCode = b.InvCode AND a.WorkPoint=b.WorkPoint LEFT JOIN ICSINVENTORY b ON a.InvCode = b.InvCode AND a.WorkPoint=b.WorkPoint
WHERE a.ApplyCode in ({0}) AND a.WorkPoint = '{1}'
WHERE a.ApplyCode in ({0}) AND a.WorkPoint = '{1}' AND ISNULL(a.Quantity, 0)>ISNULL(a.IssueQuantity, 0)
GROUP BY a.ApplyCode,a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.WhCode,a.ExtensionID,a.Sequence"; GROUP BY a.ApplyCode,a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.WhCode,a.ExtensionID,a.Sequence";
} }
if (Type == "3") if (Type == "3")
@ -1701,12 +1701,12 @@ a.Sequence,
b.InvName, b.InvName,
b.InvStd, b.InvStd,
b.InvUnit, b.InvUnit,
SUM(ISNULL(a.Quantity, 0)) AS iQuantity,
(SUM(ISNULL(a.Quantity, 0))-SUM(ISNULL(a.IssueQuantity,0))) AS iQuantity,
a.WhCode,a.ExtensionID a.WhCode,a.ExtensionID
FROM FROM
ICSOApply a ICSOApply a
LEFT JOIN ICSINVENTORY b ON a.InvCode = b.InvCode AND a.WorkPoint=b.WorkPoint LEFT JOIN ICSINVENTORY b ON a.InvCode = b.InvCode AND a.WorkPoint=b.WorkPoint
WHERE a.ApplyCode in ({0}) AND a.WorkPoint = '{1}'
WHERE a.ApplyCode in ({0}) AND a.WorkPoint = '{1}' AND ISNULL(a.Quantity, 0)>ISNULL(a.IssueQuantity, 0)
GROUP BY a.ApplyCode,a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.WhCode,a.ExtensionID,a.Sequence"; GROUP BY a.ApplyCode,a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.WhCode,a.ExtensionID,a.Sequence";
#endregion #endregion
} }
@ -1740,13 +1740,13 @@ a.Sequence,
b.InvName, b.InvName,
b.InvStd, b.InvStd,
b.InvUnit, b.InvUnit,
SUM(ISNULL(a.Quantity, 0)) AS iQuantity,
(SUM(ISNULL(a.Quantity, 0))-SUM(ISNULL(a.SDNQuantity, 0))) AS iQuantity,
a.WhCode, a.WhCode,
a.ExtensionID a.ExtensionID
FROM FROM
ICSSDN a ICSSDN a
LEFT JOIN ICSINVENTORY b ON a.InvCode = b.InvCode AND a.WorkPoint=b.WorkPoint LEFT JOIN ICSINVENTORY b ON a.InvCode = b.InvCode AND a.WorkPoint=b.WorkPoint
WHERE a.SDNCode in ({0}) AND a.WorkPoint = '{1}'
WHERE a.SDNCode in ({0}) AND a.WorkPoint = '{1}' AND ISNULL(a.Quantity, 0)>ISNULL(a.SDNQuantity, 0)
GROUP BY a.SDNCode,a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.WhCode,a.ExtensionID,a.Sequence"; GROUP BY a.SDNCode,a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.WhCode,a.ExtensionID,a.Sequence";
#endregion #endregion
} }
@ -1760,13 +1760,13 @@ a.Sequence,
b.InvName, b.InvName,
b.InvStd, b.InvStd,
b.InvUnit, b.InvUnit,
SUM(ISNULL(a.Quantity, 0)) AS iQuantity,
(SUM(ISNULL(a.Quantity, 0))-SUM(ISNULL(a.OutQuantity, 0))) AS iQuantity,
a.WhCode, a.WhCode,
a.ExtensionID a.ExtensionID
FROM FROM
ICSOtherOut a ICSOtherOut a
LEFT JOIN ICSINVENTORY b ON a.InvCode = b.InvCode AND a.WorkPoint=b.WorkPoint LEFT JOIN ICSINVENTORY b ON a.InvCode = b.InvCode AND a.WorkPoint=b.WorkPoint
WHERE a.OutCode in ({0}) AND a.WorkPoint = '{1}'
WHERE a.OutCode in ({0}) AND a.WorkPoint = '{1}' AND ISNULL(a.Quantity, 0)>ISNULL(a.OutQuantity, 0)
GROUP BY a.OutCode,a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.WhCode,a.ExtensionID,a.Sequence"; GROUP BY a.OutCode,a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.WhCode,a.ExtensionID,a.Sequence";
#endregion #endregion
} }
@ -1800,13 +1800,13 @@ a.Sequence,
b.InvName, b.InvName,
b.InvStd, b.InvStd,
b.InvUnit, b.InvUnit,
SUM(ISNULL(a.Quantity, 0)) AS iQuantity,
(SUM(ISNULL(a.Quantity, 0))-SUM(ISNULL(a.TransferQuantity, 0))) AS iQuantity,
a.FromWarehouseCode as WhCode, a.FromWarehouseCode as WhCode,
a.ExtensionID a.ExtensionID
FROM FROM
ICSTransfer a ICSTransfer a
LEFT JOIN ICSINVENTORY b ON a.InvCode = b.InvCode AND a.WorkPoint=b.WorkPoint LEFT JOIN ICSINVENTORY b ON a.InvCode = b.InvCode AND a.WorkPoint=b.WorkPoint
WHERE a.TransferNO in ({0}) AND a.WorkPoint = '{1}'
WHERE a.TransferNO in ({0}) AND a.WorkPoint = '{1}' AND ISNULL(a.Quantity, 0)>ISNULL(a.TransferQuantity, 0)
GROUP BY a.TransferNO,a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.FromWarehouseCode,a.ExtensionID,a.Sequence"; GROUP BY a.TransferNO,a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.FromWarehouseCode,a.ExtensionID,a.Sequence";
#endregion #endregion
} }

Loading…
Cancel
Save