@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | protected $paperwidth = 80; |
28 | 28 | protected $descPercent = 0.38; |
29 | 29 | protected $xml; // string XML NFe |
30 | - protected $logomarca=''; // path para logomarca em jpg |
|
31 | - protected $formatoChave="#### #### #### #### #### #### #### #### #### #### ####"; |
|
30 | + protected $logomarca = ''; // path para logomarca em jpg |
|
31 | + protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####"; |
|
32 | 32 | protected $nfeProc; |
33 | 33 | protected $nfe; |
34 | 34 | protected $infNFe; |
@@ -220,10 +220,10 @@ discard block |
||
220 | 220 | //total inicial de paginas |
221 | 221 | $totPag = 1; |
222 | 222 | //largura imprimivel em mm: largura da folha menos as margens esq/direita |
223 | - $this->wPrint = $maxW-($margEsq*2); |
|
223 | + $this->wPrint = $maxW - ($margEsq * 2); |
|
224 | 224 | //comprimento (altura) imprimivel em mm: altura da folha menos as margens |
225 | 225 | //superior e inferior |
226 | - $this->hPrint = $maxH-$margSup-$margInf; |
|
226 | + $this->hPrint = $maxH - $margSup - $margInf; |
|
227 | 227 | // estabelece contagem de paginas |
228 | 228 | $this->pdf->aliasNbPages(); |
229 | 229 | $this->pdf->setMargins($margEsq, $margSup); // fixa as margens |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | $y = $this->blocoIX($y); //informações sobre tributos |
248 | 248 | $y = $this->blocoX($y); //creditos |
249 | 249 | |
250 | - $ymark = $maxH/4; |
|
250 | + $ymark = $maxH / 4; |
|
251 | 251 | if ($this->tpAmb == 2) { |
252 | 252 | $this->pdf->setTextColor(120, 120, 120); |
253 | 253 | $texto = "SEM VALOR FISCAL\nEmitida em ambiente de homologacao"; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $this->margem, |
257 | 257 | $ymark, |
258 | 258 | $this->wPrint, |
259 | - $maxH/2, |
|
259 | + $maxH / 2, |
|
260 | 260 | $texto, |
261 | 261 | $aFont, |
262 | 262 | 'T', |
@@ -273,9 +273,9 @@ discard block |
||
273 | 273 | $aFont = ['font' => $this->fontePadrao, 'size' => 24, 'style' => 'B']; |
274 | 274 | $this->pdf->textBox( |
275 | 275 | $this->margem, |
276 | - $ymark+4, |
|
276 | + $ymark + 4, |
|
277 | 277 | $this->wPrint, |
278 | - $maxH/2, |
|
278 | + $maxH / 2, |
|
279 | 279 | $texto, |
280 | 280 | $aFont, |
281 | 281 | 'T', |
@@ -287,9 +287,9 @@ discard block |
||
287 | 287 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
288 | 288 | $this->pdf->textBox( |
289 | 289 | $this->margem, |
290 | - $ymark+14, |
|
290 | + $ymark + 14, |
|
291 | 291 | $this->wPrint, |
292 | - $maxH/2, |
|
292 | + $maxH / 2, |
|
293 | 293 | $this->submessage, |
294 | 294 | $aFont, |
295 | 295 | 'T', |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $y = $this->blocoVIII($y); //QRCODE |
318 | 318 | $y = $this->blocoIX($y); //informações sobre tributos |
319 | 319 | $y = $this->blocoX($y); //creditos |
320 | - $ymark = $maxH/4; |
|
320 | + $ymark = $maxH / 4; |
|
321 | 321 | if ($this->tpAmb == 2) { |
322 | 322 | $this->pdf->setTextColor(120, 120, 120); |
323 | 323 | $texto = "SEM VALOR FISCAL\nEmitida em ambiente de homologacao"; |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $this->margem, |
327 | 327 | $ymark, |
328 | 328 | $this->wPrint, |
329 | - $maxH/2, |
|
329 | + $maxH / 2, |
|
330 | 330 | $texto, |
331 | 331 | $aFont, |
332 | 332 | 'T', |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | } elseif (!empty($retEvento = $this->nfeProc->getElementsByTagName('retEvento')->item(0))) { |
411 | 411 | $infEvento = $retEvento->getElementsByTagName('infEvento')->item(0); |
412 | 412 | $cStat = $this->getTagValue($infEvento, "cStat"); |
413 | - $tpEvento= $this->getTagValue($infEvento, "tpEvento"); |
|
413 | + $tpEvento = $this->getTagValue($infEvento, "tpEvento"); |
|
414 | 414 | $dhEvento = date("d/m/Y H:i:s", $this->toTimestamp($this->getTagValue($infEvento, "dhRegEvento"))); |
415 | 415 | $nProt = $this->getTagValue($infEvento, "nProt"); |
416 | 416 | if ($tpEvento == '110111' && ($cStat == '101' || $cStat == '151' || $cStat == '135' || $cStat == '155')) { |
@@ -310,39 +310,39 @@ discard block |
||
310 | 310 | { |
311 | 311 | $this->textoAdic = ''; |
312 | 312 | //informações adicionais |
313 | - $fontProduto = [ |
|
313 | + $fontProduto = [ |
|
314 | 314 | 'font' => $this->fontePadrao, |
315 | 315 | 'size' => 8, |
316 | 316 | 'style' => '' |
317 | 317 | ]; |
318 | 318 | $k = $this->pdf->k; |
319 | 319 | $this->textadicfontsize = $fontProduto['size'] / $k; |
320 | - $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas(); |
|
320 | + $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas(); |
|
321 | 321 | if (isset($this->infAdic)) { |
322 | 322 | $i = 0; |
323 | 323 | if ($this->textoAdic != '') { |
324 | 324 | $this->textoAdic .= ". \n"; |
325 | 325 | } |
326 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl")) |
|
326 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl")) |
|
327 | 327 | ? 'Inf. Contribuinte: ' . $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl")) |
328 | 328 | : ''; |
329 | - $infPedido = $this->geraInformacoesDaTagCompra(); |
|
329 | + $infPedido = $this->geraInformacoesDaTagCompra(); |
|
330 | 330 | if ($infPedido != "") { |
331 | 331 | $this->textoAdic .= $infPedido; |
332 | 332 | } |
333 | 333 | $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: '); |
334 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco")) |
|
334 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco")) |
|
335 | 335 | ? "\n Inf. fisco: " . $this->getTagValue($this->infAdic, "infAdFisco") |
336 | 336 | : ''; |
337 | - $obsCont = $this->infAdic->getElementsByTagName("obsCont"); |
|
337 | + $obsCont = $this->infAdic->getElementsByTagName("obsCont"); |
|
338 | 338 | if (isset($obsCont)) { |
339 | 339 | foreach ($obsCont as $obs) { |
340 | 340 | $campo = $obsCont->item($i)->getAttribute("xCampo"); |
341 | - $xTexto = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) |
|
341 | + $xTexto = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) |
|
342 | 342 | ? $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue |
343 | 343 | : ''; |
344 | 344 | $this->textoAdic .= "\n" . $campo . ': ' . trim($xTexto); |
345 | - $i ++; |
|
345 | + $i++; |
|
346 | 346 | } |
347 | 347 | } |
348 | 348 | } |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $flagVTT = $flagVTT && (strpos(strtolower(trim($this->textoAdic)), 'trib') || |
357 | 357 | strpos(strtolower(trim($this->textoAdic)), 'imp')); |
358 | 358 | $vTotTrib = $this->getTagValue($this->ICMSTot, 'vTotTrib'); |
359 | - if ($vTotTrib != '' && ! $flagVTT) { |
|
359 | + if ($vTotTrib != '' && !$flagVTT) { |
|
360 | 360 | $this->textoAdic .= "\n Valor Aproximado dos Tributos : R$ " |
361 | 361 | . number_format($vTotTrib, 2, ",", "."); |
362 | 362 | } |
@@ -367,9 +367,9 @@ discard block |
||
367 | 367 | $this->textadicfontsize = $this->pdf->fontSize; |
368 | 368 | $hdadosadic = ceil($numlinhasdados * ($this->textadicfontsize)); |
369 | 369 | if ($hdadosadic > 70) { |
370 | - for ($f = 8; $f > 3; $f --) { |
|
370 | + for ($f = 8; $f > 3; $f--) { |
|
371 | 371 | $this->pdf->setFont($this->fontePadrao, '', $f); |
372 | - $fontProduto = [ |
|
372 | + $fontProduto = [ |
|
373 | 373 | 'font' => $this->fontePadrao, |
374 | 374 | 'size' => $f, |
375 | 375 | 'style' => '' |
@@ -497,9 +497,9 @@ discard block |
||
497 | 497 | $this->hdadosadic = $this->calculoEspacoVericalDadosAdicionais(); |
498 | 498 | |
499 | 499 | //altura disponivel para os campos da DANFE |
500 | - $hcabecalho = 47;//para cabeçalho |
|
501 | - $hdestinatario = 25;//para destinatario |
|
502 | - $hduplicatas = 12;//para cada grupo de 7 duplicatas |
|
500 | + $hcabecalho = 47; //para cabeçalho |
|
501 | + $hdestinatario = 25; //para destinatario |
|
502 | + $hduplicatas = 12; //para cada grupo de 7 duplicatas |
|
503 | 503 | if (isset($this->entrega)) { |
504 | 504 | $hlocalentrega = 25; |
505 | 505 | } else { |
@@ -510,11 +510,11 @@ discard block |
||
510 | 510 | } else { |
511 | 511 | $hlocalretirada = 0; |
512 | 512 | } |
513 | - $himposto = 18;// para imposto |
|
514 | - $htransporte = 25;// para transporte |
|
515 | - $hissqn = 11;// para issqn |
|
516 | - $hfooter = 5;// para rodape |
|
517 | - $hCabecItens = 4;//cabeçalho dos itens |
|
513 | + $himposto = 18; // para imposto |
|
514 | + $htransporte = 25; // para transporte |
|
515 | + $hissqn = 11; // para issqn |
|
516 | + $hfooter = 5; // para rodape |
|
517 | + $hCabecItens = 4; //cabeçalho dos itens |
|
518 | 518 | $hOCUPADA = $hcabecalho |
519 | 519 | + $hdestinatario |
520 | 520 | + $hlocalentrega |
@@ -537,10 +537,10 @@ discard block |
||
537 | 537 | $this->sizeExtraTextoFatura());*/ |
538 | 538 | |
539 | 539 | if ($this->orientacao == 'P') { |
540 | - $hDispo1 -= 24 * $this->qCanhoto;//para canhoto |
|
541 | - $w = $this->wPrint; |
|
540 | + $hDispo1 -= 24 * $this->qCanhoto; //para canhoto |
|
541 | + $w = $this->wPrint; |
|
542 | 542 | } else { |
543 | - $hcanhoto = $this->hPrint;//para canhoto |
|
543 | + $hcanhoto = $this->hPrint; //para canhoto |
|
544 | 544 | $w = $this->wPrint - $this->wCanhoto; |
545 | 545 | } |
546 | 546 | //$hDispo1 += 14; |
@@ -561,18 +561,18 @@ discard block |
||
561 | 561 | $prod = $itemProd->getElementsByTagName('prod')->item(0); |
562 | 562 | $uCom = $prod->getElementsByTagName("uCom")->item(0)->nodeValue; |
563 | 563 | $uTrib = $prod->getElementsByTagName("uTrib")->item(0); |
564 | - if (! empty($uTrib) && strcmp($uCom, $uTrib->nodeValue) != 0) { |
|
564 | + if (!empty($uTrib) && strcmp($uCom, $uTrib->nodeValue) != 0) { |
|
565 | 565 | $mostrarUnidadeTributavel = true; |
566 | 566 | } |
567 | 567 | |
568 | 568 | $hUsado += $this->calculeHeight($itemProd, $mostrarUnidadeTributavel); |
569 | 569 | if ($hUsado > $hDispo) { |
570 | - $totPag ++; |
|
570 | + $totPag++; |
|
571 | 571 | $hDispo = $hDispo2; |
572 | 572 | $hUsado = $hCabecItens; |
573 | - $i --; // decrementa para readicionar o item que não coube nessa pagina na outra. |
|
573 | + $i--; // decrementa para readicionar o item que não coube nessa pagina na outra. |
|
574 | 574 | } |
575 | - $i ++; |
|
575 | + $i++; |
|
576 | 576 | } //fim da soma das areas de itens usadas |
577 | 577 | $qtdeItens = $i; //controle da quantidade de itens no DANFE |
578 | 578 | //montagem da primeira página |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | $formaPag = []; |
605 | 605 | if (isset($this->detPag) && $this->detPag->length > 0) { |
606 | 606 | foreach ($this->detPag as $k => $d) { |
607 | - $fPag = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
|
607 | + $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
|
608 | 608 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue |
609 | 609 | : '0'; |
610 | 610 | $formaPag[$fPag] = $fPag; |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | } |
649 | 649 | |
650 | 650 | //loop para páginas seguintes |
651 | - for ($n = 2; $n <= $totPag; $n ++) { |
|
651 | + for ($n = 2; $n <= $totPag; $n++) { |
|
652 | 652 | // fixa as margens |
653 | 653 | $this->pdf->setMargins($this->margesq, $this->margsup); |
654 | 654 | //adiciona nova página |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | } |
673 | 673 | //se estiver na última página e ainda restar itens para inserir, adiciona mais uma página |
674 | 674 | if ($n == $totPag && $this->qtdeItensProc < $qtdeItens) { |
675 | - $totPag ++; |
|
675 | + $totPag++; |
|
676 | 676 | } |
677 | 677 | } |
678 | 678 | } |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | if ($startPos === false) { |
702 | 702 | return $cdata; |
703 | 703 | } |
704 | - for ($x = $len; $x > 0; $x --) { |
|
704 | + for ($x = $len; $x > 0; $x--) { |
|
705 | 705 | if (substr($cdata, $x, 1) == '>') { |
706 | 706 | $endPos = $x; |
707 | 707 | break; |
@@ -797,15 +797,15 @@ discard block |
||
797 | 797 | //grupo CADATA infCpl |
798 | 798 | $t = $dom->getElementsByTagName('transmissor')->item(0); |
799 | 799 | $r = $dom->getElementsByTagName('receptor')->item(0); |
800 | - $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
800 | + $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
801 | 801 | 'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : ''; |
802 | - $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
802 | + $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
803 | 803 | 'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : ''; |
804 | - $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
804 | + $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
805 | 805 | 'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : ''; |
806 | - $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
806 | + $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
807 | 807 | 'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : ''; |
808 | - $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
808 | + $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
809 | 809 | if (isset($t)) { |
810 | 810 | if ($t->hasAttributes()) { |
811 | 811 | $texto .= " Transmissor "; |
@@ -847,7 +847,7 @@ discard block |
||
847 | 847 | $resp['message'][] = 'NFe NÃO PROTOCOLADA'; |
848 | 848 | } elseif ($this->getTagValue($this->ide, "tpAmb") == '2') { |
849 | 849 | $resp['status'] = false; |
850 | - $resp['message'][] = "NFe EMITIDA EM HOMOLOGAÇÃO"; |
|
850 | + $resp['message'][] = "NFe EMITIDA EM HOMOLOGAÇÃO"; |
|
851 | 851 | } |
852 | 852 | $retEvento = $this->nfeProc->getElementsByTagName('retEvento')->item(0); |
853 | 853 | $cStat = $this->getTagValue($this->nfeProc, "cStat"); |
@@ -868,7 +868,7 @@ discard block |
||
868 | 868 | } elseif (!empty($retEvento)) { |
869 | 869 | $infEvento = $retEvento->getElementsByTagName('infEvento')->item(0); |
870 | 870 | $cStat = $this->getTagValue($infEvento, "cStat"); |
871 | - $tpEvento= $this->getTagValue($infEvento, "tpEvento"); |
|
871 | + $tpEvento = $this->getTagValue($infEvento, "tpEvento"); |
|
872 | 872 | $dhEvento = date("d/m/Y H:i:s", $this->toTimestamp($this->getTagValue($infEvento, "dhRegEvento"))); |
873 | 873 | $nProt = $this->getTagValue($infEvento, "nProt"); |
874 | 874 | if ($tpEvento == '110111' && ($cStat == '101' || $cStat == '151' || $cStat == '135' || $cStat == '155')) { |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | |
883 | 883 | protected function notaDPEC() |
884 | 884 | { |
885 | - return ! empty($this->numdepec); |
|
885 | + return !empty($this->numdepec); |
|
886 | 886 | } |
887 | 887 | |
888 | 888 | /** |
@@ -931,7 +931,7 @@ discard block |
||
931 | 931 | //se for right separa 2/3 para os dados e o terço seguinte para o logo |
932 | 932 | //se não houver logo centraliza dos dados do emitente |
933 | 933 | // coloca o logo |
934 | - if (! empty($this->logomarca)) { |
|
934 | + if (!empty($this->logomarca)) { |
|
935 | 935 | $logoInfo = getimagesize($this->logomarca); |
936 | 936 | //largura da imagem em mm |
937 | 937 | $logoWmm = ($logoInfo[0] / 72) * 25.4; |
@@ -987,7 +987,7 @@ discard block |
||
987 | 987 | //endereço |
988 | 988 | $y1 = $y1 + 5; |
989 | 989 | $aFont = ['font' => $this->fontePadrao, 'size' => 8, 'style' => '']; |
990 | - $fone = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
990 | + $fone = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
991 | 991 | ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue |
992 | 992 | : ''; |
993 | 993 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
@@ -1006,8 +1006,8 @@ discard block |
||
1006 | 1006 | |
1007 | 1007 | //#################################################################################### |
1008 | 1008 | //coluna central Danfe |
1009 | - $x += $w; |
|
1010 | - $w = round($maxW * 0.17, 0);//35; |
|
1009 | + $x += $w; |
|
1010 | + $w = round($maxW * 0.17, 0); //35; |
|
1011 | 1011 | $w2 = $w; |
1012 | 1012 | $h = 32; |
1013 | 1013 | $this->pdf->textBox($x, $y, $w, $h); |
@@ -1064,8 +1064,8 @@ discard block |
||
1064 | 1064 | |
1065 | 1065 | //#################################################################################### |
1066 | 1066 | //coluna codigo de barras |
1067 | - $x += $w; |
|
1068 | - $w = ($maxW - $w1 - $w2);//85; |
|
1067 | + $x += $w; |
|
1068 | + $w = ($maxW - $w1 - $w2); //85; |
|
1069 | 1069 | $w3 = $w; |
1070 | 1070 | $h = 32; |
1071 | 1071 | $this->pdf->textBox($x, $y, $w, $h); |
@@ -1095,7 +1095,7 @@ discard block |
||
1095 | 1095 | } else { |
1096 | 1096 | $cabecalhoProtoAutorizacao = 'PROTOCOLO DE AUTORIZAÇÃO DE USO'; |
1097 | 1097 | } |
1098 | - if (($this->tpEmis == 2 || $this->tpEmis == 5) && ! $this->notaDpec()) { |
|
1098 | + if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->notaDpec()) { |
|
1099 | 1099 | $cabecalhoProtoAutorizacao = "DADOS DA NF-E"; |
1100 | 1100 | $chaveContingencia = $this->geraChaveAdicionalDeContingencia(); |
1101 | 1101 | $this->pdf->setFillColor(0, 0, 0); |
@@ -1127,7 +1127,7 @@ discard block |
||
1127 | 1127 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1128 | 1128 | $w = $w1 + $w2; |
1129 | 1129 | $y = $oldY; |
1130 | - $oldY += $h; |
|
1130 | + $oldY += $h; |
|
1131 | 1131 | $x = $oldX; |
1132 | 1132 | $h = 7; |
1133 | 1133 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1144,7 +1144,7 @@ discard block |
||
1144 | 1144 | // NOTA : DANFE sem protocolo deve existir somente no caso de contingência !!! |
1145 | 1145 | // Além disso, existem várias NFes em contingência que eu recebo com protocolo de autorização. |
1146 | 1146 | // Na minha opinião, deveríamos mostra-lo, mas o manual da NFe v4.01 diz outra coisa... |
1147 | - if (($this->tpEmis == 2 || $this->tpEmis == 5) && ! $this->notaDpec()) { |
|
1147 | + if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->notaDpec()) { |
|
1148 | 1148 | $aFont = ['font' => $this->fontePadrao, 'size' => 8, 'style' => 'B']; |
1149 | 1149 | $texto = $this->formatField( |
1150 | 1150 | $chaveContingencia, |
@@ -1158,7 +1158,7 @@ discard block |
||
1158 | 1158 | $cStat = ''; |
1159 | 1159 | } else { |
1160 | 1160 | if (isset($this->nfeProc)) { |
1161 | - $texto = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) |
|
1161 | + $texto = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) |
|
1162 | 1162 | ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue |
1163 | 1163 | : ''; |
1164 | 1164 | $tsHora = $this->toTimestamp( |
@@ -1188,7 +1188,7 @@ discard block |
||
1188 | 1188 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1189 | 1189 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1190 | 1190 | //INSCRIÇÃO MUNICIPAL |
1191 | - $x += $w; |
|
1191 | + $x += $w; |
|
1192 | 1192 | $texto = 'INSCRIÇÃO MUNICIPAL'; |
1193 | 1193 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1194 | 1194 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1196,29 +1196,29 @@ discard block |
||
1196 | 1196 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1197 | 1197 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1198 | 1198 | //INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT. |
1199 | - $x += $w; |
|
1199 | + $x += $w; |
|
1200 | 1200 | $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.'; |
1201 | 1201 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1202 | 1202 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1203 | - $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
1203 | + $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
1204 | 1204 | ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue |
1205 | 1205 | : ''; |
1206 | 1206 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1207 | 1207 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1208 | 1208 | //CNPJ |
1209 | - $x += $w; |
|
1209 | + $x += $w; |
|
1210 | 1210 | $w = ($maxW - (3 * $w)); |
1211 | 1211 | $texto = 'CNPJ'; |
1212 | 1212 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1213 | 1213 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1214 | 1214 | //Pegando valor do CPF/CNPJ |
1215 | - if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1215 | + if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1216 | 1216 | $texto = $this->formatField( |
1217 | 1217 | $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
1218 | 1218 | "###.###.###/####-##" |
1219 | 1219 | ); |
1220 | 1220 | } else { |
1221 | - $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
1221 | + $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
1222 | 1222 | ? $this->formatField( |
1223 | 1223 | $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue, |
1224 | 1224 | "###.###.###-##" |
@@ -1237,7 +1237,7 @@ discard block |
||
1237 | 1237 | $n = count($resp['message']); |
1238 | 1238 | $alttot = $n * 15; |
1239 | 1239 | $x = 10; |
1240 | - $y = $this->hPrint/2 - $alttot/2; |
|
1240 | + $y = $this->hPrint / 2 - $alttot / 2; |
|
1241 | 1241 | $h = 15; |
1242 | 1242 | $w = $maxW - (2 * $x); |
1243 | 1243 | $this->pdf->settextcolor(90, 90, 90); |
@@ -1310,7 +1310,7 @@ discard block |
||
1310 | 1310 | //NOME / RAZÃO SOCIAL |
1311 | 1311 | $w = round($maxW * 0.61, 0); |
1312 | 1312 | $w1 = $w; |
1313 | - $y += 3; |
|
1313 | + $y += 3; |
|
1314 | 1314 | $texto = 'NOME / RAZÃO SOCIAL'; |
1315 | 1315 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1316 | 1316 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1322,20 +1322,20 @@ discard block |
||
1322 | 1322 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, ''); |
1323 | 1323 | } |
1324 | 1324 | //CNPJ / CPF |
1325 | - $x += $w; |
|
1325 | + $x += $w; |
|
1326 | 1326 | $w = round($maxW * 0.23, 0); |
1327 | 1327 | $w2 = $w; |
1328 | 1328 | $texto = 'CNPJ / CPF'; |
1329 | 1329 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1330 | 1330 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1331 | 1331 | //Pegando valor do CPF/CNPJ |
1332 | - if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1332 | + if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1333 | 1333 | $texto = $this->formatField( |
1334 | 1334 | $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
1335 | 1335 | "###.###.###/####-##" |
1336 | 1336 | ); |
1337 | 1337 | } else { |
1338 | - $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
1338 | + $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
1339 | 1339 | ? $this->formatField( |
1340 | 1340 | $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue, |
1341 | 1341 | "###.###.###-##" |
@@ -1345,17 +1345,17 @@ discard block |
||
1345 | 1345 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1346 | 1346 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1347 | 1347 | //DATA DA EMISSÃO |
1348 | - $x += $w; |
|
1348 | + $x += $w; |
|
1349 | 1349 | $w = $maxW - ($w1 + $w2); |
1350 | 1350 | $wx = $w; |
1351 | 1351 | $texto = 'DATA DA EMISSÃO'; |
1352 | 1352 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1353 | 1353 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1354 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) |
|
1354 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) |
|
1355 | 1355 | ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue |
1356 | 1356 | : ''; |
1357 | 1357 | if ($dEmi == '') { |
1358 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) |
|
1358 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) |
|
1359 | 1359 | ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue |
1360 | 1360 | : ''; |
1361 | 1361 | $aDemi = explode('T', $dEmi); |
@@ -1371,7 +1371,7 @@ discard block |
||
1371 | 1371 | //ENDEREÇO |
1372 | 1372 | $w = round($maxW * 0.47, 0); |
1373 | 1373 | $w1 = $w; |
1374 | - $y += $h; |
|
1374 | + $y += $h; |
|
1375 | 1375 | $x = $oldX; |
1376 | 1376 | $texto = 'ENDEREÇO'; |
1377 | 1377 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1383,7 +1383,7 @@ discard block |
||
1383 | 1383 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1384 | 1384 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
1385 | 1385 | //BAIRRO / DISTRITO |
1386 | - $x += $w; |
|
1386 | + $x += $w; |
|
1387 | 1387 | $w = round($maxW * 0.21, 0); |
1388 | 1388 | $w2 = $w; |
1389 | 1389 | $texto = 'BAIRRO / DISTRITO'; |
@@ -1393,29 +1393,29 @@ discard block |
||
1393 | 1393 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1394 | 1394 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1395 | 1395 | //CEP |
1396 | - $x += $w; |
|
1396 | + $x += $w; |
|
1397 | 1397 | $w = $maxW - $w1 - $w2 - $wx; |
1398 | 1398 | $w2 = $w; |
1399 | 1399 | $texto = 'CEP'; |
1400 | 1400 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1401 | 1401 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1402 | - $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) |
|
1402 | + $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) |
|
1403 | 1403 | ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue |
1404 | 1404 | : ''; |
1405 | 1405 | $texto = $this->formatField($texto, "#####-###"); |
1406 | 1406 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1407 | 1407 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1408 | 1408 | //DATA DA SAÍDA |
1409 | - $x += $w; |
|
1409 | + $x += $w; |
|
1410 | 1410 | $w = $wx; |
1411 | 1411 | $texto = 'DATA DA SAÍDA/ENTRADA'; |
1412 | 1412 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1413 | 1413 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1414 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) |
|
1414 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) |
|
1415 | 1415 | ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue |
1416 | 1416 | : ''; |
1417 | 1417 | if ($dSaiEnt == '') { |
1418 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
1418 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
1419 | 1419 | ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue |
1420 | 1420 | : ''; |
1421 | 1421 | $aDsaient = explode('T', $dSaiEnt); |
@@ -1426,7 +1426,7 @@ discard block |
||
1426 | 1426 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1427 | 1427 | //MUNICÍPIO |
1428 | 1428 | $w = $w1; |
1429 | - $y += $h; |
|
1429 | + $y += $h; |
|
1430 | 1430 | $x = $oldX; |
1431 | 1431 | $texto = 'MUNICÍPIO'; |
1432 | 1432 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1440,7 +1440,7 @@ discard block |
||
1440 | 1440 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1441 | 1441 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
1442 | 1442 | //UF |
1443 | - $x += $w; |
|
1443 | + $x += $w; |
|
1444 | 1444 | $w = 8; |
1445 | 1445 | $texto = 'UF'; |
1446 | 1446 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1449,19 +1449,19 @@ discard block |
||
1449 | 1449 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1450 | 1450 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1451 | 1451 | //FONE / FAX |
1452 | - $x += $w; |
|
1452 | + $x += $w; |
|
1453 | 1453 | $w = round(($maxW - $w1 - $wx - 8) / 2, 0); |
1454 | 1454 | $w3 = $w; |
1455 | 1455 | $texto = 'FONE / FAX'; |
1456 | 1456 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1457 | 1457 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1458 | - $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) |
|
1458 | + $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) |
|
1459 | 1459 | ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue |
1460 | 1460 | : ''; |
1461 | 1461 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1462 | 1462 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1463 | 1463 | //INSCRIÇÃO ESTADUAL |
1464 | - $x += $w; |
|
1464 | + $x += $w; |
|
1465 | 1465 | $w = $maxW - $w1 - $wx - 8 - $w3; |
1466 | 1466 | $texto = 'INSCRIÇÃO ESTADUAL'; |
1467 | 1467 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1471,16 +1471,16 @@ discard block |
||
1471 | 1471 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1472 | 1472 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1473 | 1473 | //HORA DA SAÍDA |
1474 | - $x += $w; |
|
1474 | + $x += $w; |
|
1475 | 1475 | $w = $wx; |
1476 | 1476 | $texto = 'HORA DA SAÍDA/ENTRADA'; |
1477 | 1477 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1478 | 1478 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1479 | - $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) |
|
1479 | + $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) |
|
1480 | 1480 | ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue |
1481 | 1481 | : ''; |
1482 | 1482 | if ($hSaiEnt == '') { |
1483 | - $dhSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
1483 | + $dhSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
1484 | 1484 | ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue |
1485 | 1485 | : ''; |
1486 | 1486 | $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt); |
@@ -1524,7 +1524,7 @@ discard block |
||
1524 | 1524 | //NOME / RAZÃO SOCIAL |
1525 | 1525 | $w = round($maxW * 0.61, 0); |
1526 | 1526 | $w1 = $w; |
1527 | - $y += 3; |
|
1527 | + $y += 3; |
|
1528 | 1528 | $texto = 'NOME / RAZÃO SOCIAL'; |
1529 | 1529 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1530 | 1530 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1539,20 +1539,20 @@ discard block |
||
1539 | 1539 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, ''); |
1540 | 1540 | } |
1541 | 1541 | //CNPJ / CPF |
1542 | - $x += $w; |
|
1542 | + $x += $w; |
|
1543 | 1543 | $w = round($maxW * 0.23, 0); |
1544 | 1544 | $w2 = $w; |
1545 | 1545 | $texto = 'CNPJ / CPF'; |
1546 | 1546 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1547 | 1547 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1548 | 1548 | //Pegando valor do CPF/CNPJ |
1549 | - if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1549 | + if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1550 | 1550 | $texto = $this->formatField( |
1551 | 1551 | $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
1552 | 1552 | "###.###.###/####-##" |
1553 | 1553 | ); |
1554 | 1554 | } else { |
1555 | - $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1555 | + $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1556 | 1556 | $this->formatField( |
1557 | 1557 | $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue, |
1558 | 1558 | "###.###.###-##" |
@@ -1561,7 +1561,7 @@ discard block |
||
1561 | 1561 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1562 | 1562 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1563 | 1563 | //INSCRIÇÃO ESTADUAL |
1564 | - $x += $w; |
|
1564 | + $x += $w; |
|
1565 | 1565 | $w = $maxW - ($w1 + $w2); |
1566 | 1566 | $wx = $w; |
1567 | 1567 | $texto = 'INSCRIÇÃO ESTADUAL'; |
@@ -1580,7 +1580,7 @@ discard block |
||
1580 | 1580 | //ENDEREÇO |
1581 | 1581 | $w = round($maxW * 0.355, 0) + $wx; |
1582 | 1582 | $w1 = $w; |
1583 | - $y += $h; |
|
1583 | + $y += $h; |
|
1584 | 1584 | $x = $oldX; |
1585 | 1585 | $texto = 'ENDEREÇO'; |
1586 | 1586 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1591,7 +1591,7 @@ discard block |
||
1591 | 1591 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1592 | 1592 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
1593 | 1593 | //BAIRRO / DISTRITO |
1594 | - $x += $w; |
|
1594 | + $x += $w; |
|
1595 | 1595 | $w = round($maxW * 0.335, 0); |
1596 | 1596 | $w2 = $w; |
1597 | 1597 | $texto = 'BAIRRO / DISTRITO'; |
@@ -1601,12 +1601,12 @@ discard block |
||
1601 | 1601 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1602 | 1602 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1603 | 1603 | //CEP |
1604 | - $x += $w; |
|
1604 | + $x += $w; |
|
1605 | 1605 | $w = $maxW - ($w1 + $w2); |
1606 | 1606 | $texto = 'CEP'; |
1607 | 1607 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1608 | 1608 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1609 | - $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
1609 | + $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
1610 | 1610 | $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
1611 | 1611 | $texto = $this->formatField($texto, "#####-###"); |
1612 | 1612 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
@@ -1614,7 +1614,7 @@ discard block |
||
1614 | 1614 | //MUNICÍPIO |
1615 | 1615 | $w = round($maxW * 0.805, 0); |
1616 | 1616 | $w1 = $w; |
1617 | - $y += $h; |
|
1617 | + $y += $h; |
|
1618 | 1618 | $x = $oldX; |
1619 | 1619 | $texto = 'MUNICÍPIO'; |
1620 | 1620 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1626,7 +1626,7 @@ discard block |
||
1626 | 1626 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1627 | 1627 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
1628 | 1628 | //UF |
1629 | - $x += $w; |
|
1629 | + $x += $w; |
|
1630 | 1630 | $w = 8; |
1631 | 1631 | $texto = 'UF'; |
1632 | 1632 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1635,12 +1635,12 @@ discard block |
||
1635 | 1635 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1636 | 1636 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1637 | 1637 | //FONE / FAX |
1638 | - $x += $w; |
|
1638 | + $x += $w; |
|
1639 | 1639 | $w = $maxW - $w - $w1; |
1640 | 1640 | $texto = 'FONE / FAX'; |
1641 | 1641 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1642 | 1642 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1643 | - $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
1643 | + $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
1644 | 1644 | $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
1645 | 1645 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1646 | 1646 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -1677,7 +1677,7 @@ discard block |
||
1677 | 1677 | //NOME / RAZÃO SOCIAL |
1678 | 1678 | $w = round($maxW * 0.61, 0); |
1679 | 1679 | $w1 = $w; |
1680 | - $y += 3; |
|
1680 | + $y += 3; |
|
1681 | 1681 | $texto = 'NOME / RAZÃO SOCIAL'; |
1682 | 1682 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1683 | 1683 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1692,20 +1692,20 @@ discard block |
||
1692 | 1692 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, ''); |
1693 | 1693 | } |
1694 | 1694 | //CNPJ / CPF |
1695 | - $x += $w; |
|
1695 | + $x += $w; |
|
1696 | 1696 | $w = round($maxW * 0.23, 0); |
1697 | 1697 | $w2 = $w; |
1698 | 1698 | $texto = 'CNPJ / CPF'; |
1699 | 1699 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1700 | 1700 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1701 | 1701 | //Pegando valor do CPF/CNPJ |
1702 | - if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1702 | + if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1703 | 1703 | $texto = $this->formatField( |
1704 | 1704 | $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
1705 | 1705 | "###.###.###/####-##" |
1706 | 1706 | ); |
1707 | 1707 | } else { |
1708 | - $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1708 | + $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1709 | 1709 | $this->formatField( |
1710 | 1710 | $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue, |
1711 | 1711 | "###.###.###-##" |
@@ -1714,7 +1714,7 @@ discard block |
||
1714 | 1714 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1715 | 1715 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1716 | 1716 | //INSCRIÇÃO ESTADUAL |
1717 | - $x += $w; |
|
1717 | + $x += $w; |
|
1718 | 1718 | $w = $maxW - ($w1 + $w2); |
1719 | 1719 | $wx = $w; |
1720 | 1720 | $texto = 'INSCRIÇÃO ESTADUAL'; |
@@ -1733,7 +1733,7 @@ discard block |
||
1733 | 1733 | //ENDEREÇO |
1734 | 1734 | $w = round($maxW * 0.355, 0) + $wx; |
1735 | 1735 | $w1 = $w; |
1736 | - $y += $h; |
|
1736 | + $y += $h; |
|
1737 | 1737 | $x = $oldX; |
1738 | 1738 | $texto = 'ENDEREÇO'; |
1739 | 1739 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1744,7 +1744,7 @@ discard block |
||
1744 | 1744 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1745 | 1745 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
1746 | 1746 | //BAIRRO / DISTRITO |
1747 | - $x += $w; |
|
1747 | + $x += $w; |
|
1748 | 1748 | $w = round($maxW * 0.335, 0); |
1749 | 1749 | $w2 = $w; |
1750 | 1750 | $texto = 'BAIRRO / DISTRITO'; |
@@ -1754,12 +1754,12 @@ discard block |
||
1754 | 1754 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1755 | 1755 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1756 | 1756 | //CEP |
1757 | - $x += $w; |
|
1757 | + $x += $w; |
|
1758 | 1758 | $w = $maxW - ($w1 + $w2); |
1759 | 1759 | $texto = 'CEP'; |
1760 | 1760 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1761 | 1761 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1762 | - $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
1762 | + $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
1763 | 1763 | $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
1764 | 1764 | $texto = $this->formatField($texto, "#####-###"); |
1765 | 1765 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
@@ -1767,7 +1767,7 @@ discard block |
||
1767 | 1767 | //MUNICÍPIO |
1768 | 1768 | $w = round($maxW * 0.805, 0); |
1769 | 1769 | $w1 = $w; |
1770 | - $y += $h; |
|
1770 | + $y += $h; |
|
1771 | 1771 | $x = $oldX; |
1772 | 1772 | $texto = 'MUNICÍPIO'; |
1773 | 1773 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1779,7 +1779,7 @@ discard block |
||
1779 | 1779 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1780 | 1780 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
1781 | 1781 | //UF |
1782 | - $x += $w; |
|
1782 | + $x += $w; |
|
1783 | 1783 | $w = 8; |
1784 | 1784 | $texto = 'UF'; |
1785 | 1785 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1788,12 +1788,12 @@ discard block |
||
1788 | 1788 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1789 | 1789 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1790 | 1790 | //FONE / FAX |
1791 | - $x += $w; |
|
1791 | + $x += $w; |
|
1792 | 1792 | $w = $maxW - $w - $w1; |
1793 | 1793 | $texto = 'FONE / FAX'; |
1794 | 1794 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1795 | 1795 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1796 | - $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
1796 | + $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
1797 | 1797 | $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
1798 | 1798 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1799 | 1799 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -1813,7 +1813,7 @@ discard block |
||
1813 | 1813 | if (isset($this->cobr)) { |
1814 | 1814 | $fat = $this->cobr->getElementsByTagName("fat")->item(0); |
1815 | 1815 | if (isset($fat)) { |
1816 | - if (! empty($this->getTagValue($this->ide, "indPag"))) { |
|
1816 | + if (!empty($this->getTagValue($this->ide, "indPag"))) { |
|
1817 | 1817 | $textoIndPag = ""; |
1818 | 1818 | $indPag = $this->getTagValue($this->ide, "indPag"); |
1819 | 1819 | if ($indPag === "0") { |
@@ -1888,7 +1888,7 @@ discard block |
||
1888 | 1888 | $h = 8; |
1889 | 1889 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B']; |
1890 | 1890 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1891 | - $y += 3; |
|
1891 | + $y += 3; |
|
1892 | 1892 | $dups = ""; |
1893 | 1893 | $dupcont = 0; |
1894 | 1894 | $nFat = $this->dup->length; |
@@ -1922,13 +1922,13 @@ discard block |
||
1922 | 1922 | } |
1923 | 1923 | $increm = 1; |
1924 | 1924 | foreach ($this->dup as $k => $d) { |
1925 | - $nDup = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) |
|
1925 | + $nDup = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) |
|
1926 | 1926 | ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue |
1927 | 1927 | : ''; |
1928 | - $dDup = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
|
1928 | + $dDup = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
|
1929 | 1929 | ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
1930 | 1930 | : ''; |
1931 | - $vDup = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) |
|
1931 | + $vDup = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) |
|
1932 | 1932 | ? 'R$ ' . number_format( |
1933 | 1933 | $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue, |
1934 | 1934 | 2, |
@@ -1975,7 +1975,7 @@ discard block |
||
1975 | 1975 | } |
1976 | 1976 | if ($dupcont == 0) { |
1977 | 1977 | $y -= 9; |
1978 | - $linha --; |
|
1978 | + $linha--; |
|
1979 | 1979 | } |
1980 | 1980 | |
1981 | 1981 | return ($y + $h); |
@@ -2015,7 +2015,7 @@ discard block |
||
2015 | 2015 | $h = 8; |
2016 | 2016 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B']; |
2017 | 2017 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2018 | - $y += 3; |
|
2018 | + $y += 3; |
|
2019 | 2019 | $dups = ""; |
2020 | 2020 | $dupcont = 0; |
2021 | 2021 | if ($this->orientacao == 'P') { |
@@ -2044,7 +2044,7 @@ discard block |
||
2044 | 2044 | '90' => 'Sem pagamento', |
2045 | 2045 | '99' => 'Outros' |
2046 | 2046 | ]; |
2047 | - $bandeira = [ |
|
2047 | + $bandeira = [ |
|
2048 | 2048 | '01' => 'Visa', |
2049 | 2049 | '02' => 'Mastercard', |
2050 | 2050 | '03' => 'American', |
@@ -2057,10 +2057,10 @@ discard block |
||
2057 | 2057 | '99' => 'Outros' |
2058 | 2058 | ]; |
2059 | 2059 | foreach ($this->detPag as $k => $d) { |
2060 | - $fPag = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
|
2060 | + $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
|
2061 | 2061 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue |
2062 | 2062 | : '0'; |
2063 | - $vPag = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
2063 | + $vPag = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
2064 | 2064 | ? 'R$ ' . number_format( |
2065 | 2065 | $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue, |
2066 | 2066 | 2, |
@@ -2103,7 +2103,7 @@ discard block |
||
2103 | 2103 | } |
2104 | 2104 | if ($dupcont == 0) { |
2105 | 2105 | $y -= 9; |
2106 | - $linha --; |
|
2106 | + $linha--; |
|
2107 | 2107 | } |
2108 | 2108 | |
2109 | 2109 | return ($y + $h); |
@@ -2135,7 +2135,7 @@ discard block |
||
2135 | 2135 | $the_field = $this->ICMSTot->getElementsByTagName($campoImposto)->item(0); |
2136 | 2136 | if (isset($the_field)) { |
2137 | 2137 | $the_value = $the_field->nodeValue; |
2138 | - if (! empty($the_value)) { |
|
2138 | + if (!empty($the_value)) { |
|
2139 | 2139 | $valorImposto = number_format($the_value, 2, ",", "."); |
2140 | 2140 | } |
2141 | 2141 | } |
@@ -2164,10 +2164,10 @@ discard block |
||
2164 | 2164 | $x_inicial = $x; |
2165 | 2165 | //##################################################################### |
2166 | 2166 | $campos_por_linha = 9; |
2167 | - if (! $this->exibirPIS) { |
|
2168 | - $campos_por_linha --; |
|
2167 | + if (!$this->exibirPIS) { |
|
2168 | + $campos_por_linha--; |
|
2169 | 2169 | } |
2170 | - if (! $this->exibirIcmsInterestadual) { |
|
2170 | + if (!$this->exibirIcmsInterestadual) { |
|
2171 | 2171 | $campos_por_linha -= 2; |
2172 | 2172 | } |
2173 | 2173 | |
@@ -2254,12 +2254,12 @@ discard block |
||
2254 | 2254 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2255 | 2255 | //NOME / RAZÃO SOCIAL |
2256 | 2256 | $w1 = $maxW * 0.29; |
2257 | - $y += 3; |
|
2257 | + $y += 3; |
|
2258 | 2258 | $texto = 'NOME / RAZÃO SOCIAL'; |
2259 | 2259 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2260 | 2260 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2261 | 2261 | if (isset($this->transporta)) { |
2262 | - $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) |
|
2262 | + $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) |
|
2263 | 2263 | ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue |
2264 | 2264 | : ''; |
2265 | 2265 | } else { |
@@ -2268,12 +2268,12 @@ discard block |
||
2268 | 2268 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2269 | 2269 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
2270 | 2270 | //FRETE POR CONTA |
2271 | - $x += $w1; |
|
2271 | + $x += $w1; |
|
2272 | 2272 | $w2 = $maxW * 0.15; |
2273 | 2273 | $texto = 'FRETE'; |
2274 | 2274 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2275 | 2275 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2276 | - $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) |
|
2276 | + $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) |
|
2277 | 2277 | ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue |
2278 | 2278 | : '0'; |
2279 | 2279 | switch ($tipoFrete) { |
@@ -2299,12 +2299,12 @@ discard block |
||
2299 | 2299 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2300 | 2300 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 1, ''); |
2301 | 2301 | //CÓDIGO ANTT |
2302 | - $x += $w2; |
|
2302 | + $x += $w2; |
|
2303 | 2303 | $texto = 'CÓDIGO ANTT'; |
2304 | 2304 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2305 | 2305 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2306 | 2306 | if (isset($this->veicTransp)) { |
2307 | - $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) |
|
2307 | + $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) |
|
2308 | 2308 | ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue |
2309 | 2309 | : ''; |
2310 | 2310 | } else { |
@@ -2313,16 +2313,16 @@ discard block |
||
2313 | 2313 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2314 | 2314 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2315 | 2315 | //PLACA DO VEÍC |
2316 | - $x += $w2; |
|
2316 | + $x += $w2; |
|
2317 | 2317 | $texto = 'PLACA DO VEÍCULO'; |
2318 | 2318 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2319 | 2319 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2320 | 2320 | if (isset($this->veicTransp)) { |
2321 | - $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) |
|
2321 | + $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) |
|
2322 | 2322 | ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue |
2323 | 2323 | : ''; |
2324 | 2324 | } elseif (isset($this->reboque)) { |
2325 | - $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) |
|
2325 | + $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) |
|
2326 | 2326 | ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue |
2327 | 2327 | : ''; |
2328 | 2328 | } else { |
@@ -2331,17 +2331,17 @@ discard block |
||
2331 | 2331 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2332 | 2332 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2333 | 2333 | //UF |
2334 | - $x += $w2; |
|
2334 | + $x += $w2; |
|
2335 | 2335 | $w3 = round($maxW * 0.04, 0); |
2336 | 2336 | $texto = 'UF'; |
2337 | 2337 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2338 | 2338 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2339 | 2339 | if (isset($this->veicTransp)) { |
2340 | - $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2340 | + $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2341 | 2341 | ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue |
2342 | 2342 | : ''; |
2343 | 2343 | } elseif (isset($this->reboque)) { |
2344 | - $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2344 | + $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2345 | 2345 | ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue |
2346 | 2346 | : ''; |
2347 | 2347 | } else { |
@@ -2350,20 +2350,20 @@ discard block |
||
2350 | 2350 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2351 | 2351 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2352 | 2352 | //CNPJ / CPF |
2353 | - $x += $w3; |
|
2353 | + $x += $w3; |
|
2354 | 2354 | $w = $maxW - ($w1 + 3 * $w2 + $w3); |
2355 | 2355 | $texto = 'CNPJ / CPF'; |
2356 | 2356 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2357 | 2357 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2358 | 2358 | if (isset($this->transporta)) { |
2359 | - $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
|
2359 | + $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
|
2360 | 2360 | ? $this->formatField( |
2361 | 2361 | $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
2362 | 2362 | "##.###.###/####-##" |
2363 | 2363 | ) |
2364 | 2364 | : ''; |
2365 | 2365 | if ($texto == '') { |
2366 | - $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
2366 | + $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
2367 | 2367 | ? $this->formatField( |
2368 | 2368 | $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue, |
2369 | 2369 | "###.###.###-##" |
@@ -2377,7 +2377,7 @@ discard block |
||
2377 | 2377 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2378 | 2378 | //##################################################################### |
2379 | 2379 | //ENDEREÇO |
2380 | - $y += $h; |
|
2380 | + $y += $h; |
|
2381 | 2381 | $x = $oldX; |
2382 | 2382 | $h = 7; |
2383 | 2383 | $w1 = $maxW * 0.44; |
@@ -2385,7 +2385,7 @@ discard block |
||
2385 | 2385 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2386 | 2386 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2387 | 2387 | if (isset($this->transporta)) { |
2388 | - $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) |
|
2388 | + $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) |
|
2389 | 2389 | ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue |
2390 | 2390 | : ''; |
2391 | 2391 | } else { |
@@ -2394,13 +2394,13 @@ discard block |
||
2394 | 2394 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2395 | 2395 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
2396 | 2396 | //MUNICÍPIO |
2397 | - $x += $w1; |
|
2397 | + $x += $w1; |
|
2398 | 2398 | $w2 = round($maxW * 0.30, 0); |
2399 | 2399 | $texto = 'MUNICÍPIO'; |
2400 | 2400 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2401 | 2401 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2402 | 2402 | if (isset($this->transporta)) { |
2403 | - $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) |
|
2403 | + $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) |
|
2404 | 2404 | ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue |
2405 | 2405 | : ''; |
2406 | 2406 | } else { |
@@ -2409,13 +2409,13 @@ discard block |
||
2409 | 2409 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2410 | 2410 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2411 | 2411 | //UF |
2412 | - $x += $w2; |
|
2412 | + $x += $w2; |
|
2413 | 2413 | $w3 = round($maxW * 0.04, 0); |
2414 | 2414 | $texto = 'UF'; |
2415 | 2415 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2416 | 2416 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2417 | 2417 | if (isset($this->transporta)) { |
2418 | - $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2418 | + $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2419 | 2419 | ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue |
2420 | 2420 | : ''; |
2421 | 2421 | } else { |
@@ -2424,14 +2424,14 @@ discard block |
||
2424 | 2424 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2425 | 2425 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2426 | 2426 | //INSCRIÇÃO ESTADUAL |
2427 | - $x += $w3; |
|
2427 | + $x += $w3; |
|
2428 | 2428 | $w = $maxW - ($w1 + $w2 + $w3); |
2429 | 2429 | $texto = 'INSCRIÇÃO ESTADUAL'; |
2430 | 2430 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2431 | 2431 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2432 | 2432 | $texto = ''; |
2433 | 2433 | if (isset($this->transporta)) { |
2434 | - if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
2434 | + if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
2435 | 2435 | $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue; |
2436 | 2436 | } |
2437 | 2437 | } |
@@ -2447,13 +2447,13 @@ discard block |
||
2447 | 2447 | $pesoBruto = 0; |
2448 | 2448 | $pesoLiquido = 0; |
2449 | 2449 | foreach ($volumes as $volume) { |
2450 | - $quantidade += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
2450 | + $quantidade += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
2451 | 2451 | $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0; |
2452 | - $pesoBruto += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
2452 | + $pesoBruto += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
2453 | 2453 | $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0; |
2454 | - $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
2454 | + $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
2455 | 2455 | $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0; |
2456 | - $texto = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
2456 | + $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
2457 | 2457 | $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : ''; |
2458 | 2458 | if ($texto != $especie && $especie != '') { |
2459 | 2459 | //tem várias especies |
@@ -2461,7 +2461,7 @@ discard block |
||
2461 | 2461 | } else { |
2462 | 2462 | $especie = $texto; |
2463 | 2463 | } |
2464 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) |
|
2464 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) |
|
2465 | 2465 | ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue |
2466 | 2466 | : ''; |
2467 | 2467 | if ($texto != $marca && $marca != '') { |
@@ -2470,7 +2470,7 @@ discard block |
||
2470 | 2470 | } else { |
2471 | 2471 | $marca = $texto; |
2472 | 2472 | } |
2473 | - $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) |
|
2473 | + $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) |
|
2474 | 2474 | ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue |
2475 | 2475 | : ''; |
2476 | 2476 | if ($texto != $numero && $numero != '') { |
@@ -2483,20 +2483,20 @@ discard block |
||
2483 | 2483 | |
2484 | 2484 | //##################################################################### |
2485 | 2485 | //QUANTIDADE |
2486 | - $y += $h; |
|
2486 | + $y += $h; |
|
2487 | 2487 | $x = $oldX; |
2488 | 2488 | $h = 7; |
2489 | 2489 | $w1 = round($maxW * 0.10, 0); |
2490 | 2490 | $texto = 'QUANTIDADE'; |
2491 | 2491 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2492 | 2492 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2493 | - if (! empty($quantidade)) { |
|
2493 | + if (!empty($quantidade)) { |
|
2494 | 2494 | $texto = $quantidade; |
2495 | 2495 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2496 | 2496 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2497 | 2497 | } |
2498 | 2498 | //ESPÉCIE |
2499 | - $x += $w1; |
|
2499 | + $x += $w1; |
|
2500 | 2500 | $w2 = round($maxW * 0.17, 0); |
2501 | 2501 | $texto = 'ESPÉCIE'; |
2502 | 2502 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -2505,16 +2505,16 @@ discard block |
||
2505 | 2505 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2506 | 2506 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2507 | 2507 | //MARCA |
2508 | - $x += $w2; |
|
2508 | + $x += $w2; |
|
2509 | 2509 | $texto = 'MARCA'; |
2510 | 2510 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2511 | 2511 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2512 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
2512 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
2513 | 2513 | $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : ''; |
2514 | 2514 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2515 | 2515 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2516 | 2516 | //NUMERAÇÃO |
2517 | - $x += $w2; |
|
2517 | + $x += $w2; |
|
2518 | 2518 | $texto = 'NUMERAÇÃO'; |
2519 | 2519 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2520 | 2520 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2522,7 +2522,7 @@ discard block |
||
2522 | 2522 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2523 | 2523 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2524 | 2524 | //PESO BRUTO |
2525 | - $x += $w2; |
|
2525 | + $x += $w2; |
|
2526 | 2526 | $w3 = round($maxW * 0.20, 0); |
2527 | 2527 | $texto = 'PESO BRUTO'; |
2528 | 2528 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -2535,7 +2535,7 @@ discard block |
||
2535 | 2535 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2536 | 2536 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, ''); |
2537 | 2537 | //PESO LÍQUIDO |
2538 | - $x += $w3; |
|
2538 | + $x += $w3; |
|
2539 | 2539 | $w = $maxW - ($w1 + 3 * $w2 + $w3); |
2540 | 2540 | $texto = 'PESO LÍQUIDO'; |
2541 | 2541 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -2555,11 +2555,11 @@ discard block |
||
2555 | 2555 | protected function descricaoProdutoHelper($origem, $campo, $formato) |
2556 | 2556 | { |
2557 | 2557 | $valor_original = $origem->getElementsByTagName($campo)->item(0); |
2558 | - if (! isset($valor_original)) { |
|
2558 | + if (!isset($valor_original)) { |
|
2559 | 2559 | return ""; |
2560 | 2560 | } |
2561 | 2561 | $valor_original = $valor_original->nodeValue; |
2562 | - $valor = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
2562 | + $valor = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
2563 | 2563 | |
2564 | 2564 | if ($valor != "") { |
2565 | 2565 | return sprintf($formato, $valor); |
@@ -2585,7 +2585,7 @@ discard block |
||
2585 | 2585 | $ICMSUFDest = $itemProd->getElementsByTagName("ICMSUFDest")->item(0); |
2586 | 2586 | $impostos = ''; |
2587 | 2587 | |
2588 | - if (! empty($ICMS)) { |
|
2588 | + if (!empty($ICMS)) { |
|
2589 | 2589 | $impostos .= $this->descricaoProdutoHelper($ICMS, "vBCFCP", " BcFcp=%s"); |
2590 | 2590 | $impostos .= $this->descricaoProdutoHelper($ICMS, "pFCP", " pFcp=%s%%"); |
2591 | 2591 | $impostos .= $this->descricaoProdutoHelper($ICMS, "vFCP", " vFcp=%s"); |
@@ -2601,7 +2601,7 @@ discard block |
||
2601 | 2601 | $impostos .= $this->descricaoProdutoHelper($ICMS, "pST", " pSt=%s"); |
2602 | 2602 | $impostos .= $this->descricaoProdutoHelper($ICMS, "vICMSSTRet", " VALOR ICMS ST=%s"); |
2603 | 2603 | } |
2604 | - if (! empty($ICMSUFDest)) { |
|
2604 | + if (!empty($ICMSUFDest)) { |
|
2605 | 2605 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pFCPUFDest", " pFCPUFDest=%s%%"); |
2606 | 2606 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSUFDest", " pICMSUFDest=%s%%"); |
2607 | 2607 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSInterPart", " pICMSInterPart=%s%%"); |
@@ -2609,20 +2609,20 @@ discard block |
||
2609 | 2609 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s"); |
2610 | 2610 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s"); |
2611 | 2611 | } |
2612 | - $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
2612 | + $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
2613 | 2613 | ? substr( |
2614 | 2614 | $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue), |
2615 | 2615 | 0, |
2616 | 2616 | 500 |
2617 | 2617 | ) |
2618 | 2618 | : ''; |
2619 | - if (! empty($infAdProd)) { |
|
2619 | + if (!empty($infAdProd)) { |
|
2620 | 2620 | $infAdProd = trim($infAdProd); |
2621 | 2621 | $infAdProd .= ' '; |
2622 | 2622 | } |
2623 | 2623 | $loteTxt = ''; |
2624 | 2624 | $rastro = $prod->getElementsByTagName("med"); |
2625 | - if (! empty($prod->getElementsByTagName("rastro"))) { |
|
2625 | + if (!empty($prod->getElementsByTagName("rastro"))) { |
|
2626 | 2626 | $rastro = $prod->getElementsByTagName("rastro"); |
2627 | 2627 | $i = 0; |
2628 | 2628 | while ($i < $rastro->length) { |
@@ -2631,14 +2631,14 @@ discard block |
||
2631 | 2631 | $loteTxt .= $this->getTagDate($rastro->item($i), 'dFab', ' Fab: '); |
2632 | 2632 | $loteTxt .= $this->getTagDate($rastro->item($i), 'dVal', ' Val: '); |
2633 | 2633 | $loteTxt .= $this->getTagValue($rastro->item($i), 'vPMC', ' PMC: '); |
2634 | - $i ++; |
|
2634 | + $i++; |
|
2635 | 2635 | } |
2636 | 2636 | if ($loteTxt != '') { |
2637 | 2637 | $loteTxt .= ' '; |
2638 | 2638 | } |
2639 | 2639 | } |
2640 | 2640 | //NT2013.006 FCI |
2641 | - $nFCI = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
2641 | + $nFCI = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
2642 | 2642 | ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
2643 | 2643 | $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
2644 | 2644 | $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue |
@@ -2688,7 +2688,7 @@ discard block |
||
2688 | 2688 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2689 | 2689 | $y += 3; |
2690 | 2690 | //desenha a caixa dos dados dos itens da NF |
2691 | - $hmax += 1; |
|
2691 | + $hmax += 1; |
|
2692 | 2692 | $texto = ''; |
2693 | 2693 | $this->pdf->textBox($x, $y, $w, $hmax); |
2694 | 2694 | //################################################################################## |
@@ -2701,101 +2701,101 @@ discard block |
||
2701 | 2701 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2702 | 2702 | $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax); |
2703 | 2703 | //DESCRIÇÃO DO PRODUTO / SERVIÇO |
2704 | - $x += $w1; |
|
2704 | + $x += $w1; |
|
2705 | 2705 | $w2 = round($w * 0.25, 0); |
2706 | 2706 | $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO'; |
2707 | 2707 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2708 | 2708 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2709 | 2709 | $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax); |
2710 | 2710 | //NCM/SH |
2711 | - $x += $w2; |
|
2711 | + $x += $w2; |
|
2712 | 2712 | $w3 = round($w * 0.06, 0); |
2713 | 2713 | $texto = 'NCM/SH'; |
2714 | 2714 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2715 | 2715 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2716 | 2716 | $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax); |
2717 | 2717 | //O/CST ou O/CSOSN |
2718 | - $x += $w3; |
|
2718 | + $x += $w3; |
|
2719 | 2719 | $w4 = round($w * 0.05, 0); |
2720 | - $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2 |
|
2720 | + $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 ou CRT = 2 |
|
2721 | 2721 | if ($this->getTagValue($this->emit, 'CRT') == '3') { |
2722 | - $texto = 'O/CST';//Regime Normal |
|
2722 | + $texto = 'O/CST'; //Regime Normal |
|
2723 | 2723 | } |
2724 | 2724 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2725 | 2725 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2726 | 2726 | $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax); |
2727 | 2727 | //CFOP |
2728 | - $x += $w4; |
|
2728 | + $x += $w4; |
|
2729 | 2729 | $w5 = round($w * 0.04, 0); |
2730 | 2730 | $texto = 'CFOP'; |
2731 | 2731 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2732 | 2732 | $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2733 | 2733 | $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax); |
2734 | 2734 | //UN |
2735 | - $x += $w5; |
|
2735 | + $x += $w5; |
|
2736 | 2736 | $w6 = round($w * 0.03, 0); |
2737 | 2737 | $texto = 'UN'; |
2738 | 2738 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2739 | 2739 | $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2740 | 2740 | $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax); |
2741 | 2741 | //QUANT |
2742 | - $x += $w6; |
|
2742 | + $x += $w6; |
|
2743 | 2743 | $w7 = round($w * 0.08, 0); |
2744 | 2744 | $texto = 'QUANT'; |
2745 | 2745 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2746 | 2746 | $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2747 | 2747 | $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax); |
2748 | 2748 | //VALOR UNIT |
2749 | - $x += $w7; |
|
2749 | + $x += $w7; |
|
2750 | 2750 | $w8 = round($w * 0.06, 0); |
2751 | 2751 | $texto = 'VALOR UNIT'; |
2752 | 2752 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2753 | 2753 | $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2754 | 2754 | $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax); |
2755 | 2755 | //VALOR TOTAL |
2756 | - $x += $w8; |
|
2756 | + $x += $w8; |
|
2757 | 2757 | $w9 = round($w * 0.06, 0); |
2758 | 2758 | $texto = 'VALOR TOTAL'; |
2759 | 2759 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2760 | 2760 | $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2761 | 2761 | $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax); |
2762 | 2762 | //VALOR DESCONTO |
2763 | - $x += $w9; |
|
2763 | + $x += $w9; |
|
2764 | 2764 | $w10 = round($w * 0.05, 0); |
2765 | 2765 | $texto = 'VALOR DESC'; |
2766 | 2766 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2767 | 2767 | $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2768 | 2768 | $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax); |
2769 | 2769 | //B.CÁLC ICMS |
2770 | - $x += $w10; |
|
2770 | + $x += $w10; |
|
2771 | 2771 | $w11 = round($w * 0.06, 0); |
2772 | 2772 | $texto = 'B.CÁLC ICMS'; |
2773 | 2773 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2774 | 2774 | $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2775 | 2775 | $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax); |
2776 | 2776 | //VALOR ICMS |
2777 | - $x += $w11; |
|
2777 | + $x += $w11; |
|
2778 | 2778 | $w12 = round($w * 0.06, 0); |
2779 | 2779 | $texto = 'VALOR ICMS'; |
2780 | 2780 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2781 | 2781 | $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2782 | 2782 | $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax); |
2783 | 2783 | //VALOR IPI |
2784 | - $x += $w12; |
|
2784 | + $x += $w12; |
|
2785 | 2785 | $w13 = round($w * 0.05, 0); |
2786 | 2786 | $texto = 'VALOR IPI'; |
2787 | 2787 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2788 | 2788 | $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2789 | 2789 | $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax); |
2790 | 2790 | //ALÍQ. ICMS |
2791 | - $x += $w13; |
|
2791 | + $x += $w13; |
|
2792 | 2792 | $w14 = round($w * 0.04, 0); |
2793 | 2793 | $texto = 'ALÍQ. ICMS'; |
2794 | 2794 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2795 | 2795 | $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2796 | 2796 | $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax); |
2797 | 2797 | //ALÍQ. IPI |
2798 | - $x += $w14; |
|
2798 | + $x += $w14; |
|
2799 | 2799 | $w15 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14); |
2800 | 2800 | $texto = 'ALÍQ. IPI'; |
2801 | 2801 | $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
@@ -2839,7 +2839,7 @@ discard block |
||
2839 | 2839 | // Informação sobre unidade de medida tributavel. |
2840 | 2840 | // Se não for para exibir a unidade de medida tributavel, então |
2841 | 2841 | // A Escrita irá começar em 0. |
2842 | - if (! $mostrarUnidadeTributavel) { |
|
2842 | + if (!$mostrarUnidadeTributavel) { |
|
2843 | 2843 | $yTrib = 0; |
2844 | 2844 | } |
2845 | 2845 | $h = $this->calculeHeight($thisItem, $mostrarUnidadeTributavel); |
@@ -2874,7 +2874,7 @@ discard block |
||
2874 | 2874 | } |
2875 | 2875 | $x += $w2; |
2876 | 2876 | //NCM |
2877 | - $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
2877 | + $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
2878 | 2878 | $prod->getElementsByTagName("NCM")->item(0)->nodeValue : ''; |
2879 | 2879 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, ''); |
2880 | 2880 | $x += $w3; |
@@ -2887,11 +2887,11 @@ discard block |
||
2887 | 2887 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, ''); |
2888 | 2888 | } |
2889 | 2889 | //CFOP |
2890 | - $x += $w4; |
|
2890 | + $x += $w4; |
|
2891 | 2891 | $texto = $prod->getElementsByTagName("CFOP")->item(0)->nodeValue; |
2892 | 2892 | $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'T', 'C', 0, ''); |
2893 | 2893 | //Unidade |
2894 | - $x += $w5; |
|
2894 | + $x += $w5; |
|
2895 | 2895 | $texto = $uCom; |
2896 | 2896 | $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'T', 'C', 0, ''); |
2897 | 2897 | //Unidade de medida tributável |
@@ -2912,7 +2912,7 @@ discard block |
||
2912 | 2912 | // QTDADE Tributável |
2913 | 2913 | if ($mostrarUnidadeTributavel) { |
2914 | 2914 | $qTrib = $prod->getElementsByTagName("qTrib")->item(0); |
2915 | - if (! empty($qTrib)) { |
|
2915 | + if (!empty($qTrib)) { |
|
2916 | 2916 | $texto = number_format($qTrib->nodeValue, $this->qComCasasDec, ",", "."); |
2917 | 2917 | $this->pdf->textBox($x, $yTrib, $w7, $h, $texto, $aFont, 'T', $alinhamento, 0, ''); |
2918 | 2918 | } |
@@ -2925,7 +2925,7 @@ discard block |
||
2925 | 2925 | // Valor Unitário Tributável |
2926 | 2926 | if ($mostrarUnidadeTributavel) { |
2927 | 2927 | $vUnTrib = $prod->getElementsByTagName("vUnTrib")->item(0); |
2928 | - if (! empty($vUnTrib)) { |
|
2928 | + if (!empty($vUnTrib)) { |
|
2929 | 2929 | $texto = number_format($vUnTrib->nodeValue, $this->vUnComCasasDec, ",", "."); |
2930 | 2930 | $this->pdf->textBox($x, $yTrib, $w8, $h, $texto, $aFont, 'T', $alinhamento, 0, ''); |
2931 | 2931 | } |
@@ -2939,7 +2939,7 @@ discard block |
||
2939 | 2939 | $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'T', $alinhamento, 0, ''); |
2940 | 2940 | $x += $w9; |
2941 | 2941 | //Valor do Desconto |
2942 | - $vdesc = ! empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue) |
|
2942 | + $vdesc = !empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue) |
|
2943 | 2943 | ? $prod->getElementsByTagName("vDesc")->item(0)->nodeValue : 0; |
2944 | 2944 | |
2945 | 2945 | $texto = number_format($vdesc, 2, ",", "."); |
@@ -2947,7 +2947,7 @@ discard block |
||
2947 | 2947 | //Valor da Base de calculo |
2948 | 2948 | $x += $w10; |
2949 | 2949 | if (isset($ICMS)) { |
2950 | - $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) |
|
2950 | + $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) |
|
2951 | 2951 | ? number_format( |
2952 | 2952 | $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue, |
2953 | 2953 | 2, |
@@ -2960,7 +2960,7 @@ discard block |
||
2960 | 2960 | //Valor do ICMS |
2961 | 2961 | $x += $w11; |
2962 | 2962 | if (isset($ICMS)) { |
2963 | - $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) |
|
2963 | + $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) |
|
2964 | 2964 | ? number_format( |
2965 | 2965 | $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue, |
2966 | 2966 | 2, |
@@ -2973,7 +2973,7 @@ discard block |
||
2973 | 2973 | //Valor do IPI |
2974 | 2974 | $x += $w12; |
2975 | 2975 | if (isset($IPI)) { |
2976 | - $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) |
|
2976 | + $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) |
|
2977 | 2977 | ? number_format( |
2978 | 2978 | $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, |
2979 | 2979 | 2, |
@@ -2988,7 +2988,7 @@ discard block |
||
2988 | 2988 | // %ICMS |
2989 | 2989 | $x += $w13; |
2990 | 2990 | if (isset($ICMS)) { |
2991 | - $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) |
|
2991 | + $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) |
|
2992 | 2992 | ? number_format( |
2993 | 2993 | $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue, |
2994 | 2994 | 2, |
@@ -3001,7 +3001,7 @@ discard block |
||
3001 | 3001 | //%IPI |
3002 | 3002 | $x += $w14; |
3003 | 3003 | if (isset($IPI)) { |
3004 | - $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) |
|
3004 | + $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) |
|
3005 | 3005 | ? number_format( |
3006 | 3006 | $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue, |
3007 | 3007 | 2, |
@@ -3019,17 +3019,17 @@ discard block |
||
3019 | 3019 | $veicProd = $prod->getElementsByTagName("veicProd")->item(0); |
3020 | 3020 | // Tag somente é gerada para veiculo 0k, e só é permitido um veiculo por NF-e por conta do detran |
3021 | 3021 | // Verifica se a Tag existe |
3022 | - if (! empty($veicProd)) { |
|
3022 | + if (!empty($veicProd)) { |
|
3023 | 3023 | $this->dadosItenVeiculoDANFE($oldX, $y, $nInicio, $h, $prod); |
3024 | 3024 | } |
3025 | 3025 | |
3026 | 3026 | |
3027 | 3027 | $y += $h; |
3028 | - $i ++; |
|
3028 | + $i++; |
|
3029 | 3029 | //incrementa o controle dos itens processados. |
3030 | - $this->qtdeItensProc ++; |
|
3030 | + $this->qtdeItensProc++; |
|
3031 | 3031 | } else { |
3032 | - $i ++; |
|
3032 | + $i++; |
|
3033 | 3033 | } |
3034 | 3034 | } |
3035 | 3035 | |
@@ -3234,23 +3234,23 @@ discard block |
||
3234 | 3234 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B']; |
3235 | 3235 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
3236 | 3236 | //INSCRIÇÃO MUNICIPAL |
3237 | - $y += 3; |
|
3237 | + $y += 3; |
|
3238 | 3238 | $w = round($this->wPrint * 0.23, 0); |
3239 | 3239 | $texto = 'INSCRIÇÃO MUNICIPAL'; |
3240 | 3240 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
3241 | 3241 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
3242 | 3242 | //inscrição municipal |
3243 | - $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
3243 | + $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
3244 | 3244 | $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : ''; |
3245 | 3245 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
3246 | 3246 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
3247 | 3247 | //VALOR TOTAL DOS SERVIÇOS |
3248 | - $x += $w; |
|
3248 | + $x += $w; |
|
3249 | 3249 | $texto = 'VALOR TOTAL DOS SERVIÇOS'; |
3250 | 3250 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
3251 | 3251 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
3252 | 3252 | if (isset($this->ISSQNtot)) { |
3253 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
3253 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
3254 | 3254 | $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : ''; |
3255 | 3255 | $texto = number_format($texto, 2, ",", "."); |
3256 | 3256 | } else { |
@@ -3259,14 +3259,14 @@ discard block |
||
3259 | 3259 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
3260 | 3260 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
3261 | 3261 | //BASE DE CÁLCULO DO ISSQN |
3262 | - $x += $w; |
|
3262 | + $x += $w; |
|
3263 | 3263 | $texto = 'BASE DE CÁLCULO DO ISSQN'; |
3264 | 3264 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
3265 | 3265 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
3266 | 3266 | if (isset($this->ISSQNtot)) { |
3267 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
3267 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
3268 | 3268 | $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : ''; |
3269 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
3269 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
3270 | 3270 | } else { |
3271 | 3271 | $texto = ''; |
3272 | 3272 | } |
@@ -3283,9 +3283,9 @@ discard block |
||
3283 | 3283 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
3284 | 3284 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
3285 | 3285 | if (isset($this->ISSQNtot)) { |
3286 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
3286 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
3287 | 3287 | $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : ''; |
3288 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
3288 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
3289 | 3289 | } else { |
3290 | 3290 | $texto = ''; |
3291 | 3291 | } |
@@ -3324,7 +3324,7 @@ discard block |
||
3324 | 3324 | |
3325 | 3325 | //INFORMAÇÕES COMPLEMENTARES |
3326 | 3326 | $texto = "INFORMAÇÕES COMPLEMENTARES"; |
3327 | - $y += 3; |
|
3327 | + $y += 3; |
|
3328 | 3328 | $w = $this->wAdic; |
3329 | 3329 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => 'B']; |
3330 | 3330 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3334,7 +3334,7 @@ discard block |
||
3334 | 3334 | //$this->textoAdic com o texto completo do campo |
3335 | 3335 | //echo str_replace("\n", "<br>",$this->textoAdic); |
3336 | 3336 | //die; |
3337 | - $y += 1; |
|
3337 | + $y += 1; |
|
3338 | 3338 | $aFont = ['font' => $this->fontePadrao, 'size' => $this->textadicfontsize * $this->pdf->k, 'style' => '']; |
3339 | 3339 | //$aFont = ['font'=>$this->fontePadrao, 'size'=> 5, 'style'=>'']; |
3340 | 3340 | $this->pdf->textBox($x, $y + 2, $w - 2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
@@ -3385,7 +3385,7 @@ discard block |
||
3385 | 3385 | $texto = 'CONTINGÊNCIA SVC-RS' . $dhCont . $xJust; |
3386 | 3386 | break; |
3387 | 3387 | } |
3388 | - $y += 2; |
|
3388 | + $y += 2; |
|
3389 | 3389 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => '']; |
3390 | 3390 | $this->pdf->textBox($x, $y, $w - 2, $h, $texto, $aFont, 'T', 'L', 0, '', false); |
3391 | 3391 | |
@@ -3440,7 +3440,7 @@ discard block |
||
3440 | 3440 | $tpNF = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue; |
3441 | 3441 | if ($tpNF == '0') { |
3442 | 3442 | //NFe de Entrada |
3443 | - $emitente = ''; |
|
3443 | + $emitente = ''; |
|
3444 | 3444 | $emitente .= $this->dest->getElementsByTagName("xNome")->item(0)->nodeValue . " - "; |
3445 | 3445 | $emitente .= $this->enderDest->getElementsByTagName("xLgr")->item(0)->nodeValue . ", "; |
3446 | 3446 | $emitente .= $this->enderDest->getElementsByTagName("nro")->item(0)->nodeValue . " - "; |
@@ -3493,10 +3493,10 @@ discard block |
||
3493 | 3493 | $texto .= "AO LADO"; |
3494 | 3494 | } |
3495 | 3495 | $texto .= ". EMISSÃO: "; |
3496 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3496 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3497 | 3497 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
3498 | 3498 | if ($dEmi == '') { |
3499 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3499 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3500 | 3500 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
3501 | 3501 | $aDemi = explode('T', $dEmi); |
3502 | 3502 | $dEmi = $aDemi[0]; |
@@ -3519,12 +3519,12 @@ discard block |
||
3519 | 3519 | $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, ''); |
3520 | 3520 | //DATA DE RECEBIMENTO |
3521 | 3521 | $texto = "DATA DE RECEBIMENTO"; |
3522 | - $y += $h; |
|
3522 | + $y += $h; |
|
3523 | 3523 | $w2 = round($this->wPrint * 0.17, 0); //35; |
3524 | 3524 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
3525 | 3525 | $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
3526 | 3526 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
3527 | - $x += $w2; |
|
3527 | + $x += $w2; |
|
3528 | 3528 | $w3 = $w - $w2; |
3529 | 3529 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
3530 | 3530 | $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3535,7 +3535,7 @@ discard block |
||
3535 | 3535 | |
3536 | 3536 | return $y; |
3537 | 3537 | } else { |
3538 | - $x --; |
|
3538 | + $x--; |
|
3539 | 3539 | $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
3540 | 3540 | //NUMERO DA NOTA FISCAL LOGO NFE |
3541 | 3541 | $w1 = 18; |
@@ -3556,7 +3556,7 @@ discard block |
||
3556 | 3556 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
3557 | 3557 | $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
3558 | 3558 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
3559 | - $y -= $w2; |
|
3559 | + $y -= $w2; |
|
3560 | 3560 | $w3 = $w - $w2; |
3561 | 3561 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
3562 | 3562 | $aFont = ['font' => $this->fontePadrao, 'size' => 5.7, 'style' => '']; |
@@ -3577,18 +3577,18 @@ discard block |
||
3577 | 3577 | */ |
3578 | 3578 | protected function geraInformacoesDaTagCompra() |
3579 | 3579 | { |
3580 | - if (! $this->gerarInformacoesAutomaticas) { |
|
3580 | + if (!$this->gerarInformacoesAutomaticas) { |
|
3581 | 3581 | return ''; |
3582 | 3582 | } |
3583 | 3583 | $saida = ""; |
3584 | 3584 | if (isset($this->compra)) { |
3585 | - if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
3585 | + if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
3586 | 3586 | $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue; |
3587 | 3587 | } |
3588 | - if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
3588 | + if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
3589 | 3589 | $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue; |
3590 | 3590 | } |
3591 | - if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
3591 | + if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
3592 | 3592 | $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue; |
3593 | 3593 | } |
3594 | 3594 | } |
@@ -3619,10 +3619,10 @@ discard block |
||
3619 | 3619 | if ($icmss > 0) { |
3620 | 3620 | $icmss = 1; |
3621 | 3621 | } |
3622 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3622 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3623 | 3623 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
3624 | 3624 | if ($dEmi == '') { |
3625 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3625 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3626 | 3626 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
3627 | 3627 | $aDemi = explode('T', $dEmi); |
3628 | 3628 | $dEmi = $aDemi[0]; |
@@ -3646,7 +3646,7 @@ discard block |
||
3646 | 3646 | */ |
3647 | 3647 | protected function geraInformacoesDasNotasReferenciadas() |
3648 | 3648 | { |
3649 | - if (! $this->gerarInformacoesAutomaticas) { |
|
3649 | + if (!$this->gerarInformacoesAutomaticas) { |
|
3650 | 3650 | return ''; |
3651 | 3651 | } |
3652 | 3652 | $formaNfeRef = "\r\nNFe Ref.: série:%d número:%d emit:%s em %s [%s]"; |
@@ -3674,7 +3674,7 @@ discard block |
||
3674 | 3674 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
3675 | 3675 | $serie = substr($chave_acesso, 22, 3); |
3676 | 3676 | $numero = substr($chave_acesso, 25, 9); |
3677 | - $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
3677 | + $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
3678 | 3678 | } |
3679 | 3679 | $refNF = $nfRef->getElementsByTagName('refNF'); |
3680 | 3680 | foreach ($refNF as $umaRefNFe) { |
@@ -3685,7 +3685,7 @@ discard block |
||
3685 | 3685 | $numero = $umaRefNFe->getElementsByTagName('nNF')->item(0)->nodeValue; |
3686 | 3686 | $data = substr($data, 2, 2) . "/20" . substr($data, 0, 2); |
3687 | 3687 | $cnpj = $this->formatField($cnpj, "##.###.###/####-##"); |
3688 | - $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod); |
|
3688 | + $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod); |
|
3689 | 3689 | } |
3690 | 3690 | $refCTe = $nfRef->getElementsByTagName('refCTe'); |
3691 | 3691 | foreach ($refCTe as $chave_acessoRef) { |
@@ -3695,7 +3695,7 @@ discard block |
||
3695 | 3695 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
3696 | 3696 | $serie = substr($chave_acesso, 22, 3); |
3697 | 3697 | $numero = substr($chave_acesso, 25, 9); |
3698 | - $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
3698 | + $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
3699 | 3699 | } |
3700 | 3700 | $refECF = $nfRef->getElementsByTagName('refECF'); |
3701 | 3701 | foreach ($refECF as $umaRefNFe) { |
@@ -3707,10 +3707,9 @@ discard block |
||
3707 | 3707 | $refNFP = $nfRef->getElementsByTagName('refNFP'); |
3708 | 3708 | foreach ($refNFP as $umaRefNFe) { |
3709 | 3709 | $data = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue; |
3710 | - $cnpj = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
3711 | - $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : |
|
3712 | - ''; |
|
3713 | - $cpf = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
3710 | + $cnpj = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
3711 | + $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : ''; |
|
3712 | + $cpf = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
3714 | 3713 | $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : ''; |
3715 | 3714 | $mod = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue; |
3716 | 3715 | $serie = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue; |
@@ -3732,7 +3731,7 @@ discard block |
||
3732 | 3731 | private function loadDoc($xml) |
3733 | 3732 | { |
3734 | 3733 | $this->xml = $xml; |
3735 | - if (! empty($xml)) { |
|
3734 | + if (!empty($xml)) { |
|
3736 | 3735 | $this->dom = new Dom(); |
3737 | 3736 | $this->dom->loadXML($this->xml); |
3738 | 3737 | if (empty($this->dom->getElementsByTagName("infNFe")->item(0))) { |
@@ -3786,7 +3785,7 @@ discard block |
||
3786 | 3785 | $numlinhas = $this->pdf->getNumLines($textoProduto, $w2, $aFont); |
3787 | 3786 | |
3788 | 3787 | if ($mostrarUnidadeTributavel && $numlinhas == 1) { |
3789 | - $numlinhas ++; |
|
3788 | + $numlinhas++; |
|
3790 | 3789 | } |
3791 | 3790 | |
3792 | 3791 | return round(($numlinhas * $this->pdf->fontSize) + ($numlinhas * 0.5), 2); |