修改库位错误
This commit is contained in:
@@ -19,7 +19,7 @@ namespace NX.ERP.Model.Purchase
|
||||
public string UnitCode { get => unitCode; set => unitCode = value; }
|
||||
public double Qty { get => quantity; set => quantity = value; }
|
||||
public double RealQuantity { get; set; }
|
||||
public string cPosName { get; set; }
|
||||
/// public string cPosName { get; set; }
|
||||
/// <summary>
|
||||
/// 审批状态2 说明已经审核过了
|
||||
/// </summary>
|
||||
|
||||
@@ -58,9 +58,9 @@ namespace NX.ERP.U8.Purchase
|
||||
<> 1 THEN 0 ELSE (CASE WHEN isnull(d.igrouptype, 0)
|
||||
= 1 THEN unit2.ichangrate ELSE ((isnull(b.iquantity, 0) - isnull(b.finspectquantity, 0))
|
||||
/ (isnull(b.inum, 0) - isnull(b.finspectnum, 0))) END) END) AS inspecexchrate,
|
||||
e.POID as Poid,Pos.cPosName,
|
||||
CASE WHEN isnull(f.bflowprocess, 0) = 1 THEN isnull(f.bstoragearrivalorder, 1) ELSE 1 END AS bstoragearrivalorder,
|
||||
Pos.cPosName
|
||||
e.POID as Poid,--Pos.cPosName,
|
||||
CASE WHEN isnull(f.bflowprocess, 0) = 1 THEN isnull(f.bstoragearrivalorder, 1) ELSE 1 END AS bstoragearrivalorder
|
||||
--,Pos.cPosName
|
||||
from PU_ArrivalVouch a
|
||||
|
||||
left join PU_ArrivalVouchs b on a.ID=b.ID
|
||||
@@ -70,13 +70,9 @@ namespace NX.ERP.U8.Purchase
|
||||
LEFT JOIN dbo.ComputationUnit AS Unit1 ON d.cComUnitCode = Unit1.cComunitCode
|
||||
Left Join PO_Podetails e ON B.iPOsID = e.ID
|
||||
LEFT JOIN dbo.PUBizFlow f ON f.iFlowID = a.iflowid
|
||||
left join (SELECT cinvcode, STUFF(( SELECT ','+ cPosName FROM ( select b.cPosName,a.cInvCode,a.iQuantity from InvPositionSum a left join Position b on a.cPosCode=b.cPosCode
|
||||
where a.iQuantity <>0) a WHERE b.cinvcode = a.cinvcode order by a.iQuantity desc FOR XML PATH('')),1 ,1, '') cPosName
|
||||
FROM InvPositionSum b
|
||||
GROUP BY cinvcode
|
||||
) Pos on b.cInvCode=Pos.cInvCode
|
||||
|
||||
where
|
||||
(isnull(cbustype,'')<>'委外加工') and isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'')
|
||||
(isnull(cbustype,'')<>'委外加工') --and isnull (b.cInvCode,'')=isnull(Pos.cInvCode,'')
|
||||
and isnull(b.cbcloser,'')='' And isnull(a.cverifier,'')<>''
|
||||
And a.iBillType ='0' and isnull(b.bGsp,'')='0' and (isnull(b.iQuantity,0)-isnull(b.fRefuseQuantity,0)>isnull(b.fValidInQuan,0) or (d.igrouptype=2
|
||||
and isnull(b.inum,0)-isnull(b.frefusenum,0)>isnull(b.fvalidinnum,0))) and isnull(bStorageArrivalOrder,1)=1 ";
|
||||
|
||||
@@ -85,8 +85,9 @@ from InvPositionSum as a left join Inventory as b on a.cInvCode=b.cInvCode where
|
||||
var sql = @" select * from (select stock.cInvCode MaterialCode,stock.Qty as StockQty ,arrival.arrivalQty,d.cInvName as MaterialName,d.cInvStd as MaterialSpecsModel from (select cInvCode,SUM( iQuantity) as Qty from CurrentStock
|
||||
group by cInvCode ) as stock
|
||||
left join
|
||||
(select cInvCode,SUM(iQuantity)-SUM(fValidInQuan) as arrivalQty from PU_ArrivalVouchs a,PU_ArrivalVouch b
|
||||
where a.ID=b.ID and isnull(b.cverifier,'')<>'' and bNegative=0
|
||||
(select cInvCode,SUM(iQuantity)-SUM(fValidInQuan) as arrivalQty from PU_ArrivalVouchs a
|
||||
left join PU_ArrivalVouch b on a.ID=b.ID
|
||||
where isnull(b.cverifier,'')<>'' and bNegative=0
|
||||
group by cInvCode) as arrival on stock.cInvCode=arrival.cInvCode
|
||||
left join Inventory as d on stock.cInvCode=d.cInvCode
|
||||
) as tbl where (StockQty<>0 or arrivalQty<>0)
|
||||
|
||||
Reference in New Issue
Block a user