4 include_once
'Services/Payment/classes/class.ilGeneralSettings.php';
5 include_once
'Services/Payment/exceptions/class.ilShopException.php';
6 include_once
'Services/Payment/classes/class.ilShopUtils.php';
37 if((
int)$a_vat_id && $a_vat_id > 0)
39 $this->
id = $a_vat_id;
55 $res = $this->db->queryf(
'SELECT * FROM payment_vats
57 array(
'integer'), array($this->
id) );
59 while(
$row = $this->db->fetchObject(
$res))
70 throw new ilShopException($this->lng->txt(
'payment_cannot_read_nonexisting_vat'));
101 throw new ilShopException($this->lng->txt(
'payment_vat_already_created'));
105 $this->db->manipulatef(
'
110 array(
'text',
'float',
'integer'),
117 throw new ilShopException($this->lng->txt(
'payment_cannot_update_nonexisting_vat'));
133 throw new ilShopException($this->lng->txt(
'payment_vat_already_created'));
136 $next_id = $this->db->nextId(
'payment_vats');
138 $this->db->manipulateF(
'
139 INSERT INTO payment_vats
140 (vat_id, vat_title, vat_rate)
142 array(
'integer',
'text',
'float'),
148 throw new ilShopException($this->lng->txt(
'payment_cannot_save_existing_vat'));
158 public function delete()
162 $result = $this->db->queryF(
'
163 SELECT * FROM payment_objects
166 array($this->
getId())
169 while(
$row = $this->db->fetchObject($result))
174 $this->db->manipulateF(
'
175 DELETE FROM payment_vats
178 array($this->
getId())
184 throw new ilShopException($this->lng->txt(
'payment_cannot_delete_nonexisting_vat'));
196 $this->title = $a_title;
230 $this->rate = $a_rate;