<?xml version="1.0" encoding="utf-8"?>
<AisMenuItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/AisMenuItem.xsd">
	<Action>stat</Action>
	<SecondAction></SecondAction>
	<Ico></Ico>
  <Label>
    <L1>Products - fleet - fusion</L1>
    <L2>Produits - flottes - fusion vignettes</L2>
  </Label>
  <Description>
    <L1>Fusion des vignettes flottes</L1>
    <L2>Fusion des vignettes flottes</L2>
  </Description>
  <Stat>
    <FileMajorVersion>1</FileMajorVersion>
    <FileMinorVersion>0</FileMinorVersion>
    <Parameters>
      <Parameter>
        <Name>policy</Name>
        <Type>string</Type>
        <Label>
          <L1>Policy</L1>
          <L2>Police</L2>
        </Label>
      </Parameter>
    </Parameters>
    <SQL>
	select
	[Assure] = adr_complete_name
	,[Adresse] = adr_address1
	,[code postal] = adr_postal_code
	,[ville] = adr_city
	,[Police] = pols_number
	,[Immatriculation] = riss_number
	,[Marque] = rcpl_GENE_MARQUE
	,[Effet] = convert(varchar(10),case when riss_entrance_date > pols_mvt_date then riss_entrance_date else pols_mvt_date end,103)
	,[Echeance] = convert(varchar(10),case when isnull(riss_retire_date,dateadd(day,-1,pols_next_principal_renewal_date)) >= dateadd(day,-1,pols_next_principal_renewal_date) then dateadd(day,-1,pols_next_principal_renewal_date) else riss_retire_date end,103)
	from
	pol_policies
	inner join pol_policies_situations on pol_policy_id = pols_policy_id
	inner join ris_risks on pol_policy_id = ris_policy_id
	inner join ris_risks_situations rrs on ris_last_risk_situation_id = rrs.riss_risk_situation_id and rrs.riss_policy_situation_id = pols_policy_situation_id
	inner join vw_act_clients on cli_actor_id = pol_client_id
	left join pr_products on prd_product_code = pol_product_code
	inner join ris_cpl on rcpl_risk_situation_id = riss_risk_situation_id
	where pols_number like @policy+'%'
	and prd_family_code = 'MO6A'
  and pols_act_code not in ('QUOT')
  and case when isnull(riss_retire_date,dateadd(day,-1,pols_next_principal_renewal_date)) >= dateadd(day,-1,pols_next_principal_renewal_date) then dateadd(day,-1,pols_next_principal_renewal_date) else riss_retire_date end >= getdate()
    </SQL>
</Stat>

</AisMenuItem>
