Completed
Push — master ( 9d10c2...bf46e5 )
by Lars
05:14
created
src/Intraface/modules/accounting/VoucherFileGateway.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,14 +22,14 @@  discard block
 block discarded – undo
22 22
 
23 23
     function findFromId($id)
24 24
     {
25
-        require_once dirname(__FILE__) . '/VoucherFile.php';
25
+        require_once dirname(__FILE__).'/VoucherFile.php';
26 26
         return new VoucherFile($this->voucher, $id);
27 27
     }
28 28
 
29 29
     function getList()
30 30
     {
31 31
         $db = new DB_Sql;
32
-        $db->query("SELECT * FROM accounting_voucher_file WHERE active = 1 AND voucher_id = " . $this->voucher->get('id') . " AND intranet_id=" . $this->voucher->year->kernel->intranet->get('id'));
32
+        $db->query("SELECT * FROM accounting_voucher_file WHERE active = 1 AND voucher_id = ".$this->voucher->get('id')." AND intranet_id=".$this->voucher->year->kernel->intranet->get('id'));
33 33
         $i = 0;
34 34
         $files = array();
35 35
         while ($db->nextRecord()) {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
                         $files[$i]['description'] = 'Momsperiode';
50 50
                     }
51 51
                     $files[$i]['name'] = 'Momsperiode';
52
-                    $files[$i]['file_uri'] = $this->url('/module/accounting/year/'.$this->voucher->year->getId().'/vat/' . $db->f('belong_to_id'));
52
+                    $files[$i]['file_uri'] = $this->url('/module/accounting/year/'.$this->voucher->year->getId().'/vat/'.$db->f('belong_to_id'));
53 53
                     break;
54 54
                 case 'file':
55 55
                     $this->voucher->year->kernel->useModule('filemanager');
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                         $files[$i]['description'] = 'Kreditnota';
64 64
                     }
65 65
                     $files[$i]['name'] = 'Kreditnota';
66
-                    $files[$i]['file_uri'] = $this->url('/module/debtor/credit_note/' . $db->f('belong_to_id') . '.pdf');
66
+                    $files[$i]['file_uri'] = $this->url('/module/debtor/credit_note/'.$db->f('belong_to_id').'.pdf');
67 67
                     break;
68 68
                 case 'reminder':
69 69
                     if (empty($files[$i]['description'])) {
@@ -91,6 +91,6 @@  discard block
 block discarded – undo
91 91
 
92 92
     function url($url)
93 93
     {
94
-        return PATH_WWW . 'restricted' . $url;
94
+        return PATH_WWW.'restricted'.$url;
95 95
     }
96 96
 }
Please login to merge, or discard this patch.
src/Intraface/modules/accounting/VoucherGateway.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
     public function findFromId($id)
27 27
     {
28
-        require_once dirname(__FILE__) . '/Voucher.php';
28
+        require_once dirname(__FILE__).'/Voucher.php';
29 29
         return new Voucher($this->year, $id);
30 30
     }
31 31
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     public function findFromVoucherNumber($voucher_number)
41 41
     {
42 42
         $db = new DB_Sql;
43
-        $db->query("SELECT id FROM accounting_voucher WHERE number = '".safeToDb($voucher_number)."' AND year_id = '".$this->year->get('id')."' AND intranet_id = " . $this->year->kernel->intranet->get('id'));
43
+        $db->query("SELECT id FROM accounting_voucher WHERE number = '".safeToDb($voucher_number)."' AND year_id = '".$this->year->get('id')."' AND intranet_id = ".$this->year->kernel->intranet->get('id'));
44 44
         if (!$db->nextRecord()) {
45 45
             return new Voucher($this->year);
46 46
         }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
         $db->query("SELECT MAX(number) AS max_voucher_number
95 95
             FROM accounting_voucher
96
-            WHERE intranet_id = " . $this->year->kernel->intranet->get('id') . "
96
+            WHERE intranet_id = " . $this->year->kernel->intranet->get('id')."
97 97
                 AND year_id = " . $this->year->get('id'));
98 98
         if (!$db->nextRecord()) {
99 99
             return 0;
Please login to merge, or discard this patch.
src/Intraface/modules/accounting/Post.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     private function load()
45 45
     {
46 46
         $db = new DB_Sql;
47
-        $db->query("SELECT *, DATE_FORMAT(date, '%d-%m-%Y') AS date_dk FROM accounting_post WHERE id = " . $this->id . " AND intranet_id=" .$this->voucher->year->kernel->intranet->get('id'));
47
+        $db->query("SELECT *, DATE_FORMAT(date, '%d-%m-%Y') AS date_dk FROM accounting_post WHERE id = ".$this->id." AND intranet_id=".$this->voucher->year->kernel->intranet->get('id'));
48 48
         if (!$db->nextRecord()) {
49 49
             return 0;
50 50
         }
@@ -125,14 +125,14 @@  discard block
 block discarded – undo
125 125
 
126 126
         if ($this->id > 0) {
127 127
             $sql_type = "UPDATE";
128
-            $sql_end = " WHERE id = " . $this->id;
128
+            $sql_end = " WHERE id = ".$this->id;
129 129
         } else {
130 130
             $sql_type = "INSERT INTO";
131 131
             $sql_end = "";
132 132
         }
133 133
 
134 134
         $db = new DB_Sql;
135
-        $sql = $sql_type . " accounting_post
135
+        $sql = $sql_type." accounting_post
136 136
                  SET
137 137
                     voucher_id = '".$this->voucher->get('id')."',
138 138
                     intranet_id = ".$this->
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                     account_id = '".(int)$account_id."',
148 148
                     text = '".(string)$text."',
149 149
                     debet = '".$debet."',
150
-                    credit = '".$credit."'"  . $sql_end;
150
+                    credit = '".$credit."'".$sql_end;
151 151
         $db->query($sql);
152 152
 
153 153
         $this->id = $db->insertedId();
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         }
175 175
 
176 176
         $db = new DB_Sql;
177
-        $db->query("UPDATE accounting_post SET stated = 1 WHERE id = " . $this->id . " AND intranet_id =" .$this->voucher->year->kernel->intranet->get('id'));
177
+        $db->query("UPDATE accounting_post SET stated = 1 WHERE id = ".$this->id." AND intranet_id =".$this->voucher->year->kernel->intranet->get('id'));
178 178
 
179 179
         return true;
180 180
     }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         }
187 187
 
188 188
         $db = new DB_Sql;
189
-        $db->query("DELETE FROM accounting_post WHERE id = " . $this->id);
189
+        $db->query("DELETE FROM accounting_post WHERE id = ".$this->id);
190 190
         return true;
191 191
 
192 192
     }
