fix for employeehours (remove) and refresh active offers / projects
This commit is contained in:
@@ -51,7 +51,7 @@ class EmployeeHoursController extends MY_Controller {
|
||||
unset( $data['id'] );
|
||||
unset( $data['hourType'] );
|
||||
unset( $data['project_id'] );
|
||||
if( $hourType == 'OFFERS' ) $data['offer_id'] = $projectID;
|
||||
if ( $hourType == 'OFFERS' ) $data['offer_id'] = $projectID;
|
||||
|
||||
$data['hourdate'] = date2mysql( $data['hourdate'] );
|
||||
|
||||
@@ -85,10 +85,18 @@ class EmployeeHoursController extends MY_Controller {
|
||||
$this->json( ['employeehourID' => $employeehourID] );
|
||||
}
|
||||
|
||||
public function removeEmployeehour( $employeehourID )
|
||||
public function removeEmployeehour( $employeehourID, $hourType )
|
||||
{
|
||||
//TODO:check op delete
|
||||
Employeehour::whereId( $employeehourID )->delete();
|
||||
if ( $hourType == 'OVERHEAD' )
|
||||
{
|
||||
Employeehour::whereId( $employeehourID )->delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
Projecthour::whereId( $employeehourID )->delete();
|
||||
}
|
||||
|
||||
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user