コード例 #1
0
 /**
  * Store a newly created kin in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make($data = Input::all(), Nextofkin::$rules, Nextofkin::$messages);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $kin = new Nextofkin();
     $kin->employee_id = Input::get('employee_id');
     $kin->name = Input::get('name');
     $kin->relationship = Input::get('rship');
     $kin->goodwill = Input::get('goodwill');
     $kin->id_number = Input::get('id_number');
     $kin->save();
     Audit::logaudit('NextofKins', 'create', 'created: ' . $kin->name);
     return Redirect::route('NextOfKins.index')->withFlashMessage('Employee`s next of kin successfully created!');
 }
コード例 #2
0
ファイル: DocumentsController.php プロジェクト: kenkode/umash
 /**
  * Remove the specified branch from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $document = Document::findOrFail($id);
     Document::destroy($id);
     Audit::logaudit('Documents', 'delete', 'deleted: ' . $document->document_name);
     return Redirect::route('documents.index')->withDeleteMessage('Employee Document successfully deleted!');
 }
コード例 #3
0
 /**
  * Remove the specified branch from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $allowance = EAllowances::findOrFail($id);
     EAllowances::destroy($id);
     Audit::logaudit('Employee Allowances', 'delete', 'deleted: ' . $allowance->allowance_amount);
     return Redirect::route('employee_allowances.index');
 }
コード例 #4
0
 /**
  * Remove the specified branch from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $employee = Employee::findOrFail($id);
     Employee::destroy($id);
     Audit::logaudit('Employee', 'delete', 'deleted: ' . $employee->personal_file_number . '-' . $employee->first_name . ' ' . $employee->last_name);
     return Redirect::route('employees.index');
 }
コード例 #5
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');
 }
コード例 #6
0
 /**
  * Remove the specified kin from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $property = Property::findOrFail($id);
     Property::destroy($id);
     Audit::logaudit('Properties', 'delete', 'deleted: ' . $property->name);
     return Redirect::route('Properties.index')->withDeleteMessage('Company Property successfully deleted!');
 }
コード例 #7
0
 /**
  * Remove the specified account from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $account = Account::findOrFail($id);
     Account::destroy($id);
     Audit::logaudit('Accounts', 'delete', 'deleted:' . $account->name . ' ' . $account->code);
     return Redirect::route('accounts.index');
 }
コード例 #8
0
ファイル: PayrollController.php プロジェクト: kenkode/xpose
 /**
  * Store a newly created branch in storage.
  *
  * @return Response
  */
 public function store()
 {
     $employees = Employee::all();
     foreach ($employees as $employee) {
         $payroll = new Payroll();
         $payroll->employee_id = $employee->personal_file_number;
         $payroll->basic_pay = $employee->basic_pay;
         $payroll->earning_amount = Payroll::total_benefits($employee->id);
         $payroll->taxable_income = Payroll::gross($employee->id);
         $payroll->paye = Payroll::tax($employee->id);
         $payroll->nssf_amount = Payroll::nssf($employee->id);
         $payroll->nhif_amount = Payroll::nhif($employee->id);
         $payroll->other_deductions = Payroll::deductions($employee->id);
         $payroll->total_deductions = Payroll::total_deductions($employee->id);
         $payroll->net = Payroll::net($employee->id);
         $payroll->financial_month_year = Input::get('period');
         $payroll->account_id = Input::get('account');
         $payroll->save();
     }
     $allws = DB::table('employee_allowances')->join('allowances', 'employee_allowances.allowance_id', '=', 'allowances.id')->select('employee_allowances.employee_id', 'allowance_name', 'allowance_id', 'allowance_amount')->get();
     foreach ($allws as $allw) {
         DB::table('transact_allowances')->insert(['employee_id' => $allw->employee_id, 'allowance_name' => $allw->allowance_name, 'allowance_id' => $allw->allowance_id, 'allowance_amount' => $allw->allowance_amount, 'financial_month_year' => Input::get('period')]);
     }
     $rels = DB::table('employee_relief')->join('relief', 'employee_relief.relief_id', '=', 'relief.id')->select('employee_relief.employee_id', 'relief_name', 'relief_id', 'relief_amount')->get();
     foreach ($rels as $rel) {
         DB::table('transact_reliefs')->insert(['employee_id' => $rel->employee_id, 'relief_name' => $rel->relief_name, 'relief_id' => $rel->relief_id, 'relief_amount' => $rel->relief_amount, 'financial_month_year' => Input::get('period')]);
     }
     $deds = DB::table('employee_deductions')->join('deductions', 'employee_deductions.deduction_id', '=', 'deductions.id')->select('employee_deductions.employee_id', 'deduction_name', 'deduction_id', 'deduction_amount')->get();
     foreach ($deds as $ded) {
         DB::table('transact_deductions')->insert(['employee_id' => $ded->employee_id, 'deduction_name' => $ded->deduction_name, 'deduction_id' => $ded->deduction_id, 'deduction_amount' => $ded->deduction_amount, 'financial_month_year' => Input::get('period')]);
     }
     $earns = DB::table('earnings')->select('earnings.employee_id', 'earnings_name', 'earnings_amount')->get();
     foreach ($earns as $earn) {
         DB::table('transact_earnings')->insert(['employee_id' => $earn->employee_id, 'earning_name' => $earn->earnings_name, 'earning_amount' => $earn->earnings_amount, 'financial_month_year' => Input::get('period')]);
     }
     $otimes = DB::table('overtimes')->select('overtimes.employee_id', 'type', 'rate', 'amount')->get();
     foreach ($otimes as $otime) {
         DB::table('transact_overtimes')->insert(['employee_id' => $otime->employee_id, 'overtime_type' => $otime->type, 'overtime_rate' => $otime->rate, 'overtime_amount' => $otime->amount, 'financial_month_year' => Input::get('period')]);
     }
     $period = Input::get('period');
     Audit::logaudit('Payroll', 'process', 'processed payroll for ' . $period);
     return Redirect::route('payroll.index')->withFlashMessage('Payroll successfully processed!');
 }
