Invoice report
This commit is contained in:
@@ -212,6 +212,42 @@ class ProjectsController extends MY_Controller {
|
||||
$this->json( ['success' => TRUE, 'projecthourID' => $paymentID] );
|
||||
}
|
||||
|
||||
public function saveForecast()
|
||||
{
|
||||
$forecastValidation = new ForecastValidation();
|
||||
|
||||
if ( ! $forecastValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $forecastValidation->getErrorMessages()] );
|
||||
|
||||
$forecast = $this->input->post();
|
||||
|
||||
$forecastID = $forecast['id'];
|
||||
unset( $forecast['id'] );
|
||||
|
||||
$forecastID = Forecast::saveForecast( $forecastID, $forecast );
|
||||
|
||||
$this->json( ['success' => TRUE, 'forecastID' => $forecastID] );
|
||||
}
|
||||
|
||||
public function saveReservation()
|
||||
{
|
||||
$reservationValidation = new ReservationValidation();
|
||||
|
||||
if ( ! $reservationValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $reservationValidation->getErrorMessages()] );
|
||||
|
||||
$reservation = $this->input->post();
|
||||
|
||||
$reservationID = $reservation['id'];
|
||||
unset( $reservation['id'] );
|
||||
|
||||
$reservationID = Reservation::saveReservation( $reservationID, $reservation );
|
||||
|
||||
$this->json( ['success' => TRUE, 'reservationID' => $reservationID] );
|
||||
}
|
||||
|
||||
public function archiveProject( $projectID, $status )
|
||||
{
|
||||
Project::whereId( $projectID )->update( ['archive' => $status] );
|
||||
@@ -261,4 +297,26 @@ class ProjectsController extends MY_Controller {
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
public function removeForecast( $forecastID )
|
||||
{
|
||||
$removeForecast = new RemoveForecast( $forecastID );
|
||||
|
||||
if ( $removeForecast->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Forecast::removeForecast( $forecastID );
|
||||
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
public function removeReservation( $reservationID )
|
||||
{
|
||||
$removeReservation = new RemoveReservation( $reservationID );
|
||||
|
||||
if ( $removeReservation->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Forecast::removeReservation( $reservationID );
|
||||
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user