Code Duplication    Length = 113-113 lines in 2 locations

src/CTe/Dacte.php 1 location

@@ 1991-2103 (lines=113) @@
1988
     * @param  number $y Posição vertical canto superior
1989
     * @return number Posição vertical final
1990
     */
1991
    protected function zImpostos($x = 0, $y = 0)
1992
    {
1993
        $oldX = $x;
1994
        $oldY = $y;
1995
        if ($this->orientacao == 'P') {
1996
            $maxW = $this->wPrint;
1997
        } else {
1998
            $maxW = $this->wPrint - $this->wCanhoto;
1999
        }
2000
        $w = $maxW;
2001
        $h = 13;
2002
        $texto = 'INFORMAÇÕES RELATIVAS AO IMPOSTO';
2003
        $aFont = $this->formatPadrao;
2004
        $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
2005
        
2006
        $y += 3.4;
2007
        $this->pdf->Line($x, $y, $w + 1, $y);
2008
        $texto = 'SITUAÇÃO TRIBUTÁRIA';
2009
        $aFont = $this->formatPadrao;
2010
        $this->pTextBox($x, $y, $w * 0.26, $h, $texto, $aFont, 'T', 'L', 0, '');
2011
        
2012
        $x += $w * 0.26;
2013
        $this->pdf->Line($x, $y, $x, $y + 9.5);
2014
        $texto = 'BASE DE CALCULO';
2015
        $aFont = $this->formatPadrao;
2016
        $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
2017
        
2018
        $wCol02=0.18;
2019
        $x += $w * $wCol02;
2020
        $this->pdf->Line($x, $y, $x, $y + 9.5);
2021
        $texto = 'ALÍQ ICMS';
2022
        $aFont = $this->formatPadrao;
2023
        $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
2024
        
2025
        $x += $w * $wCol02;
2026
        $this->pdf->Line($x, $y, $x, $y + 9.5);
2027
        $texto = 'VALOR ICMS';
2028
        $aFont = $this->formatPadrao;
2029
        $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
2030
        
2031
        $x += $w * $wCol02;
2032
        $this->pdf->Line($x, $y, $x, $y + 9.5);
2033
        $texto = '% RED. BC ICMS';
2034
        $aFont = $this->formatPadrao;
2035
        $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
2036
        
2037
        /*$x += $w * 0.14;
2038
        $this->pdf->Line($x, $y, $x, $y + 9.5);
2039
        $texto = 'ICMS ST';
2040
        $aFont = $this->formatPadrao;
2041
        $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
2042
         * */
2043
        
2044
        $x = $oldX;
2045
        $y = $y + 4;
2046
        $texto = $this->pSimpleGetValue($this->ICMS, "CST");
2047
        switch ($texto) {
2048
            case '00':
2049
                $texto = "00 - Tributação normal ICMS";
2050
                break;
2051
            case '20':
2052
                $texto = "20 - Tributação com BC reduzida do ICMS";
2053
                break;
2054
            case '40':
2055
                $texto = "40 - ICMS isenção";
2056
                break;
2057
            case '41':
2058
                $texto = "41 - ICMS não tributada";
2059
                break;
2060
            case '51':
2061
                $texto = "51 - ICMS diferido";
2062
                break;
2063
            case '60':
2064
                $texto = "60 - ICMS cobrado anteriormente por substituição tributária";
2065
                break;
2066
            case '90':
2067
                $texto = "90 - ICMS outros";
2068
                break;
2069
        }
2070
        $texto .= $this->pSimpleGetValue($this->ICMSSN, "indSN");
2071
        $texto = $texto == 1 ? 'Simples Nacional' : $texto;
2072
        $aFont = $this->formatNegrito;
2073
        $this->pTextBox($x, $y, $w * 0.26, $h, $texto, $aFont, 'T', 'L', 0, '');
2074
        $x += $w * 0.26;
2075
        
2076
        $texto = !empty($this->ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ?
2077
            number_format($this->pSimpleGetValue($this->ICMS, "vBC"), 2, ",", ".") : '';
2078
        $aFont = $this->formatNegrito;
2079
        $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
2080
        $x += $w * $wCol02;
2081
        
2082
        $texto = !empty($this->ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ?
2083
            number_format($this->pSimpleGetValue($this->ICMS, "pICMS"), 2, ",", ".") : '';
2084
        $aFont = $this->formatNegrito;
2085
        $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
2086
        $x += $w * $wCol02;
2087
        
2088
        $texto = !empty($this->ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ?
2089
            number_format($this->pSimpleGetValue($this->ICMS, "vICMS"), 2, ",", ".") : '';
2090
        $aFont = $this->formatNegrito;
2091
        $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
2092
        $x += $w * $wCol02;
2093
        
2094
        $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ?
2095
            number_format($this->pSimpleGetValue($this->ICMS, "pRedBC"), 2, ",", ".").'%' :'';
2096
        $aFont = $this->formatNegrito;
2097
        $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
2098
        
2099
        /*$x += $w * 0.14;
2100
        $texto = '';
2101
        $aFont = $this->formatNegrito;
2102
        $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');*/
2103
    } //fim da função compValorDACTE
2104
2105
    /**
2106
     * zGeraChaveAdicCont

src/CTe/DacteV3.php 1 location

@@ 1965-2077 (lines=113) @@
1962
     * @param  number $y Posição vertical canto superior
1963
     * @return number Posição vertical final
1964
     */
1965
    protected function zImpostos($x = 0, $y = 0)
1966
    {
1967
        $oldX = $x;
1968
        $oldY = $y;
1969
        if ($this->orientacao == 'P') {
1970
            $maxW = $this->wPrint;
1971
        } else {
1972
            $maxW = $this->wPrint - $this->wCanhoto;
1973
        }
1974
        $w = $maxW;
1975
        $h = 13;
1976
        $texto = 'INFORMAÇÕES RELATIVAS AO IMPOSTO';
1977
        $aFont = $this->formatPadrao;
1978
        $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'C', 1, '');
1979
        
1980
        $y += 3.4;
1981
        $this->pdf->Line($x, $y, $w + 1, $y);
1982
        $texto = 'SITUAÇÃO TRIBUTÁRIA';
1983
        $aFont = $this->formatPadrao;
1984
        $this->pTextBox($x, $y, $w * 0.26, $h, $texto, $aFont, 'T', 'L', 0, '');
1985
        
1986
        $x += $w * 0.26;
1987
        $this->pdf->Line($x, $y, $x, $y + 9.5);
1988
        $texto = 'BASE DE CALCULO';
1989
        $aFont = $this->formatPadrao;
1990
        $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
1991
        
1992
        $wCol02=0.18;
1993
        $x += $w * $wCol02;
1994
        $this->pdf->Line($x, $y, $x, $y + 9.5);
1995
        $texto = 'ALÍQ ICMS';
1996
        $aFont = $this->formatPadrao;
1997
        $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
1998
        
1999
        $x += $w * $wCol02;
2000
        $this->pdf->Line($x, $y, $x, $y + 9.5);
2001
        $texto = 'VALOR ICMS';
2002
        $aFont = $this->formatPadrao;
2003
        $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
2004
        
2005
        $x += $w * $wCol02;
2006
        $this->pdf->Line($x, $y, $x, $y + 9.5);
2007
        $texto = '% RED. BC ICMS';
2008
        $aFont = $this->formatPadrao;
2009
        $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
2010
        
2011
        /*$x += $w * 0.14;
2012
        $this->pdf->Line($x, $y, $x, $y + 9.5);
2013
        $texto = 'ICMS ST';
2014
        $aFont = $this->formatPadrao;
2015
        $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');
2016
         * */
2017
        
2018
        $x = $oldX;
2019
        $y = $y + 4;
2020
        $texto = $this->pSimpleGetValue($this->ICMS, "CST");
2021
        switch ($texto) {
2022
            case '00':
2023
                $texto = "00 - Tributação normal ICMS";
2024
                break;
2025
            case '20':
2026
                $texto = "20 - Tributação com BC reduzida do ICMS";
2027
                break;
2028
            case '40':
2029
                $texto = "40 - ICMS isenção";
2030
                break;
2031
            case '41':
2032
                $texto = "41 - ICMS não tributada";
2033
                break;
2034
            case '51':
2035
                $texto = "51 - ICMS diferido";
2036
                break;
2037
            case '60':
2038
                $texto = "60 - ICMS cobrado anteriormente por substituição tributária";
2039
                break;
2040
            case '90':
2041
                $texto = "90 - ICMS outros";
2042
                break;
2043
        }
2044
        $texto .= $this->pSimpleGetValue($this->ICMSSN, "indSN");
2045
        $texto = $texto == 1 ? 'Simples Nacional' : $texto;
2046
        $aFont = $this->formatNegrito;
2047
        $this->pTextBox($x, $y, $w * 0.26, $h, $texto, $aFont, 'T', 'L', 0, '');
2048
        $x += $w * 0.26;
2049
        
2050
        $texto = !empty($this->ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ?
2051
            number_format($this->pSimpleGetValue($this->ICMS, "vBC"), 2, ",", ".") : '';
2052
        $aFont = $this->formatNegrito;
2053
        $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
2054
        $x += $w * $wCol02;
2055
        
2056
        $texto = !empty($this->ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ?
2057
            number_format($this->pSimpleGetValue($this->ICMS, "pICMS"), 2, ",", ".") : '';
2058
        $aFont = $this->formatNegrito;
2059
        $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
2060
        $x += $w * $wCol02;
2061
        
2062
        $texto = !empty($this->ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ?
2063
            number_format($this->pSimpleGetValue($this->ICMS, "vICMS"), 2, ",", ".") : '';
2064
        $aFont = $this->formatNegrito;
2065
        $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
2066
        $x += $w * $wCol02;
2067
        
2068
        $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ?
2069
            number_format($this->pSimpleGetValue($this->ICMS, "pRedBC"), 2, ",", ".").'%' :'';
2070
        $aFont = $this->formatNegrito;
2071
        $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, '');
2072
        
2073
        /*$x += $w * 0.14;
2074
        $texto = '';
2075
        $aFont = $this->formatNegrito;
2076
        $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, '');*/
2077
    } //fim da função compValorDACTE
2078
2079
    /**
2080
     * zGeraChaveAdicCont