Completed
Branch master (6ed6e7)
by Lars
07:57
created
src/Intraface/modules/debtor/Debtor.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
         // Bruges til at afg�re, hvor debtor er sendt hent til
273 273
         $db = new DB_Sql;
274
-        $db->query("SELECT id, type FROM debtor WHERE where_from > 2 AND where_from_id = " . $this->id . " AND active = 1");
274
+        $db->query("SELECT id, type FROM debtor WHERE where_from > 2 AND where_from_id = ".$this->id." AND active = 1");
275 275
         if ($db->nextRecord()) {
276 276
             if ($db->f('type') > 0) {
277 277
                 $types = self::getDebtorTypes();
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         // @todo Currency is always loaded, should be done with left join. Oh give me more doctrine!
306 306
         $currency = $this->getCurrency();
307 307
 
308
-        for ($i = 0, $max = count($item), $total = 0, $total_currency = 0; $i<$max; $i++) {
308
+        for ($i = 0, $max = count($item), $total = 0, $total_currency = 0; $i < $max; $i++) {
309 309
             $total += $item[$i]["amount"]->getAsIso();
310 310
             if ($currency) $total_currency += $item[$i]['amount_currency']->getAsIso();
311 311
         }
@@ -461,12 +461,12 @@  discard block
 block discarded – undo
461 461
             } while ($db->nextRecord());
462 462
 
463 463
             $sql_type = "INSERT INTO ";
464
-            $sql_after = ", date_created = NOW(), identifier_key = \"".$identifier."\", intranet_id = " . $this->kernel->intranet->get('id');
464
+            $sql_after = ", date_created = NOW(), identifier_key = \"".$identifier."\", intranet_id = ".$this->kernel->intranet->get('id');
465 465
         } else {
466 466
             $sql_type = "UPDATE ";
467
-            $sql_after = " WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id');
467
+            $sql_after = " WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id');
468 468
         }
469
-        $sql = $sql_type . "debtor SET contact_id = " . $contact->get('id') . ",
469
+        $sql = $sql_type."debtor SET contact_id = ".$contact->get('id').",
470 470
             contact_address_id = ".$contact_address_id.",
471 471
             contact_person_id = ".$input['contact_person_id'].",
472 472
             intranet_address_id = ".$this->kernel->intranet->address->get("address_id").",
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
             currency_id = ".$currency_id.",
482 482
             currency_product_price_exchange_rate_id = ".$currency_exchange_rate_id.",
483 483
             payment_method=".$input['payment_method'].",
484
-            girocode='".$input['girocode']."' " . $internal_note_sql . $sql_after;
484
+            girocode='".$input['girocode']."' ".$internal_note_sql.$sql_after;
485 485
 
486 486
             // attention_to = '". $input['attention_to'] ."',
487 487
 
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
         }
494 494
 
495 495
         if (is_object($this->kernel->user) AND strtolower(get_class($this->kernel->user)) == 'user') {
496
-            $db->query("UPDATE debtor SET user_id = ".$this->kernel->user->get('id')." WHERE id = " . $this->id);
496
+            $db->query("UPDATE debtor SET user_id = ".$this->kernel->user->get('id')." WHERE id = ".$this->id);
497 497
         }
498 498
 
499 499
         $this->load();
@@ -513,9 +513,9 @@  discard block
 block discarded – undo
513 513
             return false;
514 514
         }
515 515
         $db = new DB_Sql;