Please login to merge, or discard this patch.
src/Intraface/modules/accounting/Voucher.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                     voucher.date,
69 69
                     voucher.reference
70 70
             FROM accounting_voucher voucher
71
-            WHERE voucher.id = " . $this->id. " AND intranet_id = ". $this->year->kernel->intranet->getId();
71
+            WHERE voucher.id = " . $this->id." AND intranet_id = ".$this->year->kernel->intranet->getId();
72 72
 
73 73
         $db = new DB_Sql;
74 74
         $db->query($sql);
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
             $sql_end = ", date_created = NOW()";
144 144
         } else {
145 145
             $sql_type = "UPDATE";
146
-            $sql_end = " WHERE id = " . (int)$this->id;
146
+            $sql_end = " WHERE id = ".(int)$this->id;
147 147
         }
148 148
 
149 149
         $db = new DB_Sql;
150
-        $sql = $sql_type . " accounting_voucher
150
+        $sql = $sql_type." accounting_voucher
151 151
             SET intranet_id = ".$this->year->kernel->intranet->get('id').",
152 152
                 year_id = ".$this->year->get('id').",
153 153
                 user_id = ".$this->year->kernel->user->get('id').",
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                 number = '".$var['voucher_number']."',
156 156
                 date = '".$post_date->get()."',
157 157
                 reference = '".$var['reference']."',
158
-                text = '".$var['text']."'" . $sql_end;
158
+                text = '".$var['text']."'".$sql_end;
159 159
 
160 160
         $db->query($sql);
161 161
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
             $buy_all_abroad = $buy_abroad;
310 310
         }
311 311
 
312
-        $amount = $this->get('amount') * ($this->vatpercent / 100);
312
+        $amount = $this->get('amount')*($this->vatpercent/100);
313 313
 
314 314
         // I det omfang du har fradragsret for momsen, kan du medregne det beregnede
315 315
         // momsbeløb til konto for indgående moms. Det beregnede momsbeløb af EU-varekøb
@@ -374,13 +374,13 @@  discard block
 block discarded – undo
374 374
                         $debet = $debet - $vat_amount;
375 375
                         // bogfør momsen
376 376
                         $post = new Post($this);
377
-                        $post->save($date, $vat_account_id, $text . " - købsmoms", $vat_amount, 0, $skip_draft);
377
+                        $post->save($date, $vat_account_id, $text." - købsmoms", $vat_amount, 0, $skip_draft);
378 378
                     } else {
379 379
                         $vat_amount = $this->calculateVat($credit, $vat_percent);
380 380
                         $credit = $credit - $vat_amount;
381 381
                         // bogføre udgående moms
382 382
                         $post = new Post($this);
383
-                        $post->save($date, $vat_account_id, $text . " - tilbageført moms", 0, $vat_amount, $skip_draft);
383
+                        $post->save($date, $vat_account_id, $text." - tilbageført moms", 0, $vat_amount, $skip_draft);
384 384
                     }
385 385
 
386 386
                         // bogføre selve posten
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
                         $credit = $credit - $vat_amount;
397 397
                         // bogføre udgående moms
398 398
                         $post = new Post($this);
