Removalls and offers revenues

This commit is contained in:
2018-06-10 17:31:05 +02:00
parent 8fe98e6ccb
commit c539d03fb6
20 changed files with 449 additions and 158 deletions
@@ -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] );
}
}