コード例 #9
0
 /**
  * Remove the specified currency from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $currency = Currency::findOrFail($id);
     Currency::destroy($id);
     Audit::logaudit('Currency', 'delete', 'deleted: ' . $currency->name);
     return Redirect::route('currencies.index');
 }
コード例 #10
0
 /**
  * Remove the specified branch from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $appraisal = Appraisal::findOrFail($id);
     Appraisal::destroy($id);
     Audit::logaudit('Employee Appraisal', 'delete', 'deleted: ' . $appraisal->question);
     return Redirect::route('Appraisals.index')->withDeleteMessage('Employee Appraisal successfully deleted!');
 }
コード例 #11
0
ファイル: UsersController.php プロジェクト: kenkode/xaraerp
 /**
  * Log the user out of the application.
  *
  * @return  Illuminate\Http\Response
  */
 public function logout()
 {
     Audit::logaudit('System', 'logout', 'Logged out: ' . Confide::user()->username);
     Confide::logout();
     return Redirect::to('/');
 }
コード例 #12
0
 /**
  * Remove the specified branch from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $allowance = Allowance::findOrFail($id);
     Allowance::destroy($id);
     Audit::logaudit('Allowances', 'delete', 'deleted: ' . $allowance->allowance_name);
     return Redirect::route('allowances.index');
 }
コード例 #13
0
 /**
  * Remove the specified branch from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $occurence = Occurence::findOrFail($id);
     Occurence::destroy($id);
     Audit::logaudit('Occurences', 'delete', 'deleted: ' . $occurence->occurence_brief);
     return Redirect::route('occurences.index');
 }
コード例 #14
0
 /**
  * Remove the specified branch from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $earning = Earnings::findOrFail($id);
     Earnings::destroy($id);
     Audit::logaudit('Earnings', 'delete', 'deleted: ' . $earning->earnings_name);
     return Redirect::route('other_earnings.index');
 }
コード例 #15
0
ファイル: OvertimesController.php プロジェクト: kenkode/xpose
 /**
  * Remove the specified branch from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $overtime = Overtime::findOrFail($id);
     Overtime::destroy($id);
     Audit::logaudit('Overtimes', 'delete', 'deleted: ' . $overtime->type);
     return Redirect::route('overtimes.index')->withDeleteMessage('Employee Overtime successfully deleted!');
 }