399
-                        $post->save($date, $vat_account_id, $text . " - salgsmoms", 0, $vat_amount, $skip_draft);
399
+                        $post->save($date, $vat_account_id, $text." - salgsmoms", 0, $vat_amount, $skip_draft);
400 400
                     } else {
401 401
                         // tilbagefører momsen hvis det er et debet beløb
402 402
                         $vat_amount = $this->calculateVat($debet, $vat_percent);
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
             $post = new Post($this, $p['id']);
456 456
 
457 457
             if (!$post->setStated()) {
458
-                $this->error->set('id#' .$p['id'] . ': Det lykkedes ikke at bogføre denne post.');
458
+                $this->error->set('id#'.$p['id'].': Det lykkedes ikke at bogføre denne post.');
459 459
             }
460 460
 
461 461
             // tjekker om der har været nogle fejl i bogføringen
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
         }
480 480
 
481 481
         if ($this->get('saldo') <> 0) {
482
-            $this->error->set('Du kan kun bogføre et bilag, hvis det stemmer. Saldoen på dette bilag er ' . $this->get('saldo') . '.');
482
+            $this->error->set('Du kan kun bogføre et bilag, hvis det stemmer. Saldoen på dette bilag er '.$this->get('saldo').'.');
483 483
         }
484 484
 
485 485
         if ($this->error->isError()) {
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
             }
496 496
 
497 497
             if (!$post->setStated()) {
498
-                $this->error->set('id#' .$p['id'] . ': Det lykkedes ikke at bogføre denne post.');
498
+                $this->error->set('id#'.$p['id'].': Det lykkedes ikke at bogføre denne post.');
499 499
             }
500 500
         }
501 501
         // tjekker om der har været nogle fejl i bogføringen
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
     function getPosts()
510 510
     {
511 511
         $db = new DB_Sql;
512
-        $db->query("SELECT id, text, debet, credit, account_id, stated, date, DATE_FORMAT(date, '%d-%m-%Y') AS date_dk FROM accounting_post WHERE voucher_id = " . $this->id . " AND intranet_id=".$this->year->kernel->intranet->get('id'));
512
+        $db->query("SELECT id, text, debet, credit, account_id, stated, date, DATE_FORMAT(date, '%d-%m-%Y') AS date_dk FROM accounting_post WHERE voucher_id = ".$this->id." AND intranet_id=".$this->year->kernel->intranet->get('id'));
513 513
         $list = array();
514 514
         $i = 0;
515 515
         $this->value['saldo'] = 0;
Please login to merge, or discard this patch.
src/Intraface/modules/accounting/VoucherFile.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
             throw new Exception('VoucherFile:: Voucher ikke gyldig');
24 24
         }
25 25
         $this->voucher = $voucher;
26
-        $this->id      = (int) $id;
26
+        $this->id      = (int)$id;
27 27
         $this->error   = new Intraface_Error;
28 28
     }
29 29
 
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
 
50 50
         $db = new DB_Sql();
51 51
         $sql = "SELECT id FROM accounting_voucher_file
52
-            WHERE intranet_id = " . $this->voucher->year->kernel->intranet->get('id') . "
52
+            WHERE intranet_id = " . $this->voucher->year->kernel->intranet->get('id')."
53 53
                 AND belong_to_key = ".array_search($var['belong_to'], $this->what_can_i_belong_to)."
54 54
                 AND belong_to_id = ".$var['belong_to_id']."
55
-                AND voucher_id = ".$this->voucher->getId() . " AND active = 1";
55
+                AND voucher_id = ".$this->voucher->getId()." AND active = 1";
56 56
         $db->query($sql);
57 57
         if ($db->nextRecord()) {
58 58
             // hvis filen allerede er tilknyttet lader vi som om alt gik godt, og vi siger go
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
         if ($this->id > 0) {
64 64
             $sql_type = "UPDATE ";
65
-            $sql_end = " WHERE id = " . $this->id;
65
+            $sql_end = " WHERE id = ".$this->id;
66 66
         } else {
67 67
             $sql_type = "INSERT INTO ";
68 68
             $sql_end = " , date_created = NOW()";
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             $var['description'] = '';
73 73
         }
74 74
 
75
-        $sql = $sql_type . " accounting_voucher_file SET
75
+        $sql = $sql_type." accounting_voucher_file SET
76 76
             date_updated = NOW(),
77 77
             intranet_id = ".$this->voucher->year->kernel->intranet->get('id').",
78 78
             voucher_id = ".$this->voucher->get('id').",
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
     function delete()
91 91
     {
92 92
         $db = new DB_Sql;
93
-        $db->query("UPDATE accounting_voucher_file SET active = 0 WHERE id = " . $this->id);
93
+        $db->query("UPDATE accounting_voucher_file SET active = 0 WHERE id = ".$this->id);
94 94
         return 1;
95 95
     }
96 96
 
97 97
     function undelete()
98 98
     {
99 99
         $db = new DB_Sql;
100
-        $db->query("UPDATE accounting_voucher_file SET active = 1 WHERE id = " . $this->id);
100
+        $db->query("UPDATE accounting_voucher_file SET active = 1 WHERE id = ".$this->id);
101 101
         return 1;
102 102
     }
103 103
 
Please login to merge, or discard this patch.
src/Intraface/modules/accounting/YearEnd.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     private function load()
45 45
     {
46 46
         $db = new DB_Sql;
47
-        $db->query("SELECT * FROM accounting_year_end WHERE year_id = " . $this->year->get('id') . " AND intranet_id =" . $this->year->kernel->intranet->get('id'));
47
+        $db->query("SELECT * FROM accounting_year_end WHERE year_id = ".$this->year->get('id')." AND intranet_id =".$this->year->kernel->intranet->get('id'));
48 48
         if (!$db->nextRecord()) {
49 49
             return 0;
50 50
         }
@@ -62,14 +62,14 @@  discard block
 block discarded – undo
62 62
             return false;
63 63
         }
64 64
         $db = new DB_Sql;
65
-        $db->query("INSERT INTO accounting_year_end SET date_created=NOW(), year_id = " . $this->year->get('id') . ", intranet_id =" .$this->year->kernel->intranet->get('id'));
65
+        $db->query("INSERT INTO accounting_year_end SET date_created=NOW(), year_id = ".$this->year->get('id').", intranet_id =".$this->year->kernel->intranet->get('id'));
66 66
         return true;
67 67
     }
