You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

1906 lines
60 KiB

<?xml version="1.0" encoding="ISO-8859-1"?>
<VUE name="ACTI000096" label="Synthèse comptable"
title="= 'Synthèse comptable - ' + SELECT.CH_LABEL + ' (' + VIEW.ANNEE_D + '-' + SELECT.ANNEE_F + ')'"
database="iCTI" swf="*CTI_view1" softCode="iCTI_activite" globals="ACTI_globals.XML"
helpFile="iCTI_ACTI_ACTI000096.HTML"
helpDokuWIkiDir="activite:qualite:benchmark"
helpDokuWIkiFile="acti000096"
>
<title><![CDATA[=
var title:String = 'Synthèse comptable';
title = title + ' de ' + [VIEW.ANNEE_D] + ' à ' + SELECT.ANNEE_F;
if (SELECT.PROVIDER != '-1') {
title = title + ' (' + SELECT.PROVIDER_LABEL + ')'
}
return title;
]]></title>
<VIEWPROPERTIES>
<PROPERTY name="CH" value="[EVAL
if ('[CH]' != 'H') {return '_c';} else {return '_h';}
EVAL]" />
<PROPERTY name="PROVIDER_SELECT" value="[EVAL
if ('[PROVIDER]' != '-1') {return ' AND provider_id = ' . substr('[PROVIDER]',2);}
return '';
EVAL]"/>
<PROPERTY dataLink="VIEWPROPERTIES" nameField="name" valueField="value" />
<PROPERTY name="ANNEE_D">
<value><![CDATA[[EVAL
return [ANNEE_F]- 2;
EVAL]]]></value>
</PROPERTY>
<PROPERTY name="ANNEE_LD">
<value><![CDATA[[EVAL
return [ANNEE_F]- 1;
EVAL]]]></value>
</PROPERTY>
</VIEWPROPERTIES>
<SELECTIONS label="Paramètres">
<GROUP label="Année">
<FIELD name="ANNEE_F" label="" UI="combo" width="150" default="2011" >
<OPTION dataLink="ANNEES" dataField="annee" labelField="annee" />
</FIELD>
</GROUP>
<GROUP>
<FIELD name="CH" label="C/H" UI="combo" width="150" default="C" >
<OPTION data="C" label="Clinique" />
<OPTION data="H" label="Honoraires"/>
</FIELD>
</GROUP>
</SELECTIONS>
<QUERIES>
<QUERY>
<SQL>
<select><![CDATA[
DROP TABLE IF EXISTS w_chiffrier;
CREATE TEMP TABLE w_chiffrier AS
SELECT
date(date_trunc('month',date_comptable) + interval '1 month' - interval '1 day') AS date_comptable,
SUM(montant_comptabilise) AS montant_comptabilise,
SUM(montant_regle) AS montant_regle,
COUNT(DISTINCT CASE WHEN date_trunc('month', p_factures.date_vente) = date_trunc('month', date_comptable) THEN p_factures.no_sejour ELSE null END) AS nb_sejour,
0::numeric AS montant_solde,
0::numeric AS montant_encours_cti,
0::numeric AS montant_encours_prs,
0::numeric AS montant_report_encours_cti,
0::numeric AS montant_report_encours_prs
FROM activite.p_factures_soldes[VIEW.CH] p_factures_soldes
JOIN activite.p_factures ON p_factures_soldes.no_facture = p_factures.no_facture
WHERE date_comptable <= date(date_trunc('month',now()) + interval '1 month' - interval '1 day')
GROUP BY 1
ORDER BY 1;
UPDATE w_chiffrier
SET montant_solde =
(SELECT SUM(montant_comptabilise - montant_regle)
FROM w_chiffrier w_chiffrier_histo
WHERE w_chiffrier_histo.date_comptable <= w_chiffrier.date_comptable);
-- Reprise des encours
UPDATE w_chiffrier SET
montant_encours_cti = subview.montant_encours_cti,
montant_encours_prs = subview.montant_encours_prs
FROM
(
SELECT
date(date_trunc('month',date_encours) + interval '1 month' - interval '1 day') AS date_comptable,
SUM(CASE WHEN code_origine = 'C' THEN montant_encours_c ELSE 0 END) AS montant_encours_cti,
SUM(CASE WHEN code_origine = 'P' THEN montant_encours_c ELSE 0 END) AS montant_encours_prs
FROM activite.p_factures_encours
GROUP BY 1
) subview
WHERE w_chiffrier.date_comptable = subview.date_comptable;
UPDATE w_chiffrier SET
montant_report_encours_cti = w_chiffrier_2.montant_encours_cti
FROM w_chiffrier w_chiffrier_2
WHERE date_trunc('month',w_chiffrier.date_comptable) - interval '1 month' =
date_trunc('month',w_chiffrier_2.date_comptable)
;
]]></select>
</SQL>
<SQL>
<select><![CDATA[
SELECT date_comptable,
montant_comptabilise,
montant_regle,
montant_solde,
montant_encours_cti,
- montant_report_encours_cti + montant_comptabilise,
- montant_report_encours_cti + montant_comptabilise + montant_encours_cti
FROM w_chiffrier
WHERE date_comptable BETWEEN '[VIEW.ANNEE_D]-01-01' AND '[ANNEE_F]-12-31'
ORDER BY date_comptable DESC;
]]></select>
<FIELDS>
<FIELD name="DATE" />
<FIELD name="VEN" />
<FIELD name="REG" />
<FIELD name="CLI" />
<FIELD name="ENC" />
<FIELD name="VAR" />
<FIELD name="ACT" />
</FIELDS>
</SQL>
</QUERY>
<QUERY>
<SQL>
<select><![CDATA[
SELECT date,
w_chiffrier.montant_comptabilise,
CASE WHEN to_char(w_chiffrier_1.date_comptable, 'YYYY')::numeric >= [VIEW.ANNEE_D] THEN w_chiffrier_1.montant_comptabilise ELSE 0 END,
CASE WHEN to_char(w_chiffrier_2.date_comptable, 'YYYY')::numeric >= [VIEW.ANNEE_D] THEN w_chiffrier_2.montant_comptabilise ELSE 0 END,
(SELECT mt_cpt
FROM activite.p_chiffrier_resultat_calcule_gliss
WHERE p_chiffrier_resultat_calcule_gliss.date_comptable = (
CASE
WHEN (
(SELECT to_char(t_divers.valeur_date, 'YYYY') FROM activite.t_divers WHERE code ilike 'NOWCLOTURE') ilike [ANNEE_F]::text
)
THEN (
SELECT valeur::TEXT
FROM activite.t_divers
WHERE code ilike 'NOWCLOTURE'
)
ELSE [ANNEE_F]::text||'-12-31'
END
)
),
mt_cpt,
mt_cpt_j
FROM base.p_calendrier
LEFT OUTER JOIN w_chiffrier w_chiffrier ON p_calendrier.date = w_chiffrier.date_comptable
LEFT OUTER JOIN w_chiffrier w_chiffrier_1
ON to_char(p_calendrier.date, 'YYYY')::numeric = to_char(w_chiffrier_1.date_comptable, 'YYYY')::numeric + 1
AND to_char(p_calendrier.date, 'MM')::numeric = to_char(w_chiffrier_1.date_comptable, 'MM')::numeric
LEFT OUTER JOIN w_chiffrier w_chiffrier_2
ON to_char(p_calendrier.date, 'YYYY')::numeric = to_char(w_chiffrier_2.date_comptable, 'YYYY')::numeric + 2
AND to_char(p_calendrier.date, 'MM')::numeric = to_char(w_chiffrier_2.date_comptable, 'MM')::numeric
LEFT OUTER JOIN activite.p_chiffrier_resultat_calcule_gliss ON activite.p_chiffrier_resultat_calcule_gliss.date_comptable = w_chiffrier.date_comptable
WHERE dernier_jour = '1'
AND to_char(date, 'YYYY')::numeric = [ANNEE_F]
ORDER BY date ;
]]></select>
<FIELDS>
<FIELD name="DATE" />
<FIELD name="M" />
<FIELD name="M1" />
<FIELD name="M2" />
<FIELD name="M22" />
<FIELD name="M33" />
<FIELD name="M44" />
</FIELDS>
</SQL>
</QUERY>
<QUERY>
<SQL>
<select><![CDATA[
SELECT date,
w_chiffrier.montant_regle,
CASE WHEN to_char(w_chiffrier_1.date_comptable, 'YYYY')::numeric >= [VIEW.ANNEE_D] THEN w_chiffrier_1.montant_regle ELSE 0 END,
CASE WHEN to_char(w_chiffrier_2.date_comptable, 'YYYY')::numeric >= [VIEW.ANNEE_D] THEN w_chiffrier_2.montant_regle ELSE 0 END,
(SELECT mt_reg
FROM activite.p_chiffrier_resultat_calcule_gliss
WHERE p_chiffrier_resultat_calcule_gliss.date_comptable = (
CASE
WHEN (
(SELECT to_char(t_divers.valeur_date, 'YYYY') FROM activite.t_divers WHERE code ilike 'NOWCLOTURE') ilike [ANNEE_F]::text
)
THEN (
SELECT valeur::TEXT
FROM activite.t_divers
WHERE code ilike 'NOWCLOTURE'
)
ELSE [ANNEE_F]::text||'-12-31'
END
)
),
mt_reg,
mt_reg_j
FROM base.p_calendrier
LEFT OUTER JOIN w_chiffrier w_chiffrier ON p_calendrier.date = w_chiffrier.date_comptable
LEFT OUTER JOIN w_chiffrier w_chiffrier_1
ON to_char(p_calendrier.date, 'YYYY')::numeric = to_char(w_chiffrier_1.date_comptable, 'YYYY')::numeric + 1
AND to_char(p_calendrier.date, 'MM')::numeric = to_char(w_chiffrier_1.date_comptable, 'MM')::numeric
LEFT OUTER JOIN w_chiffrier w_chiffrier_2
ON to_char(p_calendrier.date, 'YYYY')::numeric = to_char(w_chiffrier_2.date_comptable, 'YYYY')::numeric + 2
AND to_char(p_calendrier.date, 'MM')::numeric = to_char(w_chiffrier_2.date_comptable, 'MM')::numeric
LEFT OUTER JOIN activite.p_chiffrier_resultat_calcule_gliss ON activite.p_chiffrier_resultat_calcule_gliss.date_comptable = w_chiffrier.date_comptable
WHERE dernier_jour = '1'
AND to_char(date, 'YYYY')::numeric = [ANNEE_F]
ORDER BY date
]]></select>
<FIELDS>
<FIELD name="DATE" />
<FIELD name="M" />
<FIELD name="M1" />
<FIELD name="M2" />
<FIELD name="M22" />
<FIELD name="M33" />
<FIELD name="M44" />
</FIELDS>
</SQL>
</QUERY>
<QUERY>
<SQL>
<select><![CDATA[
SELECT date,
w_chiffrier.montant_solde,
CASE WHEN to_char(w_chiffrier_1.date_comptable, 'YYYY')::numeric >= [VIEW.ANNEE_D] THEN w_chiffrier_1.montant_solde ELSE 0 END,
CASE WHEN to_char(w_chiffrier_2.date_comptable, 'YYYY')::numeric >= [VIEW.ANNEE_D] THEN w_chiffrier_2.montant_solde ELSE 0 END,
( SELECT mt_sol
FROM activite.p_chiffrier_resultat_calcule_gliss
WHERE p_chiffrier_resultat_calcule_gliss.date_comptable = (
CASE
WHEN (
(SELECT to_char(t_divers.valeur_date, 'YYYY') FROM activite.t_divers WHERE code ilike 'NOWCLOTURE') ilike [ANNEE_F]::text
)
THEN (
SELECT valeur::TEXT
FROM activite.t_divers
WHERE code ilike 'NOWCLOTURE'
)
ELSE [ANNEE_F]::text||'-12-31'
END
)
),
mt_sol,
mt_sol_j
FROM base.p_calendrier
LEFT OUTER JOIN w_chiffrier w_chiffrier ON p_calendrier.date = w_chiffrier.date_comptable
LEFT OUTER JOIN w_chiffrier w_chiffrier_1
ON to_char(p_calendrier.date, 'YYYY')::numeric = to_char(w_chiffrier_1.date_comptable, 'YYYY')::numeric + 1
AND to_char(p_calendrier.date, 'MM')::numeric = to_char(w_chiffrier_1.date_comptable, 'MM')::numeric
LEFT OUTER JOIN w_chiffrier w_chiffrier_2
ON to_char(p_calendrier.date, 'YYYY')::numeric = to_char(w_chiffrier_2.date_comptable, 'YYYY')::numeric + 2
AND to_char(p_calendrier.date, 'MM')::numeric = to_char(w_chiffrier_2.date_comptable, 'MM')::numeric
LEFT OUTER JOIN activite.p_chiffrier_resultat_calcule_gliss ON activite.p_chiffrier_resultat_calcule_gliss.date_comptable = w_chiffrier.date_comptable
WHERE dernier_jour = '1'
AND to_char(date, 'YYYY')::numeric = [ANNEE_F]
ORDER BY date
]]></select>
<FIELDS>
<FIELD name="DATE" />
<FIELD name="M" />
<FIELD name="M1" />
<FIELD name="M2" />
<FIELD name="M22" />
<FIELD name="M33" />
<FIELD name="M44" />
</FIELDS>
</SQL>
</QUERY>
<QUERY>
<SQL>
<select><![CDATA[
SELECT date,
- w_chiffrier.montant_report_encours_cti + w_chiffrier.montant_comptabilise + w_chiffrier.montant_encours_cti,
CASE WHEN to_char(w_chiffrier_1.date_comptable, 'YYYY')::numeric >= [VIEW.ANNEE_D] THEN - w_chiffrier_1.montant_report_encours_cti + w_chiffrier_1.montant_comptabilise + w_chiffrier_1.montant_encours_cti ELSE 0 END,
CASE WHEN to_char(w_chiffrier_2.date_comptable, 'YYYY')::numeric >= [VIEW.ANNEE_D] THEN - w_chiffrier_2.montant_report_encours_cti + w_chiffrier_2.montant_comptabilise + w_chiffrier_2.montant_encours_cti ELSE 0 END,
( SELECT mt_act_cpt
FROM activite.p_chiffrier_resultat_calcule_gliss
WHERE p_chiffrier_resultat_calcule_gliss.date_comptable = (
CASE
WHEN (
(SELECT to_char(t_divers.valeur_date, 'YYYY') FROM activite.t_divers WHERE code ilike 'NOWCLOTURE') ilike [ANNEE_F]::text
)
THEN (
SELECT valeur::TEXT
FROM activite.t_divers
WHERE code ilike 'NOWCLOTURE'
)
ELSE [ANNEE_F]::text||'-12-31'
END
)
),
mt_act_cpt,
mt_act_cpt_j
FROM base.p_calendrier
LEFT OUTER JOIN w_chiffrier w_chiffrier ON p_calendrier.date = w_chiffrier.date_comptable
LEFT OUTER JOIN w_chiffrier w_chiffrier_1
ON to_char(p_calendrier.date, 'YYYY')::numeric = to_char(w_chiffrier_1.date_comptable, 'YYYY')::numeric + 1
AND to_char(p_calendrier.date, 'MM')::numeric = to_char(w_chiffrier_1.date_comptable, 'MM')::numeric
LEFT OUTER JOIN w_chiffrier w_chiffrier_2
ON to_char(p_calendrier.date, 'YYYY')::numeric = to_char(w_chiffrier_2.date_comptable, 'YYYY')::numeric + 2
AND to_char(p_calendrier.date, 'MM')::numeric = to_char(w_chiffrier_2.date_comptable, 'MM')::numeric
LEFT OUTER JOIN activite.p_chiffrier_resultat_calcule_gliss ON activite.p_chiffrier_resultat_calcule_gliss.date_comptable = w_chiffrier.date_comptable
WHERE dernier_jour = '1'
AND to_char(date, 'YYYY')::numeric = [ANNEE_F]
ORDER BY date
]]></select>
<FIELDS>
<FIELD name="DATE" />
<FIELD name="M" />
<FIELD name="M1" />
<FIELD name="M2" />
<FIELD name="M22" />
<FIELD name="M33" />
<FIELD name="M44" />
</FIELDS>
</SQL>
</QUERY>
<QUERY>
<SQL>
<select><![CDATA[
select
date_comptable,
texte,
periode,
nb_sej_dt_occ,
nb_sej_dt_occ_j,
mt_cpt_occ,
mt_cpt_occ_j,
nb_sej_dt_sor,
nb_sej_dt_sor_j,
mt_cpt_sor,
mt_cpt_sor_j,
mt_act_cpt,
mt_act_cpt_j,
nb_sej_dt_grp,
nb_sej_dt_grp_j,
mt_cpt_grp,
mt_cpt_grp_j
from activite.p_chiffrier_resultat_calcule_gliss
where date_comptable BETWEEN [VIEW.ANNEE_D] AND [ANNEE_F]+1
order by 1
]]></select>
<FIELDS>
<FIELD name="DAT" />
<FIELD name="DATE" />
<FIELD name="PERIODE" />
<FIELD name="nb_sej_dt_occ" />
<FIELD name="nb_sej_dt_occ_j" />
<FIELD name="mt_cpt_occ" />
<FIELD name="mt_cpt_occ_j" />
<FIELD name="nb_sej_dt_sor" />
<FIELD name="nb_sej_dt_sor_j" />
<FIELD name="mt_cpt_sor" />
<FIELD name="mt_cpt_sor_j" />
<FIELD name="mt_act_cpt" />
<FIELD name="mt_act_cpt_j" />
<FIELD name="nb_sej_dt_grp" />
<FIELD name="nb_sej_dt_grp_j" />
<FIELD name="mt_cpt_grp" />
<FIELD name="mt_cpt_grp_j" />
</FIELDS>
</SQL>
</QUERY>
<QUERY>
<SQL>
<select><![CDATA[
select * from activite.p_chiffrier_resultat_calcule_gliss where date_comptable BETWEEN [VIEW.ANNEE_D] AND [ANNEE_F] + 1 order by 1 ;
]]></select>
<FIELDS>
<FIELD name="DAT" />
<FIELD name="DATE" />
<FIELD name="PERIODE" />
<FIELD name="mt_cpt" />
<FIELD name="mt_cpt_j" />
<FIELD name="mt_reg" />
<FIELD name="mt_reg_j" />
<FIELD name="nb_sej" />
<FIELD name="nb_sej_j" />
<FIELD name="mt_sol" />
<FIELD name="mt_sol_j" />
<FIELD name="mt_act_cpt" />
<FIELD name="mt_act_cpt_j" />
</FIELDS>
</SQL>
</QUERY>
<QUERY>
<SQL>
<select><![CDATA[
select
date,
activite.p_chiffrier_data_calcule_gliss.montant_comptabilise_dt_occ,
CASE WHEN to_char(w_chiffrier_dt_occ_1.date_occupation, 'YYYY')::numeric >= [VIEW.ANNEE_D] THEN w_chiffrier_dt_occ_1.montant_comptabilise_dt_occ ELSE 0 END,
CASE WHEN to_char(w_chiffrier_dt_occ_2.date_occupation, 'YYYY')::numeric >= [VIEW.ANNEE_D] THEN w_chiffrier_dt_occ_2.montant_comptabilise_dt_occ ELSE 0 END,
(SELECT mt_cpt_occ
FROM activite.p_chiffrier_resultat_calcule_gliss
WHERE p_chiffrier_resultat_calcule_gliss.date_comptable = (
CASE
WHEN (
(SELECT to_char(t_divers.valeur_date, 'YYYY') FROM activite.t_divers WHERE code ilike 'NOWCLOTURE') ilike [ANNEE_F]::text
)
THEN (
SELECT valeur::TEXT
FROM activite.t_divers
WHERE code ilike 'NOWCLOTURE'
)
ELSE [ANNEE_F]::text||'-12-31'
END
)
),
mt_cpt_occ,
mt_cpt_occ_j
FROM activite.p_chiffrier_data_calcule_gliss
RIGHT OUTER JOIN base.p_calendrier p_calendrier ON p_calendrier.date = activite.p_chiffrier_data_calcule_gliss.date_occupation
LEFT OUTER JOIN activite.p_chiffrier_data_calcule_gliss w_chiffrier_dt_occ_1
ON to_char(p_calendrier.date, 'YYYY')::numeric = to_char(w_chiffrier_dt_occ_1.date_occupation, 'YYYY')::numeric + 1
AND to_char(p_calendrier.date, 'MM')::numeric = to_char(w_chiffrier_dt_occ_1.date_occupation, 'MM')::numeric
LEFT OUTER JOIN activite.p_chiffrier_data_calcule_gliss w_chiffrier_dt_occ_2
ON to_char(p_calendrier.date, 'YYYY')::numeric = to_char(w_chiffrier_dt_occ_2.date_occupation, 'YYYY')::numeric + 2
AND to_char(p_calendrier.date, 'MM')::numeric = to_char(w_chiffrier_dt_occ_2.date_occupation, 'MM')::numeric
LEFT OUTER JOIN activite.p_chiffrier_resultat_calcule_gliss ON activite.p_chiffrier_resultat_calcule_gliss.date_comptable = activite.p_chiffrier_data_calcule_gliss.date_occupation
WHERE dernier_jour = '1'
AND to_char(date, 'YYYY')::numeric = [ANNEE_F]
ORDER BY date ;
]]></select>
<FIELDS>
<FIELD name="DATE" />
<FIELD name="M" />
<FIELD name="M1" />
<FIELD name="M2" />
<FIELD name="M22" />
<FIELD name="M33" />
<FIELD name="M44" />
</FIELDS>
</SQL>
</QUERY>
<QUERY>
<SQL>
<select><![CDATA[
select
date,
activite.p_chiffrier_data_calcule_gliss.montant_comptabilise_dt_sor,
CASE WHEN to_char(w_chiffrier_dt_sor_1.date_sortie, 'YYYY')::numeric >= [VIEW.ANNEE_D] THEN w_chiffrier_dt_sor_1.montant_comptabilise_dt_sor ELSE 0 END,
CASE WHEN to_char(w_chiffrier_dt_sor_2.date_sortie, 'YYYY')::numeric >= [VIEW.ANNEE_D] THEN w_chiffrier_dt_sor_2.montant_comptabilise_dt_sor ELSE 0 END,
(SELECT mt_cpt_sor
FROM activite.p_chiffrier_resultat_calcule_gliss
WHERE p_chiffrier_resultat_calcule_gliss.date_comptable = (
CASE
WHEN (
(SELECT to_char(t_divers.valeur_date, 'YYYY') FROM activite.t_divers WHERE code ilike 'NOWCLOTURE') ilike [ANNEE_F]::text
)
THEN (
SELECT valeur::TEXT
FROM activite.t_divers
WHERE code ilike 'NOWCLOTURE'
)
ELSE [ANNEE_F]::text||'-12-31'
END
)
),
mt_cpt_sor,
mt_cpt_sor_j
FROM activite.p_chiffrier_data_calcule_gliss
RIGHT OUTER JOIN base.p_calendrier p_calendrier ON p_calendrier.date = activite.p_chiffrier_data_calcule_gliss.date_sortie
LEFT OUTER JOIN activite.p_chiffrier_data_calcule_gliss w_chiffrier_dt_sor_1
ON to_char(p_calendrier.date, 'YYYY')::numeric = to_char(w_chiffrier_dt_sor_1.date_sortie, 'YYYY')::numeric + 1
AND to_char(p_calendrier.date, 'MM')::numeric = to_char(w_chiffrier_dt_sor_1.date_sortie, 'MM')::numeric
LEFT OUTER JOIN activite.p_chiffrier_data_calcule_gliss w_chiffrier_dt_sor_2
ON to_char(p_calendrier.date, 'YYYY')::numeric = to_char(w_chiffrier_dt_sor_2.date_sortie, 'YYYY')::numeric + 2
AND to_char(p_calendrier.date, 'MM')::numeric = to_char(w_chiffrier_dt_sor_2.date_sortie, 'MM')::numeric
LEFT OUTER JOIN activite.p_chiffrier_resultat_calcule_gliss ON activite.p_chiffrier_resultat_calcule_gliss.date_comptable = activite.p_chiffrier_data_calcule_gliss.date_sortie
WHERE dernier_jour = '1'
AND to_char(date, 'YYYY')::numeric = [ANNEE_F]
ORDER BY date ;
]]></select>
<FIELDS>
<FIELD name="DATE" />
<FIELD name="M" />
<FIELD name="M1" />
<FIELD name="M2" />
<FIELD name="M22" />
<FIELD name="M33" />
<FIELD name="M44" />
</FIELDS>
</SQL>
</QUERY>
<QUERY>
<SQL>
<select><![CDATA[
select
date,
activite.p_chiffrier_data_calcule_gliss.montant_comptabilise_dt_grp,
CASE WHEN to_char(w_chiffrier_dt_grp_1.date_groupage, 'YYYY')::numeric >= [VIEW.ANNEE_D] THEN w_chiffrier_dt_grp_1.montant_comptabilise_dt_grp ELSE 0 END,
CASE WHEN to_char(w_chiffrier_dt_grp_2.date_groupage, 'YYYY')::numeric >= [VIEW.ANNEE_D] THEN w_chiffrier_dt_grp_2.montant_comptabilise_dt_grp ELSE 0 END,
(SELECT mt_cpt_grp
FROM activite.p_chiffrier_resultat_calcule_gliss
WHERE p_chiffrier_resultat_calcule_gliss.date_comptable = (
CASE
WHEN (
(SELECT to_char(t_divers.valeur_date, 'YYYY') FROM activite.t_divers WHERE code ilike 'NOWCLOTURE') ilike [ANNEE_F]::text
)
THEN (
SELECT valeur::TEXT
FROM activite.t_divers
WHERE code ilike 'NOWCLOTURE'
)
ELSE [ANNEE_F]::text||'-12-31'
END
)
),
mt_cpt_grp,
mt_cpt_grp_j
FROM activite.p_chiffrier_data_calcule_gliss
RIGHT OUTER JOIN base.p_calendrier p_calendrier ON p_calendrier.date = activite.p_chiffrier_data_calcule_gliss.date_groupage
LEFT OUTER JOIN activite.p_chiffrier_data_calcule_gliss w_chiffrier_dt_grp_1
ON to_char(p_calendrier.date, 'YYYY')::numeric = to_char(w_chiffrier_dt_grp_1.date_groupage, 'YYYY')::numeric + 1
AND to_char(p_calendrier.date, 'MM')::numeric = to_char(w_chiffrier_dt_grp_1.date_groupage, 'MM')::numeric
LEFT OUTER JOIN activite.p_chiffrier_data_calcule_gliss w_chiffrier_dt_grp_2
ON to_char(p_calendrier.date, 'YYYY')::numeric = to_char(w_chiffrier_dt_grp_2.date_groupage, 'YYYY')::numeric + 2
AND to_char(p_calendrier.date, 'MM')::numeric = to_char(w_chiffrier_dt_grp_2.date_groupage, 'MM')::numeric
LEFT OUTER JOIN activite.p_chiffrier_resultat_calcule_gliss ON activite.p_chiffrier_resultat_calcule_gliss.date_comptable = activite.p_chiffrier_data_calcule_gliss.date_groupage
WHERE dernier_jour = '1'
AND to_char(date, 'YYYY')::numeric = [ANNEE_F]
ORDER BY date ;
]]></select>
<FIELDS>
<FIELD name="DATE" />
<FIELD name="M" />
<FIELD name="M1" />
<FIELD name="M2" />
<FIELD name="M22" />
<FIELD name="M33" />
<FIELD name="M44" />
</FIELDS>
</SQL>
</QUERY>
<QUERY type="propertiesLink" name="VIEWPROPERTIES" forSelections="false">
<SQL
select="SELECT DISTINCT 'V' || [ANNEE_F] - annee, annee
FROM base.p_calendrier_mois
WHERE annee &gt;= [VIEW.ANNEE_D] AND annee &lt;= [ANNEE_F]
UNION
SELECT DISTINCT 'R' || [ANNEE_F] - annee, annee
FROM base.p_calendrier_mois
WHERE annee &gt;= [VIEW.ANNEE_D] AND annee &lt;= [ANNEE_F]
UNION
SELECT DISTINCT 'C' || [ANNEE_F] - annee, annee
FROM base.p_calendrier_mois
WHERE annee &gt;= [VIEW.ANNEE_D] AND annee &lt;= [ANNEE_F]
ORDER BY annee" >
<FIELDS>
<FIELD name="name" />
<FIELD name="value" />
</FIELDS>
</SQL>
</QUERY>
<QUERY type="comboLink" name="ANNEES" forRows="false">
<SQL select="SELECT DISTINCT to_char(p_calendrier.date, 'YYYY')::numeric
FROM base.p_calendrier
JOIN activite.p_chiffrier_comptable ON date = date_comptable
ORDER BY to_char(p_calendrier.date, 'YYYY')::numeric DESC " >
<FIELDS>
<FIELD name="annee" />
</FIELDS>
</SQL>
</QUERY>
</QUERIES>
<CALCFIELDS />
<PRESENTATION>
<VIEWLINKS>
<VIEWLINK label="Analyse" shortLabel="Analyse" view="ACTI000143.XML" enabled="true" rowContext="false" buttonType="ANALYSE" >
<ARG name="ALIAS_PERIODE" value="'CUM_LAST_MONTH'"/>
<ARG name="GROUPBY" value="'NUMEROMOIS'"/>
<ARG name="GROUPBY_TAB" value="'TAB'" />
</VIEWLINK>
</VIEWLINKS>
<LINKS />
<ONGLET label="Synthèse">
<CHART title="Ventes / règlements / clients Historique" type="lineChart" sortField="DATE" sortSeq="A" maxItems="72" maxItemsSortOn="DATE" maxItemsSortSeq="D" condition="ROW.CLI != 0" >
<CATEGORY field="DATE"
type="Date"
displayName="Mois"
valueName="Montant"
inputFormat="AAAA-MM-JJ"
outputFormat="MMM YY"
/>
<SERIE field="VEN" displayName="Ventes" />
<SERIE field="REG" displayName="Règlements" />
<SERIE field="CLI" displayName="Solde client" />
<SERIE field="ACT" displayName="Activité comptable" />
</CHART>
<CHART title="Activité comptable" type="columnChart" subType="stacked" sortField="DATE" sortSeq="A" maxItems="12" maxItemsSortOn="DATE" maxItemsSortSeq="D" >
<CATEGORY field="DATE"
type="Date"
displayName="Mois"
valueName="Montant"
inputFormat="AAAA-MM-JJ"
outputFormat="MMM YY"
/>
<SERIE field="VEN" displayName="Ventes" />
<SERIE field="VAR" displayName="Variation encours" />
</CHART>
<DATAGRID title="" key="DATE" keySeq="D" headerHeight="36" printRatio="1">
<COLUMN dataField="DATE"
type="Date"
inputFormat="AAAA-MM-JJ"
outputFormat="MMMM YYYY"
minWidth="80"
visible="true"
headerText="Mois"
textAlign="left"
/>
<COLUMN dataField="VAR"
type="Number"
visible="false" />
<COLUMN dataField="VEN"
type="Number"
outputFormat="#E"
width="120"
headerText="Ventes@LF@A"
align="right" />
<COLUMN dataField="REG"
type="Number"
outputFormat="#E"
width="120"
headerText="Règlements@LF@B"
align="right" />
<COLUMN dataField="CLI"
type="Number"
outputFormat="#E"
width="120"
headerText="Solde client@LF@C"
align="right" />
<COLUMN dataField="ENC"
type="Number"
outputFormat="#E"
width="120"
headerText="Encours@LF@D"
align="right" />
<COLUMN dataField="ACT"
type="Number"
outputFormat="#E"
width="120"
headerText="Activité comptable@LF@A + Variation D"
description="Ventes + variation d'encours (encours du mois - encours du mois précédent"
align="right" />
</DATAGRID>
</ONGLET>
<ONGLET label="Ventes" queryNumber="1">
<CHART title="Comparatif des ventes" type="columnChart" maxItems="12" sortField="DATE" sortSeq="A">
<CATEGORY field="DATE"
type="Date"
displayName="Mois"
valueName="Montant ventes"
inputFormat="AAAA-MM-JJ"
outputFormat="MMM"
/>
<SERIE field="M2" displayName="VIEW.V2" displayNameCalc="true" visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"/>
<SERIE field="M1" displayName="VIEW.V1" displayNameCalc="true" visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"/>
<SERIE field="M" displayName="VIEW.V0" displayNameCalc="true" />
<SERIE field="M22" displayName=" 'CA Moyen '+ VIEW.V0" displayNameCalc="true" type ="line" />
</CHART>
<DATAGRID title="" key="DATE" keySeq="A" headerHeight="50" printRatio="1">
<COLUMN dataField="DATE"
type="Date"
inputFormat="AAAA-MM-JJ"
outputFormat="MMMM"
minWidth="120"
visible="true"
headerText="Mois"
textAlign="left"
/>
<COLUMN dataField="M2"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"
headerText="VIEW.V2"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M1"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"
headerText="VIEW.V1"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M22"
visible="false"
type="Number"
outputFormat="#E"
width="1"
headerText="VIEW.V1"
headerTextCalc="true"
align="right" />
<!--
<COLUMN dataField="M1M2"
type="Number"
outputFormat="#E"
width="100"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"
headerText="'Ecart ' + VIEW.V1 + ' - ' + VIEW.V2"
headerTextCalc="true"
align="right"
calc="true">
<CALC dataField="M1" />
<CALC dataField="M2" operator="-" />
</COLUMN>
-->
<COLUMN dataField="M"
type="Number"
outputFormat="#E"
width="120"
headerText="VIEW.V0"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M0M1"
type="Number"
outputFormat="#E"
width="100"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"
headerText="'Ecart ' + '\n'+ VIEW.V0 + ' - ' + VIEW.V1"
headerTextCalc="true"
textAlign="right"
calc="true">
<CALC dataField="M" />
<CALC dataField="M1" operator="-" />
</COLUMN>
<COLUMN dataField="M33"
type="Number"
outputFormat="#E"
width="120"
headerText="'C.A.'+'\n'+'Moyen' +'\n'+ VIEW.V0"
headerTextCalc="true"
align="right"
description="C.A. moyen ventes des 12 derniers mois glissants"
/>
<COLUMN dataField="M44"
type="Number"
outputFormat="#E"
width="120"
headerText="'C.A.'+'\n'+'Moyen par jour' +'\n'+ VIEW.V0"
headerTextCalc="true"
align="right"
description="C.A. journalier ventes des 12 derniers mois glissants calculé en 20ème"
/>
</DATAGRID>
</ONGLET>
<ONGLET label="Règlements" queryNumber="2">
<CHART title="Comparatif des règlements" type="columnChart" maxItems="12" sortField="DATE" sortSeq="A">
<CATEGORY field="DATE"
type="Date"
displayName="Mois"
valueName="Montant règlements"
inputFormat="AAAA-MM-JJ"
outputFormat="MMM"
/>
<SERIE field="M2" displayName="VIEW.R2" displayNameCalc="true" visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"/>
<SERIE field="M1" displayName="VIEW.R1" displayNameCalc="true" visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"/>
<SERIE field="M" displayName="VIEW.R0" displayNameCalc="true" />
<SERIE field="M22" displayName=" 'CA Moyen '+ VIEW.V0" displayNameCalc="true" type ="line" />
</CHART>
<DATAGRID title="" key="DATE" keySeq="A" headerHeight="36" printRatio="1">
<COLUMN dataField="DATE"
type="Date"
inputFormat="AAAA-MM-JJ"
outputFormat="MMMM"
minWidth="80"
visible="true"
headerText="Mois"
textAlign="left"
/>
<COLUMN dataField="M2"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"
headerText="VIEW.R2"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M1"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"
headerText="VIEW.R1"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M22"
visible="false"
type="Number"
outputFormat="#E"
width="1"
headerText="VIEW.V1"
headerTextCalc="true"
align="right" />
<!--
<COLUMN dataField="M1M2"
type="Number"
outputFormat="#E"
width="100"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"
headerText="'Ecart ' + VIEW.R1 + ' - ' + VIEW.R2"
headerTextCalc="true"
align="right"
calc="true">
<CALC dataField="M1" />
<CALC dataField="M2" operator="-" />
</COLUMN>
-->
<COLUMN dataField="M"
type="Number"
outputFormat="#E"
width="120"
headerText="VIEW.R0"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M0M1"
type="Number"
outputFormat="#E"
width="100"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"
headerText="'Ecart ' + VIEW.R0 + ' - ' + VIEW.R1"
headerTextCalc="true"
align="right"
calc="true">
<CALC dataField="M" />
<CALC dataField="M1" operator="-" />
</COLUMN>
<COLUMN dataField="M33"
type="Number"
outputFormat="#E"
width="120"
headerText="'C.A.'+'\n'+'Moyen' +'\n'+ VIEW.V0"
headerTextCalc="true"
align="right"
description="C.A. moyen réglè des 12 derniers mois glissants"
/>
<COLUMN dataField="M44"
type="Number"
outputFormat="#E"
width="120"
headerText="'C.A.'+'\n'+'Moyen par jour' +'\n'+ VIEW.V0"
headerTextCalc="true"
align="right"
description="C.A. journalier réglè des 12 derniers mois glissants calculé en 20ème"
/>
</DATAGRID>
</ONGLET>
<ONGLET label="Solde clients" queryNumber="3">
<CHART title="Comparatif des soldes clients" type="columnChart" maxItems="12" sortField="DATE" sortSeq="A">
<CATEGORY field="DATE"
type="Date"
displayName="Mois"
valueName="Montant solde client"
inputFormat="AAAA-MM-JJ"
outputFormat="MMM"
/>
<SERIE field="M2" displayName="VIEW.C2" displayNameCalc="true" visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"/>
<SERIE field="M1" displayName="VIEW.C1" displayNameCalc="true" visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"/>
<SERIE field="M" displayName="VIEW.C0" displayNameCalc="true" />
<SERIE field="M22" displayName=" 'CA Moyen '+ VIEW.V0" displayNameCalc="true" type ="line" />
</CHART>
<DATAGRID title="" key="DATE" keySeq="A" headerHeight="36" printRatio="1">
<COLUMN dataField="DATE"
type="Date"
inputFormat="AAAA-MM-JJ"
outputFormat="MMMM"
minWidth="80"
visible="true"
headerText="Mois"
textAlign="left"
/>
<COLUMN dataField="M2"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"
headerText="VIEW.C2"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M22"
visible="false"
type="Number"
outputFormat="#E"
width="1"
headerText="VIEW.V1"
headerTextCalc="true"
align="right" />
<!--
<COLUMN dataField="M1M2"
type="Number"
outputFormat="#E"
width="120"
visible="false"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"
headerText="'Ecart ' + VIEW.C1 + ' - ' + VIEW.C2"
headerTextCalc="true"
align="right"
calc="true">
<CALC dataField="M1" />
<CALC dataField="M2" operator="-" />
</COLUMN>
-->
<COLUMN dataField="M1"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"
headerText="VIEW.C1"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M"
type="Number"
outputFormat="#E"
width="120"
headerText="VIEW.C0"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M0M1"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"
headerText="'Ecart ' + VIEW.C0 + ' - ' + VIEW.C1"
headerTextCalc="true"
align="right"
calc="true">
<CALC dataField="M" />
<CALC dataField="M1" operator="-" />
</COLUMN>
<COLUMN dataField="M33"
type="Number"
outputFormat="#E"
width="120"
headerText="'C.A.'+'\n'+'Moyen' +'\n'+ VIEW.V0"
headerTextCalc="true"
align="right"
description="C.A. moyen soldé des 12 derniers mois glissants"
/>
<COLUMN dataField="M44"
type="Number"
outputFormat="#E"
width="120"
headerText="'C.A.'+'\n'+'Moyen' + ' par jour '+'\n'+ VIEW.V0"
headerTextCalc="true"
align="right"
description="C.A. journalier soldé des 12 derniers mois glissants calculé en 20ème"
/>
</DATAGRID>
</ONGLET>
<ONGLET label="Ratios 1" queryNumber="6">
<CHART title="Ratio calculé sur les 12 derniers mois glissants" type="lineChart" sortField="" sortSeq="" maxItems="72" maxItemsSortOn="DATE" maxItemsSortSeq="D" >
<CATEGORY field="DATE"
type="text"
displayName="Mois"
valueName="Montant"
inputFormat="AAAA-MM-JJ"
outputFormat="MMM YY"
/>
<SERIE field="mt_cpt" displayName="Ventes" />
<SERIE field="mt_reg" displayName="Règlements" />
<SERIE field="mt_sol" displayName="Solde clients" />
</CHART>
<DATAGRID title="" key="DATE" keySeq="A" headerHeight="50" printRatio="1">
<COLUMN dataField="DATE"
type="text"
inputFormat="AAAA-MM-JJ"
outputFormat="text"
minWidth="80"
width = "90"
visible="true"
headerText="Mois/année"
textAlign="left"
/>
<COLUMN dataField="PERIODE"
type="text"
inputFormat="AAAA-MM-JJ"
outputFormat="MMMM"
minWidth="80"
visible="true"
headerText="Période"
textAlign="left"
/>
<COLUMN dataField="nb_sej"
type="Number"
outputFormat="#"
width="120"
headerText="'Nb séjour'+'\n'"
headerTextCalc="true"
textAlign ="center"
align="right"
fixed ="false"
description ="Nombre de séjour moyen sur les 12 derniers mois glissants"
>
<CELLSTYLE name="backgroundColor" value="0xDCDCDC" />
</COLUMN>
<COLUMN dataField="nb_sej_j"
type="Number"
outputFormat="#"
width="120"
headerText="'Nb par jour'+'\n'"
headerTextCalc="true"
textAlign ="center"
align="right"
fixed ="false"
description ="Nombre moyen de séjours journalier sur les 12 derniers mois glissants calculé en 20ème"
>
<CELLSTYLE name="backgroundColor" value="0xDCDCDC" />
</COLUMN>
<COLUMN dataField="mt_cpt"
type="Number"
outputFormat="#E"
width="120"
headerText="'MT Comptabilisé'+ '\n' +'\n'+ 'Vente'"
headerTextCalc="true"
textAlign ="center"
align="right"
description ="Montant moyen comptabilsé sur les 12 derniers mois glissants"
>
<CELLSTYLE name="backgroundColor" value="0xDCDCDC" />
</COLUMN>
<COLUMN dataField="mt_cpt_j"
type="Number"
outputFormat="#E"
width="120"
headerText="'MT '+'par jour'+'\n'+ 'Vente' "
headerTextCalc="true"
textAlign ="center"
align="right"
description ="Montant moyen comptabilsé journalier sur les 12 derniers mois glissants calculé en 20ème"
>
<CELLSTYLE name="backgroundColor" value="0xDCDCDC" />
</COLUMN>
<COLUMN dataField="mt_reg"
type="Number"
outputFormat="#E"
width="120"
headerText="'MT Réglè '+'\n'+'\n'+ 'Réglement' "
headerTextCalc="true"
textAlign ="center"
align="right"
description ="MT Règlé moyen sur les 12 derniers mois glissants"
>
<CELLSTYLE name="backgroundColor" value="0xbccbed" />
</COLUMN>
<COLUMN dataField="mt_reg_j"
type="Number"
outputFormat="#E"
width="120"
headerText="'MT '+' par jour' +'\n'+ 'Réglement' "
headerTextCalc="true"
textAlign ="center"
align="right"
description ="MT Réglè moyen par jour ouvré sur les 12 derniers mois glissants"
>
<CELLSTYLE name="backgroundColor" value="0xbccbed" />
</COLUMN>
<COLUMN dataField="mt_sol"
type="Number"
outputFormat="#E"
width="120"
headerText="'MT soldé '+'\n'+'\n'+ 'Solde' "
headerTextCalc="true"
textAlign ="center"
align="right"
description ="MT soldé moyen sur les 12 derniers mois glissants"
>
<CELLSTYLE name="backgroundColor" value="0xEDEABC" />
</COLUMN>
<COLUMN dataField="mt_sol_j"
type="Number"
outputFormat="#E"
width="120"
headerText="'MT'+' par jour' +'\n'+ 'Solde' "
headerTextCalc="true"
textAlign ="center"
align="right"
description ="MT soldé moyen par jour ouvré sur les 12 derniers mois glissants"
>
<CELLSTYLE name="backgroundColor" value="0xEDEABC" />
</COLUMN>
</DATAGRID>
</ONGLET>
<ONGLET label="Activité" queryNumber="7">
<CHART title="Comparatif des règlements" type="columnChart" maxItems="12" sortField="DATE" sortSeq="A">
<CATEGORY field="DATE"
type="Date"
displayName="Mois"
valueName="Montant règlements"
inputFormat="AAAA-MM-JJ"
outputFormat="MMM"
/>
<SERIE field="M2" displayName="VIEW.R2" displayNameCalc="true" visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"/>
<SERIE field="M1" displayName="VIEW.R1" displayNameCalc="true" visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"/>
<SERIE field="M" displayName="VIEW.R0" displayNameCalc="true" />
<SERIE field="M22" displayName=" 'CA Moyen '+ VIEW.V0" displayNameCalc="true" type ="line" />
</CHART>
<DATAGRID title="" key="DATE" keySeq="A" headerHeight="36" printRatio="1">
<COLUMN dataField="DATE"
type="Date"
inputFormat="AAAA-MM-JJ"
outputFormat="MMMM"
minWidth="80"
visible="true"
headerText="Mois"
textAlign="left"
/>
<COLUMN dataField="M2"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"
headerText="VIEW.R2"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M1"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"
headerText="VIEW.R1"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M22"
visible="false"
type="Number"
outputFormat="#E"
width="1"
headerText="VIEW.V1"
headerTextCalc="true"
align="right" />
<!--
<COLUMN dataField="M1M2"
type="Number"
outputFormat="#E"
width="100"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"
headerText="'Ecart ' + VIEW.R1 + ' - ' + VIEW.R2"
headerTextCalc="true"
align="right"
calc="true">
<CALC dataField="M1" />
<CALC dataField="M2" operator="-" />
</COLUMN>
-->
<COLUMN dataField="M"
type="Number"
outputFormat="#E"
width="120"
headerText="VIEW.R0"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M0M1"
type="Number"
outputFormat="#E"
width="100"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"
headerText="'Ecart ' + VIEW.R0 + ' - ' + VIEW.R1"
headerTextCalc="true"
align="right"
calc="true">
<CALC dataField="M" />
<CALC dataField="M1" operator="-" />
</COLUMN>
<COLUMN dataField="M33"
type="Number"
outputFormat="#E"
width="120"
headerText="'C.A.'+'\n'+'Moyen' +'\n'+ VIEW.V0"
headerTextCalc="true"
align="right"
description="C.A. moyen occupations des 12 derniers mois glissants"
/>
<COLUMN dataField="M44"
type="Number"
outputFormat="#E"
width="120"
headerText="'C.A.'+'\n'+'Moyen par jour' +'\n'+ VIEW.V0"
headerTextCalc="true"
align="right"
description="C.A. journalier occupations des 12 derniers mois glissants calculé en 20ème"
/>
</DATAGRID>
</ONGLET>
<ONGLET label="Sorties" queryNumber="8">
<CHART title="Comparatif des règlements" type="columnChart" maxItems="12" sortField="DATE" sortSeq="A">
<CATEGORY field="DATE"
type="Date"
displayName="Mois"
valueName="Montant règlements"
inputFormat="AAAA-MM-JJ"
outputFormat="MMM"
/>
<SERIE field="M2" displayName="VIEW.R2" displayNameCalc="true" visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"/>
<SERIE field="M1" displayName="VIEW.R1" displayNameCalc="true" visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"/>
<SERIE field="M" displayName="VIEW.R0" displayNameCalc="true" />
<SERIE field="M22" displayName=" 'CA Moyen '+ VIEW.V0" displayNameCalc="true" type ="line" />
</CHART>
<DATAGRID title="" key="DATE" keySeq="A" headerHeight="36" printRatio="1">
<COLUMN dataField="DATE"
type="Date"
inputFormat="AAAA-MM-JJ"
outputFormat="MMMM"
minWidth="80"
visible="true"
headerText="Mois"
textAlign="left"
/>
<COLUMN dataField="M2"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"
headerText="VIEW.R2"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M1"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"
headerText="VIEW.R1"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M22"
visible="false"
type="Number"
outputFormat="#E"
width="1"
headerText="VIEW.V1"
headerTextCalc="true"
align="right" />
<!--
<COLUMN dataField="M1M2"
type="Number"
outputFormat="#E"
width="100"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"
headerText="'Ecart ' + VIEW.R1 + ' - ' + VIEW.R2"
headerTextCalc="true"
align="right"
calc="true">
<CALC dataField="M1" />
<CALC dataField="M2" operator="-" />
</COLUMN>
-->
<COLUMN dataField="M"
type="Number"
outputFormat="#E"
width="120"
headerText="VIEW.R0"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M0M1"
type="Number"
outputFormat="#E"
width="100"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"
headerText="'Ecart ' + VIEW.R0 + ' - ' + VIEW.R1"
headerTextCalc="true"
align="right"
calc="true">
<CALC dataField="M" />
<CALC dataField="M1" operator="-" />
</COLUMN>
<COLUMN dataField="M33"
type="Number"
outputFormat="#E"
width="120"
headerText="'C.A.'+'\n'+'Moyen' +'\n'+ VIEW.V0"
headerTextCalc="true"
align="right"
description="C.A. moyen sorties des 12 derniers mois glissants"
/>
<COLUMN dataField="M44"
type="Number"
outputFormat="#E"
width="120"
headerText="'C.A.'+'\n'+'Moyen par jour' +'\n'+ VIEW.V0"
headerTextCalc="true"
align="right"
description="C.A. journalier sorties des 12 derniers mois glissants calculé en 20ème"
/>
</DATAGRID>
</ONGLET>
<ONGLET label="PMSI" queryNumber="9">
<CHART title="Comparatif des règlements" type="columnChart" maxItems="12" sortField="DATE" sortSeq="A">
<CATEGORY field="DATE"
type="Date"
displayName="Mois"
valueName="Montant règlements"
inputFormat="AAAA-MM-JJ"
outputFormat="MMM"
/>
<SERIE field="M2" displayName="VIEW.R2" displayNameCalc="true" visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"/>
<SERIE field="M1" displayName="VIEW.R1" displayNameCalc="true" visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"/>
<SERIE field="M" displayName="VIEW.R0" displayNameCalc="true" />
<SERIE field="M22" displayName=" 'CA Moyen '+ VIEW.V0" displayNameCalc="true" type ="line" />
</CHART>
<DATAGRID title="" key="DATE" keySeq="A" headerHeight="36" printRatio="1">
<COLUMN dataField="DATE"
type="Date"
inputFormat="AAAA-MM-JJ"
outputFormat="MMMM"
minWidth="80"
visible="true"
headerText="Mois"
textAlign="left"
/>
<COLUMN dataField="M2"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"
headerText="VIEW.R2"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M1"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"
headerText="VIEW.R1"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M22"
visible="false"
type="Number"
outputFormat="#E"
width="1"
headerText="VIEW.V1"
headerTextCalc="true"
align="right" />
<!--
<COLUMN dataField="M1M2"
type="Number"
outputFormat="#E"
width="100"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"
headerText="'Ecart ' + VIEW.R1 + ' - ' + VIEW.R2"
headerTextCalc="true"
align="right"
calc="true">
<CALC dataField="M1" />
<CALC dataField="M2" operator="-" />
</COLUMN>
-->
<COLUMN dataField="M"
type="Number"
outputFormat="#E"
width="120"
headerText="VIEW.R0"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M0M1"
type="Number"
outputFormat="#E"
width="100"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"
headerText="'Ecart ' + VIEW.R0 + ' - ' + VIEW.R1"
headerTextCalc="true"
align="right"
calc="true">
<CALC dataField="M" />
<CALC dataField="M1" operator="-" />
</COLUMN>
<COLUMN dataField="M33"
type="Number"
outputFormat="#E"
width="120"
headerText="'C.A.'+'\n'+'Moyen' +'\n'+ VIEW.V0"
headerTextCalc="true"
align="right"
description="C.A. moyen sorties des 12 derniers mois glissants"
/>
<COLUMN dataField="M44"
type="Number"
outputFormat="#E"
width="120"
headerText="'C.A.'+'\n'+'Moyen par jour' +'\n'+ VIEW.V0"
headerTextCalc="true"
align="right"
description="C.A. journalier sorties des 12 derniers mois glissants calculé en 20ème"
/>
</DATAGRID>
</ONGLET>
<ONGLET label="Activité comptable" queryNumber="4">
<CHART title="Comparatif des soldes clients" type="columnChart" maxItems="12" sortField="DATE" sortSeq="A">
<CATEGORY field="DATE"
type="Date"
displayName="Mois"
valueName="Activite comptable"
inputFormat="AAAA-MM-JJ"
outputFormat="MMM"
/>
<SERIE field="M2" displayName="VIEW.C2" displayNameCalc="true" visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"/>
<SERIE field="M1" displayName="VIEW.C1" displayNameCalc="true" visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"/>
<SERIE field="M" displayName="VIEW.C0" displayNameCalc="true" />
<SERIE field="M22" displayName=" 'CA Moyen '+ VIEW.V0" displayNameCalc="true" type ="line" />
</CHART>
<DATAGRID title="" key="DATE" keySeq="A" headerHeight="36" printRatio="1">
<COLUMN dataField="DATE"
type="Date"
inputFormat="AAAA-MM-JJ"
outputFormat="MMMM"
minWidth="80"
visible="true"
headerText="Mois"
textAlign="left"
/>
<COLUMN dataField="M2"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"
headerText="VIEW.C2"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M22"
visible="false"
type="Number"
outputFormat="#E"
width="1"
headerText="VIEW.V1"
headerTextCalc="true"
align="right" />
<!--
<COLUMN dataField="M1M2"
type="Number"
outputFormat="#E"
width="120"
visible="false"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 2"
headerText="'Ecart ' + VIEW.C1 + ' - ' + VIEW.C2"
headerTextCalc="true"
align="right"
calc="true">
<CALC dataField="M1" />
<CALC dataField="M2" operator="-" />
</COLUMN>
-->
<COLUMN dataField="M1"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"
headerText="VIEW.C1"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M"
type="Number"
outputFormat="#E"
width="120"
headerText="VIEW.C0"
headerTextCalc="true"
align="right" />
<COLUMN dataField="M0M1"
type="Number"
outputFormat="#E"
width="120"
visibleCondition="Number(SELECT.ANNEE_F) - Number(SELECT.ANNEE_D) &gt;= 1"
headerText="'Ecart ' + VIEW.C0 + ' - ' + VIEW.C1"
headerTextCalc="true"
align="right"
calc="true">
<CALC dataField="M" />
<CALC dataField="M1" operator="-" />
</COLUMN>
<COLUMN dataField="M33"
type="Number"
outputFormat="#E"
width="120"
headerText="'C.A.'+'\n'+'Moyen' +'\n'+ VIEW.V0"
headerTextCalc="true"
align="right"
description="C.A. moyen activité comptable des 12 derniers mois glissants"
/>
<COLUMN dataField="M44"
type="Number"
outputFormat="#E"
width="120"
headerText="'C.A.'+'\n'+'Moyen par jour' +'\n'+ VIEW.V0"
headerTextCalc="true"
align="right"
description="C.A. journalier activité comptable des 12 derniers mois glissants calculé en 20ème"
/>
</DATAGRID>
</ONGLET>
<ONGLET label="Ratios 2" queryNumber="5">
<CHART title="Ratio calculé sur les 12 derniers mois glissants" type="lineChart" sortField="" sortSeq="" maxItems="72" maxItemsSortOn="DATE" maxItemsSortSeq="D" >
<CATEGORY field="DATE"
type="text"
displayName="Mois"
valueName="Montant"
inputFormat="AAAA-MM-JJ"
outputFormat="MMM YY"
/>
<SERIE field="mt_cpt_occ" displayName="Occupations" />
<SERIE field="mt_cpt_grp" displayName="Groupages" />
<SERIE field="mt_cpt_sor" displayName="Sorties" />
<SERIE field="mt_act_cpt" displayName="Activité comptable" />
</CHART>
<DATAGRID title="" key="DATE" keySeq="A" headerHeight="50" printRatio="1">
<COLUMN dataField="DATE"
type="text"
inputFormat="AAAA-MM-JJ"
outputFormat="text"
minWidth="80"
width = "90"
visible="true"
headerText="Mois/année"
textAlign="left"
/>
<COLUMN dataField="PERIODE"
type="text"
inputFormat="AAAA-MM-JJ"
outputFormat="MMMM"
minWidth="80"
visible="true"
headerText="Période"
textAlign="left"
/>
<COLUMN dataField="nb_sej_dt_occ"
type="Number"
outputFormat="#"
width="90"
headerText="'Nb séjour'+'\n'+'\n'+ 'Occupation'"
headerTextCalc="true"
textAlign ="center"
align="right"
fixed ="false"
description ="Nombre de séjour moyen sur les 12 derniers mois glissants"
>
<CELLSTYLE name="backgroundColor" value="0xDCDCDC" />
</COLUMN>
<COLUMN dataField="nb_sej_dt_occ_j"
type="Number"
outputFormat="#"
width="90"
headerText="'Nb par jour'+'\n' +'\n'+ 'Occupation'"
headerTextCalc="true"
textAlign ="center"
align="right"
fixed ="false"
description ="Nombre moyen de séjours journalier sur les 12 derniers mois glissants calculé en 20ème"
>
<CELLSTYLE name="backgroundColor" value="0xDCDCDC" />
</COLUMN>
<COLUMN dataField="mt_cpt_occ"
type="Number"
outputFormat="#E"
width="90"
headerText="'MT Comptabilisé'+ '\n' +'\n'+ 'Occupation'"
headerTextCalc="true"
textAlign ="center"
align="right"
description ="Montant moyen comptabilsé sur les 12 derniers mois glissants"
>
<CELLSTYLE name="backgroundColor" value="0xDCDCDC" />
</COLUMN>
<COLUMN dataField="mt_cpt_occ_j"
type="Number"
outputFormat="#E"
width="90"
headerText="'MT'+ ' par jour'+'\n'+ 'Occupation' "
headerTextCalc="true"
textAlign ="center"
align="right"
description ="Montant moyen comptabilsé journalier sur les 12 derniers mois glissants calculé en 20ème"
>
<CELLSTYLE name="backgroundColor" value="0xDCDCDC" />
</COLUMN>
<COLUMN dataField="nb_sej_dt_grp"
type="Number"
outputFormat="#"
width="90"
headerText="'Nb séjour'+'\n'+'\n'+ 'Groupé'"
headerTextCalc="true"
textAlign ="center"
align="right"
fixed ="false"
description ="Nombre de séjour moyen sur les 12 derniers mois glissants"
>
<CELLSTYLE name="backgroundColor" value="0xE8E4B5"/>
</COLUMN>
<COLUMN dataField="nb_sej_dt_grp_j"
type="Number"
outputFormat="#"
width="90"
headerText="'Nb par jour'+'\n' +'\n'+ 'Groupé'"
headerTextCalc="true"
textAlign ="center"
align="right"
fixed ="false"
description ="Nombre moyen de séjours journalier sur les 12 derniers mois glissants calculé en 20ème"
>
<CELLSTYLE name="backgroundColor" value="0xE8E4B5" />
</COLUMN>
<COLUMN dataField="mt_cpt_grp"
type="Number"
outputFormat="#E"
width="90"
headerText="'MT Comptabilisé'+ '\n' +'\n'+ 'Groupé'"
headerTextCalc="true"
textAlign ="center"
align="right"
description ="Montant moyen comptabilsé sur les 12 derniers mois glissants"
>
<CELLSTYLE name="backgroundColor" value="0xE8E4B5" />
</COLUMN>
<COLUMN dataField="mt_cpt_grp_j"
type="Number"
outputFormat="#E"
width="90"
headerText="'MT'+ ' par jour'+'\n'+ 'Groupé' "
headerTextCalc="true"
textAlign ="center"
align="right"
description ="Montant moyen comptabilsé journalier sur les 12 derniers mois glissants calculé en 20ème"
>
<CELLSTYLE name="backgroundColor" value="0xE8E4B5" />
</COLUMN>
<COLUMN dataField="nb_sej_dt_sor"
type="Number"
outputFormat="#"
width="90"
headerText="'Nb séjour'+'\n'+ '\n'+ 'Sorties' "
headerTextCalc="true"
textAlign ="center"
align="right"
fixed ="false"
description ="Nombre de séjour moyen sur les 12 derniers mois glissants"
>
<CELLSTYLE name="backgroundColor" value="0xbccbed" />
</COLUMN>
<COLUMN dataField="nb_sej_dt_sor_j"
type="Number"
outputFormat="#"
width="90"
headerText="'Nb par jour'+'\n' + '\n'+ 'Sorties'"
headerTextCalc="true"
textAlign ="center"
align="right"
fixed ="false"
description ="Nombre moyen de séjours journalier sur les 12 derniers mois glissants calculé en 20ème"
>
<CELLSTYLE name="backgroundColor" value="0xbccbed" />
</COLUMN>
<COLUMN dataField="mt_cpt_sor"
type="Number"
outputFormat="#E"
width="90"
headerText="'MT Comptabilisé'+ '\n' +'\n'+ 'Sorties'"
headerTextCalc="true"
textAlign ="center"
align="right"
description ="Montant moyen comptabilsé sur les 12 derniers mois glissants calculé "
>
<CELLSTYLE name="backgroundColor" value="0xbccbed" />
</COLUMN>
<COLUMN dataField="mt_cpt_sor_j"
type="Number"
outputFormat="#E"
width="90"
headerText="'MT'+ ' par jour'+'\n'+'Sorties' "
headerTextCalc="true"
textAlign ="center"
align="right"
description ="Montant moyen comptabilsé journalier sur les 12 derniers mois glissants calculé en 20ème"
>
<CELLSTYLE name="backgroundColor" value="0xbccbed" />
</COLUMN>
<COLUMN dataField="mt_act_cpt"
type="Number"
outputFormat="#E"
width="90"
headerText="'Activité comptable'+'\n'+'\n'+ 'Vente' "
headerTextCalc="true"
textAlign ="center"
align="right"
description ="Activité comptable moyen sur les 12 derniers mois glissants"
>
<CELLSTYLE name="backgroundColor" value="0xD0BCED" />
</COLUMN>
<COLUMN dataField="mt_act_cpt_j"
type="Number"
outputFormat="#E"
width="90"
headerText="'Activité comptable '+'\n'+' par jour' +'\n'+ 'Vente' "
headerTextCalc="true"
textAlign ="center"
align="right"
description ="Activité comptable moyen par jour ouvré sur les 12 derniers mois glissants"
>
<CELLSTYLE name="backgroundColor" value="0xD0BCED" />
</COLUMN>
</DATAGRID>
</ONGLET>
</PRESENTATION>
</VUE>