@ -7876,7 +7876,7 @@ ISNULL(c.MTIME,'') AS MTIME,'' AS VenCode,'' AS cVenName,d.InvUnit,'' AS POCode,
END
" + sql + " AND Otin . InCode = ' " + JsonData.TransCode + @" '
GROUP BY inv . LotEnable , a . ID , con . ContainerCode , con . ContainerName , a . LotNo , a . InvCode , inv . InvName , inv . InvStd , inv . InvUnit , a . WarehouseCode ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit , inv . EATTRIBUTE5 ,
ext . ID , ext . ProjectCode , ext . Version , ext . Brand , ext . cFree1 , ext . cFree2 , ext . cFree3 , ext . cFree4 , ext . cFree5 , ext . cFree6 , ext . cFree7 , ext . cFree8 , ext . cFree9 , ext . cFree10 , a . MUSER , a . MTIME ";
columns = @ "SUM(log.Quantity) AS Quantity,
@ -7929,7 +7929,7 @@ ISNULL(c.MTIME,'') AS MTIME,'' AS VenCode,'' AS cVenName,d.InvUnit,'' AS POCode,
)
" + sql + " AND Otin . InCode = ' " + JsonData.TransCode + @" '
GROUP BY inv . LotEnable , a . ID , con . ContainerCode , con . ContainerName , a . LotNo , a . InvCode , inv . InvName , inv . InvStd , inv . InvUnit , a . WarehouseCode ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit , inv . EATTRIBUTE5 ,
ext . ID , ext . ProjectCode , ext . Version , ext . Brand , ext . cFree1 , ext . cFree2 , ext . cFree3 , ext . cFree4 , ext . cFree5 , ext . cFree6 , ext . cFree7 , ext . cFree8 , ext . cFree9 , ext . cFree10 , a . MUSER , a . MTIME ";
columns = @ "SUM(log.Quantity) AS Quantity,
@ -7982,7 +7982,7 @@ ISNULL(c.MTIME,'') AS MTIME,'' AS VenCode,'' AS cVenName,d.InvUnit,'' AS POCode,
END
" + sql + @" AND sdn . Type = '1'
GROUP BY inv . LotEnable , a . ID , con . ContainerCode , con . ContainerName , a . LotNo , a . InvCode , inv . InvName , inv . InvStd , inv . InvUnit , a . WarehouseCode ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit , inv . EATTRIBUTE5 ,
ext . ID , ext . ProjectCode , ext . Version , ext . Brand , ext . cFree1 , ext . cFree2 , ext . cFree3 , ext . cFree4 , ext . cFree5 , ext . cFree6 , ext . cFree7 , ext . cFree8 , ext . cFree9 , ext . cFree10 , a . MUSER , a . MTIME ";
columns = @ "SUM(log.Quantity) AS Quantity,
@ -8033,7 +8033,7 @@ ISNULL(c.MTIME,'') AS MTIME,'' AS VenCode,'' AS cVenName,d.InvUnit,'' AS POCode,
)
" + sql + @" AND sdn . Type = '1'
GROUP BY inv . LotEnable , a . ID , con . ContainerCode , con . ContainerName , a . LotNo , a . InvCode , inv . InvName , inv . InvStd , inv . InvUnit , a . WarehouseCode ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit , inv . EATTRIBUTE5 ,
ext . ID , ext . ProjectCode , ext . Version , ext . Brand , ext . cFree1 , ext . cFree2 , ext . cFree3 , ext . cFree4 , ext . cFree5 , ext . cFree6 , ext . cFree7 , ext . cFree8 , ext . cFree9 , ext . cFree10 , a . MUSER , a . MTIME ";
columns = @ "SUM(log.Quantity) AS Quantity,
@ -8079,7 +8079,7 @@ ISNULL(c.MTIME,'') AS MTIME,'' AS VenCode,'' AS cVenName,d.InvUnit,'' AS POCode,
END
" + sql + @" AND log . BusinessCode IN ( ' 1 9 ',' 5 5 ' )
GROUP BY inv . LotEnable , log . ID , a . ID , con . ContainerCode , con . ContainerName , a . LotNo , a . InvCode , inv . InvName , inv . InvStd , inv . InvUnit , a . WarehouseCode ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit , inv . EATTRIBUTE5 ,
ext . ID , ext . ProjectCode , ext . Version , ext . Brand , ext . cFree1 , ext . cFree2 , ext . cFree3 , ext . cFree4 , ext . cFree5 , ext . cFree6 , ext . cFree7 , ext . cFree8 , ext . cFree9 , ext . cFree10 , a . MUSER , a . MTIME ";
columns = @ "SUM(log.Quantity) AS Quantity,
@ -8130,7 +8130,7 @@ ISNULL(c.MTIME,'') AS MTIME,'' AS VenCode,'' AS cVenName,d.InvUnit,'' AS POCode,
)
" + sql + @" AND log . BusinessCode IN ( ' 1 9 ',' 5 5 ' )
GROUP BY inv . LotEnable , a . ID , con . ContainerCode , con . ContainerName , a . LotNo , a . InvCode , inv . InvName , inv . InvStd , inv . InvUnit , a . WarehouseCode ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit , inv . EATTRIBUTE5 ,
ext . ID , ext . ProjectCode , ext . Version , ext . Brand , ext . cFree1 , ext . cFree2 , ext . cFree3 , ext . cFree4 , ext . cFree5 , ext . cFree6 , ext . cFree7 , ext . cFree8 , ext . cFree9 , ext . cFree10 , a . MUSER , a . MTIME ";
columns = @ "SUM(log.Quantity) AS Quantity,
@ -8320,7 +8320,7 @@ ISNULL(c.MTIME,'') AS MTIME,'' AS VenCode,'' AS cVenName,d.InvUnit,'' AS POCode,
if ( ScanType = = "LOTNO" )
{
sql = sql + @" AND log.BusinessCode IN('" + type + @ "') GROUP BY inv.LotEnable,log.ID,a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,inv.InvName,inv.InvStd,inv.InvUnit,a.WarehouseCode,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit , inv . EATTRIBUTE5 ,
ext . ID , ext . ProjectCode , ext . Version , ext . Brand , ext . cFree1 , ext . cFree2 , ext . cFree3 , ext . cFree4 , ext . cFree5 , ext . cFree6 , ext . cFree7 , ext . cFree8 , ext . cFree9 , ext . cFree10 , a . MUSER , a . MTIME
";
sql = @"IF EXISTS(" + sql + @ ")
@ -8361,7 +8361,7 @@ ISNULL(c.MTIME,'') AS MTIME,'' AS VenCode,'' AS cVenName,d.InvUnit,'' AS POCode,
else
{
sql = sql + @" AND log.BusinessCode IN('" + type + @ "') GROUP BY inv.LotEnable,log.ID,a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,inv.InvName,inv.InvStd,inv.InvUnit,a.WarehouseCode,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit , inv . EATTRIBUTE5 ,
ext . ID , ext . ProjectCode , ext . Version , ext . Brand , ext . cFree1 , ext . cFree2 , ext . cFree3 , ext . cFree4 , ext . cFree5 , ext . cFree6 , ext . cFree7 , ext . cFree8 , ext . cFree9 , ext . cFree10 , a . MUSER , a . MTIME
";
sql = @"IF EXISTS(" + sql + @ ")
@ -8504,7 +8504,7 @@ ISNULL(c.MTIME,'') AS MTIME,'' AS VenCode,'' AS cVenName,d.InvUnit,'' AS POCode,
if ( ScanType = = "LOTNO" )
{
sql = sql + @ " AND log.BusinessCode IN('27') GROUP BY inv.LotEnable,log.ID,a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,inv.InvName,inv.InvStd,inv.InvUnit,a.WarehouseCode,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit , inv . EATTRIBUTE5 ,
ext . ID , ext . ProjectCode , ext . Version , ext . Brand , ext . cFree1 , ext . cFree2 , ext . cFree3 , ext . cFree4 , ext . cFree5 , ext . cFree6 , ext . cFree7 , ext . cFree8 , ext . cFree9 , ext . cFree10 , a . MUSER , a . MTIME
";
sql = @"IF EXISTS(" + sql + @ ")
@ -8536,7 +8536,7 @@ ISNULL(c.MTIME,'') AS MTIME,'' AS VenCode,'' AS cVenName,d.InvUnit,'' AS POCode,
else
{
sql = sql + @ " AND log.BusinessCode IN('27') GROUP BY inv.LotEnable,log.ID,a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,inv.InvName,inv.InvStd,inv.InvUnit,a.WarehouseCode,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit ,
wh . WarehouseName , a . LocationCode , loc . LocationName , CASE WHEN ( invBat . BatchEnable IS NULL AND ISNULL ( inv . BatchEnable , '0' ) = '1' ) OR ISNULL ( invBat . BatchEnable , '0' ) = '1' THEN ISNULL ( ext . BatchCode , ' ' ) ELSE ' ' END , inv . AmountUnit , inv . EATTRIBUTE5 ,
ext . ID , ext . ProjectCode , ext . Version , ext . Brand , ext . cFree1 , ext . cFree2 , ext . cFree3 , ext . cFree4 , ext . cFree5 , ext . cFree6 , ext . cFree7 , ext . cFree8 , ext . cFree9 , ext . cFree10 , a . MUSER , a . MTIME
";
sql = @"IF EXISTS(" + sql + @ ")