1
This commit is contained in:
@@ -855,7 +855,7 @@ select *from tempdb..tablepzck20210526
|
||||
public NX.ERP.Model.saleRes InventorySale(NX.ERP.Model.Request.SaleinvRequest info1)
|
||||
{
|
||||
string sql = $@"
|
||||
select *from (
|
||||
select *from (
|
||||
select f.cCusAbbName,CONVERT(varchar(100),b.dDate, 23) as dDate ,b.cSOCode,a.cInvCode,a.cInvName,g.cInvStd, FLOOR(a.iQuantity - isnull(d.cqty,0)) as wfiQuantity,b.cCloser
|
||||
,
|
||||
FLOOR(isnull(cs.qty,0)) as xcl,
|
||||
@@ -865,28 +865,28 @@ select *from tempdb..tablepzck20210526
|
||||
(SELECT isnull(SUM(iquantity),0) qty
|
||||
FROM currentstock WITH (nolock) where cInvCode=a.cInvCode
|
||||
GROUP BY cInvCode
|
||||
),0)-( select sum(aa.iQuantity - isnull(dd.cqty,0)) as swfiQuantity from SO_SODetails aa WITH (nolock) LEFT JOIN
|
||||
),0)-( select isnull(sum(aa.iQuantity - isnull(dd.cqty,0)),0) as swfiQuantity from SO_SODetails aa WITH (nolock) LEFT JOIN
|
||||
SO_SOMain bb WITH (nolock) on aa.ID=bb.id left join
|
||||
(SELECT ipesodid, sum(iQuantity) AS cqty
|
||||
FROM rdrecords32 WITH (nolock)
|
||||
GROUP BY ipesodid) dd on isnull(dd.ipesodid,'')=isnull(aa.iSOsID ,'')
|
||||
where aa.cInvCode=a.cInvCode and isnull( bb.cCloser ,'') ='' and bb.cVerifier is not null and isnull(CONVERT(varchar(100),aa.dPreDate, 23),'1900-01-01')<=isnull(CONVERT(varchar(100),a.dPreDate, 23),'1900-01-01') and (aa.iQuantity - isnull(dd.cqty,0))>0
|
||||
where aa.cInvCode=a.cInvCode and isnull( bb.cCloser ,'') ='' and isnull(CONVERT(varchar(100),aa.dPreDate, 23),'1900-01-01')<=isnull(CONVERT(varchar(100),a.dPreDate, 23),'1900-01-01') and (aa.iQuantity - isnull(dd.cqty,0))>0
|
||||
group by aa.cInvCode
|
||||
) )>0 then 0 else (
|
||||
isnull(
|
||||
(SELECT isnull(SUM(iquantity),0) qty
|
||||
FROM currentstock WITH (nolock) where cInvCode=a.cInvCode
|
||||
GROUP BY cInvCode
|
||||
),0)-( select sum(aa.iQuantity - isnull(dd.cqty,0)) as swfiQuantity from SO_SODetails aa WITH (nolock) LEFT JOIN
|
||||
),0)-( select isnull(sum(aa.iQuantity - isnull(dd.cqty,0)),0) as swfiQuantity from SO_SODetails aa WITH (nolock) LEFT JOIN
|
||||
SO_SOMain bb WITH (nolock) on aa.ID=bb.id left join
|
||||
(SELECT ipesodid, sum(iQuantity) AS cqty
|
||||
FROM rdrecords32 WITH (nolock)
|
||||
GROUP BY ipesodid) dd on isnull(dd.ipesodid,'')=isnull(aa.iSOsID ,'')
|
||||
where aa.cInvCode=a.cInvCode and isnull( bb.cCloser ,'') =''and bb.cVerifier is not null and isnull(CONVERT(varchar(100),aa.dPreDate, 23),'1900-01-01')<=isnull(CONVERT(varchar(100),a.dPreDate, 23),'1900-01-01') and (aa.iQuantity - isnull(dd.cqty,0))>0
|
||||
where aa.cInvCode=a.cInvCode and isnull( bb.cCloser ,'') ='' and isnull(CONVERT(varchar(100),aa.dPreDate, 23),'1900-01-01')<=isnull(CONVERT(varchar(100),a.dPreDate, 23),'1900-01-01') and (aa.iQuantity - isnull(dd.cqty,0))>0
|
||||
group by aa.cInvCode
|
||||
) ) end )as kcyl
|
||||
,
|
||||
CONVERT(varchar(100),a.dPreDate, 23) as dPreDate , a.cMemo,
|
||||
CONVERT(varchar(100),a.dPreDate, 23) as dPreDate , a.cMemo as cmemo,
|
||||
CASE
|
||||
WHEN DATEDIFF(day,a.dPreDate,GETDATE()) > -15 AND DATEDIFF(day,a.dPreDate,GETDATE()) < 0 THEN '15天内发货'
|
||||
WHEN DATEDIFF(day,a.dPreDate,GETDATE()) <= -15 THEN '15天以上发货'
|
||||
@@ -905,11 +905,7 @@ select *from tempdb..tablepzck20210526
|
||||
GROUP BY cInvCode) cs ON a.cInvCode = cs.cInvCode
|
||||
|
||||
left join Customer f WITH (nolock) on b.cCusCode=f.cCusCode
|
||||
left join Inventory g WITH (nolock) on g.cInvCode=a.cInvCode ) mm
|
||||
|
||||
|
||||
|
||||
|
||||
left join Inventory g WITH (nolock) on g.cInvCode=a.cInvCode ) mm
|
||||
|
||||
|
||||
";
|
||||
@@ -919,7 +915,7 @@ select *from tempdb..tablepzck20210526
|
||||
|
||||
// where.Add(" a.iQuantity - isnull(d.cqty,0) >0 and b.cVerifier is not null ");
|
||||
|
||||
where.Add(" mm.wfiQuantity >0 and mm.cVerifier is not null and mm.cInvCode like '9%' and isnull( mm.cCloser ,'') ='' ");
|
||||
where.Add(" mm.wfiQuantity >0 and mm.cInvCode like '9%' and isnull( mm.cCloser ,'') ='' ");
|
||||
if(info1 ==null)
|
||||
{
|
||||
info1 = new NX.ERP.Model.Request.SaleinvRequest();
|
||||
|
||||
Reference in New Issue
Block a user