@ -485,12 +485,13 @@ namespace ICSSoft.DataProject
END
END
INSERT INTO ICSWareHouseLotInfo ( ID , LotNO , WarehouseCode , LocationCode , InvCode , Quantity , InDate , LockQuantity , MUSER , MUSERName , MTIME , WorkPoint , EATTRIBUTE1 )
SELECT NEWID ( ) , a . LotNo , e . WarehouseCode , d . LocationCode , a . InvCode , ' { 3 } ' , SYSDATETIME ( ) , '0' , ' { 2 } ', '{ 2 } ' , SYSDATETIME ( ) , a . WorkPoint , ' '
SELECT NEWID ( ) , a . LotNo , e . WarehouseCode , d . LocationCode , a . InvCode , ' { 3 } ' , SYSDATETIME ( ) , '0' , ' { 2 } ' , isnull ( f . F_RealName , ' { 2 } ' ) , SYSDATETIME ( ) , a . WorkPoint , ' '
FROM ICSInventoryLot a
INNER JOIN ICSInventoryLotDetail b ON a . LotNo = b . LotNo AND a . WorkPoint = b . WorkPoint
- - INNER JOIN ICSOApplyNegDetail c ON b . TransCode = c . OApplyNegCode AND b . TransSequence = c . Sequence AND b . WorkPoint = c . WorkPoint
INNER JOIN ICSLocation d ON d . LocationCode = ' { 4 } ' AND a . WorkPoint = d . WorkPoint
INNER JOIN ICSWarehouse e ON d . WHID = e . ID AND d . WorkPoint = e . WorkPoint
left JOIN Sys_SRM_User f ON f . F_Account = ' { 2 } ' AND a . WorkPoint = f . F_Location
WHERE a . LotNo = ' { 0 } ' AND a . WorkPoint = ' { 1 } '
END ";
sql = string . Format ( sql , dr [ "LotNo" ] . ToString ( ) , dr [ "WorkPoint" ] . ToString ( ) , User , dr [ "Quantity" ] . ToString ( ) , LocationCode ) ;
@ -509,11 +510,12 @@ namespace ICSSoft.DataProject
SELECT NEWID ( ) , ' { 3 } ' , b . TransCode , b . TransSequence , a . LotNo , a . InvCode ,
' ',' ' , c . WarehouseCode , c . LocationCode , ' { 6 } ' ,
' ',' 0 ',' { 4 } ',' { 5 } ',' 0 ',' ' ,
' ',' ',' ',' { 2 } ', '{ 2 } ' ,
' ',' ',' ',' { 2 } ' , isnull ( f . F_RealName , ' { 2 } ' ) ,
SYSDATETIME ( ) , a . WorkPoint , ' '
FROM ICSInventoryLot a
INNER JOIN ICSInventoryLotDetail b ON a . LotNo = b . LotNo AND a . WorkPoint = b . WorkPoint
INNER JOIN ICSWareHouseLotInfo c ON a . LotNo = c . LotNo AND a . WorkPoint = c . WorkPoint
left JOIN Sys_SRM_User f ON f . F_Account = ' { 2 } ' AND a . WorkPoint = f . F_Location
WHERE a . LotNo = ' { 0 } ' AND a . WorkPoint = ' { 1 } '
";
sql = string . Format ( sql , dr [ "LotNo" ] . ToString ( ) , dr [ "WorkPoint" ] . ToString ( ) , User , Identification , TransType , BusinessCode , dr [ "Quantity" ] . ToString ( ) ) ;
@ -711,9 +713,10 @@ namespace ICSSoft.DataProject
}
string sql = string . Empty ;
sql = @ " INSERT INTO ICSWareHouseLotInfo(ID,LotNO,WarehouseCode,LocationCode,InvCode,Quantity,InDate,LockQuantity,MUSER,MUSERName,MTIME,WorkPoint,EATTRIBUTE1)
SELECT NEWID ( ) , a . LotNo , ' { 4 } ',' { 5 } ' , a . InvCode , ' { 3 } ' , SYSDATETIME ( ) , '0' , ' { 2 } ', '{ 2 } ' , SYSDATETIME ( ) , a . WorkPoint , ' '
SELECT NEWID ( ) , a . LotNo , ' { 4 } ',' { 5 } ' , a . InvCode , ' { 3 } ' , SYSDATETIME ( ) , '0' , ' { 2 } ' , isnull ( f . F_RealName , ' { 2 } ' ) , SYSDATETIME ( ) , a . WorkPoint , ' '
FROM ICSInventoryLot a
INNER JOIN ICSInventoryLotDetail b ON a . LotNo = b . LotNo AND a . WorkPoint = b . WorkPoint
left JOIN Sys_SRM_User f ON f . F_Account = ' { 2 } ' AND a . WorkPoint = f . F_Location
WHERE a . LotNo = ' { 0 } ' AND a . WorkPoint = ' { 1 } ' ";
sql = string . Format ( sql , LotNo , WorkPoint , User , Quantity , WHCode , LocationCode ) ;
@ -731,12 +734,12 @@ namespace ICSSoft.DataProject
SELECT NEWID ( ) , ' { 3 } ' , b . TransCode , b . TransSequence , a . LotNo , a . InvCode ,
' ',' ' , c . WarehouseCode , c . LocationCode , ' { 6 } ' ,
' ',' 0 ',' { 4 } ',' { 5 } ',' 0 ',' ' ,
' ',' ',' ',' { 2 } ', '{ 2 } ' ,
' ',' ',' ',' { 2 } ' , isnull ( f . F_RealName , ' { 2 } ' ) ,
SYSDATETIME ( ) , a . WorkPoint , ' '
FROM ICSInventoryLot a
INNER JOIN ICSInventoryLotDetail b ON a . LotNo = b . LotNo AND a . WorkPoint = b . WorkPoint
INNER JOIN ICSWareHouseLotInfo c ON a . LotNo = c . LotNo AND a . WorkPoint = c . WorkPoint
- - INNER JOIN Sys_SRM_User f ON f . F_Account = ' { 2 } ' AND a . WorkPoint = f . F_Location
left JOIN Sys_SRM_User f ON f . F_Account = ' { 2 } ' AND a . WorkPoint = f . F_Location
WHERE a . LotNo = ' { 0 } ' AND a . WorkPoint = ' { 1 } '
";
sql = string . Format ( sql , LotNo , WorkPoint , User , Identification , TransType , BusinessCode , Quantity ) ;
@ -996,11 +999,11 @@ namespace ICSSoft.DataProject
SELECT NEWID ( ) , ' { 3 } ',' { 4 } ',' { 5 } ' , a . LotNo , a . InvCode ,
c . WarehouseCode , c . LocationCode , ' ',' ',' { 6 } ' ,
' ',' 0 ',' { 7 } ',' { 8 } ',' 0 ',' ' ,
' ',' ',' ',' { 2 } ', '{ 2 } ' ,
' ',' ',' ',' { 2 } ' , isnull ( f . F_RealName , ' { 2 } ' ) ,
SYSDATETIME ( ) , a . WorkPoint , ' ',' { 9 } '
FROM ICSInventoryLot a
INNER JOIN ICSWareHouseLotInfo c ON a . LotNo = c . LotNo AND a . WorkPoint = c . WorkPoint
- - INNER JOIN Sys_SRM_User f ON f . F_Account = ' { 2 } ' AND a . WorkPoint = f . F_Location
left JOIN Sys_SRM_User f ON f . F_Account = ' { 2 } ' AND a . WorkPoint = f . F_Location
WHERE a . LotNo = ' { 0 } ' AND a . WorkPoint = ' { 1 } '
";
sql = string . Format ( sql , LotNo , WorkPoint , User , Identification , TransCode , TransSequence , Quantity , TransType , BusinessCode , MergeID ) ;
@ -1093,11 +1096,11 @@ namespace ICSSoft.DataProject
SELECT NEWID ( ) , ' { 3 } ',' { 4 } ',' { 5 } ' , a . LotNo , a . InvCode ,
c . WarehouseCode , c . LocationCode , ' ',' ',' { 6 } ' ,
' ',' 0 ',' { 7 } ',' { 8 } ',' 0 ',' ' ,
' ',' ',' ',' { 2 } ', '{ 2 } ' ,
' ',' ',' ',' { 2 } ' , isnull ( f . F_RealName , ' { 2 } ' ) ,
SYSDATETIME ( ) , a . WorkPoint , ' ',' { 9 } '
FROM ICSInventoryLot a
INNER JOIN ICSWareHouseLotInfo c ON a . LotNo = c . LotNo AND a . WorkPoint = c . WorkPoint
- - INNER JOIN Sys_SRM_User f ON f . F_Account = ' { 2 } ' AND a . WorkPoint = f . F_Location
left JOIN Sys_SRM_User f ON f . F_Account = ' { 2 } ' AND a . WorkPoint = f . F_Location
WHERE a . LotNo = ' { 0 } ' AND a . WorkPoint = ' { 1 } '
";
sql = string . Format ( sql , dr [ "LotNo" ] . ToString ( ) , WorkPoint , User , Identification , TransCode , dr [ "TransSequence" ] . ToString ( )
@ -1246,10 +1249,11 @@ namespace ICSSoft.DataProject
SELECT NEWID ( ) , ' { 3 } ',' { 4 } ',' { 5 } ' , a . LotNo , a . InvCode ,
c . WarehouseCode , c . LocationCode , ' ',' ',' { 6 } ' ,
' ',' 0 ',' { 7 } ',' { 8 } ',' 0 ',' ' ,
' ',' ',' ',' { 2 } ', '{ 2 } ' ,
' ',' ',' ',' { 2 } ' , isnull ( f . F_RealName , ' { 2 } ' ) ,
SYSDATETIME ( ) , a . WorkPoint , ' ',' { 9 } '
FROM ICSInventoryLot a
INNER JOIN ICSWareHouseLotInfo c ON a . LotNo = c . LotNo AND a . WorkPoint = c . WorkPoint
left JOIN Sys_SRM_User f ON f . F_Account = ' { 2 } ' AND a . WorkPoint = f . F_Location
WHERE a . LotNo = ' { 0 } ' AND a . WorkPoint = ' { 1 } ' ";
sql = string . Format ( sql , LotNO , WorkPoint , User , Identification , TransCode , DocLineNO , lotQuantity , TransType , BusinessCode , MergeID ) ;