@@ -162,6 +162,9 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | /** |
| 164 | 164 | * Imprime barcode 128 |
| 165 | + * @param double $x |
|
| 166 | + * @param double $y |
|
| 167 | + * @param integer $h |
|
| 165 | 168 | */ |
| 166 | 169 | public function code128($x, $y, $code, $w, $h) |
| 167 | 170 | { |
@@ -235,9 +238,9 @@ discard block |
||
| 235 | 238 | |
| 236 | 239 | /** |
| 237 | 240 | * Rotaciona para impressão paisagem (landscape) |
| 238 | - * @param number $angle |
|
| 239 | - * @param number $x |
|
| 240 | - * @param number $y |
|
| 241 | + * @param integer $angle |
|
| 242 | + * @param integer $x |
|
| 243 | + * @param integer $y |
|
| 241 | 244 | */ |
| 242 | 245 | public function rotate($angle, $x = -1, $y = -1) |
| 243 | 246 | { |
@@ -279,7 +282,7 @@ discard block |
||
| 279 | 282 | * @param number $y |
| 280 | 283 | * @param number $w |
| 281 | 284 | * @param number $h |
| 282 | - * @param number $r |
|
| 285 | + * @param double $r |
|
| 283 | 286 | * @param string $corners |
| 284 | 287 | * @param string $style |
| 285 | 288 | */ |
@@ -334,12 +337,12 @@ discard block |
||
| 334 | 337 | |
| 335 | 338 | /** |
| 336 | 339 | * Desenha o arco para arredondar o canto do retangulo |
| 337 | - * @param number $x1 |
|
| 338 | - * @param number $y1 |
|
| 339 | - * @param number $x2 |
|
| 340 | - * @param number $y2 |
|
| 341 | - * @param number $x3 |
|
| 342 | - * @param number $y3 |
|
| 340 | + * @param double $x1 |
|
| 341 | + * @param double $y1 |
|
| 342 | + * @param double $x2 |
|
| 343 | + * @param double $y2 |
|
| 344 | + * @param double $x3 |
|
| 345 | + * @param double $y3 |
|
| 343 | 346 | */ |
| 344 | 347 | private function arc($x1, $y1, $x2, $y2, $x3, $y3) |
| 345 | 348 | { |
@@ -363,8 +366,8 @@ discard block |
||
| 363 | 366 | * @param number $y1 |
| 364 | 367 | * @param number $x2 |
| 365 | 368 | * @param number $y2 |
| 366 | - * @param number $width |
|
| 367 | - * @param number $nb |
|
| 369 | + * @param integer $width |
|
| 370 | + * @param integer $nb |
|
| 368 | 371 | */ |
| 369 | 372 | public function dashedRect($x1, $y1, $x2, $y2, $width = 1, $nb = 15) |
| 370 | 373 | { |
@@ -431,11 +434,11 @@ discard block |
||
| 431 | 434 | * @param number $w |
| 432 | 435 | * @param number $h |
| 433 | 436 | * @param string $txt |
| 434 | - * @param string $border |
|
| 437 | + * @param integer $border |
|
| 435 | 438 | * @param string $align |
| 436 | 439 | * @param boolean $fill |
| 437 | - * @param number $maxline |
|
| 438 | - * @param number $prn |
|
| 440 | + * @param integer $maxline |
|
| 441 | + * @param integer $prn |
|
| 439 | 442 | * @return int |
| 440 | 443 | */ |
| 441 | 444 | private function drawRows($w, $h, $txt, $border = 0, $align = 'J', $fill = false, $maxline = 0, $prn = 0) |
@@ -564,7 +567,7 @@ discard block |
||
| 564 | 567 | |
| 565 | 568 | /** |
| 566 | 569 | * Quebra o texto para caber na caixa |
| 567 | - * @param type $text |
|
| 570 | + * @param string $text |
|
| 568 | 571 | * @param type $maxwidth |
| 569 | 572 | * @return int |
| 570 | 573 | */ |
@@ -615,10 +618,10 @@ discard block |
||
| 615 | 618 | /** |
| 616 | 619 | * Celula com escala horizontal caso o texto seja muito largo |
| 617 | 620 | * @param number $w |
| 618 | - * @param number $h |
|
| 621 | + * @param integer $h |
|
| 619 | 622 | * @param string $txt |
| 620 | - * @param number $border |
|
| 621 | - * @param number $ln |
|
| 623 | + * @param integer $border |
|
| 624 | + * @param integer $ln |
|
| 622 | 625 | * @param string $align |
| 623 | 626 | * @param boolean $fill |
| 624 | 627 | * @param string $link |
@@ -669,10 +672,10 @@ discard block |
||
| 669 | 672 | /** |
| 670 | 673 | * Celula com escalamento horizontal somente se necessário |
| 671 | 674 | * @param number $w |
| 672 | - * @param number $h |
|
| 675 | + * @param integer $h |
|
| 673 | 676 | * @param string $txt |
| 674 | - * @param number $border |
|
| 675 | - * @param number $ln |
|
| 677 | + * @param integer $border |
|
| 678 | + * @param integer $ln |
|
| 676 | 679 | * @param string $align |
| 677 | 680 | * @param boolean $fill |
| 678 | 681 | * @param string $link |
@@ -685,10 +688,10 @@ discard block |
||
| 685 | 688 | /** |
| 686 | 689 | * Celula com escalamento forçado |
| 687 | 690 | * @param number $w |
| 688 | - * @param number $h |
|
| 691 | + * @param integer $h |
|
| 689 | 692 | * @param string $txt |
| 690 | - * @param number $border |
|
| 691 | - * @param number $ln |
|
| 693 | + * @param integer $border |
|
| 694 | + * @param integer $ln |
|
| 692 | 695 | * @param string $align |
| 693 | 696 | * @param boolean $fill |
| 694 | 697 | * @param string $link |
@@ -709,10 +712,10 @@ discard block |
||
| 709 | 712 | /** |
| 710 | 713 | * Celula com espaçamento de caracteres somente se necessário |
| 711 | 714 | * @param number $w |
| 712 | - * @param number $h |
|
| 715 | + * @param integer $h |
|
| 713 | 716 | * @param string $txt |
| 714 | - * @param number $border |
|
| 715 | - * @param number $ln |
|
| 717 | + * @param integer $border |
|
| 718 | + * @param integer $ln |
|
| 716 | 719 | * @param string $align |
| 717 | 720 | * @param boolean $fill |
| 718 | 721 | * @param string $link |
@@ -725,10 +728,10 @@ discard block |
||
| 725 | 728 | /** |
| 726 | 729 | * Celula com espaçamento de caracteres forçado |
| 727 | 730 | * @param number $w |
| 728 | - * @param number $h |
|
| 731 | + * @param integer $h |
|
| 729 | 732 | * @param string $txt |
| 730 | - * @param number $border |
|
| 731 | - * @param number $ln |
|
| 733 | + * @param integer $border |
|
| 734 | + * @param integer $ln |
|
| 732 | 735 | * @param string $align |
| 733 | 736 | * @param boolean $fill |
| 734 | 737 | * @param string $link |
@@ -772,11 +775,11 @@ discard block |
||
| 772 | 775 | |
| 773 | 776 | /** |
| 774 | 777 | * Desenha uma linha horizontal tracejada com o FPDF |
| 775 | - * @param number $x Posição horizontal inicial, em mm |
|
| 778 | + * @param integer $x Posição horizontal inicial, em mm |
|
| 776 | 779 | * @param number $y Posição vertical inicial, em mm |
| 777 | 780 | * @param number $w Comprimento da linha, em mm |
| 778 | - * @param number $h Espessura da linha, em mm |
|
| 779 | - * @param number $n Numero de traços na seção da linha com o comprimento $w |
|
| 781 | + * @param double $h Espessura da linha, em mm |
|
| 782 | + * @param integer $n Numero de traços na seção da linha com o comprimento $w |
|
| 780 | 783 | * @return none |
| 781 | 784 | */ |
| 782 | 785 | public function dashedHLine($x, $y, $w, $h, $n) |
@@ -850,14 +853,14 @@ discard block |
||
| 850 | 853 | * @param array $aFont Matriz com as informações para formatação do texto com fonte, tamanho e estilo |
| 851 | 854 | * @param string $vAlign Alinhamento vertical do texto, T-topo C-centro B-base |
| 852 | 855 | * @param string $hAlign Alinhamento horizontal do texto, L-esquerda, C-centro, R-direita |
| 853 | - * @param boolean $border TRUE ou 1 desenha a borda, FALSE ou 0 Sem borda |
|
| 856 | + * @param integer $border TRUE ou 1 desenha a borda, FALSE ou 0 Sem borda |
|
| 854 | 857 | * @param string $link Insere um hiperlink |
| 855 | 858 | * @param boolean $force Se for true força a caixa com uma unica linha e para isso atera o tamanho do |
| 856 | 859 | * fonte até caber no espaço, se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias |
| 857 | 860 | * e para isso atera o tamanho do fonte até caber no espaço, |
| 858 | 861 | * se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias |
| 859 | - * @param number $hmax |
|
| 860 | - * @param number $vOffSet incremento forçado na na posição Y |
|
| 862 | + * @param integer $hmax |
|
| 863 | + * @param integer $vOffSet incremento forçado na na posição Y |
|
| 861 | 864 | * @return number $height Qual a altura necessária para desenhar esta textBox |
| 862 | 865 | */ |
| 863 | 866 | public function textBox( |
@@ -977,22 +980,22 @@ discard block |
||
| 977 | 980 | * Atenção : Esta função é dependente de outras classes de FPDF |
| 978 | 981 | * Ex. $this->__textBox90(2,20,34,8,'Texto',array('fonte'=>$this->fontePadrao, |
| 979 | 982 | * 'size'=>10,'style='B'),'C','L',FALSE,'http://www.nfephp.org') |
| 980 | - * @param number $x Posição horizontal da caixa, canto esquerdo superior |
|
| 981 | - * @param number $y Posição vertical da caixa, canto esquerdo superior |
|
| 982 | - * @param number $w Largura da caixa |
|
| 983 | - * @param number $h Altura da caixa |
|
| 983 | + * @param integer $x Posição horizontal da caixa, canto esquerdo superior |
|
| 984 | + * @param integer $y Posição vertical da caixa, canto esquerdo superior |
|
| 985 | + * @param double $w Largura da caixa |
|
| 986 | + * @param integer $h Altura da caixa |
|
| 984 | 987 | * @param string $text Conteúdo da caixa |
| 985 | 988 | * @param array $aFont Matriz com as informações para formatação do texto com fonte, tamanho e estilo |
| 986 | 989 | * @param string $vAlign Alinhamento vertical do texto, T-topo C-centro B-base |
| 987 | 990 | * @param string $hAlign Alinhamento horizontal do texto, L-esquerda, C-centro, R-direita |
| 988 | - * @param boolean $border TRUE ou 1 desenha a borda, FALSE ou 0 Sem borda |
|
| 991 | + * @param integer $border TRUE ou 1 desenha a borda, FALSE ou 0 Sem borda |
|
| 989 | 992 | * @param string $link Insere um hiperlink |
| 990 | 993 | * @param boolean $force Se for true força a caixa com uma unica linha e para isso atera o tamanho do |
| 991 | 994 | * fonte até caber no espaço, se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias |
| 992 | 995 | * linha e para isso atera o tamanho do fonte até caber no espaço, |
| 993 | 996 | * se falso mantem o tamanho do fonte e usa quantas linhas forem necessárias |
| 994 | - * @param number $hmax |
|
| 995 | - * @param number $vOffSet incremento forçado na na posição Y |
|
| 997 | + * @param integer $hmax |
|
| 998 | + * @param integer $vOffSet incremento forçado na na posição Y |
|
| 996 | 999 | * @return number $height Qual a altura necessária para desenhar esta textBox |
| 997 | 1000 | */ |
| 998 | 1001 | public function textBox90( |
@@ -794,15 +794,15 @@ |
||
| 794 | 794 | $this->setDrawColor(0); |
| 795 | 795 | } |
| 796 | 796 | |
| 797 | - /** |
|
| 798 | - * Desenha uma linha vertical tracejada com o FPDF |
|
| 799 | - * @param number $x Posição horizontal inicial, em mm |
|
| 800 | - * @param number $y Posição vertical inicial, em mm |
|
| 801 | - * @param number $w Espessura da linha, em mm |
|
| 802 | - * @param number $yfinal posição final |
|
| 803 | - * @param number $n Numero de traços na seção da linha com o comprimento $w |
|
| 804 | - * @return none |
|
| 805 | - */ |
|
| 797 | + /** |
|
| 798 | + * Desenha uma linha vertical tracejada com o FPDF |
|
| 799 | + * @param number $x Posição horizontal inicial, em mm |
|
| 800 | + * @param number $y Posição vertical inicial, em mm |
|
| 801 | + * @param number $w Espessura da linha, em mm |
|
| 802 | + * @param number $yfinal posição final |
|
| 803 | + * @param number $n Numero de traços na seção da linha com o comprimento $w |
|
| 804 | + * @return none |
|
| 805 | + */ |
|
| 806 | 806 | public function dashedVLine($x, $y, $w, $yfinal, $n) |
| 807 | 807 | { |
| 808 | 808 | $this->setLineWidth($w); |
@@ -268,8 +268,6 @@ discard block |
||
| 268 | 268 | * __construct |
| 269 | 269 | * |
| 270 | 270 | * @name __construct |
| 271 | - * @param string $docXML Conteúdo XML da NF-e (com ou sem a tag nfeProc) |
|
| 272 | - * @param string $logoimage Caminho para o arquivo do logo |
|
| 273 | 271 | */ |
| 274 | 272 | public function __construct( |
| 275 | 273 | $xml |
@@ -860,8 +858,8 @@ discard block |
||
| 860 | 858 | *header |
| 861 | 859 | * Monta o cabelhalho da DANFE (retrato e paisagem) |
| 862 | 860 | * |
| 863 | - * @param number $x Posição horizontal inicial, canto esquerdo |
|
| 864 | - * @param number $y Posição vertical inicial, canto superior |
|
| 861 | + * @param integer $x Posição horizontal inicial, canto esquerdo |
|
| 862 | + * @param integer $y Posição vertical inicial, canto superior |
|
| 865 | 863 | * @param number $pag Número da Página |
| 866 | 864 | * @param number $totPag Total de páginas |
| 867 | 865 | * @return number Posição vertical final |
@@ -1327,8 +1325,8 @@ discard block |
||
| 1327 | 1325 | * Monta o campo com os dados do destinatário na DANFE. (retrato e paisagem) |
| 1328 | 1326 | * |
| 1329 | 1327 | * @name destinatarioDANFE |
| 1330 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1331 | - * @param number $y Posição vertical canto superior |
|
| 1328 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1329 | + * @param integer $y Posição vertical canto superior |
|
| 1332 | 1330 | * @return number Posição vertical final |
| 1333 | 1331 | */ |
| 1334 | 1332 | protected function destinatarioDANFE($x = 0, $y = 0) |
@@ -1528,7 +1526,7 @@ discard block |
||
| 1528 | 1526 | * Gera a String do Texto da Fatura |
| 1529 | 1527 | * |
| 1530 | 1528 | * @name getTextoFatura |
| 1531 | - * @return uma String com o texto ou ""; |
|
| 1529 | + * @return string String com o texto ou ""; |
|
| 1532 | 1530 | */ |
| 1533 | 1531 | protected function getTextoFatura() |
| 1534 | 1532 | { |
@@ -1582,8 +1580,8 @@ discard block |
||
| 1582 | 1580 | * Monta o campo de duplicatas da DANFE (retrato e paisagem) |
| 1583 | 1581 | * |
| 1584 | 1582 | * @name fatura |
| 1585 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1586 | - * @param number $y Posição vertical canto superior |
|
| 1583 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1584 | + * @param double $y Posição vertical canto superior |
|
| 1587 | 1585 | * @return number Posição vertical final |
| 1588 | 1586 | */ |
| 1589 | 1587 | protected function fatura($x, $y) |
@@ -1702,8 +1700,8 @@ discard block |
||
| 1702 | 1700 | * Monta o campo de pagamentos da DANFE (retrato e paisagem) (foi baseada na fatura) |
| 1703 | 1701 | * |
| 1704 | 1702 | * @name pagamento |
| 1705 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1706 | - * @param number $y Posição vertical canto superior |
|
| 1703 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1704 | + * @param double $y Posição vertical canto superior |
|
| 1707 | 1705 | * @return number Posição vertical final |
| 1708 | 1706 | */ |
| 1709 | 1707 | protected function pagamento($x, $y) |
@@ -1809,6 +1807,8 @@ discard block |
||
| 1809 | 1807 | * @param float $h Altura do campo |
| 1810 | 1808 | * @param float $h Título do campo |
| 1811 | 1809 | * @param float $h Valor do imposto |
| 1810 | + * @param string $titulo |
|
| 1811 | + * @param string $campoImposto |
|
| 1812 | 1812 | * @return float Sugestão do $x do próximo imposto |
| 1813 | 1813 | */ |
| 1814 | 1814 | protected function impostoHelper($x, $y, $w, $h, $titulo, $campoImposto) |
@@ -1835,9 +1835,9 @@ discard block |
||
| 1835 | 1835 | * imposto |
| 1836 | 1836 | * Monta o campo de impostos e totais da DANFE (retrato e paisagem) |
| 1837 | 1837 | * |
| 1838 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1839 | - * @param number $y Posição vertical canto superior |
|
| 1840 | - * @return number Posição vertical final |
|
| 1838 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1839 | + * @param double $y Posição vertical canto superior |
|
| 1840 | + * @return double Posição vertical final |
|
| 1841 | 1841 | */ |
| 1842 | 1842 | protected function imposto($x, $y) |
| 1843 | 1843 | { |
@@ -2219,6 +2219,10 @@ discard block |
||
| 2219 | 2219 | |
| 2220 | 2220 | |
| 2221 | 2221 | |
| 2222 | + /** |
|
| 2223 | + * @param string $campo |
|
| 2224 | + * @param string $formato |
|
| 2225 | + */ |
|
| 2222 | 2226 | protected function descricaoProdutoHelper($origem, $campo, $formato) |
| 2223 | 2227 | { |
| 2224 | 2228 | $valor_original = $origem->getElementsByTagName($campo)->item(0); |
@@ -2322,7 +2326,6 @@ discard block |
||
| 2322 | 2326 | * @param float $x Posição horizontal canto esquerdo |
| 2323 | 2327 | * @param float $y Posição vertical canto superior |
| 2324 | 2328 | * @param float $nInicio Número do item inicial |
| 2325 | - * @param float $max Número do item final |
|
| 2326 | 2329 | * @param float $hmax Altura máxima do campo de itens em mm |
| 2327 | 2330 | * @return float Posição vertical final |
| 2328 | 2331 | */ |
@@ -2989,8 +2992,8 @@ discard block |
||
| 2989 | 2992 | * Monta o canhoto da DANFE (retrato e paisagem) |
| 2990 | 2993 | * |
| 2991 | 2994 | * @name canhotoDANFE |
| 2992 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2993 | - * @param number $y Posição vertical canto superior |
|
| 2995 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2996 | + * @param integer $y Posição vertical canto superior |
|
| 2994 | 2997 | * @return number Posição vertical final |
| 2995 | 2998 | * |
| 2996 | 2999 | * TODO 21/07/14 fmertins: quando orientação L-paisagem, o canhoto está sendo gerado incorretamente |
@@ -3322,6 +3325,9 @@ discard block |
||
| 3322 | 3325 | } |
| 3323 | 3326 | } |
| 3324 | 3327 | |
| 3328 | + /** |
|
| 3329 | + * @param string $original |
|
| 3330 | + */ |
|
| 3325 | 3331 | private function imagePNGtoJPG($original) |
| 3326 | 3332 | { |
| 3327 | 3333 | $image = imagecreatefrompng($original); |
@@ -27,10 +27,10 @@ discard block |
||
| 27 | 27 | * @var string |
| 28 | 28 | */ |
| 29 | 29 | protected $numero_registro_dpec = ''; |
| 30 | - /** |
|
| 31 | - * Parâmetro para exibir ou ocultar os valores do PIS/COFINS. |
|
| 32 | - * @var boolean |
|
| 33 | - */ |
|
| 30 | + /** |
|
| 31 | + * Parâmetro para exibir ou ocultar os valores do PIS/COFINS. |
|
| 32 | + * @var boolean |
|
| 33 | + */ |
|
| 34 | 34 | protected $qCanhoto = 1; |
| 35 | 35 | protected $exibirPIS = true; |
| 36 | 36 | /** |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | $this->textoAdic .= ". \r\n"; |
| 472 | 472 | } |
| 473 | 473 | $this->textoAdic .= "LOCAL DE ENTREGA : ".$txRetCNPJ.'-'.$txRetxLgr.', '.$txRetnro.' '.$txRetxCpl. |
| 474 | - ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n"; |
|
| 474 | + ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n"; |
|
| 475 | 475 | } |
| 476 | 476 | //informações adicionais |
| 477 | 477 | $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas(); |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | $oldX = $x; |
| 872 | 872 | $oldY = $y; |
| 873 | 873 | if ($this->orientacao == 'P') { |
| 874 | - $maxW = $this->wPrint; |
|
| 874 | + $maxW = $this->wPrint; |
|
| 875 | 875 | } else { |
| 876 | 876 | if ($pag == 1) { // primeira página |
| 877 | 877 | $maxW = $this->wPrint - $this->wCanhoto; |
@@ -1229,8 +1229,8 @@ discard block |
||
| 1229 | 1229 | $w = $maxW-(2*$x); |
| 1230 | 1230 | $this->pdf->SetTextColor(200, 200, 200); |
| 1231 | 1231 | $texto = "DANFE impresso em contingência -\n". |
| 1232 | - "DPEC regularmente recebido pela Receita\n". |
|
| 1233 | - "Federal do Brasil"; |
|
| 1232 | + "DPEC regularmente recebido pela Receita\n". |
|
| 1233 | + "Federal do Brasil"; |
|
| 1234 | 1234 | $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B']; |
| 1235 | 1235 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1236 | 1236 | $this->pdf->SetTextColor(0, 0, 0); |
@@ -1523,13 +1523,13 @@ discard block |
||
| 1523 | 1523 | return ($y + $h); |
| 1524 | 1524 | } //fim da função destinatarioDANFE |
| 1525 | 1525 | |
| 1526 | - /** |
|
| 1527 | - * getTextoFatura |
|
| 1528 | - * Gera a String do Texto da Fatura |
|
| 1529 | - * |
|
| 1530 | - * @name getTextoFatura |
|
| 1531 | - * @return uma String com o texto ou ""; |
|
| 1532 | - */ |
|
| 1526 | + /** |
|
| 1527 | + * getTextoFatura |
|
| 1528 | + * Gera a String do Texto da Fatura |
|
| 1529 | + * |
|
| 1530 | + * @name getTextoFatura |
|
| 1531 | + * @return uma String com o texto ou ""; |
|
| 1532 | + */ |
|
| 1533 | 1533 | protected function getTextoFatura() |
| 1534 | 1534 | { |
| 1535 | 1535 | if (isset($this->cobr)) { |
@@ -1560,13 +1560,13 @@ discard block |
||
| 1560 | 1560 | return ""; |
| 1561 | 1561 | } |
| 1562 | 1562 | |
| 1563 | - /** |
|
| 1564 | - * sizeExtraTextoFatura |
|
| 1565 | - * Calcula o espaço ocupado pelo texto da fatura. Este espaço só é utilizado quando não houver duplicata. |
|
| 1566 | - * |
|
| 1567 | - * @name sizeExtraTextoFatura |
|
| 1568 | - * @return integer |
|
| 1569 | - */ |
|
| 1563 | + /** |
|
| 1564 | + * sizeExtraTextoFatura |
|
| 1565 | + * Calcula o espaço ocupado pelo texto da fatura. Este espaço só é utilizado quando não houver duplicata. |
|
| 1566 | + * |
|
| 1567 | + * @name sizeExtraTextoFatura |
|
| 1568 | + * @return integer |
|
| 1569 | + */ |
|
| 1570 | 1570 | protected function sizeExtraTextoFatura() |
| 1571 | 1571 | { |
| 1572 | 1572 | $textoFatura = $this->getTextoFatura(); |
@@ -1743,7 +1743,7 @@ discard block |
||
| 1743 | 1743 | '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível', |
| 1744 | 1744 | '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros']; |
| 1745 | 1745 | $bandeira = ['01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners', |
| 1746 | - '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros']; |
|
| 1746 | + '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros']; |
|
| 1747 | 1747 | foreach ($this->detPag as $k => $d) { |
| 1748 | 1748 | $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
| 1749 | 1749 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue : '0'; |
@@ -2379,7 +2379,7 @@ discard block |
||
| 2379 | 2379 | $w4 = round($w*0.05, 0); |
| 2380 | 2380 | $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2 |
| 2381 | 2381 | if ($this->getTagValue($this->emit, 'CRT') == '3') { |
| 2382 | - $texto = 'O/CST';//Regime Normal |
|
| 2382 | + $texto = 'O/CST';//Regime Normal |
|
| 2383 | 2383 | } |
| 2384 | 2384 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2385 | 2385 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
@@ -2754,7 +2754,7 @@ discard block |
||
| 2754 | 2754 | $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2755 | 2755 | $yVeic += $h; |
| 2756 | 2756 | $texto = 'Tipo.................: ' . ($renavamTiposVeiculos[intval($veiculoTipo)] ?? $veiculoTipo); |
| 2757 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2757 | + $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2758 | 2758 | $yVeic = $y + $h; |
| 2759 | 2759 | $xVeic = $x + 65; |
| 2760 | 2760 | $texto = 'Nº Motor: .........: ' . $veiculoMotor; |
@@ -2888,9 +2888,9 @@ discard block |
||
| 2888 | 2888 | //DADOS ADICIONAIS |
| 2889 | 2889 | $texto = "DADOS ADICIONAIS"; |
| 2890 | 2890 | if ($this->orientacao == 'P') { |
| 2891 | - $w = $this->wPrint; |
|
| 2891 | + $w = $this->wPrint; |
|
| 2892 | 2892 | } else { |
| 2893 | - $w = $this->wPrint-$this->wCanhoto; |
|
| 2893 | + $w = $this->wPrint-$this->wCanhoto; |
|
| 2894 | 2894 | } |
| 2895 | 2895 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 2896 | 2896 | $this->pdf->textBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -2971,10 +2971,10 @@ discard block |
||
| 2971 | 2971 | |
| 2972 | 2972 | $y = $this->maxH - 4; |
| 2973 | 2973 | if ($this->orientacao == 'P') { |
| 2974 | - $w = $this->wPrint; |
|
| 2974 | + $w = $this->wPrint; |
|
| 2975 | 2975 | } else { |
| 2976 | - $w = $this->wPrint-$this->wCanhoto; |
|
| 2977 | - $x = $this->wCanhoto; |
|
| 2976 | + $w = $this->wPrint-$this->wCanhoto; |
|
| 2977 | + $x = $this->wCanhoto; |
|
| 2978 | 2978 | } |
| 2979 | 2979 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I']; |
| 2980 | 2980 | $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s') |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | if ($papel == 'A4') { |
| 374 | 374 | $this->maxW = 297; |
| 375 | 375 | $this->maxH = 210; |
| 376 | - $xInic = $margEsq+10; |
|
| 376 | + $xInic = $margEsq + 10; |
|
| 377 | 377 | //se paisagem multiplica a largura do canhoto pela quantidade de canhotos |
| 378 | 378 | //$this->wCanhoto *= $this->qCanhoto; |
| 379 | 379 | } |
@@ -381,10 +381,10 @@ discard block |
||
| 381 | 381 | //total inicial de paginas |
| 382 | 382 | $totPag = 1; |
| 383 | 383 | //largura imprimivel em mm: largura da folha menos as margens esq/direita |
| 384 | - $this->wPrint = $this->maxW-($margEsq * 2); |
|
| 384 | + $this->wPrint = $this->maxW - ($margEsq * 2); |
|
| 385 | 385 | //comprimento (altura) imprimivel em mm: altura da folha menos as margens |
| 386 | 386 | //superior e inferior |
| 387 | - $this->hPrint = $this->maxH-$margSup-$margInf; |
|
| 387 | + $this->hPrint = $this->maxH - $margSup - $margInf; |
|
| 388 | 388 | // estabelece contagem de paginas |
| 389 | 389 | $this->pdf->aliasNbPages(); |
| 390 | 390 | // fixa as margens |
@@ -428,9 +428,9 @@ discard block |
||
| 428 | 428 | } |
| 429 | 429 | //calcular a altura necessária para os dados adicionais |
| 430 | 430 | if ($this->orientacao == 'P') { |
| 431 | - $this->wAdic = round($this->wPrint*0.66, 0); |
|
| 431 | + $this->wAdic = round($this->wPrint * 0.66, 0); |
|
| 432 | 432 | } else { |
| 433 | - $this->wAdic = round(($this->wPrint-$this->wCanhoto)*0.5, 0); |
|
| 433 | + $this->wAdic = round(($this->wPrint - $this->wCanhoto) * 0.5, 0); |
|
| 434 | 434 | } |
| 435 | 435 | $fontProduto = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 436 | 436 | $this->textoAdic = ''; |
@@ -442,8 +442,8 @@ discard block |
||
| 442 | 442 | $txRetxBairro = $this->getTagValue($this->retirada, "xBairro"); |
| 443 | 443 | $txRetxMun = $this->getTagValue($this->retirada, "xMun"); |
| 444 | 444 | $txRetUF = $this->getTagValue($this->retirada, "UF"); |
| 445 | - $this->textoAdic .= "LOCAL DE RETIRADA : ". |
|
| 446 | - $txRetCNPJ. |
|
| 445 | + $this->textoAdic .= "LOCAL DE RETIRADA : " . |
|
| 446 | + $txRetCNPJ . |
|
| 447 | 447 | '-' . |
| 448 | 448 | $txRetxLgr . |
| 449 | 449 | ', ' . |
@@ -470,8 +470,8 @@ discard block |
||
| 470 | 470 | if ($this->textoAdic != '') { |
| 471 | 471 | $this->textoAdic .= ". \r\n"; |
| 472 | 472 | } |
| 473 | - $this->textoAdic .= "LOCAL DE ENTREGA : ".$txRetCNPJ.'-'.$txRetxLgr.', '.$txRetnro.' '.$txRetxCpl. |
|
| 474 | - ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n"; |
|
| 473 | + $this->textoAdic .= "LOCAL DE ENTREGA : " . $txRetCNPJ . '-' . $txRetxLgr . ', ' . $txRetnro . ' ' . $txRetxCpl . |
|
| 474 | + ' - ' . $txRetxBairro . ' ' . $txRetxMun . ' - ' . $txRetUF . "\r\n"; |
|
| 475 | 475 | } |
| 476 | 476 | //informações adicionais |
| 477 | 477 | $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas(); |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | if ($this->textoAdic != '') { |
| 481 | 481 | $this->textoAdic .= ". \r\n"; |
| 482 | 482 | } |
| 483 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl")) ? |
|
| 483 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl")) ? |
|
| 484 | 484 | 'Inf. Contribuinte: ' . |
| 485 | 485 | $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl")) : ''; |
| 486 | 486 | $infPedido = $this->geraInformacoesDaTagCompra(); |
@@ -488,14 +488,14 @@ discard block |
||
| 488 | 488 | $this->textoAdic .= $infPedido; |
| 489 | 489 | } |
| 490 | 490 | $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: '); |
| 491 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco")) ? |
|
| 491 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco")) ? |
|
| 492 | 492 | "\r\n Inf. fisco: " . |
| 493 | 493 | $this->getTagValue($this->infAdic, "infAdFisco") : ''; |
| 494 | 494 | $obsCont = $this->infAdic->getElementsByTagName("obsCont"); |
| 495 | 495 | if (isset($obsCont)) { |
| 496 | 496 | foreach ($obsCont as $obs) { |
| 497 | - $campo = $obsCont->item($i)->getAttribute("xCampo"); |
|
| 498 | - $xTexto = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) ? |
|
| 497 | + $campo = $obsCont->item($i)->getAttribute("xCampo"); |
|
| 498 | + $xTexto = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) ? |
|
| 499 | 499 | $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue : ''; |
| 500 | 500 | $this->textoAdic .= "\r\n" . $campo . ': ' . trim($xTexto); |
| 501 | 501 | $i++; |
@@ -523,37 +523,37 @@ discard block |
||
| 523 | 523 | foreach ($alinhas as $linha) { |
| 524 | 524 | $numlinhasdados += $this->pdf->getNumLines($linha, $this->wAdic, $fontProduto); |
| 525 | 525 | } |
| 526 | - $hdadosadic = round(($numlinhasdados+3) * $this->pdf->fontSize, 0); |
|
| 526 | + $hdadosadic = round(($numlinhasdados + 3) * $this->pdf->fontSize, 0); |
|
| 527 | 527 | if ($hdadosadic < 10) { |
| 528 | 528 | $hdadosadic = 10; |
| 529 | 529 | } |
| 530 | 530 | //altura disponivel para os campos da DANFE |
| 531 | - $hcabecalho = 47;//para cabeçalho |
|
| 532 | - $hdestinatario = 25;//para destinatario |
|
| 533 | - $hduplicatas = 12;//para cada grupo de 7 duplicatas |
|
| 534 | - $himposto = 18;// para imposto |
|
| 535 | - $htransporte = 25;// para transporte |
|
| 536 | - $hissqn = 11;// para issqn |
|
| 537 | - $hfooter = 5;// para rodape |
|
| 538 | - $hCabecItens = 4;//cabeçalho dos itens |
|
| 531 | + $hcabecalho = 47; //para cabeçalho |
|
| 532 | + $hdestinatario = 25; //para destinatario |
|
| 533 | + $hduplicatas = 12; //para cada grupo de 7 duplicatas |
|
| 534 | + $himposto = 18; // para imposto |
|
| 535 | + $htransporte = 25; // para transporte |
|
| 536 | + $hissqn = 11; // para issqn |
|
| 537 | + $hfooter = 5; // para rodape |
|
| 538 | + $hCabecItens = 4; //cabeçalho dos itens |
|
| 539 | 539 | //alturas disponiveis para os dados |
| 540 | 540 | $hDispo1 = $this->hPrint - 10 - ($hcabecalho + |
| 541 | 541 | $hdestinatario + ($linhasDup * $hduplicatas) + $himposto + $htransporte + |
| 542 | 542 | ($linhaISSQN * $hissqn) + $hdadosadic + $hfooter + $hCabecItens + |
| 543 | 543 | $this->sizeExtraTextoFatura()); |
| 544 | 544 | if ($this->orientacao == 'P') { |
| 545 | - $hDispo1 -= 24 * $this->qCanhoto;//para canhoto |
|
| 545 | + $hDispo1 -= 24 * $this->qCanhoto; //para canhoto |
|
| 546 | 546 | $w = $this->wPrint; |
| 547 | 547 | } else { |
| 548 | - $hcanhoto = $this->hPrint;//para canhoto |
|
| 548 | + $hcanhoto = $this->hPrint; //para canhoto |
|
| 549 | 549 | $w = $this->wPrint - $this->wCanhoto; |
| 550 | 550 | } |
| 551 | - $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens)-4; |
|
| 551 | + $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens) - 4; |
|
| 552 | 552 | //Contagem da altura ocupada para impressão dos itens |
| 553 | 553 | $fontProduto = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 554 | 554 | $numlinhas = 0; |
| 555 | 555 | $hUsado = $hCabecItens; |
| 556 | - $w2 = round($w*0.28, 0); |
|
| 556 | + $w2 = round($w * 0.28, 0); |
|
| 557 | 557 | $hDispo = $hDispo1; |
| 558 | 558 | $totPag = 1; |
| 559 | 559 | $i = 0; |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | $hDispo = $hDispo2; |
| 567 | 567 | $hUsado = $hCabecItens; |
| 568 | 568 | // Remove canhoto para páginas secundárias em modo paisagem ('L') |
| 569 | - $w2 = round($this->wPrint*0.28, 0); |
|
| 569 | + $w2 = round($this->wPrint * 0.28, 0); |
|
| 570 | 570 | $i--; // decrementa para readicionar o item que não coube nessa pagina na outra. |
| 571 | 571 | } |
| 572 | 572 | $i++; |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | //coloca o cabeçalho |
| 591 | 591 | $y = $this->header($x, $y, $pag, $totPag); |
| 592 | 592 | //coloca os dados do destinatário |
| 593 | - $y = $this->destinatarioDANFE($x, $y+1); |
|
| 593 | + $y = $this->destinatarioDANFE($x, $y + 1); |
|
| 594 | 594 | |
| 595 | 595 | |
| 596 | 596 | //Verifica as formas de pagamento da nota fiscal |
@@ -604,29 +604,29 @@ discard block |
||
| 604 | 604 | } |
| 605 | 605 | //caso tenha boleto imprimir fatura |
| 606 | 606 | if ($this->dup->length > 0) { |
| 607 | - $y = $this->fatura($x, $y+1); |
|
| 607 | + $y = $this->fatura($x, $y + 1); |
|
| 608 | 608 | } else { |
| 609 | 609 | //Se somente tiver a forma de pagamento sem pagamento ou outros não imprimir nada |
| 610 | - if (count($formaPag)=='1' && (isset($formaPag[90]) || isset($formaPag[99]))) { |
|
| 610 | + if (count($formaPag) == '1' && (isset($formaPag[90]) || isset($formaPag[99]))) { |
|
| 611 | 611 | $y = $y; |
| 612 | 612 | } else { |
| 613 | 613 | //caso tenha mais de uma forma de pagamento ou seja diferente de boleto exibe a |
| 614 | 614 | //forma de pagamento e o valor |
| 615 | - $y = $this->pagamento($x, $y+1); |
|
| 615 | + $y = $this->pagamento($x, $y + 1); |
|
| 616 | 616 | } |
| 617 | 617 | } |
| 618 | 618 | //coloca os dados dos impostos e totais da NFe |
| 619 | - $y = $this->imposto($x, $y+1); |
|
| 619 | + $y = $this->imposto($x, $y + 1); |
|
| 620 | 620 | //coloca os dados do trasnporte |
| 621 | - $y = $this->transporte($x, $y+1); |
|
| 621 | + $y = $this->transporte($x, $y + 1); |
|
| 622 | 622 | //itens da DANFE |
| 623 | 623 | $nInicial = 0; |
| 624 | 624 | |
| 625 | - $y = $this->itens($x, $y+1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens); |
|
| 625 | + $y = $this->itens($x, $y + 1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens); |
|
| 626 | 626 | |
| 627 | 627 | //coloca os dados do ISSQN |
| 628 | 628 | if ($linhaISSQN == 1) { |
| 629 | - $y = $this->issqn($x, $y+4); |
|
| 629 | + $y = $this->issqn($x, $y + 4); |
|
| 630 | 630 | } else { |
| 631 | 631 | $y += 4; |
| 632 | 632 | } |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | //coloca o cabeçalho na página adicional |
| 656 | 656 | $y = $this->header($x, $y, $n, $totPag); |
| 657 | 657 | //coloca os itens na página adicional |
| 658 | - $y = $this->itens($x, $y+1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens); |
|
| 658 | + $y = $this->itens($x, $y + 1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens); |
|
| 659 | 659 | //coloca o rodapé da página |
| 660 | 660 | if ($this->orientacao == 'P') { |
| 661 | 661 | $this->rodape($margEsq); |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | if ($startPos === false) { |
| 693 | 693 | return $cdata; |
| 694 | 694 | } |
| 695 | - for ($x=$len; $x>0; $x--) { |
|
| 695 | + for ($x = $len; $x > 0; $x--) { |
|
| 696 | 696 | if (substr($cdata, $x, 1) == '>') { |
| 697 | 697 | $endPos = $x; |
| 698 | 698 | break; |
@@ -703,15 +703,15 @@ discard block |
||
| 703 | 703 | } else { |
| 704 | 704 | $parte1 = ''; |
| 705 | 705 | } |
| 706 | - $parte2 = substr($cdata, $startPos, $endPos-$startPos+1); |
|
| 706 | + $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1); |
|
| 707 | 707 | if ($endPos < $len) { |
| 708 | 708 | $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1); |
| 709 | 709 | } else { |
| 710 | 710 | $parte3 = ''; |
| 711 | 711 | } |
| 712 | - $texto = trim($parte1).' '.trim($parte3); |
|
| 712 | + $texto = trim($parte1) . ' ' . trim($parte3); |
|
| 713 | 713 | if (strpos($parte2, '<CDATA>') === false) { |
| 714 | - $cdata = '<CDATA>'.$parte2.'</CDATA>'; |
|
| 714 | + $cdata = '<CDATA>' . $parte2 . '</CDATA>'; |
|
| 715 | 715 | } else { |
| 716 | 716 | $cdata = $parte2; |
| 717 | 717 | } |
@@ -785,15 +785,15 @@ discard block |
||
| 785 | 785 | //grupo CADATA infCpl |
| 786 | 786 | $t = $dom->getElementsByTagName('transmissor')->item(0); |
| 787 | 787 | $r = $dom->getElementsByTagName('receptor')->item(0); |
| 788 | - $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 789 | - 'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : ''; |
|
| 790 | - $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 791 | - 'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : ''; |
|
| 792 | - $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 793 | - 'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : ''; |
|
| 794 | - $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 795 | - 'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : ''; |
|
| 796 | - $texto .= "".$versao.$especieNF.$fabEntrega.$dca; |
|
| 788 | + $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 789 | + 'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : ''; |
|
| 790 | + $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 791 | + 'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : ''; |
|
| 792 | + $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 793 | + 'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : ''; |
|
| 794 | + $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 795 | + 'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : ''; |
|
| 796 | + $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
| 797 | 797 | if (isset($t)) { |
| 798 | 798 | if ($t->hasAttributes()) { |
| 799 | 799 | $texto .= " Transmissor "; |
@@ -881,14 +881,14 @@ discard block |
||
| 881 | 881 | } |
| 882 | 882 | //#################################################################################### |
| 883 | 883 | //coluna esquerda identificação do emitente |
| 884 | - $w = round($maxW*0.41, 0); |
|
| 884 | + $w = round($maxW * 0.41, 0); |
|
| 885 | 885 | if ($this->orientacao == 'P') { |
| 886 | 886 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I']; |
| 887 | 887 | } else { |
| 888 | 888 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B']; |
| 889 | 889 | } |
| 890 | 890 | $w1 = $w; |
| 891 | - $h=32; |
|
| 891 | + $h = 32; |
|
| 892 | 892 | $oldY += $h; |
| 893 | 893 | $this->pdf->textBox($x, $y, $w, $h); |
| 894 | 894 | $texto = 'IDENTIFICAÇÃO DO EMITENTE'; |
@@ -909,39 +909,39 @@ discard block |
||
| 909 | 909 | $type == 'jpg'; |
| 910 | 910 | } |
| 911 | 911 | //largura da imagem em mm |
| 912 | - $logoWmm = ($logoInfo[0]/72)*25.4; |
|
| 912 | + $logoWmm = ($logoInfo[0] / 72) * 25.4; |
|
| 913 | 913 | //altura da imagem em mm |
| 914 | - $logoHmm = ($logoInfo[1]/72)*25.4; |
|
| 915 | - if ($this->logoAlign=='L') { |
|
| 916 | - $nImgW = round($w/3, 0); |
|
| 917 | - $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
|
| 918 | - $xImg = $x+1; |
|
| 919 | - $yImg = round(($h-$nImgH)/2, 0)+$y; |
|
| 914 | + $logoHmm = ($logoInfo[1] / 72) * 25.4; |
|
| 915 | + if ($this->logoAlign == 'L') { |
|
| 916 | + $nImgW = round($w / 3, 0); |
|
| 917 | + $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
|
| 918 | + $xImg = $x + 1; |
|
| 919 | + $yImg = round(($h - $nImgH) / 2, 0) + $y; |
|
| 920 | 920 | //estabelecer posições do texto |
| 921 | - $x1 = round($xImg + $nImgW +1, 0); |
|
| 922 | - $y1 = round($h/3+$y, 0); |
|
| 923 | - $tw = round(2*$w/3, 0); |
|
| 924 | - } elseif ($this->logoAlign=='C') { |
|
| 925 | - $nImgH = round($h/3, 0); |
|
| 926 | - $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
|
| 927 | - $xImg = round(($w-$nImgW)/2+$x, 0); |
|
| 928 | - $yImg = $y+3; |
|
| 921 | + $x1 = round($xImg + $nImgW + 1, 0); |
|
| 922 | + $y1 = round($h / 3 + $y, 0); |
|
| 923 | + $tw = round(2 * $w / 3, 0); |
|
| 924 | + } elseif ($this->logoAlign == 'C') { |
|
| 925 | + $nImgH = round($h / 3, 0); |
|
| 926 | + $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0); |
|
| 927 | + $xImg = round(($w - $nImgW) / 2 + $x, 0); |
|
| 928 | + $yImg = $y + 3; |
|
| 929 | 929 | $x1 = $x; |
| 930 | 930 | $y1 = round($yImg + $nImgH + 1, 0); |
| 931 | 931 | $tw = $w; |
| 932 | - } elseif ($this->logoAlign=='R') { |
|
| 933 | - $nImgW = round($w/3, 0); |
|
| 934 | - $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
|
| 935 | - $xImg = round($x+($w-(1+$nImgW)), 0); |
|
| 936 | - $yImg = round(($h-$nImgH)/2, 0)+$y; |
|
| 932 | + } elseif ($this->logoAlign == 'R') { |
|
| 933 | + $nImgW = round($w / 3, 0); |
|
| 934 | + $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
|
| 935 | + $xImg = round($x + ($w - (1 + $nImgW)), 0); |
|
| 936 | + $yImg = round(($h - $nImgH) / 2, 0) + $y; |
|
| 937 | 937 | $x1 = $x; |
| 938 | - $y1 = round($h/3+$y, 0); |
|
| 939 | - $tw = round(2*$w/3, 0); |
|
| 940 | - } elseif ($this->logoAlign=='F') { |
|
| 941 | - $nImgH = round($h-5, 0); |
|
| 942 | - $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
|
| 943 | - $xImg = round(($w-$nImgW)/2+$x, 0); |
|
| 944 | - $yImg = $y+3; |
|
| 938 | + $y1 = round($h / 3 + $y, 0); |
|
| 939 | + $tw = round(2 * $w / 3, 0); |
|
| 940 | + } elseif ($this->logoAlign == 'F') { |
|
| 941 | + $nImgH = round($h - 5, 0); |
|
| 942 | + $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0); |
|
| 943 | + $xImg = round(($w - $nImgW) / 2 + $x, 0); |
|
| 944 | + $yImg = $y + 3; |
|
| 945 | 945 | $x1 = $x; |
| 946 | 946 | $y1 = round($yImg + $nImgH + 1, 0); |
| 947 | 947 | $tw = $w; |
@@ -950,7 +950,7 @@ discard block |
||
| 950 | 950 | $this->pdf->Image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, $type); |
| 951 | 951 | } else { |
| 952 | 952 | $x1 = $x; |
| 953 | - $y1 = round($h/3+$y, 0); |
|
| 953 | + $y1 = round($h / 3 + $y, 0); |
|
| 954 | 954 | $tw = $w; |
| 955 | 955 | } |
| 956 | 956 | // monta as informações apenas se diferente de full logo |
@@ -960,9 +960,9 @@ discard block |
||
| 960 | 960 | $texto = $this->emit->getElementsByTagName("xNome")->item(0)->nodeValue; |
| 961 | 961 | $this->pdf->textBox($x1, $y1, $tw, 8, $texto, $aFont, 'T', 'C', 0, ''); |
| 962 | 962 | //endereço |
| 963 | - $y1 = $y1+5; |
|
| 963 | + $y1 = $y1 + 5; |
|
| 964 | 964 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 965 | - $fone = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 965 | + $fone = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 966 | 966 | ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue |
| 967 | 967 | : ''; |
| 968 | 968 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
@@ -982,34 +982,34 @@ discard block |
||
| 982 | 982 | //#################################################################################### |
| 983 | 983 | //coluna central Danfe |
| 984 | 984 | $x += $w; |
| 985 | - $w=round($maxW * 0.17, 0);//35; |
|
| 985 | + $w = round($maxW * 0.17, 0); //35; |
|
| 986 | 986 | $w2 = $w; |
| 987 | 987 | $h = 32; |
| 988 | 988 | $this->pdf->textBox($x, $y, $w, $h); |
| 989 | 989 | |
| 990 | 990 | $texto = "DANFE"; |
| 991 | 991 | $aFont = ['font'=>$this->fontePadrao, 'size'=>14, 'style'=>'B']; |
| 992 | - $this->pdf->textBox($x, $y+1, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 992 | + $this->pdf->textBox($x, $y + 1, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 993 | 993 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 994 | 994 | $texto = 'Documento Auxiliar da Nota Fiscal Eletrônica'; |
| 995 | 995 | $h = 20; |
| 996 | - $this->pdf->textBox($x, $y+6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false); |
|
| 996 | + $this->pdf->textBox($x, $y + 6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false); |
|
| 997 | 997 | |
| 998 | 998 | |
| 999 | 999 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 1000 | 1000 | $texto = '0 - ENTRADA'; |
| 1001 | 1001 | $y1 = $y + 14; |
| 1002 | 1002 | $h = 8; |
| 1003 | - $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1003 | + $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1004 | 1004 | $texto = '1 - SAÍDA'; |
| 1005 | 1005 | $y1 = $y + 17; |
| 1006 | - $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1006 | + $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1007 | 1007 | //tipo de nF |
| 1008 | 1008 | $aFont = ['font'=>$this->fontePadrao, 'size'=>12, 'style'=>'B']; |
| 1009 | 1009 | $y1 = $y + 13; |
| 1010 | 1010 | $h = 7; |
| 1011 | 1011 | $texto = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue; |
| 1012 | - $this->pdf->textBox($x+27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, ''); |
|
| 1012 | + $this->pdf->textBox($x + 27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, ''); |
|
| 1013 | 1013 | //numero da NF |
| 1014 | 1014 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 1015 | 1015 | $y1 = $y + 20; |
@@ -1031,7 +1031,7 @@ discard block |
||
| 1031 | 1031 | //#################################################################################### |
| 1032 | 1032 | //coluna codigo de barras |
| 1033 | 1033 | $x += $w; |
| 1034 | - $w = ($maxW-$w1-$w2);//85; |
|
| 1034 | + $w = ($maxW - $w1 - $w2); //85; |
|
| 1035 | 1035 | $w3 = $w; |
| 1036 | 1036 | $h = 32; |
| 1037 | 1037 | $this->pdf->textBox($x, $y, $w, $h); |
@@ -1040,22 +1040,22 @@ discard block |
||
| 1040 | 1040 | $bW = 75; |
| 1041 | 1041 | $bH = 12; |
| 1042 | 1042 | //codigo de barras |
| 1043 | - $this->pdf->code128($x+(($w-$bW)/2), $y+2, $chave_acesso, $bW, $bH); |
|
| 1043 | + $this->pdf->code128($x + (($w - $bW) / 2), $y + 2, $chave_acesso, $bW, $bH); |
|
| 1044 | 1044 | //linhas divisorias |
| 1045 | - $this->pdf->line($x, $y+4+$bH, $x+$w, $y+4+$bH); |
|
| 1046 | - $this->pdf->line($x, $y+12+$bH, $x+$w, $y+12+$bH); |
|
| 1045 | + $this->pdf->line($x, $y + 4 + $bH, $x + $w, $y + 4 + $bH); |
|
| 1046 | + $this->pdf->line($x, $y + 12 + $bH, $x + $w, $y + 12 + $bH); |
|
| 1047 | 1047 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1048 | - $y1 = $y+4+$bH; |
|
| 1048 | + $y1 = $y + 4 + $bH; |
|
| 1049 | 1049 | $h = 7; |
| 1050 | 1050 | $texto = 'CHAVE DE ACESSO'; |
| 1051 | 1051 | $this->pdf->textBox($x, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1052 | 1052 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B']; |
| 1053 | - $y1 = $y+8+$bH; |
|
| 1053 | + $y1 = $y + 8 + $bH; |
|
| 1054 | 1054 | $texto = $this->formatField($chave_acesso, $this->formatoChave); |
| 1055 | - $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1056 | - $y1 = $y+12+$bH; |
|
| 1055 | + $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1056 | + $y1 = $y + 12 + $bH; |
|
| 1057 | 1057 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 1058 | - $chaveContingencia=""; |
|
| 1058 | + $chaveContingencia = ""; |
|
| 1059 | 1059 | if ($this->notaDpec()) { |
| 1060 | 1060 | $cabecalhoProtoAutorizacao = 'NÚMERO DE REGISTRO DPEC'; |
| 1061 | 1061 | } else { |
@@ -1066,16 +1066,16 @@ discard block |
||
| 1066 | 1066 | $chaveContingencia = $this->geraChaveAdicionalDeContingencia(); |
| 1067 | 1067 | $this->pdf->setFillColor(0, 0, 0); |
| 1068 | 1068 | //codigo de barras |
| 1069 | - $this->pdf->code128($x+11, $y1+1, $chaveContingencia, $bW*.9, $bH/2); |
|
| 1069 | + $this->pdf->code128($x + 11, $y1 + 1, $chaveContingencia, $bW * .9, $bH / 2); |
|
| 1070 | 1070 | } else { |
| 1071 | 1071 | $texto = 'Consulta de autenticidade no portal nacional da NF-e'; |
| 1072 | - $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1073 | - $y1 = $y+16+$bH; |
|
| 1072 | + $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1073 | + $y1 = $y + 16 + $bH; |
|
| 1074 | 1074 | $texto = 'www.nfe.fazenda.gov.br/portal ou no site da Sefaz Autorizadora'; |
| 1075 | 1075 | $this->pdf->textBox( |
| 1076 | - $x+2, |
|
| 1076 | + $x + 2, |
|
| 1077 | 1077 | $y1, |
| 1078 | - $w-2, |
|
| 1078 | + $w - 2, |
|
| 1079 | 1079 | $h, |
| 1080 | 1080 | $texto, |
| 1081 | 1081 | $aFont, |
@@ -1091,7 +1091,7 @@ discard block |
||
| 1091 | 1091 | //natureza da operação |
| 1092 | 1092 | $texto = 'NATUREZA DA OPERAÇÃO'; |
| 1093 | 1093 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1094 | - $w = $w1+$w2; |
|
| 1094 | + $w = $w1 + $w2; |
|
| 1095 | 1095 | $y = $oldY; |
| 1096 | 1096 | $oldY += $h; |
| 1097 | 1097 | $x = $oldX; |
@@ -1121,7 +1121,7 @@ discard block |
||
| 1121 | 1121 | $cStat = ''; |
| 1122 | 1122 | } else { |
| 1123 | 1123 | if (isset($this->nfeProc)) { |
| 1124 | - $texto = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) ? |
|
| 1124 | + $texto = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) ? |
|
| 1125 | 1125 | $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue : ''; |
| 1126 | 1126 | $tsHora = $this->toTimestamp($this->nfeProc->getElementsByTagName("dhRecbto")->item(0)->nodeValue); |
| 1127 | 1127 | if ($texto != '') { |
@@ -1152,25 +1152,25 @@ discard block |
||
| 1152 | 1152 | $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.'; |
| 1153 | 1153 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1154 | 1154 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1155 | - $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
| 1155 | + $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
| 1156 | 1156 | ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue |
| 1157 | 1157 | : ''; |
| 1158 | 1158 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 1159 | 1159 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1160 | 1160 | //CNPJ |
| 1161 | 1161 | $x += $w; |
| 1162 | - $w = ($maxW-(2*$w)); |
|
| 1162 | + $w = ($maxW - (2 * $w)); |
|
| 1163 | 1163 | $texto = 'CNPJ / CPF'; |
| 1164 | 1164 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1165 | 1165 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1166 | 1166 | //Pegando valor do CPF/CNPJ |
| 1167 | - if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1167 | + if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1168 | 1168 | $texto = $this->formatField( |
| 1169 | 1169 | $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1170 | 1170 | "###.###.###/####-##" |
| 1171 | 1171 | ); |
| 1172 | 1172 | } else { |
| 1173 | - $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1173 | + $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1174 | 1174 | $this->formatField( |
| 1175 | 1175 | $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1176 | 1176 | "###.###.###-##" |
@@ -1186,22 +1186,22 @@ discard block |
||
| 1186 | 1186 | $resp = $this->statusNFe(); |
| 1187 | 1187 | if (!$resp['status']) { |
| 1188 | 1188 | $x = 10; |
| 1189 | - $y = $this->hPrint-130; |
|
| 1189 | + $y = $this->hPrint - 130; |
|
| 1190 | 1190 | $h = 25; |
| 1191 | - $w = $maxW-(2*$x); |
|
| 1191 | + $w = $maxW - (2 * $x); |
|
| 1192 | 1192 | $this->pdf->setTextColor(90, 90, 90); |
| 1193 | 1193 | $texto = $resp['message']; |
| 1194 | 1194 | $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B']; |
| 1195 | 1195 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1196 | 1196 | $y += $h; |
| 1197 | 1197 | $h = 5; |
| 1198 | - $w = $maxW-(2*$x); |
|
| 1198 | + $w = $maxW - (2 * $x); |
|
| 1199 | 1199 | if (isset($this->infProt) && $resp['status']) { |
| 1200 | 1200 | $xMotivo = $this->infProt->getElementsByTagName("xMotivo")->item(0)->nodeValue; |
| 1201 | 1201 | } else { |
| 1202 | 1202 | $xMotivo = ''; |
| 1203 | 1203 | } |
| 1204 | - $texto = "SEM VALOR FISCAL\n".$xMotivo; |
|
| 1204 | + $texto = "SEM VALOR FISCAL\n" . $xMotivo; |
|
| 1205 | 1205 | $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B']; |
| 1206 | 1206 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1207 | 1207 | $this->pdf->setTextColor(0, 0, 0); |
@@ -1224,12 +1224,12 @@ discard block |
||
| 1224 | 1224 | if ($this->notaDpec() || $this->tpEmis == 4) { |
| 1225 | 1225 | //DPEC |
| 1226 | 1226 | $x = 10; |
| 1227 | - $y = $this->hPrint-130; |
|
| 1227 | + $y = $this->hPrint - 130; |
|
| 1228 | 1228 | $h = 25; |
| 1229 | - $w = $maxW-(2*$x); |
|
| 1229 | + $w = $maxW - (2 * $x); |
|
| 1230 | 1230 | $this->pdf->SetTextColor(200, 200, 200); |
| 1231 | - $texto = "DANFE impresso em contingência -\n". |
|
| 1232 | - "DPEC regularmente recebido pela Receita\n". |
|
| 1231 | + $texto = "DANFE impresso em contingência -\n" . |
|
| 1232 | + "DPEC regularmente recebido pela Receita\n" . |
|
| 1233 | 1233 | "Federal do Brasil"; |
| 1234 | 1234 | $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B']; |
| 1235 | 1235 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
@@ -1348,7 +1348,7 @@ discard block |
||
| 1348 | 1348 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 1349 | 1349 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1350 | 1350 | //NOME / RAZÃO SOCIAL |
| 1351 | - $w = round($maxW*0.61, 0); |
|
| 1351 | + $w = round($maxW * 0.61, 0); |
|
| 1352 | 1352 | $w1 = $w; |
| 1353 | 1353 | $y += 3; |
| 1354 | 1354 | $texto = 'NOME / RAZÃO SOCIAL'; |
@@ -1363,19 +1363,19 @@ discard block |
||
| 1363 | 1363 | } |
| 1364 | 1364 | //CNPJ / CPF |
| 1365 | 1365 | $x += $w; |
| 1366 | - $w = round($maxW*0.23, 0); |
|
| 1366 | + $w = round($maxW * 0.23, 0); |
|
| 1367 | 1367 | $w2 = $w; |
| 1368 | 1368 | $texto = 'CNPJ / CPF'; |
| 1369 | 1369 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1370 | 1370 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1371 | 1371 | //Pegando valor do CPF/CNPJ |
| 1372 | - if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1372 | + if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1373 | 1373 | $texto = $this->formatField( |
| 1374 | 1374 | $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1375 | 1375 | "###.###.###/####-##" |
| 1376 | 1376 | ); |
| 1377 | 1377 | } else { |
| 1378 | - $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1378 | + $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1379 | 1379 | $this->formatField( |
| 1380 | 1380 | $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1381 | 1381 | "###.###.###-##" |
@@ -1385,15 +1385,15 @@ discard block |
||
| 1385 | 1385 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1386 | 1386 | //DATA DA EMISSÃO |
| 1387 | 1387 | $x += $w; |
| 1388 | - $w = $maxW-($w1+$w2); |
|
| 1388 | + $w = $maxW - ($w1 + $w2); |
|
| 1389 | 1389 | $wx = $w; |
| 1390 | 1390 | $texto = 'DATA DA EMISSÃO'; |
| 1391 | 1391 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1392 | 1392 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1393 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 1393 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 1394 | 1394 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 1395 | 1395 | if ($dEmi == '') { |
| 1396 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 1396 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 1397 | 1397 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 1398 | 1398 | $aDemi = explode('T', $dEmi); |
| 1399 | 1399 | $dEmi = $aDemi[0]; |
@@ -1406,7 +1406,7 @@ discard block |
||
| 1406 | 1406 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, ''); |
| 1407 | 1407 | } |
| 1408 | 1408 | //ENDEREÇO |
| 1409 | - $w = round($maxW*0.47, 0); |
|
| 1409 | + $w = round($maxW * 0.47, 0); |
|
| 1410 | 1410 | $w1 = $w; |
| 1411 | 1411 | $y += $h; |
| 1412 | 1412 | $x = $oldX; |
@@ -1421,7 +1421,7 @@ discard block |
||
| 1421 | 1421 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
| 1422 | 1422 | //BAIRRO / DISTRITO |
| 1423 | 1423 | $x += $w; |
| 1424 | - $w = round($maxW*0.21, 0); |
|
| 1424 | + $w = round($maxW * 0.21, 0); |
|
| 1425 | 1425 | $w2 = $w; |
| 1426 | 1426 | $texto = 'BAIRRO / DISTRITO'; |
| 1427 | 1427 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
@@ -1431,12 +1431,12 @@ discard block |
||
| 1431 | 1431 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1432 | 1432 | //CEP |
| 1433 | 1433 | $x += $w; |
| 1434 | - $w = $maxW-$w1-$w2-$wx; |
|
| 1434 | + $w = $maxW - $w1 - $w2 - $wx; |
|
| 1435 | 1435 | $w2 = $w; |
| 1436 | 1436 | $texto = 'CEP'; |
| 1437 | 1437 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1438 | 1438 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1439 | - $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1439 | + $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1440 | 1440 | $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
| 1441 | 1441 | $texto = $this->formatField($texto, "#####-###"); |
| 1442 | 1442 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
@@ -1447,10 +1447,10 @@ discard block |
||
| 1447 | 1447 | $texto = 'DATA DA SAÍDA/ENTRADA'; |
| 1448 | 1448 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1449 | 1449 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1450 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) ? |
|
| 1450 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) ? |
|
| 1451 | 1451 | $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue : ''; |
| 1452 | 1452 | if ($dSaiEnt == '') { |
| 1453 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
| 1453 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
| 1454 | 1454 | $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue : ''; |
| 1455 | 1455 | $aDsaient = explode('T', $dSaiEnt); |
| 1456 | 1456 | $dSaiEnt = $aDsaient[0]; |
@@ -1467,7 +1467,7 @@ discard block |
||
| 1467 | 1467 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1468 | 1468 | $texto = $this->dest->getElementsByTagName("xMun")->item(0)->nodeValue; |
| 1469 | 1469 | if (strtoupper(trim($texto)) == "EXTERIOR" && $this->dest->getElementsByTagName("xPais")->length > 0) { |
| 1470 | - $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
| 1470 | + $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
| 1471 | 1471 | } |
| 1472 | 1472 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 1473 | 1473 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -1482,18 +1482,18 @@ discard block |
||
| 1482 | 1482 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1483 | 1483 | //FONE / FAX |
| 1484 | 1484 | $x += $w; |
| 1485 | - $w = round(($maxW -$w1-$wx-8)/2, 0); |
|
| 1485 | + $w = round(($maxW - $w1 - $wx - 8) / 2, 0); |
|
| 1486 | 1486 | $w3 = $w; |
| 1487 | 1487 | $texto = 'FONE / FAX'; |
| 1488 | 1488 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1489 | 1489 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1490 | - $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1490 | + $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1491 | 1491 | $this->dest->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
| 1492 | 1492 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 1493 | 1493 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1494 | 1494 | //INSCRIÇÃO ESTADUAL |
| 1495 | 1495 | $x += $w; |
| 1496 | - $w = $maxW -$w1-$wx-8-$w3; |
|
| 1496 | + $w = $maxW - $w1 - $wx - 8 - $w3; |
|
| 1497 | 1497 | $texto = 'INSCRIÇÃO ESTADUAL'; |
| 1498 | 1498 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1499 | 1499 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1507,10 +1507,10 @@ discard block |
||
| 1507 | 1507 | $texto = 'HORA DA SAÍDA/ENTRADA'; |
| 1508 | 1508 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1509 | 1509 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1510 | - $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) ? |
|
| 1510 | + $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) ? |
|
| 1511 | 1511 | $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue : ''; |
| 1512 | 1512 | if ($hSaiEnt == '') { |
| 1513 | - $dhSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
| 1513 | + $dhSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
| 1514 | 1514 | $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue : ''; |
| 1515 | 1515 | $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt); |
| 1516 | 1516 | if ($tsDhSaiEnt != '') { |
@@ -1589,7 +1589,7 @@ discard block |
||
| 1589 | 1589 | protected function fatura($x, $y) |
| 1590 | 1590 | { |
| 1591 | 1591 | $linha = 1; |
| 1592 | - $h = 8+3; |
|
| 1592 | + $h = 8 + 3; |
|
| 1593 | 1593 | $oldx = $x; |
| 1594 | 1594 | $textoFatura = $this->getTextoFatura(); |
| 1595 | 1595 | //verificar se existem duplicatas |
@@ -1622,27 +1622,27 @@ discard block |
||
| 1622 | 1622 | return ($y + $h - 3); |
| 1623 | 1623 | } |
| 1624 | 1624 | if ($textoFatura !== "" && $this->exibirTextoFatura) { |
| 1625 | - $myH=6; |
|
| 1625 | + $myH = 6; |
|
| 1626 | 1626 | $myW = $this->wPrint; |
| 1627 | 1627 | if ($this->orientacao == 'L') { |
| 1628 | 1628 | $myW -= $this->wCanhoto; |
| 1629 | 1629 | } |
| 1630 | 1630 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 1631 | 1631 | $this->pdf->textBox($x, $y, $myW, $myH, $textoFatura, $aFont, 'C', 'L', 1, ''); |
| 1632 | - $y+=$myH+1; |
|
| 1632 | + $y += $myH + 1; |
|
| 1633 | 1633 | } |
| 1634 | 1634 | if ($this->orientacao == 'P') { |
| 1635 | - $w = round($this->wPrint/7.018, 0)-1; |
|
| 1635 | + $w = round($this->wPrint / 7.018, 0) - 1; |
|
| 1636 | 1636 | } else { |
| 1637 | 1637 | $w = 28; |
| 1638 | 1638 | } |
| 1639 | 1639 | $increm = 1; |
| 1640 | 1640 | foreach ($this->dup as $k => $d) { |
| 1641 | - $nDup = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) ? |
|
| 1641 | + $nDup = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) ? |
|
| 1642 | 1642 | $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue : ''; |
| 1643 | - $dDup = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) ? |
|
| 1643 | + $dDup = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) ? |
|
| 1644 | 1644 | $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) : ''; |
| 1645 | - $vDup = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) ? |
|
| 1645 | + $vDup = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) ? |
|
| 1646 | 1646 | 'R$ ' . number_format( |
| 1647 | 1647 | $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue, |
| 1648 | 1648 | 2, |
@@ -1651,14 +1651,14 @@ discard block |
||
| 1651 | 1651 | ) : ''; |
| 1652 | 1652 | $h = 8; |
| 1653 | 1653 | $texto = ''; |
| 1654 | - if ($nDup!='0' && $nDup!='') { |
|
| 1654 | + if ($nDup != '0' && $nDup != '') { |
|
| 1655 | 1655 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1656 | 1656 | $this->pdf->textBox($x, $y, $w, $h, 'Num.', $aFont, 'T', 'L', 1, ''); |
| 1657 | 1657 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 1658 | 1658 | $this->pdf->textBox($x, $y, $w, $h, $nDup, $aFont, 'T', 'R', 0, ''); |
| 1659 | 1659 | } else { |
| 1660 | 1660 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1661 | - $this->pdf->textBox($x, $y, $w, $h, ($dupcont+1)."", $aFont, 'T', 'L', 1, ''); |
|
| 1661 | + $this->pdf->textBox($x, $y, $w, $h, ($dupcont + 1) . "", $aFont, 'T', 'L', 1, ''); |
|
| 1662 | 1662 | } |
| 1663 | 1663 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1664 | 1664 | $this->pdf->textBox($x, $y, $w, $h, 'Venc.', $aFont, 'C', 'L', 0, ''); |
@@ -1668,7 +1668,7 @@ discard block |
||
| 1668 | 1668 | $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, ''); |
| 1669 | 1669 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 1670 | 1670 | $this->pdf->textBox($x, $y, $w, $h, $vDup, $aFont, 'B', 'R', 0, ''); |
| 1671 | - $x += $w+$increm; |
|
| 1671 | + $x += $w + $increm; |
|
| 1672 | 1672 | $dupcont += 1; |
| 1673 | 1673 | if ($this->orientacao == 'P') { |
| 1674 | 1674 | $maxDupCont = 6; |
@@ -1690,10 +1690,10 @@ discard block |
||
| 1690 | 1690 | $y -= 9; |
| 1691 | 1691 | $linha--; |
| 1692 | 1692 | } |
| 1693 | - return ($y+$h); |
|
| 1693 | + return ($y + $h); |
|
| 1694 | 1694 | } else { |
| 1695 | 1695 | $linha = 0; |
| 1696 | - return ($y-2); |
|
| 1696 | + return ($y - 2); |
|
| 1697 | 1697 | } |
| 1698 | 1698 | } |
| 1699 | 1699 | |
@@ -1709,7 +1709,7 @@ discard block |
||
| 1709 | 1709 | protected function pagamento($x, $y) |
| 1710 | 1710 | { |
| 1711 | 1711 | $linha = 1; |
| 1712 | - $h = 8+3; |
|
| 1712 | + $h = 8 + 3; |
|
| 1713 | 1713 | $oldx = $x; |
| 1714 | 1714 | //verificar se existem cobranças definidas |
| 1715 | 1715 | if (isset($this->detPag) && $this->detPag->length > 0) { |
@@ -1728,7 +1728,7 @@ discard block |
||
| 1728 | 1728 | $dups = ""; |
| 1729 | 1729 | $dupcont = 0; |
| 1730 | 1730 | if ($this->orientacao == 'P') { |
| 1731 | - $w = round($this->wPrint/7.018, 0)-1; |
|
| 1731 | + $w = round($this->wPrint / 7.018, 0) - 1; |
|
| 1732 | 1732 | } else { |
| 1733 | 1733 | $w = 28; |
| 1734 | 1734 | } |
@@ -1738,16 +1738,16 @@ discard block |
||
| 1738 | 1738 | $maxDupCont = 8; |
| 1739 | 1739 | } |
| 1740 | 1740 | $increm = 1; |
| 1741 | - $formaPagamento = ['01'=>'Dinheiro','02'=>'Cheque','03'=>'Cartão de Crédito', |
|
| 1742 | - '04'=>'Cartão de Débito','05'=>'Crédito Loja','10'=>'Vale Alimentação', |
|
| 1743 | - '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível', |
|
| 1744 | - '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros']; |
|
| 1745 | - $bandeira = ['01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners', |
|
| 1746 | - '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros']; |
|
| 1741 | + $formaPagamento = ['01'=>'Dinheiro', '02'=>'Cheque', '03'=>'Cartão de Crédito', |
|
| 1742 | + '04'=>'Cartão de Débito', '05'=>'Crédito Loja', '10'=>'Vale Alimentação', |
|
| 1743 | + '11'=>'Vale Refeição', '12'=>'Vale Presente', '13'=>'Vale Combustível', |
|
| 1744 | + '14'=>'Duplicata Mercantil', '15'=>'Boleto', '90'=>'Sem pagamento', '99'=>'Outros']; |
|
| 1745 | + $bandeira = ['01'=>'Visa', '02'=>'Mastercard', '03'=>'American', '04'=>'Sorocred', '05'=>'Diners', |
|
| 1746 | + '06'=>'Elo', '07'=>'Hipercard', '08'=>'Aura', '09'=>'Cabal', '99'=>'Outros']; |
|
| 1747 | 1747 | foreach ($this->detPag as $k => $d) { |
| 1748 | 1748 | $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
| 1749 | 1749 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue : '0'; |
| 1750 | - $vPag = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
| 1750 | + $vPag = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
| 1751 | 1751 | ? 'R$ ' . number_format( |
| 1752 | 1752 | $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue, |
| 1753 | 1753 | 2, |
@@ -1758,7 +1758,7 @@ discard block |
||
| 1758 | 1758 | $texto = ''; |
| 1759 | 1759 | if (isset($formaPagamento[$fPag])) { |
| 1760 | 1760 | /*Exibir Item sem pagamento ou outros?*/ |
| 1761 | - if ($fPag=='90' || $fPag=='99') { |
|
| 1761 | + if ($fPag == '90' || $fPag == '99') { |
|
| 1762 | 1762 | continue; |
| 1763 | 1763 | } |
| 1764 | 1764 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
@@ -1767,16 +1767,16 @@ discard block |
||
| 1767 | 1767 | $this->pdf->textBox($x, $y, $w, $h, $formaPagamento[$fPag], $aFont, 'T', 'R', 0, ''); |
| 1768 | 1768 | } else { |
| 1769 | 1769 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 1770 | - $this->pdf->textBox($x, $y, $w, $h, "Forma ".$fPag." não encontrado", $aFont, 'T', 'L', 1, ''); |
|
| 1770 | + $this->pdf->textBox($x, $y, $w, $h, "Forma " . $fPag . " não encontrado", $aFont, 'T', 'L', 1, ''); |
|
| 1771 | 1771 | } |
| 1772 | 1772 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1773 | 1773 | $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, ''); |
| 1774 | 1774 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 1775 | 1775 | $this->pdf->textBox($x, $y, $w, $h, $vPag, $aFont, 'B', 'R', 0, ''); |
| 1776 | - $x += $w+$increm; |
|
| 1776 | + $x += $w + $increm; |
|
| 1777 | 1777 | $dupcont += 1; |
| 1778 | 1778 | |
| 1779 | - if ($dupcont>$maxDupCont) { |
|
| 1779 | + if ($dupcont > $maxDupCont) { |
|
| 1780 | 1780 | $y += 9; |
| 1781 | 1781 | $x = $oldx; |
| 1782 | 1782 | $dupcont = 0; |
@@ -1791,10 +1791,10 @@ discard block |
||
| 1791 | 1791 | $y -= 9; |
| 1792 | 1792 | $linha--; |
| 1793 | 1793 | } |
| 1794 | - return ($y+$h); |
|
| 1794 | + return ($y + $h); |
|
| 1795 | 1795 | } else { |
| 1796 | 1796 | $linha = 0; |
| 1797 | - return ($y-2); |
|
| 1797 | + return ($y - 2); |
|
| 1798 | 1798 | } |
| 1799 | 1799 | } //fim da função pagamento |
| 1800 | 1800 | |
@@ -1906,7 +1906,7 @@ discard block |
||
| 1906 | 1906 | } |
| 1907 | 1907 | $x = $this->impostoHelper($x, $y, $w, $h, "V. TOTAL DA NOTA", "vNF"); |
| 1908 | 1908 | |
| 1909 | - return ($y+$h); |
|
| 1909 | + return ($y + $h); |
|
| 1910 | 1910 | } //fim imposto |
| 1911 | 1911 | |
| 1912 | 1912 | /** |
@@ -1934,13 +1934,13 @@ discard block |
||
| 1934 | 1934 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 1935 | 1935 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1936 | 1936 | //NOME / RAZÃO SOCIAL |
| 1937 | - $w1 = $maxW*0.29; |
|
| 1937 | + $w1 = $maxW * 0.29; |
|
| 1938 | 1938 | $y += 3; |
| 1939 | 1939 | $texto = 'NOME / RAZÃO SOCIAL'; |
| 1940 | 1940 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1941 | 1941 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1942 | 1942 | if (isset($this->transporta)) { |
| 1943 | - $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) ? |
|
| 1943 | + $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) ? |
|
| 1944 | 1944 | $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue : ''; |
| 1945 | 1945 | } else { |
| 1946 | 1946 | $texto = ''; |
@@ -1949,11 +1949,11 @@ discard block |
||
| 1949 | 1949 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 1950 | 1950 | //FRETE POR CONTA |
| 1951 | 1951 | $x += $w1; |
| 1952 | - $w2 = $maxW*0.15; |
|
| 1952 | + $w2 = $maxW * 0.15; |
|
| 1953 | 1953 | $texto = 'FRETE'; |
| 1954 | 1954 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1955 | 1955 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1956 | - $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) ? |
|
| 1956 | + $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) ? |
|
| 1957 | 1957 | $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue : '0'; |
| 1958 | 1958 | switch ($tipoFrete) { |
| 1959 | 1959 | case 0: |
@@ -1983,7 +1983,7 @@ discard block |
||
| 1983 | 1983 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1984 | 1984 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1985 | 1985 | if (isset($this->veicTransp)) { |
| 1986 | - $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) ? |
|
| 1986 | + $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) ? |
|
| 1987 | 1987 | $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue : ''; |
| 1988 | 1988 | } else { |
| 1989 | 1989 | $texto = ''; |
@@ -1996,10 +1996,10 @@ discard block |
||
| 1996 | 1996 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1997 | 1997 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1998 | 1998 | if (isset($this->veicTransp)) { |
| 1999 | - $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
| 1999 | + $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
| 2000 | 2000 | $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue : ''; |
| 2001 | 2001 | } elseif (isset($this->reboque)) { |
| 2002 | - $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
| 2002 | + $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
| 2003 | 2003 | $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue : ''; |
| 2004 | 2004 | } else { |
| 2005 | 2005 | $texto = ''; |
@@ -2008,15 +2008,15 @@ discard block |
||
| 2008 | 2008 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2009 | 2009 | //UF |
| 2010 | 2010 | $x += $w2; |
| 2011 | - $w3 = round($maxW*0.04, 0); |
|
| 2011 | + $w3 = round($maxW * 0.04, 0); |
|
| 2012 | 2012 | $texto = 'UF'; |
| 2013 | 2013 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2014 | 2014 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2015 | 2015 | if (isset($this->veicTransp)) { |
| 2016 | - $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2016 | + $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2017 | 2017 | $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue : ''; |
| 2018 | 2018 | } elseif (isset($this->reboque)) { |
| 2019 | - $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2019 | + $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2020 | 2020 | $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue : ''; |
| 2021 | 2021 | } else { |
| 2022 | 2022 | $texto = ''; |
@@ -2025,18 +2025,18 @@ discard block |
||
| 2025 | 2025 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2026 | 2026 | //CNPJ / CPF |
| 2027 | 2027 | $x += $w3; |
| 2028 | - $w = $maxW-($w1+3*$w2+$w3); |
|
| 2028 | + $w = $maxW - ($w1 + 3 * $w2 + $w3); |
|
| 2029 | 2029 | $texto = 'CNPJ / CPF'; |
| 2030 | 2030 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2031 | 2031 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2032 | 2032 | if (isset($this->transporta)) { |
| 2033 | - $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) ? |
|
| 2033 | + $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) ? |
|
| 2034 | 2034 | $this->formatField( |
| 2035 | 2035 | $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 2036 | 2036 | "##.###.###/####-##" |
| 2037 | 2037 | ) : ''; |
| 2038 | 2038 | if ($texto == '') { |
| 2039 | - $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 2039 | + $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 2040 | 2040 | $this->formatField( |
| 2041 | 2041 | $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 2042 | 2042 | "###.###.###-##" |
@@ -2052,12 +2052,12 @@ discard block |
||
| 2052 | 2052 | $y += $h; |
| 2053 | 2053 | $x = $oldX; |
| 2054 | 2054 | $h = 7; |
| 2055 | - $w1 = $maxW*0.44; |
|
| 2055 | + $w1 = $maxW * 0.44; |
|
| 2056 | 2056 | $texto = 'ENDEREÇO'; |
| 2057 | 2057 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2058 | 2058 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2059 | 2059 | if (isset($this->transporta)) { |
| 2060 | - $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) ? |
|
| 2060 | + $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) ? |
|
| 2061 | 2061 | $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue : ''; |
| 2062 | 2062 | } else { |
| 2063 | 2063 | $texto = ''; |
@@ -2066,12 +2066,12 @@ discard block |
||
| 2066 | 2066 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 2067 | 2067 | //MUNICÍPIO |
| 2068 | 2068 | $x += $w1; |
| 2069 | - $w2 = round($maxW*0.30, 0); |
|
| 2069 | + $w2 = round($maxW * 0.30, 0); |
|
| 2070 | 2070 | $texto = 'MUNICÍPIO'; |
| 2071 | 2071 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2072 | 2072 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2073 | 2073 | if (isset($this->transporta)) { |
| 2074 | - $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) ? |
|
| 2074 | + $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) ? |
|
| 2075 | 2075 | $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue : ''; |
| 2076 | 2076 | } else { |
| 2077 | 2077 | $texto = ''; |
@@ -2080,12 +2080,12 @@ discard block |
||
| 2080 | 2080 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2081 | 2081 | //UF |
| 2082 | 2082 | $x += $w2; |
| 2083 | - $w3 = round($maxW*0.04, 0); |
|
| 2083 | + $w3 = round($maxW * 0.04, 0); |
|
| 2084 | 2084 | $texto = 'UF'; |
| 2085 | 2085 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2086 | 2086 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2087 | 2087 | if (isset($this->transporta)) { |
| 2088 | - $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2088 | + $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2089 | 2089 | $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue : ''; |
| 2090 | 2090 | } else { |
| 2091 | 2091 | $texto = ''; |
@@ -2094,13 +2094,13 @@ discard block |
||
| 2094 | 2094 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2095 | 2095 | //INSCRIÇÃO ESTADUAL |
| 2096 | 2096 | $x += $w3; |
| 2097 | - $w = $maxW-($w1+$w2+$w3); |
|
| 2097 | + $w = $maxW - ($w1 + $w2 + $w3); |
|
| 2098 | 2098 | $texto = 'INSCRIÇÃO ESTADUAL'; |
| 2099 | 2099 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2100 | 2100 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2101 | 2101 | $texto = ''; |
| 2102 | 2102 | if (isset($this->transporta)) { |
| 2103 | - if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
| 2103 | + if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
| 2104 | 2104 | $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue; |
| 2105 | 2105 | } |
| 2106 | 2106 | } |
@@ -2113,16 +2113,16 @@ discard block |
||
| 2113 | 2113 | $marca = ''; |
| 2114 | 2114 | $numero = ''; |
| 2115 | 2115 | $texto = ''; |
| 2116 | - $pesoBruto=0; |
|
| 2117 | - $pesoLiquido=0; |
|
| 2116 | + $pesoBruto = 0; |
|
| 2117 | + $pesoLiquido = 0; |
|
| 2118 | 2118 | foreach ($volumes as $volume) { |
| 2119 | - $quantidade += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
| 2119 | + $quantidade += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
| 2120 | 2120 | $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0; |
| 2121 | - $pesoBruto += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
| 2121 | + $pesoBruto += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
| 2122 | 2122 | $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0; |
| 2123 | - $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
| 2123 | + $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
| 2124 | 2124 | $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0; |
| 2125 | - $texto = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
| 2125 | + $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
| 2126 | 2126 | $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : ''; |
| 2127 | 2127 | if ($texto != $especie && $especie != '') { |
| 2128 | 2128 | //tem várias especies |
@@ -2130,7 +2130,7 @@ discard block |
||
| 2130 | 2130 | } else { |
| 2131 | 2131 | $especie = $texto; |
| 2132 | 2132 | } |
| 2133 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2133 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2134 | 2134 | $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : ''; |
| 2135 | 2135 | if ($texto != $marca && $marca != '') { |
| 2136 | 2136 | //tem várias especies |
@@ -2138,7 +2138,7 @@ discard block |
||
| 2138 | 2138 | } else { |
| 2139 | 2139 | $marca = $texto; |
| 2140 | 2140 | } |
| 2141 | - $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) ? |
|
| 2141 | + $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) ? |
|
| 2142 | 2142 | $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue : ''; |
| 2143 | 2143 | if ($texto != $numero && $numero != '') { |
| 2144 | 2144 | //tem várias especies |
@@ -2153,7 +2153,7 @@ discard block |
||
| 2153 | 2153 | $y += $h; |
| 2154 | 2154 | $x = $oldX; |
| 2155 | 2155 | $h = 7; |
| 2156 | - $w1 = round($maxW*0.10, 0); |
|
| 2156 | + $w1 = round($maxW * 0.10, 0); |
|
| 2157 | 2157 | $texto = 'QUANTIDADE'; |
| 2158 | 2158 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2159 | 2159 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2164,7 +2164,7 @@ discard block |
||
| 2164 | 2164 | } |
| 2165 | 2165 | //ESPÉCIE |
| 2166 | 2166 | $x += $w1; |
| 2167 | - $w2 = round($maxW*0.17, 0); |
|
| 2167 | + $w2 = round($maxW * 0.17, 0); |
|
| 2168 | 2168 | $texto = 'ESPÉCIE'; |
| 2169 | 2169 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2170 | 2170 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2176,7 +2176,7 @@ discard block |
||
| 2176 | 2176 | $texto = 'MARCA'; |
| 2177 | 2177 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2178 | 2178 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2179 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2179 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2180 | 2180 | $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : ''; |
| 2181 | 2181 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 2182 | 2182 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -2190,7 +2190,7 @@ discard block |
||
| 2190 | 2190 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2191 | 2191 | //PESO BRUTO |
| 2192 | 2192 | $x += $w2; |
| 2193 | - $w3 = round($maxW*0.20, 0); |
|
| 2193 | + $w3 = round($maxW * 0.20, 0); |
|
| 2194 | 2194 | $texto = 'PESO BRUTO'; |
| 2195 | 2195 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2196 | 2196 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2203,7 +2203,7 @@ discard block |
||
| 2203 | 2203 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 2204 | 2204 | //PESO LÍQUIDO |
| 2205 | 2205 | $x += $w3; |
| 2206 | - $w = $maxW -($w1+3*$w2+$w3); |
|
| 2206 | + $w = $maxW - ($w1 + 3 * $w2 + $w3); |
|
| 2207 | 2207 | $texto = 'PESO LÍQUIDO'; |
| 2208 | 2208 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2209 | 2209 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2214,7 +2214,7 @@ discard block |
||
| 2214 | 2214 | } |
| 2215 | 2215 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 2216 | 2216 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 2217 | - return ($y+$h); |
|
| 2217 | + return ($y + $h); |
|
| 2218 | 2218 | } //fim transporte |
| 2219 | 2219 | |
| 2220 | 2220 | |
@@ -2226,7 +2226,7 @@ discard block |
||
| 2226 | 2226 | return ""; |
| 2227 | 2227 | } |
| 2228 | 2228 | $valor_original = $valor_original->nodeValue; |
| 2229 | - $valor = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
| 2229 | + $valor = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
| 2230 | 2230 | |
| 2231 | 2231 | if ($valor != "") { |
| 2232 | 2232 | return sprintf($formato, $valor); |
@@ -2273,18 +2273,18 @@ discard block |
||
| 2273 | 2273 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s"); |
| 2274 | 2274 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s"); |
| 2275 | 2275 | } |
| 2276 | - $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
| 2276 | + $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
| 2277 | 2277 | ? substr( |
| 2278 | 2278 | $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue), |
| 2279 | 2279 | 0, |
| 2280 | 2280 | 500 |
| 2281 | 2281 | ) |
| 2282 | 2282 | : ''; |
| 2283 | - if (! empty($infAdProd)) { |
|
| 2283 | + if (!empty($infAdProd)) { |
|
| 2284 | 2284 | $infAdProd = trim($infAdProd); |
| 2285 | 2285 | $infAdProd .= ' '; |
| 2286 | 2286 | } |
| 2287 | - $loteTxt =''; |
|
| 2287 | + $loteTxt = ''; |
|
| 2288 | 2288 | $rastro = $prod->getElementsByTagName("med"); |
| 2289 | 2289 | if (!empty($prod->getElementsByTagName("rastro"))) { |
| 2290 | 2290 | $rastro = $prod->getElementsByTagName("rastro"); |
@@ -2298,14 +2298,14 @@ discard block |
||
| 2298 | 2298 | $i++; |
| 2299 | 2299 | } |
| 2300 | 2300 | if ($loteTxt != '') { |
| 2301 | - $loteTxt.= ' '; |
|
| 2301 | + $loteTxt .= ' '; |
|
| 2302 | 2302 | } |
| 2303 | 2303 | } |
| 2304 | 2304 | //NT2013.006 FCI |
| 2305 | - $nFCI = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
| 2306 | - ' FCI:'.$itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
|
| 2307 | - $tmp_ad=$infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
|
| 2308 | - $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue . (strlen($tmp_ad)!=0?"\n ".$tmp_ad:''); |
|
| 2305 | + $nFCI = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
| 2306 | + ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
|
| 2307 | + $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
|
| 2308 | + $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue . (strlen($tmp_ad) != 0 ? "\n " . $tmp_ad : ''); |
|
| 2309 | 2309 | //decodifica os caracteres html no xml |
| 2310 | 2310 | $texto = html_entity_decode($texto); |
| 2311 | 2311 | if ($this->descProdQuebraLinha) { |
@@ -2355,104 +2355,104 @@ discard block |
||
| 2355 | 2355 | // cabecalho LOOP COM OS DADOS DOS PRODUTOS |
| 2356 | 2356 | //CÓDIGO PRODUTO |
| 2357 | 2357 | $texto = "CÓDIGO PRODUTO"; |
| 2358 | - $w1 = round($w*0.09, 0); |
|
| 2358 | + $w1 = round($w * 0.09, 0); |
|
| 2359 | 2359 | $h = 4; |
| 2360 | 2360 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2361 | 2361 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2362 | - $this->pdf->line($x+$w1, $y, $x+$w1, $y+$hmax); |
|
| 2362 | + $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax); |
|
| 2363 | 2363 | //DESCRIÇÃO DO PRODUTO / SERVIÇO |
| 2364 | 2364 | $x += $w1; |
| 2365 | - $w2 = round($w*0.28, 0); |
|
| 2365 | + $w2 = round($w * 0.28, 0); |
|
| 2366 | 2366 | $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO'; |
| 2367 | 2367 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2368 | 2368 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2369 | - $this->pdf->line($x+$w2, $y, $x+$w2, $y+$hmax); |
|
| 2369 | + $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax); |
|
| 2370 | 2370 | //NCM/SH |
| 2371 | 2371 | $x += $w2; |
| 2372 | - $w3 = round($w*0.06, 0); |
|
| 2372 | + $w3 = round($w * 0.06, 0); |
|
| 2373 | 2373 | $texto = 'NCM/SH'; |
| 2374 | 2374 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2375 | 2375 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2376 | - $this->pdf->line($x+$w3, $y, $x+$w3, $y+$hmax); |
|
| 2376 | + $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax); |
|
| 2377 | 2377 | //O/CST ou O/CSOSN |
| 2378 | 2378 | $x += $w3; |
| 2379 | - $w4 = round($w*0.05, 0); |
|
| 2380 | - $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2 |
|
| 2379 | + $w4 = round($w * 0.05, 0); |
|
| 2380 | + $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 ou CRT = 2 |
|
| 2381 | 2381 | if ($this->getTagValue($this->emit, 'CRT') == '3') { |
| 2382 | - $texto = 'O/CST';//Regime Normal |
|
| 2382 | + $texto = 'O/CST'; //Regime Normal |
|
| 2383 | 2383 | } |
| 2384 | 2384 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2385 | 2385 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2386 | - $this->pdf->line($x+$w4, $y, $x+$w4, $y+$hmax); |
|
| 2386 | + $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax); |
|
| 2387 | 2387 | //CFOP |
| 2388 | 2388 | $x += $w4; |
| 2389 | - $w5 = round($w*0.04, 0); |
|
| 2389 | + $w5 = round($w * 0.04, 0); |
|
| 2390 | 2390 | $texto = 'CFOP'; |
| 2391 | 2391 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2392 | 2392 | $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2393 | - $this->pdf->line($x+$w5, $y, $x+$w5, $y+$hmax); |
|
| 2393 | + $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax); |
|
| 2394 | 2394 | //UN |
| 2395 | 2395 | $x += $w5; |
| 2396 | - $w6 = round($w*0.03, 0); |
|
| 2396 | + $w6 = round($w * 0.03, 0); |
|
| 2397 | 2397 | $texto = 'UN'; |
| 2398 | 2398 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2399 | 2399 | $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2400 | - $this->pdf->line($x+$w6, $y, $x+$w6, $y+$hmax); |
|
| 2400 | + $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax); |
|
| 2401 | 2401 | //QUANT |
| 2402 | 2402 | $x += $w6; |
| 2403 | - $w7 = round($w*0.07, 0); |
|
| 2403 | + $w7 = round($w * 0.07, 0); |
|
| 2404 | 2404 | $texto = 'QUANT'; |
| 2405 | 2405 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2406 | 2406 | $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2407 | - $this->pdf->line($x+$w7, $y, $x+$w7, $y+$hmax); |
|
| 2407 | + $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax); |
|
| 2408 | 2408 | //VALOR UNIT |
| 2409 | 2409 | $x += $w7; |
| 2410 | - $w8 = round($w*0.06, 0); |
|
| 2410 | + $w8 = round($w * 0.06, 0); |
|
| 2411 | 2411 | $texto = 'VALOR UNIT'; |
| 2412 | 2412 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2413 | 2413 | $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2414 | - $this->pdf->line($x+$w8, $y, $x+$w8, $y+$hmax); |
|
| 2414 | + $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax); |
|
| 2415 | 2415 | //VALOR TOTAL |
| 2416 | 2416 | $x += $w8; |
| 2417 | - $w9 = round($w*0.06, 0); |
|
| 2417 | + $w9 = round($w * 0.06, 0); |
|
| 2418 | 2418 | $texto = 'VALOR TOTAL'; |
| 2419 | 2419 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2420 | 2420 | $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2421 | - $this->pdf->line($x+$w9, $y, $x+$w9, $y+$hmax); |
|
| 2421 | + $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax); |
|
| 2422 | 2422 | //B.CÁLC ICMS |
| 2423 | 2423 | $x += $w9; |
| 2424 | - $w10 = round($w*0.06, 0); |
|
| 2424 | + $w10 = round($w * 0.06, 0); |
|
| 2425 | 2425 | $texto = 'B.CÁLC ICMS'; |
| 2426 | 2426 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2427 | 2427 | $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2428 | - $this->pdf->line($x+$w10, $y, $x+$w10, $y+$hmax); |
|
| 2428 | + $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax); |
|
| 2429 | 2429 | //VALOR ICMS |
| 2430 | 2430 | $x += $w10; |
| 2431 | - $w11 = round($w*0.06, 0); |
|
| 2431 | + $w11 = round($w * 0.06, 0); |
|
| 2432 | 2432 | $texto = 'VALOR ICMS'; |
| 2433 | 2433 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2434 | 2434 | $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2435 | - $this->pdf->line($x+$w11, $y, $x+$w11, $y+$hmax); |
|
| 2435 | + $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax); |
|
| 2436 | 2436 | //VALOR IPI |
| 2437 | 2437 | $x += $w11; |
| 2438 | - $w12 = round($w*0.05, 0); |
|
| 2438 | + $w12 = round($w * 0.05, 0); |
|
| 2439 | 2439 | $texto = 'VALOR IPI'; |
| 2440 | 2440 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2441 | 2441 | $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2442 | - $this->pdf->line($x+$w12, $y, $x+$w12, $y+$hmax); |
|
| 2442 | + $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax); |
|
| 2443 | 2443 | //ALÍQ. ICMS |
| 2444 | 2444 | $x += $w12; |
| 2445 | - $w13 = round($w*0.035, 0); |
|
| 2445 | + $w13 = round($w * 0.035, 0); |
|
| 2446 | 2446 | $texto = 'ALÍQ. ICMS'; |
| 2447 | 2447 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2448 | 2448 | $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2449 | - $this->pdf->line($x+$w13, $y, $x+$w13, $y+$hmax); |
|
| 2449 | + $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax); |
|
| 2450 | 2450 | //ALÍQ. IPI |
| 2451 | 2451 | $x += $w13; |
| 2452 | - $w14 = $w-($w1+$w2+$w3+$w4+$w5+$w6+$w7+$w8+$w9+$w10+$w11+$w12+$w13); |
|
| 2452 | + $w14 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13); |
|
| 2453 | 2453 | $texto = 'ALÍQ. IPI'; |
| 2454 | 2454 | $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2455 | - $this->pdf->line($oldX, $y+$h+1, $oldX + $w, $y+$h+1); |
|
| 2455 | + $this->pdf->line($oldX, $y + $h + 1, $oldX + $w, $y + $h + 1); |
|
| 2456 | 2456 | $y += 5; |
| 2457 | 2457 | //################################################################################## |
| 2458 | 2458 | // LOOP COM OS DADOS DOS PRODUTOS |
@@ -2470,7 +2470,7 @@ discard block |
||
| 2470 | 2470 | $textoProduto = trim($this->descricaoProduto($thisItem)); |
| 2471 | 2471 | |
| 2472 | 2472 | $linhaDescr = $this->pdf->getNumLines($textoProduto, $w2, $aFont); |
| 2473 | - $h = round(($linhaDescr * $this->pdf->fontSize)+ ($linhaDescr * 0.5), 2); |
|
| 2473 | + $h = round(($linhaDescr * $this->pdf->fontSize) + ($linhaDescr * 0.5), 2); |
|
| 2474 | 2474 | $hUsado += $h; |
| 2475 | 2475 | |
| 2476 | 2476 | $diffH = $hmax - $hUsado; |
@@ -2483,11 +2483,11 @@ discard block |
||
| 2483 | 2483 | break; |
| 2484 | 2484 | } |
| 2485 | 2485 | } |
| 2486 | - $y_linha=$y+$h; |
|
| 2486 | + $y_linha = $y + $h; |
|
| 2487 | 2487 | // linha entre itens |
| 2488 | 2488 | $this->pdf->dashedHLine($oldX, $y_linha, $w, 0.1, 120); |
| 2489 | 2489 | //corrige o x |
| 2490 | - $x=$oldX; |
|
| 2490 | + $x = $oldX; |
|
| 2491 | 2491 | //codigo do produto |
| 2492 | 2492 | $texto = $prod->getElementsByTagName("cProd")->item(0)->nodeValue; |
| 2493 | 2493 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'C', 0, ''); |
@@ -2500,16 +2500,16 @@ discard block |
||
| 2500 | 2500 | } |
| 2501 | 2501 | $x += $w2; |
| 2502 | 2502 | //NCM |
| 2503 | - $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
| 2503 | + $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
| 2504 | 2504 | $prod->getElementsByTagName("NCM")->item(0)->nodeValue : ''; |
| 2505 | 2505 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2506 | 2506 | $x += $w3; |
| 2507 | 2507 | //CST |
| 2508 | 2508 | if (isset($ICMS)) { |
| 2509 | - $origem = $this->getTagValue($ICMS, "orig"); |
|
| 2510 | - $cst = $this->getTagValue($ICMS, "CST"); |
|
| 2511 | - $csosn = $this->getTagValue($ICMS, "CSOSN"); |
|
| 2512 | - $texto = $origem.$cst.$csosn; |
|
| 2509 | + $origem = $this->getTagValue($ICMS, "orig"); |
|
| 2510 | + $cst = $this->getTagValue($ICMS, "CST"); |
|
| 2511 | + $csosn = $this->getTagValue($ICMS, "CSOSN"); |
|
| 2512 | + $texto = $origem . $cst . $csosn; |
|
| 2513 | 2513 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2514 | 2514 | } |
| 2515 | 2515 | //CFOP |
@@ -2543,7 +2543,7 @@ discard block |
||
| 2543 | 2543 | //Valor da Base de calculo |
| 2544 | 2544 | $x += $w9; |
| 2545 | 2545 | if (isset($ICMS)) { |
| 2546 | - $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 2546 | + $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 2547 | 2547 | number_format( |
| 2548 | 2548 | $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue, |
| 2549 | 2549 | 2, |
@@ -2555,7 +2555,7 @@ discard block |
||
| 2555 | 2555 | //Valor do ICMS |
| 2556 | 2556 | $x += $w10; |
| 2557 | 2557 | if (isset($ICMS)) { |
| 2558 | - $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ? |
|
| 2558 | + $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ? |
|
| 2559 | 2559 | number_format( |
| 2560 | 2560 | $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue, |
| 2561 | 2561 | 2, |
@@ -2567,8 +2567,8 @@ discard block |
||
| 2567 | 2567 | //Valor do IPI |
| 2568 | 2568 | $x += $w11; |
| 2569 | 2569 | if (isset($IPI)) { |
| 2570 | - $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) ? |
|
| 2571 | - number_format($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, 2, ",", ".") :''; |
|
| 2570 | + $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) ? |
|
| 2571 | + number_format($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, 2, ",", ".") : ''; |
|
| 2572 | 2572 | } else { |
| 2573 | 2573 | $texto = ''; |
| 2574 | 2574 | } |
@@ -2576,7 +2576,7 @@ discard block |
||
| 2576 | 2576 | // %ICMS |
| 2577 | 2577 | $x += $w12; |
| 2578 | 2578 | if (isset($ICMS)) { |
| 2579 | - $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ? |
|
| 2579 | + $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ? |
|
| 2580 | 2580 | number_format( |
| 2581 | 2581 | $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue, |
| 2582 | 2582 | 2, |
@@ -2588,7 +2588,7 @@ discard block |
||
| 2588 | 2588 | //%IPI |
| 2589 | 2589 | $x += $w13; |
| 2590 | 2590 | if (isset($IPI)) { |
| 2591 | - $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) ? |
|
| 2591 | + $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) ? |
|
| 2592 | 2592 | number_format($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue, 2, ",", ".") : ''; |
| 2593 | 2593 | } else { |
| 2594 | 2594 | $texto = ''; |
@@ -2613,7 +2613,7 @@ discard block |
||
| 2613 | 2613 | $i++; |
| 2614 | 2614 | } |
| 2615 | 2615 | } |
| 2616 | - return $oldY+$hmax; |
|
| 2616 | + return $oldY + $hmax; |
|
| 2617 | 2617 | } |
| 2618 | 2618 | |
| 2619 | 2619 | |
@@ -2647,7 +2647,7 @@ discard block |
||
| 2647 | 2647 | |
| 2648 | 2648 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 2649 | 2649 | |
| 2650 | - $w1 = round($w*0.09, 0); |
|
| 2650 | + $w1 = round($w * 0.09, 0); |
|
| 2651 | 2651 | |
| 2652 | 2652 | // Tabela Renavam Combustivel |
| 2653 | 2653 | $renavamCombustivel = [ |
@@ -2742,54 +2742,54 @@ discard block |
||
| 2742 | 2742 | |
| 2743 | 2743 | $yVeic = $y + $h; |
| 2744 | 2744 | $texto = 'Chassi: ............: ' . $veiculoChassi; |
| 2745 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2745 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2746 | 2746 | $yVeic += $h; |
| 2747 | 2747 | $texto = 'Cor...................: ' . $veiculoCor; |
| 2748 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2748 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2749 | 2749 | $yVeic += $h; |
| 2750 | 2750 | $texto = 'Cilindrada........: ' . $veiculoCilindrada; |
| 2751 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2751 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2752 | 2752 | $yVeic += $h; |
| 2753 | 2753 | $texto = 'Cmkg...............: ' . $veiculoCmkg; |
| 2754 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2754 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2755 | 2755 | $yVeic += $h; |
| 2756 | 2756 | $texto = 'Tipo.................: ' . ($renavamTiposVeiculos[intval($veiculoTipo)] ?? $veiculoTipo); |
| 2757 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2757 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2758 | 2758 | $yVeic = $y + $h; |
| 2759 | 2759 | $xVeic = $x + 65; |
| 2760 | 2760 | $texto = 'Nº Motor: .........: ' . $veiculoMotor; |
| 2761 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2761 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2762 | 2762 | $yVeic += $h; |
| 2763 | 2763 | $texto = 'Renavam...........: ' . $veiculoRenavam; |
| 2764 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2764 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2765 | 2765 | $yVeic += $h; |
| 2766 | 2766 | $texto = 'HP.....................: ' . $veiculoHp; |
| 2767 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2767 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2768 | 2768 | $yVeic += $h; |
| 2769 | 2769 | $texto = 'Placa.................: ' . $veiculoPlaca; |
| 2770 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2770 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2771 | 2771 | $yVeic += $h; |
| 2772 | 2772 | $texto = 'Tipo Pintura......: ' . ($renavamEspecie[intval($veiculoTipoPintura)] ?? $veiculoTipoPintura); |
| 2773 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2773 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2774 | 2774 | $yVeic = $y + $h; |
| 2775 | 2775 | $xVeic = $xVeic + 55; |
| 2776 | 2776 | $texto = 'Marca / Modelo.....: ' . $veiculoMarcaModelo; |
| 2777 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2777 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2778 | 2778 | $yVeic += $h; |
| 2779 | 2779 | $texto = 'Especie..................: ' . ($renavamEspecie[intval($veiculoEspecie)] ?? $veiculoEspecie); |
| 2780 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2780 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2781 | 2781 | $yVeic += $h; |
| 2782 | 2782 | $texto = 'Combustivel..........: ' . ($renavamCombustivel[intval($veiculoCombustivel)] ?? $veiculoCombustivel); |
| 2783 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2783 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2784 | 2784 | $yVeic += $h; |
| 2785 | 2785 | $texto = 'Serial.....................: ' . $veiculoSerial; |
| 2786 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2786 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2787 | 2787 | $yVeic += $h; |
| 2788 | - $texto = 'Ano Fab/Mod........: '. $veiculoFabricacao . '/' . $veiculoModelo; |
|
| 2789 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2788 | + $texto = 'Ano Fab/Mod........: ' . $veiculoFabricacao . '/' . $veiculoModelo; |
|
| 2789 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2790 | 2790 | $yVeic += $h; |
| 2791 | - $texto = 'Distancia Entre Eixos(mm)..: '. $veiculoDistancia; |
|
| 2792 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2791 | + $texto = 'Distancia Entre Eixos(mm)..: ' . $veiculoDistancia; |
|
| 2792 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2793 | 2793 | } |
| 2794 | 2794 | |
| 2795 | 2795 | /** |
@@ -2813,12 +2813,12 @@ discard block |
||
| 2813 | 2813 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2814 | 2814 | //INSCRIÇÃO MUNICIPAL |
| 2815 | 2815 | $y += 3; |
| 2816 | - $w = round($this->wPrint*0.23, 0); |
|
| 2816 | + $w = round($this->wPrint * 0.23, 0); |
|
| 2817 | 2817 | $texto = 'INSCRIÇÃO MUNICIPAL'; |
| 2818 | 2818 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2819 | 2819 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2820 | 2820 | //inscrição municipal |
| 2821 | - $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
| 2821 | + $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
| 2822 | 2822 | $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : ''; |
| 2823 | 2823 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 2824 | 2824 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -2828,7 +2828,7 @@ discard block |
||
| 2828 | 2828 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2829 | 2829 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2830 | 2830 | if (isset($this->ISSQNtot)) { |
| 2831 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
| 2831 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
| 2832 | 2832 | $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : ''; |
| 2833 | 2833 | $texto = number_format($texto, 2, ",", "."); |
| 2834 | 2834 | } else { |
@@ -2842,9 +2842,9 @@ discard block |
||
| 2842 | 2842 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2843 | 2843 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2844 | 2844 | if (isset($this->ISSQNtot)) { |
| 2845 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 2845 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 2846 | 2846 | $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : ''; |
| 2847 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 2847 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 2848 | 2848 | } else { |
| 2849 | 2849 | $texto = ''; |
| 2850 | 2850 | } |
@@ -2855,21 +2855,21 @@ discard block |
||
| 2855 | 2855 | if ($this->orientacao == 'P') { |
| 2856 | 2856 | $w = $this->wPrint - (3 * $w); |
| 2857 | 2857 | } else { |
| 2858 | - $w = $this->wPrint - (3 * $w)-$this->wCanhoto; |
|
| 2858 | + $w = $this->wPrint - (3 * $w) - $this->wCanhoto; |
|
| 2859 | 2859 | } |
| 2860 | 2860 | $texto = 'VALOR TOTAL DO ISSQN'; |
| 2861 | 2861 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2862 | 2862 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2863 | 2863 | if (isset($this->ISSQNtot)) { |
| 2864 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
| 2864 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
| 2865 | 2865 | $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : ''; |
| 2866 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 2866 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 2867 | 2867 | } else { |
| 2868 | 2868 | $texto = ''; |
| 2869 | 2869 | } |
| 2870 | 2870 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 2871 | 2871 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 2872 | - return ($y+$h+1); |
|
| 2872 | + return ($y + $h + 1); |
|
| 2873 | 2873 | } |
| 2874 | 2874 | |
| 2875 | 2875 | /** |
@@ -2890,7 +2890,7 @@ discard block |
||
| 2890 | 2890 | if ($this->orientacao == 'P') { |
| 2891 | 2891 | $w = $this->wPrint; |
| 2892 | 2892 | } else { |
| 2893 | - $w = $this->wPrint-$this->wCanhoto; |
|
| 2893 | + $w = $this->wPrint - $this->wCanhoto; |
|
| 2894 | 2894 | } |
| 2895 | 2895 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 2896 | 2896 | $this->pdf->textBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -2906,15 +2906,15 @@ discard block |
||
| 2906 | 2906 | //$this->textoAdic com o texto completo do campo |
| 2907 | 2907 | $y += 1; |
| 2908 | 2908 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 2909 | - $this->pdf->textBox($x, $y+2, $w-2, $h-3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
|
| 2909 | + $this->pdf->textBox($x, $y + 2, $w - 2, $h - 3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
|
| 2910 | 2910 | //RESERVADO AO FISCO |
| 2911 | 2911 | $texto = "RESERVADO AO FISCO"; |
| 2912 | 2912 | $x += $w; |
| 2913 | 2913 | $y -= 1; |
| 2914 | 2914 | if ($this->orientacao == 'P') { |
| 2915 | - $w = $this->wPrint-$w; |
|
| 2915 | + $w = $this->wPrint - $w; |
|
| 2916 | 2916 | } else { |
| 2917 | - $w = $this->wPrint-$w-$this->wCanhoto; |
|
| 2917 | + $w = $this->wPrint - $w - $this->wCanhoto; |
|
| 2918 | 2918 | } |
| 2919 | 2919 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'B']; |
| 2920 | 2920 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2953,8 +2953,8 @@ discard block |
||
| 2953 | 2953 | } |
| 2954 | 2954 | $y += 2; |
| 2955 | 2955 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 2956 | - $this->pdf->textBox($x, $y, $w-2, $h-3, $texto, $aFont, 'T', 'L', 0, '', false); |
|
| 2957 | - return $y+$h; |
|
| 2956 | + $this->pdf->textBox($x, $y, $w - 2, $h - 3, $texto, $aFont, 'T', 'L', 0, '', false); |
|
| 2957 | + return $y + $h; |
|
| 2958 | 2958 | } |
| 2959 | 2959 | |
| 2960 | 2960 | /** |
@@ -2973,11 +2973,11 @@ discard block |
||
| 2973 | 2973 | if ($this->orientacao == 'P') { |
| 2974 | 2974 | $w = $this->wPrint; |
| 2975 | 2975 | } else { |
| 2976 | - $w = $this->wPrint-$this->wCanhoto; |
|
| 2976 | + $w = $this->wPrint - $this->wCanhoto; |
|
| 2977 | 2977 | $x = $this->wCanhoto; |
| 2978 | 2978 | } |
| 2979 | 2979 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I']; |
| 2980 | - $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s') |
|
| 2980 | + $texto = "Impresso em " . date('d/m/Y') . " as " . date('H:i:s') |
|
| 2981 | 2981 | . ' ' . $this->creditos; |
| 2982 | 2982 | $this->pdf->textBox($x, $y, $w, 0, $texto, $aFont, 'T', 'L', false); |
| 2983 | 2983 | $texto = "Powered by NFePHP®"; |
@@ -3033,9 +3033,9 @@ discard block |
||
| 3033 | 3033 | } else { |
| 3034 | 3034 | //linha separadora do canhoto - 238 |
| 3035 | 3035 | //posicao altura |
| 3036 | - $y = $this->wPrint-85; |
|
| 3036 | + $y = $this->wPrint - 85; |
|
| 3037 | 3037 | //altura |
| 3038 | - $w = $this->wPrint-85-24; |
|
| 3038 | + $w = $this->wPrint - 85 - 24; |
|
| 3039 | 3039 | } |
| 3040 | 3040 | $h = 10; |
| 3041 | 3041 | //desenha caixa |
@@ -3058,21 +3058,21 @@ discard block |
||
| 3058 | 3058 | $texto .= "AO LADO"; |
| 3059 | 3059 | } |
| 3060 | 3060 | $texto .= ". EMISSÃO: "; |
| 3061 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3061 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3062 | 3062 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 3063 | 3063 | if ($dEmi == '') { |
| 3064 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3064 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3065 | 3065 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 3066 | 3066 | $aDemi = explode('T', $dEmi); |
| 3067 | 3067 | $dEmi = $aDemi[0]; |
| 3068 | 3068 | } |
| 3069 | - $texto .= $this->ymdTodmy($dEmi) ." "; |
|
| 3069 | + $texto .= $this->ymdTodmy($dEmi) . " "; |
|
| 3070 | 3070 | $texto .= "VALOR TOTAL: R$ "; |
| 3071 | 3071 | $texto .= number_format($this->ICMSTot->getElementsByTagName("vNF")->item(0)->nodeValue, 2, ",", ".") . " "; |
| 3072 | 3072 | $texto .= "DESTINATÁRIO: "; |
| 3073 | 3073 | $texto .= $destinatario; |
| 3074 | 3074 | if ($this->orientacao == 'P') { |
| 3075 | - $this->pdf->textBox($x, $y, $w-1, $h, $texto, $aFont, 'C', 'L', 0, '', false); |
|
| 3075 | + $this->pdf->textBox($x, $y, $w - 1, $h, $texto, $aFont, 'C', 'L', 0, '', false); |
|
| 3076 | 3076 | $x1 = $x + $w; |
| 3077 | 3077 | $w1 = $this->wPrint - $w; |
| 3078 | 3078 | $texto = "NF-e"; |
@@ -3085,12 +3085,12 @@ discard block |
||
| 3085 | 3085 | //DATA DE RECEBIMENTO |
| 3086 | 3086 | $texto = "DATA DE RECEBIMENTO"; |
| 3087 | 3087 | $y += $h; |
| 3088 | - $w2 = round($this->wPrint*0.17, 0); //35; |
|
| 3088 | + $w2 = round($this->wPrint * 0.17, 0); //35; |
|
| 3089 | 3089 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 3090 | 3090 | $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3091 | 3091 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
| 3092 | 3092 | $x += $w2; |
| 3093 | - $w3 = $w-$w2; |
|
| 3093 | + $w3 = $w - $w2; |
|
| 3094 | 3094 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
| 3095 | 3095 | $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3096 | 3096 | $x = $oldX; |
@@ -3100,7 +3100,7 @@ discard block |
||
| 3100 | 3100 | return $y; |
| 3101 | 3101 | } else { |
| 3102 | 3102 | $x--; |
| 3103 | - $x = $this->pdf->textBox90($x, $y, $w-1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
|
| 3103 | + $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
|
| 3104 | 3104 | //NUMERO DA NOTA FISCAL LOGO NFE |
| 3105 | 3105 | $w1 = 18; |
| 3106 | 3106 | $x1 = $oldX; |
@@ -3114,14 +3114,14 @@ discard block |
||
| 3114 | 3114 | $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, ''); |
| 3115 | 3115 | //DATA DO RECEBIMENTO |
| 3116 | 3116 | $texto = "DATA DO RECEBIMENTO"; |
| 3117 | - $y = $this->wPrint-85; |
|
| 3117 | + $y = $this->wPrint - 85; |
|
| 3118 | 3118 | $x = 12; |
| 3119 | - $w2 = round($this->wPrint*0.17, 0); //35; |
|
| 3119 | + $w2 = round($this->wPrint * 0.17, 0); //35; |
|
| 3120 | 3120 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 3121 | 3121 | $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3122 | 3122 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
| 3123 | 3123 | $y -= $w2; |
| 3124 | - $w3 = $w-$w2; |
|
| 3124 | + $w3 = $w - $w2; |
|
| 3125 | 3125 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
| 3126 | 3126 | $aFont = ['font'=>$this->fontePadrao, 'size'=>5.7, 'style'=>'']; |
| 3127 | 3127 | $x = $this->pdf->textBox90($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3142,13 +3142,13 @@ discard block |
||
| 3142 | 3142 | { |
| 3143 | 3143 | $saida = ""; |
| 3144 | 3144 | if (isset($this->compra)) { |
| 3145 | - if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
| 3145 | + if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
| 3146 | 3146 | $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue; |
| 3147 | 3147 | } |
| 3148 | - if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
| 3148 | + if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
| 3149 | 3149 | $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue; |
| 3150 | 3150 | } |
| 3151 | - if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
| 3151 | + if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
| 3152 | 3152 | $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue; |
| 3153 | 3153 | } |
| 3154 | 3154 | } |
@@ -3174,21 +3174,21 @@ discard block |
||
| 3174 | 3174 | if ($vICMS > 0) { |
| 3175 | 3175 | $vICMS = 1; |
| 3176 | 3176 | } |
| 3177 | - $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue; |
|
| 3177 | + $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue; |
|
| 3178 | 3178 | if ($icmss > 0) { |
| 3179 | 3179 | $icmss = 1; |
| 3180 | 3180 | } |
| 3181 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3181 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3182 | 3182 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 3183 | 3183 | if ($dEmi == '') { |
| 3184 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3184 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3185 | 3185 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 3186 | 3186 | $aDemi = explode('T', $dEmi); |
| 3187 | 3187 | $dEmi = $aDemi[0]; |
| 3188 | 3188 | } |
| 3189 | 3189 | $dd = $dEmi; |
| 3190 | 3190 | $rpos = strrpos($dd, '-'); |
| 3191 | - $dd = substr($dd, $rpos +1); |
|
| 3191 | + $dd = substr($dd, $rpos + 1); |
|
| 3192 | 3192 | $chave = sprintf($forma, $cUF, $this->tpEmis, $CNPJ, $vNF, $vICMS, $icmss, $dd); |
| 3193 | 3193 | $chave = $chave . $this->modulo11($chave); |
| 3194 | 3194 | return $chave; |
@@ -3209,7 +3209,7 @@ discard block |
||
| 3209 | 3209 | $formaNfRef = "\r\nNF Ref.: série:%d numero:%d emit:%s em %s modelo: %d"; |
| 3210 | 3210 | $formaECFRef = "\r\nECF Ref.: modelo: %s ECF:%d COO:%d"; |
| 3211 | 3211 | $formaNfpRef = "\r\nNFP Ref.: série:%d número:%d emit:%s em %s modelo: %d IE:%s"; |
| 3212 | - $saida=''; |
|
| 3212 | + $saida = ''; |
|
| 3213 | 3213 | $nfRefs = $this->ide->getElementsByTagName('NFref'); |
| 3214 | 3214 | if (0 === $nfRefs->length) { |
| 3215 | 3215 | return $saida; |
@@ -3225,7 +3225,7 @@ discard block |
||
| 3225 | 3225 | foreach ($refNFe as $chave_acessoRef) { |
| 3226 | 3226 | $chave_acesso = $chave_acessoRef->nodeValue; |
| 3227 | 3227 | $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave); |
| 3228 | - $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2); |
|
| 3228 | + $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2); |
|
| 3229 | 3229 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
| 3230 | 3230 | $serie = substr($chave_acesso, 22, 3); |
| 3231 | 3231 | $numero = substr($chave_acesso, 25, 9); |
@@ -3246,7 +3246,7 @@ discard block |
||
| 3246 | 3246 | foreach ($refCTe as $chave_acessoRef) { |
| 3247 | 3247 | $chave_acesso = $chave_acessoRef->nodeValue; |
| 3248 | 3248 | $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave); |
| 3249 | - $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2); |
|
| 3249 | + $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2); |
|
| 3250 | 3250 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
| 3251 | 3251 | $serie = substr($chave_acesso, 22, 3); |
| 3252 | 3252 | $numero = substr($chave_acesso, 25, 9); |
@@ -3262,10 +3262,9 @@ discard block |
||
| 3262 | 3262 | $refNFP = $nfRef->getElementsByTagName('refNFP'); |
| 3263 | 3263 | foreach ($refNFP as $umaRefNFe) { |
| 3264 | 3264 | $data = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue; |
| 3265 | - $cnpj = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
| 3266 | - $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : |
|
| 3267 | - ''; |
|
| 3268 | - $cpf = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
| 3265 | + $cnpj = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
| 3266 | + $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : ''; |
|
| 3267 | + $cpf = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
| 3269 | 3268 | $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : ''; |
| 3270 | 3269 | $mod = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue; |
| 3271 | 3270 | $serie = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue; |
@@ -3330,6 +3329,6 @@ discard block |
||
| 3330 | 3329 | imagedestroy($image); |
| 3331 | 3330 | $stringdata = ob_get_contents(); // read from buffer |
| 3332 | 3331 | ob_end_clean(); |
| 3333 | - return 'data://text/plain;base64,'.base64_encode($stringdata); |
|
| 3332 | + return 'data://text/plain;base64,' . base64_encode($stringdata); |
|
| 3334 | 3333 | } |
| 3335 | 3334 | } |