Commit 8d94389d authored by Florian Joriot's avatar Florian Joriot
Browse files

Remontée de la composante d'affectation si celle du contrat est null dans l'indicateur des contrats

parent 4d9df5c3
Loading
Loading
Loading
Loading
Loading
+1 −1
Changes for data/ddl/view/V_INDICATEUR_461.sql: 1 added line, 1 removed line.
Original line number Diff line number Diff line
CREATE OR REPLACE FORCE VIEW V_INDICATEUR_461 AS
SELECT DISTINCT
  c.intervenant_id,
  c.structure_id
  COALESCE(c.structure_id, i.structure_id) structure_id
FROM
  contrat                c
  JOIN intervenant i ON c.intervenant_id = i.id
+2 −1
Changes for data/ddl/view/V_INDICATEUR_470.sql: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
CREATE OR REPLACE FORCE VIEW V_INDICATEUR_470 AS
SELECT DISTINCT
  c.intervenant_id,
  c.structure_id
  COALESCE(c.structure_id, i.structure_id) structure_id
FROM
  contrat                c
  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 intervenant i ON c.intervenant_id = i.id
  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
WHERE
+2 −1
Changes for data/ddl/view/V_INDICATEUR_471.sql: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
CREATE OR REPLACE FORCE VIEW V_INDICATEUR_471 AS
SELECT DISTINCT
  c.intervenant_id,
  c.structure_id
  COALESCE(c.structure_id, i.structure_id) structure_id
FROM
  contrat                c
  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 intervenant i ON c.intervenant_id = i.id
  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
WHERE
+2 −1
Changes for data/ddl/view/V_INDICATEUR_480.sql: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
CREATE OR REPLACE FORCE VIEW V_INDICATEUR_480 AS
SELECT DISTINCT
  c.intervenant_id,
  c.structure_id
  COALESCE(c.structure_id, i.structure_id) structure_id
FROM
  contrat                c
  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
  JOIN intervenant i ON c.intervenant_id = i.id
WHERE
  c.histo_destruction IS NULL
  AND c.date_retour_signe IS NULL
 No newline at end of file
+2 −1
Changes for data/ddl/view/V_INDICATEUR_481.sql: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
CREATE OR REPLACE FORCE VIEW V_INDICATEUR_481 AS
SELECT DISTINCT
  c.intervenant_id,
  c.structure_id
  COALESCE(c.structure_id, i.structure_id) structure_id
FROM
  contrat                c
  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 unicaen_signature_process usp ON usp.id = c.process_signature_id
  JOIN intervenant i ON c.intervenant_id = i.id
WHERE
  c.histo_destruction IS NULL
  --On vérifie que le statut est en waiting