Esempio n. 1
0
 public function cuotasMasivas()
 {
     $time = new Carbon();
     $mes = Input::get('mes', $time->month);
     $año = Input::get('año', $time->year);
     if (Request::isMethod("POST")) {
         foreach (Input::get('residencia_id') as $key => $residencia_id) {
             $array = ["residencia_id" => $residencia_id] + Input::only('mes', 'año', 'concepto', 'monto');
             $cambios[] = Facturas::firstorCreate($array);
         }
         return Redirect::to(URL::previous());
     }
     $conceptosMasivos = Facturas::selectRaw("concepto, monto,concat(mes,'/',año) as periodo , count(*) as cuenta")->groupby("concepto")->having('cuenta', '>', 1)->whereNotNull("residencia_id")->get();
     return View::make('admin/cuotasMasivas')->withConceptosmasivos($conceptosMasivos)->withMes($mes)->withAño($año);
 }