516
-        $db->query("SELECT id FROM debtor WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id'). " AND type = '".$this->type_key."' LIMIT 1");
516
+        $db->query("SELECT id FROM debtor WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')." AND type = '".$this->type_key."' LIMIT 1");
517 517
         if ($db->nextRecord()) {
518
-            $db->query("UPDATE debtor SET active = 0 WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id') . "  AND type = '".$this->type_key."'");
518
+            $db->query("UPDATE debtor SET active = 0 WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')."  AND type = '".$this->type_key."'");
519 519
             return true;
520 520
         }
521 521
         return false;
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 
566 566
         switch ($this->type) {
567 567
             case "invoice":
568
-                $values['due_date'] = date("d-m-Y", time() + 24 * 60 * 60 * $debtor_object->contact->get("paymentcondition"));
568
+                $values['due_date'] = date("d-m-Y", time() + 24*60*60*$debtor_object->contact->get("paymentcondition"));
569 569
                 if (empty($values['payment_method']) AND $this->kernel->setting->get('intranet', 'bank_account_number')) {
570 570
                     $values['payment_method'] = 1;
571 571
                 }
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
             if ($status_id === false) {
627 627
                 throw new Exception("Debtor->setStatus(): Ugyldig status (streng)");
628 628
             }
629
-        } else{
629
+        } else {
630 630
             $status_id = intval($status);
631 631
             $status_types = $this->getStatusTypes();
632 632
             if (isset($status_types[$status_id])) {
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
         }
663 663
 
664 664
         $db = new Db_Sql;
665
-        $db->query("UPDATE debtor SET status = ".$status_id.", ".$sql."  WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id'));
665
+        $db->query("UPDATE debtor SET status = ".$status_id.", ".$sql."  WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id'));
666 666
         $this->load();
667 667
 
668 668
         return true;
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
             return false;
690 690
         }
691 691
         $db = new Db_Sql;
692
-        $db->query("UPDATE debtor SET where_from = ".(int)$from.", where_from_id = " . $from_id . " WHERE id = " . $this->id);
692
+        $db->query("UPDATE debtor SET where_from = ".(int)$from.", where_from_id = ".$from_id." WHERE id = ".$this->id);
693 693
         return true;
694 694
     }
695 695
 
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
         }
711 711
         $contact_id = (int)$contact_id;
712 712
         $db = new DB_Sql;
713
-        $db->query("UPDATE debtor SET contact_id = " . $contact_id . " WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get("id") . " AND type='".$this->type_key."'");
713
+        $db->query("UPDATE debtor SET contact_id = ".$contact_id." WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get("id")." AND type='".$this->type_key."'");
714 714
 
715 715
         return true;
716 716
     }
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
             case 'contact':
740 740
                 $sql = "SELECT id
741 741
                 FROM debtor
742
-                    WHERE intranet_id = " . $this->kernel->intranet->get("id") . "
742
+                    WHERE intranet_id = " . $this->kernel->intranet->get("id")."
743 743
                         AND contact_id = ".(int)$type_id."
744 744
               AND type='".$this->type_key."'
745 745
               AND active = 1";
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
     public function isFilledIn()
774 774
     {
775 775
         $db = new DB_Sql;
776
-        $db->query("SELECT id FROM debtor WHERE type = " . $this->type_key . " AND intranet_id = " . $this->kernel->intranet->get('id'));
776
+        $db->query("SELECT id FROM debtor WHERE type = ".$this->type_key." AND intranet_id = ".$this->kernel->intranet->get('id'));
777 777
         return $db->numRows();
778 778
     }
779 779
 
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
     {
979 979
         $number = safeToDb($number);
980 980
         $db = new DB_Sql;
981
-        $sql = "SELECT id FROM debtor WHERE intranet_id = " . $this->kernel->intranet->get('id') . " AND number = '".$number."' AND type = '".$this->type_key."' AND id != " . $this->id." AND active = 1";
981
+        $sql = "SELECT id FROM debtor WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND number = '".$number."' AND type = '".$this->type_key."' AND id != ".$this->id." AND active = 1";
982 982
         $db->query($sql);
983 983
         if ($db->numRows() == 0) {
984 984
             return true;
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
     {
1064 1064
         // FIXME - check on date
1065 1065
         $db = new DB_Sql;
1066
-        $db->query("UPDATE debtor SET date_stated = '" . $voucher_date . "', voucher_id = '".$voucher_id."' WHERE id = " . $this->id . " AND intranet_id = " . $this->kernel->intranet->get('id'));
1066
+        $db->query("UPDATE debtor SET date_stated = '".$voucher_date."', voucher_id = '".$voucher_id."' WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id'));
1067 1067
         return true;
1068 1068
     }
1069 1069
 
@@ -1307,6 +1307,6 @@  discard block
 block discarded – undo
1307 1307
 
1308 1308
     function getPaymentLink($url)
1309 1309
     {
1310
-        return $url . $this->getIdentifier();
1310
+        return $url.$this->getIdentifier();
1311 1311
     }
1312 1312
 }
1313 1313
\ No newline at end of file
Please login to merge, or discard this patch.
src/Intraface/modules/debtor/Visitor/Text.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
                 $currency_iso_code = 'DKK';
14 14
             }
15 15
 
16
-            $table->addRow(array(round($item["quantity"]), substr($item["name"], 0, 40), $currency_iso_code.' ' . $amount));
16
+            $table->addRow(array(round($item["quantity"]), substr($item["name"], 0, 40), $currency_iso_code.' '.$amount));
17 17
         }
18 18
         return $table->getTable();
19 19
     }
Please login to merge, or discard this patch.
src/Intraface/modules/debtor/Visitor/OIOXML.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
     private function start()
41 41
     {
42
-        $this->output .= '<?xml version="1.0" encoding="iso-8859-1"?>' . "\n";
43
-        $this->output .= '<Invoice xmlns="http://rep.oio.dk/ubl/xml/schemas/0p71/pie/" xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/" xmlns:main="http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://rep.oio.dk/ubl/xml/schemas/0p71/pie/ http://rep.oio.dk/ubl/xml/schemas/0p71/pie/pieStrict.xsd">' . "\n";
42
+        $this->output .= '<?xml version="1.0" encoding="iso-8859-1"?>'."\n";
43
+        $this->output .= '<Invoice xmlns="http://rep.oio.dk/ubl/xml/schemas/0p71/pie/" xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/" xmlns:main="http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://rep.oio.dk/ubl/xml/schemas/0p71/pie/ http://rep.oio.dk/ubl/xml/schemas/0p71/pie/pieStrict.xsd">'."\n";
44 44
     }
45 45
 
46 46
     private function end()
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     public function output($debtor)
52 52
     {
53 53
         $this->start();
54
-        $this->output .= '<com:ID>'.$debtor->get('id').'</com:ID>' . "\n";
54
+        $this->output .= '<com:ID>'.$debtor->get('id').'</com:ID>'."\n";
55 55
         $this->output .= '<com:IssueDate>'.$debtor->get('date_due').'</com:IssueDate>';
56 56
         $this->output .= '<com:TypeCode>PIE</com:TypeCode>';
57 57
         $this->output .= '<main:InvoiceCurrencyCode>DKK</main:InvoiceCurrencyCode>';
Please login to merge, or discard this patch.
src/Intraface/modules/debtor/Visitor/Pdf.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
         $this->doc->setY('-'.$this->doc->get("font_spacing"));
76 76
 
77
-        if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) {
77
+        if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) {
78 78
             $this->doc->nextPage(true);
79 79
         }
80 80
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             foreach ($text AS $line) {
84 84
                 if ($line == "") {
85 85
                     $this->doc->setY('-'.$this->doc->get("font_spacing"));
86
-                    if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) {
86
+                    if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) {
87 87
                         $this->doc->nextPage(true);
88 88
                     }
89 89
                 } else {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
                         $this->doc->setY('-'.($this->doc->get("font_padding_top") + $this->doc->get("font_size")));
92 92
                         $line = $this->doc->addTextWrap($this->doc->get('margin_left'), $this->doc->get('y'), $this->doc->get('content_width'), $this->doc->get("font_size"), $line);
93 93
                         $this->doc->setY('-'.$this->doc->get("font_padding_bottom"));
94
-                        if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) {
94
+                        if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) {
95 95
                             $this->doc->nextPage(true);
96 96
                         }
97 97
                     }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         $this->doc->addText($apointX["tekst"], $this->doc->get('y'), $this->doc->get("font_size"), "Tekst");
117 117
         $this->doc->addText($apointX["antal"] - $this->doc->getTextWidth($this->doc->get("font_size"), "Antal"), $this->doc->get('y'), $this->doc->get("font_size"), "Antal");
118 118
         $this->doc->addText($apointX["pris"] - $this->doc->getTextWidth($this->doc->get("font_size"), "Pris"), $this->doc->get('y'), $this->doc->get("font_size"), "Pris");
119
-        $this->doc->addText($apointX["beloeb"] - $this->doc->getTextWidth($this->doc->get("font_size"), "Beløb") -3, $this->doc->get('y'), $this->doc->get("font_size"), "Beløb");
119
+        $this->doc->addText($apointX["beloeb"] - $this->doc->getTextWidth($this->doc->get("font_size"), "Beløb") - 3, $this->doc->get('y'), $this->doc->get("font_size"), "Beløb");
120 120
 
121 121
         $this->doc->setY('-'.($this->doc->get("font_spacing") - $this->doc->get("font_size")));
122 122
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
         $bg_color = 0;
140 140
 
141
-        for ($i = 0, $max = count($items); $i <  $max; $i++) {
141
+        for ($i = 0, $max = count($items); $i < $max; $i++) {
142 142
             $vat = $items[$i]["vat"];
143 143
 
144 144
             if ($bg_color == 1) {
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
             }
162 162
             
163 163
             if ($debtor->getCurrency()) {
164
-                $amount =  $items[$i]["quantity"] * $items[$i]["price_currency"]->getAsIso(2);
164
+                $amount = $items[$i]["quantity"]*$items[$i]["price_currency"]->getAsIso(2);
165 165
             } else {
166
-                $amount =  $items[$i]["quantity"] * $items[$i]["price"]->getAsIso(2);
166
+                $amount = $items[$i]["quantity"]*$items[$i]["price"]->getAsIso(2);
167 167
             }
168 168
             $total += $amount;
169 169
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
                 $tekst = $this->doc->addTextWrap($apointX["tekst"], $this->doc->get('y'), $apointX["tekst_width_small"], $this->doc->get("font_size"), $tekst);
190 190
                 $this->doc->setY('-'.$this->doc->get("font_padding_bottom"));
191
-                if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) {
191
+                if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) {
192 192
                     $this->doc->nextPage(true);
193 193
                 }
194 194
             }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                             $this->doc->setColor(0, 0, 0);
212 212
                         }
213 213
                         $this->doc->setY('-'.$this->doc->get("font_spacing"));
214
-                        if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) {
214
+                        if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) {
215 215
                             $this->doc->nextPage(true);
216 216
                         }
217 217
                     } else {
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                             $line = $this->doc->addTextWrap($apointX["tekst"], $this->doc->get('y') + 1, $apointX["tekst_width"], $this->doc->get("font_size"), $line); // Ups Ups, hvor kommer '+ 1' fra - jo ser du, ellers kappes det nederste af teksten!
228 228
                             $this->doc->setY('-'.$this->doc->get("font_padding_bottom"));
229 229
 
230
-                            if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) {
230
+                            if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) {
231 231
                                 $this->doc->nextPage(true);
232 232
                             }
