/** * 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')); }
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'); } }