@@ -94,9 +94,9 @@ discard block |
||
| 94 | 94 | * |
| 95 | 95 | * @param string $docXML |
| 96 | 96 | * @param string $sPathLogo |
| 97 | - * @param string $mododebug |
|
| 97 | + * @param integer $mododebug |
|
| 98 | 98 | * @param string $idToken |
| 99 | - * @param string $Token |
|
| 99 | + * @param string $emitToken |
|
| 100 | 100 | */ |
| 101 | 101 | public function __construct( |
| 102 | 102 | $docXML = '', |
@@ -1074,6 +1074,9 @@ discard block |
||
| 1074 | 1074 | return $texto; |
| 1075 | 1075 | } |
| 1076 | 1076 | |
| 1077 | + /** |
|
| 1078 | + * @param string $tBand |
|
| 1079 | + */ |
|
| 1077 | 1080 | protected static function getCardName($tBand) |
| 1078 | 1081 | { |
| 1079 | 1082 | switch ($tBand) { |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | protected $papel; |
| 27 | 27 | protected $xml; // string XML NFe |
| 28 | - protected $logomarca=''; // path para logomarca em jpg |
|
| 29 | - protected $formatoChave="#### #### #### #### #### #### #### #### #### #### ####"; |
|
| 30 | - protected $debugMode=0; //ativa ou desativa o modo de debug |
|
| 28 | + protected $logomarca = ''; // path para logomarca em jpg |
|
| 29 | + protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####"; |
|
| 30 | + protected $debugMode = 0; //ativa ou desativa o modo de debug |
|
| 31 | 31 | protected $tpImp; //ambiente |
| 32 | - protected $fontePadrao='Times'; |
|
| 32 | + protected $fontePadrao = 'Times'; |
|
| 33 | 33 | protected $nfeProc; |
| 34 | 34 | protected $nfe; |
| 35 | 35 | protected $infNFe; |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $this->textoAdic = ''; |
| 200 | 200 | if (isset($this->infAdic)) { |
| 201 | 201 | $this->textoAdic .= !empty($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue) ? |
| 202 | - 'Inf. Contribuinte: '. |
|
| 202 | + 'Inf. Contribuinte: ' . |
|
| 203 | 203 | trim($this->anfaveaDANFE($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue)) : ''; |
| 204 | 204 | if (!empty($this->textoAdic)) { |
| 205 | 205 | $this->textoAdic = str_replace(";", "\n", $this->textoAdic); |
@@ -248,10 +248,10 @@ discard block |
||
| 248 | 248 | //total inicial de paginas |
| 249 | 249 | $totPag = 1; |
| 250 | 250 | //largura imprimivel em mm: largura da folha menos as margens esq/direita |
| 251 | - $this->wPrint = $maxW-($margEsq*2); |
|
| 251 | + $this->wPrint = $maxW - ($margEsq * 2); |
|
| 252 | 252 | //comprimento (altura) imprimivel em mm: altura da folha menos as margens |
| 253 | 253 | //superior e inferior |
| 254 | - $this->hPrint = $maxH-$margSup-$margInf; |
|
| 254 | + $this->hPrint = $maxH - $margSup - $margInf; |
|
| 255 | 255 | // estabelece contagem de paginas |
| 256 | 256 | $this->pdf->aliasNbPages(); |
| 257 | 257 | $this->pdf->setMargins($margEsq, $margSup); // fixa as margens |
@@ -262,25 +262,25 @@ discard block |
||
| 262 | 262 | $this->pdf->setLineWidth(0.1); // define a largura da linha |
| 263 | 263 | $this->pdf->setTextColor(0, 0, 0); |
| 264 | 264 | $this->pdf->textBox(0, 0, $maxW, $maxH); // POR QUE PRECISO DESA LINHA? |
| 265 | - $hcabecalho = 27;//para cabeçalho (dados emitente mais logomarca) (FIXO) |
|
| 266 | - $hcabecalhoSecundario = 10;//para cabeçalho secundário (cabeçalho sefaz) (FIXO) |
|
| 267 | - $hprodutos = $hLinha + ($qtdItens*$hMaxLinha) ;//box poduto |
|
| 265 | + $hcabecalho = 27; //para cabeçalho (dados emitente mais logomarca) (FIXO) |
|
| 266 | + $hcabecalhoSecundario = 10; //para cabeçalho secundário (cabeçalho sefaz) (FIXO) |
|
| 267 | + $hprodutos = $hLinha + ($qtdItens * $hMaxLinha); //box poduto |
|
| 268 | 268 | $hTotal = 12; //box total (FIXO) |
| 269 | - $hpagamentos = $hLinha + ($qtdPgto*$hLinha);//para pagamentos |
|
| 269 | + $hpagamentos = $hLinha + ($qtdPgto * $hLinha); //para pagamentos |
|
| 270 | 270 | if (!empty($this->vTroco)) { |
| 271 | 271 | $hpagamentos += $hLinha; |
| 272 | 272 | } |
| 273 | - $hmsgfiscal = 21;// para imposto (FIXO) |
|
| 273 | + $hmsgfiscal = 21; // para imposto (FIXO) |
|
| 274 | 274 | if (!isset($this->dest)) { |
| 275 | - $hcliente = 6;// para cliente (FIXO) |
|
| 275 | + $hcliente = 6; // para cliente (FIXO) |
|
| 276 | 276 | } else { |
| 277 | 277 | $hcliente = 12; |
| 278 | 278 | }// para cliente (FIXO)}; |
| 279 | - $hQRCode = 50;// para qrcode (FIXO) |
|
| 280 | - $hCabecItens = 4;//cabeçalho dos itens |
|
| 279 | + $hQRCode = 50; // para qrcode (FIXO) |
|
| 280 | + $hCabecItens = 4; //cabeçalho dos itens |
|
| 281 | 281 | |
| 282 | 282 | $hUsado = $hCabecItens; |
| 283 | - $w2 = round($this->wPrint*0.31, 0); |
|
| 283 | + $w2 = round($this->wPrint * 0.31, 0); |
|
| 284 | 284 | $totPag = 1; |
| 285 | 285 | $pag = 1; |
| 286 | 286 | $x = $xInic; |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal; |
| 301 | 301 | $y = $this->pagamentosDANFE($x, $y, $hpagamentos); |
| 302 | 302 | //COLOCA MENSAGEM FISCAL |
| 303 | - $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal+ $hpagamentos; |
|
| 303 | + $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos; |
|
| 304 | 304 | $y = $this->fiscalDANFE($x, $y, $hmsgfiscal); |
| 305 | 305 | //COLOCA CONSUMIDOR |
| 306 | 306 | $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos + $hmsgfiscal; |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | //retorna o ID na NFe |
| 322 | - if ($classPdf!==false) { |
|
| 322 | + if ($classPdf !== false) { |
|
| 323 | 323 | $aR = [ |
| 324 | 324 | 'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")), |
| 325 | 325 | 'classe_PDF'=>$this->pdf |
@@ -339,14 +339,14 @@ discard block |
||
| 339 | 339 | $emitIM = $this->getTagValue($this->emit, "IM"); |
| 340 | 340 | $emitFone = $this->getTagValue($this->enderEmit, "fone"); |
| 341 | 341 | $foneLen = strlen($emitFone); |
| 342 | - if ($foneLen>0) { |
|
| 342 | + if ($foneLen > 0) { |
|
| 343 | 343 | $ddd = substr($emitFone, 0, 2); |
| 344 | 344 | $fone1 = substr($emitFone, -8); |
| 345 | 345 | $digito9 = ' '; |
| 346 | 346 | if ($foneLen == 11) { |
| 347 | 347 | $digito9 = substr($emitFone, 2, 1); |
| 348 | 348 | } |
| 349 | - $emitFone = ' - ('.$ddd.') '.$digito9. ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4); |
|
| 349 | + $emitFone = ' - (' . $ddd . ') ' . $digito9 . ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4); |
|
| 350 | 350 | } else { |
| 351 | 351 | $emitFone = ''; |
| 352 | 352 | } |
@@ -360,18 +360,18 @@ discard block |
||
| 360 | 360 | // CONFIGURAÇÃO DE POSIÇÃO |
| 361 | 361 | $margemInterna = $this->margemInterna; |
| 362 | 362 | $maxW = $this->wPrint; |
| 363 | - $h = $h-($margemInterna); |
|
| 363 | + $h = $h - ($margemInterna); |
|
| 364 | 364 | //COLOCA LOGOMARCA |
| 365 | 365 | if (is_file($this->logomarca)) { |
| 366 | 366 | $xImg = $margemInterna; |
| 367 | 367 | $yImg = $margemInterna + 1; |
| 368 | 368 | $this->pdf->image($this->logomarca, $xImg, $yImg, 30, 22.5); |
| 369 | - $xRs = ($maxW*0.4) + $margemInterna; |
|
| 370 | - $wRs = ($maxW*0.6); |
|
| 369 | + $xRs = ($maxW * 0.4) + $margemInterna; |
|
| 370 | + $wRs = ($maxW * 0.6); |
|
| 371 | 371 | $alignEmit = 'L'; |
| 372 | 372 | } else { |
| 373 | 373 | $xRs = $margemInterna; |
| 374 | - $wRs = ($maxW*1); |
|
| 374 | + $wRs = ($maxW * 1); |
|
| 375 | 375 | $alignEmit = 'L'; |
| 376 | 376 | } |
| 377 | 377 | //COLOCA RAZÃO SOCIAL |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | { |
| 392 | 392 | $margemInterna = $this->margemInterna; |
| 393 | 393 | $maxW = $this->wPrint; |
| 394 | - $w = ($maxW*1); |
|
| 394 | + $w = ($maxW * 1); |
|
| 395 | 395 | $hBox1 = 7; |
| 396 | 396 | $texto = "DANFE NFC-e\nDocumento Auxiliar da Nota Fiscal de Consumidor Eletrônica"; |
| 397 | 397 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
@@ -408,13 +408,13 @@ discard block |
||
| 408 | 408 | $margemInterna = $this->margemInterna; |
| 409 | 409 | $maxW = $this->wPrint; |
| 410 | 410 | $qtdItens = $this->det->length; |
| 411 | - $w = ($maxW*1); |
|
| 411 | + $w = ($maxW * 1); |
|
| 412 | 412 | $hLinha = $this->hLinha; |
| 413 | 413 | $aFontCabProdutos = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 414 | - $wBoxCod = $w*0.17; |
|
| 414 | + $wBoxCod = $w * 0.17; |
|
| 415 | 415 | $texto = "CÓDIGO"; |
| 416 | 416 | $this->pdf->textBox($x, $y, $wBoxCod, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 417 | - $wBoxDescricao = $w*0.43; |
|
| 417 | + $wBoxDescricao = $w * 0.43; |
|
| 418 | 418 | $xBoxDescricao = $wBoxCod + $x; |
| 419 | 419 | $texto = "DESCRICÃO"; |
| 420 | 420 | $this->pdf->textBox( |
@@ -430,19 +430,19 @@ discard block |
||
| 430 | 430 | '', |
| 431 | 431 | false |
| 432 | 432 | ); |
| 433 | - $wBoxQt = $w*0.08; |
|
| 433 | + $wBoxQt = $w * 0.08; |
|
| 434 | 434 | $xBoxQt = $wBoxDescricao + $xBoxDescricao; |
| 435 | 435 | $texto = "QT"; |
| 436 | 436 | $this->pdf->textBox($xBoxQt, $y, $wBoxQt, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 437 | - $wBoxUn = $w*0.06; |
|
| 437 | + $wBoxUn = $w * 0.06; |
|
| 438 | 438 | $xBoxUn = $wBoxQt + $xBoxQt; |
| 439 | 439 | $texto = "UN"; |
| 440 | 440 | $this->pdf->textBox($xBoxUn, $y, $wBoxUn, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 441 | - $wBoxVl = $w*0.13; |
|
| 441 | + $wBoxVl = $w * 0.13; |
|
| 442 | 442 | $xBoxVl = $wBoxUn + $xBoxUn; |
| 443 | 443 | $texto = "VALOR"; |
| 444 | 444 | $this->pdf->textBox($xBoxVl, $y, $wBoxVl, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 445 | - $wBoxTotal = $w*0.13; |
|
| 445 | + $wBoxTotal = $w * 0.13; |
|
| 446 | 446 | $xBoxTotal = $wBoxVl + $xBoxVl; |
| 447 | 447 | $texto = "TOTAL"; |
| 448 | 448 | $this->pdf->textBox($xBoxTotal, $y, $wBoxTotal, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
@@ -462,9 +462,9 @@ discard block |
||
| 462 | 462 | $vUnCom = number_format($this->getTagValue($prod, "vUnCom"), 2, ",", "."); |
| 463 | 463 | $vProd = number_format($this->getTagValue($prod, "vProd"), 2, ",", "."); |
| 464 | 464 | //COLOCA PRODUTO |
| 465 | - $yBoxProd = $y + $hLinha + ($cont*$hMaxLinha); |
|
| 465 | + $yBoxProd = $y + $hLinha + ($cont * $hMaxLinha); |
|
| 466 | 466 | //COLOCA PRODUTO CÓDIGO |
| 467 | - $wBoxCod = $w*0.17; |
|
| 467 | + $wBoxCod = $w * 0.17; |
|
| 468 | 468 | $texto = $cProd; |
| 469 | 469 | $this->pdf->textBox( |
| 470 | 470 | $x, |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | false |
| 481 | 481 | ); |
| 482 | 482 | //COLOCA PRODUTO DESCRIÇÃO |
| 483 | - $wBoxDescricao = $w*0.43; |
|
| 483 | + $wBoxDescricao = $w * 0.43; |
|
| 484 | 484 | $xBoxDescricao = $wBoxCod + $x; |
| 485 | 485 | $texto = $xProd; |
| 486 | 486 | $this->pdf->textBox( |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | false |
| 498 | 498 | ); |
| 499 | 499 | //COLOCA PRODUTO QUANTIDADE |
| 500 | - $wBoxQt = $w*0.08; |
|
| 500 | + $wBoxQt = $w * 0.08; |
|
| 501 | 501 | $xBoxQt = $wBoxDescricao + $xBoxDescricao; |
| 502 | 502 | $texto = $qCom; |
| 503 | 503 | $this->pdf->textBox( |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | false |
| 515 | 515 | ); |
| 516 | 516 | //COLOCA PRODUTO UNIDADE |
| 517 | - $wBoxUn = $w*0.06; |
|
| 517 | + $wBoxUn = $w * 0.06; |
|
| 518 | 518 | $xBoxUn = $wBoxQt + $xBoxQt; |
| 519 | 519 | $texto = $uCom; |
| 520 | 520 | $this->pdf->textBox( |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | false |
| 532 | 532 | ); |
| 533 | 533 | //COLOCA PRODUTO VL UNITÁRIO |
| 534 | - $wBoxVl = $w*0.13; |
|
| 534 | + $wBoxVl = $w * 0.13; |
|
| 535 | 535 | $xBoxVl = $wBoxUn + $xBoxUn; |
| 536 | 536 | $texto = $vUnCom; |
| 537 | 537 | $this->pdf->textBox( |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | false |
| 549 | 549 | ); |
| 550 | 550 | //COLOCA PRODUTO VL TOTAL |
| 551 | - $wBoxTotal = $w*0.13; |
|
| 551 | + $wBoxTotal = $w * 0.13; |
|
| 552 | 552 | $xBoxTotal = $wBoxVl + $xBoxVl; |
| 553 | 553 | $texto = $vProd; |
| 554 | 554 | $this->pdf->textBox( |
@@ -575,8 +575,8 @@ discard block |
||
| 575 | 575 | $margemInterna = $this->margemInterna; |
| 576 | 576 | $maxW = $this->wPrint; |
| 577 | 577 | $hLinha = 3; |
| 578 | - $wColEsq = ($maxW*0.7); |
|
| 579 | - $wColDir = ($maxW*0.3); |
|
| 578 | + $wColEsq = ($maxW * 0.7); |
|
| 579 | + $wColDir = ($maxW * 0.3); |
|
| 580 | 580 | $xValor = $x + $wColEsq; |
| 581 | 581 | $qtdItens = $this->det->length; |
| 582 | 582 | $vProd = $this->getTagValue($this->ICMSTot, "vProd"); |
@@ -597,28 +597,28 @@ discard block |
||
| 597 | 597 | $texto = "R$ " . number_format($vProd, 2, ",", "."); |
| 598 | 598 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 599 | 599 | $this->pdf->textBox($xValor, $yTotal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 600 | - $yDesconto = $y + ($hLinha*2); |
|
| 600 | + $yDesconto = $y + ($hLinha * 2); |
|
| 601 | 601 | $texto = "Descontos"; |
| 602 | 602 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 603 | 603 | $this->pdf->textBox($x, $yDesconto, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 604 | 604 | $texto = "R$ " . $vDesc; |
| 605 | 605 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 606 | 606 | $this->pdf->textBox($xValor, $yDesconto, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 607 | - $yFrete= $y + ($hLinha*3); |
|
| 607 | + $yFrete = $y + ($hLinha * 3); |
|
| 608 | 608 | $texto = "Frete"; |
| 609 | 609 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 610 | 610 | $this->pdf->textBox($x, $yFrete, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 611 | 611 | $texto = "R$ " . $vFrete; |
| 612 | 612 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 613 | 613 | $this->pdf->textBox($xValor, $yFrete, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 614 | - $yTotalFinal = $y + ($hLinha*4); |
|
| 614 | + $yTotalFinal = $y + ($hLinha * 4); |
|
| 615 | 615 | $texto = "Total"; |
| 616 | 616 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 617 | 617 | $this->pdf->textBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 618 | 618 | $texto = "R$ " . $vNF; |
| 619 | 619 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 620 | 620 | $this->pdf->textBox($xValor, $yTotalFinal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 621 | - $yTotalFinal = $y + ($hLinha*5); |
|
| 621 | + $yTotalFinal = $y + ($hLinha * 5); |
|
| 622 | 622 | $texto = "Informação dos Tributos Totais Incidentes"; |
| 623 | 623 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 624 | 624 | $this->pdf->textBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
@@ -633,16 +633,16 @@ discard block |
||
| 633 | 633 | $margemInterna = $this->margemInterna; |
| 634 | 634 | $maxW = $this->wPrint; |
| 635 | 635 | $qtdPgto = $this->pag->length; |
| 636 | - $w = ($maxW*1); |
|
| 636 | + $w = ($maxW * 1); |
|
| 637 | 637 | $hLinha = $this->hLinha; |
| 638 | - $wColEsq = ($maxW*0.7); |
|
| 639 | - $wColDir = ($maxW*0.3); |
|
| 638 | + $wColEsq = ($maxW * 0.7); |
|
| 639 | + $wColDir = ($maxW * 0.3); |
|
| 640 | 640 | $xValor = $x + $wColEsq; |
| 641 | 641 | $aFontPgto = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 642 | - $wBoxEsq = $w*0.7; |
|
| 642 | + $wBoxEsq = $w * 0.7; |
|
| 643 | 643 | $texto = "FORMA DE PAGAMENTO"; |
| 644 | 644 | $this->pdf->textBox($x, $y, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false); |
| 645 | - $wBoxDir = $w*0.3; |
|
| 645 | + $wBoxDir = $w * 0.3; |
|
| 646 | 646 | $xBoxDescricao = $x + $wBoxEsq; |
| 647 | 647 | $texto = "VALOR PAGO"; |
| 648 | 648 | $this->pdf->textBox($xBoxDescricao, $y, $wBoxDir, $hLinha, $texto, $aFontPgto, 'T', 'R', 0, '', false); |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | $tBandNome = self::getCardName($tBand); |
| 665 | 665 | } |
| 666 | 666 | //COLOCA PRODUTO |
| 667 | - $yBoxProd = $y + $hLinha + ($cont*$hLinha); |
|
| 667 | + $yBoxProd = $y + $hLinha + ($cont * $hLinha); |
|
| 668 | 668 | //COLOCA PRODUTO CÓDIGO |
| 669 | 669 | $texto = $tPagNome; |
| 670 | 670 | $this->pdf->textBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false); |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | if (!empty($this->vTroco)) { |
| 691 | - $yBoxProd = $y + $hLinha + ($cont*$hLinha); |
|
| 691 | + $yBoxProd = $y + $hLinha + ($cont * $hLinha); |
|
| 692 | 692 | //COLOCA PRODUTO CÓDIGO |
| 693 | 693 | $texto = 'Troco'; |
| 694 | 694 | $this->pdf->textBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false); |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | $y += 6; |
| 718 | 718 | $margemInterna = $this->margemInterna; |
| 719 | 719 | $maxW = $this->wPrint; |
| 720 | - $w = ($maxW*1); |
|
| 720 | + $w = ($maxW * 1); |
|
| 721 | 721 | $hLinha = $this->hLinha; |
| 722 | 722 | $aFontTit = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B']; |
| 723 | 723 | $aFontTex = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
@@ -749,19 +749,19 @@ discard block |
||
| 749 | 749 | $dhEmiLocalFormat = $dhEmilocal->format('d/m/Y H:i:s'); |
| 750 | 750 | $texto = "ÁREA DE MENSAGEM FISCAL"; |
| 751 | 751 | $this->pdf->textBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 752 | - $yTex1 = $y + ($hLinha*1); |
|
| 753 | - $hTex1 = $hLinha*2; |
|
| 754 | - $texto = "Número " . $nNF . " Série " . $serieNF . " " .$dhEmiLocalFormat . " - Via Consumidor"; |
|
| 752 | + $yTex1 = $y + ($hLinha * 1); |
|
| 753 | + $hTex1 = $hLinha * 2; |
|
| 754 | + $texto = "Número " . $nNF . " Série " . $serieNF . " " . $dhEmiLocalFormat . " - Via Consumidor"; |
|
| 755 | 755 | $this->pdf->textBox($x, $yTex1, $w, $hTex1, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 756 | - $yTex2 = $y + ($hLinha*3); |
|
| 757 | - $hTex2 = $hLinha*2; |
|
| 756 | + $yTex2 = $y + ($hLinha * 3); |
|
| 757 | + $hTex2 = $hLinha * 2; |
|
| 758 | 758 | |
| 759 | 759 | $texto = !empty($this->urlChave) ? "Consulte pela Chave de Acesso em " . $this->urlChave : ''; |
| 760 | 760 | $this->pdf->textBox($x, $yTex2, $w, $hTex2, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 761 | 761 | $texto = "CHAVE DE ACESSO"; |
| 762 | - $yTit2 = $y + ($hLinha*5); |
|
| 762 | + $yTit2 = $y + ($hLinha * 5); |
|
| 763 | 763 | $this->pdf->textBox($x, $yTit2, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 764 | - $yTex3 = $y + ($hLinha*6); |
|
| 764 | + $yTex3 = $y + ($hLinha * 6); |
|
| 765 | 765 | $texto = $chNFe; |
| 766 | 766 | $this->pdf->textBox($x, $yTex3, $w, $hLinha, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 767 | 767 | } |
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | $y += 6; |
| 772 | 772 | $margemInterna = $this->margemInterna; |
| 773 | 773 | $maxW = $this->wPrint; |
| 774 | - $w = ($maxW*1); |
|
| 774 | + $w = ($maxW * 1); |
|
| 775 | 775 | $hLinha = $this->hLinha; |
| 776 | 776 | $aFontTit = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B']; |
| 777 | 777 | $aFontTex = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
@@ -787,7 +787,7 @@ discard block |
||
| 787 | 787 | $consCNPJ = !empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
| 788 | 788 | ? $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue |
| 789 | 789 | : ''; |
| 790 | - $cDest = $consCPF.$consCNPJ.$considEstrangeiro; //documentos do consumidor |
|
| 790 | + $cDest = $consCPF . $consCNPJ . $considEstrangeiro; //documentos do consumidor |
|
| 791 | 791 | $enderDest = $this->dest->getElementsByTagName("enderDest")->item(0); |
| 792 | 792 | $consNome = $this->getTagValue($this->dest, "xNome"); |
| 793 | 793 | $consLgr = $this->getTagValue($enderDest, "xLgr"); |
@@ -827,8 +827,8 @@ discard block |
||
| 827 | 827 | $yTex1 = $y + $hLinha; |
| 828 | 828 | $texto = $consNome; |
| 829 | 829 | if (!empty($consDoc)) { |
| 830 | - $texto .= " - ". $consDoc . "\n" . $consEnd; |
|
| 831 | - $this->pdf->textBox($x, $yTex1, $w, $hLinha*3, $texto, $aFontTex, 'C', 'C', 0, '', false); |
|
| 830 | + $texto .= " - " . $consDoc . "\n" . $consEnd; |
|
| 831 | + $this->pdf->textBox($x, $yTex1, $w, $hLinha * 3, $texto, $aFontTex, 'C', 'C', 0, '', false); |
|
| 832 | 832 | } |
| 833 | 833 | } else { |
| 834 | 834 | $yTex1 = $y + $hLinha; |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | $y += 6; |
| 843 | 843 | $margemInterna = $this->margemInterna; |
| 844 | 844 | $maxW = $this->wPrint; |
| 845 | - $w = ($maxW*1)+4; |
|
| 845 | + $w = ($maxW * 1) + 4; |
|
| 846 | 846 | $hLinha = $this->hLinha; |
| 847 | 847 | $hBoxLinha = $this->hBoxLinha; |
| 848 | 848 | $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
@@ -851,7 +851,7 @@ discard block |
||
| 851 | 851 | $nProt = ''; |
| 852 | 852 | if (isset($this->nfeProc)) { |
| 853 | 853 | $nProt = $this->getTagValue($this->nfeProc, "nProt"); |
| 854 | - $dhRecbto = $this->getTagValue($this->nfeProc, "dhRecbto"); |
|
| 854 | + $dhRecbto = $this->getTagValue($this->nfeProc, "dhRecbto"); |
|
| 855 | 855 | } |
| 856 | 856 | $barcode = new Barcode(); |
| 857 | 857 | $bobj = $barcode->getBarcodeObj( |
@@ -865,15 +865,15 @@ discard block |
||
| 865 | 865 | $qrcode = $bobj->getPngData(); |
| 866 | 866 | $wQr = 50; |
| 867 | 867 | $hQr = 50; |
| 868 | - $yQr = ($y+$margemInterna); |
|
| 869 | - $xQr = ($w/2) - ($wQr/2); |
|
| 868 | + $yQr = ($y + $margemInterna); |
|
| 869 | + $xQr = ($w / 2) - ($wQr / 2); |
|
| 870 | 870 | // prepare a base64 encoded "data url" |
| 871 | 871 | $pic = 'data://text/plain;base64,' . base64_encode($qrcode); |
| 872 | 872 | $info = getimagesize($pic); |
| 873 | 873 | $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG'); |
| 874 | 874 | $dt = new DateTime($dhRecbto); |
| 875 | - $yQr = ($yQr+$hQr+$margemInterna); |
|
| 876 | - $this->pdf->textBox($x, $yQr, $w-4, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n" |
|
| 875 | + $yQr = ($yQr + $hQr + $margemInterna); |
|
| 876 | + $this->pdf->textBox($x, $yQr, $w - 4, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n" |
|
| 877 | 877 | . $dt->format('d/m/Y H:i:s'), $aFontTex, 'C', 'C', 0, '', false); |
| 878 | 878 | } |
| 879 | 879 | |
@@ -891,7 +891,7 @@ discard block |
||
| 891 | 891 | $heigthText = $this->pdf->textBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 892 | 892 | |
| 893 | 893 | // seta o textbox do texto adicional |
| 894 | - $this->pdf->textBox($x, $y+3, $w-2, $hLinha-3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false); |
|
| 894 | + $this->pdf->textBox($x, $y + 3, $w - 2, $hLinha - 3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false); |
|
| 895 | 895 | } |
| 896 | 896 | |
| 897 | 897 | /** |
@@ -951,7 +951,7 @@ discard block |
||
| 951 | 951 | if ($startPos === false) { |
| 952 | 952 | return $cdata; |
| 953 | 953 | } |
| 954 | - for ($x=$len; $x>0; $x--) { |
|
| 954 | + for ($x = $len; $x > 0; $x--) { |
|
| 955 | 955 | if (substr($cdata, $x, 1) == '>') { |
| 956 | 956 | $endPos = $x; |
| 957 | 957 | break; |
@@ -962,15 +962,15 @@ discard block |
||
| 962 | 962 | } else { |
| 963 | 963 | $parte1 = ''; |
| 964 | 964 | } |
| 965 | - $parte2 = substr($cdata, $startPos, $endPos-$startPos+1); |
|
| 965 | + $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1); |
|
| 966 | 966 | if ($endPos < $len) { |
| 967 | 967 | $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1); |
| 968 | 968 | } else { |
| 969 | 969 | $parte3 = ''; |
| 970 | 970 | } |
| 971 | - $texto = trim($parte1).' '.trim($parte3); |
|
| 971 | + $texto = trim($parte1) . ' ' . trim($parte3); |
|
| 972 | 972 | if (strpos($parte2, '<CDATA>') === false) { |
| 973 | - $cdata = '<CDATA>'.$parte2.'</CDATA>'; |
|
| 973 | + $cdata = '<CDATA>' . $parte2 . '</CDATA>'; |
|
| 974 | 974 | } else { |
| 975 | 975 | $cdata = $parte2; |
| 976 | 976 | } |
@@ -1042,15 +1042,15 @@ discard block |
||
| 1042 | 1042 | //grupo CADATA infCpl |
| 1043 | 1043 | $t = $dom->getElementsByTagName('transmissor')->item(0); |
| 1044 | 1044 | $r = $dom->getElementsByTagName('receptor')->item(0); |
| 1045 | - $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 1046 | - 'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : ''; |
|
| 1047 | - $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 1048 | - 'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : ''; |
|
| 1049 | - $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 1050 | - 'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : ''; |
|
| 1051 | - $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 1052 | - 'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : ''; |
|
| 1053 | - $texto .= "".$versao.$especieNF.$fabEntrega.$dca; |
|
| 1045 | + $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 1046 | + 'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : ''; |
|
| 1047 | + $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 1048 | + 'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : ''; |
|
| 1049 | + $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 1050 | + 'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : ''; |
|
| 1051 | + $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 1052 | + 'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : ''; |
|
| 1053 | + $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
| 1054 | 1054 | if (isset($t)) { |
| 1055 | 1055 | if ($t->hasAttributes()) { |
| 1056 | 1056 | $texto .= " Transmissor "; |