Complex classes like Damdfe often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Damdfe, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 22 | class Damdfe extends Common |
||
| 23 | { |
||
| 24 | //publicas |
||
| 25 | public $logoAlign='L'; //alinhamento do logo |
||
| 26 | public $yDados=0; |
||
| 27 | public $debugMode=0; //ativa ou desativa o modo de debug |
||
| 28 | //privadas |
||
| 29 | protected $pdf; // objeto fpdf() |
||
| 30 | protected $xml; // string XML NFe |
||
| 31 | protected $logomarca=''; // path para logomarca em jpg |
||
| 32 | protected $errMsg=''; // mesagens de erro |
||
| 33 | protected $errStatus=false;// status de erro TRUE um erro ocorreu false sem erros |
||
| 34 | protected $orientacao='P'; //orientação da DANFE P-Retrato ou L-Paisagem |
||
| 35 | protected $papel='A4'; //formato do papel |
||
| 36 | //destivo do arquivo pdf I-borwser, S-retorna o arquivo, D-força download, F-salva em arquivo local |
||
| 37 | protected $destino = 'I'; |
||
| 38 | protected $pdfDir=''; //diretorio para salvar o pdf com a opção de destino = F |
||
| 39 | protected $fontePadrao='Times'; //Nome da Fonte para gerar o DANFE |
||
| 40 | protected $version = '1.0.0'; |
||
| 41 | protected $wPrint; //largura imprimivel |
||
| 42 | protected $hPrint; //comprimento imprimivel |
||
| 43 | protected $formatoChave="#### #### #### #### #### #### #### #### #### #### ####"; |
||
| 44 | //variaveis da carta de correção |
||
| 45 | protected $id; |
||
| 46 | protected $chMDFe; |
||
| 47 | protected $tpAmb; |
||
| 48 | protected $cOrgao; |
||
| 49 | protected $xCondUso; |
||
| 50 | protected $dhEvento; |
||
| 51 | protected $cStat; |
||
| 52 | protected $xMotivo; |
||
| 53 | protected $CNPJDest = ''; |
||
| 54 | protected $dhRegEvento; |
||
| 55 | protected $nProt; |
||
| 56 | protected $tpEmis; |
||
| 57 | //objetos |
||
| 58 | private $dom; |
||
| 59 | private $procEventoNFe; |
||
|
|
|||
| 60 | private $evento; |
||
| 61 | private $infEvento; |
||
| 62 | private $retEvento; |
||
| 63 | private $rinfEvento; |
||
| 64 | /** |
||
| 65 | * __construct |
||
| 66 | * |
||
| 67 | * @param string $xmlfile Arquivo XML da MDFe |
||
| 68 | * @param string $sOrientacao (Opcional) Orientação da impressão P-retrato L-Paisagem |
||
| 69 | * @param string $sPapel Tamanho do papel (Ex. A4) |
||
| 70 | * @param string $sPathLogo Caminho para o arquivo do logo |
||
| 71 | * @param string $sDestino Estabelece a direção do envio do documento PDF I-browser D-browser com download S- |
||
| 72 | * @param string $sDirPDF Caminho para o diretorio de armazenamento dos arquivos PDF |
||
| 73 | * @param string $fonteDAMDFE Nome da fonte alternativa do DAnfe |
||
| 74 | * @param integer $mododebug 0-Não 1-Sim e 2-nada (2 default) |
||
| 75 | */ |
||
| 76 | 1 | public function __construct( |
|
| 199 | /** |
||
| 200 | *buildMDFe |
||
| 201 | * |
||
| 202 | */ |
||
| 203 | 1 | public function buildMDFe() |
|
| 262 | /** |
||
| 263 | * headerMDFePaisagem |
||
| 264 | * @param float $x |
||
| 265 | * @param float $y |
||
| 266 | * @param integer $pag |
||
| 267 | * @return string |
||
| 268 | */ |
||
| 269 | private function headerMDFePaisagem($x, $y, $pag) |
||
| 270 | { |
||
| 271 | $oldX = $x; |
||
| 272 | $oldY = $y; |
||
| 273 | $maxW = $this->wPrint; |
||
| 274 | //#################################################################################### |
||
| 275 | //coluna esquerda identificação do emitente |
||
| 276 | $w = $maxW; //round($maxW*0.41, 0);// 80; |
||
| 277 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
||
| 278 | $w1 = $w; |
||
| 279 | $h=30; |
||
| 280 | $oldY += $h; |
||
| 281 | $this->pTextBox($x, $y, $w, $h); |
||
| 282 | if (is_file($this->logomarca)) { |
||
| 283 | $logoInfo = getimagesize($this->logomarca); |
||
| 284 | //largura da imagem em mm |
||
| 285 | $logoWmm = ($logoInfo[0]/72)*25.4; |
||
| 286 | //altura da imagem em mm |
||
| 287 | $logoHmm = ($logoInfo[1]/72)*25.4; |
||
| 288 | if ($this->logoAlign=='L') { |
||
| 289 | $nImgW = round($w/4.5, 0); |
||
| 290 | $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
||
| 291 | $xImg = $x+1; |
||
| 292 | $yImg = round(($h-$nImgH)/2, 0)+$y; |
||
| 293 | //estabelecer posições do texto |
||
| 294 | $x1 = round($xImg + $nImgW +1, 0); |
||
| 295 | $y1 = round($y+2, 0); |
||
| 296 | $tw = round(2*$w/3, 0); |
||
| 297 | } |
||
| 298 | if ($this->logoAlign=='C') { |
||
| 299 | $nImgH = round($h/3, 0); |
||
| 300 | $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
||
| 301 | $xImg = round(($w-$nImgW)/2+$x, 0); |
||
| 302 | $yImg = $y+3; |
||
| 303 | $x1 = $x; |
||
| 304 | $y1 = round($yImg + $nImgH + 1, 0); |
||
| 305 | $tw = $w; |
||
| 306 | } |
||
| 307 | if ($this->logoAlign=='R') { |
||
| 308 | $nImgW = round($w/3, 0); |
||
| 309 | $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
||
| 310 | $xImg = round($x+($w-(1+$nImgW)), 0); |
||
| 311 | $yImg = round(($h-$nImgH)/2, 0)+$y; |
||
| 312 | $x1 = $x; |
||
| 313 | $y1 = round($h/3+$y, 0); |
||
| 314 | $tw = round(2*$w/3, 0); |
||
| 315 | } |
||
| 316 | $this->pdf->Image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, 'jpeg'); |
||
| 317 | } else { |
||
| 318 | $x1 = $x; |
||
| 319 | $y1 = round($h/3+$y, 0); |
||
| 320 | $tw = $w; |
||
| 321 | } |
||
| 322 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
||
| 323 | $razao = $this->xNome; |
||
| 324 | $cnpj = 'CNPJ: '.$this->pFormat($this->CNPJ, "###.###.###/####-##"); |
||
| 325 | $ie = 'IE: '.$this->pFormat($this->IE, '##/########'); |
||
| 326 | $lgr = 'Logradouro: '.$this->xLgr; |
||
| 327 | $nro = 'Nº: '.$this->nro; |
||
| 328 | $bairro = 'Bairro: '.$this->xBairro; |
||
| 329 | $CEP = $this->CEP; |
||
| 330 | $CEP = 'CEP: '.$this->pFormat($CEP, "##.###-###"); |
||
| 331 | $UF = 'UF: '.$this->UF; |
||
| 332 | $mun = 'Municipio: '.$this->xMun; |
||
| 333 | |||
| 334 | $texto = $razao . "\n" . $cnpj . ' - ' . $ie . "\n"; |
||
| 335 | $texto .= $lgr . ' - ' . $nro . "\n"; |
||
| 336 | $texto .= $bairro . "\n"; |
||
| 337 | $texto .= $UF . ' - ' . $mun . ' - ' . $CEP; |
||
| 338 | $this->pTextBox($x1, $y1+5, $tw, 8, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 339 | $x = $x+$maxW/2; |
||
| 340 | $w = $maxW / 2; |
||
| 341 | $this->pTextBox($x, $y, $w, $h); |
||
| 342 | $aFont = array('font'=>$this->fontePadrao, 'size'=>12, 'style'=>'I'); |
||
| 343 | $this->pTextBox( |
||
| 344 | $x, |
||
| 345 | $y, |
||
| 346 | $w, |
||
| 347 | 8, |
||
| 348 | 'DAMDFE - Documento Auxiliar de Manifesto Eletronico de Documentos Fiscais', |
||
| 349 | $aFont, |
||
| 350 | 'T', |
||
| 351 | 'C', |
||
| 352 | 0, |
||
| 353 | '' |
||
| 354 | ); |
||
| 355 | $this->pTextBox($x, $y, $w, 6); |
||
| 356 | $bH = 13; |
||
| 357 | $bW = round(($w), 0); |
||
| 358 | $this->pdf->SetFillColor(0, 0, 0); |
||
| 359 | $this->pdf->Code128($x+5, $y+7.5, $this->chMDFe, $bW-10, $bH); |
||
| 360 | $this->pdf->SetFillColor(255, 255, 255); |
||
| 361 | $y = $y + 22; |
||
| 362 | $this->pTextBox($x, $y, $w, 8); |
||
| 363 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'I'); |
||
| 364 | $tsHora = $this->pConvertTime($this->dhEvento); |
||
| 365 | $texto = 'CHAVE DE ACESSO'; |
||
| 366 | $this->pTextBox($x, $y, $maxW, 6, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 367 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>''); |
||
| 368 | $texto = $this->pFormat($this->chMDFe, $this->formatoChave); |
||
| 369 | $this->pTextBox($x, $y+3, $w, 6, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 370 | $y = $y + 11; |
||
| 371 | $this->pTextBox($x, $y, $w, 12); |
||
| 372 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'I'); |
||
| 373 | $texto = 'PROTOCOLO DE AUTORIZACAO DE USO'; |
||
| 374 | $this->pTextBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 375 | |||
| 376 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>''); |
||
| 377 | if (is_object($this->mdfeProc)) { |
||
| 378 | $tsHora = $this->pConvertTime($this->dhRecbto); |
||
| 379 | $texto = $this->nProt.' - '.date('d/m/Y H:i:s', $tsHora); |
||
| 380 | } else { |
||
| 381 | $texto = 'DAMDFE impresso em contingência - '.date('d/m/Y H:i:s'); |
||
| 382 | } |
||
| 383 | $this->pTextBox($x, $y+4, $w, 8, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 384 | if ($this->tpAmb != 1) { |
||
| 385 | $x = 10; |
||
| 386 | if ($this->orientacao == 'P') { |
||
| 387 | $yy = round($this->hPrint*2/3, 0); |
||
| 388 | } else { |
||
| 389 | $yy = round($this->hPrint/2, 0); |
||
| 390 | } |
||
| 391 | $h = 5; |
||
| 392 | $w = $maxW-(2*$x); |
||
| 393 | $this->pdf->SetTextColor(90, 90, 90); |
||
| 394 | $texto = "SEM VALOR FISCAL"; |
||
| 395 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
||
| 396 | $this->pTextBox($x, $yy, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 397 | $aFont = array('font'=>$this->fontePadrao, 'size'=>30, 'style'=>'B'); |
||
| 398 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
||
| 399 | $this->pTextBox($x, $yy+14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 400 | $this->pdf->SetTextColor(0, 0, 0); |
||
| 401 | } else { |
||
| 402 | $x = 10; |
||
| 403 | if ($this->orientacao == 'P') { |
||
| 404 | $yy = round($this->hPrint*2/3, 0); |
||
| 405 | } else { |
||
| 406 | $yy = round($this->hPrint/2, 0); |
||
| 407 | }//fim orientacao |
||
| 408 | $h = 5; |
||
| 409 | $w = $maxW-(2*$x); |
||
| 410 | $this->pdf->SetTextColor(90, 90, 90); |
||
| 411 | //indicar FALTA DO PROTOCOLO se MDFe não for em contingência |
||
| 412 | if (($this->tpEmis == 2 || $this->tpEmis == 5)) { |
||
| 413 | //Contingência |
||
| 414 | $texto = "DAMDFE Emitido em Contingência"; |
||
| 415 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
||
| 416 | $this->pTextBox($x, $yy, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 417 | $aFont = array('font'=>$this->fontePadrao, 'size'=>30, 'style'=>'B'); |
||
| 418 | $texto = "devido à problemas técnicos"; |
||
| 419 | $this->pTextBox($x, $yy+12, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 420 | } |
||
| 421 | $this->pdf->SetTextColor(0, 0, 0); |
||
| 422 | } |
||
| 423 | return $y; |
||
| 424 | }// fim headerMDFe |
||
| 425 | |||
| 426 | /** |
||
| 427 | * headerMDFeRetrato |
||
| 428 | * |
||
| 429 | * @param float $x |
||
| 430 | * @param float $y |
||
| 431 | * @param integer $pag |
||
| 432 | * @return string |
||
| 433 | */ |
||
| 434 | 1 | private function headerMDFeRetrato($x, $y, $pag) |
|
| 435 | { |
||
| 436 | 1 | $oldX = $x; |
|
| 437 | 1 | $oldY = $y; |
|
| 438 | 1 | $maxW = $this->wPrint; |
|
| 439 | //#################################################################################### |
||
| 440 | //coluna esquerda identificação do emitente |
||
| 441 | 1 | $w = $maxW; //round($maxW*0.41, 0);// 80; |
|
| 442 | 1 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'); |
|
| 443 | 1 | $w1 = $w; |
|
| 444 | 1 | $h=20; |
|
| 445 | 1 | $oldY += $h; |
|
| 446 | 1 | $this->pTextBox($x, $y, $w, $h); |
|
| 447 | 1 | if (is_file($this->logomarca)) { |
|
| 448 | $logoInfo = getimagesize($this->logomarca); |
||
| 449 | //largura da imagem em mm |
||
| 450 | $logoWmm = ($logoInfo[0]/72)*25.4; |
||
| 451 | //altura da imagem em mm |
||
| 452 | $logoHmm = ($logoInfo[1]/72)*25.4; |
||
| 453 | if ($this->logoAlign=='L') { |
||
| 454 | $nImgW = round($w/8, 0); |
||
| 455 | $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
||
| 456 | $xImg = $x+1; |
||
| 457 | $yImg = round(($h-$nImgH)/2, 0)+$y; |
||
| 458 | //estabelecer posições do texto |
||
| 459 | $x1 = round($xImg + $nImgW +1, 0); |
||
| 460 | $y1 = round($y+2, 0); |
||
| 461 | $tw = round(2*$w/3, 0); |
||
| 462 | } |
||
| 463 | if ($this->logoAlign=='C') { |
||
| 464 | $nImgH = round($h/3, 0); |
||
| 465 | $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
||
| 466 | $xImg = round(($w-$nImgW)/2+$x, 0); |
||
| 467 | $yImg = $y+3; |
||
| 468 | $x1 = $x; |
||
| 469 | $y1 = round($yImg + $nImgH + 1, 0); |
||
| 470 | $tw = $w; |
||
| 471 | } |
||
| 472 | if ($this->logoAlign=='R') { |
||
| 473 | $nImgW = round($w/3, 0); |
||
| 474 | $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
||
| 475 | $xImg = round($x+($w-(1+$nImgW)), 0); |
||
| 476 | $yImg = round(($h-$nImgH)/2, 0)+$y; |
||
| 477 | $x1 = $x; |
||
| 478 | $y1 = round($h/3+$y, 0); |
||
| 479 | $tw = round(2*$w/3, 0); |
||
| 480 | } |
||
| 481 | $this->pdf->Image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, 'jpeg'); |
||
| 482 | } else { |
||
| 483 | 1 | $x1 = $x+40; |
|
| 484 | 1 | $y1 = $y; |
|
| 485 | 1 | $tw = $w; |
|
| 486 | } |
||
| 487 | 1 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
|
| 488 | 1 | $razao = $this->xNome; |
|
| 489 | 1 | $cnpj = 'CNPJ: '.$this->pFormat($this->CNPJ, "###.###.###/####-##"); |
|
| 490 | 1 | $ie = 'IE: '.$this->pFormat($this->IE, '###/#######'); |
|
| 491 | 1 | $lgr = 'Logradouro: '.$this->xLgr; |
|
| 492 | 1 | $nro = 'Nº: '.$this->nro; |
|
| 493 | 1 | $bairro = 'Bairro: '.$this->xBairro; |
|
| 494 | 1 | $CEP = $this->CEP; |
|
| 495 | 1 | $CEP = 'CEP: '.$this->pFormat($CEP, "##.###-###"); |
|
| 496 | 1 | $mun = 'Municipio: '.$this->xMun; |
|
| 497 | 1 | $UF = 'UF: '.$this->UF; |
|
| 498 | 1 | $texto = $razao . "\n" . $cnpj . ' - ' . $ie . "\n"; |
|
| 499 | 1 | $texto .= $lgr . ' - ' . $nro . "\n"; |
|
| 500 | 1 | $texto .= $bairro . "\n"; |
|
| 501 | 1 | $texto .= $UF . ' - ' . $mun . ' - ' . $CEP; |
|
| 502 | 1 | $this->pTextBox($x1, $y1, $tw, 8, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 503 | //################################################## |
||
| 504 | 1 | $y = $h + 8; |
|
| 505 | 1 | $this->pTextBox($x, $y, $maxW, 6); |
|
| 506 | 1 | $aFont = array('font'=>$this->fontePadrao, 'size'=>12, 'style'=>'I'); |
|
| 507 | 1 | $this->pTextBox( |
|
| 508 | 1 | $x, |
|
| 509 | 1 | $y, |
|
| 510 | 1 | $maxW, |
|
| 511 | 1 | 8, |
|
| 512 | 1 | 'DAMDFE - Documento Auxiliar de Manifesto Eletronico de Documentos Fiscais', |
|
| 513 | 1 | $aFont, |
|
| 514 | 1 | 'T', |
|
| 515 | 1 | 'C', |
|
| 516 | 1 | 0, |
|
| 517 | 1 | '' |
|
| 518 | ); |
||
| 519 | 1 | $y = $y + 8; |
|
| 520 | 1 | $this->pTextBox($x, $y, $maxW, 20); |
|
| 521 | 1 | $bH = 16; |
|
| 522 | 1 | $w = $maxW; |
|
| 523 | 1 | $this->pdf->SetFillColor(0, 0, 0); |
|
| 524 | 1 | $this->pdf->Code128($x + 5, $y+2, $this->chMDFe, $maxW - 10, $bH); |
|
| 525 | 1 | $this->pdf->SetFillColor(255, 255, 255); |
|
| 526 | 1 | $y = $y + 22; |
|
| 527 | 1 | $this->pTextBox($x, $y, $maxW, 10); |
|
| 528 | 1 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'I'); |
|
| 529 | 1 | $tsHora = $this->pConvertTime($this->dhEvento); |
|
| 530 | 1 | $texto = 'CHAVE DE ACESSO'; |
|
| 531 | 1 | $this->pTextBox($x, $y, $maxW, 6, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 532 | 1 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>''); |
|
| 533 | 1 | $texto = $this->pFormat($this->chMDFe, $this->formatoChave); |
|
| 534 | 1 | $this->pTextBox($x, $y+4, $maxW, 6, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 535 | 1 | $y = $y + 12; |
|
| 536 | 1 | $this->pTextBox($x, $y, $maxW, 10); |
|
| 537 | 1 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'I'); |
|
| 538 | 1 | $texto = 'PROTOCOLO DE AUTORIZACAO DE USO'; |
|
| 539 | 1 | $this->pTextBox($x, $y, $maxW, 8, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 540 | 1 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>''); |
|
| 541 | 1 | if (is_object($this->mdfeProc)) { |
|
| 542 | 1 | $tsHora = $this->pConvertTime($this->dhRecbto); |
|
| 543 | 1 | $texto = $this->nProt.' - '.date('d/m/Y H:i:s', $tsHora); |
|
| 544 | } else { |
||
| 545 | $texto = 'DAMDFE impresso em contingência - '.date('d/m/Y H:i:s'); |
||
| 546 | } |
||
| 547 | 1 | $this->pTextBox($x, $y+4, $maxW, 8, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 548 | 1 | if ($this->tpAmb != 1) { |
|
| 549 | 1 | $x = 10; |
|
| 550 | 1 | if ($this->orientacao == 'P') { |
|
| 551 | 1 | $yy = round($this->hPrint*2/3, 0); |
|
| 552 | } else { |
||
| 553 | $yy = round($this->hPrint/2, 0); |
||
| 554 | } |
||
| 555 | 1 | $h = 5; |
|
| 556 | 1 | $w = $maxW-(2*$x); |
|
| 557 | 1 | $this->pdf->SetTextColor(90, 90, 90); |
|
| 558 | 1 | $texto = "SEM VALOR FISCAL"; |
|
| 559 | 1 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
|
| 560 | 1 | $this->pTextBox($x, $yy, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 561 | 1 | $aFont = array('font'=>$this->fontePadrao, 'size'=>30, 'style'=>'B'); |
|
| 562 | 1 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
|
| 563 | 1 | $this->pTextBox($x, $yy+14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 564 | 1 | $this->pdf->SetTextColor(0, 0, 0); |
|
| 565 | } else { |
||
| 566 | $x = 10; |
||
| 567 | if ($this->orientacao == 'P') { |
||
| 568 | $yy = round($this->hPrint*2/3, 0); |
||
| 569 | } else { |
||
| 570 | $yy = round($this->hPrint/2, 0); |
||
| 571 | }//fim orientacao |
||
| 572 | $h = 5; |
||
| 573 | $w = $maxW-(2*$x); |
||
| 574 | $this->pdf->SetTextColor(90, 90, 90); |
||
| 575 | //indicar FALTA DO PROTOCOLO se MDFe não for em contingência |
||
| 576 | if (($this->tpEmis == 2 || $this->tpEmis == 5)) { |
||
| 577 | //Contingência |
||
| 578 | $texto = "DAMDFE Emitido em Contingência"; |
||
| 579 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
||
| 580 | $this->pTextBox($x, $yy, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 581 | $aFont = array('font'=>$this->fontePadrao, 'size'=>30, 'style'=>'B'); |
||
| 582 | $texto = "devido à problemas técnicos"; |
||
| 583 | $this->pTextBox($x, $yy+12, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 584 | } |
||
| 585 | $this->pdf->SetTextColor(0, 0, 0); |
||
| 586 | } |
||
| 587 | 1 | return $y+12; |
|
| 588 | }// fim headerMDFe |
||
| 589 | |||
| 590 | /** |
||
| 591 | * bodyMDFe |
||
| 592 | * |
||
| 593 | * @param float $x |
||
| 594 | * @param float $y |
||
| 595 | * @return void |
||
| 596 | */ |
||
| 597 | 1 | private function bodyMDFe($x, $y) |
|
| 843 | /** |
||
| 844 | * footerMDFe |
||
| 845 | * |
||
| 846 | * @param float $x |
||
| 847 | * @param float $y |
||
| 848 | */ |
||
| 849 | 1 | private function footerMDFe($x, $y) |
|
| 864 | /** |
||
| 865 | * printMDFe |
||
| 866 | * |
||
| 867 | * @param string $nome |
||
| 868 | * @param string $destino |
||
| 869 | * @param string $printer |
||
| 870 | * @return string |
||
| 871 | */ |
||
| 872 | 1 | public function printMDFe($nome = '', $destino = 'I', $printer = '') |
|
| 898 | |||
| 899 | /** |
||
| 900 | * Dados brutos do PDF |
||
| 901 | * @return string |
||
| 902 | */ |
||
| 903 | public function render() |
||
| 907 | } |
||
| 908 |
This check marks private properties in classes that are never used. Those properties can be removed.