Commit 2c3da753 authored by Florian Joriot's avatar Florian Joriot
Browse files

Correction des indicateurs renvoyant 0 lorsque contrat unique (prise en compte...

Correction des indicateurs renvoyant 0 lorsque contrat unique (prise en compte des structure de contrat null)
parent 919aae0f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ FROM
      c.type_contrat_id = 1 --a déjà un contrat de type 'CONTRAT'
      AND c.histo_destruction IS NULL
  ) 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
  LEFT JOIN contrat c ON c.intervenant_id = i.id AND (w.structure_id = c.structure_id OR w.structure_id is NULL) AND c.histo_destruction IS NULL
WHERE
  w.atteignable = 1
  AND w.etape_code = 'CONTRAT'
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ SELECT
  s.structure_id
FROM
  tbl_service s
  JOIN tbl_workflow w ON w.intervenant_id = s.intervenant_id AND w.structure_id = s.structure_id
  JOIN tbl_workflow w ON w.intervenant_id = s.intervenant_id AND (w.structure_id = s.structure_id OR w.structure_id is NULL)
WHERE
  s.type_intervenant_code = 'V'
  AND s.type_volume_horaire_code = 'PREVU'
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ SELECT DISTINCT
  c.structure_id
FROM
  contrat                c
  JOIN tbl_workflow w ON w.intervenant_id = c.intervenant_id AND w.structure_id = c.structure_id AND w.etape_code = 'CONTRAT' AND w.atteignable = 1
  JOIN tbl_workflow w ON w.intervenant_id = c.intervenant_id AND (w.structure_id = c.structure_id OR w.structure_id is NULL) AND w.etape_code = 'CONTRAT' AND w.atteignable = 1
  JOIN validation v ON v.id = c.validation_id AND v.histo_destruction IS NULL
  LEFT JOIN contrat_fichier cf ON cf.contrat_id = c.id
  LEFT JOIN fichier f ON f.id = cf.fichier_id AND f.histo_destruction IS NULL
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ SELECT DISTINCT
  c.structure_id
FROM
  contrat                c
  JOIN tbl_workflow w ON w.intervenant_id = c.intervenant_id AND w.structure_id = c.structure_id AND w.etape_code = 'CONTRAT' AND w.atteignable = 1
  JOIN tbl_workflow w ON w.intervenant_id = c.intervenant_id AND (w.structure_id = c.structure_id OR w.structure_id is NULL) AND w.etape_code = 'CONTRAT' AND w.atteignable = 1
  JOIN validation v ON v.id = c.validation_id AND v.histo_destruction IS NULL
  LEFT JOIN contrat_fichier cf ON cf.contrat_id = c.id
  LEFT JOIN fichier f ON f.id = cf.fichier_id AND f.histo_destruction IS NULL
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ SELECT DISTINCT
  c.structure_id
FROM
  contrat                c
  JOIN tbl_workflow w ON w.intervenant_id = c.intervenant_id AND w.structure_id = c.structure_id AND w.etape_code = 'CONTRAT' AND w.atteignable = 1
  JOIN tbl_workflow w ON w.intervenant_id = c.intervenant_id AND (w.structure_id = c.structure_id OR w.structure_id is NULL) AND w.etape_code = 'CONTRAT' AND w.atteignable = 1
  JOIN validation v ON v.id = c.validation_id AND v.histo_destruction IS NULL
  JOIN contrat_fichier cf ON cf.contrat_id = c.id
  JOIN fichier f ON f.id = cf.fichier_id AND f.histo_destruction IS NULL