233 233
                         }
@@ -236,12 +236,12 @@  discard block
 block discarded – undo
236 236
 
237 237
             }
238 238
 
239
-            if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) {
239
+            if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) {
240 240
                 $this->doc->nextPage(true);
241 241
             }
242 242
 
243 243
             // If products with VAT and next post is without we add VAT.
244
-            if (($vat == 1 && isset($items[$i+1]["vat"]) && $items[$i+1]["vat"] == 0) || ($vat == 1 && $i+1 >= $max)) {
244
+            if (($vat == 1 && isset($items[$i + 1]["vat"]) && $items[$i + 1]["vat"] == 0) || ($vat == 1 && $i + 1 >= $max)) {
245 245
                 // If VAT on current product, but next has no VAT OR if VAT and last product
246 246
 
247 247
                 ($bg_color == 1) ? $bg_color = 0 : $bg_color = 1;
@@ -256,8 +256,8 @@  discard block
 block discarded – undo
256 256
                 $this->doc->line($this->doc->get("margin_left"), $this->doc->get('y'), $this->doc->get('right_margin_position'), $this->doc->get('y'));
257 257
                 $this->doc->setY('-'.($this->doc->get("font_size") + $this->doc->get("font_padding_top")));
258 258
                 $this->doc->addText($apointX["tekst"], $this->doc->get('y'), $this->doc->get("font_size"), "<b>25% moms af ".number_format($total, 2, ",", ".")."</b>");
259
-                $this->doc->addText($apointX["beloeb"] - $this->doc->getTextWidth($this->doc->get("font_size"), "<b>".number_format($total * 0.25, 2, ",", ".")."</b>"), $this->doc->get('y'), $this->doc->get("font_size"), "<b>".number_format($total * 0.25, 2, ",", ".")."</b>");
260
-                $total = $total * 1.25;
259
+                $this->doc->addText($apointX["beloeb"] - $this->doc->getTextWidth($this->doc->get("font_size"), "<b>".number_format($total*0.25, 2, ",", ".")."</b>"), $this->doc->get('y'), $this->doc->get("font_size"), "<b>".number_format($total*0.25, 2, ",", ".")."</b>");
260
+                $total = $total*1.25;
261 261
                 $this->doc->setY('-'.$this->doc->get("font_padding_bottom"));
262 262
                 $this->doc->line($this->doc->get("margin_left"), $this->doc->get('y'), $this->doc->get('right_margin_position'), $this->doc->get('y'));
263 263
                 $this->doc->setLineStyle(1);
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
         }
269 269
 
270 270
 
271
-        if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) {
271
+        if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) {
272 272
             $this->doc->nextPage();
273 273
         }
