 
 CREATE OR REPLACE FUNCTION pr_occtax.insert_in_synthese(my_id_counting integer)
     RETURNS integer[]
-    LANGUAGE 'plpgsql'
-    VOLATILE
-    PARALLEL UNSAFE
-    COST 100
 AS $BODY$  DECLARE
   new_count RECORD;
   occurrence RECORD;

      non_digital_proof = NEW.non_digital_proof,
      comment_description = NEW.comment,
      last_action = 'U',
	  --CHAMPS ADDITIONNELS OCCTAX
	  additional_data = NEW.additional_fields || pr_occtax.t_releves_occtax.additional_fields || pr_occtax.cor_counting_occtax.additional_fields
	FROM pr_occtax.t_releves_occtax
	INNER JOIN pr_occtax.cor_counting_occtax ON NEW.id_occurrence_occtax = pr_occtax.cor_counting_occtax.id_occurrence_occtax
    WHERE unique_id_sinp = pr_occtax.cor_counting_occtax.unique_id_sinp_occtax;
	
    RETURN NULL;

        id_nomenclature_geo_object_nature = NEW.id_nomenclature_geo_object_nature,
        last_action = 'U',
        comment_context = NEW.comment,
		additional_data = NEW.additional_fields || occurrence.additional_fields || counting.additional_fields
	FROM pr_occtax.t_occurrences_occtax occurrence 
	JOIN pr_occtax.cor_counting_occtax counting
		ON counting.id_occurrence_occtax = occurrence.id_occurrence_occtax
		AND NEW.id_releve_occtax = occurrence.id_releve_occtax
	WHERE unique_id_sinp IN (SELECT unnest(pr_occtax.get_unique_id_sinp_from_id_releve(NEW.id_releve_occtax::integer)));
