Diversen nav opmerkingen
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
* Date: 21/04/2018
|
||||
* Time: 20:08
|
||||
*/
|
||||
//include_once('../application/models/eloquent/Employeetarget.php');
|
||||
|
||||
//include_once('../application/models/eloquent/Employeetarget.php');
|
||||
|
||||
|
||||
class EmployeeTargetController extends MY_Controller {
|
||||
@@ -30,5 +30,26 @@ class EmployeeTargetController extends MY_Controller {
|
||||
$this->json( $employeeTargets );
|
||||
}
|
||||
|
||||
public function saveEmployeeTarget()
|
||||
{
|
||||
$employeeTargetValidation = new EmployeeTargetValidation();
|
||||
|
||||
if ( ! $employeeTargetValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $employeeTargetValidation->getErrorMessages()] );
|
||||
|
||||
$target = $this->input->post();
|
||||
|
||||
$targetID = $target['id'];
|
||||
unset( $target['id'] );
|
||||
|
||||
$target['endmonth'] = $target['endmonth'] ? $target['endmonth'] : NULL;
|
||||
$target['endyear'] = $target['endyear'] ? $target['endyear'] : NULL;
|
||||
|
||||
$targetID = Employeetarget::saveTarget( $targetID, $target );
|
||||
|
||||
$this->json( ['success' => TRUE, 'targetID' => $targetID] );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -51,6 +51,11 @@ class ReportsController extends MY_Controller {
|
||||
|
||||
$result = $query->result();
|
||||
|
||||
foreach($result as $user)
|
||||
{
|
||||
$user->targethours = Employeetarget::getTargetHoursPerEmployee( $user->user_id, $year, $month);
|
||||
}
|
||||
|
||||
$this->json( $result );
|
||||
}
|
||||
|
||||
|
||||
@@ -27,22 +27,30 @@ class ReservationsController extends MY_Controller {
|
||||
{
|
||||
$projects[ $result->projectID ] = [
|
||||
'projectnumber' => $result->projectnumber,
|
||||
'costs' => 0,
|
||||
'reservation' => 0,
|
||||
'payed' => 0,
|
||||
'saldo' => 0,
|
||||
'saldoToPay' => 0,
|
||||
'other_revenue' => 0,
|
||||
'customers' => []
|
||||
];
|
||||
}
|
||||
|
||||
$projects[ $result->projectID ]['reservation'] += $result->reservation;
|
||||
$projects[ $result->projectID ]['costs'] += $result->costs;
|
||||
$projects[ $result->projectID ]['payed'] += $result->payed;
|
||||
$projects[ $result->projectID ]['saldo'] += $result->saldo;
|
||||
$projects[ $result->projectID ]['saldoToPay'] += $result->saldoToPay;
|
||||
$projects[ $result->projectID ]['other_revenue'] = $result->other_revenue;
|
||||
|
||||
$projects[ $result->projectID ]['externals'][] = [
|
||||
'external' => $result->contactperson,
|
||||
'reservation' => $result->reservation,
|
||||
'costs' => $result->costs,
|
||||
'payed' => $result->payed,
|
||||
'saldo' => $result->saldo
|
||||
'saldo' => $result->saldo,
|
||||
'saldoToPay' => $result->saldoToPay
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user