@ -79,7 +79,7 @@ namespace NFine.Application.WMS
string sql = @ " select a.ID,b.MOCode as Code,a.Sequence+'-'+b.Sequence AS Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,c.WarehouseName,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . IssueQuantity as IssueQuantity
from ICSMOPick a
left join ICSMO b on a . MODetailID = b . MODetailID and a . WorkPoint = b . WorkPoint
@ -153,7 +153,7 @@ where b.MOCode='{0}' and a.WorkPoint='{1}'";
string sql = @ "select a.ID,a.ApplyCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseName ,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . IssueQuantity as IssueQuantity
from ICSMOApply a
left join ICSWarehouse b on a . WHCode = b . WarehouseCode and a . WorkPoint = b . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
@ -227,7 +227,7 @@ where b.MOCode='{0}' and a.WorkPoint='{1}'";
string sql = @ "select a.ID,a.IssueCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode ,b.WarehouseName ,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . IssueQuantity as IssueQuantity
from ICSMOIssue a
left join ICSWarehouse b on a . WHCode = b . WarehouseCode and a . WorkPoint = b . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
@ -292,7 +292,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
string sql = @ "select a.ID,b.OOCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,c.WarehouseName ,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . IssueQuantity as IssueQuantity
from ICSOOPick a
left join ICSOutsourcingOrder b on a . OODetailID = b . OODetailID and a . WorkPoint = b . WorkPoint
left join ICSWarehouse c on a . WHCode = c . WarehouseCode and a . WorkPoint = c . WorkPoint
@ -362,7 +362,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
string sql = @ "select a.ID,a.ApplyCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseName,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . IssueQuantity as IssueQuantity
from ICSOApply a
left join ICSWarehouse b on a . WHCode = b . WarehouseCode and a . WorkPoint = b . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
@ -436,7 +436,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
string sql = @ "select a.ID,a.IssueCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseCode,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . IssueQuantity as IssueQuantity
from ICSOIssue a
left join ICSWarehouse b on a . WHCode = b . WarehouseCode and a . WorkPoint = b . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
@ -512,7 +512,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
string sql = @ "select a.ID,a.SDNCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseName,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . SDNQuantity as IssueQuantity
from ICSSDN a
left join ICSWarehouse b on a . WHCode = b . WarehouseCode and a . WorkPoint = b . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
@ -584,7 +584,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
string sql = @ "select a.ID,a.OutCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseName,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . OutQuantity as IssueQuantity
from ICSOtherOut a
left join ICSWarehouse b on a . WHCode = b . WarehouseCode and a . WorkPoint = b . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
@ -657,7 +657,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
string sql = @ "select a.ID,a.BrrowCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseName,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . BrrowQuantity as IssueQuantity
from ICSBrrow a
left join ICSWarehouse b on a . WHCode = b . WarehouseCode and a . WorkPoint = b . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
@ -727,7 +727,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
string sql = @ "select a.ID,a.TransferNO as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.FromWarehouseCode as WHCode,b.WarehouseName,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . TransferQuantity as IssueQuantity
from ICSTransfer a
left join ICSWarehouse b on a . FromWarehouseCode = b . WarehouseCode and a . WorkPoint = b . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
@ -799,7 +799,7 @@ where a.WorkPoint='{0}' and a.Status='2'
string sql = @ " select a.ID,a.OutCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode ,b.WarehouseName,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . OutQuantity as IssueQuantity
FROM ICSOtherOut a
INNER JOIN ICSTransfer tra ON a . TransferDetailID = tra . TransferDetailID AND a . WorkPoint = tra . WorkPoint
left join ICSWarehouse b on a . WHCode = b . WarehouseCode and a . WorkPoint = b . WorkPoint
@ -824,6 +824,7 @@ where a.WorkPoint='{0}' and a.Status='2'
c . InvCode ,
c . InvName ,
c . InvStd ,
c . InvUnit ,
FLOOR ( c . iQuantity ) AS iQuantity ,
d . WarehouseCode ,
d . LocationCode ,
@ -893,13 +894,14 @@ DROP TABLE #temp
b . InvStd ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
b . InvUnit ,
a . ExtensionID
FROM
ICSMOPick a
inner join ICSMO c on a . MODetailID = c . MODetailID and a . WorkPoint = c . WorkPoint
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE c . MOCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY c . MOCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , a . ExtensionID ";
GROUP BY c . MOCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID ";
#endregion
}
if ( Type = = "2" )
@ -910,6 +912,7 @@ DROP TABLE #temp
a . InvCode ,
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -917,7 +920,7 @@ DROP TABLE #temp
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 , a . WhCode , a . ExtensionID ";
GROUP BY a . ApplyCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID ";
#endregion
}
if ( Type = = "3" )
@ -928,6 +931,7 @@ DROP TABLE #temp
a . InvCode ,
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -935,7 +939,7 @@ DROP TABLE #temp
ICSMOIssue a
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE a . IssueCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . IssueCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , a . ExtensionID ";
GROUP BY a . IssueCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID ";
#endregion
}
if ( Type = = "4" )
@ -946,6 +950,7 @@ DROP TABLE #temp
a . InvCode ,
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -954,7 +959,7 @@ DROP TABLE #temp
left join ICSOutsourcingOrder c on a . OODetailID = c . OODetailID and a . WorkPoint = c . WorkPoint
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE c . OOCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY c . OOCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , a . ExtensionID ";
GROUP BY c . OOCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID ";
#endregion
}
if ( Type = = "5" )
@ -965,6 +970,7 @@ DROP TABLE #temp
a . InvCode ,
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -972,7 +978,7 @@ DROP TABLE #temp
ICSOApply 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 , a . WhCode , a . ExtensionID ";
GROUP BY a . ApplyCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID ";
#endregion
}
if ( Type = = "6" )
@ -983,6 +989,7 @@ DROP TABLE #temp
a . InvCode ,
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -990,7 +997,7 @@ a.ExtensionID
ICSOIssue a
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE a . IssueCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . IssueCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , a . ExtensionID ";
GROUP BY a . IssueCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID ";
#endregion
}
if ( Type = = "7" )
@ -1001,6 +1008,7 @@ a.ExtensionID
a . InvCode ,
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -1008,7 +1016,7 @@ a.ExtensionID
ICSSDN a
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE a . SDNCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . SDNCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , a . ExtensionID ";
GROUP BY a . SDNCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID ";
#endregion
}
if ( Type = = "8" )
@ -1019,6 +1027,7 @@ a.ExtensionID
a . InvCode ,
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -1026,7 +1035,7 @@ a.ExtensionID
ICSOtherOut a
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE a . OutCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . OutCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , a . ExtensionID ";
GROUP BY a . OutCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID ";
#endregion
}
if ( Type = = "9" )
@ -1038,6 +1047,7 @@ a.ExtensionID
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -1045,7 +1055,7 @@ a.ExtensionID
ICSBrrow a
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE a . BrrowCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . BrrowCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , a . ExtensionID ";
GROUP BY a . BrrowCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID ";
#endregion
}
if ( Type = = "10" )
@ -1057,6 +1067,7 @@ a.ExtensionID
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . FromWarehouseCode as WhCode ,
a . ExtensionID
@ -1064,7 +1075,7 @@ a.ExtensionID
ICSTransfer a
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE a . TransferNO in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . TransferNO , a . InvCode , b . InvName , b . InvStd , a . FromWarehouseCode , a . ExtensionID ";
GROUP BY a . TransferNO , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . FromWarehouseCode , a . ExtensionID ";
#endregion
}
if ( Type = = "11" )
@ -1076,6 +1087,7 @@ a.ExtensionID
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WHCode ,
a . ExtensionID
@ -1083,7 +1095,7 @@ a.ExtensionID
INNER JOIN ICSTransfer tra ON a . TransferDetailID = tra . TransferDetailID AND a . WorkPoint = tra . WorkPoint
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE a . OutCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . OutCode , a . InvCode , b . InvName , b . InvStd , a . WHCode , a . ExtensionID ";
GROUP BY a . OutCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WHCode , a . ExtensionID ";
#endregion
}
@ -1123,6 +1135,7 @@ a.ExtensionID
c . InvCode ,
c . InvName ,
c . InvStd ,
c . InvUnit ,
FLOOR ( c . iQuantity ) AS iQuantity ,
d . WarehouseCode ,
d . LocationCode ,
@ -1191,6 +1204,7 @@ DROP TABLE #temp
a . InvCode ,
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -1200,7 +1214,7 @@ a.ExtensionID
inner join ICSMO c on a . MODetailID = c . MODetailID and a . WorkPoint = c . WorkPoint
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE c . MOCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY c . MOCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , x . MergeID , a . ExtensionID ";
GROUP BY c . MOCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , x . MergeID , a . ExtensionID ";
#endregion
}
if ( Type = = "2" )
@ -1212,6 +1226,7 @@ a.ExtensionID
a . InvCode ,
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -1220,7 +1235,7 @@ a.ExtensionID
inner join ICSMOPickMerge x on a . ID = x . SourceID and a . WorkPoint = x . WorkPoint
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE x . SourceID in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . ApplyCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , x . MergeID , a . ExtensionID ";
GROUP BY a . ApplyCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , x . MergeID , a . ExtensionID ";
#endregion
}
if ( Type = = "3" )
@ -1233,6 +1248,7 @@ a.ExtensionID
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -1241,7 +1257,7 @@ a.ExtensionID
inner join ICSMOPickMerge x on a . ID = x . SourceID and a . WorkPoint = x . WorkPoint
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE a . IssueCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . IssueCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , a . ExtensionID , x . MergeID ";
GROUP BY a . IssueCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID , x . MergeID ";
#endregion
}
if ( Type = = "4" )
@ -1253,6 +1269,7 @@ a.ExtensionID
a . InvCode ,
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -1262,7 +1279,7 @@ a.ExtensionID
left join ICSOutsourcingOrder c on a . OODetailID = c . OODetailID and a . WorkPoint = c . WorkPoint
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE c . OOCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY c . OOCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , a . ExtensionID , x . MergeID ";
GROUP BY c . OOCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID , x . MergeID ";
#endregion
}
if ( Type = = "5" )
@ -1275,6 +1292,7 @@ a.ExtensionID
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -1283,7 +1301,7 @@ a.ExtensionID
inner join ICSMOPickMerge x on a . ID = x . SourceID and a . WorkPoint = x . WorkPoint
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 , a . WhCode , a . ExtensionID , x . MergeID ";
GROUP BY a . ApplyCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID , x . MergeID ";
#endregion
}
if ( Type = = "6" )
@ -1296,6 +1314,7 @@ a.ExtensionID
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -1304,7 +1323,7 @@ a.ExtensionID
inner join ICSMOPickMerge x on a . ID = x . SourceID and a . WorkPoint = x . WorkPoint
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE a . IssueCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . IssueCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , a . ExtensionID , x . MergeID ";
GROUP BY a . IssueCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID , x . MergeID ";
#endregion
}
if ( Type = = "7" )
@ -1317,6 +1336,7 @@ a.ExtensionID
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -1325,7 +1345,7 @@ a.ExtensionID
inner join ICSMOPickMerge x on a . ID = x . SourceID and a . WorkPoint = x . WorkPoint
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE a . SDNCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . SDNCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , a . ExtensionID , x . MergeID ";
GROUP BY a . SDNCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID , x . MergeID ";
#endregion
}
if ( Type = = "8" )
@ -1338,6 +1358,7 @@ a.ExtensionID
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -1346,7 +1367,7 @@ a.ExtensionID
inner join ICSMOPickMerge x on a . ID = x . SourceID and a . WorkPoint = x . WorkPoint
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE a . OutCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . OutCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , a . ExtensionID , x . MergeID ";
GROUP BY a . OutCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID , x . MergeID ";
#endregion
}
if ( Type = = "9" )
@ -1359,6 +1380,7 @@ a.ExtensionID
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WhCode ,
a . ExtensionID
@ -1367,7 +1389,7 @@ a.ExtensionID
inner join ICSMOPickMerge x on a . ID = x . SourceID and a . WorkPoint = x . WorkPoint
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE a . BrrowCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . BrrowCode , a . InvCode , b . InvName , b . InvStd , a . WhCode , a . ExtensionID , x . MergeID ";
GROUP BY a . BrrowCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WhCode , a . ExtensionID , x . MergeID ";
#endregion
}
if ( Type = = "10" )
@ -1380,6 +1402,7 @@ a.ExtensionID
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . FromWarehouseCode as WhCode ,
a . ExtensionID
@ -1388,7 +1411,7 @@ a.ExtensionID
inner join ICSMOPickMerge x on a . ID = x . SourceID and a . WorkPoint = x . WorkPoint
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE a . TransferNO in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . TransferNO , a . InvCode , b . InvName , b . InvStd , a . FromWarehouseCode , a . ExtensionID , x . MergeID ";
GROUP BY a . TransferNO , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . FromWarehouseCode , a . ExtensionID , x . MergeID ";
#endregion
}
if ( Type = = "10" )
@ -1401,6 +1424,7 @@ a.ExtensionID
b . InvName ,
b . InvStd ,
b . InvUnit ,
SUM ( ISNULL ( a . Quantity , 0 ) ) AS iQuantity ,
a . WHCode as WhCode ,
a . ExtensionID
@ -1410,7 +1434,7 @@ a.ExtensionID
inner join ICSMOPickMerge x on a . ID = x . SourceID and a . WorkPoint = x . WorkPoint
LEFT JOIN ICSINVENTORY b ON a . InvCode = b . InvCode AND a . WorkPoint = b . WorkPoint
WHERE a . OutCode in ( { 0 } ) AND a . WorkPoint = ' { 1 } '
GROUP BY a . OutCode , a . InvCode , b . InvName , b . InvStd , a . WHCode , a . ExtensionID , x . MergeID ";
GROUP BY a . OutCode , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . WHCode , a . ExtensionID , x . MergeID ";
#endregion
}