@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | protected $papel; |
| 27 | 27 | protected $paperwidth = 80; |
| 28 | 28 | protected $xml; // string XML NFe |
| 29 | - protected $logomarca=''; // path para logomarca em jpg |
|
| 30 | - protected $formatoChave="#### #### #### #### #### #### #### #### #### #### ####"; |
|
| 29 | + protected $logomarca = ''; // path para logomarca em jpg |
|
| 30 | + protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####"; |
|
| 31 | 31 | protected $nfeProc; |
| 32 | 32 | protected $nfe; |
| 33 | 33 | protected $infNFe; |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | if (isset($this->infAdic)) { |
| 170 | 170 | //$this->textoAdic .= !empty($this->textoAdic) ? "\n" : ''; |
| 171 | 171 | $this->textoAdic .= !empty($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue) ? |
| 172 | - 'Inf. Contribuinte: '. |
|
| 172 | + 'Inf. Contribuinte: ' . |
|
| 173 | 173 | trim($this->anfaveaDANFE($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue)) : ''; |
| 174 | 174 | } |
| 175 | 175 | if (!empty($this->textoAdic)) { |
@@ -209,10 +209,10 @@ discard block |
||
| 209 | 209 | //total inicial de paginas |
| 210 | 210 | $totPag = 1; |
| 211 | 211 | //largura imprimivel em mm: largura da folha menos as margens esq/direita |
| 212 | - $this->wPrint = $maxW-($margEsq*2); |
|
| 212 | + $this->wPrint = $maxW - ($margEsq * 2); |
|
| 213 | 213 | //comprimento (altura) imprimivel em mm: altura da folha menos as margens |
| 214 | 214 | //superior e inferior |
| 215 | - $this->hPrint = $maxH-$margSup-$margInf; |
|
| 215 | + $this->hPrint = $maxH - $margSup - $margInf; |
|
| 216 | 216 | // estabelece contagem de paginas |
| 217 | 217 | $this->pdf->aliasNbPages(); |
| 218 | 218 | $this->pdf->setMargins($margEsq, $margSup); // fixa as margens |
@@ -223,11 +223,11 @@ discard block |
||
| 223 | 223 | $this->pdf->setLineWidth(0.1); // define a largura da linha |
| 224 | 224 | $this->pdf->setTextColor(0, 0, 0); |
| 225 | 225 | $this->pdf->textBox(0, 0, $maxW, $maxH); // POR QUE PRECISO DESA LINHA? |
| 226 | - $hcabecalho = 27;//para cabeçalho (dados emitente mais logomarca) (FIXO) |
|
| 227 | - $hcabecalhoSecundario = 10 + 3;//para cabeçalho secundário (cabeçalho sefaz) (FIXO) |
|
| 228 | - $hprodutos = $hLinha + ($qtdItens * $hMaxLinha) ;//box poduto |
|
| 226 | + $hcabecalho = 27; //para cabeçalho (dados emitente mais logomarca) (FIXO) |
|
| 227 | + $hcabecalhoSecundario = 10 + 3; //para cabeçalho secundário (cabeçalho sefaz) (FIXO) |
|
| 228 | + $hprodutos = $hLinha + ($qtdItens * $hMaxLinha); //box poduto |
|
| 229 | 229 | $hTotal = 12; //box total (FIXO) |
| 230 | - $hpagamentos = $hLinha + ($qtdPgto * $hLinha) + 3;//para pagamentos |
|
| 230 | + $hpagamentos = $hLinha + ($qtdPgto * $hLinha) + 3; //para pagamentos |
|
| 231 | 231 | if (!empty($this->vTroco)) { |
| 232 | 232 | $hpagamentos += $hLinha; |
| 233 | 233 | } |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal; |
| 261 | 261 | $y = $this->pagamentosDANFE($x, $y, $hpagamentos); |
| 262 | 262 | //COLOCA MENSAGEM FISCAL |
| 263 | - $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal+ $hpagamentos; |
|
| 263 | + $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos; |
|
| 264 | 264 | $y = $this->fiscalDANFE($x, $y, $hmsgfiscal); |
| 265 | 265 | //COLOCA CONSUMIDOR |
| 266 | 266 | $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos + $hmsgfiscal; |
@@ -288,14 +288,14 @@ discard block |
||
| 288 | 288 | $emitIM = $this->getTagValue($this->emit, "IM"); |
| 289 | 289 | $emitFone = $this->getTagValue($this->enderEmit, "fone"); |
| 290 | 290 | $foneLen = strlen($emitFone); |
| 291 | - if ($foneLen>0) { |
|
| 291 | + if ($foneLen > 0) { |
|
| 292 | 292 | $ddd = substr($emitFone, 0, 2); |
| 293 | 293 | $fone1 = substr($emitFone, -8); |
| 294 | 294 | $digito9 = ' '; |
| 295 | 295 | if ($foneLen == 11) { |
| 296 | 296 | $digito9 = substr($emitFone, 2, 1); |
| 297 | 297 | } |
| 298 | - $emitFone = ' - ('.$ddd.') '.$digito9. ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4); |
|
| 298 | + $emitFone = ' - (' . $ddd . ') ' . $digito9 . ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4); |
|
| 299 | 299 | } else { |
| 300 | 300 | $emitFone = ''; |
| 301 | 301 | } |
@@ -309,24 +309,24 @@ discard block |
||
| 309 | 309 | // CONFIGURAÇÃO DE POSIÇÃO |
| 310 | 310 | $margemInterna = $this->margemInterna; |
| 311 | 311 | $maxW = $this->wPrint; |
| 312 | - $h = $h-($margemInterna); |
|
| 312 | + $h = $h - ($margemInterna); |
|
| 313 | 313 | //COLOCA LOGOMARCA |
| 314 | 314 | if (!empty($this->logomarca)) { |
| 315 | 315 | $xImg = $margemInterna; |
| 316 | 316 | $yImg = $margemInterna + 1; |
| 317 | 317 | $logoInfo = getimagesize($this->logomarca); |
| 318 | - $logoWmm = ($logoInfo[0]/72)*25.4; |
|
| 319 | - $logoHmm = ($logoInfo[1]/72)*25.4; |
|
| 318 | + $logoWmm = ($logoInfo[0] / 72) * 25.4; |
|
| 319 | + $logoHmm = ($logoInfo[1] / 72) * 25.4; |
|
| 320 | 320 | $nImgW = 30; |
| 321 | - $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
|
| 322 | - $yImg = $margemInterna + $nImgH/2; |
|
| 321 | + $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
|
| 322 | + $yImg = $margemInterna + $nImgH / 2; |
|
| 323 | 323 | $this->pdf->image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, 'jpeg'); |
| 324 | - $xRs = ($maxW*0.4) + $margemInterna; |
|
| 325 | - $wRs = ($maxW*0.6); |
|
| 324 | + $xRs = ($maxW * 0.4) + $margemInterna; |
|
| 325 | + $wRs = ($maxW * 0.6); |
|
| 326 | 326 | $alignEmit = 'L'; |
| 327 | 327 | } else { |
| 328 | 328 | $xRs = $margemInterna; |
| 329 | - $wRs = ($maxW*1); |
|
| 329 | + $wRs = ($maxW * 1); |
|
| 330 | 330 | $alignEmit = 'L'; |
| 331 | 331 | } |
| 332 | 332 | //COLOCA RAZÃO SOCIAL |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | { |
| 347 | 347 | $margemInterna = $this->margemInterna; |
| 348 | 348 | $maxW = $this->wPrint; |
| 349 | - $w = ($maxW*1); |
|
| 349 | + $w = ($maxW * 1); |
|
| 350 | 350 | $hBox1 = 7; |
| 351 | 351 | $texto = "DANFE NFC-e\nDocumento Auxiliar da Nota Fiscal de Consumidor Eletrônica"; |
| 352 | 352 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
@@ -363,13 +363,13 @@ discard block |
||
| 363 | 363 | $margemInterna = $this->margemInterna; |
| 364 | 364 | $maxW = $this->wPrint; |
| 365 | 365 | $qtdItens = $this->det->length; |
| 366 | - $w = ($maxW*1); |
|
| 366 | + $w = ($maxW * 1); |
|
| 367 | 367 | $hLinha = $this->hLinha; |
| 368 | 368 | $aFontCabProdutos = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 369 | - $wBoxCod = $w*0.17; |
|
| 369 | + $wBoxCod = $w * 0.17; |
|
| 370 | 370 | $texto = "CÓDIGO"; |
| 371 | 371 | $this->pdf->textBox($x, $y, $wBoxCod, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 372 | - $wBoxDescricao = $w*0.43; |
|
| 372 | + $wBoxDescricao = $w * 0.43; |
|
| 373 | 373 | $xBoxDescricao = $wBoxCod + $x; |
| 374 | 374 | $texto = "DESCRICÃO"; |
| 375 | 375 | $this->pdf->textBox( |
@@ -385,19 +385,19 @@ discard block |
||
| 385 | 385 | '', |
| 386 | 386 | false |
| 387 | 387 | ); |
| 388 | - $wBoxQt = $w*0.08; |
|
| 388 | + $wBoxQt = $w * 0.08; |
|
| 389 | 389 | $xBoxQt = $wBoxDescricao + $xBoxDescricao; |
| 390 | 390 | $texto = "QT"; |
| 391 | 391 | $this->pdf->textBox($xBoxQt, $y, $wBoxQt, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 392 | - $wBoxUn = $w*0.06; |
|
| 392 | + $wBoxUn = $w * 0.06; |
|
| 393 | 393 | $xBoxUn = $wBoxQt + $xBoxQt; |
| 394 | 394 | $texto = "UN"; |
| 395 | 395 | $this->pdf->textBox($xBoxUn, $y, $wBoxUn, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 396 | - $wBoxVl = $w*0.13; |
|
| 396 | + $wBoxVl = $w * 0.13; |
|
| 397 | 397 | $xBoxVl = $wBoxUn + $xBoxUn; |
| 398 | 398 | $texto = "VALOR"; |
| 399 | 399 | $this->pdf->textBox($xBoxVl, $y, $wBoxVl, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 400 | - $wBoxTotal = $w*0.13; |
|
| 400 | + $wBoxTotal = $w * 0.13; |
|
| 401 | 401 | $xBoxTotal = $wBoxVl + $xBoxVl; |
| 402 | 402 | $texto = "TOTAL"; |
| 403 | 403 | $this->pdf->textBox($xBoxTotal, $y, $wBoxTotal, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
@@ -417,9 +417,9 @@ discard block |
||
| 417 | 417 | $vUnCom = number_format($this->getTagValue($prod, "vUnCom"), 2, ",", "."); |
| 418 | 418 | $vProd = number_format($this->getTagValue($prod, "vProd"), 2, ",", "."); |
| 419 | 419 | //COLOCA PRODUTO |
| 420 | - $yBoxProd = $y + $hLinha + ($cont*$hMaxLinha); |
|
| 420 | + $yBoxProd = $y + $hLinha + ($cont * $hMaxLinha); |
|
| 421 | 421 | //COLOCA PRODUTO CÓDIGO |
| 422 | - $wBoxCod = $w*0.17; |
|
| 422 | + $wBoxCod = $w * 0.17; |
|
| 423 | 423 | $texto = $cProd; |
| 424 | 424 | $this->pdf->textBox( |
| 425 | 425 | $x, |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | false |
| 436 | 436 | ); |
| 437 | 437 | //COLOCA PRODUTO DESCRIÇÃO |
| 438 | - $wBoxDescricao = $w*0.43; |
|
| 438 | + $wBoxDescricao = $w * 0.43; |
|
| 439 | 439 | $xBoxDescricao = $wBoxCod + $x; |
| 440 | 440 | $texto = $xProd; |
| 441 | 441 | $this->pdf->textBox( |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | false |
| 453 | 453 | ); |
| 454 | 454 | //COLOCA PRODUTO QUANTIDADE |
| 455 | - $wBoxQt = $w*0.08; |
|
| 455 | + $wBoxQt = $w * 0.08; |
|
| 456 | 456 | $xBoxQt = $wBoxDescricao + $xBoxDescricao; |
| 457 | 457 | $texto = $qCom; |
| 458 | 458 | $this->pdf->textBox( |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | false |
| 470 | 470 | ); |
| 471 | 471 | //COLOCA PRODUTO UNIDADE |
| 472 | - $wBoxUn = $w*0.06; |
|
| 472 | + $wBoxUn = $w * 0.06; |
|
| 473 | 473 | $xBoxUn = $wBoxQt + $xBoxQt; |
| 474 | 474 | $texto = $uCom; |
| 475 | 475 | $this->pdf->textBox( |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | false |
| 487 | 487 | ); |
| 488 | 488 | //COLOCA PRODUTO VL UNITÁRIO |
| 489 | - $wBoxVl = $w*0.13; |
|
| 489 | + $wBoxVl = $w * 0.13; |
|
| 490 | 490 | $xBoxVl = $wBoxUn + $xBoxUn; |
| 491 | 491 | $texto = $vUnCom; |
| 492 | 492 | $this->pdf->textBox( |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | false |
| 504 | 504 | ); |
| 505 | 505 | //COLOCA PRODUTO VL TOTAL |
| 506 | - $wBoxTotal = $w*0.13; |
|
| 506 | + $wBoxTotal = $w * 0.13; |
|
| 507 | 507 | $xBoxTotal = $wBoxVl + $xBoxVl; |
| 508 | 508 | $texto = $vProd; |
| 509 | 509 | $this->pdf->textBox( |
@@ -530,8 +530,8 @@ discard block |
||
| 530 | 530 | $margemInterna = $this->margemInterna; |
| 531 | 531 | $maxW = $this->wPrint; |
| 532 | 532 | $hLinha = 3; |
| 533 | - $wColEsq = ($maxW*0.7); |
|
| 534 | - $wColDir = ($maxW*0.3); |
|
| 533 | + $wColEsq = ($maxW * 0.7); |
|
| 534 | + $wColDir = ($maxW * 0.3); |
|
| 535 | 535 | $xValor = $x + $wColEsq; |
| 536 | 536 | $qtdItens = $this->det->length; |
| 537 | 537 | $vProd = $this->getTagValue($this->ICMSTot, "vProd"); |
@@ -552,28 +552,28 @@ discard block |
||
| 552 | 552 | $texto = "R$ " . number_format($vProd, 2, ",", "."); |
| 553 | 553 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 554 | 554 | $this->pdf->textBox($xValor, $yTotal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 555 | - $yDesconto = $y + ($hLinha*2); |
|
| 555 | + $yDesconto = $y + ($hLinha * 2); |
|
| 556 | 556 | $texto = "Descontos"; |
| 557 | 557 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 558 | 558 | $this->pdf->textBox($x, $yDesconto, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 559 | 559 | $texto = "R$ " . $vDesc; |
| 560 | 560 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 561 | 561 | $this->pdf->textBox($xValor, $yDesconto, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 562 | - $yFrete= $y + ($hLinha*3); |
|
| 562 | + $yFrete = $y + ($hLinha * 3); |
|
| 563 | 563 | $texto = "Frete"; |
| 564 | 564 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 565 | 565 | $this->pdf->textBox($x, $yFrete, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 566 | 566 | $texto = "R$ " . $vFrete; |
| 567 | 567 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 568 | 568 | $this->pdf->textBox($xValor, $yFrete, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 569 | - $yTotalFinal = $y + ($hLinha*4); |
|
| 569 | + $yTotalFinal = $y + ($hLinha * 4); |
|
| 570 | 570 | $texto = "Total"; |
| 571 | 571 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 572 | 572 | $this->pdf->textBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 573 | 573 | $texto = "R$ " . $vNF; |
| 574 | 574 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 575 | 575 | $this->pdf->textBox($xValor, $yTotalFinal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 576 | - $yTotalFinal = $y + ($hLinha*5); |
|
| 576 | + $yTotalFinal = $y + ($hLinha * 5); |
|
| 577 | 577 | $texto = "Informação dos Tributos Totais Incidentes"; |
| 578 | 578 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 579 | 579 | $this->pdf->textBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
@@ -588,16 +588,16 @@ discard block |
||
| 588 | 588 | $margemInterna = $this->margemInterna; |
| 589 | 589 | $maxW = $this->wPrint; |
| 590 | 590 | $qtdPgto = $this->pag->length; |
| 591 | - $w = ($maxW*1); |
|
| 591 | + $w = ($maxW * 1); |
|
| 592 | 592 | $hLinha = $this->hLinha; |
| 593 | - $wColEsq = ($maxW*0.7); |
|
| 594 | - $wColDir = ($maxW*0.3); |
|
| 593 | + $wColEsq = ($maxW * 0.7); |
|
| 594 | + $wColDir = ($maxW * 0.3); |
|
| 595 | 595 | $xValor = $x + $wColEsq; |
| 596 | 596 | $aFontPgto = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 597 | - $wBoxEsq = $w*0.7; |
|
| 597 | + $wBoxEsq = $w * 0.7; |
|
| 598 | 598 | $texto = "FORMA DE PAGAMENTO"; |
| 599 | 599 | $this->pdf->textBox($x, $y, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false); |
| 600 | - $wBoxDir = $w*0.3; |
|
| 600 | + $wBoxDir = $w * 0.3; |
|
| 601 | 601 | $xBoxDescricao = $x + $wBoxEsq; |
| 602 | 602 | $texto = "VALOR PAGO"; |
| 603 | 603 | $this->pdf->textBox($xBoxDescricao, $y, $wBoxDir, $hLinha, $texto, $aFontPgto, 'T', 'R', 0, '', false); |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | $tBandNome = self::getCardName($tBand); |
| 620 | 620 | } |
| 621 | 621 | //COLOCA PRODUTO |
| 622 | - $yBoxProd = $y + $hLinha + ($cont*$hLinha); |
|
| 622 | + $yBoxProd = $y + $hLinha + ($cont * $hLinha); |
|
| 623 | 623 | //COLOCA PRODUTO CÓDIGO |
| 624 | 624 | $texto = $tPagNome; |
| 625 | 625 | $this->pdf->textBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false); |
@@ -643,7 +643,7 @@ discard block |
||
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | if (!empty($this->vTroco)) { |
| 646 | - $yBoxProd = $y + $hLinha + ($cont*$hLinha); |
|
| 646 | + $yBoxProd = $y + $hLinha + ($cont * $hLinha); |
|
| 647 | 647 | //COLOCA PRODUTO CÓDIGO |
| 648 | 648 | $texto = 'Troco'; |
| 649 | 649 | $this->pdf->textBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false); |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | $y += 6; |
| 673 | 673 | $margemInterna = $this->margemInterna; |
| 674 | 674 | $maxW = $this->wPrint; |
| 675 | - $w = ($maxW*1); |
|
| 675 | + $w = ($maxW * 1); |
|
| 676 | 676 | $hLinha = $this->hLinha; |
| 677 | 677 | $aFontTit = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B']; |
| 678 | 678 | $aFontTex = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
@@ -704,19 +704,19 @@ discard block |
||
| 704 | 704 | $dhEmiLocalFormat = $dhEmilocal->format('d/m/Y H:i:s'); |
| 705 | 705 | $texto = "ÁREA DE MENSAGEM FISCAL"; |
| 706 | 706 | $this->pdf->textBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 707 | - $yTex1 = $y + ($hLinha*1); |
|
| 708 | - $hTex1 = $hLinha*2; |
|
| 709 | - $texto = "Número " . $nNF . " Série " . $serieNF . " " .$dhEmiLocalFormat . " - Via Consumidor"; |
|
| 707 | + $yTex1 = $y + ($hLinha * 1); |
|
| 708 | + $hTex1 = $hLinha * 2; |
|
| 709 | + $texto = "Número " . $nNF . " Série " . $serieNF . " " . $dhEmiLocalFormat . " - Via Consumidor"; |
|
| 710 | 710 | $this->pdf->textBox($x, $yTex1, $w, $hTex1, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 711 | - $yTex2 = $y + ($hLinha*3); |
|
| 712 | - $hTex2 = $hLinha*2; |
|
| 711 | + $yTex2 = $y + ($hLinha * 3); |
|
| 712 | + $hTex2 = $hLinha * 2; |
|
| 713 | 713 | |
| 714 | 714 | $texto = !empty($this->urlChave) ? "Consulte pela Chave de Acesso em " . $this->urlChave : ''; |
| 715 | 715 | $this->pdf->textBox($x, $yTex2, $w, $hTex2, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 716 | 716 | $texto = "CHAVE DE ACESSO"; |
| 717 | - $yTit2 = $y + ($hLinha*5); |
|
| 717 | + $yTit2 = $y + ($hLinha * 5); |
|
| 718 | 718 | $this->pdf->textBox($x, $yTit2, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 719 | - $yTex3 = $y + ($hLinha*6); |
|
| 719 | + $yTex3 = $y + ($hLinha * 6); |
|
| 720 | 720 | $texto = $chNFe; |
| 721 | 721 | $this->pdf->textBox($x, $yTex3, $w, $hLinha, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 722 | 722 | } |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | $y += 6; |
| 727 | 727 | $margemInterna = $this->margemInterna; |
| 728 | 728 | $maxW = $this->wPrint; |
| 729 | - $w = ($maxW*1); |
|
| 729 | + $w = ($maxW * 1); |
|
| 730 | 730 | $hLinha = $this->hLinha; |
| 731 | 731 | $aFontTit = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B']; |
| 732 | 732 | $aFontTex = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | $consCNPJ = !empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
| 743 | 743 | ? $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue |
| 744 | 744 | : ''; |
| 745 | - $cDest = $consCPF.$consCNPJ.$considEstrangeiro; //documentos do consumidor |
|
| 745 | + $cDest = $consCPF . $consCNPJ . $considEstrangeiro; //documentos do consumidor |
|
| 746 | 746 | $enderDest = $this->dest->getElementsByTagName("enderDest")->item(0); |
| 747 | 747 | $consNome = $this->getTagValue($this->dest, "xNome"); |
| 748 | 748 | $consLgr = $this->getTagValue($enderDest, "xLgr"); |
@@ -782,8 +782,8 @@ discard block |
||
| 782 | 782 | $yTex1 = $y + $hLinha; |
| 783 | 783 | $texto = $consNome; |
| 784 | 784 | if (!empty($consDoc)) { |
| 785 | - $texto .= " - ". $consDoc . "\n" . $consEnd; |
|
| 786 | - $this->pdf->textBox($x, $yTex1, $w, $hLinha*3, $texto, $aFontTex, 'C', 'C', 0, '', false); |
|
| 785 | + $texto .= " - " . $consDoc . "\n" . $consEnd; |
|
| 786 | + $this->pdf->textBox($x, $yTex1, $w, $hLinha * 3, $texto, $aFontTex, 'C', 'C', 0, '', false); |
|
| 787 | 787 | } |
| 788 | 788 | } else { |
| 789 | 789 | $yTex1 = $y + $hLinha; |
@@ -797,7 +797,7 @@ discard block |
||
| 797 | 797 | $y += 6; |
| 798 | 798 | $margemInterna = $this->margemInterna; |
| 799 | 799 | $maxW = $this->wPrint; |
| 800 | - $w = ($maxW*1)+4; |
|
| 800 | + $w = ($maxW * 1) + 4; |
|
| 801 | 801 | $hLinha = $this->hLinha; |
| 802 | 802 | $hBoxLinha = $this->hBoxLinha; |
| 803 | 803 | $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | $nProt = ''; |
| 807 | 807 | if (isset($this->nfeProc)) { |
| 808 | 808 | $nProt = $this->getTagValue($this->nfeProc, "nProt"); |
| 809 | - $dhRecbto = $this->getTagValue($this->nfeProc, "dhRecbto"); |
|
| 809 | + $dhRecbto = $this->getTagValue($this->nfeProc, "dhRecbto"); |
|
| 810 | 810 | } |
| 811 | 811 | $barcode = new Barcode(); |
| 812 | 812 | $bobj = $barcode->getBarcodeObj( |
@@ -820,15 +820,15 @@ discard block |
||
| 820 | 820 | $qrcode = $bobj->getPngData(); |
| 821 | 821 | $wQr = 50; |
| 822 | 822 | $hQr = 50; |
| 823 | - $yQr = ($y+$margemInterna); |
|
| 824 | - $xQr = ($w/2) - ($wQr/2); |
|
| 823 | + $yQr = ($y + $margemInterna); |
|
| 824 | + $xQr = ($w / 2) - ($wQr / 2); |
|
| 825 | 825 | // prepare a base64 encoded "data url" |
| 826 | 826 | $pic = 'data://text/plain;base64,' . base64_encode($qrcode); |
| 827 | 827 | $info = getimagesize($pic); |
| 828 | 828 | $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG'); |
| 829 | 829 | $dt = new DateTime($dhRecbto); |
| 830 | - $yQr = ($yQr+$hQr+$margemInterna); |
|
| 831 | - $this->pdf->textBox($x, $yQr, $w-4, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n" |
|
| 830 | + $yQr = ($yQr + $hQr + $margemInterna); |
|
| 831 | + $this->pdf->textBox($x, $yQr, $w - 4, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n" |
|
| 832 | 832 | . $dt->format('d/m/Y H:i:s'), $aFontTex, 'C', 'C', 0, '', false); |
| 833 | 833 | } |
| 834 | 834 | |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | $heigthText = $this->pdf->textBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 855 | 855 | } |
| 856 | 856 | // seta o textbox do texto adicional |
| 857 | - $this->pdf->textBox($x, $y+3, $w-2, $hLinha-3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false); |
|
| 857 | + $this->pdf->textBox($x, $y + 3, $w - 2, $hLinha - 3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false); |
|
| 858 | 858 | } |
| 859 | 859 | |
| 860 | 860 | /** |
@@ -880,7 +880,7 @@ discard block |
||
| 880 | 880 | if ($startPos === false) { |
| 881 | 881 | return $cdata; |
| 882 | 882 | } |
| 883 | - for ($x=$len; $x>0; $x--) { |
|
| 883 | + for ($x = $len; $x > 0; $x--) { |
|
| 884 | 884 | if (substr($cdata, $x, 1) == '>') { |
| 885 | 885 | $endPos = $x; |
| 886 | 886 | break; |
@@ -891,15 +891,15 @@ discard block |
||
| 891 | 891 | } else { |
| 892 | 892 | $parte1 = ''; |
| 893 | 893 | } |
| 894 | - $parte2 = substr($cdata, $startPos, $endPos-$startPos+1); |
|
| 894 | + $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1); |
|
| 895 | 895 | if ($endPos < $len) { |
| 896 | 896 | $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1); |
| 897 | 897 | } else { |
| 898 | 898 | $parte3 = ''; |
| 899 | 899 | } |
| 900 | - $texto = trim($parte1).' '.trim($parte3); |
|
| 900 | + $texto = trim($parte1) . ' ' . trim($parte3); |
|
| 901 | 901 | if (strpos($parte2, '<CDATA>') === false) { |
| 902 | - $cdata = '<CDATA>'.$parte2.'</CDATA>'; |
|
| 902 | + $cdata = '<CDATA>' . $parte2 . '</CDATA>'; |
|
| 903 | 903 | } else { |
| 904 | 904 | $cdata = $parte2; |
| 905 | 905 | } |
@@ -971,15 +971,15 @@ discard block |
||
| 971 | 971 | //grupo CADATA infCpl |
| 972 | 972 | $t = $dom->getElementsByTagName('transmissor')->item(0); |
| 973 | 973 | $r = $dom->getElementsByTagName('receptor')->item(0); |
| 974 | - $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 975 | - 'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : ''; |
|
| 976 | - $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 977 | - 'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : ''; |
|
| 978 | - $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 979 | - 'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : ''; |
|
| 980 | - $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 981 | - 'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : ''; |
|
| 982 | - $texto .= "".$versao.$especieNF.$fabEntrega.$dca; |
|
| 974 | + $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 975 | + 'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : ''; |
|
| 976 | + $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 977 | + 'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : ''; |
|
| 978 | + $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 979 | + 'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : ''; |
|
| 980 | + $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 981 | + 'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : ''; |
|
| 982 | + $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
| 983 | 983 | if (isset($t)) { |
| 984 | 984 | if ($t->hasAttributes()) { |
| 985 | 985 | $texto .= " Transmissor "; |