96 Commits

Author SHA1 Message Date
e2468328fd Merge pull request 'fusion maj parcelle,batiment,ulo et leur enquete' (#184) from features/fiche_refonte into develop
Reviewed-on: #184
2026-03-21 10:13:37 +00:00
41e55da1df Merge pull request 'fusion maj parcelle,batiment,ulo et leur enquete' (#182) from features/fiche_refonte into develop
Reviewed-on: #182
2026-03-20 13:39:59 +00:00
705af14b4e Merge pull request 'fusion maj parcelle,batiment,ulo et leur enquete' (#181) from features/fiche_refonte into develop
Reviewed-on: #181
2026-03-20 13:39:00 +00:00
9063162c33 Merge pull request 'fusion maj parcelle,batiment,ulo et leur enquete' (#179) from features/fiche_refonte into develop
Reviewed-on: #179
2026-03-19 18:45:31 +00:00
3f9cdcdad3 Merge pull request 'fusion maj parcelle,batiment,ulo et leur enquete' (#177) from features/fiche_refonte into develop
Reviewed-on: #177
2026-03-19 18:00:14 +00:00
e58e338123 Merge pull request 'features/fiche_refonte' (#175) from features/fiche_refonte into develop
Reviewed-on: #175
2026-03-19 16:15:42 +00:00
253332bbd3 Merge pull request 'fusion maj parcelle,batiment,ulo et leur enquete' (#173) from features/fiche_refonte into develop
Reviewed-on: #173
2026-03-19 10:24:32 +00:00
6dcd549889 Merge pull request 'features/fiche_refonte' (#171) from features/fiche_refonte into develop
Reviewed-on: #171
2026-03-18 17:18:14 +00:00
0d27aaebac Merge pull request 'fusion maj parcelle,batiment,ulo et leur enquete' (#169) from features/fiche_refonte into develop
Reviewed-on: #169
2026-03-16 13:27:34 +00:00
afbf525af5 Merge pull request 'Generation tfu batie et non batie avec ressource de liste de données imposition' (#167) from features/crud_entites into develop
Reviewed-on: #167
2026-03-14 14:47:18 +00:00
8ee2f7c9b0 Merge pull request 'Generation tfu batie et non batie avec ressource de liste de données imposition' (#165) from features/crud_entites into develop
Reviewed-on: #165
2026-03-12 20:01:27 +00:00
6bdfa3ad1e Merge pull request 'Generation tfu batie et non batie avec ressource de liste de données imposition' (#163) from features/crud_entites into develop
Reviewed-on: #163
2026-03-12 19:34:04 +00:00
b8ba15c6fb Merge pull request 'Generation tfu batie et non batie' (#161) from features/crud_entites into develop
Reviewed-on: #161
2026-03-12 11:27:12 +00:00
698b7e7c99 Merge pull request 'Generation tfu batie et non batie' (#158) from features/crud_entites into develop
Reviewed-on: #158
2026-03-12 11:06:47 +00:00
9e597386f8 Merge pull request 'Generation tfu batie et non batie' (#156) from features/crud_entites into develop
Reviewed-on: #156
2026-03-12 00:03:12 +00:00
cb2faeea32 Merge pull request 'Generation tfu batie et non batie' (#154) from features/crud_entites into develop
Reviewed-on: #154
2026-03-11 00:10:38 +00:00
6b3ab8fc43 Merge pull request 'Gestion des barem' (#152) from features/crud_entites into develop
Reviewed-on: #152
2026-03-10 21:37:55 +00:00
906a74571f Merge pull request 'features/crud_entites' (#150) from features/crud_entites into develop
Reviewed-on: #150
2026-03-09 20:13:24 +00:00
6494fe235e Merge pull request 'Gestion des barem' (#148) from features/crud_entites into develop
Reviewed-on: #148
2026-03-09 20:00:03 +00:00
28da361054 Merge pull request 'features/crud_entites' (#146) from features/crud_entites into develop
Reviewed-on: #146
2026-03-09 19:32:08 +00:00
3993d28d51 Merge pull request 'features/crud_entites' (#144) from features/crud_entites into develop
Reviewed-on: #144
2026-03-09 18:52:33 +00:00
09d8b21909 Merge pull request 'Gestion des barem' (#142) from features/crud_entites into develop
Reviewed-on: #142
2026-03-08 13:54:26 +00:00
274b47d116 Merge pull request 'Gestion des barem' (#141) from features/crud_entites into develop
Reviewed-on: #141
2026-03-08 13:52:20 +00:00
bdb08b88fd Merge pull request 'Gestion des barem' (#140) from features/crud_entites into develop
Reviewed-on: #140
2026-03-08 13:25:13 +00:00
b86c685cd0 Merge pull request 'Gestion cloture' (#138) from features/crud_entites into develop
Reviewed-on: #138
2026-03-06 19:08:53 +00:00
d46a14626e Merge pull request 'Gestion parcelle geom et changement https://gitea.com/actions/checkout@v4 #actions/checkout@v4' (#136) from features/crud_entites into develop
Reviewed-on: #136
2026-03-01 17:33:59 +00:00
920c70c877 Merge pull request 'Gestion parcelle geom' (#135) from features/crud_entites into develop
Reviewed-on: #135
2026-03-01 17:29:34 +00:00
2ab5b9299c Merge pull request 'Gestion parcelle geom' (#133) from features/crud_entites into develop
Reviewed-on: #133
2026-03-01 01:40:41 +00:00
bf19ab6e6a Merge pull request 'features/crud_entites' (#131) from features/crud_entites into develop
Reviewed-on: #131
2026-02-22 23:17:33 +00:00
84451d5a15 Merge pull request 'features/crud_entites' (#129) from features/crud_entites into develop
Reviewed-on: #129
2026-02-22 13:53:35 +00:00
e687a9a904 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#127) from features/crud_entites into develop
Reviewed-on: #127
2026-02-21 12:42:08 +00:00
9685c73513 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#125) from features/crud_entites into develop
Reviewed-on: #125
2026-02-20 19:33:57 +00:00
650470efff Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#123) from features/crud_entites into develop
Reviewed-on: #123
2026-02-20 18:54:07 +00:00
9f5cc61726 Merge pull request 'features/crud_entites' (#121) from features/crud_entites into develop
Reviewed-on: #121
2026-02-19 20:37:58 +00:00
41175d93f0 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#119) from features/crud_entites into develop
Reviewed-on: #119
2026-02-19 19:07:35 +00:00
1ecaecdee3 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#117) from features/crud_entites into develop
Reviewed-on: #117
2026-02-19 18:33:11 +00:00
122dfcbead Merge pull request 'features/crud_entites' (#115) from features/crud_entites into develop
Reviewed-on: #115
2026-02-19 12:00:31 +00:00
d168b68d4b Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#113) from features/crud_entites into develop
Reviewed-on: #113
2026-02-18 23:05:41 +00:00
2af14dd4cd Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#111) from features/crud_entites into develop
Reviewed-on: #111
2026-02-18 20:42:05 +00:00
76f0d34e79 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#109) from features/crud_entites into develop
Reviewed-on: #109
2026-02-18 14:01:25 +00:00
666779ecce Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#107) from features/crud_entites into develop
Reviewed-on: #107
2026-02-16 22:04:26 +00:00
7fcd676fc0 Merge pull request 'features/crud_entites' (#105) from features/crud_entites into develop
Reviewed-on: #105
2026-02-16 20:55:25 +00:00
fffdef7103 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#103) from features/crud_entites into develop
Reviewed-on: #103
2026-02-16 00:15:01 +00:00
95c0dacd1e Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#101) from features/crud_entites into develop
Reviewed-on: #101
2026-02-14 14:08:19 +00:00
7ac6b953d3 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#99) from features/crud_entites into develop
Reviewed-on: #99
2026-02-13 17:54:51 +00:00
e010100472 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#97) from features/crud_entites into develop
Reviewed-on: #97
2026-02-12 21:31:24 +00:00
177a9c7b56 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#95) from features/crud_entites into develop
Reviewed-on: #95
2026-02-12 02:15:05 +00:00
3054930a86 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#93) from features/crud_entites into develop
Reviewed-on: #93
2026-02-11 21:14:57 +00:00
4397abd041 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#91) from features/crud_entites into develop
Reviewed-on: #91
2026-02-11 21:10:08 +00:00
a4b403ca20 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#89) from features/crud_entites into develop
Reviewed-on: #89
2026-02-10 00:10:39 +00:00
ff7b88f9f8 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#87) from features/crud_entites into develop
Reviewed-on: #87
2026-02-09 23:26:42 +00:00
37fdba1d85 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#85) from features/crud_entites into develop
Reviewed-on: #85
2026-02-08 22:23:08 +00:00
f50ed9aa5f Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#83) from features/crud_entites into develop
Reviewed-on: #83
2026-02-04 01:33:32 +00:00
966fd2ca7a Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#81) from features/crud_entites into develop
Reviewed-on: #81
2026-02-03 19:32:06 +00:00
a10253b2e8 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#79) from features/crud_entites into develop
Reviewed-on: #79
2026-02-03 15:08:48 +00:00
08b68f9e08 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#77) from features/crud_entites into develop
Reviewed-on: #77
2026-02-02 23:03:26 +00:00
be487d6a03 Merge pull request 'gestion revu de code en utilisant uniquement les DTO' (#75) from features/crud_entites into develop
Reviewed-on: #75
2026-02-01 22:49:00 +00:00
3be64e7f44 Merge pull request 'gestion de profil, secteur, section et arbre decoupage' (#73) from features/crud_entites into develop
Reviewed-on: #73
2026-01-27 08:58:32 +00:00
03a661cdc0 Merge pull request 'gestion de profil, secteur, section et arbre decoupage' (#72) from features/crud_entites into develop
Reviewed-on: #72
2026-01-27 08:37:52 +00:00
a68ec444cc Merge pull request 'features/crud_entites' (#70) from features/crud_entites into develop
Reviewed-on: #70
2026-01-13 20:33:17 +00:00
58f517bf31 Merge pull request 'correction creation user par defaut' (#68) from features/crud_entites into develop
Reviewed-on: #68
2025-12-20 19:03:51 +00:00
7f18f22efb Merge pull request 'correction creation user par defaut' (#66) from features/crud_entites into develop
Reviewed-on: #66
2025-12-20 18:55:42 +00:00
af3218412f Merge pull request 'correction creation user par defaut' (#64) from features/crud_entites into develop
Reviewed-on: #64
2025-12-20 17:06:19 +00:00
f35670c72e Merge pull request 'correction creation user par defaut' (#62) from features/crud_entites into develop
Reviewed-on: #62
2025-12-20 15:03:45 +00:00
a77c0e854d Merge pull request 'correction creation user par defaut' (#60) from features/crud_entites into develop
Reviewed-on: #60
2025-12-20 14:48:47 +00:00
e75eff4e20 Merge pull request 'correction lecture de secret chargement' (#58) from features/crud_entites into develop
Reviewed-on: #58
2025-12-20 14:33:59 +00:00
40d078c653 Merge pull request 'correction lecture de secret chargement' (#56) from features/crud_entites into develop
Reviewed-on: #56
2025-12-20 14:14:02 +00:00
31dd11d017 Merge pull request 'correction lecture de secret chargement' (#54) from features/crud_entites into develop
Reviewed-on: #54
2025-12-20 13:10:40 +00:00
6dfd12fae8 Merge pull request 'correction lecture de secret chargement' (#52) from features/crud_entites into develop
Reviewed-on: #52
2025-12-20 12:57:46 +00:00
a4ad0a4556 Merge pull request 'correction lecture de secret chargement' (#50) from features/crud_entites into develop
Reviewed-on: #50
2025-12-20 12:41:09 +00:00
411a6c0c2d Merge pull request 'correction lecture de secret' (#48) from features/crud_entites into develop
Reviewed-on: #48
2025-12-20 12:21:25 +00:00
bed73b2b16 Merge pull request 'correction lecture de secret' (#46) from features/crud_entites into develop
Reviewed-on: #46
2025-12-20 12:10:00 +00:00
5a0814a0ba Merge pull request 'correction lecture de secret' (#44) from features/crud_entites into develop
Reviewed-on: #44
2025-12-20 12:00:12 +00:00
126254ea94 Merge pull request 'correction lecture de secret' (#42) from features/crud_entites into develop
Reviewed-on: #42
2025-12-20 11:43:55 +00:00
f9e4681af4 Merge pull request 'correction lecture de secret' (#40) from features/crud_entites into develop
Reviewed-on: #40
2025-12-20 11:39:40 +00:00
84089d3639 Merge pull request 'correction profil actif' (#38) from features/crud_entites into develop
Reviewed-on: #38
2025-12-20 10:48:01 +00:00
02b0a937b4 Merge pull request 'correction profil actif' (#36) from features/crud_entites into develop
Reviewed-on: #36
2025-12-20 10:02:19 +00:00
c0096457fb Merge pull request 'nouvelle verson ci-cd avec gitea runner natif intallé sur hote' (#34) from features/crud_entites into develop
Reviewed-on: #34
2025-12-19 19:14:24 +00:00
b6062ba4d1 Merge pull request 'nouvelle verson ci-cd avec gitea runner natif intallé sur hote' (#33) from features/crud_entites into develop
Reviewed-on: #33
2025-12-19 10:50:02 +00:00
8dc8c974d3 Merge pull request 'correction docker composer avec les secrets' (#32) from features/crud_entites into develop
Reviewed-on: #32
2025-12-19 10:39:57 +00:00
957416df9e Merge pull request 'correction docker composer avec les secrets' (#30) from features/crud_entites into develop
Reviewed-on: #30
2025-12-18 15:47:21 +00:00
8d8af75108 Merge pull request 'correction docker composer avec les secrets' (#28) from features/crud_entites into develop
Reviewed-on: #28
2025-12-18 15:46:02 +00:00
555f13508e Merge pull request 'correction docker composer avec les secrets' (#26) from features/crud_entites into develop
Reviewed-on: #26
2025-12-18 10:36:10 +00:00
d92a2b2503 Merge pull request 'correction docker composer avec les secrets' (#24) from features/crud_entites into develop
Reviewed-on: #24
2025-12-17 17:13:46 +00:00
5ccfdb6a3f Merge pull request 'correction docker composer avec les secrets' (#22) from features/crud_entites into develop
Reviewed-on: #22
2025-12-17 16:58:50 +00:00
87b3bfbe83 Merge pull request 'correction docker composer avec les secrets' (#20) from features/crud_entites into develop
Reviewed-on: #20
2025-12-17 16:49:15 +00:00
62f25ea726 Merge pull request 'correction docker composer avec les secrets' (#18) from features/crud_entites into develop
Reviewed-on: #18
2025-12-17 16:41:46 +00:00
6125fcbd0b Merge pull request 'correction docker composer' (#16) from features/crud_entites into develop
Reviewed-on: #16
2025-12-17 16:26:17 +00:00
211af6103a Merge pull request 'features/crud_entites' (#14) from features/crud_entites into develop
Reviewed-on: #14
2025-12-17 14:12:53 +00:00
d27b622db8 Merge pull request 'Changement en DB du nom de la colonne personne_id en proprietaire_id dans la table enquete' (#12) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 35s
Reviewed-on: #12
2025-12-16 18:22:48 +00:00
c80b40082c Merge pull request 'Changement en DB du nom de la colonne personne_id en proprietaire_id dans la table enquete' (#10) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 44s
Reviewed-on: #10
2025-12-16 18:06:52 +00:00
4a88af6487 Merge pull request 'Changement en DB du nom de la colonne personne_id en proprietaire_id dans la table enquete' (#8) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 34s
Reviewed-on: #8
2025-12-05 19:24:00 +00:00
966b0af1c2 Merge pull request 'Changement en DB du nom de la colonne personne_id en proprietaire_id dans la table enquete' (#6) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 36s
Reviewed-on: #6
2025-12-05 19:20:57 +00:00
58aa088ac3 Merge pull request 'ajout de ci-cd' (#4) from features/crud_entites into develop
All checks were successful
CD - Deploy on main / deploy (pull_request) Successful in 39s
Reviewed-on: #4
2025-12-05 19:10:37 +00:00
033b430051 Merge pull request 'ajout de ci-cd' (#2) from features/crud_entites into develop
Some checks failed
CD - Deploy on main / deploy (pull_request) Failing after 39s
Reviewed-on: #2
2025-12-05 19:06:43 +00:00
b8dbc7f625 Merge pull request 'ajout de ci-cd' (#1) from features/crud_entites into develop
Reviewed-on: #1
2025-12-05 17:53:30 +00:00
12 changed files with 70 additions and 910 deletions

View File

@@ -120,7 +120,7 @@ public class DonneesImpositionTfuController {
public ResponseEntity<?> getAllDonneesImpositionTfuList() { public ResponseEntity<?> getAllDonneesImpositionTfuList() {
try { try {
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(), "Liste des impositions chargée avec succès."), new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -144,7 +144,7 @@ public class DonneesImpositionTfuController {
try { try {
Pageable pageable = PageRequest.of(pageNo, pageSize); Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(pageable), "Liste des impositions chargée avec succès."), new ApiResponse<>(true, donneesImpositionTfuService.getDonneesImpositionTfuList(pageable), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -169,7 +169,7 @@ public class DonneesImpositionTfuController {
try { try {
Pageable pageable = PageRequest.of(pageNo, pageSize); Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdPageable(impositionId, pageable), "Liste des impositions chargée avec succès."), new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdPageable(impositionId, pageable), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -193,7 +193,7 @@ public class DonneesImpositionTfuController {
try { try {
Pageable pageable = PageRequest.of(pageNo, pageSize); Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdNonBatiePageable(impositionId, pageable), "Liste des impositions chargée avec succès."), new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdNonBatiePageable(impositionId, pageable), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -218,7 +218,7 @@ public class DonneesImpositionTfuController {
try { try {
Pageable pageable = PageRequest.of(pageNo, pageSize); Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieBatimentPageable(impositionId, pageable), "Liste des impositions chargée avec succès."), new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieBatimentPageable(impositionId, pageable), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -242,7 +242,7 @@ public class DonneesImpositionTfuController {
try { try {
Pageable pageable = PageRequest.of(pageNo, pageSize); Pageable pageable = PageRequest.of(pageNo, pageSize);
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(impositionId, pageable), "Liste des impositions chargée avec succès."), new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(impositionId, pageable), "Liste des caractéristiques chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {
@@ -442,56 +442,7 @@ public class DonneesImpositionTfuController {
Pageable pageable = PageRequest.of(pageNo, pageSize); Pageable pageable = PageRequest.of(pageNo, pageSize);
System.out.println("NOUS SOMMES ICI"); System.out.println("NOUS SOMMES ICI");
return new ResponseEntity<>( return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByExerciceAndStructureIdPageable(exerciceId,structureId, pageable), "Liste des impositions chargée avec succès."), new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByExerciceAndStructureIdPageable(exerciceId,structureId, pageable), "Liste des caractéristiques 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/by-exercice-id/by-structure-id/by-quartier-id/{exerciceId}/{structureId}/{quartierId}")
public ResponseEntity<?> getAllDonneesImpositionTfuByExerciceIdAndStructureId(@PathVariable Long exerciceId, @PathVariable Long structureId, @PathVariable Long quartierId) {
try {
System.out.println("NOUS SOMMES ICI");
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByExerciceAndStructureId(exerciceId,structureId,quartierId), "Liste des imposition 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/by-personne-id/{personneId}")
public ResponseEntity<?> getAllDonneesImpositionTfuByPersonneId(@PathVariable Long personneId) {
try {
return new ResponseEntity<>(
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByPersonneId(personneId), "Liste des impositions chargée avec succès."),
HttpStatus.OK HttpStatus.OK
); );
} catch (HttpClientErrorException.MethodNotAllowed e) { } catch (HttpClientErrorException.MethodNotAllowed e) {

View File

@@ -8,7 +8,6 @@ import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.infocad.metier.Enquete; import io.gmss.fiscad.entities.infocad.metier.Enquete;
import io.gmss.fiscad.entities.infocad.metier.Parcelle; import io.gmss.fiscad.entities.infocad.metier.Parcelle;
import io.gmss.fiscad.entities.infocad.metier.Tpe; import io.gmss.fiscad.entities.infocad.metier.Tpe;
import io.gmss.fiscad.entities.infocad.parametre.Personne;
import io.gmss.fiscad.entities.infocad.parametre.Structure; import io.gmss.fiscad.entities.infocad.parametre.Structure;
import io.gmss.fiscad.entities.rfu.parametre.ZoneRfu; import io.gmss.fiscad.entities.rfu.parametre.ZoneRfu;
import io.gmss.fiscad.enums.NatureImpot; import io.gmss.fiscad.enums.NatureImpot;
@@ -98,12 +97,10 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable {
@JsonDeserialize(using = LocalDateDeserializer.class) @JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate dateEnquete; private LocalDate dateEnquete;
private Long enqueteId; private Long enqueteId;
@JsonIgnore @JsonIgnore
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "structure_id") @JoinColumn(name = "structure_id")
private Structure structure ; private Structure structure ;
private Long secteurId; private Long secteurId;
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "zone_rfu_id") @JoinColumn(name = "zone_rfu_id")
@@ -140,11 +137,4 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable {
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "unite_logement_id") @JoinColumn(name = "unite_logement_id")
private UniteLogement uniteLogementImposee ; private UniteLogement uniteLogementImposee ;
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY)
private Personne personne ;
} }

View File

@@ -117,13 +117,13 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
Integer nbulo= donneesImpositionTfuRepository.genererDonneesTfuBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId); Integer nbulo= donneesImpositionTfuRepository.genererDonneesTfuBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId);
// Integer nbirfbt= donneesImpositionTfuRepository.genererDonneesIrfBatie(impositionsTfuPaylaodWeb.getId(),userId); Integer nbirfbt= donneesImpositionTfuRepository.genererDonneesIrfBatie(impositionsTfuPaylaodWeb.getId(),userId);
//
// Integer nbirfulo= donneesImpositionTfuRepository.genererDonneesIrfBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId); Integer nbirfulo= donneesImpositionTfuRepository.genererDonneesIrfBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId);
//
// Integer nbsrtbbt= donneesImpositionTfuRepository.genererDonneesSrtbBatie(impositionsTfuPaylaodWeb.getId(),userId); Integer nbsrtbbt= donneesImpositionTfuRepository.genererDonneesSrtbBatie(impositionsTfuPaylaodWeb.getId(),userId);
//
// Integer nbsrtbulo= donneesImpositionTfuRepository.genererDonneesSrtbBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId); Integer nbsrtbulo= donneesImpositionTfuRepository.genererDonneesSrtbBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId);
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb); ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
@@ -197,14 +197,4 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureIdPageable(Long exerciceId, Long structureId, Pageable pageable) { public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureIdPageable(Long exerciceId, Long structureId, Pageable pageable) {
return donneesImpositionTfuRepository.findAllByExericeIdStructureIdPageable(exerciceId,structureId,pageable); return donneesImpositionTfuRepository.findAllByExericeIdStructureIdPageable(exerciceId,structureId,pageable);
} }
@Override
public List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureId(Long exerciceId, Long structureId,Long quartierId) {
return donneesImpositionTfuRepository.findAllByExericeIdStructureId(exerciceId,structureId,quartierId);
}
@Override
public List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByPersonneId(Long personneId) {
return donneesImpositionTfuRepository.findAllByPersonneId(personneId);
}
} }

View File

@@ -43,9 +43,5 @@ public interface DonneesImpositionTfuService {
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionSrtbIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable); Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionSrtbIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable);
Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureIdPageable(Long exerciceId, Long structureId, Pageable pageable); Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureIdPageable(Long exerciceId, Long structureId, Pageable pageable);
List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByExerciceAndStructureId(Long exerciceId, Long structureId,Long quartierId);
List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByPersonneId(Long personneId);
} }

View File

@@ -283,3 +283,13 @@ WHERE impositions_tfu_id = p_impositions_tfu_id
RETURN v_rows_inserted; RETURN v_rows_inserted;
END; END;
$$; $$;
delete from donnees_imposition_tfu;
select donnees_imposition_tfu.superficie_au_sol_loue,valeur_locative_adm,taux_tfu,montant_taxe, * from donnees_imposition_tfu
where nature_impot='IRF';
select generer_donnees_imposition_irf_batie(4,35);

View File

@@ -234,14 +234,7 @@ FROM parcelle p
JOIN arrondissement a ON a.id = q.arrondissement_id JOIN arrondissement a ON a.id = q.arrondissement_id
JOIN commune c ON c.id = a.commune_id JOIN commune c ON c.id = a.commune_id
JOIN departement d ON d.id = c.departement_id JOIN departement d ON d.id = c.departement_id
--JOIN secteur_decoupage sd ON sd.quartier_id = q.id JOIN secteur_decoupage sd ON sd.quartier_id = q.id
JOIN (
SELECT DISTINCT ON (quartier_id)
quartier_id,
secteur_id
FROM secteur_decoupage
ORDER BY quartier_id
) sd ON sd.quartier_id = q.id
JOIN secteur sect ON sect.id = sd.secteur_id JOIN secteur sect ON sect.id = sd.secteur_id
JOIN section ses ON ses.id = sect.section_id JOIN section ses ON ses.id = sect.section_id
JOIN "structure" st ON st.id = ses.structure_id JOIN "structure" st ON st.id = ses.structure_id
@@ -339,3 +332,11 @@ WHERE impositions_tfu_id = p_impositions_tfu_id
RETURN v_rows_inserted; RETURN v_rows_inserted;
END; END;
$$; $$;
delete from donnees_imposition_tfu;
select generer_donnees_imposition_irf_batie_unite_logement(4,35);
select donnees_imposition_tfu.superficie_au_sol_loue,valeur_locative_adm,taux_tfu,montant_taxe, * from donnees_imposition_tfu
where nature_impot='IRF';

View File

@@ -202,14 +202,7 @@ FROM parcelle p
JOIN arrondissement a ON a.id = q.arrondissement_id JOIN arrondissement a ON a.id = q.arrondissement_id
JOIN commune c ON c.id = a.commune_id JOIN commune c ON c.id = a.commune_id
JOIN departement d ON d.id = c.departement_id JOIN departement d ON d.id = c.departement_id
--JOIN secteur_decoupage sd ON sd.quartier_id = q.id JOIN secteur_decoupage sd ON sd.quartier_id = q.id
JOIN (
SELECT DISTINCT ON (quartier_id)
quartier_id,
secteur_id
FROM secteur_decoupage
ORDER BY quartier_id
) sd ON sd.quartier_id = q.id
JOIN secteur sect ON sect.id = sd.secteur_id JOIN secteur sect ON sect.id = sd.secteur_id
JOIN section ses ON ses.id = sect.section_id JOIN section ses ON ses.id = sect.section_id
JOIN "structure" st ON st.id = ses.structure_id JOIN "structure" st ON st.id = ses.structure_id
@@ -262,3 +255,11 @@ END;
$$; $$;
--delete from donnees_imposition_tfu;
select donnees_imposition_tfu.superficie_au_sol_loue,valeur_locative_adm,taux_tfu,montant_taxe, * from donnees_imposition_tfu
where nature_impot='SRTB';
select generer_donnees_imposition_srtb_batie(4,35);

View File

@@ -215,14 +215,7 @@ FROM parcelle p
JOIN arrondissement a ON a.id = q.arrondissement_id JOIN arrondissement a ON a.id = q.arrondissement_id
JOIN commune c ON c.id = a.commune_id JOIN commune c ON c.id = a.commune_id
JOIN departement d ON d.id = c.departement_id JOIN departement d ON d.id = c.departement_id
--JOIN secteur_decoupage sd ON sd.quartier_id = q.id JOIN secteur_decoupage sd ON sd.quartier_id = q.id
JOIN (
SELECT DISTINCT ON (quartier_id)
quartier_id,
secteur_id
FROM secteur_decoupage
ORDER BY quartier_id
) sd ON sd.quartier_id = q.id
JOIN secteur sect ON sect.id = sd.secteur_id JOIN secteur sect ON sect.id = sd.secteur_id
JOIN section ses ON ses.id = sect.section_id JOIN section ses ON ses.id = sect.section_id
JOIN "structure" st ON st.id = ses.structure_id JOIN "structure" st ON st.id = ses.structure_id
@@ -309,3 +302,10 @@ RETURN v_rows_inserted;
END; END;
$$; $$;
delete from donnees_imposition_tfu;
select generer_donnees_imposition_srtb_batie_unite_logement(4,35);
select donnees_imposition_tfu.superficie_au_sol_loue,valeur_locative_adm,taux_tfu,montant_taxe, * from donnees_imposition_tfu
where nature_impot='SRTB';

View File

@@ -1,4 +1,4 @@
/*CREATE OR REPLACE FUNCTION public.generer_donnees_imposition_tfu_batie( CREATE OR REPLACE FUNCTION public.generer_donnees_imposition_tfu_batie(
p_impositions_tfu_id BIGINT, p_impositions_tfu_id BIGINT,
p_user_id BIGINT p_user_id BIGINT
) )
@@ -160,19 +160,19 @@ SELECT
'TFU', 'TFU',
p.superficie, p.superficie,
eb.superficie_au_sol, eb.superficie_au_sol,
COALESCE( case -------valeur_batiment
NULLIF(eb.valeur_batiment_reel, 0), WHEN eb.valeur_batiment_reel IS NOT NULL AND eb.valeur_batiment_reel <> 0 THEN eb.valeur_batiment_reel
NULLIF(eb.valeur_batiment_calcule, 0), WHEN eb.valeur_batiment_calcule IS NOT NULL AND eb.valeur_batiment_calcule <> 0 THEN eb.valeur_batiment_calcule
NULLIF(eb.valeur_batiment_estime, 0), WHEN eb.valeur_batiment_estime IS NOT NULL AND eb.valeur_batiment_estime <> 0 THEN eb.valeur_batiment_estime
0 ELSE 0
), END,
brb.valeur_locative, brb.valeur_locative,
COALESCE( case ----- montant_loyer_annuel
NULLIF(eb.montant_locatif_annuel_declare, 0), WHEN eb.montant_locatif_annuel_declare IS NOT NULL AND eb.montant_locatif_annuel_declare <> 0 THEN eb.montant_locatif_annuel_declare
NULLIF(eb.montant_locatif_annuel_calcule, 0), WHEN eb.montant_locatif_annuel_calcule IS NOT NULL AND eb.montant_locatif_annuel_calcule <> 0 THEN eb.montant_locatif_annuel_calcule
NULLIF(eb.montant_locatif_annuel_estime, 0), WHEN eb.montant_locatif_annuel_estime IS NOT NULL AND eb.montant_locatif_annuel_estime <> 0 THEN eb.montant_locatif_annuel_estime
0 ELSE 0
), END,
brb.tfu_metre_carre, brb.tfu_metre_carre,
brb.tfu_minimum, brb.tfu_minimum,
p_impositions_tfu_id, p_impositions_tfu_id,
@@ -198,7 +198,7 @@ SELECT
end, end,
0, ------ valeur_locative_adm : en attente de update 0, ------ valeur_locative_adm : en attente de update
case -----tfu_superficie_au_sol_reel case -----tfu_superficie_au_sol_reel
when eb.categorie_usage='HABITATION' then eb.superficie_au_sol * brb.valeur_locative * v_taux_tfu/100 +eb.nombre_piscine * v_tfu_piscine_unitaire when eb.categorie_usage='HABITATION' then eb.superficie_au_sol * brb.valeur_locative * v_taux_tfu/100
else 0 else 0
end, end,
eb.nombre_piscine * v_tfu_piscine_unitaire, eb.nombre_piscine * v_tfu_piscine_unitaire,
@@ -231,14 +231,7 @@ FROM parcelle p
JOIN arrondissement a ON a.id = q.arrondissement_id JOIN arrondissement a ON a.id = q.arrondissement_id
JOIN commune c ON c.id = a.commune_id JOIN commune c ON c.id = a.commune_id
JOIN departement d ON d.id = c.departement_id JOIN departement d ON d.id = c.departement_id
--JOIN secteur_decoupage sd ON sd.quartier_id = q.id JOIN secteur_decoupage sd ON sd.quartier_id = q.id
JOIN (
SELECT DISTINCT ON (quartier_id)
quartier_id,
secteur_id
FROM secteur_decoupage
ORDER BY quartier_id
) sd ON sd.quartier_id = q.id
JOIN secteur sect ON sect.id = sd.secteur_id JOIN secteur sect ON sect.id = sd.secteur_id
JOIN section ses ON ses.id = sect.section_id JOIN section ses ON ses.id = sect.section_id
JOIN "structure" st ON st.id = ses.structure_id JOIN "structure" st ON st.id = ses.structure_id
@@ -342,415 +335,4 @@ WHERE impositions_tfu_id = p_impositions_tfu_id
); );
RETURN v_rows_inserted; RETURN v_rows_inserted;
END; END;
$$;*/ $$;
CREATE OR REPLACE FUNCTION public.generer_donnees_imposition_tfu_batie(
p_impositions_tfu_id BIGINT,
p_user_id BIGINT
)
RETURNS INTEGER
LANGUAGE plpgsql
AS $$
DECLARE
v_rows_inserted INTEGER;
v_annee BIGINT;
v_structure_id BIGINT;
v_taux_defaut_sup_sol NUMERIC;
v_taux_tfu NUMERIC;
v_taux_tfu_ratio NUMERIC; -- v_taux_tfu / 100 (pré-calculé)
v_taux_valeur_locat_prof NUMERIC;
v_taux_vlp_ratio NUMERIC; -- v_taux_valeur_locat_prof / 100 (pré-calculé)
v_tfu_piscine_unitaire NUMERIC;
v_today DATE;
BEGIN
v_today := CURRENT_DATE;
-- -------------------------------------------------------------------------
-- 1. Récupération de l'année et de la structure (inchangée)
-- -------------------------------------------------------------------------
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;
-- -------------------------------------------------------------------------
-- 2. Récupération des 4 paramètres en UNE seule requête
-- (évite 4 accès séquentiels à la table parameters)
-- -------------------------------------------------------------------------
SELECT
MAX(value) FILTER (WHERE name = 'TAUX_DEFAUT_SUPERFICIE_AU_SOL'),
MAX(value) FILTER (WHERE name = 'TAUX_TFU'),
MAX(value) FILTER (WHERE name = 'TAUX_VALEUR_LOCATIVE_PROFESSIONNELLE'),
MAX(value) FILTER (WHERE name = 'TFU_PAR_PISCINE')
INTO STRICT
v_taux_defaut_sup_sol,
v_taux_tfu,
v_taux_valeur_locat_prof,
v_tfu_piscine_unitaire
FROM parameters
WHERE name IN (
'TAUX_DEFAUT_SUPERFICIE_AU_SOL',
'TAUX_TFU',
'TAUX_VALEUR_LOCATIVE_PROFESSIONNELLE',
'TFU_PAR_PISCINE'
);
-- Ratios pré-calculés pour éviter la division répétée dans le SELECT
v_taux_tfu_ratio := v_taux_tfu / 100.0;
v_taux_vlp_ratio := v_taux_valeur_locat_prof / 100.0;
-- -------------------------------------------------------------------------
-- 3. INSERT avec calcul complet de valeur_locative_adm et montant_taxe
-- → supprime l'UPDATE post-INSERT (économie d'un second scan de table)
-- -------------------------------------------------------------------------
INSERT INTO donnees_imposition_tfu (
annee,
code_departement,
nom_departement,
code_commune,
nom_commune,
code_arrondissement,
nom_arrondissement,
code_quartier_village,
nom_quartier_village,
q,
ilot,
parcelle,
nup,
titre_foncier,
num_batiment,
ifu,
npi,
tel_prop,
email_prop,
nom_prop,
prenom_prop,
raison_sociale,
adresse_prop,
tel_sc,
nom_sc,
prenom_sc,
longitude,
latitude,
batie,
exonere,
batiment_exonere,
standing_bat,
categorie_bat,
nombre_piscine,
date_enquete,
structure_id,
zone_rfu_id,
nature_impot,
superficie_parc,
superficie_au_sol_bat,
valeur_batiment,
valeur_locative_adm_metre_carre,
montant_loyer_annuel,
tfu_metre_carre,
tfu_minimum,
impositions_tfu_id,
deleted,
created_at,
created_by,
"source",
updated_at,
updated_by,
categorie_usage,
superficie_au_sol_taux_prop_parc, -- 70 % superficie parcelle
valeur_locative_adm_taux_prop_parc,
tfu_calcule_taux_prop_parc, -- TFU à 70 %
valeur_locative_adm_sup_reel,
valeur_locative_adm, -- valeur locative administrative finale
tfu_superficie_au_sol_reel,
tfu_piscine,
montant_taxe, -- TFU finale
taux_tfu,
parcelle_id,
batiment_id,
unite_logement_id,
personne_id
)
SELECT
v_annee,
d.code,
d.nom,
c.code,
c.nom,
a.code,
a.nom,
q.code,
q.nom,
p.q,
p.i,
p.p,
p.nup,
ep.numero_titre_foncier,
b.nub,
pers.ifu,
pers.npi,
pers.tel1,
pers.email,
pers.nom,
pers.prenom,
pers.raison_sociale,
pers.adresse,
ep.representant_tel,
ep.representant_nom,
ep.representant_prenom,
p.longitude,
p.latitude,
TRUE,
-- exonere parcelle
(v_today BETWEEN ep.date_debut_exemption
AND COALESCE(ep.date_fin_exemption, v_today)),
-- exonere batiment
(v_today BETWEEN eb.date_debut_excemption
AND COALESCE(eb.date_fin_excemption, v_today)),
cb.standing,
cb.nom,
eb.nombre_piscine,
eb.date_enquete,
st.id,
ep.zone_rfu_id,
'TFU',
p.superficie,
eb.superficie_au_sol,
-- valeur_batiment : première valeur non nulle non zéro
COALESCE(
NULLIF(eb.valeur_batiment_reel, 0),
NULLIF(eb.valeur_batiment_calcule, 0),
NULLIF(eb.valeur_batiment_estime, 0),
0
),
brb.valeur_locative,
-- montant_loyer_annuel
COALESCE(
NULLIF(eb.montant_locatif_annuel_declare, 0),
NULLIF(eb.montant_locatif_annuel_calcule, 0),
NULLIF(eb.montant_locatif_annuel_estime, 0),
0
),
brb.tfu_metre_carre,
brb.tfu_minimum,
p_impositions_tfu_id,
FALSE,
v_today,
p_user_id,
'FISCAD',
v_today,
p_user_id,
eb.categorie_usage,
-- superficie_au_sol_taux_prop_parc (70 % parcelle)
p.superficie * v_taux_defaut_sup_sol / 100.0,
-- valeur_locative_adm_taux_prop_parc
CASE WHEN eb.categorie_usage = 'HABITATION'
THEN (p.superficie * v_taux_defaut_sup_sol / 100.0) * brb.valeur_locative
ELSE 0
END,
-- tfu_calcule_taux_prop_parc
CASE WHEN eb.categorie_usage = 'HABITATION'
THEN (p.superficie * v_taux_defaut_sup_sol / 100.0) * brb.valeur_locative * v_taux_tfu_ratio
ELSE 0
END,
-- valeur_locative_adm_sup_reel
CASE WHEN eb.categorie_usage = 'HABITATION'
THEN eb.superficie_au_sol * brb.valeur_locative
ELSE 0
END,
-- ---------------------------------------------------------------
-- 🔧 CORRECTION : valeur_locative_adm avec tests explicites
-- ---------------------------------------------------------------
CASE
WHEN eb.categorie_usage = 'HABITATION'
AND eb.superficie_au_sol <> 0
THEN eb.superficie_au_sol * brb.valeur_locative
WHEN eb.categorie_usage = 'HABITATION'
AND eb.superficie_au_sol = 0
THEN (p.superficie * v_taux_defaut_sup_sol / 100.0) * brb.valeur_locative
-- ✅ Test explicite : valeur_batiment <> 0
WHEN eb.categorie_usage IN ('PROFESSIONNELLE', 'MIXTE')
AND COALESCE(NULLIF(eb.valeur_batiment_reel, 0),
NULLIF(eb.valeur_batiment_calcule, 0),
NULLIF(eb.valeur_batiment_estime, 0), 0) <> 0
THEN COALESCE(NULLIF(eb.valeur_batiment_reel, 0),
NULLIF(eb.valeur_batiment_calcule, 0),
NULLIF(eb.valeur_batiment_estime, 0), 0)
* v_taux_vlp_ratio
-- ✅ Test explicite : valeur_batiment = 0
WHEN eb.categorie_usage IN ('PROFESSIONNELLE', 'MIXTE')
AND COALESCE(NULLIF(eb.valeur_batiment_reel, 0),
NULLIF(eb.valeur_batiment_calcule, 0),
NULLIF(eb.valeur_batiment_estime, 0), 0) = 0
THEN COALESCE(NULLIF(eb.montant_locatif_annuel_declare, 0),
NULLIF(eb.montant_locatif_annuel_calcule, 0),
NULLIF(eb.montant_locatif_annuel_estime, 0), 0)
ELSE 0
END,
-- tfu_superficie_au_sol_reel
CASE WHEN eb.categorie_usage = 'HABITATION'
THEN eb.superficie_au_sol * brb.valeur_locative * v_taux_tfu_ratio
ELSE 0
END,
-- tfu_piscine
eb.nombre_piscine * v_tfu_piscine_unitaire,
-- ---------------------------------------------------------------
-- montant_taxe ← calculé directement (plus d'UPDATE)
-- Utilise des CTE inline via expression pour éviter la redondance
-- ---------------------------------------------------------------
(
-- On matérialise valeur_batiment et valeur_locative une seule fois
WITH calc AS (
SELECT
COALESCE(NULLIF(eb.valeur_batiment_reel, 0),
NULLIF(eb.valeur_batiment_calcule, 0),
NULLIF(eb.valeur_batiment_estime, 0), 0) AS vb,
COALESCE(NULLIF(eb.montant_locatif_annuel_declare, 0),
NULLIF(eb.montant_locatif_annuel_calcule, 0),
NULLIF(eb.montant_locatif_annuel_estime, 0), 0) AS loyer,
eb.superficie_au_sol * brb.valeur_locative AS vla_reel,
(p.superficie * v_taux_defaut_sup_sol / 100.0)
* brb.valeur_locative AS vla_70
)
SELECT
CASE
WHEN eb.categorie_usage = 'HABITATION'
AND eb.superficie_au_sol <> 0
THEN GREATEST(brb.tfu_minimum,
calc.vla_reel * v_taux_tfu_ratio
+ eb.nombre_piscine * v_tfu_piscine_unitaire)
WHEN eb.categorie_usage = 'HABITATION'
AND eb.superficie_au_sol = 0
THEN GREATEST(brb.tfu_minimum,
calc.vla_70 * v_taux_tfu_ratio
+ eb.nombre_piscine * v_tfu_piscine_unitaire)
WHEN eb.categorie_usage IN ('PROFESSIONNELLE', 'MIXTE')
AND calc.vb <> 0
THEN GREATEST(brb.tfu_minimum,
calc.vb * v_taux_vlp_ratio * v_taux_tfu_ratio)
WHEN eb.categorie_usage IN ('PROFESSIONNELLE', 'MIXTE')
AND calc.vb = 0
THEN GREATEST(brb.tfu_minimum,
calc.loyer * v_taux_tfu_ratio)
ELSE brb.tfu_minimum
END
FROM calc
),
v_taux_tfu,
p.id,
b.id,
NULL,
ep.personne_id
FROM parcelle p
-- Dernière enquête parcelle
LEFT JOIN LATERAL (
SELECT
parcelle_id,
superficie,
personne_id,
numero_titre_foncier,
date_enquete,
representant_tel,
representant_nom,
representant_prenom,
representant_npi,
date_debut_exemption,
date_fin_exemption,
zone_rfu_id
FROM enquete
WHERE parcelle_id = p.id
ORDER BY date_enquete DESC, id DESC
LIMIT 1
) ep ON TRUE
LEFT JOIN personne pers ON pers.id = ep.personne_id
JOIN quartier q ON q.id = p.quartier_id
JOIN arrondissement a ON a.id = q.arrondissement_id
JOIN commune c ON c.id = a.commune_id
JOIN departement d ON d.id = c.departement_id
-- Rattachement structure via secteur (DISTINCT ON → LATERAL plus lisible)
JOIN LATERAL (
SELECT secteur_id
FROM secteur_decoupage
WHERE quartier_id = q.id
ORDER BY quartier_id
LIMIT 1
) sd ON TRUE
JOIN secteur sect ON sect.id = sd.secteur_id
JOIN section ses ON ses.id = sect.section_id
JOIN "structure" st ON st.id = ses.structure_id
-- Bâtiments sans unités logement (anti-join via LEFT JOIN … IS NULL)
JOIN batiment b ON b.parcelle_id = p.id
LEFT JOIN unite_logement ul_filter ON ul_filter.batiment_id = b.id
-- Dernière enquête bâtiment
JOIN LATERAL (
SELECT
eb2.batiment_id,
eb2.superficie_au_sol,
eb2.nombre_piscine,
eb2.categorie_batiment_id,
eb2.date_enquete,
eb2.montant_locatif_annuel_declare,
eb2.montant_locatif_annuel_calcule,
eb2.montant_locatif_annuel_estime,
eb2.date_debut_excemption,
eb2.date_fin_excemption,
eb2.valeur_batiment_reel,
eb2.valeur_batiment_calcule,
eb2.valeur_batiment_estime,
u.categorie_usage
FROM enquete_batiment eb2
JOIN usage u ON u.id = eb2.usage_id
WHERE eb2.batiment_id = b.id
ORDER BY eb2.date_enquete DESC, eb2.id DESC
LIMIT 1
) eb ON TRUE
JOIN categorie_batiment cb ON cb.id = eb.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
WHERE p.batie = TRUE
AND ul_filter.batiment_id IS NULL -- anti-join : pas d'unité logement
AND st.id = v_structure_id
ON CONFLICT DO NOTHING;
GET DIAGNOSTICS v_rows_inserted = ROW_COUNT;
RETURN v_rows_inserted;
END;
$$;

View File

@@ -246,14 +246,7 @@ FROM parcelle p
JOIN arrondissement a ON a.id = q.arrondissement_id JOIN arrondissement a ON a.id = q.arrondissement_id
JOIN commune c ON c.id = a.commune_id JOIN commune c ON c.id = a.commune_id
JOIN departement d ON d.id = c.departement_id JOIN departement d ON d.id = c.departement_id
--JOIN secteur_decoupage sd ON sd.quartier_id = q.id JOIN secteur_decoupage sd ON sd.quartier_id = q.id
JOIN (
SELECT DISTINCT ON (quartier_id)
quartier_id,
secteur_id
FROM secteur_decoupage
ORDER BY quartier_id
) sd ON sd.quartier_id = q.id
JOIN secteur sect ON sect.id = sd.secteur_id JOIN secteur sect ON sect.id = sd.secteur_id
JOIN section ses ON ses.id = sect.section_id JOIN section ses ON ses.id = sect.section_id
JOIN "structure" st ON st.id = ses.structure_id JOIN "structure" st ON st.id = ses.structure_id

View File

@@ -1,4 +1,4 @@
/*CREATE OR REPLACE FUNCTION public.generer_donnees_imposition_tfu_non_batie( CREATE OR REPLACE FUNCTION public.generer_donnees_imposition_tfu_non_batie(
p_impositions_tfu_id BIGINT, p_impositions_tfu_id BIGINT,
p_user_id BIGINT p_user_id BIGINT
) )
@@ -159,189 +159,4 @@ GET DIAGNOSTICS v_rows_inserted = ROW_COUNT;
RETURN v_rows_inserted; RETURN v_rows_inserted;
END; END;
$$;*/ $$;
CREATE OR REPLACE FUNCTION public.generer_donnees_imposition_tfu_non_batie(
p_impositions_tfu_id BIGINT,
p_user_id BIGINT
)
RETURNS INTEGER
LANGUAGE plpgsql
AS
$$
DECLARE
v_rows_inserted INTEGER;
v_annee BIGINT;
v_structure_id BIGINT;
BEGIN
-- récupération de l'année
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;
INSERT INTO donnees_imposition_tfu(
annee,
code_departement,
nom_departement,
code_commune,
nom_commune,
code_arrondissement,
nom_arrondissement,
code_quartier_village,
nom_quartier_village,
q,
ilot,
parcelle,
nup,
titre_foncier,
ifu,
npi,
tel_prop,
email_prop,
nom_prop,
prenom_prop,
raison_sociale,
adresse_prop,
tel_sc,
nom_sc,
prenom_sc,
longitude,
latitude,
batie,
exonere,
date_enquete,
structure_id,
zone_rfu_id,
nature_impot,
superficie_parc,
impositions_tfu_id,
deleted,
created_at,
created_by,
"source",
updated_at,
updated_by,
taux_tfu,
valeur_admin_parcelle_nb,
valeur_admin_parcelle_nb_metre_carre,
montant_taxe,
parcelle_id,
personne_id
)
SELECT
v_annee,
d.code,
d.nom,
c.code,
c.nom,
a.code,
a.nom,
q.code,
q.nom,
p.q,
p.i,
p.p,
p.nup,
ep.numero_titre_foncier,
pers.ifu,
pers.npi,
pers.tel1,
pers.email,
pers.nom,
pers.prenom,
pers.raison_sociale,
pers.adresse,
ep.representant_tel,
ep.representant_nom,
ep.representant_prenom,
p.longitude,
p.latitude,
false,
(
CURRENT_DATE >= ep.date_debut_exemption
AND CURRENT_DATE <= COALESCE(ep.date_fin_exemption, CURRENT_DATE)
),
ep.date_enquete,
st.id,
ep.zone_rfu_id,
'TFU',
p.superficie,
p_impositions_tfu_id,
false,
current_date,
p_user_id,
'FISCAD',
current_date,
p_user_id,
brnb.taux,
CASE
WHEN brnb.au_metre_carre = true
THEN brnb.valeur_administrative_metre_carre * ep.superficie
ELSE brnb.valeur_administrative
END,
brnb.valeur_administrative_metre_carre,
CASE
WHEN brnb.au_metre_carre = true
THEN brnb.valeur_administrative_metre_carre * ep.superficie * brnb.taux / 100
ELSE brnb.valeur_administrative * brnb.taux / 100
END,
p.id,
ep.personne_id
FROM parcelle p
LEFT JOIN (
SELECT DISTINCT ON (parcelle_id)
parcelle_id,
superficie,
personne_id,
numero_titre_foncier,
date_enquete,
representant_tel,
representant_nom,
representant_prenom,
representant_npi,
date_debut_exemption,
date_fin_exemption,
zone_rfu_id
FROM enquete
ORDER BY parcelle_id, date_enquete DESC
) ep ON ep.parcelle_id = p.id
LEFT JOIN personne pers ON pers.id = ep.personne_id
JOIN quartier q ON q.id = p.quartier_id
JOIN arrondissement a ON a.id = q.arrondissement_id
JOIN commune c ON c.id = a.commune_id
JOIN departement d ON d.id = c.departement_id
-- ✅ CORRECTION ICI
JOIN (
SELECT DISTINCT ON (quartier_id)
quartier_id,
secteur_id
FROM secteur_decoupage
ORDER BY quartier_id
) sd ON sd.quartier_id = q.id
JOIN secteur sect ON sect.id = sd.secteur_id
JOIN section ses ON ses.id = sect.section_id
JOIN "structure" st ON st.id = ses.structure_id
LEFT JOIN barem_rfu_non_bati brnb
ON (brnb.commune_id = c.id AND brnb.zone_rfu_id = ep.zone_rfu_id)
WHERE p.batie = false
AND st.id = v_structure_id
ON CONFLICT DO NOTHING;
GET DIAGNOSTICS v_rows_inserted = ROW_COUNT;
RETURN v_rows_inserted;
END;
$$;

View File

@@ -555,7 +555,7 @@ SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
@Query(value = """ @Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb( SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
d.id, d.id,
d.annee, d.annee,
@@ -625,179 +625,10 @@ SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
WHERE itfu.exercice.id = :exerciceId WHERE itfu.exercice.id = :exerciceId
and s.id= :structureId and s.id= :structureId
order by d.nomProp,d.nomProp asc order by d.nomProp,d.nomProp asc
""",
countQuery = """
select count(*)
FROM DonneesImpositionTfu d
JOIN d.impositionsTfu itfu
LEFT join d.structure s
LEFT join d.zoneRfu z
WHERE itfu.exercice.id = :exerciceId
and s.id= :structureId
""") """)
Page<DonneesImpositionPaylaodWeb> findAllByExericeIdStructureIdPageable( Page<DonneesImpositionPaylaodWeb> findAllByExericeIdStructureIdPageable(
Long exerciceId, Long exerciceId,
Long structureId, Long structureId,
Pageable pageable Pageable pageable
); );
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
d.id,
d.annee,
d.codeDepartement,
d.nomDepartement,
d.codeCommune,
d.nomCommune,
d.codeArrondissement,
d.nomArrondissement,
d.codeQuartierVillage,
d.nomQuartierVillage,
d.q,
d.ilot,
d.parcelle,
d.nup,
d.titreFoncier,
d.numBatiment,
d.numUniteLogement,
d.ifu,
d.npi,
d.telProp,
d.emailProp,
d.nomProp,
d.prenomProp,
d.raisonSociale,
d.adresseProp,
d.telSc,
d.emailSc,
d.nomSc,
d.prenomSc,
d.adresseSc,
d.longitude,
d.latitude,
d.superficieParc,
d.superficieAuSolBat,
d.superficieAuSolUlog,
d.batie,
d.exonere,
d.batimentExonere,
d.uniteLogementExonere,
d.valeurLocativeAdm,
d.montantLoyerAnnuel,
d.tfuMetreCarre,
d.tfuMinimum,
d.standingBat,
d.categorieBat,
d.nombrePiscine,
d.nombreUlog,
d.nombreBat,
d.dateEnquete,
s.id,
z.id,
d.valeurAdminParcelleNb,
d.natureImpot,
s.code,
z.nom,
d.valeurBatiment,
d.valeurParcelle,
d.valeurLocativeAdmMetreCarre,
d.valeurAdminParcelleNbMetreCarre,
d.montantTaxe
)
FROM DonneesImpositionTfu d
JOIN d.impositionsTfu itfu
JOIN d.parcelleImposee parc
JOIN parc.quartier quart
LEFT join d.structure s
LEFT join d.zoneRfu z
WHERE itfu.exercice.id = :exerciceId
and s.id= :structureId
and quart.id= :quartierId
order by d.nomProp,d.nomProp asc
""")
List<DonneesImpositionPaylaodWeb> findAllByExericeIdStructureId(
Long exerciceId,
Long structureId,
Long quartierId
);
@Query("""
SELECT new io.gmss.fiscad.paylaods.request.crudweb.DonneesImpositionPaylaodWeb(
d.id,
d.annee,
d.codeDepartement,
d.nomDepartement,
d.codeCommune,
d.nomCommune,
d.codeArrondissement,
d.nomArrondissement,
d.codeQuartierVillage,
d.nomQuartierVillage,
d.q,
d.ilot,
d.parcelle,
d.nup,
d.titreFoncier,
d.numBatiment,
d.numUniteLogement,
d.ifu,
d.npi,
d.telProp,
d.emailProp,
d.nomProp,
d.prenomProp,
d.raisonSociale,
d.adresseProp,
d.telSc,
d.emailSc,
d.nomSc,
d.prenomSc,
d.adresseSc,
d.longitude,
d.latitude,
d.superficieParc,
d.superficieAuSolBat,
d.superficieAuSolUlog,
d.batie,
d.exonere,
d.batimentExonere,
d.uniteLogementExonere,
d.valeurLocativeAdm,
d.montantLoyerAnnuel,
d.tfuMetreCarre,
d.tfuMinimum,
d.standingBat,
d.categorieBat,
d.nombrePiscine,
d.nombreUlog,
d.nombreBat,
d.dateEnquete,
s.id,
z.id,
d.valeurAdminParcelleNb,
d.natureImpot,
s.code,
z.nom,
d.valeurBatiment,
d.valeurParcelle,
d.valeurLocativeAdmMetreCarre,
d.valeurAdminParcelleNbMetreCarre,
d.montantTaxe
)
FROM DonneesImpositionTfu d
JOIN d.impositionsTfu itfu
JOIN d.parcelleImposee parc
JOIN parc.quartier quart
LEFT join d.structure s
LEFT join d.zoneRfu z
WHERE d.personne.id = :personneId
order by d.nomProp,d.nomProp asc
""")
List<DonneesImpositionPaylaodWeb> findAllByPersonneId(
@Param("personneId") Long personneId
);
} }