Removalls and offers revenues
This commit is contained in:
@@ -256,28 +256,39 @@ class ProjectsController extends MY_Controller {
|
||||
Project::whereId( $projectID )->update( ['archive' => $status] );
|
||||
}
|
||||
|
||||
public function removeProject( $projectID )
|
||||
{
|
||||
$removeProject = new RemoveProject( $projectID );
|
||||
|
||||
if ( $removeProject->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Project::removeProject( $projectID );
|
||||
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
public function removeProjectemployee( $projectemployeeID )
|
||||
{
|
||||
$removeProjectemployee = new RemoveProjectemployee( $projectemployeeID );
|
||||
|
||||
if ( $removeProjectemployee->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
if ( $removeProjectemployee->getRemoveAllowed() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Projectemployee::removeProjectemployee( $projectemployeeID );
|
||||
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
public function removeInvoice( $invoiceID )
|
||||
{
|
||||
$removeInvoice = new RemoveInvoice( $invoiceID );
|
||||
|
||||
if ( $removeInvoice->getRemoveAllowed() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Invoice::whereId( $invoiceID )->delete();
|
||||
|
||||
return $this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
public function removeIncomingInvoice( $invoiceID )
|
||||
{
|
||||
// $removeInvoice = new RemoveInvoice( $invoiceID );
|
||||
//
|
||||
// if ( $removeInvoice->getRemoveAllowed() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Projectcost::whereId( $invoiceID )->delete();
|
||||
|
||||
return $this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
public function removePayment( $paymentID )
|
||||
{
|
||||
$removePayment = new RemovePayment( $paymentID );
|
||||
@@ -322,4 +333,15 @@ class ProjectsController extends MY_Controller {
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
public function removeProject( $projectID )
|
||||
{
|
||||
$removeProject = new RemoveProject( $projectID );
|
||||
|
||||
if ( $removeProject->getRemoveAllowed() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Project::removeProject( $projectID );
|
||||
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user