From 71e566da256a05f834268ffefdeb61d90244b73c Mon Sep 17 00:00:00 2001 From: Aurince AKAKPO Date: Thu, 30 Apr 2026 11:31:58 +0100 Subject: [PATCH] liquidation pour une parcelle --- .../DonneesImpositionTfuController.java | 90 +++++++-------- .../DeclarationSpontaneBien.java | 62 +++++++++++ .../interface_sigibe/EpaiementAcompte.java | 58 ++++++++++ .../interface_sigibe/EpaiementRetenu.java | 55 ++++++++++ .../interface_sigibe/PaiementAvis.java | 50 +++++++++ .../rfu/metier/CommuneCentreAssignation.java | 2 + .../rfu/metier/DonneesImpositionTfu.java | 4 + .../CommuneCentreAssignationPaylaodWeb.java | 7 +- .../export_donnee_imposition_vers_sigibe.sql | 6 + .../maj_donnees_imposition_acompte_rirf.sql | 103 ++++++++++++++++++ .../CommuneCentreAssignationRepository.java | 35 +++--- .../service/EntityFromPayLoadService.java | 2 + src/main/resources/application.properties | 2 +- 13 files changed, 406 insertions(+), 70 deletions(-) create mode 100644 src/main/java/io/gmss/fiscad/entities/interface_sigibe/DeclarationSpontaneBien.java create mode 100644 src/main/java/io/gmss/fiscad/entities/interface_sigibe/EpaiementAcompte.java create mode 100644 src/main/java/io/gmss/fiscad/entities/interface_sigibe/EpaiementRetenu.java create mode 100644 src/main/java/io/gmss/fiscad/entities/interface_sigibe/PaiementAvis.java create mode 100644 src/main/java/io/gmss/fiscad/persistence/procedure_fonction_stocke/maj_donnees_imposition_acompte_rirf.sql diff --git a/src/main/java/io/gmss/fiscad/controllers/rfu/metier/DonneesImpositionTfuController.java b/src/main/java/io/gmss/fiscad/controllers/rfu/metier/DonneesImpositionTfuController.java index daf0934..5d0984f 100644 --- a/src/main/java/io/gmss/fiscad/controllers/rfu/metier/DonneesImpositionTfuController.java +++ b/src/main/java/io/gmss/fiscad/controllers/rfu/metier/DonneesImpositionTfuController.java @@ -116,52 +116,52 @@ public class DonneesImpositionTfuController { } } - @GetMapping("/all") - public ResponseEntity getAllDonneesImpositionTfuList() { - try { - return new ResponseEntity<>( - new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(), "Liste des impositions chargée avec succès."), - HttpStatus.OK - ); - } catch (HttpClientErrorException.MethodNotAllowed e) { - logger.error(e.getLocalizedMessage()); - return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK); - } catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException | - FileStorageException e) { - logger.error(e.getLocalizedMessage()); - return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK); - } catch (NullPointerException e) { - logger.error(e.getLocalizedMessage()); - return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK); - } catch (Exception e) { - logger.error(e.getLocalizedMessage()); - return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK); - } - } +// @GetMapping("/all") +// public ResponseEntity getAllDonneesImpositionTfuList() { +// try { +// return new ResponseEntity<>( +// new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(), "Liste des impositions chargée avec succès."), +// HttpStatus.OK +// ); +// } catch (HttpClientErrorException.MethodNotAllowed e) { +// logger.error(e.getLocalizedMessage()); +// return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK); +// } catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException | +// FileStorageException e) { +// logger.error(e.getLocalizedMessage()); +// return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK); +// } catch (NullPointerException e) { +// logger.error(e.getLocalizedMessage()); +// return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK); +// } catch (Exception e) { +// logger.error(e.getLocalizedMessage()); +// return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK); +// } +// } - @GetMapping("/all-paged") - public ResponseEntity getAllDonneesImpositionTfuPaged(@RequestParam int pageNo, @RequestParam int pageSize) { - try { - Pageable pageable = PageRequest.of(pageNo, pageSize); - return new ResponseEntity<>( - new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(pageable), "Liste des impositions chargée avec succès."), - HttpStatus.OK - ); - } catch (HttpClientErrorException.MethodNotAllowed e) { - logger.error(e.getLocalizedMessage()); - return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK); - } catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException | - FileStorageException e) { - logger.error(e.getLocalizedMessage()); - return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK); - } catch (NullPointerException e) { - logger.error(e.getLocalizedMessage()); - return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK); - } catch (Exception e) { - logger.error(e.getLocalizedMessage()); - return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK); - } - } +// @GetMapping("/all-paged") +// public ResponseEntity getAllDonneesImpositionTfuPaged(@RequestParam int pageNo, @RequestParam int pageSize) { +// try { +// Pageable pageable = PageRequest.of(pageNo, pageSize); +// return new ResponseEntity<>( +// new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(pageable), "Liste des impositions chargée avec succès."), +// HttpStatus.OK +// ); +// } catch (HttpClientErrorException.MethodNotAllowed e) { +// logger.error(e.getLocalizedMessage()); +// return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK); +// } catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException | +// FileStorageException e) { +// logger.error(e.getLocalizedMessage()); +// return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK); +// } catch (NullPointerException e) { +// logger.error(e.getLocalizedMessage()); +// return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK); +// } catch (Exception e) { +// logger.error(e.getLocalizedMessage()); +// return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK); +// } +// } @GetMapping("/all-page/by-imposition-id/{impositionId}") diff --git a/src/main/java/io/gmss/fiscad/entities/interface_sigibe/DeclarationSpontaneBien.java b/src/main/java/io/gmss/fiscad/entities/interface_sigibe/DeclarationSpontaneBien.java new file mode 100644 index 0000000..5e7b5f3 --- /dev/null +++ b/src/main/java/io/gmss/fiscad/entities/interface_sigibe/DeclarationSpontaneBien.java @@ -0,0 +1,62 @@ +package io.gmss.fiscad.entities.interface_sigibe; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.gmss.fiscad.deserializer.LocalDateDeserializer; +import io.gmss.fiscad.entities.BaseEntity; +import io.gmss.fiscad.entities.decoupage.Quartier; +import io.gmss.fiscad.entities.infocad.parametre.Personne; +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; + +@EqualsAndHashCode(callSuper = true) +@Entity +@Data +@NoArgsConstructor +@AllArgsConstructor +public class DeclarationSpontaneBien extends BaseEntity implements Serializable { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + private Long idImposition ; + private String rImposition ; + private String ifu ; + private String rCommune ; + private String rQuartier ; + private String qipQuartier; + private String qipIlot; + private String qipParcelle; + private String nup; + private String gpsLatitude; + private String gpsLongitude; + private String commentaire; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateValidation; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateInformation; + private Long valeurBatiment; + private Long nub; + private Long nul; + private Long montantLocatifAnnuel ; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateConstruction; + private Float superficieSolBat; + private Float superficieSolUlot; + private Float superficieParcelle; + private String usage; + private Boolean bati; + @ManyToOne + private Personne personne; + @ManyToOne + private Quartier quartier; +} \ No newline at end of file diff --git a/src/main/java/io/gmss/fiscad/entities/interface_sigibe/EpaiementAcompte.java b/src/main/java/io/gmss/fiscad/entities/interface_sigibe/EpaiementAcompte.java new file mode 100644 index 0000000..50ff8a2 --- /dev/null +++ b/src/main/java/io/gmss/fiscad/entities/interface_sigibe/EpaiementAcompte.java @@ -0,0 +1,58 @@ +package io.gmss.fiscad.entities.interface_sigibe; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.gmss.fiscad.deserializer.LocalDateDeserializer; +import io.gmss.fiscad.entities.BaseEntity; +import io.gmss.fiscad.entities.infocad.parametre.Personne; +import io.gmss.fiscad.entities.infocad.parametre.PositionRepresentation; +import io.gmss.fiscad.entities.infocad.parametre.TypeContestation; +import io.gmss.fiscad.entities.infocad.parametre.TypeRepresentation; +import io.gmss.fiscad.enums.SourceDonnee; +import io.gmss.fiscad.enums.TypeDroit; +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; + +@EqualsAndHashCode(callSuper = true) +@Entity +@Data +@NoArgsConstructor +@AllArgsConstructor +public class EpaiementAcompte extends BaseEntity implements Serializable { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + private Long idPaiementAcompte; + private Long idPaiementImpot; + private String rDoc; + private String rImpot; + private String idImpotType; + private String idImpotNature; + private String ifu; + private String rCommune; + private String rQuartier; + private String qipQuartier; + private String qipIlot; + private String qipParcelle; + private String nup; + private Long exercice; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateValidation; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateAvisCredit; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateRapprochement; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateInformation; + private Long montantPayer; +} diff --git a/src/main/java/io/gmss/fiscad/entities/interface_sigibe/EpaiementRetenu.java b/src/main/java/io/gmss/fiscad/entities/interface_sigibe/EpaiementRetenu.java new file mode 100644 index 0000000..da2e2da --- /dev/null +++ b/src/main/java/io/gmss/fiscad/entities/interface_sigibe/EpaiementRetenu.java @@ -0,0 +1,55 @@ +package io.gmss.fiscad.entities.interface_sigibe; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.gmss.fiscad.deserializer.LocalDateDeserializer; +import io.gmss.fiscad.entities.BaseEntity; +import io.gmss.fiscad.enums.SourceDonnee; +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; + +@EqualsAndHashCode(callSuper = true) +@Entity +@Data +@NoArgsConstructor +@AllArgsConstructor +public class EpaiementRetenu extends BaseEntity implements Serializable { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + private Long idPaiementRetenue; + private Long idEdiGenerique; + private Long idPaiementImpot; + private String rDoc; + private String rImpot; + private String idImpotType; + private String idImpotNature; + private String ifuPayeur; + private String ifuRetenue; + private String rCommune; + private String rQuartier; + private String qipQuartier; + private String qipIlot; + private String qipParcelle; + private String nup; + private Long exercice; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateValidation; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateAvisCredit; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateRapprochement; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateInformation; + private Long montantPayer; +} diff --git a/src/main/java/io/gmss/fiscad/entities/interface_sigibe/PaiementAvis.java b/src/main/java/io/gmss/fiscad/entities/interface_sigibe/PaiementAvis.java new file mode 100644 index 0000000..1940541 --- /dev/null +++ b/src/main/java/io/gmss/fiscad/entities/interface_sigibe/PaiementAvis.java @@ -0,0 +1,50 @@ +package io.gmss.fiscad.entities.interface_sigibe; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.gmss.fiscad.deserializer.LocalDateDeserializer; +import io.gmss.fiscad.entities.BaseEntity; +import io.gmss.fiscad.enums.SourceDonnee; +import jakarta.persistence.*; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDate; + +@EqualsAndHashCode(callSuper = true) +@Entity +@Data +@NoArgsConstructor +@AllArgsConstructor +public class PaiementAvis extends BaseEntity implements Serializable { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + private Long idPaiementImpot; + private Long idAvis; + private Long idUniteFoncier; + private Long idContribuableFoncier; + private String rDoc; + private String rImpot; + private String idImpotType; + private String idImpotNature; + private String ifu; + private String rCommune; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateValidation; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateAvisCredit; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateRapprochement; + @JsonFormat(pattern = "dd-MM-yyyy") + @JsonDeserialize(using = LocalDateDeserializer.class) + private LocalDate dateInformation; + private Long montantPayer; + +} \ No newline at end of file diff --git a/src/main/java/io/gmss/fiscad/entities/rfu/metier/CommuneCentreAssignation.java b/src/main/java/io/gmss/fiscad/entities/rfu/metier/CommuneCentreAssignation.java index 68762c3..dd6d560 100644 --- a/src/main/java/io/gmss/fiscad/entities/rfu/metier/CommuneCentreAssignation.java +++ b/src/main/java/io/gmss/fiscad/entities/rfu/metier/CommuneCentreAssignation.java @@ -62,4 +62,6 @@ public class CommuneCentreAssignation extends BaseEntity implements Serializable private String nc; private String ifu; + + private String adresseContact ; } \ No newline at end of file diff --git a/src/main/java/io/gmss/fiscad/entities/rfu/metier/DonneesImpositionTfu.java b/src/main/java/io/gmss/fiscad/entities/rfu/metier/DonneesImpositionTfu.java index a6caeb7..b47af6e 100644 --- a/src/main/java/io/gmss/fiscad/entities/rfu/metier/DonneesImpositionTfu.java +++ b/src/main/java/io/gmss/fiscad/entities/rfu/metier/DonneesImpositionTfu.java @@ -114,6 +114,10 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable { private Float tauxTfu; private Long tfuPiscine; private Float montantTaxe; + private Float penalite; + private Float retenuIrf ; + private Float acompte ; + private Float montantRestant ; private Float montantTaxeBrut; //montant de la taxe calculée sans comparaisons avec TFU MINI private Float tfuCalculeTauxPropParc; private Float tfuSuperficieAuSolReel; diff --git a/src/main/java/io/gmss/fiscad/paylaods/request/crudweb/CommuneCentreAssignationPaylaodWeb.java b/src/main/java/io/gmss/fiscad/paylaods/request/crudweb/CommuneCentreAssignationPaylaodWeb.java index 1528edb..dc1c2da 100644 --- a/src/main/java/io/gmss/fiscad/paylaods/request/crudweb/CommuneCentreAssignationPaylaodWeb.java +++ b/src/main/java/io/gmss/fiscad/paylaods/request/crudweb/CommuneCentreAssignationPaylaodWeb.java @@ -27,11 +27,11 @@ public class CommuneCentreAssignationPaylaodWeb { private String parcelleContactQ; private String parcelleContactI; private String parcelleContactP; + private String adresseContact; - public CommuneCentreAssignationPaylaodWeb(Long id, String code, String nom, Long communeId, String communeCode, String communeNom, Long structureId, String structureCode, String structureNom, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, String personneIfu, String personneNc, String personneNpi, Long parcelleContactId, String parcelleContactQuartierCode, String parcelleContactQ, String parcelleContactI, String parcelleContactP) { + public CommuneCentreAssignationPaylaodWeb(Long id, Long communeId, String communeCode, String communeNom, Long structureId, String structureCode, String structureNom, Long personneId, String personneNom, String personnePrenom, String personneRaisonSociale, String personneIfu, String personneNc, String personneNpi, Long parcelleContactId, String parcelleContactQuartierCode, String parcelleContactQ, String parcelleContactI, String parcelleContactP, + String adresseContact) { this.id = id; - this.code = code; - this.nom = nom; this.communeId = communeId; this.communeCode = communeCode; this.communeNom = communeNom; @@ -50,5 +50,6 @@ public class CommuneCentreAssignationPaylaodWeb { this.parcelleContactQ = parcelleContactQ; this.parcelleContactI = parcelleContactI; this.parcelleContactP = parcelleContactP; + this.adresseContact=adresseContact; } } diff --git a/src/main/java/io/gmss/fiscad/persistence/procedure_fonction_stocke/export_donnee_imposition_vers_sigibe.sql b/src/main/java/io/gmss/fiscad/persistence/procedure_fonction_stocke/export_donnee_imposition_vers_sigibe.sql index 21fa901..e40c7cc 100644 --- a/src/main/java/io/gmss/fiscad/persistence/procedure_fonction_stocke/export_donnee_imposition_vers_sigibe.sql +++ b/src/main/java/io/gmss/fiscad/persistence/procedure_fonction_stocke/export_donnee_imposition_vers_sigibe.sql @@ -123,6 +123,12 @@ FROM impositions_tfu imp ON st.id = cca.structure_id where dimp.personne_id is not null ; + + + + + +--------------------------------------------------- select * from e_avis_detail_view where qip_quartier='6431' and qip_ilot='1656' and qip_parcelle='C' ; diff --git a/src/main/java/io/gmss/fiscad/persistence/procedure_fonction_stocke/maj_donnees_imposition_acompte_rirf.sql b/src/main/java/io/gmss/fiscad/persistence/procedure_fonction_stocke/maj_donnees_imposition_acompte_rirf.sql new file mode 100644 index 0000000..6aaf8ec --- /dev/null +++ b/src/main/java/io/gmss/fiscad/persistence/procedure_fonction_stocke/maj_donnees_imposition_acompte_rirf.sql @@ -0,0 +1,103 @@ +/** + - recuperation et cumul des acomptes par exercice, commune, ifu et parcelle + - recuperation et cumul des rirf par exercice, commune, ifu et parcelle + */ + +CREATE OR REPLACE FUNCTION public.maj_donnees_imposition_tfu_irf_( + p_impositions_tfu_id BIGINT +) + RETURNS INTEGER + LANGUAGE plpgsql +AS $$ +DECLARE + v_rows_inserted INTEGER; + v_annee INTEGER; + v_structure_id INTEGER; +BEGIN + SELECT ex.annee, it.structure_id + INTO STRICT v_annee, v_structure_id + FROM impositions_tfu it + JOIN exercice ex ON ex.id = it.exercice_id + WHERE it.id = p_impositions_tfu_id; + + WITH cumulRetenu as ( + select ifu_retenue, + r_commune, + r_quartier, + qip_quartier, + qip_ilot, + qip_parcelle, + nup, + exercice, + sum(montant_payer) as cumul_retenu + from epaiement_retenu + where exercice = v_annee + group by ifu_retenue, r_commune, r_quartier, + qip_quartier, qip_ilot, qip_parcelle, + nup, exercice + ) + UPDATE donnees_imposition_tfu dimp + SET + retenu_irf = coalesce(cr.cumul_retenu,0), + montant_restant = dimp.montant_taxe + - coalesce(cr.cumul_retenu,0) + FROM donnees_imposition_tfu dimp2 + LEFT JOIN cumulRetenu cr ON ( + cr.exercice = dimp2.annee + AND cr.r_commune = dimp2.code_commune + AND cr.ifu_retenue = dimp2.ifu + AND cr.r_quartier = dimp2.code_quartier_village + AND cr.qip_quartier = dimp2.q + AND cr.qip_ilot = dimp2.ilot + AND cr.qip_parcelle = dimp2.parcelle + AND cr.nup = dimp2.nup + AND cr.nup = dimp2.nup + ) + WHERE dimp.id = dimp2.id + AND dimp.impositions_tfu_id = p_impositions_tfu_id + AND dimp.nature_impot ='IRF'; + + + WITH cumulAcompte as ( + select ifu, + r_commune, + r_quartier, + qip_quartier, + qip_ilot, + qip_parcelle, + nup, + exercice, + sum(montant_payer) as cumul_acompte + from epaiement_acompte + where exercice = v_annee + group by ifu, r_commune, r_quartier, + qip_quartier, qip_ilot, qip_parcelle, + nup, exercice + ) + UPDATE donnees_imposition_tfu dimp + SET + acompte = coalesce(ac.cumul_acompte,0), + montant_restant = dimp.montant_taxe + - coalesce(ac.cumul_acompte,0) + FROM donnees_imposition_tfu dimp2 + LEFT JOIN cumulAcompte ac ON ( + ac.exercice = dimp2.annee + AND ac.r_commune = dimp2.code_commune + AND ac.ifu = dimp2.ifu + AND ac.r_quartier = dimp2.code_quartier_village + AND ac.qip_quartier = dimp2.q + AND ac.qip_ilot = dimp2.ilot + AND ac.qip_parcelle = dimp2.parcelle + AND ac.nup = dimp2.nup + ) + WHERE dimp.id = dimp2.id + AND dimp.impositions_tfu_id = p_impositions_tfu_id + AND dimp.nature_impot in ('FNB','FB'); + + GET DIAGNOSTICS v_rows_inserted = ROW_COUNT; + + RETURN v_rows_inserted; +END; +$$ ; + + diff --git a/src/main/java/io/gmss/fiscad/persistence/repositories/rfu/metier/CommuneCentreAssignationRepository.java b/src/main/java/io/gmss/fiscad/persistence/repositories/rfu/metier/CommuneCentreAssignationRepository.java index bba87b2..bcec26b 100755 --- a/src/main/java/io/gmss/fiscad/persistence/repositories/rfu/metier/CommuneCentreAssignationRepository.java +++ b/src/main/java/io/gmss/fiscad/persistence/repositories/rfu/metier/CommuneCentreAssignationRepository.java @@ -20,8 +20,6 @@ public interface CommuneCentreAssignationRepository extends JpaRepository