东莞精诚网络技术交流论坛

 找回密码
 注册
搜索
热搜: 活动 交友 discuz
查看: 3000|回复: 0

专业版领料单多仓库同单处理方法

[复制链接]
发表于 2008-11-24 19:45:49 | 显示全部楼层 |阅读模式
金蝶K3则可以在表体录入仓库项。表体录入仓库好啊!一张单子可以同时出多个仓库的材料,避免了填写多张单据的麻烦。但专业版估计由于产品定位的原因,只能在表头录入仓库项。但仔细分析其数据结构,似乎。。。似乎。。。也是在后台处理表体仓库的,那还等什么?

以下仅为专业版生产领料单处理语句,其他单据应该可以类似处理。

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ICStockBill_UPDATE]') and OBJECTPROPERTY(id, N'IsTrigger') = 1)
drop trigger [dbo].[ICStockBill_UPDATE]
GO
CREATE TRIGGER ICStockBill_UPDATE ON dbo.ICStockBill
FOR INSERT,UPDATE
AS
if exists (select * from inserted where ftrantype <> 24) --2008-01-11,狂啸三声,排除生产领料单
begin
  Update E Set E.FDCStockID=E.FDVStockID
  From ICStockBillEntry E Inner Join INSERTED I On I.FInterID=E.FInterID
  Where IsNull(E.FDVStockID,0)<>0 And I.FTranType In (1,21)
  --Update E Set E.FDCStockID=I.FDCStockID
  --From ICStockBillEntry E Inner Join INSERTED I On I.FInterID=E.FInterID
  --Where IsNull(E.FDVStockID,0)=0 And I.FTranType In (1,21)
  Update E Set E.FSCStockID=E.FDVStockID
  From ICStockBillEntry E Inner Join INSERTED I On I.FInterID=E.FInterID
  Where IsNull(E.FDVStockID,0)<>0 And I.FTranType In (24)
  --Update E Set E.FSCStockID=E.FSCStockID
  --From ICStockBillEntry E Inner Join INSERTED I On I.FInterID=E.FInterID
  --Where IsNull(E.FDVStockID,0)=0 And I.FTranType In (24)
  Update E Set E.FDCStockID=IsNull(I.FDCStockID,0),E.FSCStockID=IsNull(I.FSCStockID,0)
  From ICStockBillEntry E Inner Join INSERTED I On I.FInterID=E.FInterID
  Where IsNull(E.FDVStockID,0)=0
end
GO
update ictemplateentry set fvisforbilltype = 31 , fmustinput = 1 ,  ffilter = 'FTypeID not in (501,502,503)' where fid = 'B04' and ffieldname = 'FSCStockID'
go
update ictemplate set fmustinput = 0 where fid = 'B04' and ffieldname = 'FSCStockID'
go




注: 以上语句仅在9.1上简单测试,如果您应用于实际请自行测试,后果自负
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|手机版|Archiver|精诚网络 ( 粤ICP备13030199号 )

GMT+8, 2023-1-31 18:17 , Processed in 0.051511 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表