68 68
 
69 69
     function setStep($step)
70 70
     {
71 71
         $db = new DB_Sql;
72
-        $db->query("UPDATE accounting_year_end SET date_updated=NOW(), step_key = " . (int)$step . " WHERE year_id = " . $this->year->get('id'));
72
+        $db->query("UPDATE accounting_year_end SET date_updated=NOW(), step_key = ".(int)$step." WHERE year_id = ".$this->year->get('id'));
73 73
         return true;
74 74
     }
75 75
 
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
         switch ($action) {
81 81
             // bruges i forbindelse med nulstilling af resultatkontoen
82 82
             case 'operating_reset':
83
-                $db->query("UPDATE accounting_year_end SET date_updated=NOW(), operating_reset_voucher_id = " . (int)$voucher_id . " WHERE year_id = " . $this->year->get('id'));
83
+                $db->query("UPDATE accounting_year_end SET date_updated=NOW(), operating_reset_voucher_id = ".(int)$voucher_id." WHERE year_id = ".$this->year->get('id'));
84 84
                 return true;
85 85
                 break;
86 86
             // bruges i forbindelse med overførelse af kapitalkontoen
87 87
             case 'result_account_reset':
88
-                $db->query("UPDATE accounting_year_end SET date_updated=NOW(), result_account_reset_voucher_id = " . (int)$voucher_id . " WHERE year_id = " . $this->year->get('id'));
88
+                $db->query("UPDATE accounting_year_end SET date_updated=NOW(), result_account_reset_voucher_id = ".(int)$voucher_id." WHERE year_id = ".$this->year->get('id'));
89 89
                 return true;
90 90
                 break;
91 91
 
@@ -117,14 +117,14 @@  discard block
 block discarded – undo
117 117
     function deleteStatedAction($id)
118 118
     {
119 119
         $db = new DB_Sql;
120
-        $db->query("DELETE FROM accounting_year_end_action WHERE id = " . (int)$id);
120
+        $db->query("DELETE FROM accounting_year_end_action WHERE id = ".(int)$id);
121 121
         return true;
122 122
     }
123 123
 
124 124
     function getStatedActions($action)
125 125
     {
126 126
         $db = new DB_Sql;
127
-        $db->query("SELECT * FROM accounting_year_end_action WHERE year_id = " . $this->year->get('id') . " AND type_key = ".array_search($action, $this->actions)." AND intranet_id = " . $this->year->kernel->intranet->get('id'));
127
+        $db->query("SELECT * FROM accounting_year_end_action WHERE year_id = ".$this->year->get('id')." AND type_key = ".array_search($action, $this->actions)." AND intranet_id = ".$this->year->kernel->intranet->get('id'));
128 128
         $actions = array();
129 129
         $i = 0;
130 130
         while ($db->nextRecord()) {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
     function flushStatement($type)
144 144
     {
145 145
         $db = new DB_Sql;
146
-        $db->query("DELETE FROM accounting_year_end_statement WHERE intranet_id = ".$this->year->kernel->intranet->get('id')." AND year_id = " . $this->year->get('id') . " AND type_key = " . array_search($type, $this->types));
146
+        $db->query("DELETE FROM accounting_year_end_statement WHERE intranet_id = ".$this->year->kernel->intranet->get('id')." AND year_id = ".$this->year->get('id')." AND type_key = ".array_search($type, $this->types));
147 147
         return true;
148 148
     }
149 149
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         $db = new DB_Sql;
180 180
         $db2 = new DB_Sql;
181 181
 
182
-        $db->query("SELECT id FROM accounting_account WHERE year_id = " .$this->year->get('id'). " AND intranet_id = " . $this->year->kernel->intranet->get('id') . " AND number >= " . $account_start->get('number') . " AND number <= " . $account_end->get('number') . " ORDER BY number ASC");
182
+        $db->query("SELECT id FROM accounting_account WHERE year_id = ".$this->year->get('id')." AND intranet_id = ".$this->year->kernel->intranet->get('id')." AND number >= ".$account_start->get('number')." AND number <= ".$account_end->get('number')." ORDER BY number ASC");
183 183
 
184 184
         while ($db->nextRecord()) {
185 185
             $account = new Account($this->year, $db->f('id'));
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
             // vi vender sgu lige fortegnet, så udgifter får negativt fortegn
189 189
             // og indtægter positivt fortegn
190
-            $db2->query("INSERT INTO accounting_year_end_statement SET type_key = ".array_search($type, $this->types).", intranet_id = ".$this->year->kernel->intranet->get('id').", year_id = ".$this->year->get('id').", account_id = " . $account->get('id') . ", amount = '".-1 * $account->get('saldo')."'");
190
+            $db2->query("INSERT INTO accounting_year_end_statement SET type_key = ".array_search($type, $this->types).", intranet_id = ".$this->year->kernel->intranet->get('id').", year_id = ".$this->year->get('id').", account_id = ".$account->get('id').", amount = '".-1*$account->get('saldo')."'");
191 191
         }
192 192
 
193 193
         return true;
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
                         'debet_account_number' => $debet_account->get('number'),
291 291
                         'credit_account_number' => $credit_account->get('number'),
292 292
                         'amount' => amountToForm($a['amount']),
293
-                        'text' => 'Modpostering: ' . $debet_account->get('name') . ' og ' . $credit_account->get('name'),
293
+                        'text' => 'Modpostering: '.$debet_account->get('name').' og '.$credit_account->get('name'),
294 294
                         'vat_off' => 1
295 295
 
296 296
                     );
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
                             'debet_account_number' => $result_account->get('number'),
329 329
                             'credit_account_number' => $account->get('number'),
330 330
                             'amount' => amountToForm(abs($account->get('saldo'))), // amountToFrom necessary to get the correct format for daybook
331
-                            'text' => $account->get('name') . ' til resultatkontoen',
331
+                            'text' => $account->get('name').' til resultatkontoen',
332 332
                             'vat_off' => 1
333 333
 
334 334
                         );
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
                             'debet_account_number' => $account->get('number'),
341 341
                             'credit_account_number' => $result_account->get('number'),
342 342
                             'amount' => amountToForm(abs($account->get('saldo'))), // amountToFrom necessary to get the correct format for daybook
343
-                            'text' => $account->get('name') . ' til resultatkontoen',
343
+                            'text' => $account->get('name').' til resultatkontoen',
344 344
                             'vat_off' => 1
345 345
                         );
