Code Duplication    Length = 6-11 lines in 7 locations

src/CTe/Dacte.php 1 location

@@ 552-562 (lines=11) @@
549
    {
550
        $oldX = $x;
551
        $oldY = $y;
552
        if ($this->orientacao == 'P') {
553
            $maxW = $this->wPrint;
554
        } else {
555
            if ($pag == 1) {
556
                // primeira página
557
                $maxW = $this->wPrint - $this->wCanhoto;
558
            } else {
559
                // páginas seguintes
560
                $maxW = $this->wPrint;
561
            }
562
        }
563
        //##################################################################
564
        //coluna esquerda identificação do emitente
565
        $w = round($maxW * 0.42);

src/NFe/Danfe.php 5 locations

@@ 670-676 (lines=7) @@
667
            $hdestinatario + ($linhasDup * $hduplicatas) + $himposto + $htransporte +
668
            ($linhaISSQN * $hissqn) + $hdadosadic + $hfooter + $hCabecItens +
669
            $this->pSizeExtraTextoFatura());
670
        if ($this->orientacao == 'P') {
671
            $hDispo1 -= 23 * $this->qCanhoto;//para canhoto
672
            $w = $this->wPrint;
673
        } else {
674
            $hcanhoto = $this->hPrint;//para canhoto
675
            $w = $this->wPrint - $this->wCanhoto;
676
        }
677
        $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens)-4;
678
        //Contagem da altura ocupada para impressão dos itens
679
        $fontProduto = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'');
@@ 983-991 (lines=9) @@
980
    {
981
        $oldX = $x;
982
        $oldY = $y;
983
        if ($this->orientacao == 'P') {
984
              $maxW = $this->wPrint;
985
        } else {
986
            if ($pag == 1) { // primeira página
987
                $maxW = $this->wPrint - $this->wCanhoto;
988
            } else { // páginas seguintes
989
                $maxW = $this->wPrint;
990
            }
991
        }
992
        //####################################################################################
993
        //coluna esquerda identificação do emitente
994
        $w = round($maxW*0.41, 0);
@@ 1801-1807 (lines=7) @@
1798
            $campos_por_linha -= 2;
1799
        }
1800
1801
        if ($this->orientacao == 'P') {
1802
            $maxW = $this->wPrint;
1803
            $title_size = 31;
1804
        } else {
1805
            $maxW = $this->wPrint - $this->wCanhoto;
1806
            $title_size = 40;
1807
        }
1808
        $w = $maxW / $campos_por_linha;
1809
1810
        $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
@@ 2259-2267 (lines=9) @@
2256
        //#####################################################################
2257
        //DADOS DOS PRODUTOS / SERVIÇOS
2258
        $texto = "DADOS DOS PRODUTOS / SERVIÇOS ";
2259
        if ($this->orientacao == 'P') {
2260
            $w = $this->wPrint;
2261
        } else {
2262
            if ($nInicio < 2) { // primeira página
2263
                $w = $this->wPrint - $this->wCanhoto;
2264
            } else { // páginas seguintes
2265
                $w = $this->wPrint;
2266
            }
2267
        }
2268
        $h = 4;
2269
        $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
2270
        $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
@@ 2703-2708 (lines=6) @@
2700
     */
2701
    protected function pRodape($x, $y)
2702
    {
2703
        if ($this->orientacao == 'P') {
2704
              $w = $this->wPrint;
2705
        } else {
2706
              $w = $this->wPrint-$this->wCanhoto;
2707
              $x = $this->wCanhoto;
2708
        }
2709
        $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I');
2710
        $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s');
2711
        $this->pTextBox($x, $y, $w, 0, $texto, $aFont, 'T', 'L', false);

src/CTe/DacteV3.php 1 location

@@ 553-563 (lines=11) @@
550
    {
551
        $oldX = $x;
552
        $oldY = $y;
553
        if ($this->orientacao == 'P') {
554
            $maxW = $this->wPrint;
555
        } else {
556
            if ($pag == 1) {
557
                // primeira página
558
                $maxW = $this->wPrint - $this->wCanhoto;
559
            } else {
560
                // páginas seguintes
561
                $maxW = $this->wPrint;
562
            }
563
        }
564
        //##################################################################
565
        //coluna esquerda identificação do emitente
566
        $w = round($maxW * 0.42);