@@ -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; |
@@ -232,13 +232,13 @@ discard block |
||
| 232 | 232 | $hMaxLinha = $this->hMaxLinha; |
| 233 | 233 | $hBoxLinha = $this->hBoxLinha; |
| 234 | 234 | $hLinha = $this->hLinha; |
| 235 | - $tamPapelVert = 160 +16+ (($qtdItens-1)*$hMaxLinha) + ($qtdPgto*$hLinha); |
|
| 235 | + $tamPapelVert = 160 + 16 + (($qtdItens - 1) * $hMaxLinha) + ($qtdPgto * $hLinha); |
|
| 236 | 236 | //se a orientação estiver em branco utilizar o padrão estabelecido na NF |
| 237 | 237 | if ($orientacao == '') { |
| 238 | 238 | $orientacao = 'P'; |
| 239 | 239 | } |
| 240 | 240 | $this->orientacao = $orientacao; |
| 241 | - $this->papel = array(80,$tamPapelVert); |
|
| 241 | + $this->papel = array(80, $tamPapelVert); |
|
| 242 | 242 | $this->logoAlign = $logoAlign; |
| 243 | 243 | //$this->situacao_externa = $situacaoExterna; |
| 244 | 244 | $this->numero_registro_dpec = $depecNumReg; |
@@ -262,10 +262,10 @@ discard block |
||
| 262 | 262 | //total inicial de paginas |
| 263 | 263 | $totPag = 1; |
| 264 | 264 | //largura imprimivel em mm: largura da folha menos as margens esq/direita |
| 265 | - $this->wPrint = $maxW-($margEsq*2); |
|
| 265 | + $this->wPrint = $maxW - ($margEsq * 2); |
|
| 266 | 266 | //comprimento (altura) imprimivel em mm: altura da folha menos as margens |
| 267 | 267 | //superior e inferior |
| 268 | - $this->hPrint = $maxH-$margSup-$margInf; |
|
| 268 | + $this->hPrint = $maxH - $margSup - $margInf; |
|
| 269 | 269 | // estabelece contagem de paginas |
| 270 | 270 | $this->pdf->aliasNbPages(); |
| 271 | 271 | $this->pdf->setMargins($margEsq, $margSup); // fixa as margens |
@@ -276,22 +276,22 @@ discard block |
||
| 276 | 276 | $this->pdf->setLineWidth(0.1); // define a largura da linha |
| 277 | 277 | $this->pdf->setTextColor(0, 0, 0); |
| 278 | 278 | $this->pTextBox(0, 0, $maxW, $maxH); // POR QUE PRECISO DESA LINHA? |
| 279 | - $hcabecalho = 27;//para cabeçalho (dados emitente mais logomarca) (FIXO) |
|
| 280 | - $hcabecalhoSecundario = 10;//para cabeçalho secundário (cabeçalho sefaz) (FIXO) |
|
| 281 | - $hprodutos = $hLinha + ($qtdItens*$hMaxLinha) ;//box poduto |
|
| 279 | + $hcabecalho = 27; //para cabeçalho (dados emitente mais logomarca) (FIXO) |
|
| 280 | + $hcabecalhoSecundario = 10; //para cabeçalho secundário (cabeçalho sefaz) (FIXO) |
|
| 281 | + $hprodutos = $hLinha + ($qtdItens * $hMaxLinha); //box poduto |
|
| 282 | 282 | $hTotal = 12; //box total (FIXO) |
| 283 | - $hpagamentos = $hLinha + ($qtdPgto*$hLinha);//para pagamentos |
|
| 284 | - $hmsgfiscal = 21;// para imposto (FIXO) |
|
| 283 | + $hpagamentos = $hLinha + ($qtdPgto * $hLinha); //para pagamentos |
|
| 284 | + $hmsgfiscal = 21; // para imposto (FIXO) |
|
| 285 | 285 | if (!isset($this->dest)) { |
| 286 | - $hcliente = 6;// para cliente (FIXO) |
|
| 286 | + $hcliente = 6; // para cliente (FIXO) |
|
| 287 | 287 | } else { |
| 288 | 288 | $hcliente = 12; |
| 289 | 289 | }// para cliente (FIXO)}; |
| 290 | - $hQRCode = 50;// para qrcode (FIXO) |
|
| 291 | - $hCabecItens = 4;//cabeçalho dos itens |
|
| 290 | + $hQRCode = 50; // para qrcode (FIXO) |
|
| 291 | + $hCabecItens = 4; //cabeçalho dos itens |
|
| 292 | 292 | |
| 293 | 293 | $hUsado = $hCabecItens; |
| 294 | - $w2 = round($this->wPrint*0.31, 0); |
|
| 294 | + $w2 = round($this->wPrint * 0.31, 0); |
|
| 295 | 295 | $totPag = 1; |
| 296 | 296 | $pag = 1; |
| 297 | 297 | $x = $xInic; |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal; |
| 312 | 312 | $y = $this->pPagamentosDANFE($x, $y, $hpagamentos); |
| 313 | 313 | //COLOCA MENSAGEM FISCAL |
| 314 | - $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal+ $hpagamentos; |
|
| 314 | + $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos; |
|
| 315 | 315 | $y = $this->pFiscalDANFE($x, $y, $hmsgfiscal); |
| 316 | 316 | //COLOCA CONSUMIDOR |
| 317 | 317 | $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos + $hmsgfiscal; |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | + $hTotal + $hpagamentos + $hmsgfiscal + $hcliente; |
| 322 | 322 | $y = $this->pQRDANFE($x, $y, $hQRCode); |
| 323 | 323 | //retorna o ID na NFe |
| 324 | - if ($classPdf!==false) { |
|
| 324 | + if ($classPdf !== false) { |
|
| 325 | 325 | $aR = [ |
| 326 | 326 | 'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")), |
| 327 | 327 | 'classe_PDF'=>$this->pdf |
@@ -341,14 +341,14 @@ discard block |
||
| 341 | 341 | $emitIM = $this->pSimpleGetValue($this->emit, "IM"); |
| 342 | 342 | $emitFone = $this->pSimpleGetValue($this->enderEmit, "fone"); |
| 343 | 343 | $foneLen = strlen($emitFone); |
| 344 | - if ($foneLen>0) { |
|
| 344 | + if ($foneLen > 0) { |
|
| 345 | 345 | $ddd = substr($emitFone, 0, 2); |
| 346 | 346 | $fone1 = substr($emitFone, -8); |
| 347 | 347 | $digito9 = ' '; |
| 348 | 348 | if ($foneLen == 11) { |
| 349 | 349 | $digito9 = substr($emitFone, 2, 1); |
| 350 | 350 | } |
| 351 | - $emitFone = ' - ('.$ddd.') '.$digito9. ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4); |
|
| 351 | + $emitFone = ' - (' . $ddd . ') ' . $digito9 . ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4); |
|
| 352 | 352 | } else { |
| 353 | 353 | $emitFone = ''; |
| 354 | 354 | } |
@@ -362,18 +362,18 @@ discard block |
||
| 362 | 362 | // CONFIGURAÇÃO DE POSIÇÃO |
| 363 | 363 | $margemInterna = $this->margemInterna; |
| 364 | 364 | $maxW = $this->wPrint; |
| 365 | - $h = $h-($margemInterna); |
|
| 365 | + $h = $h - ($margemInterna); |
|
| 366 | 366 | //COLOCA LOGOMARCA |
| 367 | 367 | if (is_file($this->logomarca)) { |
| 368 | 368 | $xImg = $margemInterna; |
| 369 | 369 | $yImg = $margemInterna + 1; |
| 370 | 370 | $this->pdf->Image($this->logomarca, $xImg, $yImg, 30, 22.5); |
| 371 | - $xRs = ($maxW*0.4) + $margemInterna; |
|
| 372 | - $wRs = ($maxW*0.6); |
|
| 371 | + $xRs = ($maxW * 0.4) + $margemInterna; |
|
| 372 | + $wRs = ($maxW * 0.6); |
|
| 373 | 373 | $alignEmit = 'L'; |
| 374 | 374 | } else { |
| 375 | 375 | $xRs = $margemInterna; |
| 376 | - $wRs = ($maxW*1); |
|
| 376 | + $wRs = ($maxW * 1); |
|
| 377 | 377 | $alignEmit = 'L'; |
| 378 | 378 | } |
| 379 | 379 | //COLOCA RAZÃO SOCIAL |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | { |
| 394 | 394 | $margemInterna = $this->margemInterna; |
| 395 | 395 | $maxW = $this->wPrint; |
| 396 | - $w = ($maxW*1); |
|
| 396 | + $w = ($maxW * 1); |
|
| 397 | 397 | $hBox1 = 7; |
| 398 | 398 | $texto = "DANFE NFC-e\nDocumento Auxiliar da Nota Fiscal de Consumidor Eletrônica"; |
| 399 | 399 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
@@ -410,13 +410,13 @@ discard block |
||
| 410 | 410 | $margemInterna = $this->margemInterna; |
| 411 | 411 | $maxW = $this->wPrint; |
| 412 | 412 | $qtdItens = $this->det->length; |
| 413 | - $w = ($maxW*1); |
|
| 413 | + $w = ($maxW * 1); |
|
| 414 | 414 | $hLinha = $this->hLinha; |
| 415 | 415 | $aFontCabProdutos = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 416 | - $wBoxCod = $w*0.17; |
|
| 416 | + $wBoxCod = $w * 0.17; |
|
| 417 | 417 | $texto = "CÓDIGO"; |
| 418 | 418 | $this->pTextBox($x, $y, $wBoxCod, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 419 | - $wBoxDescricao = $w*0.43; |
|
| 419 | + $wBoxDescricao = $w * 0.43; |
|
| 420 | 420 | $xBoxDescricao = $wBoxCod + $x; |
| 421 | 421 | $texto = "DESCRICÃO"; |
| 422 | 422 | $this->pTextBox( |
@@ -432,19 +432,19 @@ discard block |
||
| 432 | 432 | '', |
| 433 | 433 | false |
| 434 | 434 | ); |
| 435 | - $wBoxQt = $w*0.08; |
|
| 435 | + $wBoxQt = $w * 0.08; |
|
| 436 | 436 | $xBoxQt = $wBoxDescricao + $xBoxDescricao; |
| 437 | 437 | $texto = "QT"; |
| 438 | 438 | $this->pTextBox($xBoxQt, $y, $wBoxQt, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 439 | - $wBoxUn = $w*0.06; |
|
| 439 | + $wBoxUn = $w * 0.06; |
|
| 440 | 440 | $xBoxUn = $wBoxQt + $xBoxQt; |
| 441 | 441 | $texto = "UN"; |
| 442 | 442 | $this->pTextBox($xBoxUn, $y, $wBoxUn, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 443 | - $wBoxVl = $w*0.13; |
|
| 443 | + $wBoxVl = $w * 0.13; |
|
| 444 | 444 | $xBoxVl = $wBoxUn + $xBoxUn; |
| 445 | 445 | $texto = "VALOR"; |
| 446 | 446 | $this->pTextBox($xBoxVl, $y, $wBoxVl, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 447 | - $wBoxTotal = $w*0.13; |
|
| 447 | + $wBoxTotal = $w * 0.13; |
|
| 448 | 448 | $xBoxTotal = $wBoxVl + $xBoxVl; |
| 449 | 449 | $texto = "TOTAL"; |
| 450 | 450 | $this->pTextBox($xBoxTotal, $y, $wBoxTotal, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
@@ -464,13 +464,13 @@ discard block |
||
| 464 | 464 | $vUnCom = number_format($this->pSimpleGetValue($prod, "vUnCom"), 2, ",", "."); |
| 465 | 465 | $vProd = number_format($this->pSimpleGetValue($prod, "vProd"), 2, ",", "."); |
| 466 | 466 | //COLOCA PRODUTO |
| 467 | - $yBoxProd = $y + $hLinha + ($cont*$hMaxLinha); |
|
| 467 | + $yBoxProd = $y + $hLinha + ($cont * $hMaxLinha); |
|
| 468 | 468 | //COLOCA PRODUTO CÓDIGO |
| 469 | - $wBoxCod = $w*0.17; |
|
| 469 | + $wBoxCod = $w * 0.17; |
|
| 470 | 470 | $texto = $cProd; |
| 471 | 471 | $this->pTextBox($x, $yBoxProd, $wBoxCod, $hMaxLinha, $texto, $aFontProdutos, 'C', 'C', 0, '', false); |
| 472 | 472 | //COLOCA PRODUTO DESCRIÇÃO |
| 473 | - $wBoxDescricao = $w*0.43; |
|
| 473 | + $wBoxDescricao = $w * 0.43; |
|
| 474 | 474 | $xBoxDescricao = $wBoxCod + $x; |
| 475 | 475 | $texto = $xProd; |
| 476 | 476 | $this->pTextBox( |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | false |
| 488 | 488 | ); |
| 489 | 489 | //COLOCA PRODUTO QUANTIDADE |
| 490 | - $wBoxQt = $w*0.08; |
|
| 490 | + $wBoxQt = $w * 0.08; |
|
| 491 | 491 | $xBoxQt = $wBoxDescricao + $xBoxDescricao; |
| 492 | 492 | $texto = $qCom; |
| 493 | 493 | $this->pTextBox( |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | false |
| 505 | 505 | ); |
| 506 | 506 | //COLOCA PRODUTO UNIDADE |
| 507 | - $wBoxUn = $w*0.06; |
|
| 507 | + $wBoxUn = $w * 0.06; |
|
| 508 | 508 | $xBoxUn = $wBoxQt + $xBoxQt; |
| 509 | 509 | $texto = $uCom; |
| 510 | 510 | $this->pTextBox( |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | false |
| 522 | 522 | ); |
| 523 | 523 | //COLOCA PRODUTO VL UNITÁRIO |
| 524 | - $wBoxVl = $w*0.13; |
|
| 524 | + $wBoxVl = $w * 0.13; |
|
| 525 | 525 | $xBoxVl = $wBoxUn + $xBoxUn; |
| 526 | 526 | $texto = $vUnCom; |
| 527 | 527 | $this->pTextBox( |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | false |
| 539 | 539 | ); |
| 540 | 540 | //COLOCA PRODUTO VL TOTAL |
| 541 | - $wBoxTotal = $w*0.13; |
|
| 541 | + $wBoxTotal = $w * 0.13; |
|
| 542 | 542 | $xBoxTotal = $wBoxVl + $xBoxVl; |
| 543 | 543 | $texto = $vProd; |
| 544 | 544 | $this->pTextBox( |
@@ -565,13 +565,13 @@ discard block |
||
| 565 | 565 | $margemInterna = $this->margemInterna; |
| 566 | 566 | $maxW = $this->wPrint; |
| 567 | 567 | $hLinha = 3; |
| 568 | - $wColEsq = ($maxW*0.7); |
|
| 569 | - $wColDir = ($maxW*0.3); |
|
| 568 | + $wColEsq = ($maxW * 0.7); |
|
| 569 | + $wColDir = ($maxW * 0.3); |
|
| 570 | 570 | $xValor = $x + $wColEsq; |
| 571 | 571 | $qtdItens = $this->det->length; |
| 572 | 572 | $vProd = $this->pSimpleGetValue($this->ICMSTot, "vProd"); |
| 573 | 573 | $vNF = $this->pSimpleGetValue($this->ICMSTot, "vNF"); |
| 574 | - $vDesc = $this->pSimpleGetValue($this->ICMSTot, "vDesc"); |
|
| 574 | + $vDesc = $this->pSimpleGetValue($this->ICMSTot, "vDesc"); |
|
| 575 | 575 | $vTotTrib = $this->pSimpleGetValue($this->ICMSTot, "vTotTrib"); |
| 576 | 576 | $texto = "Qtd. Total de Itens"; |
| 577 | 577 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
@@ -586,21 +586,21 @@ discard block |
||
| 586 | 586 | $texto = "R$ " . number_format($vProd, 2, ",", "."); |
| 587 | 587 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 588 | 588 | $this->pTextBox($xValor, $yTotal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 589 | - $yDesconto = $y + ($hLinha*2); |
|
| 589 | + $yDesconto = $y + ($hLinha * 2); |
|
| 590 | 590 | $texto = "Descontos"; |
| 591 | 591 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 592 | 592 | $this->pTextBox($x, $yDesconto, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 593 | 593 | $texto = "R$ " . $vDesc; |
| 594 | 594 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 595 | 595 | $this->pTextBox($xValor, $yDesconto, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 596 | - $yTotalFinal = $y + ($hLinha*3); |
|
| 596 | + $yTotalFinal = $y + ($hLinha * 3); |
|
| 597 | 597 | $texto = "Total"; |
| 598 | 598 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 599 | 599 | $this->pTextBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 600 | 600 | $texto = "R$ " . $vNF; |
| 601 | 601 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 602 | 602 | $this->pTextBox($xValor, $yTotalFinal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 603 | - $yTotalFinal = $y + ($hLinha*4); |
|
| 603 | + $yTotalFinal = $y + ($hLinha * 4); |
|
| 604 | 604 | $texto = "Informação dos Tributos Totais Incidentes"; |
| 605 | 605 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
| 606 | 606 | $this->pTextBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
@@ -615,16 +615,16 @@ discard block |
||
| 615 | 615 | $margemInterna = $this->margemInterna; |
| 616 | 616 | $maxW = $this->wPrint; |
| 617 | 617 | $qtdPgto = $this->pag->length; |
| 618 | - $w = ($maxW*1); |
|
| 618 | + $w = ($maxW * 1); |
|
| 619 | 619 | $hLinha = $this->hLinha; |
| 620 | - $wColEsq = ($maxW*0.7); |
|
| 621 | - $wColDir = ($maxW*0.3); |
|
| 620 | + $wColEsq = ($maxW * 0.7); |
|
| 621 | + $wColDir = ($maxW * 0.3); |
|
| 622 | 622 | $xValor = $x + $wColEsq; |
| 623 | 623 | $aFontPgto = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 624 | - $wBoxEsq = $w*0.7; |
|
| 624 | + $wBoxEsq = $w * 0.7; |
|
| 625 | 625 | $texto = "FORMA DE PAGAMENTO"; |
| 626 | 626 | $this->pTextBox($x, $y, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false); |
| 627 | - $wBoxDir = $w*0.3; |
|
| 627 | + $wBoxDir = $w * 0.3; |
|
| 628 | 628 | $xBoxDescricao = $x + $wBoxEsq; |
| 629 | 629 | $texto = "VALOR PAGO"; |
| 630 | 630 | $this->pTextBox($xBoxDescricao, $y, $wBoxDir, $hLinha, $texto, $aFontPgto, 'T', 'R', 0, '', false); |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | $tBandNome = self::getCardName($tBand); |
| 647 | 647 | } |
| 648 | 648 | //COLOCA PRODUTO |
| 649 | - $yBoxProd = $y + $hLinha + ($cont*$hLinha); |
|
| 649 | + $yBoxProd = $y + $hLinha + ($cont * $hLinha); |
|
| 650 | 650 | //COLOCA PRODUTO CÓDIGO |
| 651 | 651 | $texto = $tPagNome; |
| 652 | 652 | $this->pTextBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false); |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | $y += 4; |
| 677 | 677 | $margemInterna = $this->margemInterna; |
| 678 | 678 | $maxW = $this->wPrint; |
| 679 | - $w = ($maxW*1); |
|
| 679 | + $w = ($maxW * 1); |
|
| 680 | 680 | $hLinha = $this->hLinha; |
| 681 | 681 | $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
| 682 | 682 | $aFontTex = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
@@ -690,18 +690,18 @@ discard block |
||
| 690 | 690 | $urlChave = $this->urlConsulta[$tpAmb][$this->UFSigla[$cUF]]; |
| 691 | 691 | $texto = "ÁREA DE MENSAGEM FISCAL"; |
| 692 | 692 | $this->pTextBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 693 | - $yTex1 = $y + ($hLinha*1); |
|
| 694 | - $hTex1 = $hLinha*2; |
|
| 695 | - $texto = "Número " . $nNF . " Série " . $serieNF . " " .$dhEmi . " - Via Consumidor"; |
|
| 693 | + $yTex1 = $y + ($hLinha * 1); |
|
| 694 | + $hTex1 = $hLinha * 2; |
|
| 695 | + $texto = "Número " . $nNF . " Série " . $serieNF . " " . $dhEmi . " - Via Consumidor"; |
|
| 696 | 696 | $this->pTextBox($x, $yTex1, $w, $hTex1, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 697 | - $yTex2 = $y + ($hLinha*3); |
|
| 698 | - $hTex2 = $hLinha*2; |
|
| 697 | + $yTex2 = $y + ($hLinha * 3); |
|
| 698 | + $hTex2 = $hLinha * 2; |
|
| 699 | 699 | $texto = "Consulte pela Chave de Acesso em " . $urlChave; |
| 700 | 700 | $this->pTextBox($x, $yTex2, $w, $hTex2, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 701 | 701 | $texto = "CHAVE DE ACESSO"; |
| 702 | - $yTit2 = $y + ($hLinha*5); |
|
| 702 | + $yTit2 = $y + ($hLinha * 5); |
|
| 703 | 703 | $this->pTextBox($x, $yTit2, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 704 | - $yTex3 = $y + ($hLinha*6); |
|
| 704 | + $yTex3 = $y + ($hLinha * 6); |
|
| 705 | 705 | $texto = $chNFe; |
| 706 | 706 | $this->pTextBox($x, $yTex3, $w, $hLinha, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 707 | 707 | } |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | $y += 4; |
| 712 | 712 | $margemInterna = $this->margemInterna; |
| 713 | 713 | $maxW = $this->wPrint; |
| 714 | - $w = ($maxW*1); |
|
| 714 | + $w = ($maxW * 1); |
|
| 715 | 715 | $hLinha = $this->hLinha; |
| 716 | 716 | $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
| 717 | 717 | $aFontTex = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
@@ -727,7 +727,7 @@ discard block |
||
| 727 | 727 | $consCNPJ = !empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
| 728 | 728 | ? $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue |
| 729 | 729 | : ''; |
| 730 | - $cDest = $consCPF.$consCNPJ.$considEstrangeiro; //documentos do consumidor |
|
| 730 | + $cDest = $consCPF . $consCNPJ . $considEstrangeiro; //documentos do consumidor |
|
| 731 | 731 | $enderDest = $this->dest->getElementsByTagName("enderDest")->item(0); |
| 732 | 732 | $consNome = $this->pSimpleGetValue($this->dest, "xNome"); |
| 733 | 733 | $consLgr = $this->pSimpleGetValue($enderDest, "xLgr"); |
@@ -767,8 +767,8 @@ discard block |
||
| 767 | 767 | $yTex1 = $y + $hLinha; |
| 768 | 768 | $texto = $consNome; |
| 769 | 769 | if (!empty($consDoc)) { |
| 770 | - $texto .= " - ". $consDoc . "\n" . $consEnd; |
|
| 771 | - $this->pTextBox($x, $yTex1, $w, $hLinha*3, $texto, $aFontTex, 'C', 'C', 0, '', false); |
|
| 770 | + $texto .= " - " . $consDoc . "\n" . $consEnd; |
|
| 771 | + $this->pTextBox($x, $yTex1, $w, $hLinha * 3, $texto, $aFontTex, 'C', 'C', 0, '', false); |
|
| 772 | 772 | } |
| 773 | 773 | } else { |
| 774 | 774 | $yTex1 = $y + $hLinha; |
@@ -782,7 +782,7 @@ discard block |
||
| 782 | 782 | $y += 4; |
| 783 | 783 | $margemInterna = $this->margemInterna; |
| 784 | 784 | $maxW = $this->wPrint; |
| 785 | - $w = ($maxW*1); |
|
| 785 | + $w = ($maxW * 1); |
|
| 786 | 786 | $hLinha = $this->hLinha; |
| 787 | 787 | $hBoxLinha = $this->hBoxLinha; |
| 788 | 788 | $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
@@ -791,19 +791,19 @@ discard block |
||
| 791 | 791 | $nProt = ''; |
| 792 | 792 | if (isset($this->nfeProc)) { |
| 793 | 793 | $nProt = $this->pSimpleGetValue($this->nfeProc, "nProt"); |
| 794 | - $dhRecbto = $this->pSimpleGetValue($this->nfeProc, "dhRecbto"); |
|
| 794 | + $dhRecbto = $this->pSimpleGetValue($this->nfeProc, "dhRecbto"); |
|
| 795 | 795 | } |
| 796 | 796 | $qrcode = new QRcode($this->qrCode, 'M'); |
| 797 | 797 | $wQr = 50; |
| 798 | 798 | $hQr = 50; |
| 799 | - $yQr = ($y+$margemInterna); |
|
| 800 | - $xQr = ($w/2) - ($wQr/2); |
|
| 799 | + $yQr = ($y + $margemInterna); |
|
| 800 | + $xQr = ($w / 2) - ($wQr / 2); |
|
| 801 | 801 | // prepare a base64 encoded "data url" |
| 802 | 802 | $pic = 'data://text/plain;base64,' . base64_encode($qrcode->writeString()); |
| 803 | 803 | $info = getimagesize($pic); |
| 804 | 804 | $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG'); |
| 805 | 805 | $dt = new DateTime($dhRecbto); |
| 806 | - $yQr = ($yQr+$hQr+$margemInterna); |
|
| 806 | + $yQr = ($yQr + $hQr + $margemInterna); |
|
| 807 | 807 | $this->pTextBox($x, $yQr, $w, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n" |
| 808 | 808 | . $dt->format('d/m/Y H:i:s'), $aFontTex, 'C', 'C', 0, '', false); |
| 809 | 809 | } |
@@ -927,7 +927,7 @@ discard block |
||
| 927 | 927 | $bin = ""; |
| 928 | 928 | $iCount = 0; |
| 929 | 929 | do { |
| 930 | - $bin .= chr(hexdec($str{$iCount}.$str{($iCount + 1)})); |
|
| 930 | + $bin .= chr(hexdec($str{$iCount} . $str{($iCount + 1)})); |
|
| 931 | 931 | $iCount += 2; |
| 932 | 932 | } while ($iCount < strlen($str)); |
| 933 | 933 | return $bin; |
@@ -961,12 +961,12 @@ discard block |
||
| 961 | 961 | $seq .= '&digVal=' . strtolower($digHex); |
| 962 | 962 | $seq .= '&cIdToken=' . $idToken; |
| 963 | 963 | //o hash code é calculado com o Token incluso |
| 964 | - $hash = sha1($seq.$token); |
|
| 965 | - $seq .= '&cHashQRCode='. strtoupper($hash); |
|
| 964 | + $hash = sha1($seq . $token); |
|
| 965 | + $seq .= '&cHashQRCode=' . strtoupper($hash); |
|
| 966 | 966 | if (strpos($url, '?') === false) { |
| 967 | - $seq = $url.'?'.$seq; |
|
| 967 | + $seq = $url . '?' . $seq; |
|
| 968 | 968 | } else { |
| 969 | - $seq = $url.''.$seq; |
|
| 969 | + $seq = $url . '' . $seq; |
|
| 970 | 970 | } |
| 971 | 971 | return $seq; |
| 972 | 972 | } |