예제 #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     //
     $caja = caja::with('usuarios', 'tiendas')->find($id);
     $saldo = caja::Totales($id);
     $movimientos = caja_detalle::with('pagos')->where('caja_id', $id)->orderBy('created_at')->get();
     return view('app.cajas.caja_show', compact('caja', 'movimientos', 'saldo'));
 }
예제 #2
0
파일: caja.php 프로젝트: vdjkelly/laravel
 public static function CerrarCaja($ingreso, $nota)
 {
     $caja = caja::CajaAbierta();
     if (isset($caja)) {
         $item = caja::find($caja->id);
         $item->estado = '0';
         $cierre = caja::Totales($caja->id);
         if ($cierre['Saldo'] != $ingreso) {
             $item->nota_cierre = $nota . ', ' . 'Cierre tiene descuadre';
             $item->descuadre = 1;
         } else {
             $item->nota = $nota;
             $item->descuadre = 0;
         }
         $item->cierre = $ingreso;
         $item->save();
     } else {
         Session::put('caja', 'caja ya esta abierta');
     }
 }