|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace NFePHP\DA\NFe\Traits; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Bloco VI informações de chave de acesso |
|
7
|
|
|
*/ |
|
8
|
|
|
trait TraitBlocoVI |
|
9
|
|
|
{ |
|
10
|
|
|
protected function blocoVI($y) |
|
11
|
|
|
{ |
|
12
|
|
|
$this->bloco6H = 10; |
|
|
|
|
|
|
13
|
|
|
|
|
14
|
|
|
//$aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => '']; |
|
15
|
|
|
//$this->pdf->textBox($this->margem, $y, $this->wPrint, $this->bloco6H, '', $aFont, 'T', 'C', false, '', false); |
|
16
|
|
|
|
|
17
|
|
|
$texto = "Consulte pela Chave de Acesso em:"; |
|
18
|
|
|
$aFont = ['font'=> $this->fontePadrao, 'size' => 8, 'style' => 'B']; |
|
|
|
|
|
|
19
|
|
|
$y1 = $this->pdf->textBox( |
|
|
|
|
|
|
20
|
|
|
$this->margem, |
|
|
|
|
|
|
21
|
|
|
$y, |
|
22
|
|
|
$this->wPrint, |
|
|
|
|
|
|
23
|
|
|
$this->bloco6H, |
|
24
|
|
|
$texto, |
|
25
|
|
|
$aFont, |
|
26
|
|
|
'T', |
|
27
|
|
|
'C', |
|
28
|
|
|
false, |
|
29
|
|
|
'', |
|
30
|
|
|
false |
|
31
|
|
|
); |
|
32
|
|
|
|
|
33
|
|
|
$texto = $this->urlChave; |
|
|
|
|
|
|
34
|
|
|
$aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => '']; |
|
35
|
|
|
$y2 = $this->pdf->textBox( |
|
36
|
|
|
$this->margem, |
|
37
|
|
|
$y+$y1, |
|
38
|
|
|
$this->wPrint, |
|
39
|
|
|
2, |
|
40
|
|
|
$texto, |
|
41
|
|
|
$aFont, |
|
42
|
|
|
'T', |
|
43
|
|
|
'C', |
|
44
|
|
|
false, |
|
45
|
|
|
'', |
|
46
|
|
|
false |
|
47
|
|
|
); |
|
48
|
|
|
|
|
49
|
|
|
$chave = str_replace('NFe', '', $this->infNFe->getAttribute("Id")); |
|
|
|
|
|
|
50
|
|
|
$texto = $this->formatField($chave, $this->formatoChave); |
|
|
|
|
|
|
51
|
|
|
$aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => '']; |
|
52
|
|
|
$y3 = $this->pdf->textBox( |
|
|
|
|
|
|
53
|
|
|
$this->margem, |
|
54
|
|
|
$y+$y1+$y2+1, |
|
55
|
|
|
$this->wPrint, |
|
56
|
|
|
2, |
|
57
|
|
|
$texto, |
|
58
|
|
|
$aFont, |
|
59
|
|
|
'T', |
|
60
|
|
|
'C', |
|
61
|
|
|
false, |
|
62
|
|
|
'', |
|
63
|
|
|
true |
|
64
|
|
|
); |
|
65
|
|
|
$this->pdf->dashedHLine($this->margem, $this->bloco6H+$y, $this->wPrint, 0.1, 30); |
|
66
|
|
|
return $this->bloco6H + $y; |
|
67
|
|
|
} |
|
68
|
|
|
} |
|
69
|
|
|
|
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: