| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  |  * Invoice | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * @package Intraface_Invoice | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * @author Sune Jensen <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  * @author Lars Olesen <[email protected]> | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 8 |  |  |  */ | 
            
                                                                        
                            
            
                                    
            
            
                | 9 |  |  | class Intraface_modules_invoice_Pdf_Reminder extends Intraface_modules_debtor_Pdf | 
            
                                                                        
                            
            
                                    
            
            
                | 10 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |     function __construct($translation, $file = null) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |         parent::__construct($translation, $file); | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 14 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 15 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |     function visit($reminder) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  |         if ($reminder->get('id') == 0) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  |             throw new Exception("Reminder->pdf must be loaded to create a PDF"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |         $this->doc = $this->getDocument(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |  | 
            
                                                                                                            
                            
            
                                                                    
                                                                                                        
            
            
                | 24 |  | View Code Duplication |         if (!empty($this->file) and $this->file->get('id') > 0) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |             $this->doc->addHeader($this->file->get('file_uri_pdf')); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |         $contact = $reminder->contact->address->get(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |         if (isset($reminder->contact_person) and get_class($reminder->contact_person) == "contactperson") { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |             $contact["attention_to"] = $reminder->contact_person->get("name"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |         $contact['number'] = $reminder->contact->get('number'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |         $intranet_address = new Intraface_Address($reminder->get("intranet_address_id")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  |         $intranet = $intranet_address->get(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |         switch ($reminder->kernel->setting->get('intranet', 'debtor.sender')) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |             case 'intranet': | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |                 // void | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |                 break; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |             case 'user': | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |                 $intranet['email'] = $reminder->kernel->user->getAddress()->get('email'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |                 $intranet['contact_person'] = $reminder->kernel->user->getAddress()->get('name'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |                 $intranet['phone'] = $reminder->kernel->user->getAddress()->get('phone'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |                 break; | 
            
                                                                                                            
                            
            
                                                                    
                                                                                                        
            
            
                | 46 |  | View Code Duplication |             case 'defined': | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |                 $intranet['email'] = $reminder->kernel->setting->get('intranet', 'debtor.sender.email'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |                 $intranet['contact_person'] = $reminder->kernel->setting->get('intranet', 'debtor.sender.name'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |                 break; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |         $this->docinfo[0]["label"] = "Dato:"; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |         $this->docinfo[0]["value"] = $reminder->get("dk_this_date"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |         $this->addRecieverAndSender($contact, $intranet, "Reminder about payment", $this->docinfo); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |         $this->doc->setY('-20'); // space to the product list | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |         $text = explode("\r\n", $reminder->get("text")); | 
            
                                                                                                            
                            
            
                                                                    
                                                                                                        
            
            
                | 60 |  | View Code Duplication |         foreach ($text as $line) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  |             if ($line == "") { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |                 $this->doc->setY('-'.$this->doc->get('font_spacing')); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |                 if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |                     $this->doc->nextPage(true); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |                 } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |             } else { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |                 while ($line != "") { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |                     $this->doc->setY('-'.($this->doc->get("font_padding_top") + $this->doc->get("font_size"))); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  |                     $line = $this->doc->addTextWrap($this->doc->get('x'), $this->doc->get('y'), $this->doc->get("right_margin_position") - $this->doc->get('x'), $this->doc->get("font_size"), $line); // $this->doc->get("right_margin_position") - $this->doc->get('x') | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  |                | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |                     $this->doc->setY('-'.$this->doc->get("font_padding_bottom")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  |                     if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  |                         $this->doc->nextPage(true); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |                     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |                 } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  |         // Headlines for products | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  |         $this->doc->setY('-20'); // space to product list | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 |  |  |         if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 3) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  |             $this->doc->nextPage(true); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  |         $apointX["text"] = $this->doc->get("margin_left"); | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  |         $apointX["invoice_date"] = $this->doc->get("right_margin_position") - 225; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  |         $apointX["due_date"] = $this->doc->get("right_margin_position") - 150; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 |  |  |         $apointX["amount"] = $this->doc->get("right_margin_position"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  |         $apointX["text_width"] = $this->doc->get("right_margin_position") - $this->doc->get("margin_left") - $apointX["text"] - 60; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  |         $this->doc->addText($apointX["text"], $this->doc->get('y'), $this->doc->get("font_size"), "Beskrivelse"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  |         $this->doc->addText($apointX["invoice_date"], $this->doc->get('y'), $this->doc->get("font_size"), "Dato"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |         $this->doc->addText($apointX["due_date"], $this->doc->get('y'), $this->doc->get("font_size"), "Forfaldsdato"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  |         $this->doc->addText($apointX["amount"] - $this->doc->getTextWidth($this->doc->get("font_size"), "Beløb") -3, $this->doc->get('y'), $this->doc->get("font_size"), "Bel�b"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  |         $this->doc->setY('-'.($this->doc->get("font_spacing") - $this->doc->get("font_size"))); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  |         $this->doc->line($this->doc->get("margin_left"), $this->doc->get('y'), $this->doc->get("right_margin_position"), $this->doc->get('y')); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 |  |  |         // vareoversigt | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 |  |  |         $reminder->loadItem(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 |  |  |         $items = $reminder->item->getList("invoice"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 109 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 110 |  |  |         $total = 0; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 111 |  |  |         $color = 0; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 112 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 113 |  |  |         for ($i = 0, $max = count($items); $i < $max; $i++) { | 
            
                                                                                                            
                            
            
                                                                    
                                                                                                        
            
            
                | 114 |  | View Code Duplication |             if ($color == 1) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 115 |  |  |                 $this->doc->setColor(0.8, 0.8, 0.8); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 116 |  |  |                 $this->doc->filledRectangle($this->doc->get("margin_left"), $this->doc->get('y') - $this->doc->get("font_spacing"), $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $this->doc->get("font_spacing")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 117 |  |  |                 $this->doc->setColor(0, 0, 0); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 118 |  |  |                 $color = 0; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 119 |  |  |             } else { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 120 |  |  |                 $color = 1; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 121 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 122 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 123 |  |  |             $this->doc->setY('-'.($this->doc->get("font_size") + $this->doc->get("font_padding_top"))); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 124 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 125 |  |  |             $this->doc->addText($apointX["text"], $this->doc->get('y'), $this->doc->get("font_size"), "Faktura nr. ".$items[$i]["number"]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 126 |  |  |             $this->doc->addText($apointX["invoice_date"], $this->doc->get('y'), $this->doc->get("font_size"), $items[$i]["dk_this_date"]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 127 |  |  |             $this->doc->addText($apointX["due_date"], $this->doc->get('y'), $this->doc->get("font_size"), $items[$i]["dk_due_date"]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 128 |  |  |             $this->doc->addText($apointX["amount"] - $this->doc->getTextWidth($this->doc->get("font_size"), number_format($items[$i]["arrears"], 2, ",", ".")), $this->doc->get('y'), $this->doc->get("font_size"), number_format($items[$i]["arrears"], 2, ",", ".")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 129 |  |  |             $this->doc->setY('-'.$this->doc->get("font_padding_bottom")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 130 |  |  |             $total += $items[$i]["arrears"]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 131 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 132 |  |  |             if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 133 |  |  |                 $this->doc->nextPage(true); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 134 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 135 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 136 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 137 |  |  |         $items = $reminder->item->getList("reminder"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 138 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 139 |  |  |         for ($i = 0, $max = count($items); $i < $max; $i++) { | 
            
                                                                                                            
                            
            
                                                                    
                                                                                                        
            
            
                | 140 |  | View Code Duplication |             if ($color == 1) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 141 |  |  |                 $this->doc->setColor(0.8, 0.8, 0.8); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 142 |  |  |                 $this->doc->filledRectangle($this->doc->get("margin_left"), $this->doc->get('y') - $this->doc->get("font_spacing"), $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $this->doc->get("font_spacing")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 143 |  |  |                 $this->doc->setColor(0, 0, 0); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 144 |  |  |                 $color = 0; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 145 |  |  |             } else { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 146 |  |  |                 $color = 1; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 147 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 148 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 149 |  |  |             $this->doc->setY('-'.($this->doc->get("font_size") + $this->doc->get("font_padding_top"))); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 150 |  |  |             $this->doc->addText($apointX["text"], $this->doc->get('y'), $this->doc->get("font_size"), "Rykkkergebyr fra tidligere rykker"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 151 |  |  |             $this->doc->addText($apointX["invoice_date"], $this->doc->get('y'), $this->doc->get("font_size"), $items[$i]["dk_this_date"]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 152 |  |  |             $this->doc->addText($apointX["due_date"], $this->doc->get('y'), $this->doc->get("font_size"), $items[$i]["dk_due_date"]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 153 |  |  |             $this->doc->addText($apointX["amount"] - $this->doc->getTextWidth($this->doc->get("font_size"), number_format($items[$i]["reminder_fee"], 2, ",", ".")), $this->doc->get('y'), $this->doc->get("font_size"), number_format($items[$i]["reminder_fee"], 2, ",", ".")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 154 |  |  |             $this->doc->setY('-'.$this->doc->get("font_padding_bottom")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 155 |  |  |             $total += $items[$i]["reminder_fee"]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 156 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 157 |  |  |             if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 158 |  |  |                 $this->doc->nextPage(true); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 159 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 160 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 161 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 162 |  |  |         if ($reminder->get("reminder_fee") > 0) { | 
            
                                                                                                            
                            
            
                                                                    
                                                                                                        
            
            
                | 163 |  | View Code Duplication |             if ($color == 1) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 164 |  |  |                 $this->doc->setColor(0.8, 0.8, 0.8); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 165 |  |  |                 $this->doc->filledRectangle($this->doc->get("margin_left"), $this->doc->get('y') - $this->doc->get("font_spacing"), $this->doc->get("right_margin_position") - $this->doc->get("margin_left"), $this->doc->get("font_spacing")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 166 |  |  |                 $this->doc->setColor(0, 0, 0); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 167 |  |  |                 $color = 0; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 168 |  |  |             } else { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 169 |  |  |                 $color = 1; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 170 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 171 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 172 |  |  |             $this->doc->setY('-'.($this->doc->get("font_size") + $this->doc->get("font_padding_top"))); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 173 |  |  |             $this->doc->addText($apointX["text"], $this->doc->get('y'), $this->doc->get("font_size"), "Rykkergebyr p�lagt denne rykker"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 174 |  |  |             $this->doc->addText($apointX["amount"] - $this->doc->getTextWidth($this->doc->get("font_size"), number_format($reminder->get("reminder_fee"), 2, ",", ".")), $this->doc->get('y'), $this->doc->get("font_size"), number_format($reminder->get("reminder_fee"), 2, ",", ".")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 175 |  |  |             $this->doc->setY('-'.$this->doc->get("font_padding_bottom")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 176 |  |  |             $total += $reminder->get("reminder_fee"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 177 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 178 |  |  |             if ($this->doc->get('y') < $this->doc->get("margin_bottom") + $this->doc->get("font_spacing") * 2) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 179 |  |  |                 $this->doc->nextPage(true); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 180 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 181 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 182 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 183 |  |  |         $this->doc->setLineStyle(1); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 184 |  |  |         $this->doc->line($this->doc->get("margin_left"), $this->doc->get('y'), $this->doc->get("right_margin_position"), $this->doc->get('y')); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 185 |  |  |         $this->doc->setY('-'.($this->doc->get("font_size") + $this->doc->get("font_padding_top"))); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 186 |  |  |         $this->doc->addText($apointX["due_date"], $this->doc->get('y'), $this->doc->get("font_size"), "<b>Total:</b>"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 187 |  |  |         $this->doc->addText($apointX["amount"] - $this->doc->getTextWidth($this->doc->get("font_size"), "<b>".number_format($total, 2, ",", ".")."</b>"), $this->doc->get('y'), $this->doc->get("font_size"), "<b>".number_format($total, 2, ",", ".")."</b>"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 188 |  |  |         $this->doc->setY('-'.$this->doc->get("font_padding_bottom")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 189 |  |  |         $this->doc->line($apointX["due_date"], $this->doc->get('y'), $this->doc->get("right_margin_position"), $this->doc->get('y')); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 190 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 191 |  |  |         $parameter = array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 192 |  |  |             "contact" => $reminder->contact, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 193 |  |  |             "payment_text" => "Kontakt ".$reminder->contact->get("number"), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 194 |  |  |             "amount" => $total, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 195 |  |  |             "payment" => $reminder->get('payment_total'), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 196 |  |  |             "due_date" => $reminder->get("dk_due_date"), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 197 |  |  |             "girocode" => $reminder->get("girocode")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 198 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 199 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 200 |  |  |         $this->addPaymentCondition($reminder->get("payment_method_key"), $parameter, $reminder->getPaymentInformation()); | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 201 |  |  |     } | 
            
                                                        
            
                                    
            
            
                | 202 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 203 |  |  |  | 
            
                        
PHP has two types of connecting operators (logical operators, and boolean operators):
and&&or||The difference between these is the order in which they are executed. In most cases, you would want to use a boolean operator like
&&, or||.Let’s take a look at a few examples:
Logical Operators are used for Control-Flow
One case where you explicitly want to use logical operators is for control-flow such as this:
Since
dieintroduces problems of its own, f.e. it makes our code hardly testable, and prevents any kind of more sophisticated error handling; you probably do not want to use this in real-world code. Unfortunately, logical operators cannot be combined withthrowat this point:These limitations lead to logical operators rarely being of use in current PHP code.