Uppercase vatcontroller
This commit is contained in:
@@ -1,60 +0,0 @@
|
|||||||
<?php
|
|
||||||
defined( 'BASEPATH' ) OR exit( 'No direct script access allowed' );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Pensare Software.
|
|
||||||
* User: Theo Weijmer
|
|
||||||
* Date: 23/01/2018
|
|
||||||
* Time: 19:35
|
|
||||||
*/
|
|
||||||
class vatController extends MY_Controller {
|
|
||||||
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
parent::__construct();
|
|
||||||
|
|
||||||
if ( AUTHENTICATED == FALSE ) die( 'NO ACCESS' );
|
|
||||||
|
|
||||||
$models = [];
|
|
||||||
$libraries = [];
|
|
||||||
|
|
||||||
$this->load->model( $models );
|
|
||||||
$this->load->library( $libraries );
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getVats( $archive )
|
|
||||||
{
|
|
||||||
$vats = Vat::getVats( $archive );
|
|
||||||
|
|
||||||
$this->json( $vats );
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addVat()
|
|
||||||
{
|
|
||||||
Vat::create( [] );
|
|
||||||
}
|
|
||||||
|
|
||||||
public function saveVat( $vatID )
|
|
||||||
{
|
|
||||||
$vatrate = $this->input->post( 'vatrate' );
|
|
||||||
Vat::whereId( $vatID )->update( ['vatrate' => $vatrate] );
|
|
||||||
}
|
|
||||||
|
|
||||||
public function removeVat( $vatID )
|
|
||||||
{
|
|
||||||
$removeVat = new RemoveVat($vatID);
|
|
||||||
|
|
||||||
$allowRemove = $removeVat->getRemoveAllowed();
|
|
||||||
|
|
||||||
if( $allowRemove === FALSE ) return $this->json( ['result'=>FALSE]);
|
|
||||||
|
|
||||||
Vat::whereId($vatID)->delete();
|
|
||||||
|
|
||||||
$this->json( ['result'=>TRUE]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user