Example #1
0
 public function getVentas()
 {
     $fecha = Input::get('fecha');
     $detallescaja = Detallecaja::whereBetween('fechainicio', [$fecha . ' 00:00:00', $fecha . ' 23:59:59'])->with(['ventas', 'ventas.alquiler', 'ventas.alquiler.habitacion', 'ventas.productos', 'usuario'])->get();
     return Response::json($detallescaja);
     //return View::make('reportes.ventas', compact('detallescaja'));
 }
Example #2
0
 public function postIndex()
 {
     $caja_id = Input::get('caja_id');
     $caja = Caja::find($caja_id);
     $datos = ['usuario_id' => Auth::user()->id, 'montoinicial' => Input::get('montoinicial'), 'caja_id' => $caja->id, 'fechainicio' => date('Y-m-d H:i:s')];
     $detallecaja = Detallecaja::create($datos);
     $caja->estado = 0;
     $caja->save();
     return Redirect::to('/caja');
 }