commit
This commit is contained in:
@@ -11,16 +11,21 @@ namespace NX.ERP.U8.Purchase
|
||||
{
|
||||
using (var conn = U8LoginContext.Instance.Connection)
|
||||
{
|
||||
string strSQL = @"select a.id AS ArrivalId,a.cCode as ArrivalCode,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,
|
||||
string strSQL = @"select a.id AS ArrivalId,a.cCode as ArrivalCode,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,
|
||||
B.Autoid as id,b.ID as ArrivalID,
|
||||
b.cInvCode AS MaterialCode,
|
||||
b.cBatch AS BatchNo,
|
||||
b.fRealQuantity as RealQuantity,
|
||||
b.cUnitID 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.iQuantity as Quantity,b.iposid as PosId ,B.CORDERCODE as OrderCode,C.POID as Poid from
|
||||
pu_ArrHead as a
|
||||
left join pu_arrbody as b on a.id=b.id
|
||||
Left Join PO_Podetails C WITH (NOLOCK) ON B.iPOsID = C.ID where ISNULL( a.cverifier,'')<>'' and a.id in (select id from PO_Podetails where fRealQuantity<>iQuantity ) ";
|
||||
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.iQuantity as Quantity,b.iposid as PosId ,B.CORDERCODE as OrderCode,C.POID as Poid
|
||||
FROM pu_ArrBody b inner join pu_ArrHead a on a.id=b.id
|
||||
inner join (select cinvcode as cinvcode1,iId from inventory) inventory on b.cinvcode=inventory.cinvcode1
|
||||
Left Join PO_Podetails C WITH (NOLOCK) ON B.iPOsID = C.ID
|
||||
Where ( (1>0) AND (1>0) ) AND ( 1>0 ) and (isnull(cbustype,'')<>'委外加工')
|
||||
And (1=1) and isnull(b.cbcloser,N'')=N'' And isnull(a.cverifier,'')<>''
|
||||
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
|
||||
";
|
||||
if (!string.IsNullOrEmpty(strWhere))
|
||||
{
|
||||
strSQL += $" and {strWhere} ";
|
||||
|
||||
Reference in New Issue
Block a user