diff --git a/SRM/NFine.Application/SRM/CreateItemLotApp.cs b/SRM/NFine.Application/SRM/CreateItemLotApp.cs index 309dce4..0a7c802 100644 --- a/SRM/NFine.Application/SRM/CreateItemLotApp.cs +++ b/SRM/NFine.Application/SRM/CreateItemLotApp.cs @@ -61,7 +61,11 @@ namespace NFine.Application FROM ICSDeliveryNotice a left join ICSPurchaseOrder b on a.PODetailID=b.PODetailID group by b.POCode,b.Sequence,a.DNType,a.WorkPoint having a.DNType='2' - + UNION ALL + select b.POCode,b.Sequence,sum(cast(a.EATTRIBUTE30 as decimal)) as returnqty,a.WorkPoint from ICSPurchaseReceive a + left join ICSPurchaseOrder b on a.SourceCode=b.POCode and a.SourceSequence=b.Sequence and a.WorkPoint=b.WorkPoint + where a.Type='2' + group by b.POCode,b.Sequence,a.WorkPoint UNION ALL SELECT b.POCode,b.Sequence,sum(isnull(a.RCVQuantity,0)) returnqty ,a.WorkPoint FROM ICSPurchaseReceive a @@ -75,7 +79,7 @@ namespace NFine.Application group by a.RCVCode,b.POCode,b.Sequence,a.WorkPoint ) dd on a.POCode=dd.POCode and a.Sequence=dd.Sequence AND a.WorkPoint=dd.WorkPoint left join ICSVendor ee on a.VenCode=ee.VenCode and a.WorkPoint=ee.WorkPoint - WHERE 1=1 AND a.ReleaseState = '1' and a.Status<>'3'"; + WHERE 1=1 AND a.ReleaseState = '1' and a.Status<>'3'"; if (!string.IsNullOrWhiteSpace(queryJson)) { if (!string.IsNullOrWhiteSpace(queryParam["ORDERNO"].ToString())) @@ -676,6 +680,11 @@ namespace NFine.Application FROM ICSDeliveryNotice a left join ICSPurchaseOrder b on a.PODetailID=b.PODetailID group by b.POCode,b.Sequence,a.DNType,a.WorkPoint having a.DNType='2' + UNION ALL + select b.POCode,b.Sequence,sum(cast(a.EATTRIBUTE30 as decimal)) as returnqty,a.WorkPoint from ICSPurchaseReceive a + left join ICSPurchaseOrder b on a.SourceCode=b.POCode and a.SourceSequence=b.Sequence and a.WorkPoint=b.WorkPoint + where a.Type='2' + group by b.POCode,b.Sequence,a.WorkPoint UNION ALL SELECT b.POCode,b.Sequence,sum(isnull(a.RCVQuantity,0)) returnqty ,a.WorkPoint diff --git a/SRM/NFine.Web/Configs/database.config b/SRM/NFine.Web/Configs/database.config index 64f10de..1c0ca67 100644 --- a/SRM/NFine.Web/Configs/database.config +++ b/SRM/NFine.Web/Configs/database.config @@ -2,12 +2,12 @@ - - + + - +