@@ -44,13 +44,13 @@ |
||
44 | 44 | $voucher_file = new VoucherFile($this->getVoucher()); |
45 | 45 | $voucher_files = $voucher_file->getList(); |
46 | 46 | |
47 | - $smarty = $this->template->create(dirname(__FILE__) . '/../templates/voucher/show'); |
|
47 | + $smarty = $this->template->create(dirname(__FILE__).'/../templates/voucher/show'); |
|
48 | 48 | return $smarty->render($this); |
49 | 49 | } |
50 | 50 | |
51 | 51 | function renderHtmlEdit() |
52 | 52 | { |
53 | - $smarty = $this->template->create(dirname(__FILE__) . '/../templates/voucher/edit'); |
|
53 | + $smarty = $this->template->create(dirname(__FILE__).'/../templates/voucher/edit'); |
|
54 | 54 | return $smarty->render($this); |
55 | 55 | } |
56 | 56 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | function renderHtml() |
25 | 25 | { |
26 | - $smarty = $this->template->create(dirname(__FILE__) . '/../templates/voucher/index'); |
|
26 | + $smarty = $this->template->create(dirname(__FILE__).'/../templates/voucher/index'); |
|
27 | 27 | return $smarty->render($this); |
28 | 28 | } |
29 | 29 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | $year = $this->getYear(); |
33 | 33 | |
34 | - $this->db_sql->query("SELECT * FROM accounting_voucher WHERE intranet_id = " . $year->kernel->intranet->get('id') . " AND year_id = " . $year->get('id') . " ORDER BY number ASC"); |
|
34 | + $this->db_sql->query("SELECT * FROM accounting_voucher WHERE intranet_id = ".$year->kernel->intranet->get('id')." AND year_id = ".$year->get('id')." ORDER BY number ASC"); |
|
35 | 35 | //$i++; |
36 | 36 | $posts = array(); |
37 | 37 | while ($this->db_sql->nextRecord()) { |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | $workbook->setVersion(8); |
45 | 45 | |
46 | 46 | // sending HTTP headers |
47 | - $workbook->send($this->getKernel()->intranet->get('name') . ' - poster ' . $year->get('label')); |
|
47 | + $workbook->send($this->getKernel()->intranet->get('name').' - poster '.$year->get('label')); |
|
48 | 48 | |
49 | 49 | // Creating a worksheet |
50 | - $worksheet = $workbook->addWorksheet('Konti ' . $year->get('label')); |
|
50 | + $worksheet = $workbook->addWorksheet('Konti '.$year->get('label')); |
|
51 | 51 | $worksheet->setInputEncoding('UTF-8'); |
52 | 52 | |
53 | 53 | $format_bold = $workbook->addFormat(); |
@@ -43,7 +43,7 @@ |
||
43 | 43 | 'saldo_total' => $saldo_total |
44 | 44 | ); |
45 | 45 | |
46 | - $smarty = $this->template->create(dirname(__FILE__) . '/../templates/vat/show'); |
|
46 | + $smarty = $this->template->create(dirname(__FILE__).'/../templates/vat/show'); |
|
47 | 47 | return $smarty->render($this, $data); |
48 | 48 | } |
49 | 49 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $periods = $vat_period->getList(); |
42 | 42 | $post = new Post(new Voucher($year)); |
43 | 43 | |
44 | - $smarty = $this->template->create(dirname(__FILE__) . '/../templates/vat/period'); |
|
44 | + $smarty = $this->template->create(dirname(__FILE__).'/../templates/vat/period'); |
|
45 | 45 | return $smarty->render($this); |
46 | 46 | } |
47 | 47 |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $this->db = new DB_Sql; |
95 | 95 | $this->mdb2 = MDB2::singleton(DB_DSN); |
96 | 96 | if (PEAR::isError($this->mdb2)) { |
97 | - throw new Exception($this->mdb2->getMessage() . $this->mdb2->getUserInfo()); |
|
97 | + throw new Exception($this->mdb2->getMessage().$this->mdb2->getUserInfo()); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | $this->error = new Intraface_Error; |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | account.active |
151 | 151 | FROM |
152 | 152 | accounting_account account |
153 | - WHERE account.id = " . $this->id . " |
|
154 | - AND account.intranet_id = ".$this->year->kernel->intranet->get('id'). " |
|
153 | + WHERE account.id = " . $this->id." |
|
154 | + AND account.intranet_id = ".$this->year->kernel->intranet->get('id')." |
|
155 | 155 | AND year_id = ".$this->year->get('id')." |
156 | 156 | LIMIT 1"; |
157 | 157 | |
@@ -256,26 +256,26 @@ discard block |
||
256 | 256 | |
257 | 257 | if ($this->id > 0) { |
258 | 258 | $sql_type = "UPDATE accounting_account "; |
259 | - $sql_end = " WHERE id = " . $this->id; |
|
259 | + $sql_end = " WHERE id = ".$this->id; |
|
260 | 260 | } else { |
261 | 261 | $sql_type = "INSERT INTO accounting_account "; |
262 | 262 | $sql_end = ", date_created=NOW()"; |
263 | 263 | } |
264 | 264 | |
265 | - $sql = $sql_type . "SET |
|
265 | + $sql = $sql_type."SET |
|
266 | 266 | number = '".(int)$var['number']."', |
267 | - intranet_id = " . $this->year->kernel->intranet->get('id') . ", |
|
268 | - user_id = " . $this->year->kernel->user->get("id") . ", |
|
267 | + intranet_id = " . $this->year->kernel->intranet->get('id').", |
|
268 | + user_id = " . $this->year->kernel->user->get("id").", |
|
269 | 269 | type_key='" . $var['type_key']."', |
270 | 270 | year_id = " . $this->year->get('id').", |
271 | 271 | use_key = '" . $var['use_key']."', |
272 | 272 | name = '" . $var['name']."', |
273 | 273 | comment = '" . $var['comment']."', |
274 | - vat_percent = '" . $var['vat_percent'] . "', |
|
275 | - sum_to_account_number = " . (int)$var['sum_to'] . ", |
|
276 | - sum_from_account_number = " . (int)$var['sum_from'] . ", |
|
274 | + vat_percent = '" . $var['vat_percent']."', |
|
275 | + sum_to_account_number = " . (int)$var['sum_to'].", |
|
276 | + sum_from_account_number = " . (int)$var['sum_from'].", |
|
277 | 277 | date_changed = NOW(), |
278 | - vat_key=" . (int)$var['vat_key'] . " " . $sql_end; |
|
278 | + vat_key=" . (int)$var['vat_key']." ".$sql_end; |
|
279 | 279 | |
280 | 280 | $this->db->query($sql); |
281 | 281 | |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | } |
285 | 285 | |
286 | 286 | if (!empty($var['created_from_id']) and is_numeric($var['created_from_id'])) { |
287 | - $this->db->query("UPDATE accounting_account SET created_from_id = ".$var['created_from_id']." WHERE id = " . $this->id); |
|
287 | + $this->db->query("UPDATE accounting_account SET created_from_id = ".$var['created_from_id']." WHERE id = ".$this->id); |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | $this->load(); |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | return false; |
350 | 350 | } |
351 | 351 | |
352 | - $this->db->query("UPDATE accounting_account SET active = 0, date_changed=NOW() WHERE intranet_id = " . $this->year->kernel->intranet->get('id') . " AND year_id = ".$this->year->get('id')." AND id = " . $this->id); |
|
352 | + $this->db->query("UPDATE accounting_account SET active = 0, date_changed=NOW() WHERE intranet_id = ".$this->year->kernel->intranet->get('id')." AND year_id = ".$this->year->get('id')." AND id = ".$this->id); |
|
353 | 353 | $this->value['active'] = 0; |
354 | 354 | return true; |
355 | 355 | } |
@@ -390,10 +390,10 @@ discard block |
||
390 | 390 | $sql = "SELECT |
391 | 391 | id |
392 | 392 | FROM accounting_account |
393 | - WHERE number = " . $account_number . " |
|
394 | - AND intranet_id = " . $this->year->kernel->intranet->get('id') . " |
|
395 | - AND year_id = " .$this->year->get('id'). " |
|
396 | - AND id <> " . $this->id . " AND active = 1"; |
|
393 | + WHERE number = " . $account_number." |
|
394 | + AND intranet_id = " . $this->year->kernel->intranet->get('id')." |
|
395 | + AND year_id = " .$this->year->get('id')." |
|
396 | + AND id <> " . $this->id." AND active = 1"; |
|
397 | 397 | $result = $this->mdb2->query($sql); |
398 | 398 | if (PEAR::isError($result)) { |
399 | 399 | throw new Exception('Error in query: '.$result->getUserInfo()); |
@@ -418,8 +418,8 @@ discard block |
||
418 | 418 | { |
419 | 419 | $sql = "SELECT primosaldo_debet, primosaldo_credit |
420 | 420 | FROM accounting_account |
421 | - WHERE year_id = " . $this->year->get('id') . " |
|
422 | - AND id = ".$this->id . " |
|
421 | + WHERE year_id = " . $this->year->get('id')." |
|
422 | + AND id = ".$this->id." |
|
423 | 423 | AND active = 1 |
424 | 424 | AND intranet_id = ".$this->year->kernel->intranet->get('id'); |
425 | 425 | |
@@ -499,9 +499,9 @@ discard block |
||
499 | 499 | if ($this->get('type_key') == array_search('sum', $this->types)) { |
500 | 500 | $db2 = new DB_Sql; |
501 | 501 | $sql = "SELECT id FROM accounting_account |
502 | - WHERE number >= " . $this->get('sum_from') . " |
|
502 | + WHERE number >= " . $this->get('sum_from')." |
|
503 | 503 | AND type_key != ".array_search('sum', $this->types)." |
504 | - AND number <= " . $this->get('sum_to') . " |
|
504 | + AND number <= " . $this->get('sum_to')." |
|
505 | 505 | AND year_id = ".$this->year->get('id')." |
506 | 506 | AND intranet_id = " . $this->year->kernel->intranet->get('id'); |
507 | 507 | $db2->query($sql); |
@@ -567,9 +567,9 @@ discard block |
||
567 | 567 | $this->db->query("SELECT |
568 | 568 | id |
569 | 569 | FROM accounting_post post |
570 | - WHERE (post.account_id = ". $this->id . ") |
|
570 | + WHERE (post.account_id = ". $this->id.") |
|
571 | 571 | AND intranet_id = ".$this->year->kernel->intranet->get('id')." |
572 | - AND year_id = " . $this->year->get('id') . " |
|
572 | + AND year_id = " . $this->year->get('id')." |
|
573 | 573 | LIMIT 1"); |
574 | 574 | return $this->db->numRows(); |
575 | 575 | } |
@@ -590,9 +590,9 @@ discard block |
||
590 | 590 | debet, |
591 | 591 | credit |
592 | 592 | FROM accounting_post post |
593 | - WHERE (post.account_id = ". $this->get('id') . ") |
|
593 | + WHERE (post.account_id = ". $this->get('id').") |
|
594 | 594 | AND intranet_id = ".$this->year->kernel->intranet->get('id')." |
595 | - AND year_id = " . $this->year->get('id') . " |
|
595 | + AND year_id = " . $this->year->get('id')." |
|
596 | 596 | AND stated = 1 |
597 | 597 | ORDER BY date ASC, id ASC"); |
598 | 598 | $i = 1; |
@@ -626,9 +626,9 @@ discard block |
||
626 | 626 | public function calculateVat($amount, $vat_percent) |
627 | 627 | { |
628 | 628 | $amount = (float)$amount; |
629 | - $vat_percent = (float)$vat_percent / 100; |
|
629 | + $vat_percent = (float)$vat_percent/100; |
|
630 | 630 | |
631 | - return $amount * ($vat_percent / (1 + $vat_percent)); |
|
631 | + return $amount*($vat_percent/(1 + $vat_percent)); |
|
632 | 632 | } |
633 | 633 | |
634 | 634 | public function getId() |
@@ -95,7 +95,7 @@ |
||
95 | 95 | $last_modified = filemtime($this->file_path); |
96 | 96 | |
97 | 97 | header('Content-Type: '.$this->mime_type); |
98 | - header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $last_modified).' GMT'); |
|
98 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_modified).' GMT'); |
|
99 | 99 | header('Cache-Control:'); |
100 | 100 | header('Content-Disposition: inline; filename='.$this->file_name); |
101 | 101 | header('Pragma:'); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | if ($this->dbquery) { |
100 | 100 | return $this->dbquery; |
101 | 101 | } |
102 | - $this->dbquery = new Ilib_DBQuery('filehandler_append_file', 'filehandler_append_file.active = 1 AND filehandler_append_file.intranet_id='.$this->kernel->intranet->get('id').' AND filehandler_append_file.belong_to_key = '.$this->belong_to_key.' AND filehandler_append_file.belong_to_id = ' . $this->belong_to_id); |
|
102 | + $this->dbquery = new Ilib_DBQuery('filehandler_append_file', 'filehandler_append_file.active = 1 AND filehandler_append_file.intranet_id='.$this->kernel->intranet->get('id').' AND filehandler_append_file.belong_to_key = '.$this->belong_to_key.' AND filehandler_append_file.belong_to_id = '.$this->belong_to_id); |
|
103 | 103 | $this->dbquery->createStore($this->kernel->getSessionId(), 'intranet_id = '.intval($this->kernel->intranet->get('id'))); |
104 | 104 | return $this->dbquery; |
105 | 105 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | { |
116 | 116 | $db = new DB_Sql(); |
117 | 117 | $db->query("SELECT id FROM filehandler_append_file |
118 | - WHERE intranet_id = " . $this->kernel->intranet->get('id') . " |
|
118 | + WHERE intranet_id = " . $this->kernel->intranet->get('id')." |
|
119 | 119 | AND belong_to_key = ".$this->belong_to_key." |
120 | 120 | AND belong_to_id = ".$this->belong_to_id." |
121 | 121 | AND file_handler_id = ".$file_id." |
@@ -288,7 +288,7 @@ |
||
288 | 288 | continue; |
289 | 289 | } |
290 | 290 | |
291 | - $ext = substr($file, strrpos($file, ".")+1); |
|
291 | + $ext = substr($file, strrpos($file, ".") + 1); |
|
292 | 292 | |
293 | 293 | if (strlen($ext) < 3 || strlen($ext) > 4) { |
294 | 294 | $this->file_handler->error->set("Filen \"".$file."\" har ikke en gyldig endelse, f.eks. .pdf"); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $this->image_library = IMAGE_LIBRARY; |
55 | 55 | |
56 | 56 | if ($this->file_handler->get('is_image') != 1) { |
57 | - throw new Exception("Filtypen " . $file_handler->get('mime_type') . " er ikke et billede, og kan derfor ikke manipuleres i ImageHandler"); |
|
57 | + throw new Exception("Filtypen ".$file_handler->get('mime_type')." er ikke et billede, og kan derfor ikke manipuleres i ImageHandler"); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | $this->tempdir_path = $this->file_handler->getTemporaryDirectory(); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | $image = Image_Transform::factory($this->image_library); |
82 | 82 | if (PEAR::isError($image)) { |
83 | - throw new Exception($image->getMessage() . $image->getUserInfo()); |
|
83 | + throw new Exception($image->getMessage().$image->getUserInfo()); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | if ($this->tmp_file_name != null && file_exists($this->tmp_file_name)) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | { |
151 | 151 | $image = Image_Transform::factory($this->image_library); |
152 | 152 | if (PEAR::isError($image)) { |
153 | - throw new Exception($image->getMessage() . $image->getUserInfo()); |
|
153 | + throw new Exception($image->getMessage().$image->getUserInfo()); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | if ($this->tmp_file_name != null && file_exists($this->tmp_file_name)) { |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $result = $image->crop($width, $height, $offset_x, $offset_y); |
169 | 169 | |
170 | 170 | if (PEAR::isError($result)) { |
171 | - throw new Exception("Der opstod en fejl under formatering (crop) af billedet i ImageHandler->crop: " . $result->getMessage()); |
|
171 | + throw new Exception("Der opstod en fejl under formatering (crop) af billedet i ImageHandler->crop: ".$result->getMessage()); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $file_type = $this->file_handler->get('file_type'); |