@ -570,13 +570,14 @@ CAST( (a.Quantity-ISNULL(c.LOTQTY,0)) as DECIMAL(18,{0})) as thisCreateQty,isnu
object Figure = GetDecimalDigits ( ) ;
object Figure = GetDecimalDigits ( ) ;
#region [SQL]
#region [SQL]
string sql = @ " select a.ID,a.SDNCode,a.Sequence,a.SOCode,a.SOSequence,a.CusCode,a.CusName,a.Type,a.ArriveDate,a.InvCode,a.WHCode,b.EATTRIBUTE1 AS Area,b.InvName,b.InvDesc,b.InvStd,b.InvUnit,CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity
string sql = @ " select a.ID,a.SDNCode,a.Sequence,a.SOCode,a.SOSequence,a.CusCode,a.CusName,a.Type,a.ArriveDate,a.InvCode,a.WHCode,detail.LocationCode AS Area,b.InvName,b.InvDesc,b.InvStd,b.InvUnit,CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity
, cast ( a . Amount as decimal ( 1 8 , { 0 } ) ) as Amount , CAST ( a . SDNQuantity AS DECIMAL ( 1 8 , { 0 } ) ) as SDNQuantity , a . Status , a . ExtensionID , a . CreatePerson , a . CreateDateTime , CAST ( c . LOTQTY AS DECIMAL ( 1 8 , { 0 } ) ) as LOTQTY
, cast ( a . Amount as decimal ( 1 8 , { 0 } ) ) as Amount , CAST ( a . SDNQuantity AS DECIMAL ( 1 8 , { 0 } ) ) as SDNQuantity , a . Status , a . ExtensionID , a . CreatePerson , a . CreateDateTime , CAST ( c . LOTQTY AS DECIMAL ( 1 8 , { 0 } ) ) as LOTQTY
, a . WorkPoint , a . Points , a . DeliveryType , a . DeliveryDescribe , a . InvDescribe , a . OtherDescribe , a . SalesUnit , a . StockIndicator , a . IsSerialNumber
, a . WorkPoint , a . Points , a . DeliveryType , a . DeliveryDescribe , a . InvDescribe , a . OtherDescribe , a . SalesUnit , a . StockIndicator , a . IsSerialNumber
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, 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
from ICSSDN a
from 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
LEFT JOIN ICSInventoryDetail detail WHERE b . InvCode = detail . INVCode AND a . WHCode = detail . WHCode AND a . WorkPoint = detail . WorkPoint
left join (
left join (
select mm . TransCode , mm . TransSequence , sum ( isnull ( ee . Quantity , 0 ) ) LOTQTY , ee . WorkPoint from ICSInventoryLot ee
select mm . TransCode , mm . TransSequence , sum ( isnull ( ee . Quantity , 0 ) ) LOTQTY , ee . WorkPoint from ICSInventoryLot ee
left join ICSInventoryLotDetail mm on ee . LotNo = mm . LotNo and ee . type = '4'
left join ICSInventoryLotDetail mm on ee . LotNo = mm . LotNo and ee . type = '4'
@ -613,7 +614,7 @@ where a.Type='2'";
}
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
{
sql + = " and b.EATTRIBUTE1 like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
sql + = " and detail.LocationCode like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
}
}
@ -736,12 +737,13 @@ insert into ICSInventoryLot
#region [SQL]
#region [SQL]
string sql = @ " select a.ID,a.InCode,a.Sequence,a.WHCode,a.InvCode,a.WorkPoint,a.OrderType,
string sql = @ " select a.ID,a.InCode,a.Sequence,a.WHCode,a.InvCode,a.WorkPoint,a.OrderType,
a . TypeDescribe , a . CostCenter , a . Remarks , a . PersonNumber , a . InvDescribe ,
a . TypeDescribe , a . CostCenter , a . Remarks , a . PersonNumber , a . InvDescribe ,
a . Unit , a . StockIndicator , b . EATTRIBUTE1 AS Area , b . InvName , b . InvStd , b . InvDesc , b . InvUnit ,
a . Unit , a . StockIndicator , detail . LocationCode AS Area , b . InvName , b . InvStd , b . InvDesc , b . InvUnit ,
CAST ( a . Quantity AS DECIMAL ( 1 8 , { 0 } ) ) as Quantity , CAST ( a . Amount AS DECIMAL ( 1 8 , { 0 } ) ) as Amount , CAST ( a . InQuantity AS DECIMAL ( 1 8 , { 0 } ) ) as InQuantity , a . CreatePerson , a . CreateDateTime , CAST ( c . LOTQTY AS DECIMAL ( 1 8 , { 0 } ) ) as LOTQTY
CAST ( a . Quantity AS DECIMAL ( 1 8 , { 0 } ) ) as Quantity , CAST ( a . Amount AS DECIMAL ( 1 8 , { 0 } ) ) as Amount , CAST ( a . InQuantity AS DECIMAL ( 1 8 , { 0 } ) ) as InQuantity , a . CreatePerson , a . CreateDateTime , CAST ( c . LOTQTY AS DECIMAL ( 1 8 , { 0 } ) ) as LOTQTY
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, 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
from ICSOtherIn a
from ICSOtherIn 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
LEFT JOIN ICSInventoryDetail detail WHERE b . InvCode = detail . INVCode AND a . WHCode = detail . WHCode AND a . WorkPoint = detail . WorkPoint
left join (
left join (
select mm . TransCode , mm . TransSequence , sum ( isnull ( ee . Quantity , 0 ) ) LOTQTY , ee . WorkPoint from ICSInventoryLot ee
select mm . TransCode , mm . TransSequence , sum ( isnull ( ee . Quantity , 0 ) ) LOTQTY , ee . WorkPoint from ICSInventoryLot ee
left join ICSInventoryLotDetail mm on ee . LotNo = mm . LotNo and ee . type = '5'
left join ICSInventoryLotDetail mm on ee . LotNo = mm . LotNo and ee . type = '5'
@ -778,7 +780,7 @@ where a.Status='1'";
}
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
{
sql + = " and b.EATTRIBUTE1 like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
sql + = " and detail.LocationCode like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
}
}
}
}
@ -898,10 +900,11 @@ insert into ICSInventoryLot
List < DbParameter > parameter = new List < DbParameter > ( ) ;
List < DbParameter > parameter = new List < DbParameter > ( ) ;
object Figure = GetDecimalDigits ( ) ;
object Figure = GetDecimalDigits ( ) ;
#region [SQL]
#region [SQL]
string sql = @ "select a.ID,a.ReturnCode,a.Sequence,a.WHCode,a.InvCode,b.EATTRIBUTE1 AS Area, b.InvName,b.InvStd,b.InvDesc,b.InvUnit,CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity ,CAST(a.Amount AS DECIMAL(18,{0})) as Amount, CAST(a.ReturnQuantity AS DECIMAL(18,{0})) as ReturnQuantity,a.CreatePerson,a.CreateDateTime,CAST(c.LOTQTY AS DECIMAL(18,{0})) as LOTQTY
string sql = @ "select a.ID,a.ReturnCode,a.Sequence,a.WHCode,a.InvCode, detail.LocationCode AS Area, b.InvName,b.InvStd,b.InvDesc,b.InvUnit,CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity ,CAST(a.Amount AS DECIMAL(18,{0})) as Amount, CAST(a.ReturnQuantity AS DECIMAL(18,{0})) as ReturnQuantity,a.CreatePerson,a.CreateDateTime,CAST(c.LOTQTY AS DECIMAL(18,{0})) as LOTQTY
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, 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 from ICSReturn a
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 from ICSReturn 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
LEFT JOIN ICSInventoryDetail detail WHERE b . InvCode = detail . INVCode AND a . WHCode = detail . WHCode AND a . WorkPoint = detail . WorkPoint
left join (
left join (
select mm . TransCode , mm . TransSequence , sum ( isnull ( ee . Quantity , 0 ) ) LOTQTY , ee . WorkPoint from ICSInventoryLot ee
select mm . TransCode , mm . TransSequence , sum ( isnull ( ee . Quantity , 0 ) ) LOTQTY , ee . WorkPoint from ICSInventoryLot ee
left join ICSInventoryLotDetail mm on ee . LotNo = mm . LotNo and ee . type = '6'
left join ICSInventoryLotDetail mm on ee . LotNo = mm . LotNo and ee . type = '6'
@ -929,7 +932,7 @@ where a.Status='2'";
}
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
{
sql + = " and b.EATTRIBUTE1 like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
sql + = " and detail.LocationCode like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
}
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "BatchCode" ] . ToString ( ) ) )
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "BatchCode" ] . ToString ( ) ) )
{
{
@ -957,12 +960,13 @@ where a.Status='2'";
#region [SQL]
#region [SQL]
string sql = @ "select a.ID, '' as 'POCode',-- d.POCode,d.Sequence as POSequence,
string sql = @ "select a.ID, '' as 'POCode',-- d.POCode,d.Sequence as POSequence,
' ' as POSequence ,
' ' as POSequence ,
a . DNCode , a . Sequence , a . VenCode , e . VenName , a . WHCode , a . InvCode , a . DNID , a . DNDetailID , a . WorkPoint , a . InspectionType , a . InvoDescribe , a . Unity , a . StockIndicator , b . InvName , b . InvStd , b . InvDesc , b . InvUnit , b . EATTRIBUTE1 AS Area ,
a . DNCode , a . Sequence , a . VenCode , e . VenName , a . WHCode , a . InvCode , a . DNID , a . DNDetailID , a . WorkPoint , a . InspectionType , a . InvoDescribe , a . Unity , a . StockIndicator , b . InvName , b . InvStd , b . InvDesc , b . InvUnit , detail . LocationCode AS Area ,
CAST ( a . Quantity AS DECIMAL ( 1 8 , { 0 } ) ) as Quantity , CAST ( a . Amount AS DECIMAL ( 1 8 , { 0 } ) ) as Amount , CAST ( a . RCVQuantity AS DECIMAL ( 1 8 , { 0 } ) ) as RCVQuantity , CAST ( a . UnitPrice AS DECIMAL ( 1 8 , { 0 } ) ) as UnitPrice , a . Currency , a . CreatePerson , a . CreateDateTime , CAST ( c . LOTQTY AS DECIMAL ( 1 8 , { 0 } ) ) as LOTQTY
CAST ( a . Quantity AS DECIMAL ( 1 8 , { 0 } ) ) as Quantity , CAST ( a . Amount AS DECIMAL ( 1 8 , { 0 } ) ) as Amount , CAST ( a . RCVQuantity AS DECIMAL ( 1 8 , { 0 } ) ) as RCVQuantity , CAST ( a . UnitPrice AS DECIMAL ( 1 8 , { 0 } ) ) as UnitPrice , a . Currency , a . CreatePerson , a . CreateDateTime , CAST ( c . LOTQTY AS DECIMAL ( 1 8 , { 0 } ) ) as LOTQTY
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, 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
from ICSDeliveryNotice a
from ICSDeliveryNotice 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
LEFT JOIN ICSInventoryDetail detail WHERE b . InvCode = detail . INVCode AND a . WHCode = detail . WHCode AND a . WorkPoint = detail . WorkPoint
left join (
left join (
select mm . TransCode , mm . TransSequence , sum ( isnull ( ee . Quantity , 0 ) ) LOTQTY , ee . WorkPoint from ICSInventoryLot ee
select mm . TransCode , mm . TransSequence , sum ( isnull ( ee . Quantity , 0 ) ) LOTQTY , ee . WorkPoint from ICSInventoryLot ee
left join ICSInventoryLotDetail mm on ee . LotNo = mm . LotNo and ee . type = '7'
left join ICSInventoryLotDetail mm on ee . LotNo = mm . LotNo and ee . type = '7'
@ -994,7 +998,7 @@ where a.DNType='1' and a.Status='2' and a.ASNCode is null
}
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
{
sql + = " and b.EATTRIBUTE1 like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
sql + = " and detail.LocationCode like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
}
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Location" ] . ToString ( ) ) )
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Location" ] . ToString ( ) ) )
{
{
@ -1033,12 +1037,13 @@ where a.DNType='1' and a.Status='2' and a.ASNCode is null
List < DbParameter > parameter = new List < DbParameter > ( ) ;
List < DbParameter > parameter = new List < DbParameter > ( ) ;
object Figure = GetDecimalDigits ( ) ;
object Figure = GetDecimalDigits ( ) ;
#region [SQL]
#region [SQL]
string sql = @ "select a.ID, d.OOCode,d.Sequence as OOSequence,a.ODNCode,a.Sequence,a.VenCode,e.VenName,a.InvCode, b.InvName,b.InvStd,b.InvDesc,b.InvUnit,b.EATTRIBUTE1 AS Area,CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity ,CAST(a.Amount AS DECIMAL(18,{0})) as Amount,CAST(a.RCVQuantity AS DECIMAL(18,{0})) as RCVQuantity,CAST(a.UnitPrice AS DECIMAL(18,{0})) as UnitPrice,a.Currency,a.CreatePerson,a.CreateDateTime,
string sql = @ "select a.ID, d.OOCode,d.Sequence as OOSequence,a.ODNCode,a.Sequence,a.VenCode,e.VenName,a.InvCode, b.InvName,b.InvStd,b.InvDesc,b.InvUnit,detail.LocationCode AS Area,CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity ,CAST(a.Amount AS DECIMAL(18,{0})) as Amount,CAST(a.RCVQuantity AS DECIMAL(18,{0})) as RCVQuantity,CAST(a.UnitPrice AS DECIMAL(18,{0})) as UnitPrice,a.Currency,a.CreatePerson,a.CreateDateTime,
CAST ( c . LOTQTY AS DECIMAL ( 1 8 , { 0 } ) ) as LOTQTY
CAST ( c . LOTQTY AS DECIMAL ( 1 8 , { 0 } ) ) as LOTQTY
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, 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
from ICSODeliveryNotice a
from ICSODeliveryNotice 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
LEFT JOIN ICSInventoryDetail detail WHERE b . InvCode = detail . INVCode AND a . WHCode = detail . WHCode AND a . WorkPoint = detail . WorkPoint
left join (
left join (
select mm . TransCode , mm . TransSequence , sum ( isnull ( ee . Quantity , 0 ) ) LOTQTY , ee . WorkPoint from ICSInventoryLot ee
select mm . TransCode , mm . TransSequence , sum ( isnull ( ee . Quantity , 0 ) ) LOTQTY , ee . WorkPoint from ICSInventoryLot ee
left join ICSInventoryLotDetail mm on ee . LotNo = mm . LotNo and ee . type = '8'
left join ICSInventoryLotDetail mm on ee . LotNo = mm . LotNo and ee . type = '8'
@ -1072,7 +1077,7 @@ where a.ODNType='1' and a.Status='2' and a.OASNCode is null";
}
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
{
sql + = " and b.EATTRIBUTE1 like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
sql + = " and detail.LocationCode like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
}
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "InvName" ] . ToString ( ) ) )
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "InvName" ] . ToString ( ) ) )
{
{
@ -1107,12 +1112,13 @@ where a.ODNType='1' and a.Status='2' and a.OASNCode is null";
string sql = @ "
string sql = @ "
select a . ID , a . RCVCode , a . Sequence , a . WHCode , a . InvCode , a . EATTRIBUTE , a . WorkPoint , a . InvDescribe , a . OrderNumber ,
select a . ID , a . RCVCode , a . Sequence , a . WHCode , a . InvCode , a . EATTRIBUTE , a . WorkPoint , a . InvDescribe , a . OrderNumber ,
a . OrderInvCode , a . OrderInvDescribe , a . BillType , a . Remarks , a . Unit ,
a . OrderInvCode , a . OrderInvDescribe , a . BillType , a . Remarks , a . Unit ,
a . StockIndicator , a . RemarksTerm , b . EATTRIBUTE1 AS Area , b . InvName , b . InvStd , b . InvDesc , b . InvUnit , CAST ( a . Quantity AS DECIMAL ( 1 8 , { 0 } ) ) as Quantity ,
a . StockIndicator , a . RemarksTerm , detail . LocationCode AS Area , b . InvName , b . InvStd , b . InvDesc , b . InvUnit , CAST ( a . Quantity AS DECIMAL ( 1 8 , { 0 } ) ) as Quantity ,
CAST ( a . Amount AS DECIMAL ( 1 8 , { 0 } ) ) as Amount , CAST ( a . RCVQuantity AS DECIMAL ( 1 8 , { 0 } ) ) as RCVQuantity , a . CreatePerson , a . CreateDateTime , CAST ( c . LOTQTY AS DECIMAL ( 1 8 , { 0 } ) ) as LOTQTY
CAST ( a . Amount AS DECIMAL ( 1 8 , { 0 } ) ) as Amount , CAST ( a . RCVQuantity AS DECIMAL ( 1 8 , { 0 } ) ) as RCVQuantity , a . CreatePerson , a . CreateDateTime , CAST ( c . LOTQTY AS DECIMAL ( 1 8 , { 0 } ) ) as LOTQTY
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, 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
from ICSManufactureReceive a
from ICSManufactureReceive 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
LEFT JOIN ICSInventoryDetail detail WHERE b . InvCode = detail . INVCode AND a . WHCode = detail . WHCode AND a . WorkPoint = detail . WorkPoint
left join (
left join (
select mm . TransCode , mm . TransSequence , sum ( isnull ( ee . Quantity , 0 ) ) LOTQTY , ee . WorkPoint from ICSInventoryLot ee
select mm . TransCode , mm . TransSequence , sum ( isnull ( ee . Quantity , 0 ) ) LOTQTY , ee . WorkPoint from ICSInventoryLot ee
left join ICSInventoryLotDetail mm on ee . LotNo = mm . LotNo and ee . type = '9'
left join ICSInventoryLotDetail mm on ee . LotNo = mm . LotNo and ee . type = '9'
@ -1140,7 +1146,7 @@ where a.Status='1' and a.Type='1'";
}
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
{
sql + = " and b.EATTRIBUTE1 like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
sql + = " and detail.LocationCode like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
}
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "InvName" ] . ToString ( ) ) )
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "InvName" ] . ToString ( ) ) )
{
{
@ -1761,11 +1767,12 @@ where a.DNType='3' and a.Status='2' and a.EATTRIBUTE1 is NOT null
string sql = @ "select a.ID,a.ApplyNegCode,a.Sequence,a.SourceDetailID,a.InvCode,b.InvName,b.InvDesc,b.InvStd,b.InvUnit,
string sql = @ "select a.ID,a.ApplyNegCode,a.Sequence,a.SourceDetailID,a.InvCode,b.InvName,b.InvDesc,b.InvStd,b.InvUnit,
CAST ( a . Quantity AS DECIMAL ( 1 8 , { 0 } ) ) as Quantity , CAST ( a . Amount AS DECIMAL ( 1 8 , { 0 } ) ) as Amount , CAST ( a . IssueNegQuantity AS DECIMAL ( 1 8 , { 0 } ) ) as IssueNegQuantity
CAST ( a . Quantity AS DECIMAL ( 1 8 , { 0 } ) ) as Quantity , CAST ( a . Amount AS DECIMAL ( 1 8 , { 0 } ) ) as Amount , CAST ( a . IssueNegQuantity AS DECIMAL ( 1 8 , { 0 } ) ) as IssueNegQuantity
, a . ExtensionID , a . MUSERName , a . MTIME , CAST ( c . LOTQTY AS DECIMAL ( 1 8 , { 0 } ) ) as LOTQTY
, a . ExtensionID , a . MUSERName , a . MTIME , CAST ( c . LOTQTY AS DECIMAL ( 1 8 , { 0 } ) ) as LOTQTY
, a . WHCode , b . EATTRIBUTE1 AS Area , f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, a . WHCode , detail . LocationCode AS Area , 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
from ICSMOApplyNegDetail a
from ICSMOApplyNegDetail a
left join ICSMOApplyNeg d on a . ApplyNegCode = d . ApplyNegCode and a . WorkPoint = d . WorkPoint
left join ICSMOApplyNeg d on a . ApplyNegCode = d . ApplyNegCode and a . WorkPoint = d . WorkPoint
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
LEFT JOIN ICSInventoryDetail detail WHERE b . InvCode = detail . INVCode AND a . WHCode = detail . WHCode AND a . WorkPoint = detail . WorkPoint
left join (
left join (
select mm . TransCode , mm . TransSequence , sum ( isnull ( ee . Quantity , 0 ) ) LOTQTY , ee . WorkPoint from ICSInventoryLot ee
select mm . TransCode , mm . TransSequence , sum ( isnull ( ee . Quantity , 0 ) ) LOTQTY , ee . WorkPoint from ICSInventoryLot ee
left join ICSInventoryLotDetail mm on ee . LotNo = mm . LotNo and ee . type = ' 1 2 '
left join ICSInventoryLotDetail mm on ee . LotNo = mm . LotNo and ee . type = ' 1 2 '
@ -1802,7 +1809,7 @@ where a.DNType='3' and a.Status='2' and a.EATTRIBUTE1 is NOT null
}
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
{
sql + = " and b.EATTRIBUTE1 like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
sql + = " and detail.LocationCode like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
}
}
}
}
if ( NFine . Code . OperatorProvider . Provider . GetCurrent ( ) . RoleEnCode ! = "admin" )
if ( NFine . Code . OperatorProvider . Provider . GetCurrent ( ) . RoleEnCode ! = "admin" )