original_string: public function cerrarMesa ( $mesa_id, $imprimir_ticket = true) {
          
          $this->Mesa->id = $mesa_id;     
          
          if( !$this->Mesa->cerrar_mesa() ) {
              if( !$this->request->is('ajax') ){
                  $this->setFlash('Error al cerrar la mesa', 'flash_error');
              }
          }
          if( !$this->request->is('ajax') ){
              $this->redirect( $this->referer() );
          }         
      }
code: public function cerrarMesa ( $mesa_id, $imprimir_ticket = true) {
          
          $this->Mesa->id = $mesa_id;     
          
          if( !$this->Mesa->cerrar_mesa() ) {
              if( !$this->request->is('ajax') ){
                  $this->setFlash('Error al cerrar la mesa', 'flash_error');
              }
          }
          if( !$this->request->is('ajax') ){
              $this->redirect( $this->referer() );
          }         
      }
code_tokens: public function cerrarMesa ( $ mesa_id , $ imprimir_ticket = true ) { $ this -> Mesa -> id = $ mesa_id ; if ( ! $ this -> Mesa -> cerrar_mesa ( ) ) { if ( ! $ this -> request -> is ( 'ajax' ) ) { $ this -> setFlash ( 'Error al cerrar la mesa' , 'flash_error' ) ; } } if ( ! $ this -> request -> is ( 'ajax' ) ) { $ this -> redirect ( $ this -> referer ( ) ) ; } }
docstring: Cierra la mesa, calculando el total y, si se lo indica,
  imprime el ticket fiscal.
  @param type $mesa_id
  @param type $imprimir_ticket
  @return type
docstring_tokens: Cierra la mesa calculando el total y si se lo indica imprime el ticket fiscal .