Code Duplication    Length = 6-6 lines in 2 locations

src/Intraface/modules/debtor/Controller/Show.php 2 locations

@@ 100-105 (lines=6) @@
97
            $filehandler = new FileHandler($this->getKernel());
98
            $tmp_file = $filehandler->createTemporaryFile($this->t($this->getDebtor()->get("type")).$this->getDebtor()->get('number').'.pdf');
99
100
            if (($this->getDebtor()->get("type") == "order" || $this->getDebtor()->get("type") == "invoice") && $this->getKernel()->intranet->hasModuleAccess('onlinepayment')) {
101
                $this->getKernel()->useModule('onlinepayment', true); // true: ignore_user_access
102
                $onlinepayment = OnlinePayment::factory($this->getKernel());
103
            } else {
104
                $onlinepayment = null;
105
            }
106
107
            // @todo the language on an invoice should be decided by the contacts preference
108
            $translation = $this->translation;
@@ 615-620 (lines=6) @@
612
613
    function renderPdf()
614
    {
615
        if (($this->getDebtor()->get("type") == "order" || $this->getDebtor()->get("type") == "invoice") && $this->getKernel()->intranet->hasModuleAccess('onlinepayment')) {
616
            $this->getKernel()->useModule('onlinepayment', true); // true: ignore_user_access
617
            $onlinepayment = OnlinePayment::factory($this->getKernel());
618
        } else {
619
            $onlinepayment = null;
620
        }
621
622
        if ($this->getKernel()->intranet->get("pdf_header_file_id") != 0) {
623
            $this->getKernel()->useModule('filemanager');