Skip to content

Commit

Permalink
Merge pull request #18 from arquivei/feature/BONDERS-1766
Browse files Browse the repository at this point in the history
Ajusta o código para pegar o status da nota e adicionar a marca d'agua se a nota for cancelada ou denegada
kairo-arquivei authored Nov 17, 2021
2 parents 0cee159 + 043615c commit 6edf7a2
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions src/NFe/Danfe.php
Original file line number Diff line number Diff line change
@@ -278,6 +278,8 @@ class Danfe extends Common

protected $textadicfontsize;

protected $status = '';

/**
* __construct
*
@@ -290,6 +292,17 @@ public function __construct($xml)
$this->loadDoc($xml);
}

private function getStatus(): string
{
return $this->status;
}

public function setStatus(string $status): string
{
return $this->status = $status;
}


/**
* Ativa ou desativa o modo debug
* @param bool $activate
@@ -1278,19 +1291,18 @@ protected function header($x = 0, $y = 0, $pag = '1', $totPag = '1')
$this->pdf->settextcolor(0, 0, 0);
}

/*
if ($this->pNotaCancelada()) {
if ($this->getStatus() == 'canceled') {
//101 Cancelamento
$x = 10;
$y = $this->hPrint-130;
$h = 25;
$w = $maxW-(2*$x);
$this->pdf->SetTextColor(90, 90, 90);
$texto = "NFe CANCELADA";
$texto = "NF-e CANCELADA";
$aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
$this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
$this->pdf->SetTextColor(0, 0, 0);
}*/
}

if ($this->notaDpec() || $this->tpEmis == 4) {
//DPEC
@@ -1306,15 +1318,15 @@ protected function header($x = 0, $y = 0, $pag = '1', $totPag = '1')
$this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
$this->pdf->SetTextColor(0, 0, 0);
}
/*
if ($this->pNotaDenegada()) {

if ($this->getStatus() == 'denied') {
//110 301 302 Denegada
$x = 10;
$y = $this->hPrint-130;
$h = 25;
$w = $maxW-(2*$x);
$this->pdf->SetTextColor(90, 90, 90);
$texto = "NFe USO DENEGADO";
$texto = "NF-e USO DENEGADO";
$aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
$this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
$y += $h;
@@ -1330,8 +1342,7 @@ protected function header($x = 0, $y = 0, $pag = '1', $totPag = '1')
$this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
$this->pdf->SetTextColor(0, 0, 0);
}
*
*/

//indicar sem valor
/*
if ($tpAmb != 1) {

0 comments on commit 6edf7a2

Please sign in to comment.