예제 #1
0
 public function update($id)
 {
     $nominal = Input::get('nominal');
     $nominal = str_replace(",", ".", $nominal);
     $nominal = str_replace(".", "", $nominal);
     $nominal = substr($nominal, 0, -2);
     $deduction = Deduction::findOrFail($id);
     $deduction->employee_id = Input::get('employee_id');
     $deduction->classification_id = Input::get('classification_id');
     $deduction->release_date = Input::get('release_date');
     $deduction->nominal = $nominal;
     $deduction->comments = Input::get('comments');
     $deduction->save();
 }
예제 #2
0
 /**
  * Remove the specified branch from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $deduction = Deduction::findOrFail($id);
     Deduction::destroy($id);
     Audit::logaudit('Deductions', 'delete', 'deleted: ' . $deduction->deduction_name);
     return Redirect::route('deductions.index');
 }
예제 #3
0
 /**
  * Update the specified branch in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $deduction = Deduction::findOrFail($id);
     $validator = Validator::make($data = Input::all(), Deduction::$rules, Deduction::$messages);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $deduction->deduction_name = Input::get('name');
     $deduction->update();
     return Redirect::route('deductions.index');
 }