|
@ -1040,11 +1040,18 @@ namespace NFine.Application.WMS |
|
|
string MUSER = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode; |
|
|
string MUSER = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode; |
|
|
string MUSERNAME = NFine.Code.OperatorProvider.Provider.GetCurrent().UserName; |
|
|
string MUSERNAME = NFine.Code.OperatorProvider.Provider.GetCurrent().UserName; |
|
|
DateTime MTime = DateTime.Now; |
|
|
DateTime MTime = DateTime.Now; |
|
|
string sql = string.Empty; |
|
|
|
|
|
|
|
|
string check = $@"IF EXISTS (SELECT ID FROM ICSWareHouseLotInfoLog WHERE TransType='15' AND TransCode IN ({codes}) )
|
|
|
|
|
|
BEGIN |
|
|
|
|
|
RAISERROR('单据已占料,请先取消占料',16,1); |
|
|
|
|
|
RETURN |
|
|
|
|
|
END;";
|
|
|
|
|
|
//Repository().ExecuteBySql(check);
|
|
|
|
|
|
SqlHelper.CmdExecuteNonQueryLi(check); |
|
|
|
|
|
string sql = String.Empty; |
|
|
StringBuilder msg=new StringBuilder(); |
|
|
StringBuilder msg=new StringBuilder(); |
|
|
if (type == "14") |
|
|
if (type == "14") |
|
|
{ |
|
|
{ |
|
|
sql = $@"SELECT a.RCVCode as Code,a.Sequence,SUM(c.Quantity) as Quantity ,a.RCVQuantity as IssueQuantity
|
|
|
|
|
|
|
|
|
sql += $@"SELECT a.RCVCode as Code,a.Sequence,SUM(c.Quantity) as Quantity ,a.RCVQuantity as IssueQuantity
|
|
|
FROM ICSManufactureReceive a |
|
|
FROM ICSManufactureReceive a |
|
|
left JOIN ICSInventoryLotDetail b ON a.RCVCode=b.TransCode AND a.Sequence=b.TransSequence |
|
|
left JOIN ICSInventoryLotDetail b ON a.RCVCode=b.TransCode AND a.Sequence=b.TransSequence |
|
|
left JOIN ICSInventoryLot c ON c.LotNo=b.LotNo |
|
|
left JOIN ICSInventoryLot c ON c.LotNo=b.LotNo |
|
@ -1054,7 +1061,7 @@ namespace NFine.Application.WMS |
|
|
} |
|
|
} |
|
|
else if (type == "15") |
|
|
else if (type == "15") |
|
|
{ |
|
|
{ |
|
|
sql = $@"SELECT a.InCode as Code,a.Sequence,SUM(c.Quantity) as Quantity ,a.InQuantity as IssueQuantity
|
|
|
|
|
|
|
|
|
sql += $@"SELECT a.InCode as Code,a.Sequence,SUM(c.Quantity) as Quantity ,a.InQuantity as IssueQuantity
|
|
|
FROM ICSOtherIn a |
|
|
FROM ICSOtherIn a |
|
|
left JOIN ICSInventoryLotDetail b ON a.InCode=b.TransCode AND a.Sequence=b.TransSequence |
|
|
left JOIN ICSInventoryLotDetail b ON a.InCode=b.TransCode AND a.Sequence=b.TransSequence |
|
|
left JOIN ICSInventoryLot c ON c.LotNo=b.LotNo |
|
|
left JOIN ICSInventoryLot c ON c.LotNo=b.LotNo |
|
@ -1064,7 +1071,7 @@ namespace NFine.Application.WMS |
|
|
} |
|
|
} |
|
|
else if (type == "16") |
|
|
else if (type == "16") |
|
|
{ |
|
|
{ |
|
|
sql = $@"SELECT a.ApplyNegCode as Code,a.Sequence,SUM(c.Quantity) as Quantity ,a.IssueNegQuantity as IssueQuantity FROM ICSMOApplyNegDetail a
|
|
|
|
|
|
|
|
|
sql += $@"SELECT a.ApplyNegCode as Code,a.Sequence,SUM(c.Quantity) as Quantity ,a.IssueNegQuantity as IssueQuantity FROM ICSMOApplyNegDetail a
|
|
|
left JOIN ICSInventoryLotDetail b ON a.ApplyNegCode=b.TransCode AND a.Sequence=b.TransSequence |
|
|
left JOIN ICSInventoryLotDetail b ON a.ApplyNegCode=b.TransCode AND a.Sequence=b.TransSequence |
|
|
left JOIN ICSInventoryLot c ON c.LotNo=b.LotNo |
|
|
left JOIN ICSInventoryLot c ON c.LotNo=b.LotNo |
|
|
WHERE a.ApplyNegCode in ({codes}) |
|
|
WHERE a.ApplyNegCode in ({codes}) |
|
@ -1073,7 +1080,7 @@ namespace NFine.Application.WMS |
|
|
} |
|
|
} |
|
|
else if (type == "17") |
|
|
else if (type == "17") |
|
|
{ |
|
|
{ |
|
|
sql = $@"SELECT a.SDNCode as Code,a.Sequence,SUM(c.Quantity) as Quantity ,a.SDNQuantity as IssueQuantity
|
|
|
|
|
|
|
|
|
sql += $@"SELECT a.SDNCode as Code,a.Sequence,SUM(c.Quantity) as Quantity ,a.SDNQuantity as IssueQuantity
|
|
|
FROM ICSSDN a |
|
|
FROM ICSSDN a |
|
|
left JOIN ICSInventoryLotDetail b ON a.SDNCode=b.TransCode AND a.Sequence=b.TransSequence |
|
|
left JOIN ICSInventoryLotDetail b ON a.SDNCode=b.TransCode AND a.Sequence=b.TransSequence |
|
|
left JOIN ICSInventoryLot c ON c.LotNo=b.LotNo |
|
|
left JOIN ICSInventoryLot c ON c.LotNo=b.LotNo |
|
|