IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[order_43_dolinkdata_1581]') AND type = 'P')
DROP PROCEDURE [dbo].[order_43_dolinkdata_1581]
GO
create procedure order_43_dolinkdata_1581(
@cmpid int ,
@useruid int ,
@bizid int ,
@ordbcid int,
@ordid bigint,
@jbid bigint,
@ftype varchar(10),
@fbizid int,
@fordid bigint,
@ford2tag int ,
@ford2id bigint,
@rtype varchar(10),
@rbizid int,
@rordid bigint,
@rord2tag int ,
@rord2id bigint 
) 
as 
begin



if (@ftype='biz' and @fbizid=40 and @ford2tag=0) 
update old set  old.ord_zw=new.ord_zw1 ,  old.ord_rztx=new.ord_ydhtx ,  old.ord_bmdpid=new.ord_bmdpid ,  old.ord_dpotid=new.ord_dpotid ,  old.ord_rzbm=new.ord_szzx1 ,  old.ord_xcdj=new.ord_xcdj1 ,  old.ord_xzdj=new.ord_xzdj1 ,  old.ord_zbdpid=new.ord_zbdpid ,  old.ord_zhij=new.ord_zj1 ,  old.ord_zzzb=new.ord_szbm1 ,  old.ord_rzzx=new.ord_branch
from order_43 new ,order_40 old 
where  new.ord_id=@ordid 
 and old.ord_id=new.ord_fordid

--- 下面这段程序，是完成帐务处理------

--- 帐务处理完毕 ------

end