|
|
@ -61,7 +61,11 @@ namespace NFine.Application |
|
|
FROM ICSDeliveryNotice a |
|
|
FROM ICSDeliveryNotice a |
|
|
left join ICSPurchaseOrder b on a.PODetailID=b.PODetailID |
|
|
left join ICSPurchaseOrder b on a.PODetailID=b.PODetailID |
|
|
group by b.POCode,b.Sequence,a.DNType,a.WorkPoint having a.DNType='2' |
|
|
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 |
|
|
UNION ALL |
|
|
SELECT b.POCode,b.Sequence,sum(isnull(a.RCVQuantity,0)) returnqty ,a.WorkPoint |
|
|
SELECT b.POCode,b.Sequence,sum(isnull(a.RCVQuantity,0)) returnqty ,a.WorkPoint |
|
|
FROM ICSPurchaseReceive a |
|
|
FROM ICSPurchaseReceive a |
|
|
@ -676,6 +680,11 @@ namespace NFine.Application |
|
|
FROM ICSDeliveryNotice a |
|
|
FROM ICSDeliveryNotice a |
|
|
left join ICSPurchaseOrder b on a.PODetailID=b.PODetailID |
|
|
left join ICSPurchaseOrder b on a.PODetailID=b.PODetailID |
|
|
group by b.POCode,b.Sequence,a.DNType,a.WorkPoint having a.DNType='2' |
|
|
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 |
|
|
UNION ALL |
|
|
SELECT b.POCode,b.Sequence,sum(isnull(a.RCVQuantity,0)) returnqty ,a.WorkPoint |
|
|
SELECT b.POCode,b.Sequence,sum(isnull(a.RCVQuantity,0)) returnqty ,a.WorkPoint |
|
|
|