@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | if ($papel == 'A4') { |
| 386 | 386 | $this->maxW = 297; |
| 387 | 387 | $this->maxH = 210; |
| 388 | - $xInic = $margEsq+10; |
|
| 388 | + $xInic = $margEsq + 10; |
|
| 389 | 389 | //se paisagem multiplica a largura do canhoto pela quantidade de canhotos |
| 390 | 390 | //$this->wCanhoto *= $this->qCanhoto; |
| 391 | 391 | } |
@@ -393,10 +393,10 @@ discard block |
||
| 393 | 393 | //total inicial de paginas |
| 394 | 394 | $totPag = 1; |
| 395 | 395 | //largura imprimivel em mm: largura da folha menos as margens esq/direita |
| 396 | - $this->wPrint = $this->maxW-($margEsq * 2); |
|
| 396 | + $this->wPrint = $this->maxW - ($margEsq * 2); |
|
| 397 | 397 | //comprimento (altura) imprimivel em mm: altura da folha menos as margens |
| 398 | 398 | //superior e inferior |
| 399 | - $this->hPrint = $this->maxH-$margSup-$margInf; |
|
| 399 | + $this->hPrint = $this->maxH - $margSup - $margInf; |
|
| 400 | 400 | // estabelece contagem de paginas |
| 401 | 401 | $this->pdf->aliasNbPages(); |
| 402 | 402 | // fixa as margens |
@@ -440,9 +440,9 @@ discard block |
||
| 440 | 440 | } |
| 441 | 441 | //calcular a altura necessária para os dados adicionais |
| 442 | 442 | if ($this->orientacao == 'P') { |
| 443 | - $this->wAdic = round($this->wPrint*0.66, 0); |
|
| 443 | + $this->wAdic = round($this->wPrint * 0.66, 0); |
|
| 444 | 444 | } else { |
| 445 | - $this->wAdic = round(($this->wPrint-$this->wCanhoto)*0.5, 0); |
|
| 445 | + $this->wAdic = round(($this->wPrint - $this->wCanhoto) * 0.5, 0); |
|
| 446 | 446 | } |
| 447 | 447 | $fontProduto = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 448 | 448 | $this->textoAdic = ''; |
@@ -454,8 +454,8 @@ discard block |
||
| 454 | 454 | $txRetxBairro = $this->getTagValue($this->retirada, "xBairro"); |
| 455 | 455 | $txRetxMun = $this->getTagValue($this->retirada, "xMun"); |
| 456 | 456 | $txRetUF = $this->getTagValue($this->retirada, "UF"); |
| 457 | - $this->textoAdic .= "LOCAL DE RETIRADA : ". |
|
| 458 | - $txRetCNPJ. |
|
| 457 | + $this->textoAdic .= "LOCAL DE RETIRADA : " . |
|
| 458 | + $txRetCNPJ . |
|
| 459 | 459 | '-' . |
| 460 | 460 | $txRetxLgr . |
| 461 | 461 | ', ' . |
@@ -482,8 +482,8 @@ discard block |
||
| 482 | 482 | if ($this->textoAdic != '') { |
| 483 | 483 | $this->textoAdic .= ". \r\n"; |
| 484 | 484 | } |
| 485 | - $this->textoAdic .= "LOCAL DE ENTREGA : ".$txRetCNPJ.'-'.$txRetxLgr.', '.$txRetnro.' '.$txRetxCpl. |
|
| 486 | - ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n"; |
|
| 485 | + $this->textoAdic .= "LOCAL DE ENTREGA : " . $txRetCNPJ . '-' . $txRetxLgr . ', ' . $txRetnro . ' ' . $txRetxCpl . |
|
| 486 | + ' - ' . $txRetxBairro . ' ' . $txRetxMun . ' - ' . $txRetUF . "\r\n"; |
|
| 487 | 487 | } |
| 488 | 488 | //informações adicionais |
| 489 | 489 | $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas(); |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | if ($this->textoAdic != '') { |
| 493 | 493 | $this->textoAdic .= ". \r\n"; |
| 494 | 494 | } |
| 495 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl")) |
|
| 495 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl")) |
|
| 496 | 496 | ? 'Inf. Contribuinte: ' . $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl")) |
| 497 | 497 | : ''; |
| 498 | 498 | $infPedido = $this->geraInformacoesDaTagCompra(); |
@@ -500,14 +500,14 @@ discard block |
||
| 500 | 500 | $this->textoAdic .= $infPedido; |
| 501 | 501 | } |
| 502 | 502 | $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: '); |
| 503 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco")) |
|
| 503 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco")) |
|
| 504 | 504 | ? "\r\n Inf. fisco: " . $this->getTagValue($this->infAdic, "infAdFisco") |
| 505 | 505 | : ''; |
| 506 | 506 | $obsCont = $this->infAdic->getElementsByTagName("obsCont"); |
| 507 | 507 | if (isset($obsCont)) { |
| 508 | 508 | foreach ($obsCont as $obs) { |
| 509 | - $campo = $obsCont->item($i)->getAttribute("xCampo"); |
|
| 510 | - $xTexto = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) |
|
| 509 | + $campo = $obsCont->item($i)->getAttribute("xCampo"); |
|
| 510 | + $xTexto = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) |
|
| 511 | 511 | ? $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue |
| 512 | 512 | : ''; |
| 513 | 513 | $this->textoAdic .= "\r\n" . $campo . ': ' . trim($xTexto); |
@@ -538,11 +538,11 @@ discard block |
||
| 538 | 538 | $numlinhasdados += $this->pdf->getNumLines($linha, $this->wAdic, $fontProduto); |
| 539 | 539 | } |
| 540 | 540 | $this->textadicfontsize = $this->pdf->fontSize; |
| 541 | - $hdadosadic = round(($numlinhasdados+3) * $this->textadicfontsize, 0); |
|
| 541 | + $hdadosadic = round(($numlinhasdados + 3) * $this->textadicfontsize, 0); |
|
| 542 | 542 | if ($hdadosadic > 70) { |
| 543 | - for ($per=1; $per>=0.01; $per=$per-0.01) { |
|
| 544 | - $this->textadicfontsize = $this->pdf->fontSize*$per; |
|
| 545 | - $hdadosadic = round(($numlinhasdados+3) * $this->textadicfontsize, 0); |
|
| 543 | + for ($per = 1; $per >= 0.01; $per = $per - 0.01) { |
|
| 544 | + $this->textadicfontsize = $this->pdf->fontSize * $per; |
|
| 545 | + $hdadosadic = round(($numlinhasdados + 3) * $this->textadicfontsize, 0); |
|
| 546 | 546 | if ($hdadosadic <= 90) { |
| 547 | 547 | $hdadosadic = 70; |
| 548 | 548 | break; |
@@ -554,9 +554,9 @@ discard block |
||
| 554 | 554 | $hdadosadic = 10; |
| 555 | 555 | } |
| 556 | 556 | //altura disponivel para os campos da DANFE |
| 557 | - $hcabecalho = 47;//para cabeçalho |
|
| 558 | - $hdestinatario = 25;//para destinatario |
|
| 559 | - $hduplicatas = 12;//para cada grupo de 7 duplicatas |
|
| 557 | + $hcabecalho = 47; //para cabeçalho |
|
| 558 | + $hdestinatario = 25; //para destinatario |
|
| 559 | + $hduplicatas = 12; //para cada grupo de 7 duplicatas |
|
| 560 | 560 | if (isset($this->entrega)) { |
| 561 | 561 | $hlocalentrega = 25; |
| 562 | 562 | } else { |
@@ -567,11 +567,11 @@ discard block |
||
| 567 | 567 | } else { |
| 568 | 568 | $hlocalretirada = 0; |
| 569 | 569 | } |
| 570 | - $himposto = 18;// para imposto |
|
| 571 | - $htransporte = 25;// para transporte |
|
| 572 | - $hissqn = 11;// para issqn |
|
| 573 | - $hfooter = 5;// para rodape |
|
| 574 | - $hCabecItens = 4;//cabeçalho dos itens |
|
| 570 | + $himposto = 18; // para imposto |
|
| 571 | + $htransporte = 25; // para transporte |
|
| 572 | + $hissqn = 11; // para issqn |
|
| 573 | + $hfooter = 5; // para rodape |
|
| 574 | + $hCabecItens = 4; //cabeçalho dos itens |
|
| 575 | 575 | //alturas disponiveis para os dados |
| 576 | 576 | $hDispo1 = $this->hPrint - 10 - ($hcabecalho + |
| 577 | 577 | //$hdestinatario + ($linhasDup * $hduplicatas) + $himposto + $htransporte + |
@@ -580,18 +580,18 @@ discard block |
||
| 580 | 580 | ($linhaISSQN * $hissqn) + $hdadosadic + $hfooter + $hCabecItens + |
| 581 | 581 | $this->sizeExtraTextoFatura()); |
| 582 | 582 | if ($this->orientacao == 'P') { |
| 583 | - $hDispo1 -= 24 * $this->qCanhoto;//para canhoto |
|
| 583 | + $hDispo1 -= 24 * $this->qCanhoto; //para canhoto |
|
| 584 | 584 | $w = $this->wPrint; |
| 585 | 585 | } else { |
| 586 | - $hcanhoto = $this->hPrint;//para canhoto |
|
| 586 | + $hcanhoto = $this->hPrint; //para canhoto |
|
| 587 | 587 | $w = $this->wPrint - $this->wCanhoto; |
| 588 | 588 | } |
| 589 | - $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens)-4; |
|
| 589 | + $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens) - 4; |
|
| 590 | 590 | //Contagem da altura ocupada para impressão dos itens |
| 591 | 591 | $fontProduto = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 592 | 592 | $numlinhas = 0; |
| 593 | 593 | $hUsado = $hCabecItens; |
| 594 | - $w2 = round($w*0.28, 0); |
|
| 594 | + $w2 = round($w * 0.28, 0); |
|
| 595 | 595 | $hDispo = $hDispo1; |
| 596 | 596 | $totPag = 1; |
| 597 | 597 | $i = 0; |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | $hDispo = $hDispo2; |
| 605 | 605 | $hUsado = $hCabecItens; |
| 606 | 606 | // Remove canhoto para páginas secundárias em modo paisagem ('L') |
| 607 | - $w2 = round($this->wPrint*0.28, 0); |
|
| 607 | + $w2 = round($this->wPrint * 0.28, 0); |
|
| 608 | 608 | $i--; // decrementa para readicionar o item que não coube nessa pagina na outra. |
| 609 | 609 | } |
| 610 | 610 | $i++; |
@@ -628,15 +628,15 @@ discard block |
||
| 628 | 628 | //coloca o cabeçalho |
| 629 | 629 | $y = $this->header($x, $y, $pag, $totPag); |
| 630 | 630 | //coloca os dados do destinatário |
| 631 | - $y = $this->destinatarioDANFE($x, $y+1); |
|
| 631 | + $y = $this->destinatarioDANFE($x, $y + 1); |
|
| 632 | 632 | |
| 633 | 633 | //coloca os dados do local de retirada |
| 634 | 634 | if (isset($this->retirada)) { |
| 635 | - $y = $this->localRetiradaDANFE($x, $y+1); |
|
| 635 | + $y = $this->localRetiradaDANFE($x, $y + 1); |
|
| 636 | 636 | } |
| 637 | 637 | //coloca os dados do local de entrega |
| 638 | 638 | if (isset($this->entrega)) { |
| 639 | - $y = $this->localEntregaDANFE($x, $y+1); |
|
| 639 | + $y = $this->localEntregaDANFE($x, $y + 1); |
|
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | //Verifica as formas de pagamento da nota fiscal |
@@ -651,29 +651,29 @@ discard block |
||
| 651 | 651 | } |
| 652 | 652 | //caso tenha boleto imprimir fatura |
| 653 | 653 | if ($this->dup->length > 0) { |
| 654 | - $y = $this->fatura($x, $y+1); |
|
| 654 | + $y = $this->fatura($x, $y + 1); |
|
| 655 | 655 | } else { |
| 656 | 656 | //Se somente tiver a forma de pagamento sem pagamento ou outros não imprimir nada |
| 657 | - if (count($formaPag)=='1' && (isset($formaPag[90]) || isset($formaPag[99]))) { |
|
| 657 | + if (count($formaPag) == '1' && (isset($formaPag[90]) || isset($formaPag[99]))) { |
|
| 658 | 658 | $y = $y; |
| 659 | 659 | } else { |
| 660 | 660 | //caso tenha mais de uma forma de pagamento ou seja diferente de boleto exibe a |
| 661 | 661 | //forma de pagamento e o valor |
| 662 | - $y = $this->pagamento($x, $y+1); |
|
| 662 | + $y = $this->pagamento($x, $y + 1); |
|
| 663 | 663 | } |
| 664 | 664 | } |
| 665 | 665 | //coloca os dados dos impostos e totais da NFe |
| 666 | - $y = $this->imposto($x, $y+1); |
|
| 666 | + $y = $this->imposto($x, $y + 1); |
|
| 667 | 667 | //coloca os dados do trasnporte |
| 668 | - $y = $this->transporte($x, $y+1); |
|
| 668 | + $y = $this->transporte($x, $y + 1); |
|
| 669 | 669 | //itens da DANFE |
| 670 | 670 | $nInicial = 0; |
| 671 | 671 | |
| 672 | - $y = $this->itens($x, $y+1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens); |
|
| 672 | + $y = $this->itens($x, $y + 1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens); |
|
| 673 | 673 | |
| 674 | 674 | //coloca os dados do ISSQN |
| 675 | 675 | if ($linhaISSQN == 1) { |
| 676 | - $y = $this->issqn($x, $y+4); |
|
| 676 | + $y = $this->issqn($x, $y + 4); |
|
| 677 | 677 | } else { |
| 678 | 678 | $y += 4; |
| 679 | 679 | } |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | //coloca o cabeçalho na página adicional |
| 703 | 703 | $y = $this->header($x, $y, $n, $totPag); |
| 704 | 704 | //coloca os itens na página adicional |
| 705 | - $y = $this->itens($x, $y+1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens); |
|
| 705 | + $y = $this->itens($x, $y + 1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens); |
|
| 706 | 706 | //coloca o rodapé da página |
| 707 | 707 | if ($this->orientacao == 'P') { |
| 708 | 708 | $this->rodape($margEsq); |
@@ -739,7 +739,7 @@ discard block |
||
| 739 | 739 | if ($startPos === false) { |
| 740 | 740 | return $cdata; |
| 741 | 741 | } |
| 742 | - for ($x=$len; $x>0; $x--) { |
|
| 742 | + for ($x = $len; $x > 0; $x--) { |
|
| 743 | 743 | if (substr($cdata, $x, 1) == '>') { |
| 744 | 744 | $endPos = $x; |
| 745 | 745 | break; |
@@ -750,15 +750,15 @@ discard block |
||
| 750 | 750 | } else { |
| 751 | 751 | $parte1 = ''; |
| 752 | 752 | } |
| 753 | - $parte2 = substr($cdata, $startPos, $endPos-$startPos+1); |
|
| 753 | + $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1); |
|
| 754 | 754 | if ($endPos < $len) { |
| 755 | 755 | $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1); |
| 756 | 756 | } else { |
| 757 | 757 | $parte3 = ''; |
| 758 | 758 | } |
| 759 | - $texto = trim($parte1).' '.trim($parte3); |
|
| 759 | + $texto = trim($parte1) . ' ' . trim($parte3); |
|
| 760 | 760 | if (strpos($parte2, '<CDATA>') === false) { |
| 761 | - $cdata = '<CDATA>'.$parte2.'</CDATA>'; |
|
| 761 | + $cdata = '<CDATA>' . $parte2 . '</CDATA>'; |
|
| 762 | 762 | } else { |
| 763 | 763 | $cdata = $parte2; |
| 764 | 764 | } |
@@ -832,15 +832,15 @@ discard block |
||
| 832 | 832 | //grupo CADATA infCpl |
| 833 | 833 | $t = $dom->getElementsByTagName('transmissor')->item(0); |
| 834 | 834 | $r = $dom->getElementsByTagName('receptor')->item(0); |
| 835 | - $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 836 | - 'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : ''; |
|
| 837 | - $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 838 | - 'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : ''; |
|
| 839 | - $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 840 | - 'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : ''; |
|
| 841 | - $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 842 | - 'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : ''; |
|
| 843 | - $texto .= "".$versao.$especieNF.$fabEntrega.$dca; |
|
| 835 | + $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 836 | + 'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : ''; |
|
| 837 | + $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 838 | + 'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : ''; |
|
| 839 | + $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 840 | + 'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : ''; |
|
| 841 | + $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 842 | + 'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : ''; |
|
| 843 | + $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
| 844 | 844 | if (isset($t)) { |
| 845 | 845 | if ($t->hasAttributes()) { |
| 846 | 846 | $texto .= " Transmissor "; |
@@ -926,14 +926,14 @@ discard block |
||
| 926 | 926 | } |
| 927 | 927 | //#################################################################################### |
| 928 | 928 | //coluna esquerda identificação do emitente |
| 929 | - $w = round($maxW*0.41, 0); |
|
| 929 | + $w = round($maxW * 0.41, 0); |
|
| 930 | 930 | if ($this->orientacao == 'P') { |
| 931 | 931 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I']; |
| 932 | 932 | } else { |
| 933 | 933 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B']; |
| 934 | 934 | } |
| 935 | 935 | $w1 = $w; |
| 936 | - $h=32; |
|
| 936 | + $h = 32; |
|
| 937 | 937 | $oldY += $h; |
| 938 | 938 | $this->pdf->textBox($x, $y, $w, $h); |
| 939 | 939 | $texto = 'IDENTIFICAÇÃO DO EMITENTE'; |
@@ -954,39 +954,39 @@ discard block |
||
| 954 | 954 | $type == 'jpg'; |
| 955 | 955 | } |
| 956 | 956 | //largura da imagem em mm |
| 957 | - $logoWmm = ($logoInfo[0]/72)*25.4; |
|
| 957 | + $logoWmm = ($logoInfo[0] / 72) * 25.4; |
|
| 958 | 958 | //altura da imagem em mm |
| 959 | - $logoHmm = ($logoInfo[1]/72)*25.4; |
|
| 960 | - if ($this->logoAlign=='L') { |
|
| 961 | - $nImgW = round($w/3, 0); |
|
| 962 | - $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
|
| 963 | - $xImg = $x+1; |
|
| 964 | - $yImg = round(($h-$nImgH)/2, 0)+$y; |
|
| 959 | + $logoHmm = ($logoInfo[1] / 72) * 25.4; |
|
| 960 | + if ($this->logoAlign == 'L') { |
|
| 961 | + $nImgW = round($w / 3, 0); |
|
| 962 | + $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
|
| 963 | + $xImg = $x + 1; |
|
| 964 | + $yImg = round(($h - $nImgH) / 2, 0) + $y; |
|
| 965 | 965 | //estabelecer posições do texto |
| 966 | - $x1 = round($xImg + $nImgW +1, 0); |
|
| 967 | - $y1 = round($h/3+$y, 0); |
|
| 968 | - $tw = round(2*$w/3, 0); |
|
| 969 | - } elseif ($this->logoAlign=='C') { |
|
| 970 | - $nImgH = round($h/3, 0); |
|
| 971 | - $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
|
| 972 | - $xImg = round(($w-$nImgW)/2+$x, 0); |
|
| 973 | - $yImg = $y+3; |
|
| 966 | + $x1 = round($xImg + $nImgW + 1, 0); |
|
| 967 | + $y1 = round($h / 3 + $y, 0); |
|
| 968 | + $tw = round(2 * $w / 3, 0); |
|
| 969 | + } elseif ($this->logoAlign == 'C') { |
|
| 970 | + $nImgH = round($h / 3, 0); |
|
| 971 | + $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0); |
|
| 972 | + $xImg = round(($w - $nImgW) / 2 + $x, 0); |
|
| 973 | + $yImg = $y + 3; |
|
| 974 | 974 | $x1 = $x; |
| 975 | 975 | $y1 = round($yImg + $nImgH + 1, 0); |
| 976 | 976 | $tw = $w; |
| 977 | - } elseif ($this->logoAlign=='R') { |
|
| 978 | - $nImgW = round($w/3, 0); |
|
| 979 | - $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
|
| 980 | - $xImg = round($x+($w-(1+$nImgW)), 0); |
|
| 981 | - $yImg = round(($h-$nImgH)/2, 0)+$y; |
|
| 977 | + } elseif ($this->logoAlign == 'R') { |
|
| 978 | + $nImgW = round($w / 3, 0); |
|
| 979 | + $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
|
| 980 | + $xImg = round($x + ($w - (1 + $nImgW)), 0); |
|
| 981 | + $yImg = round(($h - $nImgH) / 2, 0) + $y; |
|
| 982 | 982 | $x1 = $x; |
| 983 | - $y1 = round($h/3+$y, 0); |
|
| 984 | - $tw = round(2*$w/3, 0); |
|
| 985 | - } elseif ($this->logoAlign=='F') { |
|
| 986 | - $nImgH = round($h-5, 0); |
|
| 987 | - $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
|
| 988 | - $xImg = round(($w-$nImgW)/2+$x, 0); |
|
| 989 | - $yImg = $y+3; |
|
| 983 | + $y1 = round($h / 3 + $y, 0); |
|
| 984 | + $tw = round(2 * $w / 3, 0); |
|
| 985 | + } elseif ($this->logoAlign == 'F') { |
|
| 986 | + $nImgH = round($h - 5, 0); |
|
| 987 | + $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0); |
|
| 988 | + $xImg = round(($w - $nImgW) / 2 + $x, 0); |
|
| 989 | + $yImg = $y + 3; |
|
| 990 | 990 | $x1 = $x; |
| 991 | 991 | $y1 = round($yImg + $nImgH + 1, 0); |
| 992 | 992 | $tw = $w; |
@@ -995,7 +995,7 @@ discard block |
||
| 995 | 995 | $this->pdf->Image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, $type); |
| 996 | 996 | } else { |
| 997 | 997 | $x1 = $x; |
| 998 | - $y1 = round($h/3+$y, 0); |
|
| 998 | + $y1 = round($h / 3 + $y, 0); |
|
| 999 | 999 | $tw = $w; |
| 1000 | 1000 | } |
| 1001 | 1001 | // monta as informações apenas se diferente de full logo |
@@ -1005,9 +1005,9 @@ discard block |
||
| 1005 | 1005 | $texto = $this->emit->getElementsByTagName("xNome")->item(0)->nodeValue; |
| 1006 | 1006 | $this->pdf->textBox($x1, $y1, $tw, 8, $texto, $aFont, 'T', 'C', 0, ''); |
| 1007 | 1007 | //endereço |
| 1008 | - $y1 = $y1+5; |
|
| 1008 | + $y1 = $y1 + 5; |
|
| 1009 | 1009 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 1010 | - $fone = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 1010 | + $fone = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 1011 | 1011 | ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue |
| 1012 | 1012 | : ''; |
| 1013 | 1013 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
@@ -1027,33 +1027,33 @@ discard block |
||
| 1027 | 1027 | //#################################################################################### |
| 1028 | 1028 | //coluna central Danfe |
| 1029 | 1029 | $x += $w; |
| 1030 | - $w=round($maxW * 0.17, 0);//35; |
|
| 1030 | + $w = round($maxW * 0.17, 0); //35; |
|
| 1031 | 1031 | $w2 = $w; |
| 1032 | 1032 | $h = 32; |
| 1033 | 1033 | $this->pdf->textBox($x, $y, $w, $h); |
| 1034 | 1034 | |
| 1035 | 1035 | $texto = "DANFE"; |
| 1036 | 1036 | $aFont = ['font'=>$this->fontePadrao, 'size'=>14, 'style'=>'B']; |
| 1037 | - $this->pdf->textBox($x, $y+1, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1037 | + $this->pdf->textBox($x, $y + 1, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1038 | 1038 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 1039 | 1039 | $texto = 'Documento Auxiliar da Nota Fiscal Eletrônica'; |
| 1040 | 1040 | $h = 20; |
| 1041 | - $this->pdf->textBox($x, $y+6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false); |
|
| 1041 | + $this->pdf->textBox($x, $y + 6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false); |
|
| 1042 | 1042 | |
| 1043 | 1043 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 1044 | 1044 | $texto = '0 - ENTRADA'; |
| 1045 | 1045 | $y1 = $y + 14; |
| 1046 | 1046 | $h = 8; |
| 1047 | - $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1047 | + $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1048 | 1048 | $texto = '1 - SAÍDA'; |
| 1049 | 1049 | $y1 = $y + 17; |
| 1050 | - $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1050 | + $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1051 | 1051 | //tipo de nF |
| 1052 | 1052 | $aFont = ['font'=>$this->fontePadrao, 'size'=>12, 'style'=>'B']; |
| 1053 | 1053 | $y1 = $y + 13; |
| 1054 | 1054 | $h = 7; |
| 1055 | 1055 | $texto = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue; |
| 1056 | - $this->pdf->textBox($x+27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, ''); |
|
| 1056 | + $this->pdf->textBox($x + 27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, ''); |
|
| 1057 | 1057 | //numero da NF |
| 1058 | 1058 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 1059 | 1059 | $y1 = $y + 20; |
@@ -1085,7 +1085,7 @@ discard block |
||
| 1085 | 1085 | //#################################################################################### |
| 1086 | 1086 | //coluna codigo de barras |
| 1087 | 1087 | $x += $w; |
| 1088 | - $w = ($maxW-$w1-$w2);//85; |
|
| 1088 | + $w = ($maxW - $w1 - $w2); //85; |
|
| 1089 | 1089 | $w3 = $w; |
| 1090 | 1090 | $h = 32; |
| 1091 | 1091 | $this->pdf->textBox($x, $y, $w, $h); |
@@ -1094,22 +1094,22 @@ discard block |
||
| 1094 | 1094 | $bW = 75; |
| 1095 | 1095 | $bH = 12; |
| 1096 | 1096 | //codigo de barras |
| 1097 | - $this->pdf->code128($x+(($w-$bW)/2), $y+2, $chave_acesso, $bW, $bH); |
|
| 1097 | + $this->pdf->code128($x + (($w - $bW) / 2), $y + 2, $chave_acesso, $bW, $bH); |
|
| 1098 | 1098 | //linhas divisorias |
| 1099 | - $this->pdf->line($x, $y+4+$bH, $x+$w, $y+4+$bH); |
|
| 1100 | - $this->pdf->line($x, $y+12+$bH, $x+$w, $y+12+$bH); |
|
| 1099 | + $this->pdf->line($x, $y + 4 + $bH, $x + $w, $y + 4 + $bH); |
|
| 1100 | + $this->pdf->line($x, $y + 12 + $bH, $x + $w, $y + 12 + $bH); |
|
| 1101 | 1101 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1102 | - $y1 = $y+4+$bH; |
|
| 1102 | + $y1 = $y + 4 + $bH; |
|
| 1103 | 1103 | $h = 7; |
| 1104 | 1104 | $texto = 'CHAVE DE ACESSO'; |
| 1105 | 1105 | $this->pdf->textBox($x, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1106 | 1106 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B']; |
| 1107 | - $y1 = $y+8+$bH; |
|
| 1107 | + $y1 = $y + 8 + $bH; |
|
| 1108 | 1108 | $texto = $this->formatField($chave_acesso, $this->formatoChave); |
| 1109 | - $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1110 | - $y1 = $y+12+$bH; |
|
| 1109 | + $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1110 | + $y1 = $y + 12 + $bH; |
|
| 1111 | 1111 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 1112 | - $chaveContingencia=""; |
|
| 1112 | + $chaveContingencia = ""; |
|
| 1113 | 1113 | if ($this->notaDpec()) { |
| 1114 | 1114 | $cabecalhoProtoAutorizacao = 'NÚMERO DE REGISTRO DPEC'; |
| 1115 | 1115 | } else { |
@@ -1120,16 +1120,16 @@ discard block |
||
| 1120 | 1120 | $chaveContingencia = $this->geraChaveAdicionalDeContingencia(); |
| 1121 | 1121 | $this->pdf->setFillColor(0, 0, 0); |
| 1122 | 1122 | //codigo de barras |
| 1123 | - $this->pdf->code128($x+11, $y1+1, $chaveContingencia, $bW*.9, $bH/2); |
|
| 1123 | + $this->pdf->code128($x + 11, $y1 + 1, $chaveContingencia, $bW * .9, $bH / 2); |
|
| 1124 | 1124 | } else { |
| 1125 | 1125 | $texto = 'Consulta de autenticidade no portal nacional da NF-e'; |
| 1126 | - $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1127 | - $y1 = $y+16+$bH; |
|
| 1126 | + $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1127 | + $y1 = $y + 16 + $bH; |
|
| 1128 | 1128 | $texto = 'www.nfe.fazenda.gov.br/portal ou no site da Sefaz Autorizadora'; |
| 1129 | 1129 | $this->pdf->textBox( |
| 1130 | - $x+2, |
|
| 1130 | + $x + 2, |
|
| 1131 | 1131 | $y1, |
| 1132 | - $w-2, |
|
| 1132 | + $w - 2, |
|
| 1133 | 1133 | $h, |
| 1134 | 1134 | $texto, |
| 1135 | 1135 | $aFont, |
@@ -1145,7 +1145,7 @@ discard block |
||
| 1145 | 1145 | //natureza da operação |
| 1146 | 1146 | $texto = 'NATUREZA DA OPERAÇÃO'; |
| 1147 | 1147 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1148 | - $w = $w1+$w2; |
|
| 1148 | + $w = $w1 + $w2; |
|
| 1149 | 1149 | $y = $oldY; |
| 1150 | 1150 | $oldY += $h; |
| 1151 | 1151 | $x = $oldX; |
@@ -1178,7 +1178,7 @@ discard block |
||
| 1178 | 1178 | $cStat = ''; |
| 1179 | 1179 | } else { |
| 1180 | 1180 | if (isset($this->nfeProc)) { |
| 1181 | - $texto = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) |
|
| 1181 | + $texto = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) |
|
| 1182 | 1182 | ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue |
| 1183 | 1183 | : ''; |
| 1184 | 1184 | $tsHora = $this->toTimestamp( |
@@ -1212,25 +1212,25 @@ discard block |
||
| 1212 | 1212 | $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.'; |
| 1213 | 1213 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1214 | 1214 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1215 | - $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
| 1215 | + $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
| 1216 | 1216 | ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue |
| 1217 | 1217 | : ''; |
| 1218 | 1218 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 1219 | 1219 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1220 | 1220 | //CNPJ |
| 1221 | 1221 | $x += $w; |
| 1222 | - $w = ($maxW-(2*$w)); |
|
| 1222 | + $w = ($maxW - (2 * $w)); |
|
| 1223 | 1223 | $texto = 'CNPJ / CPF'; |
| 1224 | 1224 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1225 | 1225 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1226 | 1226 | //Pegando valor do CPF/CNPJ |
| 1227 | - if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1227 | + if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1228 | 1228 | $texto = $this->formatField( |
| 1229 | 1229 | $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1230 | 1230 | "###.###.###/####-##" |
| 1231 | 1231 | ); |
| 1232 | 1232 | } else { |
| 1233 | - $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 1233 | + $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 1234 | 1234 | ? $this->formatField( |
| 1235 | 1235 | $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1236 | 1236 | "###.###.###-##" |
@@ -1247,22 +1247,22 @@ discard block |
||
| 1247 | 1247 | $resp = $this->statusNFe(); |
| 1248 | 1248 | if (!$resp['status']) { |
| 1249 | 1249 | $x = 10; |
| 1250 | - $y = $this->hPrint-130; |
|
| 1250 | + $y = $this->hPrint - 130; |
|
| 1251 | 1251 | $h = 25; |
| 1252 | - $w = $maxW-(2*$x); |
|
| 1252 | + $w = $maxW - (2 * $x); |
|
| 1253 | 1253 | $this->pdf->settextcolor(90, 90, 90); |
| 1254 | 1254 | $texto = $resp['message']; |
| 1255 | 1255 | $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B']; |
| 1256 | 1256 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1257 | 1257 | $y += $h; |
| 1258 | 1258 | $h = 5; |
| 1259 | - $w = $maxW-(2*$x); |
|
| 1259 | + $w = $maxW - (2 * $x); |
|
| 1260 | 1260 | if (isset($this->infProt) && $resp['status']) { |
| 1261 | 1261 | $xMotivo = $this->infProt->getElementsByTagName("xMotivo")->item(0)->nodeValue; |
| 1262 | 1262 | } else { |
| 1263 | 1263 | $xMotivo = ''; |
| 1264 | 1264 | } |
| 1265 | - $texto = "SEM VALOR FISCAL\n".$xMotivo; |
|
| 1265 | + $texto = "SEM VALOR FISCAL\n" . $xMotivo; |
|
| 1266 | 1266 | $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B']; |
| 1267 | 1267 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1268 | 1268 | $this->pdf->settextcolor(0, 0, 0); |
@@ -1285,12 +1285,12 @@ discard block |
||
| 1285 | 1285 | if ($this->notaDpec() || $this->tpEmis == 4) { |
| 1286 | 1286 | //DPEC |
| 1287 | 1287 | $x = 10; |
| 1288 | - $y = $this->hPrint-130; |
|
| 1288 | + $y = $this->hPrint - 130; |
|
| 1289 | 1289 | $h = 25; |
| 1290 | - $w = $maxW-(2*$x); |
|
| 1290 | + $w = $maxW - (2 * $x); |
|
| 1291 | 1291 | $this->pdf->SetTextColor(200, 200, 200); |
| 1292 | - $texto = "DANFE impresso em contingência -\n". |
|
| 1293 | - "DPEC regularmente recebido pela Receita\n". |
|
| 1292 | + $texto = "DANFE impresso em contingência -\n" . |
|
| 1293 | + "DPEC regularmente recebido pela Receita\n" . |
|
| 1294 | 1294 | "Federal do Brasil"; |
| 1295 | 1295 | $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B']; |
| 1296 | 1296 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
@@ -1409,7 +1409,7 @@ discard block |
||
| 1409 | 1409 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 1410 | 1410 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1411 | 1411 | //NOME / RAZÃO SOCIAL |
| 1412 | - $w = round($maxW*0.61, 0); |
|
| 1412 | + $w = round($maxW * 0.61, 0); |
|
| 1413 | 1413 | $w1 = $w; |
| 1414 | 1414 | $y += 3; |
| 1415 | 1415 | $texto = 'NOME / RAZÃO SOCIAL'; |
@@ -1424,19 +1424,19 @@ discard block |
||
| 1424 | 1424 | } |
| 1425 | 1425 | //CNPJ / CPF |
| 1426 | 1426 | $x += $w; |
| 1427 | - $w = round($maxW*0.23, 0); |
|
| 1427 | + $w = round($maxW * 0.23, 0); |
|
| 1428 | 1428 | $w2 = $w; |
| 1429 | 1429 | $texto = 'CNPJ / CPF'; |
| 1430 | 1430 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1431 | 1431 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1432 | 1432 | //Pegando valor do CPF/CNPJ |
| 1433 | - if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1433 | + if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1434 | 1434 | $texto = $this->formatField( |
| 1435 | 1435 | $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1436 | 1436 | "###.###.###/####-##" |
| 1437 | 1437 | ); |
| 1438 | 1438 | } else { |
| 1439 | - $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 1439 | + $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 1440 | 1440 | ? $this->formatField( |
| 1441 | 1441 | $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1442 | 1442 | "###.###.###-##" |
@@ -1447,16 +1447,16 @@ discard block |
||
| 1447 | 1447 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1448 | 1448 | //DATA DA EMISSÃO |
| 1449 | 1449 | $x += $w; |
| 1450 | - $w = $maxW-($w1+$w2); |
|
| 1450 | + $w = $maxW - ($w1 + $w2); |
|
| 1451 | 1451 | $wx = $w; |
| 1452 | 1452 | $texto = 'DATA DA EMISSÃO'; |
| 1453 | 1453 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1454 | 1454 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1455 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) |
|
| 1455 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) |
|
| 1456 | 1456 | ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue |
| 1457 | 1457 | : ''; |
| 1458 | 1458 | if ($dEmi == '') { |
| 1459 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) |
|
| 1459 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) |
|
| 1460 | 1460 | ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue |
| 1461 | 1461 | : ''; |
| 1462 | 1462 | $aDemi = explode('T', $dEmi); |
@@ -1470,7 +1470,7 @@ discard block |
||
| 1470 | 1470 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, ''); |
| 1471 | 1471 | } |
| 1472 | 1472 | //ENDEREÇO |
| 1473 | - $w = round($maxW*0.47, 0); |
|
| 1473 | + $w = round($maxW * 0.47, 0); |
|
| 1474 | 1474 | $w1 = $w; |
| 1475 | 1475 | $y += $h; |
| 1476 | 1476 | $x = $oldX; |
@@ -1485,7 +1485,7 @@ discard block |
||
| 1485 | 1485 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
| 1486 | 1486 | //BAIRRO / DISTRITO |
| 1487 | 1487 | $x += $w; |
| 1488 | - $w = round($maxW*0.21, 0); |
|
| 1488 | + $w = round($maxW * 0.21, 0); |
|
| 1489 | 1489 | $w2 = $w; |
| 1490 | 1490 | $texto = 'BAIRRO / DISTRITO'; |
| 1491 | 1491 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
@@ -1495,12 +1495,12 @@ discard block |
||
| 1495 | 1495 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1496 | 1496 | //CEP |
| 1497 | 1497 | $x += $w; |
| 1498 | - $w = $maxW-$w1-$w2-$wx; |
|
| 1498 | + $w = $maxW - $w1 - $w2 - $wx; |
|
| 1499 | 1499 | $w2 = $w; |
| 1500 | 1500 | $texto = 'CEP'; |
| 1501 | 1501 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1502 | 1502 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1503 | - $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) |
|
| 1503 | + $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) |
|
| 1504 | 1504 | ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue |
| 1505 | 1505 | : ''; |
| 1506 | 1506 | $texto = $this->formatField($texto, "#####-###"); |
@@ -1512,11 +1512,11 @@ discard block |
||
| 1512 | 1512 | $texto = 'DATA DA SAÍDA/ENTRADA'; |
| 1513 | 1513 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1514 | 1514 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1515 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) |
|
| 1515 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) |
|
| 1516 | 1516 | ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue |
| 1517 | 1517 | : ''; |
| 1518 | 1518 | if ($dSaiEnt == '') { |
| 1519 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
| 1519 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
| 1520 | 1520 | ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue |
| 1521 | 1521 | : ''; |
| 1522 | 1522 | $aDsaient = explode('T', $dSaiEnt); |
@@ -1536,7 +1536,7 @@ discard block |
||
| 1536 | 1536 | if (strtoupper(trim($texto)) == "EXTERIOR" |
| 1537 | 1537 | && $this->dest->getElementsByTagName("xPais")->length > 0 |
| 1538 | 1538 | ) { |
| 1539 | - $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
| 1539 | + $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
| 1540 | 1540 | } |
| 1541 | 1541 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 1542 | 1542 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -1551,19 +1551,19 @@ discard block |
||
| 1551 | 1551 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1552 | 1552 | //FONE / FAX |
| 1553 | 1553 | $x += $w; |
| 1554 | - $w = round(($maxW -$w1-$wx-8)/2, 0); |
|
| 1554 | + $w = round(($maxW - $w1 - $wx - 8) / 2, 0); |
|
| 1555 | 1555 | $w3 = $w; |
| 1556 | 1556 | $texto = 'FONE / FAX'; |
| 1557 | 1557 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1558 | 1558 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1559 | - $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 1559 | + $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 1560 | 1560 | ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue |
| 1561 | 1561 | : ''; |
| 1562 | 1562 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 1563 | 1563 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1564 | 1564 | //INSCRIÇÃO ESTADUAL |
| 1565 | 1565 | $x += $w; |
| 1566 | - $w = $maxW -$w1-$wx-8-$w3; |
|
| 1566 | + $w = $maxW - $w1 - $wx - 8 - $w3; |
|
| 1567 | 1567 | $texto = 'INSCRIÇÃO ESTADUAL'; |
| 1568 | 1568 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1569 | 1569 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1577,11 +1577,11 @@ discard block |
||
| 1577 | 1577 | $texto = 'HORA DA SAÍDA/ENTRADA'; |
| 1578 | 1578 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1579 | 1579 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1580 | - $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) |
|
| 1580 | + $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) |
|
| 1581 | 1581 | ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue |
| 1582 | 1582 | : ''; |
| 1583 | 1583 | if ($hSaiEnt == '') { |
| 1584 | - $dhSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
| 1584 | + $dhSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
| 1585 | 1585 | ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue |
| 1586 | 1586 | : ''; |
| 1587 | 1587 | $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt); |
@@ -1620,7 +1620,7 @@ discard block |
||
| 1620 | 1620 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 1621 | 1621 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1622 | 1622 | //NOME / RAZÃO SOCIAL |
| 1623 | - $w = round($maxW*0.61, 0); |
|
| 1623 | + $w = round($maxW * 0.61, 0); |
|
| 1624 | 1624 | $w1 = $w; |
| 1625 | 1625 | $y += 3; |
| 1626 | 1626 | $texto = 'NOME / RAZÃO SOCIAL'; |
@@ -1638,19 +1638,19 @@ discard block |
||
| 1638 | 1638 | } |
| 1639 | 1639 | //CNPJ / CPF |
| 1640 | 1640 | $x += $w; |
| 1641 | - $w = round($maxW*0.23, 0); |
|
| 1641 | + $w = round($maxW * 0.23, 0); |
|
| 1642 | 1642 | $w2 = $w; |
| 1643 | 1643 | $texto = 'CNPJ / CPF'; |
| 1644 | 1644 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1645 | 1645 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1646 | 1646 | //Pegando valor do CPF/CNPJ |
| 1647 | - if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1647 | + if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1648 | 1648 | $texto = $this->formatField( |
| 1649 | 1649 | $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1650 | 1650 | "###.###.###/####-##" |
| 1651 | 1651 | ); |
| 1652 | 1652 | } else { |
| 1653 | - $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1653 | + $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1654 | 1654 | $this->formatField( |
| 1655 | 1655 | $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1656 | 1656 | "###.###.###-##" |
@@ -1660,7 +1660,7 @@ discard block |
||
| 1660 | 1660 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1661 | 1661 | //INSCRIÇÃO ESTADUAL |
| 1662 | 1662 | $x += $w; |
| 1663 | - $w = $maxW-($w1+$w2); |
|
| 1663 | + $w = $maxW - ($w1 + $w2); |
|
| 1664 | 1664 | $wx = $w; |
| 1665 | 1665 | $texto = 'INSCRIÇÃO ESTADUAL'; |
| 1666 | 1666 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
@@ -1676,7 +1676,7 @@ discard block |
||
| 1676 | 1676 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, ''); |
| 1677 | 1677 | } |
| 1678 | 1678 | //ENDEREÇO |
| 1679 | - $w = round($maxW*0.355, 0) + $wx; |
|
| 1679 | + $w = round($maxW * 0.355, 0) + $wx; |
|
| 1680 | 1680 | $w1 = $w; |
| 1681 | 1681 | $y += $h; |
| 1682 | 1682 | $x = $oldX; |
@@ -1690,7 +1690,7 @@ discard block |
||
| 1690 | 1690 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
| 1691 | 1691 | //BAIRRO / DISTRITO |
| 1692 | 1692 | $x += $w; |
| 1693 | - $w = round($maxW*0.335, 0); |
|
| 1693 | + $w = round($maxW * 0.335, 0); |
|
| 1694 | 1694 | $w2 = $w; |
| 1695 | 1695 | $texto = 'BAIRRO / DISTRITO'; |
| 1696 | 1696 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
@@ -1700,17 +1700,17 @@ discard block |
||
| 1700 | 1700 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1701 | 1701 | //CEP |
| 1702 | 1702 | $x += $w; |
| 1703 | - $w = $maxW-($w1+$w2); |
|
| 1703 | + $w = $maxW - ($w1 + $w2); |
|
| 1704 | 1704 | $texto = 'CEP'; |
| 1705 | 1705 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1706 | 1706 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1707 | - $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1707 | + $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1708 | 1708 | $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
| 1709 | 1709 | $texto = $this->formatField($texto, "#####-###"); |
| 1710 | 1710 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
| 1711 | 1711 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1712 | 1712 | //MUNICÍPIO |
| 1713 | - $w = round($maxW*0.805, 0); |
|
| 1713 | + $w = round($maxW * 0.805, 0); |
|
| 1714 | 1714 | $w1 = $w; |
| 1715 | 1715 | $y += $h; |
| 1716 | 1716 | $x = $oldX; |
@@ -1719,7 +1719,7 @@ discard block |
||
| 1719 | 1719 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1720 | 1720 | $texto = $this->entrega->getElementsByTagName("xMun")->item(0)->nodeValue; |
| 1721 | 1721 | if (strtoupper(trim($texto)) == "EXTERIOR" && $this->entrega->getElementsByTagName("xPais")->length > 0) { |
| 1722 | - $texto .= " - " . $this->entrega->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
| 1722 | + $texto .= " - " . $this->entrega->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
| 1723 | 1723 | } |
| 1724 | 1724 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
| 1725 | 1725 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -1734,11 +1734,11 @@ discard block |
||
| 1734 | 1734 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1735 | 1735 | //FONE / FAX |
| 1736 | 1736 | $x += $w; |
| 1737 | - $w = $maxW-$w-$w1; |
|
| 1737 | + $w = $maxW - $w - $w1; |
|
| 1738 | 1738 | $texto = 'FONE / FAX'; |
| 1739 | 1739 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1740 | 1740 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1741 | - $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1741 | + $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1742 | 1742 | $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
| 1743 | 1743 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
| 1744 | 1744 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -1770,7 +1770,7 @@ discard block |
||
| 1770 | 1770 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 1771 | 1771 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1772 | 1772 | //NOME / RAZÃO SOCIAL |
| 1773 | - $w = round($maxW*0.61, 0); |
|
| 1773 | + $w = round($maxW * 0.61, 0); |
|
| 1774 | 1774 | $w1 = $w; |
| 1775 | 1775 | $y += 3; |
| 1776 | 1776 | $texto = 'NOME / RAZÃO SOCIAL'; |
@@ -1788,19 +1788,19 @@ discard block |
||
| 1788 | 1788 | } |
| 1789 | 1789 | //CNPJ / CPF |
| 1790 | 1790 | $x += $w; |
| 1791 | - $w = round($maxW*0.23, 0); |
|
| 1791 | + $w = round($maxW * 0.23, 0); |
|
| 1792 | 1792 | $w2 = $w; |
| 1793 | 1793 | $texto = 'CNPJ / CPF'; |
| 1794 | 1794 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1795 | 1795 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1796 | 1796 | //Pegando valor do CPF/CNPJ |
| 1797 | - if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1797 | + if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1798 | 1798 | $texto = $this->formatField( |
| 1799 | 1799 | $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1800 | 1800 | "###.###.###/####-##" |
| 1801 | 1801 | ); |
| 1802 | 1802 | } else { |
| 1803 | - $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1803 | + $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1804 | 1804 | $this->formatField( |
| 1805 | 1805 | $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1806 | 1806 | "###.###.###-##" |
@@ -1810,7 +1810,7 @@ discard block |
||
| 1810 | 1810 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1811 | 1811 | //INSCRIÇÃO ESTADUAL |
| 1812 | 1812 | $x += $w; |
| 1813 | - $w = $maxW-($w1+$w2); |
|
| 1813 | + $w = $maxW - ($w1 + $w2); |
|
| 1814 | 1814 | $wx = $w; |
| 1815 | 1815 | $texto = 'INSCRIÇÃO ESTADUAL'; |
| 1816 | 1816 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
@@ -1826,7 +1826,7 @@ discard block |
||
| 1826 | 1826 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, ''); |
| 1827 | 1827 | } |
| 1828 | 1828 | //ENDEREÇO |
| 1829 | - $w = round($maxW*0.355, 0) + $wx; |
|
| 1829 | + $w = round($maxW * 0.355, 0) + $wx; |
|
| 1830 | 1830 | $w1 = $w; |
| 1831 | 1831 | $y += $h; |
| 1832 | 1832 | $x = $oldX; |
@@ -1840,7 +1840,7 @@ discard block |
||
| 1840 | 1840 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
| 1841 | 1841 | //BAIRRO / DISTRITO |
| 1842 | 1842 | $x += $w; |
| 1843 | - $w = round($maxW*0.335, 0); |
|
| 1843 | + $w = round($maxW * 0.335, 0); |
|
| 1844 | 1844 | $w2 = $w; |
| 1845 | 1845 | $texto = 'BAIRRO / DISTRITO'; |
| 1846 | 1846 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
@@ -1850,17 +1850,17 @@ discard block |
||
| 1850 | 1850 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1851 | 1851 | //CEP |
| 1852 | 1852 | $x += $w; |
| 1853 | - $w = $maxW-($w1+$w2); |
|
| 1853 | + $w = $maxW - ($w1 + $w2); |
|
| 1854 | 1854 | $texto = 'CEP'; |
| 1855 | 1855 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1856 | 1856 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1857 | - $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1857 | + $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1858 | 1858 | $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
| 1859 | 1859 | $texto = $this->formatField($texto, "#####-###"); |
| 1860 | 1860 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
| 1861 | 1861 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1862 | 1862 | //MUNICÍPIO |
| 1863 | - $w = round($maxW*0.805, 0); |
|
| 1863 | + $w = round($maxW * 0.805, 0); |
|
| 1864 | 1864 | $w1 = $w; |
| 1865 | 1865 | $y += $h; |
| 1866 | 1866 | $x = $oldX; |
@@ -1869,7 +1869,7 @@ discard block |
||
| 1869 | 1869 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1870 | 1870 | $texto = $this->retirada->getElementsByTagName("xMun")->item(0)->nodeValue; |
| 1871 | 1871 | if (strtoupper(trim($texto)) == "EXTERIOR" && $this->retirada->getElementsByTagName("xPais")->length > 0) { |
| 1872 | - $texto .= " - " . $this->retirada->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
| 1872 | + $texto .= " - " . $this->retirada->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
| 1873 | 1873 | } |
| 1874 | 1874 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
| 1875 | 1875 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -1884,11 +1884,11 @@ discard block |
||
| 1884 | 1884 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1885 | 1885 | //FONE / FAX |
| 1886 | 1886 | $x += $w; |
| 1887 | - $w = $maxW-$w-$w1; |
|
| 1887 | + $w = $maxW - $w - $w1; |
|
| 1888 | 1888 | $texto = 'FONE / FAX'; |
| 1889 | 1889 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1890 | 1890 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1891 | - $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1891 | + $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1892 | 1892 | $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
| 1893 | 1893 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
| 1894 | 1894 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -1961,7 +1961,7 @@ discard block |
||
| 1961 | 1961 | protected function fatura($x, $y) |
| 1962 | 1962 | { |
| 1963 | 1963 | $linha = 1; |
| 1964 | - $h = 8+3; |
|
| 1964 | + $h = 8 + 3; |
|
| 1965 | 1965 | $oldx = $x; |
| 1966 | 1966 | $textoFatura = $this->getTextoFatura(); |
| 1967 | 1967 | //verificar se existem duplicatas |
@@ -1994,29 +1994,29 @@ discard block |
||
| 1994 | 1994 | return ($y + $h - 3); |
| 1995 | 1995 | } |
| 1996 | 1996 | if ($textoFatura !== "" && $this->exibirTextoFatura) { |
| 1997 | - $myH=6; |
|
| 1997 | + $myH = 6; |
|
| 1998 | 1998 | $myW = $this->wPrint; |
| 1999 | 1999 | if ($this->orientacao == 'L') { |
| 2000 | 2000 | $myW -= $this->wCanhoto; |
| 2001 | 2001 | } |
| 2002 | 2002 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 2003 | 2003 | $this->pdf->textBox($x, $y, $myW, $myH, $textoFatura, $aFont, 'C', 'L', 1, ''); |
| 2004 | - $y+=$myH+1; |
|
| 2004 | + $y += $myH + 1; |
|
| 2005 | 2005 | } |
| 2006 | 2006 | if ($this->orientacao == 'P') { |
| 2007 | - $w = round($this->wPrint/7.018, 0)-1; |
|
| 2007 | + $w = round($this->wPrint / 7.018, 0) - 1; |
|
| 2008 | 2008 | } else { |
| 2009 | 2009 | $w = 28; |
| 2010 | 2010 | } |
| 2011 | 2011 | $increm = 1; |
| 2012 | 2012 | foreach ($this->dup as $k => $d) { |
| 2013 | - $nDup = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) |
|
| 2013 | + $nDup = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) |
|
| 2014 | 2014 | ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue |
| 2015 | 2015 | : ''; |
| 2016 | - $dDup = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
|
| 2016 | + $dDup = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
|
| 2017 | 2017 | ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
| 2018 | 2018 | : ''; |
| 2019 | - $vDup = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) |
|
| 2019 | + $vDup = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) |
|
| 2020 | 2020 | ? 'R$ ' . number_format( |
| 2021 | 2021 | $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue, |
| 2022 | 2022 | 2, |
@@ -2026,14 +2026,14 @@ discard block |
||
| 2026 | 2026 | : ''; |
| 2027 | 2027 | $h = 8; |
| 2028 | 2028 | $texto = ''; |
| 2029 | - if ($nDup!='0' && $nDup!='') { |
|
| 2029 | + if ($nDup != '0' && $nDup != '') { |
|
| 2030 | 2030 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2031 | 2031 | $this->pdf->textBox($x, $y, $w, $h, 'Num.', $aFont, 'T', 'L', 1, ''); |
| 2032 | 2032 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 2033 | 2033 | $this->pdf->textBox($x, $y, $w, $h, $nDup, $aFont, 'T', 'R', 0, ''); |
| 2034 | 2034 | } else { |
| 2035 | 2035 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2036 | - $this->pdf->textBox($x, $y, $w, $h, ($dupcont+1)."", $aFont, 'T', 'L', 1, ''); |
|
| 2036 | + $this->pdf->textBox($x, $y, $w, $h, ($dupcont + 1) . "", $aFont, 'T', 'L', 1, ''); |
|
| 2037 | 2037 | } |
| 2038 | 2038 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2039 | 2039 | $this->pdf->textBox($x, $y, $w, $h, 'Venc.', $aFont, 'C', 'L', 0, ''); |
@@ -2043,7 +2043,7 @@ discard block |
||
| 2043 | 2043 | $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, ''); |
| 2044 | 2044 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 2045 | 2045 | $this->pdf->textBox($x, $y, $w, $h, $vDup, $aFont, 'B', 'R', 0, ''); |
| 2046 | - $x += $w+$increm; |
|
| 2046 | + $x += $w + $increm; |
|
| 2047 | 2047 | $dupcont += 1; |
| 2048 | 2048 | if ($this->orientacao == 'P') { |
| 2049 | 2049 | $maxDupCont = 6; |
@@ -2065,10 +2065,10 @@ discard block |
||
| 2065 | 2065 | $y -= 9; |
| 2066 | 2066 | $linha--; |
| 2067 | 2067 | } |
| 2068 | - return ($y+$h); |
|
| 2068 | + return ($y + $h); |
|
| 2069 | 2069 | } else { |
| 2070 | 2070 | $linha = 0; |
| 2071 | - return ($y-2); |
|
| 2071 | + return ($y - 2); |
|
| 2072 | 2072 | } |
| 2073 | 2073 | } |
| 2074 | 2074 | |
@@ -2084,7 +2084,7 @@ discard block |
||
| 2084 | 2084 | protected function pagamento($x, $y) |
| 2085 | 2085 | { |
| 2086 | 2086 | $linha = 1; |
| 2087 | - $h = 8+3; |
|
| 2087 | + $h = 8 + 3; |
|
| 2088 | 2088 | $oldx = $x; |
| 2089 | 2089 | //verificar se existem cobranças definidas |
| 2090 | 2090 | if (isset($this->detPag) && $this->detPag->length > 0) { |
@@ -2103,7 +2103,7 @@ discard block |
||
| 2103 | 2103 | $dups = ""; |
| 2104 | 2104 | $dupcont = 0; |
| 2105 | 2105 | if ($this->orientacao == 'P') { |
| 2106 | - $w = round($this->wPrint/7.018, 0)-1; |
|
| 2106 | + $w = round($this->wPrint / 7.018, 0) - 1; |
|
| 2107 | 2107 | } else { |
| 2108 | 2108 | $w = 28; |
| 2109 | 2109 | } |
@@ -2113,17 +2113,17 @@ discard block |
||
| 2113 | 2113 | $maxDupCont = 8; |
| 2114 | 2114 | } |
| 2115 | 2115 | $increm = 1; |
| 2116 | - $formaPagamento = ['01'=>'Dinheiro','02'=>'Cheque','03'=>'Cartão de Crédito', |
|
| 2117 | - '04'=>'Cartão de Débito','05'=>'Crédito Loja','10'=>'Vale Alimentação', |
|
| 2118 | - '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível', |
|
| 2119 | - '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros']; |
|
| 2120 | - $bandeira = ['01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners', |
|
| 2121 | - '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros']; |
|
| 2116 | + $formaPagamento = ['01'=>'Dinheiro', '02'=>'Cheque', '03'=>'Cartão de Crédito', |
|
| 2117 | + '04'=>'Cartão de Débito', '05'=>'Crédito Loja', '10'=>'Vale Alimentação', |
|
| 2118 | + '11'=>'Vale Refeição', '12'=>'Vale Presente', '13'=>'Vale Combustível', |
|
| 2119 | + '14'=>'Duplicata Mercantil', '15'=>'Boleto', '90'=>'Sem pagamento', '99'=>'Outros']; |
|
| 2120 | + $bandeira = ['01'=>'Visa', '02'=>'Mastercard', '03'=>'American', '04'=>'Sorocred', '05'=>'Diners', |
|
| 2121 | + '06'=>'Elo', '07'=>'Hipercard', '08'=>'Aura', '09'=>'Cabal', '99'=>'Outros']; |
|
| 2122 | 2122 | foreach ($this->detPag as $k => $d) { |
| 2123 | 2123 | $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
| 2124 | 2124 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue |
| 2125 | 2125 | : '0'; |
| 2126 | - $vPag = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
| 2126 | + $vPag = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
| 2127 | 2127 | ? 'R$ ' . number_format( |
| 2128 | 2128 | $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue, |
| 2129 | 2129 | 2, |
@@ -2135,7 +2135,7 @@ discard block |
||
| 2135 | 2135 | $texto = ''; |
| 2136 | 2136 | if (isset($formaPagamento[$fPag])) { |
| 2137 | 2137 | /*Exibir Item sem pagamento ou outros?*/ |
| 2138 | - if ($fPag=='90' || $fPag=='99') { |
|
| 2138 | + if ($fPag == '90' || $fPag == '99') { |
|
| 2139 | 2139 | continue; |
| 2140 | 2140 | } |
| 2141 | 2141 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
@@ -2144,16 +2144,16 @@ discard block |
||
| 2144 | 2144 | $this->pdf->textBox($x, $y, $w, $h, $formaPagamento[$fPag], $aFont, 'T', 'R', 0, ''); |
| 2145 | 2145 | } else { |
| 2146 | 2146 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 2147 | - $this->pdf->textBox($x, $y, $w, $h, "Forma ".$fPag." não encontrado", $aFont, 'T', 'L', 1, ''); |
|
| 2147 | + $this->pdf->textBox($x, $y, $w, $h, "Forma " . $fPag . " não encontrado", $aFont, 'T', 'L', 1, ''); |
|
| 2148 | 2148 | } |
| 2149 | 2149 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2150 | 2150 | $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, ''); |
| 2151 | 2151 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 2152 | 2152 | $this->pdf->textBox($x, $y, $w, $h, $vPag, $aFont, 'B', 'R', 0, ''); |
| 2153 | - $x += $w+$increm; |
|
| 2153 | + $x += $w + $increm; |
|
| 2154 | 2154 | $dupcont += 1; |
| 2155 | 2155 | |
| 2156 | - if ($dupcont>$maxDupCont) { |
|
| 2156 | + if ($dupcont > $maxDupCont) { |
|
| 2157 | 2157 | $y += 9; |
| 2158 | 2158 | $x = $oldx; |
| 2159 | 2159 | $dupcont = 0; |
@@ -2168,10 +2168,10 @@ discard block |
||
| 2168 | 2168 | $y -= 9; |
| 2169 | 2169 | $linha--; |
| 2170 | 2170 | } |
| 2171 | - return ($y+$h); |
|
| 2171 | + return ($y + $h); |
|
| 2172 | 2172 | } else { |
| 2173 | 2173 | $linha = 0; |
| 2174 | - return ($y-2); |
|
| 2174 | + return ($y - 2); |
|
| 2175 | 2175 | } |
| 2176 | 2176 | } //fim da função pagamento |
| 2177 | 2177 | |
@@ -2283,7 +2283,7 @@ discard block |
||
| 2283 | 2283 | } |
| 2284 | 2284 | $x = $this->impostoHelper($x, $y, $w, $h, "V. TOTAL DA NOTA", "vNF"); |
| 2285 | 2285 | |
| 2286 | - return ($y+$h); |
|
| 2286 | + return ($y + $h); |
|
| 2287 | 2287 | } //fim imposto |
| 2288 | 2288 | |
| 2289 | 2289 | /** |
@@ -2311,13 +2311,13 @@ discard block |
||
| 2311 | 2311 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 2312 | 2312 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2313 | 2313 | //NOME / RAZÃO SOCIAL |
| 2314 | - $w1 = $maxW*0.29; |
|
| 2314 | + $w1 = $maxW * 0.29; |
|
| 2315 | 2315 | $y += 3; |
| 2316 | 2316 | $texto = 'NOME / RAZÃO SOCIAL'; |
| 2317 | 2317 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2318 | 2318 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2319 | 2319 | if (isset($this->transporta)) { |
| 2320 | - $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) |
|
| 2320 | + $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) |
|
| 2321 | 2321 | ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue |
| 2322 | 2322 | : ''; |
| 2323 | 2323 | } else { |
@@ -2327,11 +2327,11 @@ discard block |
||
| 2327 | 2327 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 2328 | 2328 | //FRETE POR CONTA |
| 2329 | 2329 | $x += $w1; |
| 2330 | - $w2 = $maxW*0.15; |
|
| 2330 | + $w2 = $maxW * 0.15; |
|
| 2331 | 2331 | $texto = 'FRETE'; |
| 2332 | 2332 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2333 | 2333 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2334 | - $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) |
|
| 2334 | + $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) |
|
| 2335 | 2335 | ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue |
| 2336 | 2336 | : '0'; |
| 2337 | 2337 | switch ($tipoFrete) { |
@@ -2362,7 +2362,7 @@ discard block |
||
| 2362 | 2362 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2363 | 2363 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2364 | 2364 | if (isset($this->veicTransp)) { |
| 2365 | - $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) |
|
| 2365 | + $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) |
|
| 2366 | 2366 | ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue |
| 2367 | 2367 | : ''; |
| 2368 | 2368 | } else { |
@@ -2376,11 +2376,11 @@ discard block |
||
| 2376 | 2376 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2377 | 2377 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2378 | 2378 | if (isset($this->veicTransp)) { |
| 2379 | - $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) |
|
| 2379 | + $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) |
|
| 2380 | 2380 | ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue |
| 2381 | 2381 | : ''; |
| 2382 | 2382 | } elseif (isset($this->reboque)) { |
| 2383 | - $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) |
|
| 2383 | + $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) |
|
| 2384 | 2384 | ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue |
| 2385 | 2385 | : ''; |
| 2386 | 2386 | } else { |
@@ -2390,16 +2390,16 @@ discard block |
||
| 2390 | 2390 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2391 | 2391 | //UF |
| 2392 | 2392 | $x += $w2; |
| 2393 | - $w3 = round($maxW*0.04, 0); |
|
| 2393 | + $w3 = round($maxW * 0.04, 0); |
|
| 2394 | 2394 | $texto = 'UF'; |
| 2395 | 2395 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2396 | 2396 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2397 | 2397 | if (isset($this->veicTransp)) { |
| 2398 | - $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2398 | + $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2399 | 2399 | ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue |
| 2400 | 2400 | : ''; |
| 2401 | 2401 | } elseif (isset($this->reboque)) { |
| 2402 | - $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2402 | + $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2403 | 2403 | ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue |
| 2404 | 2404 | : ''; |
| 2405 | 2405 | } else { |
@@ -2409,19 +2409,19 @@ discard block |
||
| 2409 | 2409 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2410 | 2410 | //CNPJ / CPF |
| 2411 | 2411 | $x += $w3; |
| 2412 | - $w = $maxW-($w1+3*$w2+$w3); |
|
| 2412 | + $w = $maxW - ($w1 + 3 * $w2 + $w3); |
|
| 2413 | 2413 | $texto = 'CNPJ / CPF'; |
| 2414 | 2414 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2415 | 2415 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2416 | 2416 | if (isset($this->transporta)) { |
| 2417 | - $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
|
| 2417 | + $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
|
| 2418 | 2418 | ? $this->formatField( |
| 2419 | 2419 | $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 2420 | 2420 | "##.###.###/####-##" |
| 2421 | 2421 | ) |
| 2422 | 2422 | : ''; |
| 2423 | 2423 | if ($texto == '') { |
| 2424 | - $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 2424 | + $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 2425 | 2425 | ? $this->formatField( |
| 2426 | 2426 | $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 2427 | 2427 | "###.###.###-##" |
@@ -2438,12 +2438,12 @@ discard block |
||
| 2438 | 2438 | $y += $h; |
| 2439 | 2439 | $x = $oldX; |
| 2440 | 2440 | $h = 7; |
| 2441 | - $w1 = $maxW*0.44; |
|
| 2441 | + $w1 = $maxW * 0.44; |
|
| 2442 | 2442 | $texto = 'ENDEREÇO'; |
| 2443 | 2443 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2444 | 2444 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2445 | 2445 | if (isset($this->transporta)) { |
| 2446 | - $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) |
|
| 2446 | + $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) |
|
| 2447 | 2447 | ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue |
| 2448 | 2448 | : ''; |
| 2449 | 2449 | } else { |
@@ -2453,12 +2453,12 @@ discard block |
||
| 2453 | 2453 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 2454 | 2454 | //MUNICÍPIO |
| 2455 | 2455 | $x += $w1; |
| 2456 | - $w2 = round($maxW*0.30, 0); |
|
| 2456 | + $w2 = round($maxW * 0.30, 0); |
|
| 2457 | 2457 | $texto = 'MUNICÍPIO'; |
| 2458 | 2458 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2459 | 2459 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2460 | 2460 | if (isset($this->transporta)) { |
| 2461 | - $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) |
|
| 2461 | + $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) |
|
| 2462 | 2462 | ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue |
| 2463 | 2463 | : ''; |
| 2464 | 2464 | } else { |
@@ -2468,12 +2468,12 @@ discard block |
||
| 2468 | 2468 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2469 | 2469 | //UF |
| 2470 | 2470 | $x += $w2; |
| 2471 | - $w3 = round($maxW*0.04, 0); |
|
| 2471 | + $w3 = round($maxW * 0.04, 0); |
|
| 2472 | 2472 | $texto = 'UF'; |
| 2473 | 2473 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2474 | 2474 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2475 | 2475 | if (isset($this->transporta)) { |
| 2476 | - $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2476 | + $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2477 | 2477 | ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue |
| 2478 | 2478 | : ''; |
| 2479 | 2479 | } else { |
@@ -2483,13 +2483,13 @@ discard block |
||
| 2483 | 2483 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2484 | 2484 | //INSCRIÇÃO ESTADUAL |
| 2485 | 2485 | $x += $w3; |
| 2486 | - $w = $maxW-($w1+$w2+$w3); |
|
| 2486 | + $w = $maxW - ($w1 + $w2 + $w3); |
|
| 2487 | 2487 | $texto = 'INSCRIÇÃO ESTADUAL'; |
| 2488 | 2488 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2489 | 2489 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2490 | 2490 | $texto = ''; |
| 2491 | 2491 | if (isset($this->transporta)) { |
| 2492 | - if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
| 2492 | + if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
| 2493 | 2493 | $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue; |
| 2494 | 2494 | } |
| 2495 | 2495 | } |
@@ -2502,16 +2502,16 @@ discard block |
||
| 2502 | 2502 | $marca = ''; |
| 2503 | 2503 | $numero = ''; |
| 2504 | 2504 | $texto = ''; |
| 2505 | - $pesoBruto=0; |
|
| 2506 | - $pesoLiquido=0; |
|
| 2505 | + $pesoBruto = 0; |
|
| 2506 | + $pesoLiquido = 0; |
|
| 2507 | 2507 | foreach ($volumes as $volume) { |
| 2508 | - $quantidade += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
| 2508 | + $quantidade += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
| 2509 | 2509 | $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0; |
| 2510 | - $pesoBruto += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
| 2510 | + $pesoBruto += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
| 2511 | 2511 | $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0; |
| 2512 | - $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
| 2512 | + $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
| 2513 | 2513 | $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0; |
| 2514 | - $texto = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
| 2514 | + $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
| 2515 | 2515 | $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : ''; |
| 2516 | 2516 | if ($texto != $especie && $especie != '') { |
| 2517 | 2517 | //tem várias especies |
@@ -2519,7 +2519,7 @@ discard block |
||
| 2519 | 2519 | } else { |
| 2520 | 2520 | $especie = $texto; |
| 2521 | 2521 | } |
| 2522 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) |
|
| 2522 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) |
|
| 2523 | 2523 | ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue |
| 2524 | 2524 | : ''; |
| 2525 | 2525 | if ($texto != $marca && $marca != '') { |
@@ -2528,7 +2528,7 @@ discard block |
||
| 2528 | 2528 | } else { |
| 2529 | 2529 | $marca = $texto; |
| 2530 | 2530 | } |
| 2531 | - $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) |
|
| 2531 | + $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) |
|
| 2532 | 2532 | ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue |
| 2533 | 2533 | : ''; |
| 2534 | 2534 | if ($texto != $numero && $numero != '') { |
@@ -2544,7 +2544,7 @@ discard block |
||
| 2544 | 2544 | $y += $h; |
| 2545 | 2545 | $x = $oldX; |
| 2546 | 2546 | $h = 7; |
| 2547 | - $w1 = round($maxW*0.10, 0); |
|
| 2547 | + $w1 = round($maxW * 0.10, 0); |
|
| 2548 | 2548 | $texto = 'QUANTIDADE'; |
| 2549 | 2549 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2550 | 2550 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2555,7 +2555,7 @@ discard block |
||
| 2555 | 2555 | } |
| 2556 | 2556 | //ESPÉCIE |
| 2557 | 2557 | $x += $w1; |
| 2558 | - $w2 = round($maxW*0.17, 0); |
|
| 2558 | + $w2 = round($maxW * 0.17, 0); |
|
| 2559 | 2559 | $texto = 'ESPÉCIE'; |
| 2560 | 2560 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2561 | 2561 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2567,7 +2567,7 @@ discard block |
||
| 2567 | 2567 | $texto = 'MARCA'; |
| 2568 | 2568 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2569 | 2569 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2570 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2570 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2571 | 2571 | $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : ''; |
| 2572 | 2572 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 2573 | 2573 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -2581,7 +2581,7 @@ discard block |
||
| 2581 | 2581 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2582 | 2582 | //PESO BRUTO |
| 2583 | 2583 | $x += $w2; |
| 2584 | - $w3 = round($maxW*0.20, 0); |
|
| 2584 | + $w3 = round($maxW * 0.20, 0); |
|
| 2585 | 2585 | $texto = 'PESO BRUTO'; |
| 2586 | 2586 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2587 | 2587 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2594,7 +2594,7 @@ discard block |
||
| 2594 | 2594 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 2595 | 2595 | //PESO LÍQUIDO |
| 2596 | 2596 | $x += $w3; |
| 2597 | - $w = $maxW -($w1+3*$w2+$w3); |
|
| 2597 | + $w = $maxW - ($w1 + 3 * $w2 + $w3); |
|
| 2598 | 2598 | $texto = 'PESO LÍQUIDO'; |
| 2599 | 2599 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2600 | 2600 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2605,7 +2605,7 @@ discard block |
||
| 2605 | 2605 | } |
| 2606 | 2606 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 2607 | 2607 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 2608 | - return ($y+$h); |
|
| 2608 | + return ($y + $h); |
|
| 2609 | 2609 | } //fim transporte |
| 2610 | 2610 | |
| 2611 | 2611 | |
@@ -2617,7 +2617,7 @@ discard block |
||
| 2617 | 2617 | return ""; |
| 2618 | 2618 | } |
| 2619 | 2619 | $valor_original = $valor_original->nodeValue; |
| 2620 | - $valor = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
| 2620 | + $valor = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
| 2621 | 2621 | |
| 2622 | 2622 | if ($valor != "") { |
| 2623 | 2623 | return sprintf($formato, $valor); |
@@ -2664,18 +2664,18 @@ discard block |
||
| 2664 | 2664 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s"); |
| 2665 | 2665 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s"); |
| 2666 | 2666 | } |
| 2667 | - $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
| 2667 | + $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
| 2668 | 2668 | ? substr( |
| 2669 | 2669 | $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue), |
| 2670 | 2670 | 0, |
| 2671 | 2671 | 500 |
| 2672 | 2672 | ) |
| 2673 | 2673 | : ''; |
| 2674 | - if (! empty($infAdProd)) { |
|
| 2674 | + if (!empty($infAdProd)) { |
|
| 2675 | 2675 | $infAdProd = trim($infAdProd); |
| 2676 | 2676 | $infAdProd .= ' '; |
| 2677 | 2677 | } |
| 2678 | - $loteTxt =''; |
|
| 2678 | + $loteTxt = ''; |
|
| 2679 | 2679 | $rastro = $prod->getElementsByTagName("med"); |
| 2680 | 2680 | if (!empty($prod->getElementsByTagName("rastro"))) { |
| 2681 | 2681 | $rastro = $prod->getElementsByTagName("rastro"); |
@@ -2689,15 +2689,15 @@ discard block |
||
| 2689 | 2689 | $i++; |
| 2690 | 2690 | } |
| 2691 | 2691 | if ($loteTxt != '') { |
| 2692 | - $loteTxt.= ' '; |
|
| 2692 | + $loteTxt .= ' '; |
|
| 2693 | 2693 | } |
| 2694 | 2694 | } |
| 2695 | 2695 | //NT2013.006 FCI |
| 2696 | - $nFCI = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
| 2697 | - ' FCI:'.$itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
|
| 2698 | - $tmp_ad=$infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
|
| 2696 | + $nFCI = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
| 2697 | + ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
|
| 2698 | + $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
|
| 2699 | 2699 | $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue |
| 2700 | - . (strlen($tmp_ad)!=0?"\n ".$tmp_ad:''); |
|
| 2700 | + . (strlen($tmp_ad) != 0 ? "\n " . $tmp_ad : ''); |
|
| 2701 | 2701 | //decodifica os caracteres html no xml |
| 2702 | 2702 | $texto = html_entity_decode($texto); |
| 2703 | 2703 | if ($this->descProdQuebraLinha) { |
@@ -2747,104 +2747,104 @@ discard block |
||
| 2747 | 2747 | // cabecalho LOOP COM OS DADOS DOS PRODUTOS |
| 2748 | 2748 | //CÓDIGO PRODUTO |
| 2749 | 2749 | $texto = "CÓDIGO PRODUTO"; |
| 2750 | - $w1 = round($w*0.09, 0); |
|
| 2750 | + $w1 = round($w * 0.09, 0); |
|
| 2751 | 2751 | $h = 4; |
| 2752 | 2752 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2753 | 2753 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2754 | - $this->pdf->line($x+$w1, $y, $x+$w1, $y+$hmax); |
|
| 2754 | + $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax); |
|
| 2755 | 2755 | //DESCRIÇÃO DO PRODUTO / SERVIÇO |
| 2756 | 2756 | $x += $w1; |
| 2757 | - $w2 = round($w*0.28, 0); |
|
| 2757 | + $w2 = round($w * 0.28, 0); |
|
| 2758 | 2758 | $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO'; |
| 2759 | 2759 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2760 | 2760 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2761 | - $this->pdf->line($x+$w2, $y, $x+$w2, $y+$hmax); |
|
| 2761 | + $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax); |
|
| 2762 | 2762 | //NCM/SH |
| 2763 | 2763 | $x += $w2; |
| 2764 | - $w3 = round($w*0.06, 0); |
|
| 2764 | + $w3 = round($w * 0.06, 0); |
|
| 2765 | 2765 | $texto = 'NCM/SH'; |
| 2766 | 2766 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2767 | 2767 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2768 | - $this->pdf->line($x+$w3, $y, $x+$w3, $y+$hmax); |
|
| 2768 | + $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax); |
|
| 2769 | 2769 | //O/CST ou O/CSOSN |
| 2770 | 2770 | $x += $w3; |
| 2771 | - $w4 = round($w*0.05, 0); |
|
| 2772 | - $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2 |
|
| 2771 | + $w4 = round($w * 0.05, 0); |
|
| 2772 | + $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 ou CRT = 2 |
|
| 2773 | 2773 | if ($this->getTagValue($this->emit, 'CRT') == '3') { |
| 2774 | - $texto = 'O/CST';//Regime Normal |
|
| 2774 | + $texto = 'O/CST'; //Regime Normal |
|
| 2775 | 2775 | } |
| 2776 | 2776 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2777 | 2777 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2778 | - $this->pdf->line($x+$w4, $y, $x+$w4, $y+$hmax); |
|
| 2778 | + $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax); |
|
| 2779 | 2779 | //CFOP |
| 2780 | 2780 | $x += $w4; |
| 2781 | - $w5 = round($w*0.04, 0); |
|
| 2781 | + $w5 = round($w * 0.04, 0); |
|
| 2782 | 2782 | $texto = 'CFOP'; |
| 2783 | 2783 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2784 | 2784 | $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2785 | - $this->pdf->line($x+$w5, $y, $x+$w5, $y+$hmax); |
|
| 2785 | + $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax); |
|
| 2786 | 2786 | //UN |
| 2787 | 2787 | $x += $w5; |
| 2788 | - $w6 = round($w*0.03, 0); |
|
| 2788 | + $w6 = round($w * 0.03, 0); |
|
| 2789 | 2789 | $texto = 'UN'; |
| 2790 | 2790 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2791 | 2791 | $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2792 | - $this->pdf->line($x+$w6, $y, $x+$w6, $y+$hmax); |
|
| 2792 | + $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax); |
|
| 2793 | 2793 | //QUANT |
| 2794 | 2794 | $x += $w6; |
| 2795 | - $w7 = round($w*0.07, 0); |
|
| 2795 | + $w7 = round($w * 0.07, 0); |
|
| 2796 | 2796 | $texto = 'QUANT'; |
| 2797 | 2797 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2798 | 2798 | $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2799 | - $this->pdf->line($x+$w7, $y, $x+$w7, $y+$hmax); |
|
| 2799 | + $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax); |
|
| 2800 | 2800 | //VALOR UNIT |
| 2801 | 2801 | $x += $w7; |
| 2802 | - $w8 = round($w*0.06, 0); |
|
| 2802 | + $w8 = round($w * 0.06, 0); |
|
| 2803 | 2803 | $texto = 'VALOR UNIT'; |
| 2804 | 2804 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2805 | 2805 | $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2806 | - $this->pdf->line($x+$w8, $y, $x+$w8, $y+$hmax); |
|
| 2806 | + $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax); |
|
| 2807 | 2807 | //VALOR TOTAL |
| 2808 | 2808 | $x += $w8; |
| 2809 | - $w9 = round($w*0.06, 0); |
|
| 2809 | + $w9 = round($w * 0.06, 0); |
|
| 2810 | 2810 | $texto = 'VALOR TOTAL'; |
| 2811 | 2811 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2812 | 2812 | $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2813 | - $this->pdf->line($x+$w9, $y, $x+$w9, $y+$hmax); |
|
| 2813 | + $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax); |
|
| 2814 | 2814 | //B.CÁLC ICMS |
| 2815 | 2815 | $x += $w9; |
| 2816 | - $w10 = round($w*0.06, 0); |
|
| 2816 | + $w10 = round($w * 0.06, 0); |
|
| 2817 | 2817 | $texto = 'B.CÁLC ICMS'; |
| 2818 | 2818 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2819 | 2819 | $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2820 | - $this->pdf->line($x+$w10, $y, $x+$w10, $y+$hmax); |
|
| 2820 | + $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax); |
|
| 2821 | 2821 | //VALOR ICMS |
| 2822 | 2822 | $x += $w10; |
| 2823 | - $w11 = round($w*0.06, 0); |
|
| 2823 | + $w11 = round($w * 0.06, 0); |
|
| 2824 | 2824 | $texto = 'VALOR ICMS'; |
| 2825 | 2825 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2826 | 2826 | $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2827 | - $this->pdf->line($x+$w11, $y, $x+$w11, $y+$hmax); |
|
| 2827 | + $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax); |
|
| 2828 | 2828 | //VALOR IPI |
| 2829 | 2829 | $x += $w11; |
| 2830 | - $w12 = round($w*0.05, 0); |
|
| 2830 | + $w12 = round($w * 0.05, 0); |
|
| 2831 | 2831 | $texto = 'VALOR IPI'; |
| 2832 | 2832 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2833 | 2833 | $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2834 | - $this->pdf->line($x+$w12, $y, $x+$w12, $y+$hmax); |
|
| 2834 | + $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax); |
|
| 2835 | 2835 | //ALÍQ. ICMS |
| 2836 | 2836 | $x += $w12; |
| 2837 | - $w13 = round($w*0.035, 0); |
|
| 2837 | + $w13 = round($w * 0.035, 0); |
|
| 2838 | 2838 | $texto = 'ALÍQ. ICMS'; |
| 2839 | 2839 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2840 | 2840 | $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2841 | - $this->pdf->line($x+$w13, $y, $x+$w13, $y+$hmax); |
|
| 2841 | + $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax); |
|
| 2842 | 2842 | //ALÍQ. IPI |
| 2843 | 2843 | $x += $w13; |
| 2844 | - $w14 = $w-($w1+$w2+$w3+$w4+$w5+$w6+$w7+$w8+$w9+$w10+$w11+$w12+$w13); |
|
| 2844 | + $w14 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13); |
|
| 2845 | 2845 | $texto = 'ALÍQ. IPI'; |
| 2846 | 2846 | $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2847 | - $this->pdf->line($oldX, $y+$h+1, $oldX + $w, $y+$h+1); |
|
| 2847 | + $this->pdf->line($oldX, $y + $h + 1, $oldX + $w, $y + $h + 1); |
|
| 2848 | 2848 | $y += 5; |
| 2849 | 2849 | //################################################################################## |
| 2850 | 2850 | // LOOP COM OS DADOS DOS PRODUTOS |
@@ -2862,7 +2862,7 @@ discard block |
||
| 2862 | 2862 | $textoProduto = trim($this->descricaoProduto($thisItem)); |
| 2863 | 2863 | |
| 2864 | 2864 | $linhaDescr = $this->pdf->getNumLines($textoProduto, $w2, $aFont); |
| 2865 | - $h = round(($linhaDescr * $this->pdf->fontSize)+ ($linhaDescr * 0.5), 2); |
|
| 2865 | + $h = round(($linhaDescr * $this->pdf->fontSize) + ($linhaDescr * 0.5), 2); |
|
| 2866 | 2866 | $hUsado += $h; |
| 2867 | 2867 | |
| 2868 | 2868 | $diffH = $hmax - $hUsado; |
@@ -2875,11 +2875,11 @@ discard block |
||
| 2875 | 2875 | break; |
| 2876 | 2876 | } |
| 2877 | 2877 | } |
| 2878 | - $y_linha=$y+$h; |
|
| 2878 | + $y_linha = $y + $h; |
|
| 2879 | 2879 | // linha entre itens |
| 2880 | 2880 | $this->pdf->dashedHLine($oldX, $y_linha, $w, 0.1, 120); |
| 2881 | 2881 | //corrige o x |
| 2882 | - $x=$oldX; |
|
| 2882 | + $x = $oldX; |
|
| 2883 | 2883 | //codigo do produto |
| 2884 | 2884 | $texto = $prod->getElementsByTagName("cProd")->item(0)->nodeValue; |
| 2885 | 2885 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'C', 0, ''); |
@@ -2892,16 +2892,16 @@ discard block |
||
| 2892 | 2892 | } |
| 2893 | 2893 | $x += $w2; |
| 2894 | 2894 | //NCM |
| 2895 | - $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
| 2895 | + $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
| 2896 | 2896 | $prod->getElementsByTagName("NCM")->item(0)->nodeValue : ''; |
| 2897 | 2897 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2898 | 2898 | $x += $w3; |
| 2899 | 2899 | //CST |
| 2900 | 2900 | if (isset($ICMS)) { |
| 2901 | - $origem = $this->getTagValue($ICMS, "orig"); |
|
| 2902 | - $cst = $this->getTagValue($ICMS, "CST"); |
|
| 2903 | - $csosn = $this->getTagValue($ICMS, "CSOSN"); |
|
| 2904 | - $texto = $origem.$cst.$csosn; |
|
| 2901 | + $origem = $this->getTagValue($ICMS, "orig"); |
|
| 2902 | + $cst = $this->getTagValue($ICMS, "CST"); |
|
| 2903 | + $csosn = $this->getTagValue($ICMS, "CSOSN"); |
|
| 2904 | + $texto = $origem . $cst . $csosn; |
|
| 2905 | 2905 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2906 | 2906 | } |
| 2907 | 2907 | //CFOP |
@@ -2935,7 +2935,7 @@ discard block |
||
| 2935 | 2935 | //Valor da Base de calculo |
| 2936 | 2936 | $x += $w9; |
| 2937 | 2937 | if (isset($ICMS)) { |
| 2938 | - $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) |
|
| 2938 | + $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) |
|
| 2939 | 2939 | ? number_format( |
| 2940 | 2940 | $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue, |
| 2941 | 2941 | 2, |
@@ -2948,7 +2948,7 @@ discard block |
||
| 2948 | 2948 | //Valor do ICMS |
| 2949 | 2949 | $x += $w10; |
| 2950 | 2950 | if (isset($ICMS)) { |
| 2951 | - $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) |
|
| 2951 | + $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) |
|
| 2952 | 2952 | ? number_format( |
| 2953 | 2953 | $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue, |
| 2954 | 2954 | 2, |
@@ -2961,7 +2961,7 @@ discard block |
||
| 2961 | 2961 | //Valor do IPI |
| 2962 | 2962 | $x += $w11; |
| 2963 | 2963 | if (isset($IPI)) { |
| 2964 | - $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) |
|
| 2964 | + $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) |
|
| 2965 | 2965 | ? number_format( |
| 2966 | 2966 | $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, |
| 2967 | 2967 | 2, |
@@ -2976,7 +2976,7 @@ discard block |
||
| 2976 | 2976 | // %ICMS |
| 2977 | 2977 | $x += $w12; |
| 2978 | 2978 | if (isset($ICMS)) { |
| 2979 | - $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) |
|
| 2979 | + $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) |
|
| 2980 | 2980 | ? number_format( |
| 2981 | 2981 | $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue, |
| 2982 | 2982 | 2, |
@@ -2989,7 +2989,7 @@ discard block |
||
| 2989 | 2989 | //%IPI |
| 2990 | 2990 | $x += $w13; |
| 2991 | 2991 | if (isset($IPI)) { |
| 2992 | - $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) |
|
| 2992 | + $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) |
|
| 2993 | 2993 | ? number_format( |
| 2994 | 2994 | $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue, |
| 2995 | 2995 | 2, |
@@ -3020,7 +3020,7 @@ discard block |
||
| 3020 | 3020 | $i++; |
| 3021 | 3021 | } |
| 3022 | 3022 | } |
| 3023 | - return $oldY+$hmax; |
|
| 3023 | + return $oldY + $hmax; |
|
| 3024 | 3024 | } |
| 3025 | 3025 | |
| 3026 | 3026 | |
@@ -3054,7 +3054,7 @@ discard block |
||
| 3054 | 3054 | |
| 3055 | 3055 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 3056 | 3056 | |
| 3057 | - $w1 = round($w*0.09, 0); |
|
| 3057 | + $w1 = round($w * 0.09, 0); |
|
| 3058 | 3058 | |
| 3059 | 3059 | // Tabela Renavam Combustivel |
| 3060 | 3060 | $renavamCombustivel = [ |
@@ -3149,54 +3149,54 @@ discard block |
||
| 3149 | 3149 | |
| 3150 | 3150 | $yVeic = $y + $h; |
| 3151 | 3151 | $texto = 'Chassi: ............: ' . $veiculoChassi; |
| 3152 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3152 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3153 | 3153 | $yVeic += $h; |
| 3154 | 3154 | $texto = 'Cor...................: ' . $veiculoCor; |
| 3155 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3155 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3156 | 3156 | $yVeic += $h; |
| 3157 | 3157 | $texto = 'Cilindrada........: ' . $veiculoCilindrada; |
| 3158 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3158 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3159 | 3159 | $yVeic += $h; |
| 3160 | 3160 | $texto = 'Cmkg...............: ' . $veiculoCmkg; |
| 3161 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3161 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3162 | 3162 | $yVeic += $h; |
| 3163 | 3163 | $texto = 'Tipo.................: ' . ($renavamTiposVeiculos[intval($veiculoTipo)] ?? $veiculoTipo); |
| 3164 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3164 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3165 | 3165 | $yVeic = $y + $h; |
| 3166 | 3166 | $xVeic = $x + 65; |
| 3167 | 3167 | $texto = 'Nº Motor: .........: ' . $veiculoMotor; |
| 3168 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3168 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3169 | 3169 | $yVeic += $h; |
| 3170 | 3170 | $texto = 'Renavam...........: ' . $veiculoRenavam; |
| 3171 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3171 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3172 | 3172 | $yVeic += $h; |
| 3173 | 3173 | $texto = 'HP.....................: ' . $veiculoHp; |
| 3174 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3174 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3175 | 3175 | $yVeic += $h; |
| 3176 | 3176 | $texto = 'Placa.................: ' . $veiculoPlaca; |
| 3177 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3177 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3178 | 3178 | $yVeic += $h; |
| 3179 | 3179 | $texto = 'Tipo Pintura......: ' . ($renavamEspecie[intval($veiculoTipoPintura)] ?? $veiculoTipoPintura); |
| 3180 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3180 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3181 | 3181 | $yVeic = $y + $h; |
| 3182 | 3182 | $xVeic = $xVeic + 55; |
| 3183 | 3183 | $texto = 'Marca / Modelo.....: ' . $veiculoMarcaModelo; |
| 3184 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3184 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3185 | 3185 | $yVeic += $h; |
| 3186 | 3186 | $texto = 'Especie..................: ' . ($renavamEspecie[intval($veiculoEspecie)] ?? $veiculoEspecie); |
| 3187 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3187 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3188 | 3188 | $yVeic += $h; |
| 3189 | 3189 | $texto = 'Combustivel..........: ' . ($renavamCombustivel[intval($veiculoCombustivel)] ?? $veiculoCombustivel); |
| 3190 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3190 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3191 | 3191 | $yVeic += $h; |
| 3192 | 3192 | $texto = 'Serial.....................: ' . $veiculoSerial; |
| 3193 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3193 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3194 | 3194 | $yVeic += $h; |
| 3195 | - $texto = 'Ano Fab/Mod........: '. $veiculoFabricacao . '/' . $veiculoModelo; |
|
| 3196 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3195 | + $texto = 'Ano Fab/Mod........: ' . $veiculoFabricacao . '/' . $veiculoModelo; |
|
| 3196 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3197 | 3197 | $yVeic += $h; |
| 3198 | - $texto = 'Distancia Entre Eixos(mm)..: '. $veiculoDistancia; |
|
| 3199 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3198 | + $texto = 'Distancia Entre Eixos(mm)..: ' . $veiculoDistancia; |
|
| 3199 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3200 | 3200 | } |
| 3201 | 3201 | |
| 3202 | 3202 | /** |
@@ -3220,12 +3220,12 @@ discard block |
||
| 3220 | 3220 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 3221 | 3221 | //INSCRIÇÃO MUNICIPAL |
| 3222 | 3222 | $y += 3; |
| 3223 | - $w = round($this->wPrint*0.23, 0); |
|
| 3223 | + $w = round($this->wPrint * 0.23, 0); |
|
| 3224 | 3224 | $texto = 'INSCRIÇÃO MUNICIPAL'; |
| 3225 | 3225 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 3226 | 3226 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 3227 | 3227 | //inscrição municipal |
| 3228 | - $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
| 3228 | + $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
| 3229 | 3229 | $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : ''; |
| 3230 | 3230 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 3231 | 3231 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -3235,7 +3235,7 @@ discard block |
||
| 3235 | 3235 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 3236 | 3236 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 3237 | 3237 | if (isset($this->ISSQNtot)) { |
| 3238 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
| 3238 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
| 3239 | 3239 | $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : ''; |
| 3240 | 3240 | $texto = number_format($texto, 2, ",", "."); |
| 3241 | 3241 | } else { |
@@ -3249,9 +3249,9 @@ discard block |
||
| 3249 | 3249 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 3250 | 3250 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 3251 | 3251 | if (isset($this->ISSQNtot)) { |
| 3252 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 3252 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 3253 | 3253 | $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : ''; |
| 3254 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3254 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3255 | 3255 | } else { |
| 3256 | 3256 | $texto = ''; |
| 3257 | 3257 | } |
@@ -3262,21 +3262,21 @@ discard block |
||
| 3262 | 3262 | if ($this->orientacao == 'P') { |
| 3263 | 3263 | $w = $this->wPrint - (3 * $w); |
| 3264 | 3264 | } else { |
| 3265 | - $w = $this->wPrint - (3 * $w)-$this->wCanhoto; |
|
| 3265 | + $w = $this->wPrint - (3 * $w) - $this->wCanhoto; |
|
| 3266 | 3266 | } |
| 3267 | 3267 | $texto = 'VALOR TOTAL DO ISSQN'; |
| 3268 | 3268 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 3269 | 3269 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 3270 | 3270 | if (isset($this->ISSQNtot)) { |
| 3271 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
| 3271 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
| 3272 | 3272 | $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : ''; |
| 3273 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3273 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3274 | 3274 | } else { |
| 3275 | 3275 | $texto = ''; |
| 3276 | 3276 | } |
| 3277 | 3277 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 3278 | 3278 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 3279 | - return ($y+$h+1); |
|
| 3279 | + return ($y + $h + 1); |
|
| 3280 | 3280 | } |
| 3281 | 3281 | |
| 3282 | 3282 | /** |
@@ -3297,7 +3297,7 @@ discard block |
||
| 3297 | 3297 | if ($this->orientacao == 'P') { |
| 3298 | 3298 | $w = $this->wPrint; |
| 3299 | 3299 | } else { |
| 3300 | - $w = $this->wPrint-$this->wCanhoto; |
|
| 3300 | + $w = $this->wPrint - $this->wCanhoto; |
|
| 3301 | 3301 | } |
| 3302 | 3302 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 3303 | 3303 | $this->pdf->textBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -3312,8 +3312,8 @@ discard block |
||
| 3312 | 3312 | //$this->wAdic com a largura do campo |
| 3313 | 3313 | //$this->textoAdic com o texto completo do campo |
| 3314 | 3314 | $y += 1; |
| 3315 | - $aFont = ['font'=>$this->fontePadrao, 'size'=>$this->textadicfontsize*$this->pdf->k, 'style'=>'']; |
|
| 3316 | - $this->pdf->textBox($x, $y+2, $w-2, $h-3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
|
| 3315 | + $aFont = ['font'=>$this->fontePadrao, 'size'=>$this->textadicfontsize * $this->pdf->k, 'style'=>'']; |
|
| 3316 | + $this->pdf->textBox($x, $y + 2, $w - 2, $h - 3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
|
| 3317 | 3317 | //RESERVADO AO FISCO |
| 3318 | 3318 | $texto = "RESERVADO AO FISCO"; |
| 3319 | 3319 | if ($this->nfeProc->getElementsByTagName("xMsg")) { |
@@ -3322,9 +3322,9 @@ discard block |
||
| 3322 | 3322 | $x += $w; |
| 3323 | 3323 | $y -= 1; |
| 3324 | 3324 | if ($this->orientacao == 'P') { |
| 3325 | - $w = $this->wPrint-$w; |
|
| 3325 | + $w = $this->wPrint - $w; |
|
| 3326 | 3326 | } else { |
| 3327 | - $w = $this->wPrint-$w-$this->wCanhoto; |
|
| 3327 | + $w = $this->wPrint - $w - $this->wCanhoto; |
|
| 3328 | 3328 | } |
| 3329 | 3329 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'B']; |
| 3330 | 3330 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3363,8 +3363,8 @@ discard block |
||
| 3363 | 3363 | } |
| 3364 | 3364 | $y += 2; |
| 3365 | 3365 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 3366 | - $this->pdf->textBox($x, $y, $w-2, $h-3, $texto, $aFont, 'T', 'L', 0, '', false); |
|
| 3367 | - return $y+$h; |
|
| 3366 | + $this->pdf->textBox($x, $y, $w - 2, $h - 3, $texto, $aFont, 'T', 'L', 0, '', false); |
|
| 3367 | + return $y + $h; |
|
| 3368 | 3368 | } |
| 3369 | 3369 | |
| 3370 | 3370 | /** |
@@ -3383,11 +3383,11 @@ discard block |
||
| 3383 | 3383 | if ($this->orientacao == 'P') { |
| 3384 | 3384 | $w = $this->wPrint; |
| 3385 | 3385 | } else { |
| 3386 | - $w = $this->wPrint-$this->wCanhoto; |
|
| 3386 | + $w = $this->wPrint - $this->wCanhoto; |
|
| 3387 | 3387 | $x = $this->wCanhoto; |
| 3388 | 3388 | } |
| 3389 | 3389 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I']; |
| 3390 | - $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s') |
|
| 3390 | + $texto = "Impresso em " . date('d/m/Y') . " as " . date('H:i:s') |
|
| 3391 | 3391 | . ' ' . $this->creditos; |
| 3392 | 3392 | $this->pdf->textBox($x, $y, $w, 0, $texto, $aFont, 'T', 'L', false); |
| 3393 | 3393 | $texto = "Powered by NFePHP®"; |
@@ -3443,9 +3443,9 @@ discard block |
||
| 3443 | 3443 | } else { |
| 3444 | 3444 | //linha separadora do canhoto - 238 |
| 3445 | 3445 | //posicao altura |
| 3446 | - $y = $this->wPrint-85; |
|
| 3446 | + $y = $this->wPrint - 85; |
|
| 3447 | 3447 | //altura |
| 3448 | - $w = $this->wPrint-85-24; |
|
| 3448 | + $w = $this->wPrint - 85 - 24; |
|
| 3449 | 3449 | } |
| 3450 | 3450 | $h = 10; |
| 3451 | 3451 | //desenha caixa |
@@ -3468,21 +3468,21 @@ discard block |
||
| 3468 | 3468 | $texto .= "AO LADO"; |
| 3469 | 3469 | } |
| 3470 | 3470 | $texto .= ". EMISSÃO: "; |
| 3471 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3471 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3472 | 3472 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 3473 | 3473 | if ($dEmi == '') { |
| 3474 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3474 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3475 | 3475 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 3476 | 3476 | $aDemi = explode('T', $dEmi); |
| 3477 | 3477 | $dEmi = $aDemi[0]; |
| 3478 | 3478 | } |
| 3479 | - $texto .= $this->ymdTodmy($dEmi) ." "; |
|
| 3479 | + $texto .= $this->ymdTodmy($dEmi) . " "; |
|
| 3480 | 3480 | $texto .= "VALOR TOTAL: R$ "; |
| 3481 | 3481 | $texto .= number_format($this->ICMSTot->getElementsByTagName("vNF")->item(0)->nodeValue, 2, ",", ".") . " "; |
| 3482 | 3482 | $texto .= "DESTINATÁRIO: "; |
| 3483 | 3483 | $texto .= $destinatario; |
| 3484 | 3484 | if ($this->orientacao == 'P') { |
| 3485 | - $this->pdf->textBox($x, $y, $w-1, $h, $texto, $aFont, 'C', 'L', 0, '', false); |
|
| 3485 | + $this->pdf->textBox($x, $y, $w - 1, $h, $texto, $aFont, 'C', 'L', 0, '', false); |
|
| 3486 | 3486 | $x1 = $x + $w; |
| 3487 | 3487 | $w1 = $this->wPrint - $w; |
| 3488 | 3488 | $texto = "NF-e"; |
@@ -3495,12 +3495,12 @@ discard block |
||
| 3495 | 3495 | //DATA DE RECEBIMENTO |
| 3496 | 3496 | $texto = "DATA DE RECEBIMENTO"; |
| 3497 | 3497 | $y += $h; |
| 3498 | - $w2 = round($this->wPrint*0.17, 0); //35; |
|
| 3498 | + $w2 = round($this->wPrint * 0.17, 0); //35; |
|
| 3499 | 3499 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 3500 | 3500 | $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3501 | 3501 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
| 3502 | 3502 | $x += $w2; |
| 3503 | - $w3 = $w-$w2; |
|
| 3503 | + $w3 = $w - $w2; |
|
| 3504 | 3504 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
| 3505 | 3505 | $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3506 | 3506 | $x = $oldX; |
@@ -3510,7 +3510,7 @@ discard block |
||
| 3510 | 3510 | return $y; |
| 3511 | 3511 | } else { |
| 3512 | 3512 | $x--; |
| 3513 | - $x = $this->pdf->textBox90($x, $y, $w-1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
|
| 3513 | + $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
|
| 3514 | 3514 | //NUMERO DA NOTA FISCAL LOGO NFE |
| 3515 | 3515 | $w1 = 18; |
| 3516 | 3516 | $x1 = $oldX; |
@@ -3524,14 +3524,14 @@ discard block |
||
| 3524 | 3524 | $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, ''); |
| 3525 | 3525 | //DATA DO RECEBIMENTO |
| 3526 | 3526 | $texto = "DATA DO RECEBIMENTO"; |
| 3527 | - $y = $this->wPrint-85; |
|
| 3527 | + $y = $this->wPrint - 85; |
|
| 3528 | 3528 | $x = 12; |
| 3529 | - $w2 = round($this->wPrint*0.17, 0); //35; |
|
| 3529 | + $w2 = round($this->wPrint * 0.17, 0); //35; |
|
| 3530 | 3530 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 3531 | 3531 | $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3532 | 3532 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
| 3533 | 3533 | $y -= $w2; |
| 3534 | - $w3 = $w-$w2; |
|
| 3534 | + $w3 = $w - $w2; |
|
| 3535 | 3535 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
| 3536 | 3536 | $aFont = ['font'=>$this->fontePadrao, 'size'=>5.7, 'style'=>'']; |
| 3537 | 3537 | $x = $this->pdf->textBox90($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3552,13 +3552,13 @@ discard block |
||
| 3552 | 3552 | { |
| 3553 | 3553 | $saida = ""; |
| 3554 | 3554 | if (isset($this->compra)) { |
| 3555 | - if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
| 3555 | + if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
| 3556 | 3556 | $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue; |
| 3557 | 3557 | } |
| 3558 | - if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
| 3558 | + if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
| 3559 | 3559 | $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue; |
| 3560 | 3560 | } |
| 3561 | - if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
| 3561 | + if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
| 3562 | 3562 | $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue; |
| 3563 | 3563 | } |
| 3564 | 3564 | } |
@@ -3584,21 +3584,21 @@ discard block |
||
| 3584 | 3584 | if ($vICMS > 0) { |
| 3585 | 3585 | $vICMS = 1; |
| 3586 | 3586 | } |
| 3587 | - $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue; |
|
| 3587 | + $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue; |
|
| 3588 | 3588 | if ($icmss > 0) { |
| 3589 | 3589 | $icmss = 1; |
| 3590 | 3590 | } |
| 3591 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3591 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3592 | 3592 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 3593 | 3593 | if ($dEmi == '') { |
| 3594 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3594 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3595 | 3595 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 3596 | 3596 | $aDemi = explode('T', $dEmi); |
| 3597 | 3597 | $dEmi = $aDemi[0]; |
| 3598 | 3598 | } |
| 3599 | 3599 | $dd = $dEmi; |
| 3600 | 3600 | $rpos = strrpos($dd, '-'); |
| 3601 | - $dd = substr($dd, $rpos +1); |
|
| 3601 | + $dd = substr($dd, $rpos + 1); |
|
| 3602 | 3602 | $chave = sprintf($forma, $cUF, $this->tpEmis, $CNPJ, $vNF, $vICMS, $icmss, $dd); |
| 3603 | 3603 | $chave = $chave . $this->modulo11($chave); |
| 3604 | 3604 | return $chave; |
@@ -3619,7 +3619,7 @@ discard block |
||
| 3619 | 3619 | $formaNfRef = "\r\nNF Ref.: série:%d numero:%d emit:%s em %s modelo: %d"; |
| 3620 | 3620 | $formaECFRef = "\r\nECF Ref.: modelo: %s ECF:%d COO:%d"; |
| 3621 | 3621 | $formaNfpRef = "\r\nNFP Ref.: série:%d número:%d emit:%s em %s modelo: %d IE:%s"; |
| 3622 | - $saida=''; |
|
| 3622 | + $saida = ''; |
|
| 3623 | 3623 | $nfRefs = $this->ide->getElementsByTagName('NFref'); |
| 3624 | 3624 | if (0 === $nfRefs->length) { |
| 3625 | 3625 | return $saida; |
@@ -3635,7 +3635,7 @@ discard block |
||
| 3635 | 3635 | foreach ($refNFe as $chave_acessoRef) { |
| 3636 | 3636 | $chave_acesso = $chave_acessoRef->nodeValue; |
| 3637 | 3637 | $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave); |
| 3638 | - $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2); |
|
| 3638 | + $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2); |
|
| 3639 | 3639 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
| 3640 | 3640 | $serie = substr($chave_acesso, 22, 3); |
| 3641 | 3641 | $numero = substr($chave_acesso, 25, 9); |
@@ -3656,7 +3656,7 @@ discard block |
||
| 3656 | 3656 | foreach ($refCTe as $chave_acessoRef) { |
| 3657 | 3657 | $chave_acesso = $chave_acessoRef->nodeValue; |
| 3658 | 3658 | $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave); |
| 3659 | - $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2); |
|
| 3659 | + $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2); |
|
| 3660 | 3660 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
| 3661 | 3661 | $serie = substr($chave_acesso, 22, 3); |
| 3662 | 3662 | $numero = substr($chave_acesso, 25, 9); |
@@ -3672,10 +3672,9 @@ discard block |
||
| 3672 | 3672 | $refNFP = $nfRef->getElementsByTagName('refNFP'); |
| 3673 | 3673 | foreach ($refNFP as $umaRefNFe) { |
| 3674 | 3674 | $data = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue; |
| 3675 | - $cnpj = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
| 3676 | - $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : |
|
| 3677 | - ''; |
|
| 3678 | - $cpf = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
| 3675 | + $cnpj = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
| 3676 | + $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : ''; |
|
| 3677 | + $cpf = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
| 3679 | 3678 | $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : ''; |
| 3680 | 3679 | $mod = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue; |
| 3681 | 3680 | $serie = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue; |
@@ -3740,6 +3739,6 @@ discard block |
||
| 3740 | 3739 | imagedestroy($image); |
| 3741 | 3740 | $stringdata = ob_get_contents(); // read from buffer |
| 3742 | 3741 | ob_end_clean(); |
| 3743 | - return 'data://text/plain;base64,'.base64_encode($stringdata); |
|
| 3742 | + return 'data://text/plain;base64,' . base64_encode($stringdata); |
|
| 3744 | 3743 | } |
| 3745 | 3744 | } |