增加单据异常查询
This commit is contained in:
@@ -37,25 +37,24 @@ SELECT cinvcode,
|
||||
),1 ,1, '') cPosName
|
||||
FROM InvPositionSum b
|
||||
GROUP BY cinvcode
|
||||
|
||||
|
||||
|
||||
select a.id AS ArrivalId,a.cCode as ArrivalCode,a.cpersoncode,a.cpersonname,A.cbustype AS busType,a.cptcode as PTCode,a.iTaxRate as TaxRate,a.iexchrate as Exchrate,cexch_name as ExchName,cVenCode as VenCode,a.dDate as ArrivalDate,A.cVenCode AS SupplierCode,
|
||||
select a.id AS ArrivalId,a.cCode as ArrivalCode,a.cpersoncode,a.cpersonname,A.cbustype AS busType,a.cptcode as PTCode,a.iTaxRate as TaxRate,a.iexchrate as Exchrate,cexch_name as ExchName,cVenCode as VenCode, CONVERT(varchar(100), a.dDate, 23) as ArrivalDate,A.cVenCode AS SupplierCode,
|
||||
B.Autoid as id,b.ID as ArrivalID,
|
||||
b.cInvCode AS MaterialCode,
|
||||
b.cInvCode AS MaterialCode,cinvname ,cinvstd,
|
||||
b.cBatch AS BatchNo,
|
||||
b.fvalidinquan as RealQuantity,
|
||||
b.ccomunitcode AS UnitCode,b.ioricost as oricost,b.ioritaxcost as oritaxcost ,b.icost as cost,b.iorimoney as orimoney,b.ioritaxprice as oritaxprice,b.iorisum as orisum,b.isum as sum,
|
||||
B.iQuantity as Quantity,b.iposid as PosId ,B.CORDERCODE as OrderCode,C.POID as Poid,b.iNum,b.ccomunitcode,b.cunitid,b.cinva_unit,b.cinvm_unit,b.inspecexchrate,
|
||||
Pos.cPosName
|
||||
FROM pu_ArrBody b , pu_ArrHead a
|
||||
, (select cinvcode as cinvcode1,iId from inventory) inventory
|
||||
, PO_Podetails C WITH (NOLOCK) ,
|
||||
tempdb..tablearrive20210603 Pos -- on isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'')
|
||||
Where ( (1>0) AND (1>0) ) AND ( 1>0 ) and (isnull(cbustype,'')<>'委外加工') and isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'')
|
||||
FROM pu_ArrBody b left join tempdb..tablearrive20210603 Pos on isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'') , pu_ArrHead a
|
||||
, (select cinvcode as cinvcode1,iId from inventory WITH (NOLOCK) ) inventory
|
||||
, PO_Podetails C WITH (NOLOCK)
|
||||
|
||||
Where ( (1>0) AND (1>0) ) AND ( 1>0 ) and (isnull(cbustype,'')<>'委外加工') -- and ( isnull (b.cInvCode,'')=isnull(Pos.cInvCode,''))
|
||||
And (1=1) and isnull(b.cbcloser,N'')=N'' And isnull(a.cverifier,'')<>'' and a.id=b.id and b.cinvcode=inventory.cinvcode1 and B.iPOsID = C.ID
|
||||
And a.iBillType =N'0' and isnull(b.bGsp,N'')=N'0' and (isnull(b.iQuantity,0)-isnull(b.fRefuseQuantity,0)>isnull(b.fValidInQuan,0) or (b.igrouptype=2
|
||||
and isnull(b.inum,0)-isnull(b.frefusenum,0)>isnull(b.fvalidinnum,0))) and isnull(a.bStorageArrivalOrder,1)=1 and 1=1
|
||||
|
||||
";
|
||||
|
||||
List<string> where = new List<string>();
|
||||
|
||||
Reference in New Issue
Block a user