@@ -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; |
@@ -794,15 +794,15 @@ discard block |
||
794 | 794 | //grupo CADATA infCpl |
795 | 795 | $t = $dom->getElementsByTagName('transmissor')->item(0); |
796 | 796 | $r = $dom->getElementsByTagName('receptor')->item(0); |
797 | - $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
797 | + $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
798 | 798 | 'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : ''; |
799 | - $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
799 | + $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
800 | 800 | 'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : ''; |
801 | - $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
801 | + $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
802 | 802 | 'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : ''; |
803 | - $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
803 | + $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
804 | 804 | 'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : ''; |
805 | - $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
805 | + $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
806 | 806 | if (isset($t)) { |
807 | 807 | if ($t->hasAttributes()) { |
808 | 808 | $texto .= " Transmissor "; |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | $resp['message'][] = 'NFe NÃO PROTOCOLADA'; |
845 | 845 | } elseif ($this->getTagValue($this->ide, "tpAmb") == '2') { |
846 | 846 | $resp['status'] = false; |
847 | - $resp['message'][] = "NFe EMITIDA EM HOMOLOGAÇÃO"; |
|
847 | + $resp['message'][] = "NFe EMITIDA EM HOMOLOGAÇÃO"; |
|
848 | 848 | } |
849 | 849 | $retEvento = $this->nfeProc->getElementsByTagName('retEvento')->item(0); |
850 | 850 | $cStat = $this->getTagValue($this->nfeProc, "cStat"); |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | } elseif (!empty($retEvento)) { |
866 | 866 | $infEvento = $retEvento->getElementsByTagName('infEvento')->item(0); |
867 | 867 | $cStat = $this->getTagValue($infEvento, "cStat"); |
868 | - $tpEvento= $this->getTagValue($infEvento, "tpEvento"); |
|
868 | + $tpEvento = $this->getTagValue($infEvento, "tpEvento"); |
|
869 | 869 | $dhEvento = date("d/m/Y H:i:s", $this->toTimestamp($this->getTagValue($infEvento, "dhRegEvento"))); |
870 | 870 | $nProt = $this->getTagValue($infEvento, "nProt"); |
871 | 871 | if ($tpEvento == '110111' && ($cStat == '101' || $cStat == '151' || $cStat == '135' || $cStat == '155')) { |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | |
880 | 880 | protected function notaDPEC() |
881 | 881 | { |
882 | - return ! empty($this->numdepec); |
|
882 | + return !empty($this->numdepec); |
|
883 | 883 | } |
884 | 884 | |
885 | 885 | /** |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | //se for right separa 2/3 para os dados e o terço seguinte para o logo |
929 | 929 | //se não houver logo centraliza dos dados do emitente |
930 | 930 | // coloca o logo |
931 | - if (! empty($this->logomarca)) { |
|
931 | + if (!empty($this->logomarca)) { |
|
932 | 932 | $logoInfo = getimagesize($this->logomarca); |
933 | 933 | //largura da imagem em mm |
934 | 934 | $logoWmm = ($logoInfo[0] / 72) * 25.4; |
@@ -984,7 +984,7 @@ discard block |
||
984 | 984 | //endereço |
985 | 985 | $y1 = $y1 + 5; |
986 | 986 | $aFont = ['font' => $this->fontePadrao, 'size' => 8, 'style' => '']; |
987 | - $fone = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
987 | + $fone = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
988 | 988 | ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue |
989 | 989 | : ''; |
990 | 990 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
@@ -1003,8 +1003,8 @@ discard block |
||
1003 | 1003 | |
1004 | 1004 | //#################################################################################### |
1005 | 1005 | //coluna central Danfe |
1006 | - $x += $w; |
|
1007 | - $w = round($maxW * 0.17, 0);//35; |
|
1006 | + $x += $w; |
|
1007 | + $w = round($maxW * 0.17, 0); //35; |
|
1008 | 1008 | $w2 = $w; |
1009 | 1009 | $h = 32; |
1010 | 1010 | $this->pdf->textBox($x, $y, $w, $h); |
@@ -1061,8 +1061,8 @@ discard block |
||
1061 | 1061 | |
1062 | 1062 | //#################################################################################### |
1063 | 1063 | //coluna codigo de barras |
1064 | - $x += $w; |
|
1065 | - $w = ($maxW - $w1 - $w2);//85; |
|
1064 | + $x += $w; |
|
1065 | + $w = ($maxW - $w1 - $w2); //85; |
|
1066 | 1066 | $w3 = $w; |
1067 | 1067 | $h = 32; |
1068 | 1068 | $this->pdf->textBox($x, $y, $w, $h); |
@@ -1092,7 +1092,7 @@ discard block |
||
1092 | 1092 | } else { |
1093 | 1093 | $cabecalhoProtoAutorizacao = 'PROTOCOLO DE AUTORIZAÇÃO DE USO'; |
1094 | 1094 | } |
1095 | - if (($this->tpEmis == 2 || $this->tpEmis == 5) && ! $this->notaDpec()) { |
|
1095 | + if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->notaDpec()) { |
|
1096 | 1096 | $cabecalhoProtoAutorizacao = "DADOS DA NF-E"; |
1097 | 1097 | $chaveContingencia = $this->geraChaveAdicionalDeContingencia(); |
1098 | 1098 | $this->pdf->setFillColor(0, 0, 0); |
@@ -1124,7 +1124,7 @@ discard block |
||
1124 | 1124 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1125 | 1125 | $w = $w1 + $w2; |
1126 | 1126 | $y = $oldY; |
1127 | - $oldY += $h; |
|
1127 | + $oldY += $h; |
|
1128 | 1128 | $x = $oldX; |
1129 | 1129 | $h = 7; |
1130 | 1130 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1141,7 +1141,7 @@ discard block |
||
1141 | 1141 | // NOTA : DANFE sem protocolo deve existir somente no caso de contingência !!! |
1142 | 1142 | // Além disso, existem várias NFes em contingência que eu recebo com protocolo de autorização. |
1143 | 1143 | // Na minha opinião, deveríamos mostra-lo, mas o manual da NFe v4.01 diz outra coisa... |
1144 | - if (($this->tpEmis == 2 || $this->tpEmis == 5) && ! $this->notaDpec()) { |
|
1144 | + if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->notaDpec()) { |
|
1145 | 1145 | $aFont = ['font' => $this->fontePadrao, 'size' => 8, 'style' => 'B']; |
1146 | 1146 | $texto = $this->formatField( |
1147 | 1147 | $chaveContingencia, |
@@ -1155,7 +1155,7 @@ discard block |
||
1155 | 1155 | $cStat = ''; |
1156 | 1156 | } else { |
1157 | 1157 | if (isset($this->nfeProc)) { |
1158 | - $texto = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) |
|
1158 | + $texto = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) |
|
1159 | 1159 | ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue |
1160 | 1160 | : ''; |
1161 | 1161 | $tsHora = $this->toTimestamp( |
@@ -1185,7 +1185,7 @@ discard block |
||
1185 | 1185 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1186 | 1186 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1187 | 1187 | //INSCRIÇÃO MUNICIPAL |
1188 | - $x += $w; |
|
1188 | + $x += $w; |
|
1189 | 1189 | $texto = 'INSCRIÇÃO MUNICIPAL'; |
1190 | 1190 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1191 | 1191 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1193,29 +1193,29 @@ discard block |
||
1193 | 1193 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1194 | 1194 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1195 | 1195 | //INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT. |
1196 | - $x += $w; |
|
1196 | + $x += $w; |
|
1197 | 1197 | $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.'; |
1198 | 1198 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1199 | 1199 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1200 | - $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
1200 | + $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
1201 | 1201 | ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue |
1202 | 1202 | : ''; |
1203 | 1203 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1204 | 1204 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1205 | 1205 | //CNPJ |
1206 | - $x += $w; |
|
1206 | + $x += $w; |
|
1207 | 1207 | $w = ($maxW - (3 * $w)); |
1208 | 1208 | $texto = 'CNPJ'; |
1209 | 1209 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1210 | 1210 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1211 | 1211 | //Pegando valor do CPF/CNPJ |
1212 | - if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1212 | + if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1213 | 1213 | $texto = $this->formatField( |
1214 | 1214 | $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
1215 | 1215 | "###.###.###/####-##" |
1216 | 1216 | ); |
1217 | 1217 | } else { |
1218 | - $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
1218 | + $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
1219 | 1219 | ? $this->formatField( |
1220 | 1220 | $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue, |
1221 | 1221 | "###.###.###-##" |
@@ -1234,12 +1234,12 @@ discard block |
||
1234 | 1234 | $n = count($resp['message']); |
1235 | 1235 | $alttot = $n * 15; |
1236 | 1236 | $x = 10; |
1237 | - $y = $this->hPrint/2 - $alttot/2; |
|
1237 | + $y = $this->hPrint / 2 - $alttot / 2; |
|
1238 | 1238 | $h = 15; |
1239 | 1239 | $w = $maxW - (2 * $x); |
1240 | 1240 | $this->pdf->settextcolor(90, 90, 90); |
1241 | 1241 | |
1242 | - foreach($resp['message'] as $msg) { |
|
1242 | + foreach ($resp['message'] as $msg) { |
|
1243 | 1243 | $aFont = ['font' => $this->fontePadrao, 'size' => 48, 'style' => 'B']; |
1244 | 1244 | $this->pdf->textBox($x, $y, $w, $h, $msg, $aFont, 'C', 'C', 0, ''); |
1245 | 1245 | $y += $h; |
@@ -1307,7 +1307,7 @@ discard block |
||
1307 | 1307 | //NOME / RAZÃO SOCIAL |
1308 | 1308 | $w = round($maxW * 0.61, 0); |
1309 | 1309 | $w1 = $w; |
1310 | - $y += 3; |
|
1310 | + $y += 3; |
|
1311 | 1311 | $texto = 'NOME / RAZÃO SOCIAL'; |
1312 | 1312 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1313 | 1313 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1319,20 +1319,20 @@ discard block |
||
1319 | 1319 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, ''); |
1320 | 1320 | } |
1321 | 1321 | //CNPJ / CPF |
1322 | - $x += $w; |
|
1322 | + $x += $w; |
|
1323 | 1323 | $w = round($maxW * 0.23, 0); |
1324 | 1324 | $w2 = $w; |
1325 | 1325 | $texto = 'CNPJ / CPF'; |
1326 | 1326 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1327 | 1327 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1328 | 1328 | //Pegando valor do CPF/CNPJ |
1329 | - if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1329 | + if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1330 | 1330 | $texto = $this->formatField( |
1331 | 1331 | $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
1332 | 1332 | "###.###.###/####-##" |
1333 | 1333 | ); |
1334 | 1334 | } else { |
1335 | - $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
1335 | + $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
1336 | 1336 | ? $this->formatField( |
1337 | 1337 | $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue, |
1338 | 1338 | "###.###.###-##" |
@@ -1342,17 +1342,17 @@ discard block |
||
1342 | 1342 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1343 | 1343 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1344 | 1344 | //DATA DA EMISSÃO |
1345 | - $x += $w; |
|
1345 | + $x += $w; |
|
1346 | 1346 | $w = $maxW - ($w1 + $w2); |
1347 | 1347 | $wx = $w; |
1348 | 1348 | $texto = 'DATA DA EMISSÃO'; |
1349 | 1349 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1350 | 1350 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1351 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) |
|
1351 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) |
|
1352 | 1352 | ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue |
1353 | 1353 | : ''; |
1354 | 1354 | if ($dEmi == '') { |
1355 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) |
|
1355 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) |
|
1356 | 1356 | ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue |
1357 | 1357 | : ''; |
1358 | 1358 | $aDemi = explode('T', $dEmi); |
@@ -1368,7 +1368,7 @@ discard block |
||
1368 | 1368 | //ENDEREÇO |
1369 | 1369 | $w = round($maxW * 0.47, 0); |
1370 | 1370 | $w1 = $w; |
1371 | - $y += $h; |
|
1371 | + $y += $h; |
|
1372 | 1372 | $x = $oldX; |
1373 | 1373 | $texto = 'ENDEREÇO'; |
1374 | 1374 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1380,7 +1380,7 @@ discard block |
||
1380 | 1380 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1381 | 1381 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
1382 | 1382 | //BAIRRO / DISTRITO |
1383 | - $x += $w; |
|
1383 | + $x += $w; |
|
1384 | 1384 | $w = round($maxW * 0.21, 0); |
1385 | 1385 | $w2 = $w; |
1386 | 1386 | $texto = 'BAIRRO / DISTRITO'; |
@@ -1390,29 +1390,29 @@ discard block |
||
1390 | 1390 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1391 | 1391 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1392 | 1392 | //CEP |
1393 | - $x += $w; |
|
1393 | + $x += $w; |
|
1394 | 1394 | $w = $maxW - $w1 - $w2 - $wx; |
1395 | 1395 | $w2 = $w; |
1396 | 1396 | $texto = 'CEP'; |
1397 | 1397 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1398 | 1398 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1399 | - $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) |
|
1399 | + $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) |
|
1400 | 1400 | ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue |
1401 | 1401 | : ''; |
1402 | 1402 | $texto = $this->formatField($texto, "#####-###"); |
1403 | 1403 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1404 | 1404 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1405 | 1405 | //DATA DA SAÍDA |
1406 | - $x += $w; |
|
1406 | + $x += $w; |
|
1407 | 1407 | $w = $wx; |
1408 | 1408 | $texto = 'DATA DA SAÍDA/ENTRADA'; |
1409 | 1409 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1410 | 1410 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1411 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) |
|
1411 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) |
|
1412 | 1412 | ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue |
1413 | 1413 | : ''; |
1414 | 1414 | if ($dSaiEnt == '') { |
1415 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
1415 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
1416 | 1416 | ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue |
1417 | 1417 | : ''; |
1418 | 1418 | $aDsaient = explode('T', $dSaiEnt); |
@@ -1423,7 +1423,7 @@ discard block |
||
1423 | 1423 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1424 | 1424 | //MUNICÍPIO |
1425 | 1425 | $w = $w1; |
1426 | - $y += $h; |
|
1426 | + $y += $h; |
|
1427 | 1427 | $x = $oldX; |
1428 | 1428 | $texto = 'MUNICÍPIO'; |
1429 | 1429 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1437,7 +1437,7 @@ discard block |
||
1437 | 1437 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1438 | 1438 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
1439 | 1439 | //UF |
1440 | - $x += $w; |
|
1440 | + $x += $w; |
|
1441 | 1441 | $w = 8; |
1442 | 1442 | $texto = 'UF'; |
1443 | 1443 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1446,19 +1446,19 @@ discard block |
||
1446 | 1446 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1447 | 1447 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1448 | 1448 | //FONE / FAX |
1449 | - $x += $w; |
|
1449 | + $x += $w; |
|
1450 | 1450 | $w = round(($maxW - $w1 - $wx - 8) / 2, 0); |
1451 | 1451 | $w3 = $w; |
1452 | 1452 | $texto = 'FONE / FAX'; |
1453 | 1453 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1454 | 1454 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1455 | - $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) |
|
1455 | + $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) |
|
1456 | 1456 | ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue |
1457 | 1457 | : ''; |
1458 | 1458 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1459 | 1459 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1460 | 1460 | //INSCRIÇÃO ESTADUAL |
1461 | - $x += $w; |
|
1461 | + $x += $w; |
|
1462 | 1462 | $w = $maxW - $w1 - $wx - 8 - $w3; |
1463 | 1463 | $texto = 'INSCRIÇÃO ESTADUAL'; |
1464 | 1464 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1468,16 +1468,16 @@ discard block |
||
1468 | 1468 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1469 | 1469 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1470 | 1470 | //HORA DA SAÍDA |
1471 | - $x += $w; |
|
1471 | + $x += $w; |
|
1472 | 1472 | $w = $wx; |
1473 | 1473 | $texto = 'HORA DA SAÍDA/ENTRADA'; |
1474 | 1474 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1475 | 1475 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1476 | - $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) |
|
1476 | + $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) |
|
1477 | 1477 | ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue |
1478 | 1478 | : ''; |
1479 | 1479 | if ($hSaiEnt == '') { |
1480 | - $dhSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
1480 | + $dhSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
1481 | 1481 | ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue |
1482 | 1482 | : ''; |
1483 | 1483 | $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt); |
@@ -1521,7 +1521,7 @@ discard block |
||
1521 | 1521 | //NOME / RAZÃO SOCIAL |
1522 | 1522 | $w = round($maxW * 0.61, 0); |
1523 | 1523 | $w1 = $w; |
1524 | - $y += 3; |
|
1524 | + $y += 3; |
|
1525 | 1525 | $texto = 'NOME / RAZÃO SOCIAL'; |
1526 | 1526 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1527 | 1527 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1536,20 +1536,20 @@ discard block |
||
1536 | 1536 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, ''); |
1537 | 1537 | } |
1538 | 1538 | //CNPJ / CPF |
1539 | - $x += $w; |
|
1539 | + $x += $w; |
|
1540 | 1540 | $w = round($maxW * 0.23, 0); |
1541 | 1541 | $w2 = $w; |
1542 | 1542 | $texto = 'CNPJ / CPF'; |
1543 | 1543 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1544 | 1544 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1545 | 1545 | //Pegando valor do CPF/CNPJ |
1546 | - if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1546 | + if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1547 | 1547 | $texto = $this->formatField( |
1548 | 1548 | $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
1549 | 1549 | "###.###.###/####-##" |
1550 | 1550 | ); |
1551 | 1551 | } else { |
1552 | - $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1552 | + $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1553 | 1553 | $this->formatField( |
1554 | 1554 | $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue, |
1555 | 1555 | "###.###.###-##" |
@@ -1558,7 +1558,7 @@ discard block |
||
1558 | 1558 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1559 | 1559 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1560 | 1560 | //INSCRIÇÃO ESTADUAL |
1561 | - $x += $w; |
|
1561 | + $x += $w; |
|
1562 | 1562 | $w = $maxW - ($w1 + $w2); |
1563 | 1563 | $wx = $w; |
1564 | 1564 | $texto = 'INSCRIÇÃO ESTADUAL'; |
@@ -1577,7 +1577,7 @@ discard block |
||
1577 | 1577 | //ENDEREÇO |
1578 | 1578 | $w = round($maxW * 0.355, 0) + $wx; |
1579 | 1579 | $w1 = $w; |
1580 | - $y += $h; |
|
1580 | + $y += $h; |
|
1581 | 1581 | $x = $oldX; |
1582 | 1582 | $texto = 'ENDEREÇO'; |
1583 | 1583 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1588,7 +1588,7 @@ discard block |
||
1588 | 1588 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1589 | 1589 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
1590 | 1590 | //BAIRRO / DISTRITO |
1591 | - $x += $w; |
|
1591 | + $x += $w; |
|
1592 | 1592 | $w = round($maxW * 0.335, 0); |
1593 | 1593 | $w2 = $w; |
1594 | 1594 | $texto = 'BAIRRO / DISTRITO'; |
@@ -1598,12 +1598,12 @@ discard block |
||
1598 | 1598 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1599 | 1599 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1600 | 1600 | //CEP |
1601 | - $x += $w; |
|
1601 | + $x += $w; |
|
1602 | 1602 | $w = $maxW - ($w1 + $w2); |
1603 | 1603 | $texto = 'CEP'; |
1604 | 1604 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1605 | 1605 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1606 | - $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
1606 | + $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
1607 | 1607 | $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
1608 | 1608 | $texto = $this->formatField($texto, "#####-###"); |
1609 | 1609 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
@@ -1611,7 +1611,7 @@ discard block |
||
1611 | 1611 | //MUNICÍPIO |
1612 | 1612 | $w = round($maxW * 0.805, 0); |
1613 | 1613 | $w1 = $w; |
1614 | - $y += $h; |
|
1614 | + $y += $h; |
|
1615 | 1615 | $x = $oldX; |
1616 | 1616 | $texto = 'MUNICÍPIO'; |
1617 | 1617 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1623,7 +1623,7 @@ discard block |
||
1623 | 1623 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1624 | 1624 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
1625 | 1625 | //UF |
1626 | - $x += $w; |
|
1626 | + $x += $w; |
|
1627 | 1627 | $w = 8; |
1628 | 1628 | $texto = 'UF'; |
1629 | 1629 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1632,12 +1632,12 @@ discard block |
||
1632 | 1632 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1633 | 1633 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1634 | 1634 | //FONE / FAX |
1635 | - $x += $w; |
|
1635 | + $x += $w; |
|
1636 | 1636 | $w = $maxW - $w - $w1; |
1637 | 1637 | $texto = 'FONE / FAX'; |
1638 | 1638 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1639 | 1639 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1640 | - $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
1640 | + $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
1641 | 1641 | $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
1642 | 1642 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1643 | 1643 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -1674,7 +1674,7 @@ discard block |
||
1674 | 1674 | //NOME / RAZÃO SOCIAL |
1675 | 1675 | $w = round($maxW * 0.61, 0); |
1676 | 1676 | $w1 = $w; |
1677 | - $y += 3; |
|
1677 | + $y += 3; |
|
1678 | 1678 | $texto = 'NOME / RAZÃO SOCIAL'; |
1679 | 1679 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1680 | 1680 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1689,20 +1689,20 @@ discard block |
||
1689 | 1689 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, ''); |
1690 | 1690 | } |
1691 | 1691 | //CNPJ / CPF |
1692 | - $x += $w; |
|
1692 | + $x += $w; |
|
1693 | 1693 | $w = round($maxW * 0.23, 0); |
1694 | 1694 | $w2 = $w; |
1695 | 1695 | $texto = 'CNPJ / CPF'; |
1696 | 1696 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1697 | 1697 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1698 | 1698 | //Pegando valor do CPF/CNPJ |
1699 | - if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1699 | + if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
1700 | 1700 | $texto = $this->formatField( |
1701 | 1701 | $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
1702 | 1702 | "###.###.###/####-##" |
1703 | 1703 | ); |
1704 | 1704 | } else { |
1705 | - $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1705 | + $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
1706 | 1706 | $this->formatField( |
1707 | 1707 | $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue, |
1708 | 1708 | "###.###.###-##" |
@@ -1711,7 +1711,7 @@ discard block |
||
1711 | 1711 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1712 | 1712 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1713 | 1713 | //INSCRIÇÃO ESTADUAL |
1714 | - $x += $w; |
|
1714 | + $x += $w; |
|
1715 | 1715 | $w = $maxW - ($w1 + $w2); |
1716 | 1716 | $wx = $w; |
1717 | 1717 | $texto = 'INSCRIÇÃO ESTADUAL'; |
@@ -1730,7 +1730,7 @@ discard block |
||
1730 | 1730 | //ENDEREÇO |
1731 | 1731 | $w = round($maxW * 0.355, 0) + $wx; |
1732 | 1732 | $w1 = $w; |
1733 | - $y += $h; |
|
1733 | + $y += $h; |
|
1734 | 1734 | $x = $oldX; |
1735 | 1735 | $texto = 'ENDEREÇO'; |
1736 | 1736 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1741,7 +1741,7 @@ discard block |
||
1741 | 1741 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1742 | 1742 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
1743 | 1743 | //BAIRRO / DISTRITO |
1744 | - $x += $w; |
|
1744 | + $x += $w; |
|
1745 | 1745 | $w = round($maxW * 0.335, 0); |
1746 | 1746 | $w2 = $w; |
1747 | 1747 | $texto = 'BAIRRO / DISTRITO'; |
@@ -1751,12 +1751,12 @@ discard block |
||
1751 | 1751 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1752 | 1752 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1753 | 1753 | //CEP |
1754 | - $x += $w; |
|
1754 | + $x += $w; |
|
1755 | 1755 | $w = $maxW - ($w1 + $w2); |
1756 | 1756 | $texto = 'CEP'; |
1757 | 1757 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1758 | 1758 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1759 | - $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
1759 | + $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
1760 | 1760 | $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
1761 | 1761 | $texto = $this->formatField($texto, "#####-###"); |
1762 | 1762 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
@@ -1764,7 +1764,7 @@ discard block |
||
1764 | 1764 | //MUNICÍPIO |
1765 | 1765 | $w = round($maxW * 0.805, 0); |
1766 | 1766 | $w1 = $w; |
1767 | - $y += $h; |
|
1767 | + $y += $h; |
|
1768 | 1768 | $x = $oldX; |
1769 | 1769 | $texto = 'MUNICÍPIO'; |
1770 | 1770 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1776,7 +1776,7 @@ discard block |
||
1776 | 1776 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1777 | 1777 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
1778 | 1778 | //UF |
1779 | - $x += $w; |
|
1779 | + $x += $w; |
|
1780 | 1780 | $w = 8; |
1781 | 1781 | $texto = 'UF'; |
1782 | 1782 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1785,12 +1785,12 @@ discard block |
||
1785 | 1785 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1786 | 1786 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
1787 | 1787 | //FONE / FAX |
1788 | - $x += $w; |
|
1788 | + $x += $w; |
|
1789 | 1789 | $w = $maxW - $w - $w1; |
1790 | 1790 | $texto = 'FONE / FAX'; |
1791 | 1791 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
1792 | 1792 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
1793 | - $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
1793 | + $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
1794 | 1794 | $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
1795 | 1795 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
1796 | 1796 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -1810,7 +1810,7 @@ discard block |
||
1810 | 1810 | if (isset($this->cobr)) { |
1811 | 1811 | $fat = $this->cobr->getElementsByTagName("fat")->item(0); |
1812 | 1812 | if (isset($fat)) { |
1813 | - if (! empty($this->getTagValue($this->ide, "indPag"))) { |
|
1813 | + if (!empty($this->getTagValue($this->ide, "indPag"))) { |
|
1814 | 1814 | $textoIndPag = ""; |
1815 | 1815 | $indPag = $this->getTagValue($this->ide, "indPag"); |
1816 | 1816 | if ($indPag === "0") { |
@@ -1885,7 +1885,7 @@ discard block |
||
1885 | 1885 | $h = 8; |
1886 | 1886 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B']; |
1887 | 1887 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
1888 | - $y += 3; |
|
1888 | + $y += 3; |
|
1889 | 1889 | $dups = ""; |
1890 | 1890 | $dupcont = 0; |
1891 | 1891 | $nFat = $this->dup->length; |
@@ -1919,13 +1919,13 @@ discard block |
||
1919 | 1919 | } |
1920 | 1920 | $increm = 1; |
1921 | 1921 | foreach ($this->dup as $k => $d) { |
1922 | - $nDup = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) |
|
1922 | + $nDup = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) |
|
1923 | 1923 | ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue |
1924 | 1924 | : ''; |
1925 | - $dDup = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
|
1925 | + $dDup = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
|
1926 | 1926 | ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
1927 | 1927 | : ''; |
1928 | - $vDup = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) |
|
1928 | + $vDup = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) |
|
1929 | 1929 | ? 'R$ ' . number_format( |
1930 | 1930 | $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue, |
1931 | 1931 | 2, |
@@ -1972,7 +1972,7 @@ discard block |
||
1972 | 1972 | } |
1973 | 1973 | if ($dupcont == 0) { |
1974 | 1974 | $y -= 9; |
1975 | - $linha --; |
|
1975 | + $linha--; |
|
1976 | 1976 | } |
1977 | 1977 | |
1978 | 1978 | return ($y + $h); |
@@ -2012,7 +2012,7 @@ discard block |
||
2012 | 2012 | $h = 8; |
2013 | 2013 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B']; |
2014 | 2014 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2015 | - $y += 3; |
|
2015 | + $y += 3; |
|
2016 | 2016 | $dups = ""; |
2017 | 2017 | $dupcont = 0; |
2018 | 2018 | if ($this->orientacao == 'P') { |
@@ -2041,7 +2041,7 @@ discard block |
||
2041 | 2041 | '90' => 'Sem pagamento', |
2042 | 2042 | '99' => 'Outros' |
2043 | 2043 | ]; |
2044 | - $bandeira = [ |
|
2044 | + $bandeira = [ |
|
2045 | 2045 | '01' => 'Visa', |
2046 | 2046 | '02' => 'Mastercard', |
2047 | 2047 | '03' => 'American', |
@@ -2054,10 +2054,10 @@ discard block |
||
2054 | 2054 | '99' => 'Outros' |
2055 | 2055 | ]; |
2056 | 2056 | foreach ($this->detPag as $k => $d) { |
2057 | - $fPag = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
|
2057 | + $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
|
2058 | 2058 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue |
2059 | 2059 | : '0'; |
2060 | - $vPag = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
2060 | + $vPag = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
2061 | 2061 | ? 'R$ ' . number_format( |
2062 | 2062 | $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue, |
2063 | 2063 | 2, |
@@ -2100,7 +2100,7 @@ discard block |
||
2100 | 2100 | } |
2101 | 2101 | if ($dupcont == 0) { |
2102 | 2102 | $y -= 9; |
2103 | - $linha --; |
|
2103 | + $linha--; |
|
2104 | 2104 | } |
2105 | 2105 | |
2106 | 2106 | return ($y + $h); |
@@ -2132,7 +2132,7 @@ discard block |
||
2132 | 2132 | $the_field = $this->ICMSTot->getElementsByTagName($campoImposto)->item(0); |
2133 | 2133 | if (isset($the_field)) { |
2134 | 2134 | $the_value = $the_field->nodeValue; |
2135 | - if (! empty($the_value)) { |
|
2135 | + if (!empty($the_value)) { |
|
2136 | 2136 | $valorImposto = number_format($the_value, 2, ",", "."); |
2137 | 2137 | } |
2138 | 2138 | } |
@@ -2161,10 +2161,10 @@ discard block |
||
2161 | 2161 | $x_inicial = $x; |
2162 | 2162 | //##################################################################### |
2163 | 2163 | $campos_por_linha = 9; |
2164 | - if (! $this->exibirPIS) { |
|
2165 | - $campos_por_linha --; |
|
2164 | + if (!$this->exibirPIS) { |
|
2165 | + $campos_por_linha--; |
|
2166 | 2166 | } |
2167 | - if (! $this->exibirIcmsInterestadual) { |
|
2167 | + if (!$this->exibirIcmsInterestadual) { |
|
2168 | 2168 | $campos_por_linha -= 2; |
2169 | 2169 | } |
2170 | 2170 | |
@@ -2251,12 +2251,12 @@ discard block |
||
2251 | 2251 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2252 | 2252 | //NOME / RAZÃO SOCIAL |
2253 | 2253 | $w1 = $maxW * 0.29; |
2254 | - $y += 3; |
|
2254 | + $y += 3; |
|
2255 | 2255 | $texto = 'NOME / RAZÃO SOCIAL'; |
2256 | 2256 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2257 | 2257 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2258 | 2258 | if (isset($this->transporta)) { |
2259 | - $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) |
|
2259 | + $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) |
|
2260 | 2260 | ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue |
2261 | 2261 | : ''; |
2262 | 2262 | } else { |
@@ -2265,12 +2265,12 @@ discard block |
||
2265 | 2265 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2266 | 2266 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
2267 | 2267 | //FRETE POR CONTA |
2268 | - $x += $w1; |
|
2268 | + $x += $w1; |
|
2269 | 2269 | $w2 = $maxW * 0.15; |
2270 | 2270 | $texto = 'FRETE'; |
2271 | 2271 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2272 | 2272 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2273 | - $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) |
|
2273 | + $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) |
|
2274 | 2274 | ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue |
2275 | 2275 | : '0'; |
2276 | 2276 | switch ($tipoFrete) { |
@@ -2296,12 +2296,12 @@ discard block |
||
2296 | 2296 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2297 | 2297 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 1, ''); |
2298 | 2298 | //CÓDIGO ANTT |
2299 | - $x += $w2; |
|
2299 | + $x += $w2; |
|
2300 | 2300 | $texto = 'CÓDIGO ANTT'; |
2301 | 2301 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2302 | 2302 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2303 | 2303 | if (isset($this->veicTransp)) { |
2304 | - $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) |
|
2304 | + $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) |
|
2305 | 2305 | ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue |
2306 | 2306 | : ''; |
2307 | 2307 | } else { |
@@ -2310,16 +2310,16 @@ discard block |
||
2310 | 2310 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2311 | 2311 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2312 | 2312 | //PLACA DO VEÍC |
2313 | - $x += $w2; |
|
2313 | + $x += $w2; |
|
2314 | 2314 | $texto = 'PLACA DO VEÍCULO'; |
2315 | 2315 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2316 | 2316 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2317 | 2317 | if (isset($this->veicTransp)) { |
2318 | - $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) |
|
2318 | + $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) |
|
2319 | 2319 | ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue |
2320 | 2320 | : ''; |
2321 | 2321 | } elseif (isset($this->reboque)) { |
2322 | - $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) |
|
2322 | + $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) |
|
2323 | 2323 | ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue |
2324 | 2324 | : ''; |
2325 | 2325 | } else { |
@@ -2328,17 +2328,17 @@ discard block |
||
2328 | 2328 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2329 | 2329 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2330 | 2330 | //UF |
2331 | - $x += $w2; |
|
2331 | + $x += $w2; |
|
2332 | 2332 | $w3 = round($maxW * 0.04, 0); |
2333 | 2333 | $texto = 'UF'; |
2334 | 2334 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2335 | 2335 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2336 | 2336 | if (isset($this->veicTransp)) { |
2337 | - $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2337 | + $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2338 | 2338 | ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue |
2339 | 2339 | : ''; |
2340 | 2340 | } elseif (isset($this->reboque)) { |
2341 | - $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2341 | + $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2342 | 2342 | ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue |
2343 | 2343 | : ''; |
2344 | 2344 | } else { |
@@ -2347,20 +2347,20 @@ discard block |
||
2347 | 2347 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2348 | 2348 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2349 | 2349 | //CNPJ / CPF |
2350 | - $x += $w3; |
|
2350 | + $x += $w3; |
|
2351 | 2351 | $w = $maxW - ($w1 + 3 * $w2 + $w3); |
2352 | 2352 | $texto = 'CNPJ / CPF'; |
2353 | 2353 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2354 | 2354 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2355 | 2355 | if (isset($this->transporta)) { |
2356 | - $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
|
2356 | + $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
|
2357 | 2357 | ? $this->formatField( |
2358 | 2358 | $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
2359 | 2359 | "##.###.###/####-##" |
2360 | 2360 | ) |
2361 | 2361 | : ''; |
2362 | 2362 | if ($texto == '') { |
2363 | - $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
2363 | + $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
2364 | 2364 | ? $this->formatField( |
2365 | 2365 | $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue, |
2366 | 2366 | "###.###.###-##" |
@@ -2374,7 +2374,7 @@ discard block |
||
2374 | 2374 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2375 | 2375 | //##################################################################### |
2376 | 2376 | //ENDEREÇO |
2377 | - $y += $h; |
|
2377 | + $y += $h; |
|
2378 | 2378 | $x = $oldX; |
2379 | 2379 | $h = 7; |
2380 | 2380 | $w1 = $maxW * 0.44; |
@@ -2382,7 +2382,7 @@ discard block |
||
2382 | 2382 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2383 | 2383 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2384 | 2384 | if (isset($this->transporta)) { |
2385 | - $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) |
|
2385 | + $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) |
|
2386 | 2386 | ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue |
2387 | 2387 | : ''; |
2388 | 2388 | } else { |
@@ -2391,13 +2391,13 @@ discard block |
||
2391 | 2391 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2392 | 2392 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
2393 | 2393 | //MUNICÍPIO |
2394 | - $x += $w1; |
|
2394 | + $x += $w1; |
|
2395 | 2395 | $w2 = round($maxW * 0.30, 0); |
2396 | 2396 | $texto = 'MUNICÍPIO'; |
2397 | 2397 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2398 | 2398 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2399 | 2399 | if (isset($this->transporta)) { |
2400 | - $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) |
|
2400 | + $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) |
|
2401 | 2401 | ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue |
2402 | 2402 | : ''; |
2403 | 2403 | } else { |
@@ -2406,13 +2406,13 @@ discard block |
||
2406 | 2406 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2407 | 2407 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2408 | 2408 | //UF |
2409 | - $x += $w2; |
|
2409 | + $x += $w2; |
|
2410 | 2410 | $w3 = round($maxW * 0.04, 0); |
2411 | 2411 | $texto = 'UF'; |
2412 | 2412 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2413 | 2413 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2414 | 2414 | if (isset($this->transporta)) { |
2415 | - $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2415 | + $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) |
|
2416 | 2416 | ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue |
2417 | 2417 | : ''; |
2418 | 2418 | } else { |
@@ -2421,14 +2421,14 @@ discard block |
||
2421 | 2421 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2422 | 2422 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2423 | 2423 | //INSCRIÇÃO ESTADUAL |
2424 | - $x += $w3; |
|
2424 | + $x += $w3; |
|
2425 | 2425 | $w = $maxW - ($w1 + $w2 + $w3); |
2426 | 2426 | $texto = 'INSCRIÇÃO ESTADUAL'; |
2427 | 2427 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2428 | 2428 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2429 | 2429 | $texto = ''; |
2430 | 2430 | if (isset($this->transporta)) { |
2431 | - if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
2431 | + if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
2432 | 2432 | $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue; |
2433 | 2433 | } |
2434 | 2434 | } |
@@ -2444,13 +2444,13 @@ discard block |
||
2444 | 2444 | $pesoBruto = 0; |
2445 | 2445 | $pesoLiquido = 0; |
2446 | 2446 | foreach ($volumes as $volume) { |
2447 | - $quantidade += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
2447 | + $quantidade += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
2448 | 2448 | $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0; |
2449 | - $pesoBruto += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
2449 | + $pesoBruto += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
2450 | 2450 | $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0; |
2451 | - $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
2451 | + $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
2452 | 2452 | $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0; |
2453 | - $texto = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
2453 | + $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
2454 | 2454 | $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : ''; |
2455 | 2455 | if ($texto != $especie && $especie != '') { |
2456 | 2456 | //tem várias especies |
@@ -2458,7 +2458,7 @@ discard block |
||
2458 | 2458 | } else { |
2459 | 2459 | $especie = $texto; |
2460 | 2460 | } |
2461 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) |
|
2461 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) |
|
2462 | 2462 | ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue |
2463 | 2463 | : ''; |
2464 | 2464 | if ($texto != $marca && $marca != '') { |
@@ -2467,7 +2467,7 @@ discard block |
||
2467 | 2467 | } else { |
2468 | 2468 | $marca = $texto; |
2469 | 2469 | } |
2470 | - $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) |
|
2470 | + $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) |
|
2471 | 2471 | ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue |
2472 | 2472 | : ''; |
2473 | 2473 | if ($texto != $numero && $numero != '') { |
@@ -2480,20 +2480,20 @@ discard block |
||
2480 | 2480 | |
2481 | 2481 | //##################################################################### |
2482 | 2482 | //QUANTIDADE |
2483 | - $y += $h; |
|
2483 | + $y += $h; |
|
2484 | 2484 | $x = $oldX; |
2485 | 2485 | $h = 7; |
2486 | 2486 | $w1 = round($maxW * 0.10, 0); |
2487 | 2487 | $texto = 'QUANTIDADE'; |
2488 | 2488 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2489 | 2489 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2490 | - if (! empty($quantidade)) { |
|
2490 | + if (!empty($quantidade)) { |
|
2491 | 2491 | $texto = $quantidade; |
2492 | 2492 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2493 | 2493 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2494 | 2494 | } |
2495 | 2495 | //ESPÉCIE |
2496 | - $x += $w1; |
|
2496 | + $x += $w1; |
|
2497 | 2497 | $w2 = round($maxW * 0.17, 0); |
2498 | 2498 | $texto = 'ESPÉCIE'; |
2499 | 2499 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -2502,16 +2502,16 @@ discard block |
||
2502 | 2502 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2503 | 2503 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2504 | 2504 | //MARCA |
2505 | - $x += $w2; |
|
2505 | + $x += $w2; |
|
2506 | 2506 | $texto = 'MARCA'; |
2507 | 2507 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2508 | 2508 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
2509 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
2509 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
2510 | 2510 | $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : ''; |
2511 | 2511 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2512 | 2512 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2513 | 2513 | //NUMERAÇÃO |
2514 | - $x += $w2; |
|
2514 | + $x += $w2; |
|
2515 | 2515 | $texto = 'NUMERAÇÃO'; |
2516 | 2516 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2517 | 2517 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2519,7 +2519,7 @@ discard block |
||
2519 | 2519 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2520 | 2520 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
2521 | 2521 | //PESO BRUTO |
2522 | - $x += $w2; |
|
2522 | + $x += $w2; |
|
2523 | 2523 | $w3 = round($maxW * 0.20, 0); |
2524 | 2524 | $texto = 'PESO BRUTO'; |
2525 | 2525 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -2532,7 +2532,7 @@ discard block |
||
2532 | 2532 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
2533 | 2533 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, ''); |
2534 | 2534 | //PESO LÍQUIDO |
2535 | - $x += $w3; |
|
2535 | + $x += $w3; |
|
2536 | 2536 | $w = $maxW - ($w1 + 3 * $w2 + $w3); |
2537 | 2537 | $texto = 'PESO LÍQUIDO'; |
2538 | 2538 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -2552,11 +2552,11 @@ discard block |
||
2552 | 2552 | protected function descricaoProdutoHelper($origem, $campo, $formato) |
2553 | 2553 | { |
2554 | 2554 | $valor_original = $origem->getElementsByTagName($campo)->item(0); |
2555 | - if (! isset($valor_original)) { |
|
2555 | + if (!isset($valor_original)) { |
|
2556 | 2556 | return ""; |
2557 | 2557 | } |
2558 | 2558 | $valor_original = $valor_original->nodeValue; |
2559 | - $valor = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
2559 | + $valor = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
2560 | 2560 | |
2561 | 2561 | if ($valor != "") { |
2562 | 2562 | return sprintf($formato, $valor); |
@@ -2582,7 +2582,7 @@ discard block |
||
2582 | 2582 | $ICMSUFDest = $itemProd->getElementsByTagName("ICMSUFDest")->item(0); |
2583 | 2583 | $impostos = ''; |
2584 | 2584 | |
2585 | - if (! empty($ICMS)) { |
|
2585 | + if (!empty($ICMS)) { |
|
2586 | 2586 | $impostos .= $this->descricaoProdutoHelper($ICMS, "vBCFCP", " BcFcp=%s"); |
2587 | 2587 | $impostos .= $this->descricaoProdutoHelper($ICMS, "pFCP", " pFcp=%s%%"); |
2588 | 2588 | $impostos .= $this->descricaoProdutoHelper($ICMS, "vFCP", " vFcp=%s"); |
@@ -2598,7 +2598,7 @@ discard block |
||
2598 | 2598 | $impostos .= $this->descricaoProdutoHelper($ICMS, "pST", " pSt=%s"); |
2599 | 2599 | $impostos .= $this->descricaoProdutoHelper($ICMS, "vICMSSTRet", " VALOR ICMS ST=%s"); |
2600 | 2600 | } |
2601 | - if (! empty($ICMSUFDest)) { |
|
2601 | + if (!empty($ICMSUFDest)) { |
|
2602 | 2602 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pFCPUFDest", " pFCPUFDest=%s%%"); |
2603 | 2603 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSUFDest", " pICMSUFDest=%s%%"); |
2604 | 2604 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSInterPart", " pICMSInterPart=%s%%"); |
@@ -2606,20 +2606,20 @@ discard block |
||
2606 | 2606 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s"); |
2607 | 2607 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s"); |
2608 | 2608 | } |
2609 | - $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
2609 | + $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
2610 | 2610 | ? substr( |
2611 | 2611 | $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue), |
2612 | 2612 | 0, |
2613 | 2613 | 500 |
2614 | 2614 | ) |
2615 | 2615 | : ''; |
2616 | - if (! empty($infAdProd)) { |
|
2616 | + if (!empty($infAdProd)) { |
|
2617 | 2617 | $infAdProd = trim($infAdProd); |
2618 | 2618 | $infAdProd .= ' '; |
2619 | 2619 | } |
2620 | 2620 | $loteTxt = ''; |
2621 | 2621 | $rastro = $prod->getElementsByTagName("med"); |
2622 | - if (! empty($prod->getElementsByTagName("rastro"))) { |
|
2622 | + if (!empty($prod->getElementsByTagName("rastro"))) { |
|
2623 | 2623 | $rastro = $prod->getElementsByTagName("rastro"); |
2624 | 2624 | $i = 0; |
2625 | 2625 | while ($i < $rastro->length) { |
@@ -2628,14 +2628,14 @@ discard block |
||
2628 | 2628 | $loteTxt .= $this->getTagDate($rastro->item($i), 'dFab', ' Fab: '); |
2629 | 2629 | $loteTxt .= $this->getTagDate($rastro->item($i), 'dVal', ' Val: '); |
2630 | 2630 | $loteTxt .= $this->getTagValue($rastro->item($i), 'vPMC', ' PMC: '); |
2631 | - $i ++; |
|
2631 | + $i++; |
|
2632 | 2632 | } |
2633 | 2633 | if ($loteTxt != '') { |
2634 | 2634 | $loteTxt .= ' '; |
2635 | 2635 | } |
2636 | 2636 | } |
2637 | 2637 | //NT2013.006 FCI |
2638 | - $nFCI = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
2638 | + $nFCI = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
2639 | 2639 | ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
2640 | 2640 | $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
2641 | 2641 | $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue |
@@ -2685,7 +2685,7 @@ discard block |
||
2685 | 2685 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
2686 | 2686 | $y += 3; |
2687 | 2687 | //desenha a caixa dos dados dos itens da NF |
2688 | - $hmax += 1; |
|
2688 | + $hmax += 1; |
|
2689 | 2689 | $texto = ''; |
2690 | 2690 | $this->pdf->textBox($x, $y, $w, $hmax); |
2691 | 2691 | //################################################################################## |
@@ -2698,101 +2698,101 @@ discard block |
||
2698 | 2698 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2699 | 2699 | $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax); |
2700 | 2700 | //DESCRIÇÃO DO PRODUTO / SERVIÇO |
2701 | - $x += $w1; |
|
2701 | + $x += $w1; |
|
2702 | 2702 | $w2 = round($w * 0.25, 0); |
2703 | 2703 | $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO'; |
2704 | 2704 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2705 | 2705 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2706 | 2706 | $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax); |
2707 | 2707 | //NCM/SH |
2708 | - $x += $w2; |
|
2708 | + $x += $w2; |
|
2709 | 2709 | $w3 = round($w * 0.06, 0); |
2710 | 2710 | $texto = 'NCM/SH'; |
2711 | 2711 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2712 | 2712 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2713 | 2713 | $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax); |
2714 | 2714 | //O/CST ou O/CSOSN |
2715 | - $x += $w3; |
|
2715 | + $x += $w3; |
|
2716 | 2716 | $w4 = round($w * 0.05, 0); |
2717 | - $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2 |
|
2717 | + $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 ou CRT = 2 |
|
2718 | 2718 | if ($this->getTagValue($this->emit, 'CRT') == '3') { |
2719 | - $texto = 'O/CST';//Regime Normal |
|
2719 | + $texto = 'O/CST'; //Regime Normal |
|
2720 | 2720 | } |
2721 | 2721 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2722 | 2722 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2723 | 2723 | $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax); |
2724 | 2724 | //CFOP |
2725 | - $x += $w4; |
|
2725 | + $x += $w4; |
|
2726 | 2726 | $w5 = round($w * 0.04, 0); |
2727 | 2727 | $texto = 'CFOP'; |
2728 | 2728 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2729 | 2729 | $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2730 | 2730 | $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax); |
2731 | 2731 | //UN |
2732 | - $x += $w5; |
|
2732 | + $x += $w5; |
|
2733 | 2733 | $w6 = round($w * 0.03, 0); |
2734 | 2734 | $texto = 'UN'; |
2735 | 2735 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2736 | 2736 | $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2737 | 2737 | $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax); |
2738 | 2738 | //QUANT |
2739 | - $x += $w6; |
|
2739 | + $x += $w6; |
|
2740 | 2740 | $w7 = round($w * 0.08, 0); |
2741 | 2741 | $texto = 'QUANT'; |
2742 | 2742 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2743 | 2743 | $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2744 | 2744 | $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax); |
2745 | 2745 | //VALOR UNIT |
2746 | - $x += $w7; |
|
2746 | + $x += $w7; |
|
2747 | 2747 | $w8 = round($w * 0.06, 0); |
2748 | 2748 | $texto = 'VALOR UNIT'; |
2749 | 2749 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2750 | 2750 | $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2751 | 2751 | $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax); |
2752 | 2752 | //VALOR TOTAL |
2753 | - $x += $w8; |
|
2753 | + $x += $w8; |
|
2754 | 2754 | $w9 = round($w * 0.06, 0); |
2755 | 2755 | $texto = 'VALOR TOTAL'; |
2756 | 2756 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2757 | 2757 | $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2758 | 2758 | $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax); |
2759 | 2759 | //VALOR DESCONTO |
2760 | - $x += $w9; |
|
2760 | + $x += $w9; |
|
2761 | 2761 | $w10 = round($w * 0.05, 0); |
2762 | 2762 | $texto = 'VALOR DESC'; |
2763 | 2763 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2764 | 2764 | $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2765 | 2765 | $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax); |
2766 | 2766 | //B.CÁLC ICMS |
2767 | - $x += $w10; |
|
2767 | + $x += $w10; |
|
2768 | 2768 | $w11 = round($w * 0.06, 0); |
2769 | 2769 | $texto = 'B.CÁLC ICMS'; |
2770 | 2770 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2771 | 2771 | $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2772 | 2772 | $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax); |
2773 | 2773 | //VALOR ICMS |
2774 | - $x += $w11; |
|
2774 | + $x += $w11; |
|
2775 | 2775 | $w12 = round($w * 0.06, 0); |
2776 | 2776 | $texto = 'VALOR ICMS'; |
2777 | 2777 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2778 | 2778 | $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2779 | 2779 | $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax); |
2780 | 2780 | //VALOR IPI |
2781 | - $x += $w12; |
|
2781 | + $x += $w12; |
|
2782 | 2782 | $w13 = round($w * 0.05, 0); |
2783 | 2783 | $texto = 'VALOR IPI'; |
2784 | 2784 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2785 | 2785 | $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2786 | 2786 | $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax); |
2787 | 2787 | //ALÍQ. ICMS |
2788 | - $x += $w13; |
|
2788 | + $x += $w13; |
|
2789 | 2789 | $w14 = round($w * 0.04, 0); |
2790 | 2790 | $texto = 'ALÍQ. ICMS'; |
2791 | 2791 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
2792 | 2792 | $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
2793 | 2793 | $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax); |
2794 | 2794 | //ALÍQ. IPI |
2795 | - $x += $w14; |
|
2795 | + $x += $w14; |
|
2796 | 2796 | $w15 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14); |
2797 | 2797 | $texto = 'ALÍQ. IPI'; |
2798 | 2798 | $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
@@ -2836,7 +2836,7 @@ discard block |
||
2836 | 2836 | // Informação sobre unidade de medida tributavel. |
2837 | 2837 | // Se não for para exibir a unidade de medida tributavel, então |
2838 | 2838 | // A Escrita irá começar em 0. |
2839 | - if (! $mostrarUnidadeTributavel) { |
|
2839 | + if (!$mostrarUnidadeTributavel) { |
|
2840 | 2840 | $yTrib = 0; |
2841 | 2841 | } |
2842 | 2842 | $h = $this->calculeHeight($thisItem, $mostrarUnidadeTributavel); |
@@ -2871,7 +2871,7 @@ discard block |
||
2871 | 2871 | } |
2872 | 2872 | $x += $w2; |
2873 | 2873 | //NCM |
2874 | - $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
2874 | + $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
2875 | 2875 | $prod->getElementsByTagName("NCM")->item(0)->nodeValue : ''; |
2876 | 2876 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, ''); |
2877 | 2877 | $x += $w3; |
@@ -2884,11 +2884,11 @@ discard block |
||
2884 | 2884 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, ''); |
2885 | 2885 | } |
2886 | 2886 | //CFOP |
2887 | - $x += $w4; |
|
2887 | + $x += $w4; |
|
2888 | 2888 | $texto = $prod->getElementsByTagName("CFOP")->item(0)->nodeValue; |
2889 | 2889 | $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'T', 'C', 0, ''); |
2890 | 2890 | //Unidade |
2891 | - $x += $w5; |
|
2891 | + $x += $w5; |
|
2892 | 2892 | $texto = $uCom; |
2893 | 2893 | $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'T', 'C', 0, ''); |
2894 | 2894 | //Unidade de medida tributável |
@@ -2909,7 +2909,7 @@ discard block |
||
2909 | 2909 | // QTDADE Tributável |
2910 | 2910 | if ($mostrarUnidadeTributavel) { |
2911 | 2911 | $qTrib = $prod->getElementsByTagName("qTrib")->item(0); |
2912 | - if (! empty($qTrib)) { |
|
2912 | + if (!empty($qTrib)) { |
|
2913 | 2913 | $texto = number_format($qTrib->nodeValue, $this->qComCasasDec, ",", "."); |
2914 | 2914 | $this->pdf->textBox($x, $yTrib, $w7, $h, $texto, $aFont, 'T', $alinhamento, 0, ''); |
2915 | 2915 | } |
@@ -2922,7 +2922,7 @@ discard block |
||
2922 | 2922 | // Valor Unitário Tributável |
2923 | 2923 | if ($mostrarUnidadeTributavel) { |
2924 | 2924 | $vUnTrib = $prod->getElementsByTagName("vUnTrib")->item(0); |
2925 | - if (! empty($vUnTrib)) { |
|
2925 | + if (!empty($vUnTrib)) { |
|
2926 | 2926 | $texto = number_format($vUnTrib->nodeValue, $this->vUnComCasasDec, ",", "."); |
2927 | 2927 | $this->pdf->textBox($x, $yTrib, $w8, $h, $texto, $aFont, 'T', $alinhamento, 0, ''); |
2928 | 2928 | } |
@@ -2936,7 +2936,7 @@ discard block |
||
2936 | 2936 | $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'T', $alinhamento, 0, ''); |
2937 | 2937 | $x += $w9; |
2938 | 2938 | //Valor do Desconto |
2939 | - $vdesc = ! empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue) |
|
2939 | + $vdesc = !empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue) |
|
2940 | 2940 | ? $prod->getElementsByTagName("vDesc")->item(0)->nodeValue : 0; |
2941 | 2941 | |
2942 | 2942 | $texto = number_format($vdesc, 2, ",", "."); |
@@ -2944,7 +2944,7 @@ discard block |
||
2944 | 2944 | //Valor da Base de calculo |
2945 | 2945 | $x += $w10; |
2946 | 2946 | if (isset($ICMS)) { |
2947 | - $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) |
|
2947 | + $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) |
|
2948 | 2948 | ? number_format( |
2949 | 2949 | $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue, |
2950 | 2950 | 2, |
@@ -2957,7 +2957,7 @@ discard block |
||
2957 | 2957 | //Valor do ICMS |
2958 | 2958 | $x += $w11; |
2959 | 2959 | if (isset($ICMS)) { |
2960 | - $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) |
|
2960 | + $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) |
|
2961 | 2961 | ? number_format( |
2962 | 2962 | $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue, |
2963 | 2963 | 2, |
@@ -2970,7 +2970,7 @@ discard block |
||
2970 | 2970 | //Valor do IPI |
2971 | 2971 | $x += $w12; |
2972 | 2972 | if (isset($IPI)) { |
2973 | - $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) |
|
2973 | + $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) |
|
2974 | 2974 | ? number_format( |
2975 | 2975 | $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, |
2976 | 2976 | 2, |
@@ -2985,7 +2985,7 @@ discard block |
||
2985 | 2985 | // %ICMS |
2986 | 2986 | $x += $w13; |
2987 | 2987 | if (isset($ICMS)) { |
2988 | - $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) |
|
2988 | + $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) |
|
2989 | 2989 | ? number_format( |
2990 | 2990 | $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue, |
2991 | 2991 | 2, |
@@ -2998,7 +2998,7 @@ discard block |
||
2998 | 2998 | //%IPI |
2999 | 2999 | $x += $w14; |
3000 | 3000 | if (isset($IPI)) { |
3001 | - $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) |
|
3001 | + $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) |
|
3002 | 3002 | ? number_format( |
3003 | 3003 | $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue, |
3004 | 3004 | 2, |
@@ -3016,17 +3016,17 @@ discard block |
||
3016 | 3016 | $veicProd = $prod->getElementsByTagName("veicProd")->item(0); |
3017 | 3017 | // Tag somente é gerada para veiculo 0k, e só é permitido um veiculo por NF-e por conta do detran |
3018 | 3018 | // Verifica se a Tag existe |
3019 | - if (! empty($veicProd)) { |
|
3019 | + if (!empty($veicProd)) { |
|
3020 | 3020 | $this->dadosItenVeiculoDANFE($oldX, $y, $nInicio, $h, $prod); |
3021 | 3021 | } |
3022 | 3022 | |
3023 | 3023 | |
3024 | 3024 | $y += $h; |
3025 | - $i ++; |
|
3025 | + $i++; |
|
3026 | 3026 | //incrementa o controle dos itens processados. |
3027 | - $this->qtdeItensProc ++; |
|
3027 | + $this->qtdeItensProc++; |
|
3028 | 3028 | } else { |
3029 | - $i ++; |
|
3029 | + $i++; |
|
3030 | 3030 | } |
3031 | 3031 | } |
3032 | 3032 | |
@@ -3231,23 +3231,23 @@ discard block |
||
3231 | 3231 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B']; |
3232 | 3232 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
3233 | 3233 | //INSCRIÇÃO MUNICIPAL |
3234 | - $y += 3; |
|
3234 | + $y += 3; |
|
3235 | 3235 | $w = round($this->wPrint * 0.23, 0); |
3236 | 3236 | $texto = 'INSCRIÇÃO MUNICIPAL'; |
3237 | 3237 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
3238 | 3238 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
3239 | 3239 | //inscrição municipal |
3240 | - $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
3240 | + $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
3241 | 3241 | $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : ''; |
3242 | 3242 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
3243 | 3243 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
3244 | 3244 | //VALOR TOTAL DOS SERVIÇOS |
3245 | - $x += $w; |
|
3245 | + $x += $w; |
|
3246 | 3246 | $texto = 'VALOR TOTAL DOS SERVIÇOS'; |
3247 | 3247 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
3248 | 3248 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
3249 | 3249 | if (isset($this->ISSQNtot)) { |
3250 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
3250 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
3251 | 3251 | $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : ''; |
3252 | 3252 | $texto = number_format($texto, 2, ",", "."); |
3253 | 3253 | } else { |
@@ -3256,14 +3256,14 @@ discard block |
||
3256 | 3256 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
3257 | 3257 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
3258 | 3258 | //BASE DE CÁLCULO DO ISSQN |
3259 | - $x += $w; |
|
3259 | + $x += $w; |
|
3260 | 3260 | $texto = 'BASE DE CÁLCULO DO ISSQN'; |
3261 | 3261 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
3262 | 3262 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
3263 | 3263 | if (isset($this->ISSQNtot)) { |
3264 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
3264 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
3265 | 3265 | $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : ''; |
3266 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
3266 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
3267 | 3267 | } else { |
3268 | 3268 | $texto = ''; |
3269 | 3269 | } |
@@ -3280,9 +3280,9 @@ discard block |
||
3280 | 3280 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
3281 | 3281 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
3282 | 3282 | if (isset($this->ISSQNtot)) { |
3283 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
3283 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
3284 | 3284 | $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : ''; |
3285 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
3285 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
3286 | 3286 | } else { |
3287 | 3287 | $texto = ''; |
3288 | 3288 | } |
@@ -3321,7 +3321,7 @@ discard block |
||
3321 | 3321 | |
3322 | 3322 | //INFORMAÇÕES COMPLEMENTARES |
3323 | 3323 | $texto = "INFORMAÇÕES COMPLEMENTARES"; |
3324 | - $y += 3; |
|
3324 | + $y += 3; |
|
3325 | 3325 | $w = $this->wAdic; |
3326 | 3326 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => 'B']; |
3327 | 3327 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3331,7 +3331,7 @@ discard block |
||
3331 | 3331 | //$this->textoAdic com o texto completo do campo |
3332 | 3332 | //echo str_replace("\n", "<br>",$this->textoAdic); |
3333 | 3333 | //die; |
3334 | - $y += 1; |
|
3334 | + $y += 1; |
|
3335 | 3335 | $aFont = ['font' => $this->fontePadrao, 'size' => $this->textadicfontsize * $this->pdf->k, 'style' => '']; |
3336 | 3336 | //$aFont = ['font'=>$this->fontePadrao, 'size'=> 5, 'style'=>'']; |
3337 | 3337 | $this->pdf->textBox($x, $y + 2, $w - 2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
@@ -3382,7 +3382,7 @@ discard block |
||
3382 | 3382 | $texto = 'CONTINGÊNCIA SVC-RS' . $dhCont . $xJust; |
3383 | 3383 | break; |
3384 | 3384 | } |
3385 | - $y += 2; |
|
3385 | + $y += 2; |
|
3386 | 3386 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => '']; |
3387 | 3387 | $this->pdf->textBox($x, $y, $w - 2, $h, $texto, $aFont, 'T', 'L', 0, '', false); |
3388 | 3388 | |
@@ -3437,7 +3437,7 @@ discard block |
||
3437 | 3437 | $tpNF = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue; |
3438 | 3438 | if ($tpNF == '0') { |
3439 | 3439 | //NFe de Entrada |
3440 | - $emitente = ''; |
|
3440 | + $emitente = ''; |
|
3441 | 3441 | $emitente .= $this->dest->getElementsByTagName("xNome")->item(0)->nodeValue . " - "; |
3442 | 3442 | $emitente .= $this->enderDest->getElementsByTagName("xLgr")->item(0)->nodeValue . ", "; |
3443 | 3443 | $emitente .= $this->enderDest->getElementsByTagName("nro")->item(0)->nodeValue . " - "; |
@@ -3490,10 +3490,10 @@ discard block |
||
3490 | 3490 | $texto .= "AO LADO"; |
3491 | 3491 | } |
3492 | 3492 | $texto .= ". EMISSÃO: "; |
3493 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3493 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3494 | 3494 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
3495 | 3495 | if ($dEmi == '') { |
3496 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3496 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3497 | 3497 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
3498 | 3498 | $aDemi = explode('T', $dEmi); |
3499 | 3499 | $dEmi = $aDemi[0]; |
@@ -3516,12 +3516,12 @@ discard block |
||
3516 | 3516 | $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, ''); |
3517 | 3517 | //DATA DE RECEBIMENTO |
3518 | 3518 | $texto = "DATA DE RECEBIMENTO"; |
3519 | - $y += $h; |
|
3519 | + $y += $h; |
|
3520 | 3520 | $w2 = round($this->wPrint * 0.17, 0); //35; |
3521 | 3521 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
3522 | 3522 | $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
3523 | 3523 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
3524 | - $x += $w2; |
|
3524 | + $x += $w2; |
|
3525 | 3525 | $w3 = $w - $w2; |
3526 | 3526 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
3527 | 3527 | $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3532,7 +3532,7 @@ discard block |
||
3532 | 3532 | |
3533 | 3533 | return $y; |
3534 | 3534 | } else { |
3535 | - $x --; |
|
3535 | + $x--; |
|
3536 | 3536 | $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
3537 | 3537 | //NUMERO DA NOTA FISCAL LOGO NFE |
3538 | 3538 | $w1 = 18; |
@@ -3553,7 +3553,7 @@ discard block |
||
3553 | 3553 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
3554 | 3554 | $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
3555 | 3555 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
3556 | - $y -= $w2; |
|
3556 | + $y -= $w2; |
|
3557 | 3557 | $w3 = $w - $w2; |
3558 | 3558 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
3559 | 3559 | $aFont = ['font' => $this->fontePadrao, 'size' => 5.7, 'style' => '']; |
@@ -3574,18 +3574,18 @@ discard block |
||
3574 | 3574 | */ |
3575 | 3575 | protected function geraInformacoesDaTagCompra() |
3576 | 3576 | { |
3577 | - if (! $this->gerarInformacoesAutomaticas) { |
|
3577 | + if (!$this->gerarInformacoesAutomaticas) { |
|
3578 | 3578 | return ''; |
3579 | 3579 | } |
3580 | 3580 | $saida = ""; |
3581 | 3581 | if (isset($this->compra)) { |
3582 | - if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
3582 | + if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
3583 | 3583 | $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue; |
3584 | 3584 | } |
3585 | - if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
3585 | + if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
3586 | 3586 | $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue; |
3587 | 3587 | } |
3588 | - if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
3588 | + if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
3589 | 3589 | $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue; |
3590 | 3590 | } |
3591 | 3591 | } |
@@ -3616,10 +3616,10 @@ discard block |
||
3616 | 3616 | if ($icmss > 0) { |
3617 | 3617 | $icmss = 1; |
3618 | 3618 | } |
3619 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3619 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
3620 | 3620 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
3621 | 3621 | if ($dEmi == '') { |
3622 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3622 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
3623 | 3623 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
3624 | 3624 | $aDemi = explode('T', $dEmi); |
3625 | 3625 | $dEmi = $aDemi[0]; |
@@ -3643,7 +3643,7 @@ discard block |
||
3643 | 3643 | */ |
3644 | 3644 | protected function geraInformacoesDasNotasReferenciadas() |
3645 | 3645 | { |
3646 | - if (! $this->gerarInformacoesAutomaticas) { |
|
3646 | + if (!$this->gerarInformacoesAutomaticas) { |
|
3647 | 3647 | return ''; |
3648 | 3648 | } |
3649 | 3649 | $formaNfeRef = "\r\nNFe Ref.: série:%d número:%d emit:%s em %s [%s]"; |
@@ -3671,7 +3671,7 @@ discard block |
||
3671 | 3671 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
3672 | 3672 | $serie = substr($chave_acesso, 22, 3); |
3673 | 3673 | $numero = substr($chave_acesso, 25, 9); |
3674 | - $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
3674 | + $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
3675 | 3675 | } |
3676 | 3676 | $refNF = $nfRef->getElementsByTagName('refNF'); |
3677 | 3677 | foreach ($refNF as $umaRefNFe) { |
@@ -3682,7 +3682,7 @@ discard block |
||
3682 | 3682 | $numero = $umaRefNFe->getElementsByTagName('nNF')->item(0)->nodeValue; |
3683 | 3683 | $data = substr($data, 2, 2) . "/20" . substr($data, 0, 2); |
3684 | 3684 | $cnpj = $this->formatField($cnpj, "##.###.###/####-##"); |
3685 | - $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod); |
|
3685 | + $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod); |
|
3686 | 3686 | } |
3687 | 3687 | $refCTe = $nfRef->getElementsByTagName('refCTe'); |
3688 | 3688 | foreach ($refCTe as $chave_acessoRef) { |
@@ -3692,7 +3692,7 @@ discard block |
||
3692 | 3692 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
3693 | 3693 | $serie = substr($chave_acesso, 22, 3); |
3694 | 3694 | $numero = substr($chave_acesso, 25, 9); |
3695 | - $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
3695 | + $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
3696 | 3696 | } |
3697 | 3697 | $refECF = $nfRef->getElementsByTagName('refECF'); |
3698 | 3698 | foreach ($refECF as $umaRefNFe) { |
@@ -3704,10 +3704,9 @@ discard block |
||
3704 | 3704 | $refNFP = $nfRef->getElementsByTagName('refNFP'); |
3705 | 3705 | foreach ($refNFP as $umaRefNFe) { |
3706 | 3706 | $data = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue; |
3707 | - $cnpj = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
3708 | - $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : |
|
3709 | - ''; |
|
3710 | - $cpf = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
3707 | + $cnpj = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
3708 | + $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : ''; |
|
3709 | + $cpf = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
3711 | 3710 | $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : ''; |
3712 | 3711 | $mod = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue; |
3713 | 3712 | $serie = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue; |
@@ -3729,7 +3728,7 @@ discard block |
||
3729 | 3728 | private function loadDoc($xml) |
3730 | 3729 | { |
3731 | 3730 | $this->xml = $xml; |
3732 | - if (! empty($xml)) { |
|
3731 | + if (!empty($xml)) { |
|
3733 | 3732 | $this->dom = new Dom(); |
3734 | 3733 | $this->dom->loadXML($this->xml); |
3735 | 3734 | if (empty($this->dom->getElementsByTagName("infNFe")->item(0))) { |
@@ -3783,7 +3782,7 @@ discard block |
||
3783 | 3782 | $numlinhas = $this->pdf->getNumLines($textoProduto, $w2, $aFont); |
3784 | 3783 | |
3785 | 3784 | if ($mostrarUnidadeTributavel && $numlinhas == 1) { |
3786 | - $numlinhas ++; |
|
3785 | + $numlinhas++; |
|
3787 | 3786 | } |
3788 | 3787 | |
3789 | 3788 | return round(($numlinhas * $this->pdf->fontSize) + ($numlinhas * 0.5), 2); |
@@ -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')) { |