@@ -14,11 +14,9 @@ |
||
| 14 | 14 | * @author Roberto Spadim <roberto at spadim dot com dot br> |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | -use Exception; |
|
| 18 | 17 | use NFePHP\DA\Legacy\Dom; |
| 19 | 18 | use NFePHP\DA\Legacy\Pdf; |
| 20 | 19 | use NFePHP\DA\Legacy\Common; |
| 21 | -use Endroid\QrCode\QrCode; |
|
| 22 | 20 | use DateTime; |
| 23 | 21 | |
| 24 | 22 | class Danfce extends Common |
@@ -223,8 +223,8 @@ |
||
| 223 | 223 | //retorna o ID na NFe |
| 224 | 224 | if ($classPdf!==false) { |
| 225 | 225 | $aR = [ |
| 226 | - 'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")), |
|
| 227 | - 'classe_PDF'=>$this->pdf |
|
| 226 | + 'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")), |
|
| 227 | + 'classe_PDF'=>$this->pdf |
|
| 228 | 228 | ]; |
| 229 | 229 | return $aR; |
| 230 | 230 | } else { |
@@ -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; |
@@ -132,13 +132,13 @@ discard block |
||
| 132 | 132 | $hMaxLinha = $this->hMaxLinha; |
| 133 | 133 | $hBoxLinha = $this->hBoxLinha; |
| 134 | 134 | $hLinha = $this->hLinha; |
| 135 | - $tamPapelVert = 160 +16+ (($qtdItens-1)*$hMaxLinha) + ($qtdPgto*$hLinha); |
|
| 135 | + $tamPapelVert = 160 + 16 + (($qtdItens - 1) * $hMaxLinha) + ($qtdPgto * $hLinha); |
|
| 136 | 136 | //se a orientação estiver em branco utilizar o padrão estabelecido na NF |
| 137 | 137 | if ($orientacao == '') { |
| 138 | 138 | $orientacao = 'P'; |
| 139 | 139 | } |
| 140 | 140 | $this->orientacao = $orientacao; |
| 141 | - $this->papel = array(80,$tamPapelVert); |
|
| 141 | + $this->papel = array(80, $tamPapelVert); |
|
| 142 | 142 | $this->logoAlign = $logoAlign; |
| 143 | 143 | $this->situacao_externa = $situacaoExterna; |
| 144 | 144 | $this->numero_registro_dpec = $depecNumReg; |
@@ -162,10 +162,10 @@ discard block |
||
| 162 | 162 | //total inicial de paginas |
| 163 | 163 | $totPag = 1; |
| 164 | 164 | //largura imprimivel em mm: largura da folha menos as margens esq/direita |
| 165 | - $this->wPrint = $maxW-($margEsq*2); |
|
| 165 | + $this->wPrint = $maxW - ($margEsq * 2); |
|
| 166 | 166 | //comprimento (altura) imprimivel em mm: altura da folha menos as margens |
| 167 | 167 | //superior e inferior |
| 168 | - $this->hPrint = $maxH-$margSup-$margInf; |
|
| 168 | + $this->hPrint = $maxH - $margSup - $margInf; |
|
| 169 | 169 | // estabelece contagem de paginas |
| 170 | 170 | $this->pdf->aliasNbPages(); |
| 171 | 171 | $this->pdf->setMargins($margEsq, $margSup); // fixa as margens |
@@ -176,22 +176,22 @@ discard block |
||
| 176 | 176 | $this->pdf->setLineWidth(0.1); // define a largura da linha |
| 177 | 177 | $this->pdf->setTextColor(0, 0, 0); |
| 178 | 178 | $this->pTextBox(0, 0, $maxW, $maxH); // POR QUE PRECISO DESA LINHA? |
| 179 | - $hcabecalho = 27;//para cabeçalho (dados emitente mais logomarca) (FIXO) |
|
| 180 | - $hcabecalhoSecundario = 10;//para cabeçalho secundário (cabeçalho sefaz) (FIXO) |
|
| 181 | - $hprodutos = $hLinha + ($qtdItens*$hMaxLinha) ;//box poduto |
|
| 179 | + $hcabecalho = 27; //para cabeçalho (dados emitente mais logomarca) (FIXO) |
|
| 180 | + $hcabecalhoSecundario = 10; //para cabeçalho secundário (cabeçalho sefaz) (FIXO) |
|
| 181 | + $hprodutos = $hLinha + ($qtdItens * $hMaxLinha); //box poduto |
|
| 182 | 182 | $hTotal = 12; //box total (FIXO) |
| 183 | - $hpagamentos = $hLinha + ($qtdPgto*$hLinha);//para pagamentos |
|
| 184 | - $hmsgfiscal = 21;// para imposto (FIXO) |
|
| 183 | + $hpagamentos = $hLinha + ($qtdPgto * $hLinha); //para pagamentos |
|
| 184 | + $hmsgfiscal = 21; // para imposto (FIXO) |
|
| 185 | 185 | if (!isset($this->dest)) { |
| 186 | - $hcliente = 6;// para cliente (FIXO) |
|
| 186 | + $hcliente = 6; // para cliente (FIXO) |
|
| 187 | 187 | } else { |
| 188 | 188 | $hcliente = 12; |
| 189 | 189 | }// para cliente (FIXO)}; |
| 190 | - $hQRCode = 50;// para qrcode (FIXO) |
|
| 191 | - $hCabecItens = 4;//cabeçalho dos itens |
|
| 190 | + $hQRCode = 50; // para qrcode (FIXO) |
|
| 191 | + $hCabecItens = 4; //cabeçalho dos itens |
|
| 192 | 192 | |
| 193 | 193 | $hUsado = $hCabecItens; |
| 194 | - $w2 = round($this->wPrint*0.31, 0); |
|
| 194 | + $w2 = round($this->wPrint * 0.31, 0); |
|
| 195 | 195 | $totPag = 1; |
| 196 | 196 | $pag = 1; |
| 197 | 197 | $x = $xInic; |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal; |
| 212 | 212 | $y = $this->pPagamentosDANFE($x, $y, $hpagamentos); |
| 213 | 213 | //COLOCA MENSAGEM FISCAL |
| 214 | - $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal+ $hpagamentos; |
|
| 214 | + $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos; |
|
| 215 | 215 | $y = $this->pFiscalDANFE($x, $y, $hmsgfiscal); |
| 216 | 216 | //COLOCA CONSUMIDOR |
| 217 | 217 | $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos + $hmsgfiscal; |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | + $hTotal + $hpagamentos + $hmsgfiscal + $hcliente; |
| 222 | 222 | $y = $this->pQRDANFE($x, $y, $hQRCode); |
| 223 | 223 | //retorna o ID na NFe |
| 224 | - if ($classPdf!==false) { |
|
| 224 | + if ($classPdf !== false) { |
|
| 225 | 225 | $aR = [ |
| 226 | 226 | 'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")), |
| 227 | 227 | 'classe_PDF'=>$this->pdf |
@@ -241,13 +241,13 @@ discard block |
||
| 241 | 241 | $emitIM = $this->pSimpleGetValue($this->emit, "IM"); |
| 242 | 242 | $emitFone = $this->pSimpleGetValue($this->enderEmit, "fone"); |
| 243 | 243 | $foneLen = strlen($emitFone); |
| 244 | - if ($foneLen>0) { |
|
| 244 | + if ($foneLen > 0) { |
|
| 245 | 245 | $ddd = substr($emitFone, 0, 2); |
| 246 | 246 | $fone1 = substr($emitFone, -8); |
| 247 | 247 | if ($foneLen == 11) { |
| 248 | 248 | $digito9 = substr($emitFone, 2, 1); |
| 249 | 249 | } |
| 250 | - $emitFone = ' - ('.$ddd.') '.$digito9. ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4); |
|
| 250 | + $emitFone = ' - (' . $ddd . ') ' . $digito9 . ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4); |
|
| 251 | 251 | } else { |
| 252 | 252 | $emitFone = ''; |
| 253 | 253 | } |
@@ -261,18 +261,18 @@ discard block |
||
| 261 | 261 | // CONFIGURAÇÃO DE POSIÇÃO |
| 262 | 262 | $margemInterna = $this->margemInterna; |
| 263 | 263 | $maxW = $this->wPrint; |
| 264 | - $h = $h-($margemInterna); |
|
| 264 | + $h = $h - ($margemInterna); |
|
| 265 | 265 | //COLOCA LOGOMARCA |
| 266 | 266 | if (is_file($this->logomarca)) { |
| 267 | 267 | $xImg = $margemInterna; |
| 268 | 268 | $yImg = $margemInterna + 1; |
| 269 | 269 | $this->pdf->Image($this->logomarca, $xImg, $yImg, 30, 22.5); |
| 270 | - $xRs = ($maxW*0.4) + $margemInterna; |
|
| 271 | - $wRs = ($maxW*0.6); |
|
| 270 | + $xRs = ($maxW * 0.4) + $margemInterna; |
|
| 271 | + $wRs = ($maxW * 0.6); |
|
| 272 | 272 | $alignEmit = 'L'; |
| 273 | 273 | } else { |
| 274 | 274 | $xRs = $margemInterna; |
| 275 | - $wRs = ($maxW*1); |
|
| 275 | + $wRs = ($maxW * 1); |
|
| 276 | 276 | $alignEmit = 'L'; |
| 277 | 277 | } |
| 278 | 278 | //COLOCA RAZÃO SOCIAL |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | { |
| 292 | 292 | $margemInterna = $this->margemInterna; |
| 293 | 293 | $maxW = $this->wPrint; |
| 294 | - $w = ($maxW*1); |
|
| 294 | + $w = ($maxW * 1); |
|
| 295 | 295 | $hBox1 = 7; |
| 296 | 296 | $texto = "DANFE NFC-e\nDocumento Auxiliar da Nota Fiscal de Consumidor Eletrônica"; |
| 297 | 297 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
@@ -308,13 +308,13 @@ discard block |
||
| 308 | 308 | $margemInterna = $this->margemInterna; |
| 309 | 309 | $maxW = $this->wPrint; |
| 310 | 310 | $qtdItens = $this->det->length; |
| 311 | - $w = ($maxW*1); |
|
| 311 | + $w = ($maxW * 1); |
|
| 312 | 312 | $hLinha = $this->hLinha; |
| 313 | 313 | $aFontCabProdutos = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 314 | - $wBoxCod = $w*0.17; |
|
| 314 | + $wBoxCod = $w * 0.17; |
|
| 315 | 315 | $texto = "CÓDIGO"; |
| 316 | 316 | $this->pTextBox($x, $y, $wBoxCod, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 317 | - $wBoxDescricao = $w*0.43; |
|
| 317 | + $wBoxDescricao = $w * 0.43; |
|
| 318 | 318 | $xBoxDescricao = $wBoxCod + $x; |
| 319 | 319 | $texto = "DESCRICÃO"; |
| 320 | 320 | $this->pTextBox( |
@@ -330,19 +330,19 @@ discard block |
||
| 330 | 330 | '', |
| 331 | 331 | false |
| 332 | 332 | ); |
| 333 | - $wBoxQt = $w*0.08; |
|
| 333 | + $wBoxQt = $w * 0.08; |
|
| 334 | 334 | $xBoxQt = $wBoxDescricao + $xBoxDescricao; |
| 335 | 335 | $texto = "QT"; |
| 336 | 336 | $this->pTextBox($xBoxQt, $y, $wBoxQt, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 337 | - $wBoxUn = $w*0.06; |
|
| 337 | + $wBoxUn = $w * 0.06; |
|
| 338 | 338 | $xBoxUn = $wBoxQt + $xBoxQt; |
| 339 | 339 | $texto = "UN"; |
| 340 | 340 | $this->pTextBox($xBoxUn, $y, $wBoxUn, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 341 | - $wBoxVl = $w*0.13; |
|
| 341 | + $wBoxVl = $w * 0.13; |
|
| 342 | 342 | $xBoxVl = $wBoxUn + $xBoxUn; |
| 343 | 343 | $texto = "VALOR"; |
| 344 | 344 | $this->pTextBox($xBoxVl, $y, $wBoxVl, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 345 | - $wBoxTotal = $w*0.13; |
|
| 345 | + $wBoxTotal = $w * 0.13; |
|
| 346 | 346 | $xBoxTotal = $wBoxVl + $xBoxVl; |
| 347 | 347 | $texto = "TOTAL"; |
| 348 | 348 | $this->pTextBox($xBoxTotal, $y, $wBoxTotal, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
@@ -362,13 +362,13 @@ discard block |
||
| 362 | 362 | $vUnCom = number_format($this->pSimpleGetValue($prod, "vUnCom"), 2, ",", "."); |
| 363 | 363 | $vProd = number_format($this->pSimpleGetValue($prod, "vProd"), 2, ",", "."); |
| 364 | 364 | //COLOCA PRODUTO |
| 365 | - $yBoxProd = $y + $hLinha + ($cont*$hMaxLinha); |
|
| 365 | + $yBoxProd = $y + $hLinha + ($cont * $hMaxLinha); |
|
| 366 | 366 | //COLOCA PRODUTO CÓDIGO |
| 367 | - $wBoxCod = $w*0.17; |
|
| 367 | + $wBoxCod = $w * 0.17; |
|
| 368 | 368 | $texto = $cProd; |
| 369 | 369 | $this->pTextBox($x, $yBoxProd, $wBoxCod, $hMaxLinha, $texto, $aFontProdutos, 'C', 'C', 0, '', false); |
| 370 | 370 | //COLOCA PRODUTO DESCRIÇÃO |
| 371 | - $wBoxDescricao = $w*0.43; |
|
| 371 | + $wBoxDescricao = $w * 0.43; |
|
| 372 | 372 | $xBoxDescricao = $wBoxCod + $x; |
| 373 | 373 | $texto = $xProd; |
| 374 | 374 | $this->pTextBox( |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | false |
| 386 | 386 | ); |
| 387 | 387 | //COLOCA PRODUTO QUANTIDADE |
| 388 | - $wBoxQt = $w*0.08; |
|
| 388 | + $wBoxQt = $w * 0.08; |
|
| 389 | 389 | $xBoxQt = $wBoxDescricao + $xBoxDescricao; |
| 390 | 390 | $texto = $qCom; |
| 391 | 391 | $this->pTextBox( |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | false |
| 403 | 403 | ); |
| 404 | 404 | //COLOCA PRODUTO UNIDADE |
| 405 | - $wBoxUn = $w*0.06; |
|
| 405 | + $wBoxUn = $w * 0.06; |
|
| 406 | 406 | $xBoxUn = $wBoxQt + $xBoxQt; |
| 407 | 407 | $texto = $uCom; |
| 408 | 408 | $this->pTextBox( |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | false |
| 420 | 420 | ); |
| 421 | 421 | //COLOCA PRODUTO VL UNITÁRIO |
| 422 | - $wBoxVl = $w*0.13; |
|
| 422 | + $wBoxVl = $w * 0.13; |
|
| 423 | 423 | $xBoxVl = $wBoxUn + $xBoxUn; |
| 424 | 424 | $texto = $vUnCom; |
| 425 | 425 | $this->pTextBox( |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | false |
| 437 | 437 | ); |
| 438 | 438 | //COLOCA PRODUTO VL TOTAL |
| 439 | - $wBoxTotal = $w*0.13; |
|
| 439 | + $wBoxTotal = $w * 0.13; |
|
| 440 | 440 | $xBoxTotal = $wBoxVl + $xBoxVl; |
| 441 | 441 | $texto = $vProd; |
| 442 | 442 | $this->pTextBox( |
@@ -463,13 +463,13 @@ discard block |
||
| 463 | 463 | $margemInterna = $this->margemInterna; |
| 464 | 464 | $maxW = $this->wPrint; |
| 465 | 465 | $hLinha = 3; |
| 466 | - $wColEsq = ($maxW*0.7); |
|
| 467 | - $wColDir = ($maxW*0.3); |
|
| 466 | + $wColEsq = ($maxW * 0.7); |
|
| 467 | + $wColDir = ($maxW * 0.3); |
|
| 468 | 468 | $xValor = $x + $wColEsq; |
| 469 | 469 | $qtdItens = $this->det->length; |
| 470 | 470 | $vProd = $this->pSimpleGetValue($this->ICMSTot, "vProd"); |
| 471 | 471 | $vNF = $this->pSimpleGetValue($this->ICMSTot, "vNF"); |
| 472 | - $vDesc = $this->pSimpleGetValue($this->ICMSTot, "vDesc"); |
|
| 472 | + $vDesc = $this->pSimpleGetValue($this->ICMSTot, "vDesc"); |
|
| 473 | 473 | $texto = "Qtd. Total de Itens"; |
| 474 | 474 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 475 | 475 | $this->pTextBox($x, $y, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
@@ -483,21 +483,21 @@ discard block |
||
| 483 | 483 | $texto = "R$ " . number_format($vProd, 2, ",", "."); |
| 484 | 484 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 485 | 485 | $this->pTextBox($xValor, $yTotal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 486 | - $yDesconto = $y + ($hLinha*2); |
|
| 486 | + $yDesconto = $y + ($hLinha * 2); |
|
| 487 | 487 | $texto = "Descontos"; |
| 488 | 488 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 489 | 489 | $this->pTextBox($x, $yDesconto, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 490 | 490 | $texto = "R$ " . $vDesc; |
| 491 | 491 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 492 | 492 | $this->pTextBox($xValor, $yDesconto, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 493 | - $yTotalFinal = $y + ($hLinha*3); |
|
| 493 | + $yTotalFinal = $y + ($hLinha * 3); |
|
| 494 | 494 | $texto = "Total"; |
| 495 | 495 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 496 | 496 | $this->pTextBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 497 | 497 | $texto = "R$ " . $vNF; |
| 498 | 498 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 499 | 499 | $this->pTextBox($xValor, $yTotalFinal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 500 | - $yTotalFinal = $y + ($hLinha*4); |
|
| 500 | + $yTotalFinal = $y + ($hLinha * 4); |
|
| 501 | 501 | $texto = "Informação dos Tributos Totais Incidentes"; |
| 502 | 502 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
| 503 | 503 | $this->pTextBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
@@ -512,16 +512,16 @@ discard block |
||
| 512 | 512 | $margemInterna = $this->margemInterna; |
| 513 | 513 | $maxW = $this->wPrint; |
| 514 | 514 | $qtdPgto = $this->pag->length; |
| 515 | - $w = ($maxW*1); |
|
| 515 | + $w = ($maxW * 1); |
|
| 516 | 516 | $hLinha = $this->hLinha; |
| 517 | - $wColEsq = ($maxW*0.7); |
|
| 518 | - $wColDir = ($maxW*0.3); |
|
| 517 | + $wColEsq = ($maxW * 0.7); |
|
| 518 | + $wColDir = ($maxW * 0.3); |
|
| 519 | 519 | $xValor = $x + $wColEsq; |
| 520 | 520 | $aFontPgto = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 521 | - $wBoxEsq = $w*0.7; |
|
| 521 | + $wBoxEsq = $w * 0.7; |
|
| 522 | 522 | $texto = "FORMA DE PAGAMENTO"; |
| 523 | 523 | $this->pTextBox($x, $y, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false); |
| 524 | - $wBoxDir = $w*0.3; |
|
| 524 | + $wBoxDir = $w * 0.3; |
|
| 525 | 525 | $xBoxDescricao = $x + $wBoxEsq; |
| 526 | 526 | $texto = "VALOR PAGO"; |
| 527 | 527 | $this->pTextBox($xBoxDescricao, $y, $wBoxDir, $hLinha, $texto, $aFontPgto, 'T', 'R', 0, '', false); |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | $tBandNome = self::getCardName($tBand); |
| 544 | 544 | } |
| 545 | 545 | //COLOCA PRODUTO |
| 546 | - $yBoxProd = $y + $hLinha + ($cont*$hLinha); |
|
| 546 | + $yBoxProd = $y + $hLinha + ($cont * $hLinha); |
|
| 547 | 547 | //COLOCA PRODUTO CÓDIGO |
| 548 | 548 | $texto = $tPagNome; |
| 549 | 549 | $this->pTextBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | $y += 4; |
| 574 | 574 | $margemInterna = $this->margemInterna; |
| 575 | 575 | $maxW = $this->wPrint; |
| 576 | - $w = ($maxW*1); |
|
| 576 | + $w = ($maxW * 1); |
|
| 577 | 577 | $hLinha = $this->hLinha; |
| 578 | 578 | $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
| 579 | 579 | $aFontTex = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
@@ -587,18 +587,18 @@ discard block |
||
| 587 | 587 | $urlChave = $this->urlConsulta[$tpAmb][$cUF]['chave']; |
| 588 | 588 | $texto = "ÁREA DE MENSAGEM FISCAL"; |
| 589 | 589 | $this->pTextBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 590 | - $yTex1 = $y + ($hLinha*1); |
|
| 591 | - $hTex1 = $hLinha*2; |
|
| 592 | - $texto = "Número " . $nNF . " Série " . $serieNF . " " .$dhEmi . " - Via Consumidor"; |
|
| 590 | + $yTex1 = $y + ($hLinha * 1); |
|
| 591 | + $hTex1 = $hLinha * 2; |
|
| 592 | + $texto = "Número " . $nNF . " Série " . $serieNF . " " . $dhEmi . " - Via Consumidor"; |
|
| 593 | 593 | $this->pTextBox($x, $yTex1, $w, $hTex1, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 594 | - $yTex2 = $y + ($hLinha*3); |
|
| 595 | - $hTex2 = $hLinha*2; |
|
| 594 | + $yTex2 = $y + ($hLinha * 3); |
|
| 595 | + $hTex2 = $hLinha * 2; |
|
| 596 | 596 | $texto = "Consulte pela Chave de Acesso em " . $urlChave; |
| 597 | 597 | $this->pTextBox($x, $yTex2, $w, $hTex2, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 598 | 598 | $texto = "CHAVE DE ACESSO"; |
| 599 | - $yTit2 = $y + ($hLinha*5); |
|
| 599 | + $yTit2 = $y + ($hLinha * 5); |
|
| 600 | 600 | $this->pTextBox($x, $yTit2, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 601 | - $yTex3 = $y + ($hLinha*6); |
|
| 601 | + $yTex3 = $y + ($hLinha * 6); |
|
| 602 | 602 | $texto = $chNFe; |
| 603 | 603 | $this->pTextBox($x, $yTex3, $w, $hLinha, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 604 | 604 | } |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | $y += 4; |
| 609 | 609 | $margemInterna = $this->margemInterna; |
| 610 | 610 | $maxW = $this->wPrint; |
| 611 | - $w = ($maxW*1); |
|
| 611 | + $w = ($maxW * 1); |
|
| 612 | 612 | $hLinha = $this->hLinha; |
| 613 | 613 | $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
| 614 | 614 | $aFontTex = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | $consCNPJ = !empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
| 625 | 625 | ? $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue |
| 626 | 626 | : ''; |
| 627 | - $cDest = $consCPF.$consCNPJ.$considEstrangeiro; //documentos do consumidor |
|
| 627 | + $cDest = $consCPF . $consCNPJ . $considEstrangeiro; //documentos do consumidor |
|
| 628 | 628 | $enderDest = $this->dest->getElementsByTagName("enderDest")->item(0); |
| 629 | 629 | $consNome = $this->pSimpleGetValue($this->dest, "xNome"); |
| 630 | 630 | $consLgr = $this->pSimpleGetValue($enderDest, "xLgr"); |
@@ -664,8 +664,8 @@ discard block |
||
| 664 | 664 | $yTex1 = $y + $hLinha; |
| 665 | 665 | $texto = $consNome; |
| 666 | 666 | if (!empty($consDoc)) { |
| 667 | - $texto .= " - ". $consDoc . "\n" . $consEnd; |
|
| 668 | - $this->pTextBox($x, $yTex1, $w, $hLinha*3, $texto, $aFontTex, 'C', 'C', 0, '', false); |
|
| 667 | + $texto .= " - " . $consDoc . "\n" . $consEnd; |
|
| 668 | + $this->pTextBox($x, $yTex1, $w, $hLinha * 3, $texto, $aFontTex, 'C', 'C', 0, '', false); |
|
| 669 | 669 | } |
| 670 | 670 | } else { |
| 671 | 671 | $yTex1 = $y + $hLinha; |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | $y += 4; |
| 680 | 680 | $margemInterna = $this->margemInterna; |
| 681 | 681 | $maxW = $this->wPrint; |
| 682 | - $w = ($maxW*1); |
|
| 682 | + $w = ($maxW * 1); |
|
| 683 | 683 | $hLinha = $this->hLinha; |
| 684 | 684 | $hBoxLinha = $this->hBoxLinha; |
| 685 | 685 | $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
@@ -688,19 +688,19 @@ discard block |
||
| 688 | 688 | $nProt = ''; |
| 689 | 689 | if (isset($this->nfeProc)) { |
| 690 | 690 | $nProt = $this->pSimpleGetValue($this->nfeProc, "nProt"); |
| 691 | - $dhRecbto = $this->pSimpleGetValue($this->nfeProc, "dhRecbto"); |
|
| 691 | + $dhRecbto = $this->pSimpleGetValue($this->nfeProc, "dhRecbto"); |
|
| 692 | 692 | } |
| 693 | 693 | $qrcode = new QRcode($this->qrCode, 'M'); |
| 694 | 694 | $wQr = 50; |
| 695 | 695 | $hQr = 50; |
| 696 | - $yQr = ($y+$margemInterna); |
|
| 697 | - $xQr = ($w/2) - ($wQr/2); |
|
| 696 | + $yQr = ($y + $margemInterna); |
|
| 697 | + $xQr = ($w / 2) - ($wQr / 2); |
|
| 698 | 698 | // prepare a base64 encoded "data url" |
| 699 | 699 | $pic = 'data://text/plain;base64,' . base64_encode($qrcode->writeString()); |
| 700 | 700 | $info = getimagesize($pic); |
| 701 | 701 | $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG'); |
| 702 | 702 | $dt = new DateTime($dhRecbto); |
| 703 | - $yQr = ($yQr+$hQr+$margemInterna); |
|
| 703 | + $yQr = ($yQr + $hQr + $margemInterna); |
|
| 704 | 704 | $this->pTextBox($x, $yQr, $w, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n" |
| 705 | 705 | . $dt->format('d/m/Y H:i:s'), $aFontTex, 'C', 'C', 0, '', false); |
| 706 | 706 | } |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | $bin = ""; |
| 825 | 825 | $iCount = 0; |
| 826 | 826 | do { |
| 827 | - $bin .= chr(hexdec($str{$iCount}.$str{($iCount + 1)})); |
|
| 827 | + $bin .= chr(hexdec($str{$iCount} . $str{($iCount + 1)})); |
|
| 828 | 828 | $iCount += 2; |
| 829 | 829 | } while ($iCount < strlen($str)); |
| 830 | 830 | return $bin; |
@@ -858,12 +858,12 @@ discard block |
||
| 858 | 858 | $seq .= '&digVal=' . strtolower($digHex); |
| 859 | 859 | $seq .= '&cIdToken=' . $idToken; |
| 860 | 860 | //o hash code é calculado com o Token incluso |
| 861 | - $hash = sha1($seq.$token); |
|
| 862 | - $seq .= '&cHashQRCode='. strtoupper($hash); |
|
| 861 | + $hash = sha1($seq . $token); |
|
| 862 | + $seq .= '&cHashQRCode=' . strtoupper($hash); |
|
| 863 | 863 | if (strpos($url, '?') === false) { |
| 864 | - $seq = $url.'?'.$seq; |
|
| 864 | + $seq = $url . '?' . $seq; |
|
| 865 | 865 | } else { |
| 866 | - $seq = $url.''.$seq; |
|
| 866 | + $seq = $url . '' . $seq; |
|
| 867 | 867 | } |
| 868 | 868 | return $seq; |
| 869 | 869 | } |