346 346
                         $debet_account = $account;
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
                         'debet_account_number' => $debet_account->get('number'),
422 422
                         'credit_account_number' => $credit_account->get('number'),
423 423
                         'amount' => amountToForm($a['amount']),
424
-                        'text' => 'Modpostering: ' . $debet_account->get('name') . ' og ' . $credit_account->get('name'),
424
+                        'text' => 'Modpostering: '.$debet_account->get('name').' og '.$credit_account->get('name'),
425 425
                         'vat_off' => 1
426 426
 
427 427
                     );
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
                         'debet_account_number' => $result_account->get('number'),
457 457
                         'credit_account_number' => $capital_account->get('number'),
458 458
                         'amount' => abs(amountToForm($result_account->get('saldo'))), // amountToFrom necessary to get the correct format for daybook
459
-                        'text' => $result_account->get('name') . ' nulstilles',
459
+                        'text' => $result_account->get('name').' nulstilles',
460 460
                         'vat_off' => 1
461 461
 
462 462
                     );
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
                         'debet_account_number' => $capital_account->get('number'),
469 469
                         'credit_account_number' => $result_account->get('number'),
470 470
                         'amount' => abs(amountToForm($result_account->get('saldo'))), // amountToFrom necessary to get the correct format for daybook
471
-                        'text' => $result_account->get('name') . ' nulstilles',
471
+                        'text' => $result_account->get('name').' nulstilles',
472 472
                         'vat_off' => 1
473 473
                     );
474 474
                     $debet_account = $capital_account;
Please login to merge, or discard this patch.
src/Intraface/modules/accounting/Year.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                 DATE_FORMAT(to_date, '%d-%m-%Y') AS to_date_dk,
145 145
                 last_year_id, from_date, to_date, locked, label, vat
146 146
             FROM accounting_year
147
-            WHERE id = '" . $this->id . "'
147
+            WHERE id = '" . $this->id."'
148 148
                 AND intranet_id = ".$this->kernel->intranet->get('id')."
149 149
             LIMIT 1";
150 150
 
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
         }
213 213
 
214 214
         if ($this->id > 0) {
215
-            $sql="UPDATE accounting_year ";
216
-            $sql_after=" WHERE id='".$this->id."' AND intranet_id = ".$this->kernel->intranet->get('id')."";
215
+            $sql = "UPDATE accounting_year ";
216
+            $sql_after = " WHERE id='".$this->id."' AND intranet_id = ".$this->kernel->intranet->get('id')."";
217 217
         } else {
218
-            $sql="INSERT INTO accounting_year ";
218
+            $sql = "INSERT INTO accounting_year ";
219 219
             $sql_after = ', date_created = NOW()';
220 220
         }
221
-        $sql.=" SET
221
+        $sql .= " SET
222 222
             intranet_id='".$this->kernel->intranet->get('id')."',
