Code Duplication    Length = 8-8 lines in 2 locations

src/Intraface/modules/debtor/Controller/Create.php 1 location

@@ 37-44 (lines=8) @@
34
        $debtor = $this->getDebtor();
35
        $contact = new Contact($this->getKernel(), $this->body("contact_id"));
36
37
        if ($this->body("contact_person_id") == "-1") {
38
            $contact_person = new ContactPerson($contact);
39
            $person["name"] = $_POST['contact_person_name'];
40
            $person["email"] = $_POST['contact_person_email'];
41
            $contact_person->save($person);
42
            $contact_person->load();
43
            $_POST["contact_person_id"] = $contact_person->get("id");
44
        }
45
46
        if ($this->getKernel()->intranet->hasModuleAccess('currency') && $this->body('currency_id')) {
47
            $currency_module = $this->getKernel()->useModule('currency', false); // false = ignore user access

src/Intraface/modules/debtor/Controller/Show.php 1 location

@@ 427-434 (lines=8) @@
424
            $debtor = $this->getDebtor();
425
            $contact = new Contact($this->getKernel(), $_POST["contact_id"]);
426
427
            if ($this->body("contact_person_id") == "-1") {
428
                $contact_person = new ContactPerson($contact);
429
                $person["name"] = $_POST['contact_person_name'];
430
                $person["email"] = $_POST['contact_person_email'];
431
                $contact_person->save($person);
432
                $contact_person->load();
433
                $_POST["contact_person_id"] = $contact_person->get("id");
434
            }
435
436
            if ($this->getKernel()->intranet->hasModuleAccess('currency') && $this->body('currency_id')) {
437
                $currency_module = $this->getKernel()->useModule('currency', false); // false = ignore user access