274 274
 
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
             $total_text = "Total ".$currency_iso_code.":";
294 294
         }
295 295
 
296
-        if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) {
296
+        if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) {
297 297
             $this->doc->nextPage(true);
298 298
         }
299 299
 
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 
331 331
             $this->doc->setY('-'.$this->doc->get("font_spacing"));
332 332
 
333
-            if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) {
333
+            if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) {
334 334
                 $this->doc->nextPage(true);
335 335
             }
336 336
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
             foreach ($text AS $line) {
339 339
                 if ($line == "") {
340 340
                     $this->doc->setY('-'.$this->doc->get("font_spacing"));
341
-                    if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) {
341
+                    if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) {
342 342
                         $this->doc->nextPage(true);
343 343
                     }
344 344
                 } else {
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
                         $line = $this->doc->addTextWrap($this->doc->get('margin_left'), $this->doc->get('y'), $this->doc->get('content_width'), $this->doc->get("font_size"), $line);
348 348
                         $this->doc->setY('-'.$this->doc->get("font_padding_bottom"));
349 349
 
350
-                        if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) {
350
+                        if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing")*2) {
351 351
                             $this->doc->nextPage(true);
352 352
                         }
353 353
                     }
Please login to merge, or discard this patch.
src/Intraface/modules/debtor/DebtorItem.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
         // TODO how do we handle vat? this should return raw prices
