diff --git a/CHANGELOG.md b/CHANGELOG.md
index a6cf2c723528bbba31c8a1c4619193f26cb0acf3..42206898180200458d6fabd32a5fc8f94304da83 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -45,6 +45,13 @@ Une nouvelle documentation sur les connecteurs est disponible ici : [Import de d
* Attention : un bug est connu et en cours de résolution : il se produit lorsqu'en tant qu'intervenant vous saisissez vos données personnelles. Une page d'erreur s'affiche au moment ou vous sélectionnez votre statut. Une mise à jour de la page suffit pour pouvoir continuer la saisie du formulaire.
+# OSE 14.13
+
+## Corrections de bugs
+
+* Refactoring de l'indicateur 320 qui n'affichait plus uniquement les intervenants en attente de la création d'un contrat initial
+* Refactoring de l'indicateur 330 : affiche maintenant uniquement les intervenants en attente d'un avenant
+
# OSE 14.12
## Corrections de bugs
diff --git a/admin/src/DataGen.php b/admin/src/DataGen.php
index f9d9045b03ebc30f8f6458ab2c33a4bcd1cbaaa3..dc4e62d92a8de693d5585041842d9cbbbb1fdb05 100644
--- a/admin/src/DataGen.php
+++ b/admin/src/DataGen.php
@@ -177,7 +177,7 @@ class DataGen
'table' => 'DOSSIER_CHAMP_AUTRE',
'context' => ['install', 'update'],
'key' => 'ID',
- 'options' => ['update-ignore-cols' => ['LIBELLE', 'DOSSIER_CHAMP_AUTRE_TYPE_ID', 'CONTENU', 'DESCRIPTION']],
+ 'options' => ['update-ignore-cols' => ['LIBELLE', 'DOSSIER_CHAMP_AUTRE_TYPE_ID', 'CONTENU', 'DESCRIPTION', 'OBLIGATOIRE']],
],
diff --git a/data/ddl/view/V_INDICATEUR_320.sql b/data/ddl/view/V_INDICATEUR_320.sql
index 1c63987f661a4e09ba00aa33a81a5a7043681c69..70f7ca699b98e6f0424977fbea7f5977c3ef53bb 100644
--- a/data/ddl/view/V_INDICATEUR_320.sql
+++ b/data/ddl/view/V_INDICATEUR_320.sql
@@ -4,16 +4,22 @@ SELECT
t."ANNEE_ID",t."INTERVENANT_ID",t."STRUCTURE_ID"
FROM (
SELECT DISTINCT
- w.annee_id,
- w.intervenant_id,
- w.structure_id
+ w.annee_id,
+ w.intervenant_id,
+ w.structure_id
FROM
- tbl_workflow w
- LEFT JOIN tbl_contrat c ON c.INTERVENANT_ID = w.intervenant_id AND w.structure_id = c.structure_id
+ tbl_workflow w
+ JOIN intervenant i ON w.intervenant_id = i.id
+ JOIN statut_intervenant si ON si.id = i.statut_id
+ LEFT JOIN contrat c ON c.intervenant_id = w.intervenant_id
WHERE
- w.atteignable = 1
- AND w.etape_code = 'CONTRAT'
- AND w.objectif > 0
- AND w.realisation = 0
- AND NVL(c.EDITE,0) <> 1
+ w.atteignable = 1
+ AND w.etape_code = 'CONTRAT'
+ AND w.objectif > 0
+ AND w.realisation = 0
+ AND c.histo_destruction IS NULL
+ AND i.histo_destruction IS NULL
+ AND si.histo_destruction IS NULL
+ AND c.id IS NULL
+ AND si.peut_avoir_contrat = 1
) t
\ No newline at end of file
diff --git a/data/ddl/view/V_INDICATEUR_330.sql b/data/ddl/view/V_INDICATEUR_330.sql
index 53f1b6a30d74e02511c99e7221a7d1b7958cadf9..84c1c3d7169031d17edecebe31e915f6b2768959 100644
--- a/data/ddl/view/V_INDICATEUR_330.sql
+++ b/data/ddl/view/V_INDICATEUR_330.sql
@@ -1,11 +1,16 @@
CREATE OR REPLACE FORCE VIEW V_INDICATEUR_330 AS
WITH has_contrat AS (
SELECT DISTINCT
- intervenant_id
+ i.id intervenant_id,
+ i.annee_id annee_id,
+ c.structure_id structure_id
FROM
- tbl_contrat
+ intervenant i
+ JOIN contrat c ON c.intervenant_id = i.iD
WHERE
- edite > 0
+ c.type_contrat_id = 1 --a déjà un contrat de type 'CONTRAT'
+ AND c.histo_destruction IS NULL
+ AND i.histo_destruction IS NULL
)
SELECT
rownum id,
@@ -13,10 +18,13 @@ SELECT
w.intervenant_id,
w.structure_id
FROM
- tbl_workflow w
- JOIN has_contrat hc ON hc.intervenant_id = w.intervenant_id
+ intervenant i
+ JOIN tbl_workflow w ON w.intervenant_id = i.id
+ JOIN has_contrat hc ON hc.intervenant_id = i.id
+ LEFT JOIN contrat c ON c.intervenant_id = i.id AND c.structure_id = w.structure_id AND c.histo_destruction IS NULL
WHERE
w.atteignable = 1
AND w.etape_code = 'CONTRAT'
AND w.objectif > 0
- AND w.realisation < w.objectif
\ No newline at end of file
+ AND w.realisation < w.objectif
+ AND c.id IS NULL
\ No newline at end of file