您的位置: 龙岩金蝶软件论坛 -> 金蝶软件 -> K3-WISE -> 客户资料更改后电子发票客户对应关系表里面... 
本帖共有361个阅读者
发表帖子 发表投票 回复主题
客户资料更改后电子发票客户对应关系表里面的资料不会更改
尊贵身份标志
cyy275(管理员)
cyy275
头衔:社区公民
帮派:无帮无派
帖数:497
金钱:100000
积分:2248
注册时间:2017-5-8
楼主信息 | 留言 | Email | 主页 | 编辑 | 管理 | 离线
客户资料更改后电子发票客户对应关系表里面的资料不会更改


alter TRIGGER [dbo].[khupdate_mycyy]
            ON [dbo].[t_Organization]
FOR insert,update
AS

declare @fitemid int
select @fitemid=fitemid from inserted

if  exists(select 1 from t_CustInfoMapp where FCustomer=@fitemid)
begin

update t_CustInfoMapp set
FInvCustName=v2.FName,FTaxpayerCode=isnull(v2.FTaxNum,''),FCompAddrPhone=isnull(v2.FAddress,''),FBankAndAccount=isnull(v2.FBank,'')+' '+isnull(FAccount,''),FContactNum=isnull(v2.FPhone,''),FEmail=isnull(v2.FEmail,'')
from t_CustInfoMapp v1
join t_Organization v2 on v1.FCustomer=v2.FItemID
where v2.fitemid=@fitemid

end
else
begin


declare @finterid int
declare @fbillno varchar(20)
exec GetICMaxNum 't_CustInfoMapp',@finterid output,1
exec p_BM_GetBillNo 1000201,@fbillno output
insert into t_CustInfoMapp
select @finterid,1000201,@fbillno,FName,ISNULL(FTaxNum,''),ISNULL(FAddress,''),ISNULL(fitemid,''),ISNULL(FBank,'')+' '+ISNULL(FAccount,''),0,ISNULL(FPhone,''),
ISNULL(FEmail,'')    from inserted

end



今天的努力,明天的享受!
今天的无为,明天的无助!
今天的迷茫,明天的受累!
等级:管理员 参考IP地址:*.*.*.*
2019-4-23 20:44:46
Powered by 金蝶论坛 Copyright © 2011 www.xxhcom.cn. All rights reserved.