/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     //para ingresos
     $cuentas = Cuenta::orderBy('nombre_cuenta', 'ASC')->get();
     $pedidosporingresar = Pedidocompra::where('confirmado_ingreso', '<>', true)->where('nivel', '=', Session::get('nivel'))->get();
     $correcto;
     $num;
     $ingresosactuales = Ingreso::where('nivel', '=', Session::get('nivel'))->get();
     if (count($ingresosactuales) == 0) {
         $num = "1/" . date('m/Y');
     } else {
         $totalingresos = count($ingresosactuales);
         $utlimoingreso = Ingreso::where('id', '=', $ingresosactuales[$totalingresos - 1]->id)->first();
         //separandola el numero el mes y el año para realizar operacion
         $parafecha = explode("/", $utlimoingreso->numero);
         if ($parafecha[1] == date('m')) {
             $actual = $parafecha[0] + 1;
             $num = $actual . "/" . date('m/Y');
         } else {
             $num = "1/" . date('m/Y');
         }
     }
     //echo count($pedidosporingresar)
     if (count($pedidosporingresar) > 0) {
         $correcto = "true";
         return View::make('encargado.inventario', array('correcto' => $correcto, 'num' => $num))->with('cuentas', $cuentas)->with('pedidosporingresar', $pedidosporingresar);
     } else {
         $correcto = "false";
         return View::make('encargado.inventario', array('correcto' => $correcto, 'num' => $num))->with('cuentas', $cuentas);
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     $cuentas = Cuenta::orderBy('nombre_cuenta', 'asc')->get();
     //$ufv = Ufv::orderBy('cotizacion', 'desc')->get();
     $ufv = DB::table('ufvs')->orderBy('gestion', 'desc')->get();
     //echo $cuentas;
     return View::make('cardex.cardexuno')->with('cuentas', $cuentas)->with('ufv', $ufv);
 }