 						_computed_date_pair.mask_length := _bit_mask_lenght;
 					ELSE
 						IF _start_date < previous_bounds.start_date THEN
-							_start_bitmask_date := _start_date;	
+							_start_bitmask_date := _start_date;
 							_tmp_bitmask := (lpad('',previous_bounds.start_date - _start_bitmask_date,'0'))::bit varying;
 							_previous_bit_mask_trimed := _tmp_bitmask || previous_bounds.bit_mask;
-							_new_bit_mask_trimed := _bit_mask;	
+							_new_bit_mask_trimed := _bit_mask;
 						ELSE
 							_start_bitmask_date := previous_bounds.start_date;
 							_tmp_bitmask := (lpad('',_start_date - _start_bitmask_date,'0'))::bit varying;

								END IF;
								_interval_counter := _interval_counter + 1;
								_iterator := _iterator + 1;
								-- RAISE DEBUG 'tmp_text = %',_tmp_text;			
							END LOOP;
							_bit_mask_text := _tmp_text || _bit_mask_text;
						ELSE
							_bit_mask_text := lpad(_bit_mask_text,_cal_lenght + _end_diff,'1');
						END IF;		
						_bit_mask_text := lpad(_bit_mask_text, _mask_length,'0');				
					ELSE
						-- In this case we trunk cal mask before the end
						IF _cal_interval > 1 THEN

COMMENT ON FUNCTION cleanpoi() IS 'Fonction de suppression des données POI, appelée à chaque nouvel import provenant de la base SIG.';


CREATE OR REPLACE FUNCTION insertcalendar(_name character varying, _ccode character varying, _datasource integer, _calendar_type calendar_type default 'periode') RETURNS integer
    LANGUAGE plpgsql
    AS $$
    DECLARE
