Code Duplication    Length = 23-23 lines in 2 locations

src/CTe/Dacte.php 1 location

@@ 959-981 (lines=23) @@
956
        }
957
        $aFont = $this->formatPadrao;
958
        $this->pTextBox($x, $y + 7.5, $wa, $h, $texto, $aFont, 'T', 'L', 0, '');
959
        if ($this->zCteDPEC()) {
960
            $texto = $this->numero_registro_dpec;
961
        } elseif ($this->tpEmis == 5) {
962
            $chaveContingencia = $this->zGeraChaveAdicCont();
963
            $aFont = array(
964
                'font' => $this->fontePadrao,
965
                'size' => 8,
966
                'style' => 'B');
967
            $texto = $this->pFormat($chaveContingencia, "#### #### #### #### #### #### #### #### ####");
968
            $cStat = '';
969
        } else {
970
            $texto = $this->pSimpleGetValue($this->protCTe, "nProt") . " - ";
971
            // empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue)
972
            if (!empty($this->protCTe)
973
                && !empty($this->protCTe->getElementsByTagName("dhRecbto")->item(0)->nodeValue)
974
            ) {
975
                $texto .= date(
976
                    'd/m/Y   H:i:s',
977
                    $this->pConvertTime($this->pSimpleGetValue($this->protCTe, "dhRecbto"))
978
                );
979
            }
980
            $texto = $this->pSimpleGetValue($this->protCTe, "nProt") == '' ? '' : $texto;
981
        }
982
        $aFont = $this->formatNegrito;
983
        $this->pTextBox($x, $y + 12, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
984
        //CFOP

src/CTe/DacteV3.php 1 location

@@ 949-971 (lines=23) @@
946
        }
947
        $aFont = $this->formatPadrao;
948
        $this->pTextBox($x, $y + 7.5, $wa, $h, $texto, $aFont, 'T', 'L', 0, '');
949
        if ($this->zCteDPEC()) {
950
            $texto = $this->numero_registro_dpec;
951
        } elseif ($this->tpEmis == 5) {
952
            $chaveContingencia = $this->zGeraChaveAdicCont();
953
            $aFont = array(
954
                'font' => $this->fontePadrao,
955
                'size' => 8,
956
                'style' => 'B');
957
            $texto = $this->pFormat($chaveContingencia, "#### #### #### #### #### #### #### #### ####");
958
            $cStat = '';
959
        } else {
960
            $texto = $this->pSimpleGetValue($this->protCTe, "nProt") . " - ";
961
            // empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue)
962
            if (!empty($this->protCTe)
963
                && !empty($this->protCTe->getElementsByTagName("dhRecbto")->item(0)->nodeValue)
964
            ) {
965
                $texto .= date(
966
                    'd/m/Y   H:i:s',
967
                    $this->pConvertTime($this->pSimpleGetValue($this->protCTe, "dhRecbto"))
968
                );
969
            }
970
            $texto = $this->pSimpleGetValue($this->protCTe, "nProt") == '' ? '' : $texto;
971
        }
972
        $aFont = $this->formatNegrito;
973
        $this->pTextBox($x, $y + 12, $wa, $h, $texto, $aFont, 'T', 'C', 0, '');
974
        //CFOP