229 229
         // and then the tax percent should return the tax to apply
230 230
         // the calculator should handle the final price
231
-        return $this->getProductPrice() * $this->get('quantity');
231
+        return $this->getProductPrice()*$this->get('quantity');
232 232
     }
233 233
 
234 234
     /**
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
      */
239 239
     public function getWeight()
240 240
     {
241
-        return $this->getProductWeight() * $this->get('quantity');
241
+        return $this->getProductWeight()*$this->get('quantity');
242 242
     }
243 243
 
244 244
     /**
@@ -470,14 +470,14 @@  discard block
 block discarded – undo
470 470
                     $variation = $product->getVariation($db->f('product_variation_id'));
471 471
                     $detail = $variation->getDetail($db->f('product_variation_detail_id'));
472 472
                     $item["name"] = $product->get("name").' - '.$variation->getName();
473
-                    $item["number"]= $product->get("number").'.'.$variation->getNumber();
473
+                    $item["number"] = $product->get("number").'.'.$variation->getNumber();
474 474
                     $item["price"] = $detail->getPrice($product);
475 475
                     if ($currency) {
476 476
                         $item['price_currency'] = $detail->getPriceInCurrency($currency, $this->debtor->get('currency_product_price_exchange_rate_id'), $product);
477 477
                     }
478 478
                 } else {
479 479
                     $item["name"] = $product->get("name");
480
-                    $item["number"]= $product->get("number");
480
+                    $item["number"] = $product->get("number");
481 481
                     $item["price"] = $product->getDetails()->getPrice();
482 482
                     if ($currency) {
483 483
                         $item['price_currency'] = $product->getDetails()->getPriceInCurrency($currency, $this->debtor->get('currency_product_price_exchange_rate_id'));
@@ -486,16 +486,16 @@  discard block
 block discarded – undo
486 486
 
487 487
                 if ($product->get("vat") == 0) {
488 488
                     $item_no_vat[$j] = $item;
489
-                    $item_no_vat[$j]["amount"] = new Ilib_Variable_Float($item["quantity"] * $item["price"]->getAsIso(2));
489
+                    $item_no_vat[$j]["amount"] = new Ilib_Variable_Float($item["quantity"]*$item["price"]->getAsIso(2));
490 490
                     if ($currency) {
491
-                        $item_no_vat[$j]["amount_currency"] = new Ilib_Variable_Float($item["quantity"] * $item["price_currency"]->getAsIso(2), 'iso');
491
+                        $item_no_vat[$j]["amount_currency"] = new Ilib_Variable_Float($item["quantity"]*$item["price_currency"]->getAsIso(2), 'iso');
492 492
                     }
493 493
                     $j++;
494 494
                 } else {
495 495
                     $item_with_vat[$i] = $item;
496
-                    $item_with_vat[$i]["amount"] = new Ilib_Variable_Float($item["quantity"] * $item["price"]->getAsIso(2) * 1.25);
496
+                    $item_with_vat[$i]["amount"] = new Ilib_Variable_Float($item["quantity"]*$item["price"]->getAsIso(2)*1.25);
497 497
                     if ($currency) {
498
-                        $item_with_vat[$i]["amount_currency"] = new Ilib_Variable_Float($item["quantity"] * $item["price_currency"]->getAsIso(2) * 1.25, 'iso');
498
+                        $item_with_vat[$i]["amount_currency"] = new Ilib_Variable_Float($item["quantity"]*$item["price_currency"]->getAsIso(2)*1.25, 'iso');
499 499
                     }
500 500
                     $i++;
501 501
                 }
Please login to merge, or discard this patch.
src/Intraface/modules/debtor/DebtorDoctrineGateway.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             ->addWhere('intranet_id = ?', $this->user->getActiveIntranetId());
104 104
 
105 105
         if ($dbquery->checkFilter("contact_id")) {
106
-            $query = $query->addWhere("contact_id = ?",intval($dbquery->getFilter("contact_id")));
106
+            $query = $query->addWhere("contact_id = ?", intval($dbquery->getFilter("contact_id")));
107 107
         }
108 108
 
109 109
         if ($dbquery->checkFilter("text")) {
@@ -204,16 +204,16 @@  discard block
 block discarded – undo
204 204
 
205 205
         switch ($dbquery->getFilter("sorting")) {
206 206
             case 1:
207
-                $query =  $query->addOrderBy('number ASC, item.position');
207
+                $query = $query->addOrderBy('number ASC, item.position');
208 208
                 break;
209 209
             case 2:
210
-                $query =  $query->addOrderBy('contact.number ASC, item.position');
210
+                $query = $query->addOrderBy('contact.number ASC, item.position');
211 211
                 break;
212 212
             case 3:
213
-                $query =  $query->addOrderBy('contact_address.name ASC, item.position');
213
+                $query = $query->addOrderBy('contact_address.name ASC, item.position');
214 214
                 break;
215 215
             default:
216
-                $query =  $query->addOrderBy('number DESC, item.position');
216
+                $query = $query->addOrderBy('number DESC, item.position');
217 217
         }
218 218
 
219 219
 
Please login to merge, or discard this patch.
src/Intraface/modules/debtor/Pdf.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $box_padding_top = 8; // space from top box to first line
88 88
         $box_padding_bottom = 9;
89 89
         $box_width = 275; // ($page_width - $margin_left - 10)/2;
90
-        $box_small_height = $this->doc->get("font_spacing") * 3 + $box_padding_top + $box_padding_bottom + 2;
90
+        $box_small_height = $this->doc->get("font_spacing")*3 + $box_padding_top + $box_padding_bottom + 2;
91 91
 
92 92
         // Write the receiver
93 93
         $this->doc->setY('-'.$this->doc->get("font_spacing")); // $pointY -= $box_padding_top;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                 if ($i == 2) $i = count($line);
152 152
             }
153 153
             $this->doc->addText($this->doc->get('x') + 10, $this->doc->get('y'), $this->doc->get("font_size"), $intranet["postcode"]." ".$intranet["city"]);
154
-            $this->doc->setY('-'.($this->doc->get("font_spacing") * 2)); // $pointY -= $this->doc->get("font_spacing") * 2;
154
+            $this->doc->setY('-'.($this->doc->get("font_spacing")*2)); // $pointY -= $this->doc->get("font_spacing") * 2;
155 155
 
156 156
             $this->doc->addText($this->doc->get('x') + 10, $this->doc->get('y'), $this->doc->get("font_size"), "CVR.:");
157 157
             $this->doc->addText($this->doc->get('x') + 10 + 60, $this->doc->get('y'), $this->doc->get("font_size"), $intranet["cvr"]);
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         if (is_array($docinfo) && count($docinfo) > 0) {
189 189
             $this->doc->setY('-10'); // $pointY -= 10;
190 190
             $box_small_top = $this->doc->get('y');
191
-            $box_small_height = count($docinfo) * $this->doc->get("font_spacing") + $box_padding_top + $box_padding_bottom;
191
+            $box_small_height = count($docinfo)*$this->doc->get("font_spacing") + $box_padding_top + $box_padding_bottom;
192 192
             $this->doc->setY('-'.$box_padding_top); // $pointY -= $box_padding_top;
193 193
 
194 194
             for ($i = 0; $i < count($docinfo); $i++) {
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
             $payment_left = 230;
281 281
             $payment_right = $this->doc->get("right_margin_position") - $this->doc->get("margin_left") - $payment_left;
282 282
 
283
-            if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") + 4 + $payment_line * 3) {
283
+            if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") + 4 + $payment_line*3) {
284 284
                 $this->doc->nextPage(true);
285 285
             }
286 286
 
@@ -298,10 +298,10 @@  discard block
 block discarded – undo
298 298
 
299 299
             if ($payment_method == 1) {
300 300
 
301
-                $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line * 2, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line * 2);
302
-                $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line * 2, $this->doc->get('x') + $payment_left, $this->doc->get('y'));
301
+                $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line*2, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line*2);
302
+                $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line*2, $this->doc->get('x') + $payment_left, $this->doc->get('y'));
303 303
                 $this->doc->line($this->doc->get('x'), $this->doc->get('y') - $payment_line, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line);
304
-                $this->doc->line($this->doc->get('x') + $payment_left / 2, $this->doc->get('y') - $payment_line * 2, $this->doc->get('x') + $payment_left / 2, $this->doc->get('y') - $payment_line);
304
+                $this->doc->line($this->doc->get('x') + $payment_left/2, $this->doc->get('y') - $payment_line*2, $this->doc->get('x') + $payment_left/2, $this->doc->get('y') - $payment_line);
305 305
 
306 306
                 $this->doc->setY('-7'); // $pointY -= 7;
307 307
                 $this->doc->addText($this->doc->get('x') + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Bank:");
@@ -325,9 +325,9 @@  discard block
 block discarded – undo
325 325
                 $this->doc->setValue('y', $payment_start - $payment_line); // Sets exact position
326 326
                 $this->doc->setY('-7'); // $pointY -= 7;
327 327
 
328
-                $this->doc->addText($this->doc->get('x') + $payment_left / 2 + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Betalingsdato:");
328
+                $this->doc->addText($this->doc->get('x') + $payment_left/2 + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Betalingsdato:");
329 329
                 $this->doc->setY('-'.($payment_line - 12));
330
-                $this->doc->addText($this->doc->get('x') + $payment_left / 2 + 10, $this->doc->get('y'), $this->doc->get("font_size"), $parameter["due_date"]);
330
+                $this->doc->addText($this->doc->get('x') + $payment_left/2 + 10, $this->doc->get('y'), $this->doc->get("font_size"), $parameter["due_date"]);
331 331
 
332 332
                 $this->doc->setValue('y', $payment_start - $payment_line); // Sets exact position
333 333
                 $this->doc->setY('-7');
@@ -339,11 +339,11 @@  discard block
 block discarded – undo
339 339
 
340 340
             } elseif ($payment_method == 2) {
341 341
 
342
-                $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line * 3, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line * 3);
343
-                $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line * 3, $this->doc->get('x') + $payment_left, $this->doc->get('y'));
342
+                $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line*3, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line*3);
343
+                $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line*3, $this->doc->get('x') + $payment_left, $this->doc->get('y'));
344 344
                 $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line);
345
-                $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line * 2, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line * 2);
346
-                $this->doc->line($this->doc->get('x') + $payment_left + $payment_right / 2, $this->doc->get('y') - $payment_line * 2, $this->doc->get('x') + $payment_left + $payment_right / 2, $this->doc->get('y') - $payment_line);
345
+                $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line*2, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line*2);
346
+                $this->doc->line($this->doc->get('x') + $payment_left + $payment_right/2, $this->doc->get('y') - $payment_line*2, $this->doc->get('x') + $payment_left + $payment_right/2, $this->doc->get('y') - $payment_line);
347 347
 
348 348
                 $this->doc->setY('-7');
349 349
                 $this->doc->addText($this->doc->get('x') + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Indbetaler:");
@@ -376,11 +376,11 @@  discard block
 block discarded – undo
376 376
                 $this->doc->setValue('y', $payment_start - $payment_line); // Sets exact position
377 377
                 $this->doc->setY('-7');
378 378
 
379
-                $this->doc->addText($this->doc->get('x') + $payment_left + $payment_right / 2 + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Betalingsdato:");
379
+                $this->doc->addText($this->doc->get('x') + $payment_left + $payment_right/2 + 4, $this->doc->get('y'), $this->doc->get("font_size") - 4, "Betalingsdato:");
380 380
                 $this->doc->setY('-'.($payment_line - 12));
381
-                $this->doc->addText($this->doc->get('x') + $payment_left + $payment_right / 2 + 10, $this->doc->get('y'), $this->doc->get("font_size"), $parameter["due_date"]);
381
+                $this->doc->addText($this->doc->get('x') + $payment_left + $payment_right/2 + 10, $this->doc->get('y'), $this->doc->get("font_size"), $parameter["due_date"]);
382 382
 
383
-                $this->doc->setValue('y', $payment_start - $payment_line * 2); // Sets exact position
383
+                $this->doc->setValue('y', $payment_start - $payment_line*2); // Sets exact position
384 384
                 $this->doc->setY('-7');
385 385
 
386 386
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
                 $this->doc->addText($this->doc->get('x') + $payment_left + 10, $this->doc->get('y'), $this->doc->get('font_size'), $this_text);
393 393
             } elseif ($payment_method == 3) {
394 394
 
395
-                $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line * 2, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line * 2);
395
+                $this->doc->rectangle($this->doc->get('x'), $this->doc->get('y') - $payment_line*2, $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $payment_line*2);
396 396
                 $this->doc->line($this->doc->get("margin_left"), $this->doc->get('y') - $payment_line, $this->doc->get("right_margin_position"), $this->doc->get('y') - $payment_line);
397 397
                 $this->doc->line($this->doc->get('x') + $payment_left, $this->doc->get('y'), $this->doc->get('x') + $payment_left, $this->doc->get('y') - $payment_line);
398 398
 
Please login to merge, or discard this patch.
src/Intraface/modules/debtor/Debtor/Item.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
      */
