1 | <?php |
||
15 | class DanfcePos |
||
16 | { |
||
17 | /** |
||
18 | * NFCe |
||
19 | * @var \SimpleXMLElement |
||
20 | */ |
||
21 | protected $nfce; |
||
22 | /** |
||
23 | * protNFe |
||
24 | * @var \SimpleXMLElement |
||
25 | */ |
||
26 | protected $protNFe; |
||
27 | /** |
||
28 | * Printer |
||
29 | * @var PrinterInterface |
||
30 | */ |
||
31 | protected $printer; |
||
32 | /** |
||
33 | * Documento montado |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $da = []; |
||
37 | /** |
||
38 | * Total de itens da NFCe |
||
39 | * @var integer |
||
40 | */ |
||
41 | protected $totItens = 0; |
||
42 | |||
43 | /** |
||
44 | * URI referente a pagina de consulta da NFCe pela chave de acesso |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $uri = ''; |
||
48 | |||
49 | protected $aURI = [ |
||
50 | 'AC' => 'http://sefaznet.ac.gov.br/nfce/consulta.xhtml', |
||
51 | 'AM' => 'http://sistemas.sefaz.am.gov.br/nfceweb/formConsulta.do', |
||
52 | 'BA' => 'http://nfe.sefaz.ba.gov.br/servicos/nfce/Modulos/Geral/NFCEC_consulta_chave_acesso.aspx', |
||
53 | 'MT' => 'https://www.sefaz.mt.gov.br/nfce/consultanfce', |
||
54 | 'MA' => 'http://www.nfce.sefaz.ma.gov.br/portal/consultaNFe.do?method=preFilterCupom&', |
||
55 | 'PA' => 'https://appnfc.sefa.pa.gov.br/portal/view/consultas/nfce/consultanfce.seam', |
||
56 | 'PB' => 'https://www.receita.pb.gov.br/ser/servirtual/documentos-fiscais/nfc-e/consultar-nfc-e', |
||
57 | 'PR' => 'http://www.sped.fazenda.pr.gov.br/modules/conteudo/conteudo.php?conteudo=100', |
||
58 | 'RJ' => 'http://www4.fazenda.rj.gov.br/consultaDFe/paginas/consultaChaveAcesso.faces', |
||
59 | 'RS' => 'https://www.sefaz.rs.gov.br/NFE/NFE-COM.aspx', |
||
60 | 'RO' => 'http://www.nfce.sefin.ro.gov.br/home.jsp', |
||
61 | 'RR' => 'https://www.sefaz.rr.gov.br/nfce/servlet/wp_consulta_nfce', |
||
62 | 'SE' => 'http://www.nfce.se.gov.br/portal/portalNoticias.jsp?jsp=barra-menu/servicos/consultaDANFENFCe.htm', |
||
63 | 'SP' => 'https://www.nfce.fazenda.sp.gov.br/NFCeConsultaPublica/Paginas/ConsultaPublica.aspx' |
||
64 | ]; |
||
65 | |||
66 | /** |
||
67 | * Carrega a impressora a ser usada |
||
68 | * a mesma deverá já ter sido pré definida inclusive seu |
||
69 | * conector |
||
70 | * @param PrinterInterface $printer |
||
71 | */ |
||
72 | public function __construct(PrinterInterface $printer) |
||
76 | |||
77 | /** |
||
78 | * Carrega a NFCe |
||
79 | * @param string $nfcexml |
||
80 | */ |
||
81 | public function loadNFCe($nfcexml) |
||
98 | |||
99 | /** |
||
100 | * Monta a DANFCE para uso de impressoras POS |
||
101 | */ |
||
102 | public function monta() |
||
114 | |||
115 | /** |
||
116 | * Manda os dados para a impressora ou |
||
117 | * retorna os comandos em ordem e legiveis |
||
118 | * para a tela |
||
119 | */ |
||
120 | public function printDanfe() |
||
127 | |||
128 | /** |
||
129 | * Recupera a sequiencia de comandos para envio |
||
130 | * posterior para a impressora por outro |
||
131 | * meio como o QZ.io (tray) |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | public function getCommands() |
||
140 | |||
141 | /** |
||
142 | * Parte I - Emitente |
||
143 | * Dados do emitente |
||
144 | * Campo Obrigatório |
||
145 | */ |
||
146 | protected function parteI() |
||
169 | |||
170 | /** |
||
171 | * Parte II - Informações Gerais |
||
172 | * Campo Obrigatório |
||
173 | */ |
||
174 | protected function parteII() |
||
184 | |||
185 | /** |
||
186 | * Parte III - Detalhes da Venda |
||
187 | * Campo Opcional |
||
188 | */ |
||
189 | protected function parteIII() |
||
209 | |||
210 | /** |
||
211 | * Parte V - Informação de tributos |
||
212 | * Campo Obrigatório |
||
213 | */ |
||
214 | protected function parteIV() |
||
222 | |||
223 | /** |
||
224 | * Parte IV - Totais da Venda |
||
225 | * Campo Obrigatório |
||
226 | */ |
||
227 | protected function parteV() |
||
243 | |||
244 | /** |
||
245 | * Parte VI - Mensagem de Interesse do Contribuinte |
||
246 | * conteudo de infCpl |
||
247 | * Campo Opcional |
||
248 | */ |
||
249 | protected function parteVI() |
||
257 | |||
258 | /** |
||
259 | * Parte VII - Mensagem Fiscal e Informações da Consulta via Chave de Acesso |
||
260 | * Campo Obrigatório |
||
261 | */ |
||
262 | protected function parteVII() |
||
288 | |||
289 | /** |
||
290 | * Parte VIII - Informações sobre o Consumidor |
||
291 | * Campo Opcional |
||
292 | */ |
||
293 | protected function parteVIII() |
||
326 | |||
327 | /** |
||
328 | * Parte IX - QRCode |
||
329 | * Consulte via Leitor de QRCode |
||
330 | * Protocolo de autorização 1234567891234567 22/06/2016 14:43:51 |
||
331 | * Campo Obrigatório |
||
332 | */ |
||
333 | protected function parteIX() |
||
349 | |||
350 | /** |
||
351 | * Retorna o texto referente ao tipo de pagamento efetuado |
||
352 | * @param int $tPag |
||
353 | * @return string |
||
354 | */ |
||
355 | private function tipoPag($tPag) |
||
374 | } |
||
375 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.