
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE view [dbo].[vw_acc_invoices_clients_policy]
as
	/*
	DGE
	Utiliser cette vue pour obtenir les informations invoice + client + policy
	*/
	select	i.*,
			act.*,
			adr.*,
			ps.*,
			p.*
	from	acc_invoices i
			inner join acc_accounts a on a.a_account_id = i.inv_invoice_id
			inner join act_actors act on act.act_actor_id = a.a_actor_id
			inner join adr_addresses adr on adr.adr_address_id = act.act_address_id  
			inner join pol_policies_situations ps on ps.pols_policy_situation_id = i.inv_policy_situation_id 
			inner join pol_policies p on p.pol_policy_id = ps.pols_policy_id










GO
