0118工作备份

select * from ICTransType
select * from ICTemplateEntry where fid='B08'
select * from ppbom where FBillNo='PBOM000278'
select * from ppbomentry where FInterID=1278
select ficmointerid from ICStockBillEntry
select * from t_Department
select * from t_Item where FItemClassID=2
select a1.fitemid,a1.FAuxQty,a1.FICMOInterID from ICStockBillEntry a1 inner join ppbom b1 on a1.FICMOInterID=b1.FICMOInterID

inner join ICStockBill c1 on a1.finterid=c1.finterid where c1.FTranType=28
select * from ppbom where FICMOInterID=1380
select fitemid,FAuxStockQty from ppbomentry where FInterID=1618

DECLARE @FFAUXQTY decimal(18,10)
DECLARE @FITEMID int
DECLARE @FDCSTOCKID int
DECLARE @finterid int
DECLARE @FAuxStockQty int
DECLARE @FTranType int
DECLARE @FAuxQtyMust decimal(18,10)
DECLARE @FICMOInterID int
DECLARE @ppbomfinterid int
DECLARE @FQTY decimal(18,10)
DECLARE @FAUXQTY decimal(18,10)
DECLARE #point_cursor CURSOR
FOR
SELECT a1.FItemID ,a1.FAuxQty,a1.FICMOInterID from
ICStockBillEntry a1 inner join ppbom b1 on a1.FICMOInterID=b1.FICMOInterID
inner join ICStockBill c1 on a1.finterid=c1.finterid where c1.FTranType=28
OPEN #point_cursor
FETCH NEXT FROM #point_cursor INTO @fitemid,@FAuxStockQty,@FICMOInterID
while @@fetch_status = 0
BEGIN

select @ppbomfinterid=finterid from PPBOM where FICMOInterID=@FICMOInterID
update ppbomentry set FAuxStockQty=FAuxStockQty+@FAuxStockQty where FInterID=@ppbomfinterid and FItemID=@FITEMID
FETCH NEXT FROM #point_cursor INTO @fitemid,@FAuxStockQty,@FICMOInterID
END
CLOSE #point_cursor
DEALLOCATE #point_cursor

update ppbomentry set FAuxStockQty=0

转载于:https://www.cnblogs.com/xujiating/p/6295995.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值