4include_once
'Services/Payment/exceptions/class.ilShopException.php';
5include_once
'Services/Payment/classes/class.ilShopUtils.php';
36 if((
int)$a_vat_id && $a_vat_id > 0)
38 $this->
id = $a_vat_id;
54 $res = $this->db->queryf(
'SELECT * FROM payment_vats
56 array(
'integer'), array($this->
id) );
58 while(
$row = $this->db->fetchObject(
$res))
69 throw new ilShopException($this->lng->txt(
'payment_cannot_read_nonexisting_vat'));
100 throw new ilShopException($this->lng->txt(
'payment_vat_already_created'));
104 $this->db->manipulatef(
'
109 array(
'text',
'float',
'integer'),
116 throw new ilShopException($this->lng->txt(
'payment_cannot_update_nonexisting_vat'));
132 throw new ilShopException($this->lng->txt(
'payment_vat_already_created'));
135 $next_id = $this->db->nextId(
'payment_vats');
137 $this->db->manipulateF(
'
138 INSERT INTO payment_vats
139 (vat_id, vat_title, vat_rate)
141 array(
'integer',
'text',
'float'),
147 throw new ilShopException($this->lng->txt(
'payment_cannot_save_existing_vat'));
157 public function delete()
162 SELECT * FROM payment_objects
165 array($this->
getId())
170 throw new ilShopException(sprintf($this->lng->txt(
'paya_vat_not_deleted'), $this->title));
173 $this->db->manipulateF(
'
174 DELETE FROM payment_vats
177 array($this->
getId())
183 throw new ilShopException($this->lng->txt(
'payment_cannot_delete_nonexisting_vat'));
195 $this->title = $a_title;
229 $this->rate = $a_rate;
243 $res =
$ilDB->query(
'SELECT * FROM payment_vats');
Class for shop related exception handling in ILIAS.
static _isVATAlreadyCreated($a_vat_rate, $a_vat_id=null)
Checks if the passed vat rate already exists in database.
setTitle($a_title)
Setter for the title.
reloadFromDatabase()
Public interface to reload the capsuled data of a vat from database.
__construct($a_vat_id=0)
Constructor.
setRate($a_rate)
Setter for the vat rate.
update()
Updates an existing vat dataset.
save()
Saves a new vat dataset.
setId($a_id)
Setter for the id.
read()
Fetches the data of a vat dataset from database.