SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[p_claim_recovery_add]
	@claim_id int,
	@variable_id int, 
	@amount ais_decimal2,
	@user_code ais_code_medium
AS

	/*
	DGE
	Ajouter une ligne de prévision de recours

	*/

	insert into claim_variables_recoveries(clvr_claim_id, clvr_variable_id, clvr_date, clvr_amount, clvr_user_code)
	values (@claim_id, @variable_id, GETDATE(), @amount, @user_code)

	update	claim_variables
	set		clv_recovery = @amount
	where	clv_claim_id = @claim_id
	and		clv_variable_id = @variable_id
GO
