Exemplo n.º 1
0
 /**
  * editar traslado
  *
  * @return Response
  */
 public function edit($transferId)
 {
     $transfer = $this->transfer->findOrFail($transferId);
     $employees = $this->employee->getCmb();
     $branchs = Branch::whereClientId(Auth::user()->client_id)->lists('name', 'id');
     $causes = TransferCause::lists('name', 'id');
     return view('humanresources.transfers.edit', compact('transfer', 'employees', 'branchs', 'causes'));
 }
Exemplo n.º 2
0
 public function create()
 {
     $contracts = $this->contract->whereClientId(Auth::user()->client_id)->whereStatus('Vigente')->lists('employee_id');
     $employees = $this->employee->whereClientId(Auth::user()->client_id)->whereNotIn('id', $contracts)->orderBy('name')->lists('name', 'id');
     if (count($employees) == 0) {
         abort(403, 'No existen trabajadores sin contrato.');
     }
     $charges = Charge::whereClientId(Auth::user()->client_id)->orderBy('name')->lists('name', 'id');
     $contractTypes = ContractType::orderBy('name')->lists('name', 'id');
     $branchs = Branch::whereClientId(Auth::user()->client_id)->orderBy('name')->lists('name', 'id');
     $workingTypes = $this->workingTypes;
     return view('humanresources.contracts.create', compact('charges', 'employees', 'contractTypes', 'branchs', 'workingTypes'));
 }