SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
create procedure [dbo].[p_policy_flotte_regul_debit_invoices]
	@policy_situation_id int
as
	set nocount on;

	select *
	from acc_invoices ai
		inner join pol_policies_situations pps on pps.pols_policy_situation_id = ai.inv_policy_situation_id
		inner join pol_policies_situations src on src.pols_policy_id = pps.pols_policy_id
	where		src.pols_policy_situation_id = @policy_situation_id
			and ai.inv_operation_code__last in ('AWR', 'CR')
GO
