|
金蝶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上简单测试,如果您应用于实际请自行测试,后果自负 |
|