public function update()
 {
     $input = Input::only(['id', 'nit', 'nombre', 'direccion', 'telefono', 'email', 'notas']);
     $validador = Validator::make($input, Tercero::rulesUpdate($input['id']));
     if ($validador->passes()) {
         $tercero = Tercero::find($input['id']);
         $tercero->nit = $input['nit'];
         $tercero->nombre = $input['nombre'];
         $tercero->direccion = $input['direccion'];
         $tercero->telefono = $input['telefono'];
         $tercero->email = $input['email'];
         $tercero->estado = 'ACTIVO';
         $tercero->notas = $input['notas'];
         $tercero->user_id = Auth::user()->id;
         $tercero->save();
         return Redirect::route('mostrar_tercero', ['id' => $tercero->id]);
     } else {
         return Redirect::back()->withInput()->withErrors($validador);
     }
 }
 /**
  * Show the form for creating a new resource.
  * GET /cuenta/create
  *
  * @return Response
  */
 public function create($id_tercero)
 {
     $tercero = Tercero::find($id_tercero);
     return View::make('cuentas.crear', compact('tercero'));
 }
 public function buscar($documento, $tercero_id)
 {
     $input = Input::all();
     $todos = $input['todos'] == 'false' ? false : true;
     $buscar = $input['buscar'];
     $tercero = Tercero::find($tercero_id);
     $saldos = $this->saldos_en_intervalos($documento, $tercero_id, $todos, $buscar);
     Session::flash('mensaje', 'Mostrando documentos físicos que contienen <strong>' . $buscar . '</strong>');
     return View::make('carteras.listado', compact('documento', 'tercero', 'saldos'));
 }