Example #1
0
 public function nuevaCorreccionObservacion($inputs)
 {
     $Correspondencia = Correspondencia::find($inputs['IdCorrespondencia']);
     if ($Correspondencia->getIdCaracter() == 1) {
         DB::transaction(function () use($inputs) {
             $oficio = new OficioSaliente();
             $oficioU = Observaciones::find($inputs['IdObservaciones']);
             $oficioU->Oficio_Saliente_Id = $inputs['IdConsecutivo'];
             $oficioU->Observacion_Usuario_Id = $oficio->getIdRevisor($inputs['IdConsecutivo'], 1);
             //Usuario que va a corregir
             $oficioU->DescripcionObservaciones = $inputs['Observacion'];
             $oficioU->save();
         });
     } else {
         DB::transaction(function () use($inputs) {
             $oficio = new OficioSaliente();
             $oficioU = Observaciones::find($inputs['IdObservaciones']);
             $oficioU->Oficio_Saliente_Id = $inputs['IdConsecutivo'];
             $oficioU->Observacion_Usuario_Id = $oficio->getIdRevisor($inputs['IdConsecutivo'], $Correspondencia->getIdCaracter());
             //Usuario que va a corregir
             $oficioU->DescripcionObservaciones = $inputs['Observacion'];
             $oficioU->save();
         });
     }
     /*DB::transaction(function () use ($inputs, $path){
     			$oficioU = Correspondencia::find($inputs['IdCorrespondencia']);
     			$oficioU->URLPDF = $path;
     			$oficioU->save();
     		});*/
     DB::transaction(function () use($inputs) {
         $oficioU = Correspondencia::find($inputs['IdCorrespondencia']);
         $oficioU->Estatus_Id = 401;
         $oficioU->save();
     });
 }
Example #2
0
 public function updateEstatusFinalizado($IdOficio)
 {
     DB::transaction(function () use($inputs, $IdOficio) {
         $oficioU = Correspondencia::find($IdOficio);
         $oficioU->Estatus_Id = 406;
         $oficioU->save();
     });
 }
Example #3
0
 public function setEstatusAprobado($IdCorrespondencia)
 {
     DB::transaction(function () use($IdCorrespondencia) {
         $oficioU = Correspondencia::find($IdCorrespondencia);
         $oficioU->Estatus_Id = 404;
         $oficioU->save();
     });
 }
Example #4
0
 public function direccion_index()
 {
     $correspondencia = Correspondencia::join('usuario_turna_correspondencia', 'IdCorrespondencia', '=', 'usuario_turna_correspondencia.Correspondencia_Id')->join('usuario', 'usuario_turna_correspondencia.UTC_TurnarA_Id', '=', 'usuario.IdUsuario')->join('oficio_entrante', 'correspondencia.IdCorrespondencia', '=', 'oficio_entrante.Correspondencia_Id')->leftJoin('oficio_saliente', 'correspondencia.IdCorrespondencia', '=', 'oficio_saliente.Correspondencia_Id')->leftJoin('memorandum', 'correspondencia.IdCorrespondencia', '=', 'memorandum.Correspondencia_Id')->join('tipo', 'usuario_turna_correspondencia.Tipo_Id', '=', 'tipo.IdTipo')->join('dependencia', 'oficio_entrante.DependenciaEmite', '=', 'dependencia.IdDependencia')->join('estatus', 'correspondencia.Estatus_Id', '=', 'estatus.IdEstatus')->orderBy('correspondencia.IdCorrespondencia', 'desc')->where('usuario_turna_correspondencia.UTC_TurnarA_Id', Auth::user()->IdUsuario)->get();
     return View::make('direccion.direccion_index', array('correspondencia' => $correspondencia));
 }
 public function verPDF()
 {
     $Correspondencia = Request::get('correspondencia');
     $OficioSaliente = Correspondencia::join('oficio_saliente', 'IdCorrespondencia', '=', 'oficio_saliente.Correspondencia_Id')->where('correspondencia.IdCorrespondencia', $Correspondencia)->first();
     $pathToFile = public_path() . '/' . $OficioSaliente->URLPDF;
     $name = 'OficioSaliente_' . $OficioSaliente->IdConsecutivo . '_' . $OficioSaliente->FechaEntrega . '.pdf';
     $headers = array('Content-Type' => 'application/pdf');
     //Cambio de estátus a Visto
     return Response::download($pathToFile, $name, $headers);
 }
 public function direccion_turnado()
 {
     $datos = Input::all();
     $UTC = new UsuarioTurnaCorrespondencia();
     $fecha = new DateTime();
     if ($IdUTC = $UTC->turnarA(Auth::User()->IdUsuario, $datos['IdCorrespondencia'], $datos['IdUsuario'], 1, $fecha)) {
         $correspondencia = Correspondencia::where('IdCorrespondencia', $datos['IdCorrespondencia'])->first();
         //Público
         if ($correspondencia->Caracter_Id == 3) {
             $nuevoEstado = $correspondencia->upDateEstatus($correspondencia->IdCorrespondencia, 102);
         }
         //Confidencial
         if ($correspondencia->Caracter_Id == 2) {
             $nuevoEstado = $correspondencia->upDateEstatus($correspondencia->IdCorrespondencia, 202);
         }
         Session::flash('msgalert', 'Oficio entrante turnado correctamente.');
         return Redirect::action('OficiosEntrantesController@direccion_verDetalles', array('correspondencia' => $datos['IdCorrespondencia']));
     } else {
         Session::flash('msgf', 'Error al turnar el oficio entrante.');
         return Redirect::action('OficiosEntrantesController@direccion_verDetalles', array('correspondencia' => $datos['IdCorrespondencia']));
     }
 }