4 include_once
'Services/Payment/exceptions/class.ilShopException.php';
5 include_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())
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');
244 while(
$row = $ilDB->fetchAssoc(
$res))