Code Duplication    Length = 54-54 lines in 2 locations

src/CTe/Dacte.php 1 location

@@ 2472-2525 (lines=54) @@
2469
     * @param number $y Posição vertical canto superior
2470
     * @return number Posição vertical final
2471
     */
2472
    protected function zDocCompl($x = 0, $y = 0)
2473
    {
2474
        $oldX = $x;
2475
        $oldY = $y;
2476
        if ($this->orientacao == 'P') {
2477
            $maxW = $this->wPrint;
2478
        } else {
2479
            $maxW = $this->wPrint - $this->wCanhoto;
2480
        }
2481
        $w = $maxW;
2482
        $h = 80;
2483
        $texto = 'DETALHAMENTO DO CT-E COMPLEMENTADO';
2484
        $aFont = $this->formatPadrao;
2485
        $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
2486
        $descr1 = 'CHAVE DO CT-E COMPLEMENTADO';
2487
        $descr2 = 'VALOR COMPLEMENTADO';
2488
        $y += 3.4;
2489
        $this->pdf->Line($x, $y, $w + 1, $y);
2490
        $texto = $descr1;
2491
        $aFont = $this->formatPadrao;
2492
        $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2493
        $yIniDados = $y;
2494
        $x += $w * 0.37;
2495
        $texto = $descr2;
2496
        $aFont = $this->formatPadrao;
2497
        $this->pTextBox($x - 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2498
        $x += $w * 0.13;
2499
        $this->pdf->Line($x, $y, $x, $y + 76.5);
2500
        $texto = $descr1;
2501
        $aFont = $this->formatPadrao;
2502
        $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2503
        $x += $w * 0.3;
2504
        $texto = $descr2;
2505
        $aFont = $this->formatPadrao;
2506
        $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2507
        $auxX = $oldX;
2508
        $yIniDados += 4;
2509
        if ($auxX > $w * 0.90) {
2510
            $yIniDados = $yIniDados + 4;
2511
            $auxX = $oldX;
2512
        }
2513
        $texto = $this->chaveCTeRef;
2514
        $aFont = array(
2515
            'font' => $this->fontePadrao,
2516
            'size' => 8,
2517
            'style' => '');
2518
        $this->pTextBox($auxX, $yIniDados, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2519
        $texto = number_format($this->pSimpleGetValue($this->vPrest, "vTPrest"), 2, ",", ".");
2520
        $aFont = array(
2521
            'font' => $this->fontePadrao,
2522
            'size' => 8,
2523
            'style' => '');
2524
        $this->pTextBox($w * 0.40, $yIniDados, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2525
    } //fim da função zDocCompl
2526
2527
    /**
2528
     * zObs

src/CTe/DacteV3.php 1 location

@@ 2444-2497 (lines=54) @@
2441
     * @param number $y Posição vertical canto superior
2442
     * @return number Posição vertical final
2443
     */
2444
    protected function zDocCompl($x = 0, $y = 0)
2445
    {
2446
        $oldX = $x;
2447
        $oldY = $y;
2448
        if ($this->orientacao == 'P') {
2449
            $maxW = $this->wPrint;
2450
        } else {
2451
            $maxW = $this->wPrint - $this->wCanhoto;
2452
        }
2453
        $w = $maxW;
2454
        $h = 80;
2455
        $texto = 'DETALHAMENTO DO CT-E COMPLEMENTADO';
2456
        $aFont = $this->formatPadrao;
2457
        $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
2458
        $descr1 = 'CHAVE DO CT-E COMPLEMENTADO';
2459
        $descr2 = 'VALOR COMPLEMENTADO';
2460
        $y += 3.4;
2461
        $this->pdf->Line($x, $y, $w + 1, $y);
2462
        $texto = $descr1;
2463
        $aFont = $this->formatPadrao;
2464
        $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2465
        $yIniDados = $y;
2466
        $x += $w * 0.37;
2467
        $texto = $descr2;
2468
        $aFont = $this->formatPadrao;
2469
        $this->pTextBox($x - 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2470
        $x += $w * 0.13;
2471
        $this->pdf->Line($x, $y, $x, $y + 76.5);
2472
        $texto = $descr1;
2473
        $aFont = $this->formatPadrao;
2474
        $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2475
        $x += $w * 0.3;
2476
        $texto = $descr2;
2477
        $aFont = $this->formatPadrao;
2478
        $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2479
        $auxX = $oldX;
2480
        $yIniDados += 4;
2481
        if ($auxX > $w * 0.90) {
2482
            $yIniDados = $yIniDados + 4;
2483
            $auxX = $oldX;
2484
        }
2485
        $texto = $this->chaveCTeRef;
2486
        $aFont = array(
2487
            'font' => $this->fontePadrao,
2488
            'size' => 8,
2489
            'style' => '');
2490
        $this->pTextBox($auxX, $yIniDados, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2491
        $texto = number_format($this->pSimpleGetValue($this->vPrest, "vTPrest"), 2, ",", ".");
2492
        $aFont = array(
2493
            'font' => $this->fontePadrao,
2494
            'size' => 8,
2495
            'style' => '');
2496
        $this->pTextBox($w * 0.40, $yIniDados, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2497
    } //fim da função zDocCompl
2498
2499
    /**
2500
     * zObs