Merge pull request 'develop' (#219) from develop into main
All checks were successful
CD - Deploy on main / deploy (push) Successful in 1m0s
All checks were successful
CD - Deploy on main / deploy (push) Successful in 1m0s
Reviewed-on: #219
This commit was merged in pull request #219.
This commit is contained in:
@@ -33,15 +33,15 @@ public class EpaiementAcompte extends BaseEntity implements Serializable {
|
||||
private String rDoc;
|
||||
private String rImpot;
|
||||
private String idImpotType;
|
||||
private String idImpotNature;
|
||||
private String ifu;
|
||||
private String idImpotNature; /// participe unicité
|
||||
private String ifu; /// participe unicité
|
||||
private String rCommune;
|
||||
private String rQuartier;
|
||||
private String rQuartier; /// participe unicité
|
||||
private String qipQuartier;
|
||||
private String qipIlot;
|
||||
private String qipParcelle;
|
||||
private String qipIlot; /// participe unicité
|
||||
private String qipParcelle; /// participe unicité
|
||||
private String nup;
|
||||
private Long exercice;
|
||||
private Long exercice; /// participe unicité
|
||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateValidation;
|
||||
|
||||
@@ -260,6 +260,10 @@ public enum UserRole {
|
||||
CREATE_PARAMETERS,
|
||||
READ_PARAMETERS,
|
||||
UPDATE_PARAMETERS,
|
||||
DELETE_PARAMETERS
|
||||
DELETE_PARAMETERS,
|
||||
CREATE_SECTEUR_DECOUPAGE,
|
||||
READ_SECTEUR_DECOUPAGE,
|
||||
UPDATE_SECTEUR_DECOUPAGE,
|
||||
DELETE_SECTEUR_DECOUPAGE
|
||||
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ SELECT distinct on (exo.annee,dimp.parcelle_id,dimp.nature_impot)
|
||||
end as montant_base_imposition,
|
||||
dimp.valeur_locative_adm as montant_valeur_locative,
|
||||
dimp.taux_tfu as taux,
|
||||
dimp.montant_taxe as montant_du,
|
||||
dimp.montant_taxe-coalesce(dimp.acompte,0)-coalesce(dimp.retenu_irf,0) as montant_du,
|
||||
case
|
||||
when cca.parcelle_id is not null then true
|
||||
else false
|
||||
@@ -123,6 +123,8 @@ FROM impositions_tfu imp
|
||||
LEFT JOIN structure st
|
||||
ON st.id = cca.structure_id
|
||||
where dimp.personne_id is not null
|
||||
order by exo.annee,dimp.parcelle_id,dimp.nature_impot, dimp.montant_taxe-coalesce(dimp.acompte,0)-coalesce(dimp.retenu_irf,0) desc ;
|
||||
and dimp.ifu='208558';
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -410,10 +410,12 @@ BEGIN
|
||||
batiment_id,
|
||||
unite_logement_id,
|
||||
superficie_au_sol_loue,
|
||||
personne_id
|
||||
personne_id,
|
||||
acompte,
|
||||
retenu_irf
|
||||
)
|
||||
SELECT
|
||||
v_annee,
|
||||
v_annee-1,
|
||||
d.code,
|
||||
d.nom,
|
||||
c.code,
|
||||
@@ -528,7 +530,9 @@ BEGIN
|
||||
b.id,
|
||||
NULL,
|
||||
eb.superficie_louee,
|
||||
ep.personne_id
|
||||
ep.personne_id,
|
||||
tac.montant_acompte,
|
||||
trirf.montant_rirf
|
||||
FROM parcelle p
|
||||
|
||||
-- Dernière enquête parcelle
|
||||
@@ -614,10 +618,46 @@ BEGIN
|
||||
ORDER BY br.quartier_id DESC NULLS LAST
|
||||
LIMIT 1
|
||||
) brb ON TRUE
|
||||
|
||||
LEFT JOIN ( ----------Calcul cumul acompte
|
||||
select epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.exercice=v_annee-1
|
||||
and epa.id_impot_nature='IRF'
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
)tac on tac.ifu=pers.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
LEFT JOIN ( ----------Calcul cumul retenu irf
|
||||
select epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice,
|
||||
sum(epr.montant_payer) as montant_rirf
|
||||
from epaiement_retenu epr
|
||||
where epr.exercice=v_annee-1
|
||||
group by epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice
|
||||
)trirf on trirf.ifu_retenue=pers.ifu and trirf.r_quartier=q.code and trirf.qip_ilot=p.i and trirf.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
AND ul_filter.batiment_id IS NULL -- anti-join : pas d'unité logement
|
||||
AND st.id = v_structure_id
|
||||
AND NOT EXISTS(select 1 from donnees_imposition_tfu dimptfu
|
||||
where dimptfu.annee=v_annee-1
|
||||
AND dimptfu.nature_impot='IRF'
|
||||
AND dimptfu.batiment_id=b.id)
|
||||
|
||||
ON CONFLICT DO NOTHING;
|
||||
|
||||
@@ -627,3 +667,5 @@ BEGIN
|
||||
END;
|
||||
$$;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -125,10 +125,12 @@ BEGIN
|
||||
batiment_id,
|
||||
unite_logement_id,
|
||||
superficie_au_sol_loue,
|
||||
personne_id
|
||||
personne_id,
|
||||
acompte,
|
||||
retenu_irf
|
||||
)
|
||||
SELECT
|
||||
v_annee,
|
||||
v_annee-1,
|
||||
d.code,
|
||||
d.nom,
|
||||
c.code,
|
||||
@@ -243,9 +245,10 @@ BEGIN
|
||||
b.id,
|
||||
NULL,
|
||||
eb.superficie_louee,
|
||||
ep.personne_id
|
||||
ep.personne_id,
|
||||
tac.montant_acompte,
|
||||
trirf.montant_rirf
|
||||
FROM parcelle p
|
||||
|
||||
-- Dernière enquête parcelle
|
||||
LEFT JOIN LATERAL (
|
||||
SELECT
|
||||
@@ -329,14 +332,46 @@ BEGIN
|
||||
ORDER BY br.quartier_id DESC NULLS LAST
|
||||
LIMIT 1
|
||||
) brb ON TRUE
|
||||
|
||||
LEFT JOIN ( ----------Calcul cumul acompte
|
||||
select epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.exercice=v_annee-1
|
||||
and epa.id_impot_nature='IRF'
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
)tac on tac.ifu=pers.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
LEFT JOIN ( ----------Calcul cumul retenu irf
|
||||
select epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice,
|
||||
sum(epr.montant_payer) as montant_rirf
|
||||
from epaiement_retenu epr
|
||||
where epr.exercice=v_annee-1
|
||||
group by epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice
|
||||
)trirf on trirf.ifu_retenue=pers.ifu and trirf.r_quartier=q.code and trirf.qip_ilot=p.i and trirf.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
AND ul_filter.batiment_id IS NULL -- anti-join : pas d'unité logement
|
||||
AND st.id = v_structure_id
|
||||
AND p.id=p_parcelle_id
|
||||
AND NOT EXISTS(select 1 from donnees_imposition_tfu dimptfu
|
||||
where dimptfu.parcelle_id=p_parcelle_id
|
||||
AND dimptfu.annee=v_annee
|
||||
AND dimptfu.annee=v_annee-1
|
||||
AND dimptfu.nature_impot='IRF'
|
||||
AND dimptfu.batiment_id=b.id)
|
||||
|
||||
|
||||
@@ -447,7 +447,9 @@ BEGIN
|
||||
batiment_id,
|
||||
unite_logement_id,
|
||||
superficie_au_sol_loue,
|
||||
personne_id
|
||||
personne_id,
|
||||
acompte,
|
||||
retenu_irf
|
||||
)
|
||||
SELECT
|
||||
v_annee,
|
||||
@@ -539,8 +541,9 @@ BEGIN
|
||||
b.id,
|
||||
ul.id,
|
||||
eul.superficie_louee,
|
||||
eul.personne_id
|
||||
|
||||
eul.personne_id,
|
||||
tac.montant_acompte,
|
||||
trirf.montant_rirf
|
||||
FROM parcelle p
|
||||
|
||||
LEFT JOIN LATERAL (
|
||||
@@ -628,7 +631,39 @@ BEGIN
|
||||
ORDER BY br.quartier_id DESC NULLS LAST
|
||||
LIMIT 1
|
||||
) brb ON TRUE
|
||||
|
||||
LEFT JOIN ( ----------Calcul cumul acompte
|
||||
select epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.exercice=v_annee-1
|
||||
and epa.id_impot_nature='IRF'
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
)tac on tac.ifu=eul.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
LEFT JOIN ( ----------Calcul cumul retenu irf
|
||||
select epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice,
|
||||
sum(epr.montant_payer) as montant_rirf
|
||||
from epaiement_retenu epr
|
||||
where epr.exercice=v_annee-1
|
||||
group by epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice
|
||||
)trirf on trirf.ifu_retenue=eul.ifu and trirf.r_quartier=q.code and trirf.qip_ilot=p.i and trirf.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
AND st.id = v_structure_id
|
||||
|
||||
|
||||
@@ -104,7 +104,9 @@ BEGIN
|
||||
batiment_id,
|
||||
unite_logement_id,
|
||||
superficie_au_sol_loue,
|
||||
personne_id
|
||||
personne_id,
|
||||
acompte,
|
||||
retenu_irf
|
||||
)
|
||||
SELECT
|
||||
v_annee,
|
||||
@@ -196,8 +198,9 @@ BEGIN
|
||||
b.id,
|
||||
ul.id,
|
||||
eul.superficie_louee,
|
||||
eul.personne_id
|
||||
|
||||
eul.personne_id,
|
||||
tac.montant_acompte,
|
||||
trirf.montant_rirf
|
||||
FROM parcelle p
|
||||
|
||||
LEFT JOIN LATERAL (
|
||||
@@ -285,7 +288,39 @@ BEGIN
|
||||
ORDER BY br.quartier_id DESC NULLS LAST
|
||||
LIMIT 1
|
||||
) brb ON TRUE
|
||||
|
||||
LEFT JOIN ( ----------Calcul cumul acompte
|
||||
select epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.exercice=v_annee-1
|
||||
and epa.id_impot_nature='IRF'
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
)tac on tac.ifu=eul.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
LEFT JOIN ( ----------Calcul cumul retenu irf
|
||||
select epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice,
|
||||
sum(epr.montant_payer) as montant_rirf
|
||||
from epaiement_retenu epr
|
||||
where epr.exercice=v_annee-1
|
||||
group by epr.ifu_retenue,
|
||||
epr.r_quartier,
|
||||
epr.qip_ilot,
|
||||
epr.qip_parcelle,
|
||||
epr.exercice
|
||||
)trirf on trirf.ifu_retenue=eul.ifu and trirf.r_quartier=q.code and trirf.qip_ilot=p.i and trirf.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
AND st.id = v_structure_id
|
||||
AND p.id=p_parcelle_id
|
||||
|
||||
@@ -128,7 +128,8 @@ BEGIN
|
||||
unite_logement_id,
|
||||
personne_id,
|
||||
nombre_ulog,
|
||||
nombre_bat
|
||||
nombre_bat,
|
||||
acompte
|
||||
)
|
||||
SELECT
|
||||
v_annee,
|
||||
@@ -362,7 +363,8 @@ BEGIN
|
||||
where ulog.batiment_id= b.id),
|
||||
(select count(*)
|
||||
from batiment bat
|
||||
where bat.parcelle_id= p.id)
|
||||
where bat.parcelle_id= p.id),
|
||||
tac.montant_acompte
|
||||
FROM parcelle p
|
||||
-- Dernière enquête parcelle
|
||||
LEFT JOIN LATERAL (
|
||||
@@ -444,7 +446,24 @@ BEGIN
|
||||
ORDER BY br.quartier_id DESC NULLS LAST
|
||||
LIMIT 1
|
||||
) brb ON TRUE
|
||||
|
||||
LEFT JOIN ( ----------Calcul cumul acompte
|
||||
select epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.exercice=v_annee
|
||||
and epa.id_impot_nature='FB'
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
)tac on tac.ifu=pers.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
--AND ul_filter.batiment_id IS NULL -- anti-join : pas d'unité logement
|
||||
AND st.id = v_structure_id ;
|
||||
|
||||
@@ -129,7 +129,8 @@ BEGIN
|
||||
unite_logement_id,
|
||||
personne_id,
|
||||
nombre_ulog,
|
||||
nombre_bat
|
||||
nombre_bat,
|
||||
acompte
|
||||
)
|
||||
SELECT
|
||||
v_annee,
|
||||
@@ -363,7 +364,8 @@ BEGIN
|
||||
where ulog.batiment_id= b.id),
|
||||
(select count(*)
|
||||
from batiment bat
|
||||
where bat.parcelle_id= p.id)
|
||||
where bat.parcelle_id= p.id),
|
||||
tac.montant_acompte
|
||||
FROM parcelle p
|
||||
-- Dernière enquête parcelle
|
||||
LEFT JOIN LATERAL (
|
||||
@@ -445,7 +447,24 @@ BEGIN
|
||||
ORDER BY br.quartier_id DESC NULLS LAST
|
||||
LIMIT 1
|
||||
) brb ON TRUE
|
||||
|
||||
LEFT JOIN ( ----------Calcul cumul acompte
|
||||
select epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.exercice=v_annee
|
||||
and epa.id_impot_nature='FB'
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
)tac on tac.ifu=pers.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
--AND ul_filter.batiment_id IS NULL -- anti-join : pas d'unité logement
|
||||
AND st.id = v_structure_id
|
||||
|
||||
@@ -150,7 +150,8 @@ BEGIN
|
||||
taux_tfu,
|
||||
parcelle_id,
|
||||
batiment_id,
|
||||
unite_logement_id
|
||||
unite_logement_id,
|
||||
acompte
|
||||
)
|
||||
SELECT
|
||||
v_annee,
|
||||
@@ -300,8 +301,8 @@ BEGIN
|
||||
v_taux_tfu,
|
||||
p.id,
|
||||
b.id,
|
||||
ul.id
|
||||
|
||||
ul.id,
|
||||
tac.montant_acompte
|
||||
FROM parcelle p
|
||||
-- Dernière enquête parcelle
|
||||
LEFT JOIN LATERAL (
|
||||
@@ -423,7 +424,24 @@ BEGIN
|
||||
ORDER BY br.quartier_id DESC NULLS LAST
|
||||
LIMIT 1
|
||||
) brb ON TRUE
|
||||
|
||||
LEFT JOIN ( ----------Calcul cumul acompte
|
||||
select epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.exercice=v_annee
|
||||
and epa.id_impot_nature='FB'
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
)tac on tac.ifu=eul.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
|
||||
@@ -151,7 +151,8 @@ BEGIN
|
||||
taux_tfu,
|
||||
parcelle_id,
|
||||
batiment_id,
|
||||
unite_logement_id
|
||||
unite_logement_id,
|
||||
acompte
|
||||
)
|
||||
SELECT
|
||||
v_annee,
|
||||
@@ -301,8 +302,8 @@ BEGIN
|
||||
v_taux_tfu,
|
||||
p.id,
|
||||
b.id,
|
||||
ul.id
|
||||
|
||||
ul.id,
|
||||
tac.montant_acompte
|
||||
FROM parcelle p
|
||||
-- Dernière enquête parcelle
|
||||
LEFT JOIN LATERAL (
|
||||
@@ -415,16 +416,33 @@ BEGIN
|
||||
JOIN categorie_batiment cb ON cb.id = eul.categorie_batiment_id
|
||||
|
||||
-- Barème RFU bâti (inchangé)
|
||||
JOIN LATERAL (
|
||||
SELECT *
|
||||
FROM barem_rfu_bati br
|
||||
WHERE br.categorie_batiment_id = cb.id
|
||||
AND br.arrondissement_id = a.id
|
||||
AND (br.quartier_id = q.id OR br.quartier_id IS NULL)
|
||||
ORDER BY br.quartier_id DESC NULLS LAST
|
||||
LIMIT 1
|
||||
) brb ON TRUE
|
||||
|
||||
JOIN LATERAL (
|
||||
SELECT *
|
||||
FROM barem_rfu_bati br
|
||||
WHERE br.categorie_batiment_id = cb.id
|
||||
AND br.arrondissement_id = a.id
|
||||
AND (br.quartier_id = q.id OR br.quartier_id IS NULL)
|
||||
ORDER BY br.quartier_id DESC NULLS LAST
|
||||
LIMIT 1
|
||||
) brb ON TRUE
|
||||
LEFT JOIN ( ----------Calcul cumul acompte
|
||||
select epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.exercice=v_annee
|
||||
and epa.id_impot_nature='FB'
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
)tac on tac.ifu=eul.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
WHERE p.batie = TRUE
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
|
||||
@@ -230,7 +230,8 @@ BEGIN
|
||||
valeur_admin_parcelle_nb_metre_carre,
|
||||
montant_taxe,
|
||||
parcelle_id,
|
||||
personne_id
|
||||
personne_id,
|
||||
acompte
|
||||
)
|
||||
SELECT
|
||||
v_annee,
|
||||
@@ -290,7 +291,8 @@ BEGIN
|
||||
ELSE brnb.valeur_administrative * brnb.taux / 100
|
||||
END,
|
||||
p.id,
|
||||
ep.personne_id
|
||||
ep.personne_id,
|
||||
tac.montant_acompte
|
||||
FROM parcelle p
|
||||
LEFT JOIN (
|
||||
SELECT DISTINCT ON (parcelle_id)
|
||||
@@ -332,7 +334,24 @@ BEGIN
|
||||
|
||||
LEFT JOIN barem_rfu_non_bati brnb
|
||||
ON (brnb.commune_id = c.id AND brnb.zone_rfu_id = ep.zone_rfu_id)
|
||||
|
||||
LEFT JOIN ( ----------Calcul cumul acompte
|
||||
select epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.exercice=v_annee
|
||||
and epa.id_impot_nature='FNB'
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
)tac on tac.ifu=pers.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
WHERE p.batie = false
|
||||
AND st.id = v_structure_id
|
||||
|
||||
|
||||
@@ -68,7 +68,8 @@ BEGIN
|
||||
valeur_admin_parcelle_nb_metre_carre,
|
||||
montant_taxe,
|
||||
parcelle_id,
|
||||
personne_id
|
||||
personne_id,
|
||||
acompte ---champ pour cumul acompte
|
||||
)
|
||||
SELECT
|
||||
v_annee,
|
||||
@@ -128,7 +129,8 @@ BEGIN
|
||||
ELSE brnb.valeur_administrative * brnb.taux / 100
|
||||
END,
|
||||
p.id,
|
||||
ep.personne_id
|
||||
ep.personne_id,
|
||||
tac.montant_acompte ---valeur pour cumul acompte
|
||||
FROM parcelle p
|
||||
LEFT JOIN (
|
||||
SELECT DISTINCT ON (parcelle_id)
|
||||
@@ -170,7 +172,24 @@ BEGIN
|
||||
|
||||
LEFT JOIN barem_rfu_non_bati brnb
|
||||
ON (brnb.commune_id = c.id AND brnb.zone_rfu_id = ep.zone_rfu_id)
|
||||
|
||||
LEFT JOIN ( ----------Calcul cumul acompte
|
||||
select epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice,
|
||||
sum(epa.montant_payer) as montant_acompte
|
||||
from epaiement_acompte epa
|
||||
where epa.exercice=v_annee
|
||||
and epa.id_impot_nature='FNB'
|
||||
group by epa.ifu,
|
||||
epa.r_quartier,
|
||||
epa.qip_ilot,
|
||||
epa.qip_parcelle,
|
||||
epa.id_impot_nature,
|
||||
epa.exercice
|
||||
)tac on tac.ifu=pers.ifu and tac.r_quartier=q.code and tac.qip_ilot=p.i and tac.qip_parcelle=p.p
|
||||
WHERE p.batie = false
|
||||
AND st.id = v_structure_id
|
||||
AND p.id=p_parcelle_id
|
||||
@@ -188,3 +207,4 @@ BEGIN
|
||||
END;
|
||||
$$;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user