|
|
@ -90,7 +90,7 @@ where d.Type='1'"; |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @" select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
from ICSMOApplyNegDetail a |
|
|
|
left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
|
left join ( |
|
|
@ -171,9 +171,9 @@ where d.Type='1'"; |
|
|
|
sql += string.Format(@"insert into ICSInventoryLot
|
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','1','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','1','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSMOApplyNegDetail where ApplyNegCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
@ -300,7 +300,7 @@ WHERE d.Type='1' "; |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
|
|
|
|
from ICSOApplyNegDetail a |
|
|
|
left join ICSOApplyNeg d on a.OApplyNegCode=d.OApplyNegCode AND a.WorkPoint=d.WorkPoint |
|
|
@ -371,9 +371,9 @@ left join ICSOApplyNeg d on a.OApplyNegCode=d.OApplyNegCode AND a.WorkPoint=d.Wo |
|
|
|
sql += string.Format(@"insert into ICSInventoryLot
|
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','2','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','2','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSOApplyNegDetail where OApplyNegCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, OApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, OApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
@ -444,7 +444,7 @@ left join ICSExtension f on a.ExtensionID=f.ID and a.WorkPoint=f.WorkPoint "; |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
|
|
|
|
from ICSMO a |
|
|
|
left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
@ -516,9 +516,9 @@ left join ICSExtension f on a.ExtensionID=f.ID and a.WorkPoint=f.WorkPoint "; |
|
|
|
sql += string.Format(@"insert into ICSInventoryLot
|
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','3','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','3','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSMO where MOCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, MOCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, MOCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
@ -592,7 +592,7 @@ where a.Type='2'"; |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
|
|
|
|
from ICSSDN a |
|
|
|
left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
@ -665,9 +665,9 @@ where a.Type='2'"; |
|
|
|
insert into ICSInventoryLot |
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','4','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','4','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSSDN where Type='2' and SDNCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, SDNCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, SDNCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
@ -738,7 +738,7 @@ where a.Status='1'"; |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
|
|
|
|
from ICSOtherIn a |
|
|
|
left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
@ -812,9 +812,9 @@ where a.Status='1'"; |
|
|
|
insert into ICSInventoryLot |
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','5','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','5','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSOtherIn where InCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, InCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, InCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
@ -1061,7 +1061,7 @@ where a.Status='1' and a.Type='1'"; |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
from ICSODeliveryNotice a |
|
|
|
left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
|
left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY from ICSInventoryLot a |
|
|
@ -1086,7 +1086,7 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
from ICSManufactureReceive a |
|
|
|
left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
|
left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY from ICSInventoryLot a |
|
|
@ -1112,7 +1112,7 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
from ICSDeliveryNotice a |
|
|
|
left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
|
left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY from ICSInventoryLot a |
|
|
@ -1137,7 +1137,7 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
from ICSReturn a |
|
|
|
left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
|
left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY from ICSInventoryLot a |
|
|
@ -1207,9 +1207,9 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro |
|
|
|
insert into ICSInventoryLot |
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','6','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','6','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSReturn where ReturnCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ReturnCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ReturnCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
@ -1273,9 +1273,9 @@ insert into ICSInventoryLot |
|
|
|
insert into ICSInventoryLot |
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','7','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','7','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSDeliveryNotice where DNCode='{6}' and Sequence='{7}' and WorkPoint='{5}'",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, DNCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, DNCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
@ -1338,9 +1338,9 @@ insert into ICSInventoryLot |
|
|
|
insert into ICSInventoryLot |
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','8','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','8','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSODeliveryNotice where ODNCode='{6}' and Sequence='{7}' and WorkPoint='{5}'",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ODNCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ODNCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
@ -1406,9 +1406,9 @@ insert into ICSInventoryLot |
|
|
|
insert into ICSInventoryLot |
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','9','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','9','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSManufactureReceive where RCVCode='{6}' and Sequence='{7}' and WorkPoint='{5}'",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, RCVCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, RCVCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
@ -1653,9 +1653,9 @@ where a.DNType='3' and a.Status='2' and a.EATTRIBUTE1 is NOT null |
|
|
|
insert into ICSInventoryLot |
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','10','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','10','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSDeliveryNotice where DNCode='{6}' and Sequence='{7}' and WorkPoint='{5}'",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, DNCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, DNCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
@ -1717,9 +1717,9 @@ insert into ICSInventoryLot |
|
|
|
insert into ICSInventoryLot |
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','11','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','11','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSODeliveryNotice where ODNCode='{6}' and Sequence='{7}' and WorkPoint='{5}'",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ODNCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ODNCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
@ -1738,7 +1738,7 @@ insert into ICSInventoryLot |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
from ICSDeliveryNotice a |
|
|
|
left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
|
left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY from ICSInventoryLot a |
|
|
@ -1762,7 +1762,7 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
from ICSODeliveryNotice a |
|
|
|
left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
|
left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY from ICSInventoryLot a |
|
|
@ -1783,7 +1783,7 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @" select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
from ICSMOApplyNegDetail a |
|
|
|
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 |
|
|
@ -1848,9 +1848,9 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro |
|
|
|
sql += string.Format(@"insert into ICSInventoryLot
|
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','12','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','12','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSMOApplyNegDetail where ApplyNegCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
@ -1920,7 +1920,7 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @" select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
from ICSMOApplyNegDetail a |
|
|
|
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 |
|
|
@ -1986,9 +1986,9 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro |
|
|
|
sql += string.Format(@"insert into ICSInventoryLot
|
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','13','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','13','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSMOApplyNegDetail where ApplyNegCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
@ -2059,7 +2059,7 @@ WHERE d.Type='2'"; |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
|
|
|
|
from ICSOApplyNegDetail a |
|
|
|
left join ICSOApplyNeg d on a.OApplyNegCode=d.OApplyNegCode AND a.WorkPoint=d.WorkPoint |
|
|
@ -2125,9 +2125,9 @@ WHERE d.Type='2'"; |
|
|
|
sql += string.Format(@"insert into ICSInventoryLot
|
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','14','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','14','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSOApplyNegDetail where OApplyNegCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, OApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, OApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
@ -2197,7 +2197,7 @@ WHERE d.Type='3'"; |
|
|
|
//var queryParam = queryJson.ToJObject();
|
|
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
|
string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty,
|
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty |
|
|
|
(a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays |
|
|
|
|
|
|
|
from ICSOApplyNegDetail a |
|
|
|
left join ICSOApplyNeg d on a.OApplyNegCode=d.OApplyNegCode AND a.WorkPoint=d.WorkPoint |
|
|
@ -2263,9 +2263,9 @@ WHERE d.Type='3'"; |
|
|
|
sql += string.Format(@"insert into ICSInventoryLot
|
|
|
|
(ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) |
|
|
|
select |
|
|
|
newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','15','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','15','{3}','{4}', getdate(),'{5}','{9}' |
|
|
|
from ICSOApplyNegDetail where OApplyNegCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ",
|
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, OApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); |
|
|
|
LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, OApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); |
|
|
|
sql += "\r\n"; |
|
|
|
//}
|
|
|
|
|
|
|
|