223 223
             user_id='".$this->kernel->user->get('id')."',
224 224
             last_year_id='".$var['last_year_id']."',
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
     {
260 260
         $sql = "SELECT id FROM accounting_year
261 261
             WHERE id = ".$this->id."
262
-                AND intranet_id = ". $this->kernel->intranet->get('id') . " AND active = 1";
262
+                AND intranet_id = ". $this->kernel->intranet->get('id')." AND active = 1";
263 263
 
264 264
         $db = new DB_Sql;
265 265
         $db->query($sql);
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
     public function isYearOpen()
292 292
     {
293 293
         $db = new Db_Sql;
294
-        $db->query("SELECT locked FROM accounting_year WHERE id = " . $this->id . " AND intranet_id = ".$this->kernel->intranet->get('id'));
294
+        $db->query("SELECT locked FROM accounting_year WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id'));
295 295
         if ($db->nextRecord()) {
296 296
             if ($db->f('locked') == 1) {
297 297
                 return false;
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         $date = safeToDb($date);
317 317
 
318 318
         $db = new Db_Sql;
319
-        $db->query("SELECT from_date, to_date FROM accounting_year WHERE id= " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id') . " LIMIT 1");
319
+        $db->query("SELECT from_date, to_date FROM accounting_year WHERE id= ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')." LIMIT 1");
320 320
         if ($db->nextRecord()) {
321 321
             if ($db->f('from_date') <= $date and $date <= $db->f('to_date')) {
322 322
                 return true;
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 
404 404
         if (!empty($balance_accounts) and count($balance_accounts) > 0) {
405 405
             foreach ($balance_accounts as $account) {
406
-                $sql_where .= "id = " . $account . " OR ";
406
+                $sql_where .= "id = ".$account." OR ";
407 407
             }
408 408
         }
409 409
         // hvis der ikke er nogen balance_accounts skal den ikke v�lge nogen poster
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
         $db = new DB_Sql;
413 413
         $db->query("SELECT id FROM accounting_account
414 414
             WHERE (".$sql_where.")
415
-            	AND intranet_id = " . $this->kernel->intranet->get('id') . "
415
+            	AND intranet_id = " . $this->kernel->intranet->get('id')."
416 416
             	AND year_id = " . $this->get('id'));
417 417
 
418 418
         $accounts = array(); // afstemningskonti
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 
442 442
     function getSetting($setting)
443 443
     {
444
-        return $this->kernel->getSetting()->get('intranet', 'accounting.' . $setting, $this->get('id'));
444
+        return $this->kernel->getSetting()->get('intranet', 'accounting.'.$setting, $this->get('id'));
445 445
     }
446 446
 
447 447
     function createAccounts($type, $last_year_id = 0)
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 
489 489
                     // settings
490 490
                     if (!empty($input['setting'])) {
491
-                        $this->setSetting($input['setting'] . '_account_id', $id);
491
+                        $this->setSetting($input['setting'].'_account_id', $id);
492 492
                     }
493 493
                     if (!empty($input['balance_account']) and $input['balance_account'] == 1) {
494 494
                         $balance_accounts[] = $id;
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
 
570 570
                 if (is_array($balance_accounts)) {
571 571
                     foreach ($balance_accounts as $key => $id) {
572
-                        $db->query("SELECT id FROM accounting_account WHERE year_id = ".$this->get('id')." AND intranet_id = ".$this->kernel->intranet->get('id')." AND created_from_id = " . (int)$id);
572
+                        $db->query("SELECT id FROM accounting_account WHERE year_id = ".$this->get('id')." AND intranet_id = ".$this->kernel->intranet->get('id')." AND created_from_id = ".(int)$id);
573 573
                         while ($db->nextRecord()) {
574 574
                             $new_balance_accounts[] = $db->f('id');
575 575
                         }
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 
585 585
                 if (is_array($buy_eu_accounts)) {
586 586
                     foreach ($buy_eu_accounts as $key => $id) {
587
-                        $db->query("SELECT id FROM accounting_account WHERE year_id = ".$this->get('id')." AND intranet_id = ".$this->kernel->intranet->get('id')." AND created_from_id = " . (int)$id);
587
+                        $db->query("SELECT id FROM accounting_account WHERE year_id = ".$this->get('id')." AND intranet_id = ".$this->kernel->intranet->get('id')." AND created_from_id = ".(int)$id);
588 588
                         while ($db->nextRecord()) {
589 589
                             $new_buy_eu_accounts[] = $db->f('id');
590 590
                         }
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 
600 600
                 if (is_array($buy_abroad_accounts)) {
601 601
                     foreach ($buy_abroad_accounts as $key => $id) {
602
-                        $db->query("SELECT id FROM accounting_account WHERE year_id = ".$this->get('id')." AND intranet_id = ".$this->kernel->intranet->get('id')." AND created_from_id = " . (int)$id);
602
+                        $db->query("SELECT id FROM accounting_account WHERE year_id = ".$this->get('id')." AND intranet_id = ".$this->kernel->intranet->get('id')." AND created_from_id = ".(int)$id);
603 603
                         while ($db->nextRecord()) {
604 604
                             $new_buy_abroad_accounts[] = $db->f('id');
605 605
                         }
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
     {
749 749
         $account_id = $from_year->getSetting($setting);
750 750
         $db = new DB_Sql;
751
-        $db->query("SELECT id FROM accounting_account WHERE year_id = ".$this->get('id')." AND intranet_id = ".$this->kernel->intranet->get('id')." AND created_from_id = " . $account_id);
751
+        $db->query("SELECT id FROM accounting_account WHERE year_id = ".$this->get('id')." AND intranet_id = ".$this->kernel->intranet->get('id')." AND created_from_id = ".$account_id);
752 752
         if ($db->nextRecord()) {
753 753
             $this->setSetting($setting, $db->f('id'));
754 754
         }
@@ -826,9 +826,9 @@  discard block
 block discarded – undo
826 826
         }
827 827
         $db = new DB_Sql;
828 828
         $sql = "SELECT id FROM debtor
829
-            WHERE type= " . $type_key . "
830
-                AND intranet_id = " .$this->kernel->intranet->get('id') . "
831
-                AND (this_date BETWEEN '" . $date_start . "' AND '" .$date_end . "')
829
+            WHERE type= " . $type_key."
830
+                AND intranet_id = " .$this->kernel->intranet->get('id')."
831
+                AND (this_date BETWEEN '" . $date_start."' AND '".$date_end."')
832 832
                 AND voucher_id = 0
833 833
                 AND active = 1";
834 834
         $db->query($sql);
@@ -842,8 +842,8 @@  discard block
 block discarded – undo
842 842
     {
843 843
         $db = new DB_Sql;
844 844
         $sql = "SELECT id FROM invoice_payment
845
-            WHERE intranet_id = " .$this->kernel->intranet->get('id') . "
846
-                AND (payment_date BETWEEN '" . $date_start . "' AND '" .$date_end . "')
845
+            WHERE intranet_id = " .$this->kernel->intranet->get('id')."
846
+                AND (payment_date BETWEEN '" . $date_start."' AND '".$date_end."')
847 847
                 AND voucher_id = 0";
848 848
         $db->query($sql);
849 849
         if ($db->numRows() == 0) {
@@ -856,8 +856,8 @@  discard block
 block discarded – undo
856 856
     {
857 857
         $db = new DB_Sql;
858 858
         $sql = "SELECT id FROM procurement
859
-            WHERE intranet_id = " .$this->kernel->intranet->get('id') . "
860
-                AND (invoice_date BETWEEN '" . $date_start . "' AND '" .$date_end . "')
859
+            WHERE intranet_id = " .$this->kernel->intranet->get('id')."
860
+                AND (invoice_date BETWEEN '" . $date_start."' AND '".$date_end."')
861 861
                 AND voucher_id = 0
862 862
                 AND active = 1";
863 863
         $db->query($sql);
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
     function lock()
871 871
     {
872 872
         $db = new DB_Sql;
873
-        $db->query("UPDATE accounting_year SET locked = 1 WHERE id = " . $this->id);
873
+        $db->query("UPDATE accounting_year SET locked = 1 WHERE id = ".$this->id);
874 874
         return true;
875 875
     }
876 876
 
Please login to merge, or discard this patch.
src/Intraface/modules/accounting/Controller/templates/vat/show.tpl.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     <?php echo $context->getError()->view(); ?>
12 12
 
13 13
     <?php if ($context->getVatPeriod()->get('status') == 'stated') : ?>
14
-        <p class="message">Denne momsopgivelse er bogført. <a href="<?php e(url('../../voucher/' . $context->getVatPeriod()->get('voucher_id'))); ?>">Se bilag</a></p>
14
+        <p class="message">Denne momsopgivelse er bogført. <a href="<?php e(url('../../voucher/'.$context->getVatPeriod()->get('voucher_id'))); ?>">Se bilag</a></p>
15 15
     <?php endif; ?>
16 16
 
17 17
     <?php if (!$context->getVatPeriod()->compareAmounts() and $context->getVatPeriod()->get('status_key') > 0) : // beløb skal vøre gemt ?>
@@ -45,22 +45,22 @@  discard block
 block discarded – undo
45 45
     </thead>
46 46
     <tbody>
47 47
         <tr class="vat-sale">
48
-            <td><a href="<?php e(url('../../account/' . $account_vat_out->get('id'))); ?>"><?php e($account_vat_out->get('number')); ?></a></td>
48
+            <td><a href="<?php e(url('../../account/'.$account_vat_out->get('id'))); ?>"><?php e($account_vat_out->get('number')); ?></a></td>
49 49
             <td><?php e($account_vat_out->get('name')); ?></td>
50 50
             <td></td>
51
-            <td class="amount debet"><?php e(amountToOutput($account_vat_out->get('saldo') * -1)); ?></td>
51
+            <td class="amount debet"><?php e(amountToOutput($account_vat_out->get('saldo')*-1)); ?></td>
52 52
         </tr>
53 53
         <tr class="vat-sale">
54
-            <td><a href="<?php e(url('../../account/' . $account_vat_abroad->get('id'))); ?>"><?php e($account_vat_abroad->get('number')); ?></a></td>
54
+            <td><a href="<?php e(url('../../account/'.$account_vat_abroad->get('id'))); ?>"><?php e($account_vat_abroad->get('number')); ?></a></td>
55 55
             <td><?php e($account_vat_abroad->get('name')); ?></td>
56 56
             <td></td>
57
-            <td class="amount debet"><?php e(amountToOutput($account_vat_abroad->get('saldo') * -1)); ?></td>
57
+            <td class="amount debet"><?php e(amountToOutput($account_vat_abroad->get('saldo')*-1)); ?></td>
58 58
         </tr>
59 59
         <tr class="headline">
60 60
             <td colspan="6"><h3>Fradrag</h3></td>
61 61
         </tr>
62 62
         <tr class="vat-buy">
63
-            <td><a href="<?php e(url('../../account/' . $account_vat_in->get('id'))); ?>"><?php e($account_vat_in->get('number')); ?></a></td>
63
+            <td><a href="<?php e(url('../../account/'.$account_vat_in->get('id'))); ?>"><?php e($account_vat_in->get('number')); ?></a></td>
64 64
             <td><?php e($account_vat_in->get('name')); ?></td>
65 65
             <td class="amount debet"><?php e(amountToOutput($account_vat_in->get('saldo'))); ?></td>
66 66
             <td></td>
Please login to merge, or discard this patch.
src/Intraface/modules/accounting/Controller/templates/year/end.tpl.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
         foreach ($vat_periods as $period) {
53 53
             $vat_period = new VatPeriod($context->getYear(), $period['id']);
54 54
             if (!$vat_period->get('voucher_id')) {
55
-                echo '<p class="warning">Momsperiode ' . $vat_period->get('label') . ' er ikke bogført. <a href="'.url('../vat/' . $vat_period->get('id')).'">Fix it at the vat period</a>.</p>';
55
+                echo '<p class="warning">Momsperiode '.$vat_period->get('label').' er ikke bogført. <a href="'.url('../vat/'.$vat_period->get('id')).'">Fix it at the vat period</a>.</p>';
56 56
             } elseif (!$context->getVatPeriod()->compareAmounts()) {
57
-                echo '<p class="warning">Momsperiode ' . $vat_period->get('label') . ' stemmer ikke. <a href="'.url('../vat/' . $vat_period->get('id')).'">Fix it at the vat period</a>.</p>';
57
+                echo '<p class="warning">Momsperiode '.$vat_period->get('label').' stemmer ikke. <a href="'.url('../vat/'.$vat_period->get('id')).'">Fix it at the vat period</a>.</p>';
58 58
             }
59 59
         }
60 60
         ?>
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             <select id="result_account" name="result_account_id">
106 106
                 <option value=""><?php e(t('Choose')); ?></option>
107 107
                 <?php foreach ($status_accounts as $a) { ?>
108
-                    <option value="<?php e($a['id']); ?>"<?php if ($context->getYear()->getSetting('result_account_id')==$a['id']) {
108
+                    <option value="<?php e($a['id']); ?>"<?php if ($context->getYear()->getSetting('result_account_id') == $a['id']) {
109 109
                         echo ' selected="selected"';
110 110
 } ?>><?php e($a['number']); ?> <?php e($a['name']); ?></option>
111 111
                 <?php } ?>
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         <tbody>
133 133
         <?php foreach ($context->getAccount()->getList('drift', true) as $a) : ?>
134 134
             <tr>
135
-                <td><a href="<?php e(url('../../../../account/' . $a['id'])); ?>"><?php e($a['number']); ?></a></td>
135
+                <td><a href="<?php e(url('../../../../account/'.$a['id'])); ?>"><?php e($a['number']); ?></a></td>
136 136
                 <td><?php e($a['name']); ?></td>
137 137
                 <td><?php e(amountToOutput($a['debet'])); ?></td>
138 138
                 <td><?php e(amountToOutput($a['credit'])); ?></td>
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         </fieldset>
182 182
 
183 183
         <ul class="options">
184
-            <li><a class="excel" href="<?php e(url(null) . '.xls'); ?>">Excel</a></li>
184
+            <li><a class="excel" href="<?php e(url(null).'.xls'); ?>">Excel</a></li>
185 185
         </ul>
186 186
         <table>
187 187
             <caption>Resultatopgørelse</caption>
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
             <fieldset>
340 340
                 <legend>Trin 8: Fyraften</legend>
341 341
                 <p>Det er godt arbejde. Nu har du fortjent en pause. Håber ikke det var for vanskeligt. Vi hører naturligvis altid gerne om dine oplevelser med programmet, så vi kan forbedre det mest muligt.</p>
342
-                <p><a class="excel" href="<?php e(url(null) . '.xls'); ?>">Hent årsregnskabet i et regneark</a></p>
342
+                <p><a class="excel" href="<?php e(url(null).'.xls'); ?>">Hent årsregnskabet i et regneark</a></p>
343 343
                 <input type="submit" value="Forrige" name="previous" />
344 344
             </fieldset>
345 345
         <?php
Please login to merge, or discard this patch.