protected function process()
 {
     $this->ppage = $this->page->get('ventas_familias');
     /// comprobamos si el usuario tiene acceso a la página de importar familia
     $this->pag_importar = FALSE;
     if ($this->user->have_access_to('importar_familia', FALSE)) {
         $this->pag_importar = $this->page->get('importar_familia');
     }
     if (isset($_POST['cod'])) {
         $this->familia = new familia();
         $this->familia = $this->familia->get($_POST['cod']);
         $this->familia->descripcion = $_POST['descripcion'];
         if ($this->familia->save()) {
             $this->new_message("Datos modificados correctamente");
         } else {
             $this->new_error_msg("Imposible modificar los datos.");
         }
     } else {
         if (isset($_GET['cod'])) {
             $this->familia = new familia();
             $this->familia = $this->familia->get($_GET['cod']);
         }
     }
     if ($this->familia and isset($_POST['stats'])) {
         $this->template = 'ajax/ventas_familia_stats';
         $this->familia->stats();
     } else {
         if ($this->familia) {
             $this->page->title = $this->familia->codfamilia;
             $this->impuesto = new impuesto();
             $this->buttons[] = new fs_button('b_stats_familia', 'Estadísticas');
             $this->buttons[] = new fs_button('b_herramientas_familia', 'Herramientas');
             if ($this->pag_importar) {
                 $this->buttons[] = new fs_button('b_importar_familia', 'Importar');
             }
             $this->buttons[] = new fs_button('b_download_familia', 'Exportar', $this->url() . '&download=TRUE');
             $this->buttons[] = new fs_button_img('b_eliminar_familia', 'Eliminar', 'trash.png', '#', TRUE);
             if (isset($_POST['multiplicar'])) {
                 $art = new articulo();
                 $art->multiplicar_precios($this->familia->codfamilia, $_POST['multiplicar']);
             } else {
                 if (isset($_GET['download'])) {
                     $this->download();
                 }
             }
             if (isset($_GET['offset'])) {
                 $this->offset = intval($_GET['offset']);
             } else {
                 $this->offset = 0;
             }
             $this->articulos = $this->familia->get_articulos($this->offset);
         } else {
             $this->new_error_msg("Familia no encontrada.");
         }
     }
 }