Skip to content

Emitir o valor Zero no campo QUANTIDADE da NFe #651

@cbarros

Description

@cbarros

Estou tento que alterar o Danfe.php no campo QUANTIDADE para que apareça o valor zero, isso é solicitado principalmente em operações de importação. A alteração é simples, somente a troca do isset por empty nesse trecho: if (empty($quantidade))
Seria possível essa implementação?

//#####################################################################
//QUANTIDADE
$y += $h;
$x = $oldX;
$h = 7;
$w1 = round($maxW * 0.10, 0);
$texto = 'QUANTIDADE';
$aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
$this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
if (empty($quantidade)) {
$texto = $quantidade;
$aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
$this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'C', 0, '');
}
//ESPÉCIE
$x += $w1;
$w2 = round($maxW * 0.17, 0);
$texto = 'ESPÉCIE';
$aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
$this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
$texto = $especie;
$aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
$this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
//MARCA
$x += $w2;
$texto = 'MARCA';
$aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => ''];
$this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
$texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
$this->transp->getElementsByTagName("marca")->item(0)->nodeValue : '';
$aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
$this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions