@@ -27,11 +27,11 @@ discard block |
||
| 27 | 27 | protected $paperwidth = 80; |
| 28 | 28 | protected $creditos; |
| 29 | 29 | protected $xml; // string XML NFe |
| 30 | - protected $logomarca=''; // path para logomarca em jpg |
|
| 31 | - protected $formatoChave="#### #### #### #### #### #### #### #### #### #### ####"; |
|
| 32 | - protected $debugMode=0; //ativa ou desativa o modo de debug |
|
| 30 | + protected $logomarca = ''; // path para logomarca em jpg |
|
| 31 | + protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####"; |
|
| 32 | + protected $debugMode = 0; //ativa ou desativa o modo de debug |
|
| 33 | 33 | protected $tpImp; //ambiente |
| 34 | - protected $fontePadrao='Times'; |
|
| 34 | + protected $fontePadrao = 'Times'; |
|
| 35 | 35 | protected $nfeProc; |
| 36 | 36 | protected $nfe; |
| 37 | 37 | protected $infNFe; |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $this->textoAdic = ''; |
| 201 | 201 | if (isset($this->infAdic)) { |
| 202 | 202 | $this->textoAdic .= !empty($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue) ? |
| 203 | - 'Inf. Contribuinte: '. |
|
| 203 | + 'Inf. Contribuinte: ' . |
|
| 204 | 204 | trim($this->anfaveaDANFE($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue)) : ''; |
| 205 | 205 | if (!empty($this->textoAdic)) { |
| 206 | 206 | $this->textoAdic = str_replace(";", "\n", $this->textoAdic); |
@@ -241,10 +241,10 @@ discard block |
||
| 241 | 241 | //total inicial de paginas |
| 242 | 242 | $totPag = 1; |
| 243 | 243 | //largura imprimivel em mm: largura da folha menos as margens esq/direita |
| 244 | - $this->wPrint = $maxW-($margEsq*2); |
|
| 244 | + $this->wPrint = $maxW - ($margEsq * 2); |
|
| 245 | 245 | //comprimento (altura) imprimivel em mm: altura da folha menos as margens |
| 246 | 246 | //superior e inferior |
| 247 | - $this->hPrint = $maxH-$margSup-$margInf; |
|
| 247 | + $this->hPrint = $maxH - $margSup - $margInf; |
|
| 248 | 248 | // estabelece contagem de paginas |
| 249 | 249 | $this->pdf->aliasNbPages(); |
| 250 | 250 | $this->pdf->setMargins($margEsq, $margSup); // fixa as margens |
@@ -255,11 +255,11 @@ discard block |
||
| 255 | 255 | $this->pdf->setLineWidth(0.1); // define a largura da linha |
| 256 | 256 | $this->pdf->setTextColor(0, 0, 0); |
| 257 | 257 | $this->pdf->textBox(0, 0, $maxW, $maxH); // POR QUE PRECISO DESA LINHA? |
| 258 | - $hcabecalho = 27;//para cabeçalho (dados emitente mais logomarca) (FIXO) |
|
| 259 | - $hcabecalhoSecundario = 10 + 3;//para cabeçalho secundário (cabeçalho sefaz) (FIXO) |
|
| 260 | - $hprodutos = $hLinha + ($qtdItens * $hMaxLinha) ;//box poduto |
|
| 258 | + $hcabecalho = 27; //para cabeçalho (dados emitente mais logomarca) (FIXO) |
|
| 259 | + $hcabecalhoSecundario = 10 + 3; //para cabeçalho secundário (cabeçalho sefaz) (FIXO) |
|
| 260 | + $hprodutos = $hLinha + ($qtdItens * $hMaxLinha); //box poduto |
|
| 261 | 261 | $hTotal = 12; //box total (FIXO) |
| 262 | - $hpagamentos = $hLinha + ($qtdPgto * $hLinha) + 3;//para pagamentos |
|
| 262 | + $hpagamentos = $hLinha + ($qtdPgto * $hLinha) + 3; //para pagamentos |
|
| 263 | 263 | if (!empty($this->vTroco)) { |
| 264 | 264 | $hpagamentos += $hLinha; |
| 265 | 265 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal; |
| 293 | 293 | $y = $this->pagamentosDANFE($x, $y, $hpagamentos); |
| 294 | 294 | //COLOCA MENSAGEM FISCAL |
| 295 | - $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal+ $hpagamentos; |
|
| 295 | + $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos; |
|
| 296 | 296 | $y = $this->fiscalDANFE($x, $y, $hmsgfiscal); |
| 297 | 297 | //COLOCA CONSUMIDOR |
| 298 | 298 | $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos + $hmsgfiscal; |
@@ -320,14 +320,14 @@ discard block |
||
| 320 | 320 | $emitIM = $this->getTagValue($this->emit, "IM"); |
| 321 | 321 | $emitFone = $this->getTagValue($this->enderEmit, "fone"); |
| 322 | 322 | $foneLen = strlen($emitFone); |
| 323 | - if ($foneLen>0) { |
|
| 323 | + if ($foneLen > 0) { |
|
| 324 | 324 | $ddd = substr($emitFone, 0, 2); |
| 325 | 325 | $fone1 = substr($emitFone, -8); |
| 326 | 326 | $digito9 = ' '; |
| 327 | 327 | if ($foneLen == 11) { |
| 328 | 328 | $digito9 = substr($emitFone, 2, 1); |
| 329 | 329 | } |
| 330 | - $emitFone = ' - ('.$ddd.') '.$digito9. ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4); |
|
| 330 | + $emitFone = ' - (' . $ddd . ') ' . $digito9 . ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4); |
|
| 331 | 331 | } else { |
| 332 | 332 | $emitFone = ''; |
| 333 | 333 | } |
@@ -341,19 +341,19 @@ discard block |
||
| 341 | 341 | // CONFIGURAÇÃO DE POSIÇÃO |
| 342 | 342 | $margemInterna = $this->margemInterna; |
| 343 | 343 | $maxW = $this->wPrint; |
| 344 | - $h = $h-($margemInterna); |
|
| 344 | + $h = $h - ($margemInterna); |
|
| 345 | 345 | //COLOCA LOGOMARCA |
| 346 | 346 | if (!empty($this->logomarca)) { |
| 347 | 347 | $xImg = $margemInterna; |
| 348 | 348 | $yImg = $margemInterna + 1; |
| 349 | 349 | $type = (substr($this->logomarca, 0, 7) === 'data://') ? 'jpg' : null; |
| 350 | 350 | $this->pdf->image($this->logomarca, $xImg, $yImg, 30, 22.5, $type); |
| 351 | - $xRs = ($maxW*0.4) + $margemInterna; |
|
| 352 | - $wRs = ($maxW*0.6); |
|
| 351 | + $xRs = ($maxW * 0.4) + $margemInterna; |
|
| 352 | + $wRs = ($maxW * 0.6); |
|
| 353 | 353 | $alignEmit = 'L'; |
| 354 | 354 | } else { |
| 355 | 355 | $xRs = $margemInterna; |
| 356 | - $wRs = ($maxW*1); |
|
| 356 | + $wRs = ($maxW * 1); |
|
| 357 | 357 | $alignEmit = 'L'; |
| 358 | 358 | } |
| 359 | 359 | //COLOCA RAZÃO SOCIAL |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | { |
| 374 | 374 | $margemInterna = $this->margemInterna; |
| 375 | 375 | $maxW = $this->wPrint; |
| 376 | - $w = ($maxW*1); |
|
| 376 | + $w = ($maxW * 1); |
|
| 377 | 377 | $hBox1 = 7; |
| 378 | 378 | $texto = "DANFE NFC-e\nDocumento Auxiliar da Nota Fiscal de Consumidor Eletrônica"; |
| 379 | 379 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
@@ -390,13 +390,13 @@ discard block |
||
| 390 | 390 | $margemInterna = $this->margemInterna; |
| 391 | 391 | $maxW = $this->wPrint; |
| 392 | 392 | $qtdItens = $this->det->length; |
| 393 | - $w = ($maxW*1); |
|
| 393 | + $w = ($maxW * 1); |
|
| 394 | 394 | $hLinha = $this->hLinha; |
| 395 | 395 | $aFontCabProdutos = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 396 | - $wBoxCod = $w*0.17; |
|
| 396 | + $wBoxCod = $w * 0.17; |
|
| 397 | 397 | $texto = "CÓDIGO"; |
| 398 | 398 | $this->pdf->textBox($x, $y, $wBoxCod, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 399 | - $wBoxDescricao = $w*0.43; |
|
| 399 | + $wBoxDescricao = $w * 0.43; |
|
| 400 | 400 | $xBoxDescricao = $wBoxCod + $x; |
| 401 | 401 | $texto = "DESCRICÃO"; |
| 402 | 402 | $this->pdf->textBox( |
@@ -412,19 +412,19 @@ discard block |
||
| 412 | 412 | '', |
| 413 | 413 | false |
| 414 | 414 | ); |
| 415 | - $wBoxQt = $w*0.08; |
|
| 415 | + $wBoxQt = $w * 0.08; |
|
| 416 | 416 | $xBoxQt = $wBoxDescricao + $xBoxDescricao; |
| 417 | 417 | $texto = "QT"; |
| 418 | 418 | $this->pdf->textBox($xBoxQt, $y, $wBoxQt, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 419 | - $wBoxUn = $w*0.06; |
|
| 419 | + $wBoxUn = $w * 0.06; |
|
| 420 | 420 | $xBoxUn = $wBoxQt + $xBoxQt; |
| 421 | 421 | $texto = "UN"; |
| 422 | 422 | $this->pdf->textBox($xBoxUn, $y, $wBoxUn, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 423 | - $wBoxVl = $w*0.13; |
|
| 423 | + $wBoxVl = $w * 0.13; |
|
| 424 | 424 | $xBoxVl = $wBoxUn + $xBoxUn; |
| 425 | 425 | $texto = "VALOR"; |
| 426 | 426 | $this->pdf->textBox($xBoxVl, $y, $wBoxVl, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 427 | - $wBoxTotal = $w*0.13; |
|
| 427 | + $wBoxTotal = $w * 0.13; |
|
| 428 | 428 | $xBoxTotal = $wBoxVl + $xBoxVl; |
| 429 | 429 | $texto = "TOTAL"; |
| 430 | 430 | $this->pdf->textBox($xBoxTotal, $y, $wBoxTotal, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
@@ -444,9 +444,9 @@ discard block |
||
| 444 | 444 | $vUnCom = number_format($this->getTagValue($prod, "vUnCom"), 2, ",", "."); |
| 445 | 445 | $vProd = number_format($this->getTagValue($prod, "vProd"), 2, ",", "."); |
| 446 | 446 | //COLOCA PRODUTO |
| 447 | - $yBoxProd = $y + $hLinha + ($cont*$hMaxLinha); |
|
| 447 | + $yBoxProd = $y + $hLinha + ($cont * $hMaxLinha); |
|
| 448 | 448 | //COLOCA PRODUTO CÓDIGO |
| 449 | - $wBoxCod = $w*0.17; |
|
| 449 | + $wBoxCod = $w * 0.17; |
|
| 450 | 450 | $texto = $cProd; |
| 451 | 451 | $this->pdf->textBox( |
| 452 | 452 | $x, |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | false |
| 463 | 463 | ); |
| 464 | 464 | //COLOCA PRODUTO DESCRIÇÃO |
| 465 | - $wBoxDescricao = $w*0.43; |
|
| 465 | + $wBoxDescricao = $w * 0.43; |
|
| 466 | 466 | $xBoxDescricao = $wBoxCod + $x; |
| 467 | 467 | $texto = $xProd; |
| 468 | 468 | $this->pdf->textBox( |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | false |
| 480 | 480 | ); |
| 481 | 481 | //COLOCA PRODUTO QUANTIDADE |
| 482 | - $wBoxQt = $w*0.08; |
|
| 482 | + $wBoxQt = $w * 0.08; |
|
| 483 | 483 | $xBoxQt = $wBoxDescricao + $xBoxDescricao; |
| 484 | 484 | $texto = $qCom; |
| 485 | 485 | $this->pdf->textBox( |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | false |
| 497 | 497 | ); |
| 498 | 498 | //COLOCA PRODUTO UNIDADE |
| 499 | - $wBoxUn = $w*0.06; |
|
| 499 | + $wBoxUn = $w * 0.06; |
|
| 500 | 500 | $xBoxUn = $wBoxQt + $xBoxQt; |
| 501 | 501 | $texto = $uCom; |
| 502 | 502 | $this->pdf->textBox( |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | false |
| 514 | 514 | ); |
| 515 | 515 | //COLOCA PRODUTO VL UNITÁRIO |
| 516 | - $wBoxVl = $w*0.13; |
|
| 516 | + $wBoxVl = $w * 0.13; |
|
| 517 | 517 | $xBoxVl = $wBoxUn + $xBoxUn; |
| 518 | 518 | $texto = $vUnCom; |
| 519 | 519 | $this->pdf->textBox( |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | false |
| 531 | 531 | ); |
| 532 | 532 | //COLOCA PRODUTO VL TOTAL |
| 533 | - $wBoxTotal = $w*0.13; |
|
| 533 | + $wBoxTotal = $w * 0.13; |
|
| 534 | 534 | $xBoxTotal = $wBoxVl + $xBoxVl; |
| 535 | 535 | $texto = $vProd; |
| 536 | 536 | $this->pdf->textBox( |
@@ -557,8 +557,8 @@ discard block |
||
| 557 | 557 | $margemInterna = $this->margemInterna; |
| 558 | 558 | $maxW = $this->wPrint; |
| 559 | 559 | $hLinha = 3; |
| 560 | - $wColEsq = ($maxW*0.7); |
|
| 561 | - $wColDir = ($maxW*0.3); |
|
| 560 | + $wColEsq = ($maxW * 0.7); |
|
| 561 | + $wColDir = ($maxW * 0.3); |
|
| 562 | 562 | $xValor = $x + $wColEsq; |
| 563 | 563 | $qtdItens = $this->det->length; |
| 564 | 564 | $vProd = $this->getTagValue($this->ICMSTot, "vProd"); |
@@ -579,28 +579,28 @@ discard block |
||
| 579 | 579 | $texto = "R$ " . number_format($vProd, 2, ",", "."); |
| 580 | 580 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 581 | 581 | $this->pdf->textBox($xValor, $yTotal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 582 | - $yDesconto = $y + ($hLinha*2); |
|
| 582 | + $yDesconto = $y + ($hLinha * 2); |
|
| 583 | 583 | $texto = "Descontos"; |
| 584 | 584 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 585 | 585 | $this->pdf->textBox($x, $yDesconto, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 586 | 586 | $texto = "R$ " . $vDesc; |
| 587 | 587 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 588 | 588 | $this->pdf->textBox($xValor, $yDesconto, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 589 | - $yFrete= $y + ($hLinha*3); |
|
| 589 | + $yFrete = $y + ($hLinha * 3); |
|
| 590 | 590 | $texto = "Frete"; |
| 591 | 591 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 592 | 592 | $this->pdf->textBox($x, $yFrete, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 593 | 593 | $texto = "R$ " . $vFrete; |
| 594 | 594 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 595 | 595 | $this->pdf->textBox($xValor, $yFrete, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 596 | - $yTotalFinal = $y + ($hLinha*4); |
|
| 596 | + $yTotalFinal = $y + ($hLinha * 4); |
|
| 597 | 597 | $texto = "Total"; |
| 598 | 598 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 599 | 599 | $this->pdf->textBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 600 | 600 | $texto = "R$ " . $vNF; |
| 601 | 601 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 602 | 602 | $this->pdf->textBox($xValor, $yTotalFinal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 603 | - $yTotalFinal = $y + ($hLinha*5); |
|
| 603 | + $yTotalFinal = $y + ($hLinha * 5); |
|
| 604 | 604 | $texto = "Informação dos Tributos Totais Incidentes"; |
| 605 | 605 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 606 | 606 | $this->pdf->textBox($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->pdf->textBox($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->pdf->textBox($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->pdf->textBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false); |
@@ -670,7 +670,7 @@ discard block |
||
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | if (!empty($this->vTroco)) { |
| 673 | - $yBoxProd = $y + $hLinha + ($cont*$hLinha); |
|
| 673 | + $yBoxProd = $y + $hLinha + ($cont * $hLinha); |
|
| 674 | 674 | //COLOCA PRODUTO CÓDIGO |
| 675 | 675 | $texto = 'Troco'; |
| 676 | 676 | $this->pdf->textBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false); |
@@ -699,7 +699,7 @@ discard block |
||
| 699 | 699 | $y += 6; |
| 700 | 700 | $margemInterna = $this->margemInterna; |
| 701 | 701 | $maxW = $this->wPrint; |
| 702 | - $w = ($maxW*1); |
|
| 702 | + $w = ($maxW * 1); |
|
| 703 | 703 | $hLinha = $this->hLinha; |
| 704 | 704 | $aFontTit = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B']; |
| 705 | 705 | $aFontTex = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
@@ -731,19 +731,19 @@ discard block |
||
| 731 | 731 | $dhEmiLocalFormat = $dhEmilocal->format('d/m/Y H:i:s'); |
| 732 | 732 | $texto = "ÁREA DE MENSAGEM FISCAL"; |
| 733 | 733 | $this->pdf->textBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 734 | - $yTex1 = $y + ($hLinha*1); |
|
| 735 | - $hTex1 = $hLinha*2; |
|
| 736 | - $texto = "Número " . $nNF . " Série " . $serieNF . " " .$dhEmiLocalFormat . " - Via Consumidor"; |
|
| 734 | + $yTex1 = $y + ($hLinha * 1); |
|
| 735 | + $hTex1 = $hLinha * 2; |
|
| 736 | + $texto = "Número " . $nNF . " Série " . $serieNF . " " . $dhEmiLocalFormat . " - Via Consumidor"; |
|
| 737 | 737 | $this->pdf->textBox($x, $yTex1, $w, $hTex1, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 738 | - $yTex2 = $y + ($hLinha*3); |
|
| 739 | - $hTex2 = $hLinha*2; |
|
| 738 | + $yTex2 = $y + ($hLinha * 3); |
|
| 739 | + $hTex2 = $hLinha * 2; |
|
| 740 | 740 | |
| 741 | 741 | $texto = !empty($this->urlChave) ? "Consulte pela Chave de Acesso em " . $this->urlChave : ''; |
| 742 | 742 | $this->pdf->textBox($x, $yTex2, $w, $hTex2, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 743 | 743 | $texto = "CHAVE DE ACESSO"; |
| 744 | - $yTit2 = $y + ($hLinha*5); |
|
| 744 | + $yTit2 = $y + ($hLinha * 5); |
|
| 745 | 745 | $this->pdf->textBox($x, $yTit2, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 746 | - $yTex3 = $y + ($hLinha*6); |
|
| 746 | + $yTex3 = $y + ($hLinha * 6); |
|
| 747 | 747 | $texto = $chNFe; |
| 748 | 748 | $this->pdf->textBox($x, $yTex3, $w, $hLinha, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 749 | 749 | } |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | $y += 6; |
| 754 | 754 | $margemInterna = $this->margemInterna; |
| 755 | 755 | $maxW = $this->wPrint; |
| 756 | - $w = ($maxW*1); |
|
| 756 | + $w = ($maxW * 1); |
|
| 757 | 757 | $hLinha = $this->hLinha; |
| 758 | 758 | $aFontTit = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B']; |
| 759 | 759 | $aFontTex = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | $consCNPJ = !empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
| 770 | 770 | ? $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue |
| 771 | 771 | : ''; |
| 772 | - $cDest = $consCPF.$consCNPJ.$considEstrangeiro; //documentos do consumidor |
|
| 772 | + $cDest = $consCPF . $consCNPJ . $considEstrangeiro; //documentos do consumidor |
|
| 773 | 773 | $enderDest = $this->dest->getElementsByTagName("enderDest")->item(0); |
| 774 | 774 | $consNome = $this->getTagValue($this->dest, "xNome"); |
| 775 | 775 | $consLgr = $this->getTagValue($enderDest, "xLgr"); |
@@ -809,8 +809,8 @@ discard block |
||
| 809 | 809 | $yTex1 = $y + $hLinha; |
| 810 | 810 | $texto = $consNome; |
| 811 | 811 | if (!empty($consDoc)) { |
| 812 | - $texto .= " - ". $consDoc . "\n" . $consEnd; |
|
| 813 | - $this->pdf->textBox($x, $yTex1, $w, $hLinha*3, $texto, $aFontTex, 'C', 'C', 0, '', false); |
|
| 812 | + $texto .= " - " . $consDoc . "\n" . $consEnd; |
|
| 813 | + $this->pdf->textBox($x, $yTex1, $w, $hLinha * 3, $texto, $aFontTex, 'C', 'C', 0, '', false); |
|
| 814 | 814 | } |
| 815 | 815 | } else { |
| 816 | 816 | $yTex1 = $y + $hLinha; |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | $y += 6; |
| 825 | 825 | $margemInterna = $this->margemInterna; |
| 826 | 826 | $maxW = $this->wPrint; |
| 827 | - $w = ($maxW*1)+4; |
|
| 827 | + $w = ($maxW * 1) + 4; |
|
| 828 | 828 | $hLinha = $this->hLinha; |
| 829 | 829 | $hBoxLinha = $this->hBoxLinha; |
| 830 | 830 | $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | $nProt = ''; |
| 834 | 834 | if (isset($this->nfeProc)) { |
| 835 | 835 | $nProt = $this->getTagValue($this->nfeProc, "nProt"); |
| 836 | - $dhRecbto = $this->getTagValue($this->nfeProc, "dhRecbto"); |
|
| 836 | + $dhRecbto = $this->getTagValue($this->nfeProc, "dhRecbto"); |
|
| 837 | 837 | } |
| 838 | 838 | $barcode = new Barcode(); |
| 839 | 839 | $bobj = $barcode->getBarcodeObj( |
@@ -847,15 +847,15 @@ discard block |
||
| 847 | 847 | $qrcode = $bobj->getPngData(); |
| 848 | 848 | $wQr = 50; |
| 849 | 849 | $hQr = 50; |
| 850 | - $yQr = ($y+$margemInterna); |
|
| 851 | - $xQr = ($w/2) - ($wQr/2); |
|
| 850 | + $yQr = ($y + $margemInterna); |
|
| 851 | + $xQr = ($w / 2) - ($wQr / 2); |
|
| 852 | 852 | // prepare a base64 encoded "data url" |
| 853 | 853 | $pic = 'data://text/plain;base64,' . base64_encode($qrcode); |
| 854 | 854 | $info = getimagesize($pic); |
| 855 | 855 | $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG'); |
| 856 | 856 | $dt = new DateTime($dhRecbto); |
| 857 | - $yQr = ($yQr+$hQr+$margemInterna); |
|
| 858 | - $this->pdf->textBox($x, $yQr, $w-4, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n" |
|
| 857 | + $yQr = ($yQr + $hQr + $margemInterna); |
|
| 858 | + $this->pdf->textBox($x, $yQr, $w - 4, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n" |
|
| 859 | 859 | . $dt->format('d/m/Y H:i:s'), $aFontTex, 'C', 'C', 0, '', false); |
| 860 | 860 | } |
| 861 | 861 | |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | } |
| 876 | 876 | $heigthText = $this->pdf->textBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 877 | 877 | // seta o textbox do texto adicional |
| 878 | - $this->pdf->textBox($x, $y+3, $w-2, $hLinha-3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false); |
|
| 878 | + $this->pdf->textBox($x, $y + 3, $w - 2, $hLinha - 3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false); |
|
| 879 | 879 | } |
| 880 | 880 | |
| 881 | 881 | /** |
@@ -901,7 +901,7 @@ discard block |
||
| 901 | 901 | if ($startPos === false) { |
| 902 | 902 | return $cdata; |
| 903 | 903 | } |
| 904 | - for ($x=$len; $x>0; $x--) { |
|
| 904 | + for ($x = $len; $x > 0; $x--) { |
|
| 905 | 905 | if (substr($cdata, $x, 1) == '>') { |
| 906 | 906 | $endPos = $x; |
| 907 | 907 | break; |
@@ -912,15 +912,15 @@ discard block |
||
| 912 | 912 | } else { |
| 913 | 913 | $parte1 = ''; |
| 914 | 914 | } |
| 915 | - $parte2 = substr($cdata, $startPos, $endPos-$startPos+1); |
|
| 915 | + $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1); |
|
| 916 | 916 | if ($endPos < $len) { |
| 917 | 917 | $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1); |
| 918 | 918 | } else { |
| 919 | 919 | $parte3 = ''; |
| 920 | 920 | } |
| 921 | - $texto = trim($parte1).' '.trim($parte3); |
|
| 921 | + $texto = trim($parte1) . ' ' . trim($parte3); |
|
| 922 | 922 | if (strpos($parte2, '<CDATA>') === false) { |
| 923 | - $cdata = '<CDATA>'.$parte2.'</CDATA>'; |
|
| 923 | + $cdata = '<CDATA>' . $parte2 . '</CDATA>'; |
|
| 924 | 924 | } else { |
| 925 | 925 | $cdata = $parte2; |
| 926 | 926 | } |
@@ -992,15 +992,15 @@ discard block |
||
| 992 | 992 | //grupo CADATA infCpl |
| 993 | 993 | $t = $dom->getElementsByTagName('transmissor')->item(0); |
| 994 | 994 | $r = $dom->getElementsByTagName('receptor')->item(0); |
| 995 | - $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 996 | - 'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : ''; |
|
| 997 | - $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 998 | - 'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : ''; |
|
| 999 | - $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 1000 | - 'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : ''; |
|
| 1001 | - $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 1002 | - 'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : ''; |
|
| 1003 | - $texto .= "".$versao.$especieNF.$fabEntrega.$dca; |
|
| 995 | + $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 996 | + 'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : ''; |
|
| 997 | + $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 998 | + 'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : ''; |
|
| 999 | + $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 1000 | + 'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : ''; |
|
| 1001 | + $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 1002 | + 'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : ''; |
|
| 1003 | + $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
| 1004 | 1004 | if (isset($t)) { |
| 1005 | 1005 | if ($t->hasAttributes()) { |
| 1006 | 1006 | $texto .= " Transmissor "; |