create procedure dbo.%PROC% @sid varchar(30) = null as .BEGIN('N') .CHECK_USER .CHECK_UPDATE begin tran ----.UPDATE_STATE .ACTION_HISTORY ---.GET_PROPS declare @in_date datetime, @owner_id numeric select @in_date=dateadd(yy,1,@in_date), @owner_id=owner_id from td_depo_docs where id=@id declare @subc_str_stock varchar(255), @subc_str_money varchar(255) .NAME_VAR(@bo1_mess_res) .OPERS_ROLL('OBLIG_CLOSE_SALE_VBR') --.OPERS_ROLL(ALL) .BACK_BSPARMS_GET(@id) select @subc_str_money=@bs1_investor_subc_str .SUBC_STR_ADD(@subc_str_money,'contragents',@bs1_contragent_id,N) .SUBC_STR_ADD(@subc_str_money,'doc_sec',@id,N) select @subc_str_stock=@subc_str_money .SUBC_STR_ADD(@subc_str_stock,'stock_emis',@bs1_stock_id,N) .BACK_CANCEL_OBLIGATION(@id,@id,2,@subc_str_money,@subc_str_stock,@in_date,@owner_id,1) /*-------Проводки ----------*/ commit tran .END