|
|
@ -1129,7 +1129,13 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; |
|
|
|
} |
|
|
|
if (Type == "2") |
|
|
|
{ |
|
|
|
return GetICSMOPickMergeByWorkorder(ID, WorkPoint); |
|
|
|
sqls = @"select
|
|
|
|
a.ApplyCode as Code, a.InvCode, b.InvName, b.InvStd, b.InvUnit, SUM(ISNULL(a.Quantity, 0)) AS iQuantity, a.WhCode,a.ExtensionID |
|
|
|
FROM |
|
|
|
ICSMOApply a |
|
|
|
LEFT JOIN ICSINVENTORY b ON a.InvCode = b.InvCode AND a.WorkPoint=b.WorkPoint |
|
|
|
WHERE a.ApplyCode in ({0}) AND a.WorkPoint = '{1}' |
|
|
|
GROUP BY a.ApplyCode,a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.WhCode,a.ExtensionID";
|
|
|
|
} |
|
|
|
if (Type == "3") |
|
|
|
{ |
|
|
@ -1304,14 +1310,14 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; |
|
|
|
} |
|
|
|
sqls = string.Format(sqls, ID, WorkPoint); |
|
|
|
|
|
|
|
string sql = $@"SELECT row_number() over (order by c.Code,c.InvCode,d.MTIME,d.LotNO) AS rowNo,
|
|
|
|
string sql = $@"SELECT row_number() over ( order by c.Code,c.InvCode,d.MTIME,d.LotNO) AS rowNo,
|
|
|
|
c.Code, |
|
|
|
c.InvCode, |
|
|
|
c.InvName, |
|
|
|
c.InvStd, |
|
|
|
c.InvUnit, |
|
|
|
FLOOR(c.iQuantity) AS iQuantity, |
|
|
|
d.WarehouseCode, |
|
|
|
c.WHCode AS WarehouseCode, |
|
|
|
d.LotNO, |
|
|
|
FLOOR(ISNULL(d.Quantity, 0)) AS QTY, |
|
|
|
d.LocationCode AS LocationCode, |
|
|
@ -1324,7 +1330,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; |
|
|
|
where d.LotNo=m.LotNo and d.WorkPoint=m.WorkPoint |
|
|
|
and d.WorkPoint='{WorkPoint}' AND d.Quantity>0 ) d |
|
|
|
on c.InvCode=d.INVCode AND c.WhCode=d.WarehouseCode and d.ExtensionID=c.ExtensionID |
|
|
|
LEFT JOIN (SELECT INVCode,WarehouseCode,SUM(Quantity) AS QTYTotal FROM ICSWareHouseLotInfo WHERE WorkPoint='1701' GROUP BY INVCode,WarehouseCode) f ON c.InvCode=f.INVCode AND c.WhCode=f.WarehouseCode |
|
|
|
LEFT JOIN (SELECT INVCode,WarehouseCode,SUM(Quantity) AS QTYTotal FROM ICSWareHouseLotInfo WHERE WorkPoint='{WorkPoint}' GROUP BY INVCode,WarehouseCode) f ON c.InvCode=f.INVCode AND c.WhCode=f.WarehouseCode |
|
|
|
order by c.Code,c.InvCode,d.MTIME ";
|
|
|
|
|
|
|
|
var dataset = Repository().FindDataSetBySql(sql); |
|
|
@ -1334,11 +1340,13 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; |
|
|
|
decimal qtyCount = 0; |
|
|
|
bool remove = false; |
|
|
|
List<int> removeList = new List<int>(); |
|
|
|
|
|
|
|
for (int i = 0; i < table.Rows.Count; i++) |
|
|
|
{ |
|
|
|
|
|
|
|
if (i != 0 |
|
|
|
&& !table.Rows[i]["InvCode"].ToString().Equals(table.Rows[i - 1]["InvCode"].ToString())) |
|
|
|
&& (!table.Rows[i]["InvCode"].ToString().Equals(table.Rows[i - 1]["InvCode"].ToString()) |
|
|
|
|| !table.Rows[i]["Code"].ToString().Equals(table.Rows[i - 1]["Code"].ToString())) |
|
|
|
) |
|
|
|
{ |
|
|
|
qtyCount = 0; |
|
|
|
remove = false; |
|
|
|