90 90
     public function getAmount()
91 91
     {
92
-        return new Ilib_Variable_Float($this->getQuantity()->getAsIso(2) * $this->getProductPriceObject()->getPriceIncludingVat($this->getProduct())->getAsIso(2), 'iso');
92
+        return new Ilib_Variable_Float($this->getQuantity()->getAsIso(2)*$this->getProductPriceObject()->getPriceIncludingVat($this->getProduct())->getAsIso(2), 'iso');
93 93
     }
94 94
     
95 95
     public function getQuantity()
Please login to merge, or discard this patch.
src/Intraface/modules/debtor/Controller/Depreciations.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         $depreciation = $this->getDepreciation();
53 53
         if ($id = $depreciation->update($_POST)) {
54 54
             if ($this->getKernel()->user->hasModuleAccess('accounting')) {
55
-                return new k_SeeOther($this->url($id . '/state'));
55
+                return new k_SeeOther($this->url($id.'/state'));
56 56
             } else {
57 57
                 return new k_SeeOther($this->url('../'));
58 58
             }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     {
65 65
         $invoice_module = $this->getKernel()->useModule('invoice');
66 66
         $depreciation = $this->getDepreciation();
67
-        $smarty = $this->template->create(dirname(__FILE__) . '/templates/depreciation');
67
+        $smarty = $this->template->create(dirname(__FILE__).'/templates/depreciation');
68 68
         return $smarty->render($this);
69 69
     }
70 70
 }
71 71
\ No newline at end of file
Please login to merge, or discard this patch.