|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace NFePHP\DA\NFe\Traits; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Bloco sub cabecalho com a identificação e logo do emitente |
|
7
|
|
|
*/ |
|
8
|
|
|
trait TraitBlocoII |
|
9
|
|
|
{ |
|
10
|
|
|
protected function blocoII($y) |
|
11
|
|
|
{ |
|
12
|
|
|
$this->bloco2H = 12; |
|
|
|
|
|
|
13
|
|
|
|
|
14
|
|
|
//$aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => '']; |
|
15
|
|
|
//$this->pdf->textBox($this->margem, $y, $this->wPrint, $this->bloco2H, '', $aFont, 'T', 'C', true, '', false); |
|
16
|
|
|
|
|
17
|
|
|
if ($this->tpEmis == 9) { |
|
|
|
|
|
|
18
|
|
|
$texto = "Documento Auxiliar da Nota Fiscal de Consumidor Eletronica"; |
|
19
|
|
|
$aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => '']; |
|
|
|
|
|
|
20
|
|
|
$y1 = $this->pdf->textBox( |
|
|
|
|
|
|
21
|
|
|
$this->margem, |
|
|
|
|
|
|
22
|
|
|
$y, |
|
23
|
|
|
$this->wPrint, |
|
|
|
|
|
|
24
|
|
|
$this->bloco2H, |
|
25
|
|
|
$texto, |
|
26
|
|
|
$aFont, |
|
27
|
|
|
'T', |
|
28
|
|
|
'C', |
|
29
|
|
|
false, |
|
30
|
|
|
'', |
|
31
|
|
|
true |
|
32
|
|
|
); |
|
33
|
|
|
$texto = "Não permite aproveitamento de crédito de ICMS"; |
|
34
|
|
|
$aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => '']; |
|
35
|
|
|
$y1 += $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
|
|
|
true |
|
47
|
|
|
); |
|
48
|
|
|
//contingencia offline |
|
49
|
|
|
$texto = "EMITIDA EM CONTINGÊNCIA"; |
|
50
|
|
|
$aFont = ['font'=> $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
|
51
|
|
|
$y2 = $this->pdf->textBox( |
|
52
|
|
|
$this->margem, |
|
53
|
|
|
$y+$y1, |
|
54
|
|
|
$this->wPrint, |
|
55
|
|
|
4, |
|
56
|
|
|
$texto, |
|
57
|
|
|
$aFont, |
|
58
|
|
|
'B', |
|
59
|
|
|
'C', |
|
60
|
|
|
false, |
|
61
|
|
|
'', |
|
62
|
|
|
true |
|
63
|
|
|
); |
|
64
|
|
|
|
|
65
|
|
|
$texto = "Pendente de autorização"; |
|
66
|
|
|
$aFont = ['font'=> $this->fontePadrao, 'size' => 8, 'style' => 'I']; |
|
67
|
|
|
$this->pdf->textBox( |
|
68
|
|
|
$this->margem, |
|
69
|
|
|
$y+$y1+$y2, |
|
70
|
|
|
$this->wPrint, |
|
71
|
|
|
3, |
|
72
|
|
|
$texto, |
|
73
|
|
|
$aFont, |
|
74
|
|
|
'B', |
|
75
|
|
|
'C', |
|
76
|
|
|
false, |
|
77
|
|
|
'', |
|
78
|
|
|
true |
|
79
|
|
|
); |
|
80
|
|
|
} else { |
|
81
|
|
|
$texto = "Documento Auxiliar da Nota Fiscal de Consumidor Eletronica\n" |
|
82
|
|
|
. "Não permite aproveitamento de crédito de ICMS"; |
|
83
|
|
|
$aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => '']; |
|
84
|
|
|
$y1 = $this->pdf->textBox( |
|
|
|
|
|
|
85
|
|
|
$this->margem, |
|
86
|
|
|
$this->bloco1H-2, |
|
|
|
|
|
|
87
|
|
|
$this->wPrint, |
|
88
|
|
|
$this->bloco2H, |
|
89
|
|
|
$texto, |
|
90
|
|
|
$aFont, |
|
91
|
|
|
'C', |
|
92
|
|
|
'C', |
|
93
|
|
|
false, |
|
94
|
|
|
'', |
|
95
|
|
|
true |
|
96
|
|
|
); |
|
97
|
|
|
} |
|
98
|
|
|
$this->pdf->dashedHLine($this->margem, $this->bloco2H+$y, $this->wPrint, 0.1, 30); |
|
99
|
|
|
return $this->bloco2H + $y; |
|
100
|
|
|
} |
|
101
|
|
|
} |
|
102
|
|
|
|
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: