Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
Complex classes like Make often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Make, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 19 | class Make extends BaseMake |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * versao |
||
| 23 | * numero da versão do xml da CTe |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | public $versao = '2.00'; |
||
| 27 | /** |
||
| 28 | * mod |
||
| 29 | * modelo da CTe 57 |
||
| 30 | * @var integer |
||
| 31 | */ |
||
| 32 | public $mod = 57; |
||
| 33 | /** |
||
| 34 | * chave da MDFe |
||
| 35 | * @var string |
||
| 36 | */ |
||
| 37 | public $chCTe = ''; |
||
| 38 | /** |
||
| 39 | * xml |
||
| 40 | * String com o xml do documento fiscal montado |
||
| 41 | * @var string |
||
| 42 | */ |
||
| 43 | public $xml = ''; |
||
| 44 | /** |
||
| 45 | * dom |
||
| 46 | * Variável onde será montado o xml do documento fiscal |
||
| 47 | * @var \NFePHP\Common\Dom\Dom |
||
| 48 | */ |
||
| 49 | public $dom; |
||
| 50 | /** |
||
| 51 | * tpAmb |
||
| 52 | * tipo de ambiente |
||
| 53 | * @var string |
||
| 54 | */ |
||
| 55 | public $tpAmb = '2'; |
||
| 56 | /** |
||
| 57 | * Modal do Cte |
||
| 58 | * @var integer |
||
| 59 | */ |
||
| 60 | private $modal = 0; |
||
| 61 | /** |
||
| 62 | * Tag CTe |
||
| 63 | * @var \DOMNode |
||
| 64 | */ |
||
| 65 | private $CTe = ''; |
||
| 66 | /** |
||
| 67 | * Informações do CT-e |
||
| 68 | * @var \DOMNode |
||
| 69 | */ |
||
| 70 | private $infCte = ''; |
||
| 71 | /** |
||
| 72 | * Identificação do CT-e |
||
| 73 | * @var \DOMNode |
||
| 74 | */ |
||
| 75 | private $ide = ''; |
||
| 76 | /** |
||
| 77 | * Tipo do Serviço |
||
| 78 | * @var integer |
||
| 79 | */ |
||
| 80 | private $tpServ = 0; |
||
| 81 | /** |
||
| 82 | * Indicador do "papel" do tomador do serviço no CT-e |
||
| 83 | * @var \DOMNode |
||
| 84 | */ |
||
| 85 | private $toma03 = ''; |
||
| 86 | /** |
||
| 87 | * Indicador do "papel" do tomador do serviço no CT-e |
||
| 88 | * @var \DOMNode |
||
| 89 | */ |
||
| 90 | private $toma4 = ''; |
||
| 91 | /** |
||
| 92 | * Dados do endereço |
||
| 93 | * @var \DOMNode |
||
| 94 | */ |
||
| 95 | private $enderToma = ''; |
||
| 96 | /** |
||
| 97 | * Dados complementares do CT-e para fins operacionais ou comerciais |
||
| 98 | * @var \DOMNode |
||
| 99 | */ |
||
| 100 | private $compl = ''; |
||
| 101 | /** |
||
| 102 | * Previsão do fluxo da carga |
||
| 103 | * @var \DOMNode |
||
| 104 | */ |
||
| 105 | private $fluxo = ''; |
||
| 106 | /** |
||
| 107 | * Passagem |
||
| 108 | * @var array |
||
| 109 | */ |
||
| 110 | private $pass = array(); |
||
| 111 | /** |
||
| 112 | * Informações ref. a previsão de entrega |
||
| 113 | * @var \DOMNode |
||
| 114 | */ |
||
| 115 | private $entrega = ''; |
||
| 116 | /** |
||
| 117 | * Entrega sem data definida |
||
| 118 | * @var \DOMNode |
||
| 119 | */ |
||
| 120 | private $semData = ''; |
||
| 121 | /** |
||
| 122 | * Entrega com data definida |
||
| 123 | * @var \DOMNode |
||
| 124 | */ |
||
| 125 | private $comData = ''; |
||
| 126 | /** |
||
| 127 | * Entrega no período definido |
||
| 128 | * @var \DOMNode |
||
| 129 | */ |
||
| 130 | private $noPeriodo = ''; |
||
| 131 | /** |
||
| 132 | * Entrega sem hora definida |
||
| 133 | * @var \DOMNode |
||
| 134 | */ |
||
| 135 | private $semHora = ''; |
||
| 136 | /** |
||
| 137 | * Entrega com hora definida |
||
| 138 | * @var \DOMNode |
||
| 139 | */ |
||
| 140 | private $comHora = ''; |
||
| 141 | /** |
||
| 142 | * Entrega no intervalo de horário definido |
||
| 143 | * @var \DOMNode |
||
| 144 | */ |
||
| 145 | private $noInter = ''; |
||
| 146 | /** |
||
| 147 | * Campo de uso livre do contribuinte |
||
| 148 | * @var array |
||
| 149 | */ |
||
| 150 | private $obsCont = array(); |
||
| 151 | /** |
||
| 152 | * Campo de uso livre do contribuinte |
||
| 153 | * @var array |
||
| 154 | */ |
||
| 155 | private $obsFisco = array(); |
||
| 156 | /** |
||
| 157 | * Identificação do Emitente do CT-e |
||
| 158 | * @var \DOMNode |
||
| 159 | */ |
||
| 160 | private $emit = ''; |
||
| 161 | /** |
||
| 162 | * Endereço do emitente |
||
| 163 | * @var \DOMNode |
||
| 164 | */ |
||
| 165 | private $enderEmit = ''; |
||
| 166 | /** |
||
| 167 | * Informações do Remetente das mercadorias transportadas pelo CT-e |
||
| 168 | * @var \DOMNode |
||
| 169 | */ |
||
| 170 | private $rem = ''; |
||
| 171 | /** |
||
| 172 | * Dados do endereço |
||
| 173 | * @var \DOMNode |
||
| 174 | */ |
||
| 175 | private $enderReme = ''; |
||
| 176 | /** |
||
| 177 | * Informações do Expedidor da Carga |
||
| 178 | * @var \DOMNode |
||
| 179 | */ |
||
| 180 | private $exped = ''; |
||
| 181 | /** |
||
| 182 | * Dados do endereço |
||
| 183 | * @var \DOMNode |
||
| 184 | */ |
||
| 185 | private $enderExped = ''; |
||
| 186 | /** |
||
| 187 | * Informações do Recebedor da Carga |
||
| 188 | * @var \DOMNode |
||
| 189 | */ |
||
| 190 | private $receb = ''; |
||
| 191 | /** |
||
| 192 | * Dados do endereço |
||
| 193 | * @var \DOMNode |
||
| 194 | */ |
||
| 195 | private $enderReceb = ''; |
||
| 196 | /** |
||
| 197 | * Informações do Destinatário do CT-e |
||
| 198 | * @var \DOMNode |
||
| 199 | */ |
||
| 200 | private $dest = ''; |
||
| 201 | /** |
||
| 202 | * Dados do endereço |
||
| 203 | * @var \DOMNode |
||
| 204 | */ |
||
| 205 | private $enderDest = ''; |
||
| 206 | /** |
||
| 207 | * Valores da Prestação de Serviço |
||
| 208 | * @var \DOMNode |
||
| 209 | */ |
||
| 210 | private $vPrest = ''; |
||
| 211 | /** |
||
| 212 | * Componentes do Valor da Prestação |
||
| 213 | * @var array |
||
| 214 | */ |
||
| 215 | private $comp = array(); |
||
| 216 | /** |
||
| 217 | * Informações relativas aos Impostos |
||
| 218 | * @var \DOMNode |
||
| 219 | */ |
||
| 220 | private $imp = ''; |
||
| 221 | /** |
||
| 222 | * Informações relativas ao ICMS |
||
| 223 | * @var \DOMNode |
||
| 224 | */ |
||
| 225 | private $ICMS = ''; |
||
|
|
|||
| 226 | /** |
||
| 227 | * Prestação sujeito à tributação normal do ICMS |
||
| 228 | * @var \DOMNode |
||
| 229 | */ |
||
| 230 | private $ICMS00 = ''; |
||
| 231 | /** |
||
| 232 | * Prestação sujeito à tributação com redução de BC do ICMS |
||
| 233 | * @var \DOMNode |
||
| 234 | */ |
||
| 235 | private $ICMS20 = ''; |
||
| 236 | /** |
||
| 237 | * ICMS Isento, não Tributado ou diferido |
||
| 238 | * @var \DOMNode |
||
| 239 | */ |
||
| 240 | private $ICMS45 = ''; |
||
| 241 | /** |
||
| 242 | * Tributação pelo ICMS60 - ICMS cobrado por substituição tributária. |
||
| 243 | * Responsabilidade do recolhimento do ICMS atribuído ao tomador ou 3º por ST |
||
| 244 | * @var \DOMNode |
||
| 245 | */ |
||
| 246 | private $ICMS60 = ''; |
||
| 247 | /** |
||
| 248 | * ICMS Outros |
||
| 249 | * @var \DOMNode |
||
| 250 | */ |
||
| 251 | private $ICMS90 = ''; |
||
| 252 | /** |
||
| 253 | * ICMS devido à UF de origem da prestação, quando diferente da UF do emitente |
||
| 254 | * @var \DOMNode |
||
| 255 | */ |
||
| 256 | private $ICMSOutraUF = ''; |
||
| 257 | /** |
||
| 258 | * Simples Nacional |
||
| 259 | * @var \DOMNode |
||
| 260 | */ |
||
| 261 | private $ICMSSN = ''; |
||
| 262 | /** |
||
| 263 | * Observações adicionais da CT-e |
||
| 264 | * @var string |
||
| 265 | */ |
||
| 266 | private $xObs = ''; |
||
| 267 | /** |
||
| 268 | * Grupo de informações do CT-e Normal e Substituto |
||
| 269 | * @var \DOMNode |
||
| 270 | */ |
||
| 271 | private $infCTeNorm = ''; |
||
| 272 | /** |
||
| 273 | * Informações da Carga do CT-e |
||
| 274 | * @var \DOMNode |
||
| 275 | */ |
||
| 276 | private $infCarga = ''; |
||
| 277 | /** |
||
| 278 | * Informações de quantidades da Carga do CT-e |
||
| 279 | * @var \DOMNode |
||
| 280 | */ |
||
| 281 | private $infQ = array(); |
||
| 282 | /** |
||
| 283 | * Informações dos documentos transportados pelo CT-e Opcional para Redespacho Intermediario |
||
| 284 | * e Serviço vinculado a multimodal. |
||
| 285 | * @var \DOMNode |
||
| 286 | */ |
||
| 287 | private $infDoc = array(); |
||
| 288 | /** |
||
| 289 | * Informações das NF |
||
| 290 | * @var array |
||
| 291 | */ |
||
| 292 | private $infNF = array(); |
||
| 293 | /** |
||
| 294 | * Informações das NF-e |
||
| 295 | * @var array |
||
| 296 | */ |
||
| 297 | private $infNFe = array(); |
||
| 298 | /** |
||
| 299 | * Informações dos demais documentos |
||
| 300 | * @var array |
||
| 301 | */ |
||
| 302 | private $infOutros = array(); |
||
| 303 | /** |
||
| 304 | * Informações das Unidades de Transporte (Carreta/Reboque/Vagão) |
||
| 305 | * @var array |
||
| 306 | */ |
||
| 307 | private $infUnidTransp = array(); |
||
| 308 | /** |
||
| 309 | * Lacres das Unidades de Transporte |
||
| 310 | * @var array |
||
| 311 | */ |
||
| 312 | private $lacUnidTransp = array(); |
||
| 313 | /** |
||
| 314 | * Informações das Unidades de Carga (Containeres/ULD/Outros) |
||
| 315 | * @var array |
||
| 316 | */ |
||
| 317 | private $infUnidCarga = array(); |
||
| 318 | /** |
||
| 319 | * Lacres das Unidades de Carga |
||
| 320 | * @var array |
||
| 321 | */ |
||
| 322 | private $lacUnidCarga = array(); |
||
| 323 | /** |
||
| 324 | * Documentos de Transporte Anterior |
||
| 325 | * @var \DOMNode |
||
| 326 | */ |
||
| 327 | private $docAnt = ''; |
||
| 328 | /** |
||
| 329 | * Emissor do documento anterior |
||
| 330 | * @var array |
||
| 331 | */ |
||
| 332 | private $emiDocAnt = array(); |
||
| 333 | /** |
||
| 334 | * Informações de identificação dos documentos de Transporte Anterior |
||
| 335 | * @var array |
||
| 336 | */ |
||
| 337 | private $idDocAnt = array(); |
||
| 338 | /** |
||
| 339 | * Documentos de transporte anterior em papel |
||
| 340 | * @var array |
||
| 341 | */ |
||
| 342 | private $idDocAntPap = array(); |
||
| 343 | /** |
||
| 344 | * Documentos de transporte anterior eletrônicos |
||
| 345 | * @var array |
||
| 346 | */ |
||
| 347 | private $idDocAntEle = array(); |
||
| 348 | /** |
||
| 349 | * Informações de Seguro da Carga |
||
| 350 | * @var array |
||
| 351 | */ |
||
| 352 | private $seg = array(); |
||
| 353 | /** |
||
| 354 | * Informações do modal |
||
| 355 | * @var \DOMNode |
||
| 356 | */ |
||
| 357 | private $infModal = ''; |
||
| 358 | /** |
||
| 359 | * Preenchido quando for transporte de produtos classificados pela ONU como perigosos. |
||
| 360 | * @var array |
||
| 361 | */ |
||
| 362 | private $peri = array(); |
||
| 363 | /** |
||
| 364 | * informações dos veículos transportados |
||
| 365 | * @var array |
||
| 366 | */ |
||
| 367 | private $veicNovos = array(); |
||
| 368 | /** |
||
| 369 | * Dados da cobrança do CT-e |
||
| 370 | * @var \DOMNode |
||
| 371 | */ |
||
| 372 | private $cobr = ''; |
||
| 373 | /** |
||
| 374 | * Dados da fatura |
||
| 375 | * @var \DOMNode |
||
| 376 | */ |
||
| 377 | private $fat = ''; |
||
| 378 | /** |
||
| 379 | * Dados das duplicatas |
||
| 380 | * @var array |
||
| 381 | */ |
||
| 382 | private $dup = array(); |
||
| 383 | /** |
||
| 384 | * Informações do CT-e de substituição |
||
| 385 | * @var \DOMNode |
||
| 386 | */ |
||
| 387 | private $infCteSub = ''; |
||
| 388 | /** |
||
| 389 | * Tomador é contribuinte do ICMS |
||
| 390 | * @var \DOMNode |
||
| 391 | */ |
||
| 392 | private $tomaICMS = ''; |
||
| 393 | /** |
||
| 394 | * Tomador não é contribuinte do ICMS |
||
| 395 | * @var \DOMNode |
||
| 396 | */ |
||
| 397 | private $tomaNaoICMS = ''; |
||
| 398 | /** |
||
| 399 | * Informação da NF ou CT emitido pelo Tomador |
||
| 400 | * @var \DOMNode |
||
| 401 | */ |
||
| 402 | private $refNF = ''; |
||
| 403 | /** |
||
| 404 | * Informação do CTe emitido pelo Tomador |
||
| 405 | * @var \DOMNode |
||
| 406 | */ |
||
| 407 | private $refCte = ''; |
||
| 408 | /** |
||
| 409 | * Informação da NF ou CT emitido pelo Tomador |
||
| 410 | * @var \DOMNode |
||
| 411 | */ |
||
| 412 | private $infCteComp = ''; |
||
| 413 | /** |
||
| 414 | * Detalhamento do CT-e do tipo Anulação |
||
| 415 | * @var \DOMNode |
||
| 416 | */ |
||
| 417 | private $infCteAnu = ''; |
||
| 418 | /** |
||
| 419 | * Informações do modal Rodoviário |
||
| 420 | * @var \DOMNode |
||
| 421 | */ |
||
| 422 | private $rodo = ''; |
||
| 423 | /** |
||
| 424 | * Ordens de Coleta associados |
||
| 425 | * @var array |
||
| 426 | */ |
||
| 427 | private $occ = array(); |
||
| 428 | /** |
||
| 429 | * @var \DOMNode |
||
| 430 | */ |
||
| 431 | private $emiOcc = array(); |
||
| 432 | /** |
||
| 433 | * Informações de Vale Pedágio |
||
| 434 | * @var array |
||
| 435 | */ |
||
| 436 | private $valePed = array(); |
||
| 437 | /** |
||
| 438 | * Dados dos Veículos |
||
| 439 | * @var array |
||
| 440 | */ |
||
| 441 | private $veic = array(); |
||
| 442 | /** |
||
| 443 | * Proprietários do Veículo. Só preenchido quando o veículo não pertencer à empresa emitente do CT-e |
||
| 444 | * @var array |
||
| 445 | */ |
||
| 446 | private $prop = array(); |
||
| 447 | /** |
||
| 448 | * Dados dos Veículos |
||
| 449 | * @var array |
||
| 450 | */ |
||
| 451 | private $lacRodo = array(); |
||
| 452 | /** |
||
| 453 | * Informações do(s) Motorista(s) |
||
| 454 | * @var array |
||
| 455 | */ |
||
| 456 | private $moto = array(); |
||
| 457 | |||
| 458 | /** |
||
| 459 | * Monta o arquivo XML usando as tag's já preenchidas |
||
| 460 | * |
||
| 461 | * @return bool |
||
| 462 | */ |
||
| 463 | public function montaCTe() |
||
| 555 | |||
| 556 | /** |
||
| 557 | * Gera o grupo básico: Informações do CT-e |
||
| 558 | * #1 |
||
| 559 | * Nível: 0 |
||
| 560 | * |
||
| 561 | * @param string $chave Chave do CTe |
||
| 562 | * @param string $versao Versão do CTe |
||
| 563 | * |
||
| 564 | * @return \DOMElement |
||
| 565 | */ |
||
| 566 | public function infCteTag($chave = '', $versao = '') |
||
| 567 | { |
||
| 568 | $this->infCte = $this->dom->createElement('infCte'); |
||
| 569 | $this->infCte->setAttribute('Id', 'CTe' . $chave); |
||
| 570 | $this->infCte->setAttribute('versao', $versao); |
||
| 571 | return $this->infCte; |
||
| 572 | } |
||
| 573 | |||
| 574 | /** |
||
| 575 | * Gera as tags para o elemento: Identificação do CT-e |
||
| 576 | * #4 |
||
| 577 | * Nível: 1 |
||
| 578 | * Os parâmetros para esta função são todos os elementos da tag "ide" do tipo elemento (Ele = E|CE|A) e nível 2 |
||
| 579 | * |
||
| 580 | * @param string $cUF Código da UF do emitente do CT-e |
||
| 581 | * @param string $cCT Código numérico que compõe a Chave de Acesso |
||
| 582 | * @param string $CFOP Código Fiscal de Operações e Prestações |
||
| 583 | * @param string $natOp Natureza da Operação |
||
| 584 | * @param string $mod Modelo do documento fiscal |
||
| 585 | * @param string $serie Série do CT-e |
||
| 586 | * @param string $nCT Número do CT-e |
||
| 587 | * @param string $dhEmi Data e hora de emissão do CT-e |
||
| 588 | * @param string $tpImp Formato de impressão do DACTE |
||
| 589 | * @param string $tpEmis Forma de emissão do CT-e |
||
| 590 | * @param string $cDV Digito Verificador da chave de acesso do CT-e |
||
| 591 | * @param string $tpAmb Tipo do Ambiente |
||
| 592 | * @param string $tpCTe Tipo do CT-e |
||
| 593 | * @param string $procEmi Identificador do processo de emissão do CT-e |
||
| 594 | * @param string $verProc Versão do processo de emissão |
||
| 595 | * @param string $refCTE Chave de acesso do CT-e referenciado |
||
| 596 | * @param string $cMunEnv Código do Município de envio do CT-e (de onde o documento foi transmitido) |
||
| 597 | * @param string $xMunEnv Nome do Município de envio do CT-e (de onde o documento foi transmitido) |
||
| 598 | * @param string $UFEnv Sigla da UF de envio do CT-e (de onde o documento foi transmitido) |
||
| 599 | * @param string $modal Modal |
||
| 600 | * @param string $tpServ Tipo do Serviço |
||
| 601 | * @param string $cMunIni Código do Município de início da prestação |
||
| 602 | * @param string $xMunIni Nome do Município do início da prestação |
||
| 603 | * @param string $UFIni UF do início da prestação |
||
| 604 | * @param string $cMunFim Código do Município de término da prestação |
||
| 605 | * @param string $xMunFim Nome do Município do término da prestação |
||
| 606 | * @param string $UFFim UF do término da prestação |
||
| 607 | * @param string $retira Indicador se o Recebedor retira no Aeroporto, Filial, Porto ou Estação de Destino? |
||
| 608 | * @param string $xDetRetira Detalhes do retira |
||
| 609 | * @param string $dhCont Data e Hora da entrada em contingência |
||
| 610 | * @param string $xJust Justificativa da entrada em contingência |
||
| 611 | * |
||
| 612 | * @return \DOMElement |
||
| 613 | */ |
||
| 614 | public function ideTag( |
||
| 615 | $cUF = '', |
||
| 616 | $cCT = '', |
||
| 617 | $CFOP = '', |
||
| 618 | $natOp = '', |
||
| 619 | $forPag = '', |
||
| 620 | $mod = '', |
||
| 621 | $serie = '', |
||
| 622 | $nCT = '', |
||
| 623 | $dhEmi = '', |
||
| 624 | $tpImp = '', |
||
| 625 | $tpEmis = '', |
||
| 626 | $cDV = '', |
||
| 627 | $tpAmb = '', |
||
| 628 | $tpCTe = '', |
||
| 629 | $procEmi = '', |
||
| 630 | $verProc = '', |
||
| 631 | $refCTE = '', |
||
| 632 | $cMunEnv = '', |
||
| 633 | $xMunEnv = '', |
||
| 634 | $UFEnv = '', |
||
| 635 | $modal = '', |
||
| 636 | $tpServ = '', |
||
| 637 | $cMunIni = '', |
||
| 638 | $xMunIni = '', |
||
| 639 | $UFIni = '', |
||
| 640 | $cMunFim = '', |
||
| 641 | $xMunFim = '', |
||
| 642 | $UFFim = '', |
||
| 643 | $retira = '', |
||
| 644 | $xDetRetira = '', |
||
| 645 | $dhCont = '', |
||
| 646 | $xJust = '' |
||
| 647 | ) { |
||
| 648 | $this->tpAmb = $tpAmb; |
||
| 649 | $identificador = '#4 <ide> - '; |
||
| 650 | $this->ide = $this->dom->createElement('ide'); |
||
| 651 | $this->dom->addChild( |
||
| 652 | $this->ide, |
||
| 653 | 'cUF', |
||
| 654 | $cUF, |
||
| 655 | true, |
||
| 656 | $identificador . 'Código da UF do emitente do CT-e' |
||
| 657 | ); |
||
| 658 | $this->dom->addChild( |
||
| 659 | $this->ide, |
||
| 660 | 'cCT', |
||
| 661 | $cCT, |
||
| 662 | true, |
||
| 663 | $identificador . 'Código numérico que compõe a Chave de Acesso' |
||
| 664 | ); |
||
| 665 | $this->dom->addChild( |
||
| 666 | $this->ide, |
||
| 667 | 'CFOP', |
||
| 668 | $CFOP, |
||
| 669 | true, |
||
| 670 | $identificador . 'Código Fiscal de Operações e Prestações' |
||
| 671 | ); |
||
| 672 | $this->dom->addChild( |
||
| 673 | $this->ide, |
||
| 674 | 'natOp', |
||
| 675 | $natOp, |
||
| 676 | true, |
||
| 677 | $identificador . 'Natureza da Operação' |
||
| 678 | ); |
||
| 679 | $this->dom->addChild( |
||
| 680 | $this->ide, |
||
| 681 | 'forPag', |
||
| 682 | $forPag, |
||
| 683 | true, |
||
| 684 | $identificador . 'Forma de pagamento do serviço' |
||
| 685 | ); |
||
| 686 | $this->dom->addChild( |
||
| 687 | $this->ide, |
||
| 688 | 'mod', |
||
| 689 | $mod, |
||
| 690 | true, |
||
| 691 | $identificador . 'Modelo do documento fiscal' |
||
| 692 | ); |
||
| 693 | $this->mod = $mod; |
||
| 694 | $this->dom->addChild( |
||
| 695 | $this->ide, |
||
| 696 | 'serie', |
||
| 697 | $serie, |
||
| 698 | true, |
||
| 699 | $identificador . 'Série do CT-e' |
||
| 700 | ); |
||
| 701 | $this->dom->addChild( |
||
| 702 | $this->ide, |
||
| 703 | 'nCT', |
||
| 704 | $nCT, |
||
| 705 | true, |
||
| 706 | $identificador . 'Número do CT-e' |
||
| 707 | ); |
||
| 708 | $this->dom->addChild( |
||
| 709 | $this->ide, |
||
| 710 | 'dhEmi', |
||
| 711 | $dhEmi, |
||
| 712 | true, |
||
| 713 | $identificador . 'Data e hora de emissão do CT-e' |
||
| 714 | ); |
||
| 715 | $this->dom->addChild( |
||
| 716 | $this->ide, |
||
| 717 | 'tpImp', |
||
| 718 | $tpImp, |
||
| 719 | true, |
||
| 720 | $identificador . 'Formato de impressão do DACTE' |
||
| 721 | ); |
||
| 722 | $this->dom->addChild( |
||
| 723 | $this->ide, |
||
| 724 | 'tpEmis', |
||
| 725 | $tpEmis, |
||
| 726 | true, |
||
| 727 | $identificador . 'Forma de emissão do CT-e' |
||
| 728 | ); |
||
| 729 | $this->dom->addChild( |
||
| 730 | $this->ide, |
||
| 731 | 'cDV', |
||
| 732 | $cDV, |
||
| 733 | true, |
||
| 734 | $identificador . 'Digito Verificador da chave de acesso do CT-e' |
||
| 735 | ); |
||
| 736 | $this->dom->addChild( |
||
| 737 | $this->ide, |
||
| 738 | 'tpAmb', |
||
| 739 | $tpAmb, |
||
| 740 | true, |
||
| 741 | $identificador . 'Tipo do Ambiente' |
||
| 742 | ); |
||
| 743 | $this->dom->addChild( |
||
| 744 | $this->ide, |
||
| 745 | 'tpCTe', |
||
| 746 | $tpCTe, |
||
| 747 | true, |
||
| 748 | $identificador . 'Tipo do CT-e' |
||
| 749 | ); |
||
| 750 | $this->dom->addChild( |
||
| 751 | $this->ide, |
||
| 752 | 'procEmi', |
||
| 753 | $procEmi, |
||
| 754 | true, |
||
| 755 | $identificador . 'Identificador do processo de emissão do CT-e' |
||
| 756 | ); |
||
| 757 | $this->dom->addChild( |
||
| 758 | $this->ide, |
||
| 759 | 'verProc', |
||
| 760 | $verProc, |
||
| 761 | true, |
||
| 762 | $identificador . 'Versão do processo de emissão' |
||
| 763 | ); |
||
| 764 | $this->dom->addChild( |
||
| 765 | $this->ide, |
||
| 766 | 'refCTE', |
||
| 767 | $refCTE, |
||
| 768 | false, |
||
| 769 | $identificador . 'Chave de acesso do CT-e referenciado' |
||
| 770 | ); |
||
| 771 | $this->dom->addChild( |
||
| 772 | $this->ide, |
||
| 773 | 'cMunEnv', |
||
| 774 | $cMunEnv, |
||
| 775 | true, |
||
| 776 | $identificador . 'Código do Município de envio do CT-e (de onde o documento foi transmitido)' |
||
| 777 | ); |
||
| 778 | $this->dom->addChild( |
||
| 779 | $this->ide, |
||
| 780 | 'xMunEnv', |
||
| 781 | $xMunEnv, |
||
| 782 | true, |
||
| 783 | $identificador . 'Nome do Município de envio do CT-e (de onde o documento foi transmitido)' |
||
| 784 | ); |
||
| 785 | $this->dom->addChild( |
||
| 786 | $this->ide, |
||
| 787 | 'UFEnv', |
||
| 788 | $UFEnv, |
||
| 789 | true, |
||
| 790 | $identificador . 'Sigla da UF de envio do CT-e (de onde o documento foi transmitido)' |
||
| 791 | ); |
||
| 792 | $this->dom->addChild( |
||
| 793 | $this->ide, |
||
| 794 | 'modal', |
||
| 795 | $modal, |
||
| 796 | true, |
||
| 797 | $identificador . 'Modal' |
||
| 798 | ); |
||
| 799 | $this->modal = $modal; |
||
| 800 | $this->dom->addChild( |
||
| 801 | $this->ide, |
||
| 802 | 'tpServ', |
||
| 803 | $tpServ, |
||
| 804 | true, |
||
| 805 | $identificador . 'Tipo do Serviço' |
||
| 806 | ); |
||
| 807 | $this->dom->addChild( |
||
| 808 | $this->ide, |
||
| 809 | 'cMunIni', |
||
| 810 | $cMunIni, |
||
| 811 | true, |
||
| 812 | $identificador . 'Nome do Município do início da prestação' |
||
| 813 | ); |
||
| 814 | $this->dom->addChild( |
||
| 815 | $this->ide, |
||
| 816 | 'xMunIni', |
||
| 817 | $xMunIni, |
||
| 818 | true, |
||
| 819 | $identificador . 'Nome do Município do início da prestação' |
||
| 820 | ); |
||
| 821 | $this->dom->addChild( |
||
| 822 | $this->ide, |
||
| 823 | 'UFIni', |
||
| 824 | $UFIni, |
||
| 825 | true, |
||
| 826 | $identificador . 'UF do início da prestação' |
||
| 827 | ); |
||
| 828 | $this->dom->addChild( |
||
| 829 | $this->ide, |
||
| 830 | 'cMunFim', |
||
| 831 | $cMunFim, |
||
| 832 | true, |
||
| 833 | $identificador . 'Código do Município de término da prestação' |
||
| 834 | ); |
||
| 835 | $this->dom->addChild( |
||
| 836 | $this->ide, |
||
| 837 | 'xMunFim', |
||
| 838 | $xMunFim, |
||
| 839 | true, |
||
| 840 | $identificador . 'Nome do Município do término da prestação' |
||
| 841 | ); |
||
| 842 | $this->dom->addChild( |
||
| 843 | $this->ide, |
||
| 844 | 'UFFim', |
||
| 845 | $UFFim, |
||
| 846 | true, |
||
| 847 | $identificador . 'UF do término da prestação' |
||
| 848 | ); |
||
| 849 | $this->dom->addChild( |
||
| 850 | $this->ide, |
||
| 851 | 'retira', |
||
| 852 | $retira, |
||
| 853 | true, |
||
| 854 | $identificador . 'Indicador se o Recebedor retira no Aeroporto, Filial, Porto ou Estação de Destino' |
||
| 855 | ); |
||
| 856 | $this->dom->addChild( |
||
| 857 | $this->ide, |
||
| 858 | 'xDetRetira', |
||
| 859 | $xDetRetira, |
||
| 860 | false, |
||
| 861 | $identificador . 'Detalhes do retira' |
||
| 862 | ); |
||
| 863 | $this->dom->addChild( |
||
| 864 | $this->ide, |
||
| 865 | 'dhCont', |
||
| 866 | $dhCont, |
||
| 867 | false, |
||
| 868 | $identificador . 'Data e Hora da entrada em contingência' |
||
| 869 | ); |
||
| 870 | $this->dom->addChild( |
||
| 871 | $this->ide, |
||
| 872 | 'xJust', |
||
| 873 | $xJust, |
||
| 874 | false, |
||
| 875 | $identificador . 'Justificativa da entrada em contingência' |
||
| 876 | ); |
||
| 877 | $this->tpServ = $tpServ; |
||
| 878 | return $this->ide; |
||
| 879 | } |
||
| 880 | |||
| 881 | /** |
||
| 882 | * Gera as tags para o elemento: toma03 (Indicador do "papel" do tomador do serviço no CT-e) |
||
| 883 | * e adiciona ao grupo ide |
||
| 884 | * #35 |
||
| 885 | * Nível: 2 |
||
| 886 | * Os parâmetros para esta função são todos os elementos da tag "toma03" do |
||
| 887 | * tipo elemento (Ele = E|CE|A) e nível 3 |
||
| 888 | * |
||
| 889 | * @param string $toma Tomador do Serviço |
||
| 890 | * |
||
| 891 | * @return \DOMElement |
||
| 892 | */ |
||
| 893 | public function toma03Tag($toma = '') |
||
| 894 | { |
||
| 895 | $identificador = '#35 <toma03> - '; |
||
| 896 | $this->toma03 = $this->dom->createElement('toma03'); |
||
| 897 | $this->dom->addChild( |
||
| 898 | $this->toma03, |
||
| 899 | 'toma', |
||
| 900 | $toma, |
||
| 901 | true, |
||
| 902 | $identificador . 'Tomador do Serviço' |
||
| 903 | ); |
||
| 904 | return $this->toma03; |
||
| 905 | } |
||
| 906 | |||
| 907 | /** |
||
| 908 | * Gera as tags para o elemento: toma4 (Indicador do "papel" do tomador |
||
| 909 | * do serviço no CT-e) e adiciona ao grupo ide |
||
| 910 | * #37 |
||
| 911 | * Nível: 2 |
||
| 912 | * Os parâmetros para esta função são todos os elementos da tag "toma4" do |
||
| 913 | * tipo elemento (Ele = E|CE|A) e nível 3 |
||
| 914 | * |
||
| 915 | * @param string $toma Tomador do Serviço |
||
| 916 | * @param string $CNPJ Número do CNPJ |
||
| 917 | * @param string $CPF Número do CPF |
||
| 918 | * @param string $IE Inscrição Estadual |
||
| 919 | * @param string $xNome Razão Social ou Nome |
||
| 920 | * @param string $xFant Nome Fantasia |
||
| 921 | * @param string $fone Telefone |
||
| 922 | * @param string $email Endereço de email |
||
| 923 | * |
||
| 924 | * @return \DOMElement |
||
| 925 | */ |
||
| 926 | public function toma4Tag( |
||
| 1014 | |||
| 1015 | /** |
||
| 1016 | * Gera as tags para o elemento: "enderToma" (Dados do endereço) e adiciona ao grupo "toma4" |
||
| 1017 | * #45 |
||
| 1018 | * Nível: 3 |
||
| 1019 | * Os parâmetros para esta função são todos os elementos da tag "enderToma" |
||
| 1020 | * do tipo elemento (Ele = E|CE|A) e nível 4 |
||
| 1021 | * |
||
| 1022 | * @param string $xLgr Logradouro |
||
| 1023 | * @param string $nro Número |
||
| 1024 | * @param string $xCpl Complemento |
||
| 1025 | * @param string $xBairro Bairro |
||
| 1026 | * @param string $cMun Código do município (utilizar a tabela do IBGE) |
||
| 1027 | * @param string $xMun Nome do município |
||
| 1028 | * @param string $CEP CEP |
||
| 1029 | * @param string $UF Sigla da UF |
||
| 1030 | * @param string $cPais Código do país |
||
| 1031 | * @param string $xPais Nome do país |
||
| 1032 | * |
||
| 1033 | * @return \DOMElement |
||
| 1034 | */ |
||
| 1035 | public function enderTomaTag( |
||
| 1121 | |||
| 1122 | /** |
||
| 1123 | * Gera as tags para o elemento: "compl" (Dados complementares do CT-e para fins operacionais ou comerciais) |
||
| 1124 | * #59 |
||
| 1125 | * Nível: 1 |
||
| 1126 | * Os parâmetros para esta função são todos os elementos da tag "compl" do |
||
| 1127 | * tipo elemento (Ele = E|CE|A) e nível 2 |
||
| 1128 | * |
||
| 1129 | * @param string $xCaracAd Característica adicional do transporte |
||
| 1130 | * @param string $xCaracSer Característica adicional do serviço |
||
| 1131 | * @param string $xEmi Funcionário emissor do CTe |
||
| 1132 | * @param string $origCalc Município de origem para efeito de cálculo do frete |
||
| 1133 | * @param string $destCalc Município de destino para efeito de cálculo do frete |
||
| 1134 | * @param string $xObs Observações Gerais |
||
| 1135 | * |
||
| 1136 | * @return \DOMElement |
||
| 1137 | */ |
||
| 1138 | public function complTag($xCaracAd = '', $xCaracSer = '', $xEmi = '', $origCalc = '', $destCalc = '', $xObs = '') |
||
| 1186 | |||
| 1187 | /** |
||
| 1188 | * Gera as tags para o elemento: "fluxo" (Previsão do fluxo da carga) |
||
| 1189 | * #63 |
||
| 1190 | * Nível: 2 |
||
| 1191 | * Os parâmetros para esta função são todos os elementos da tag "fluxo" do |
||
| 1192 | * tipo elemento (Ele = E|CE|A) e nível 3 |
||
| 1193 | * |
||
| 1194 | * @param string $xOrig Sigla ou código interno da Filial/Porto/Estação/ Aeroporto de Origem |
||
| 1195 | * @param string $xDest Sigla ou código interno da Filial/Porto/Estação/Aeroporto de Destino |
||
| 1196 | * @param string $xRota Código da Rota de Entrega |
||
| 1197 | * |
||
| 1198 | * @return \DOMElement |
||
| 1199 | */ |
||
| 1200 | public function fluxoTag($xOrig = '', $xDest = '', $xRota = '') |
||
| 1227 | |||
| 1228 | /** |
||
| 1229 | * Gera as tags para o elemento: "pass" |
||
| 1230 | * #65 |
||
| 1231 | * Nível: 3 |
||
| 1232 | * Os parâmetros para esta função são todos os elementos da tag "pass" do |
||
| 1233 | * tipo elemento (Ele = E|CE|A) e nível 4 |
||
| 1234 | * |
||
| 1235 | * @param string $xPass Sigla ou código interno da Filial/Porto/Estação/Aeroporto de Passagem |
||
| 1236 | * |
||
| 1237 | * @return \DOMElement |
||
| 1238 | */ |
||
| 1239 | public function passTag($xPass = '') |
||
| 1253 | |||
| 1254 | /** |
||
| 1255 | * Gera as tags para o elemento: "semData" (Entrega sem data definida) |
||
| 1256 | * #70 |
||
| 1257 | * Nível: 3 |
||
| 1258 | * Os parâmetros para esta função são todos os elementos da tag "semData" do |
||
| 1259 | * tipo elemento (Ele = E|CE|A) e nível 4 |
||
| 1260 | * |
||
| 1261 | * @param string $tpPer Tipo de data/período programado para entrega |
||
| 1262 | * |
||
| 1263 | * @return \DOMElement |
||
| 1264 | */ |
||
| 1265 | public function semDataTag($tpPer = '') |
||
| 1278 | |||
| 1279 | /** |
||
| 1280 | * Gera as tags para o elemento: "comData" (Entrega com data definida) |
||
| 1281 | * #72 |
||
| 1282 | * Nível: 3 |
||
| 1283 | * Os parâmetros para esta função são todos os elementos da tag "comData" do |
||
| 1284 | * tipo elemento (Ele = E|CE|A) e nível 4 |
||
| 1285 | * |
||
| 1286 | * @param string $tpPer Tipo de data/período programado para entrega |
||
| 1287 | * @param string $dProg Data programada |
||
| 1288 | * |
||
| 1289 | * @return \DOMElement |
||
| 1290 | */ |
||
| 1291 | public function comDataTag($tpPer = '', $dProg = '') |
||
| 1311 | |||
| 1312 | /** |
||
| 1313 | * Gera as tags para o elemento: "noPeriodo" (Entrega no período definido) |
||
| 1314 | * #75 |
||
| 1315 | * Nível: 3 |
||
| 1316 | * Os parâmetros para esta função são todos os elementos da tag "noPeriodo" do tipo |
||
| 1317 | * elemento (Ele = E|CE|A) e nível 4 |
||
| 1318 | * |
||
| 1319 | * @param string $tpPer Tipo de data/período programado para entrega |
||
| 1320 | * @param string $dIni Data inicial |
||
| 1321 | * @param string $dFim Data final |
||
| 1322 | * |
||
| 1323 | * @return \DOMElement |
||
| 1324 | */ |
||
| 1325 | View Code Duplication | public function noPeriodoTag($tpPer = '', $dIni = '', $dFim = '') |
|
| 1352 | |||
| 1353 | /** |
||
| 1354 | * Gera as tags para o elemento: "semHora" (Entrega sem hora definida) |
||
| 1355 | * #79 |
||
| 1356 | * Nível: 3 |
||
| 1357 | * Os parâmetros para esta função são todos os elementos da tag "semHora" do |
||
| 1358 | * tipo elemento (Ele = E|CE|A) e nível 4 |
||
| 1359 | * |
||
| 1360 | * @param string $tpHor Tipo de hora |
||
| 1361 | * |
||
| 1362 | * @return \DOMElement |
||
| 1363 | */ |
||
| 1364 | public function semHoraTag($tpHor = '') |
||
| 1377 | |||
| 1378 | /** |
||
| 1379 | * Gera as tags para o elemento: "comHora" (Entrega sem hora definida) |
||
| 1380 | * # = 81 |
||
| 1381 | * Nível = 3 |
||
| 1382 | * Os parâmetros para esta função são todos os elementos da tag "comHora" do |
||
| 1383 | * tipo elemento (Ele = E|CE|A) e nível 4 |
||
| 1384 | * |
||
| 1385 | * @param string $tpHor Tipo de hora |
||
| 1386 | * @param string $hProg Hora programada |
||
| 1387 | * |
||
| 1388 | * @return \DOMElement |
||
| 1389 | */ |
||
| 1390 | public function comHoraTag($tpHor = '', $hProg = '') |
||
| 1410 | |||
| 1411 | /** |
||
| 1412 | * Gera as tags para o elemento: "noInter" (Entrega no intervalo de horário definido) |
||
| 1413 | * #84 |
||
| 1414 | * Nível: 3 |
||
| 1415 | * Os parâmetros para esta função são todos os elementos da tag "noInter" do |
||
| 1416 | * tipo elemento (Ele = E|CE|A) e nível 4 |
||
| 1417 | * |
||
| 1418 | * @param string $tpHor Tipo de hora |
||
| 1419 | * @param string $hIni Hora inicial |
||
| 1420 | * @param string $hFim Hora final |
||
| 1421 | * |
||
| 1422 | * @return \DOMElement |
||
| 1423 | */ |
||
| 1424 | View Code Duplication | public function noInterTag($tpHor = '', $hIni = '', $hFim = '') |
|
| 1451 | |||
| 1452 | /** |
||
| 1453 | * Gera as tags para o elemento: "ObsCont" (Campo de uso livre do contribuinte) |
||
| 1454 | * #91 |
||
| 1455 | * Nível: 2 |
||
| 1456 | * Os parâmetros para esta função são todos os elementos da tag "ObsCont" do |
||
| 1457 | * tipo elemento (Ele = E|CE|A) e nível 3 |
||
| 1458 | * |
||
| 1459 | * @param string $xCampo Identificação do campo |
||
| 1460 | * @param string $xTexto Conteúdo do campo |
||
| 1461 | * |
||
| 1462 | * @return boolean |
||
| 1463 | */ |
||
| 1464 | View Code Duplication | public function obsContTag($xCampo = '', $xTexto = '') |
|
| 1487 | |||
| 1488 | /** |
||
| 1489 | * Gera as tags para o elemento: "ObsFisco" (Campo de uso livre do contribuinte) |
||
| 1490 | * #94 |
||
| 1491 | * Nível: 2 |
||
| 1492 | * Os parâmetros para esta função são todos os elementos da tag "ObsFisco" do tipo |
||
| 1493 | * elemento (Ele = E|CE|A) e nível 3 |
||
| 1494 | * |
||
| 1495 | * @param string $xCampo Identificação do campo |
||
| 1496 | * @param string $xTexto Conteúdo do campo |
||
| 1497 | * |
||
| 1498 | * @return boolean |
||
| 1499 | */ |
||
| 1500 | View Code Duplication | public function obsFiscoTag($xCampo = '', $xTexto = '') |
|
| 1523 | |||
| 1524 | /** |
||
| 1525 | * Gera as tags para o elemento: "emit" (Identificação do Emitente do CT-e) |
||
| 1526 | * #97 |
||
| 1527 | * Nível: 1 |
||
| 1528 | * Os parâmetros para esta função são todos os elementos da tag "emit" do |
||
| 1529 | * tipo elemento (Ele = E|CE|A) e nível 2 |
||
| 1530 | * |
||
| 1531 | * @param string $CNPJ CNPJ do emitente |
||
| 1532 | * @param string $IE Inscrição Estadual do Emitente |
||
| 1533 | * @param string $xNome Razão social ou Nome do emitente |
||
| 1534 | * @param string $xFant Nome fantasia |
||
| 1535 | * |
||
| 1536 | * @return \DOMElement |
||
| 1537 | */ |
||
| 1538 | public function emitTag($CNPJ = '', $IE = '', $xNome = '', $xFant = '') |
||
| 1539 | { |
||
| 1540 | $identificador = '#97 <emit> - '; |
||
| 1541 | $this->emit = $this->dom->createElement('emit'); |
||
| 1542 | $this->dom->addChild( |
||
| 1543 | $this->emit, |
||
| 1544 | 'CNPJ', |
||
| 1545 | $CNPJ, |
||
| 1546 | true, |
||
| 1547 | $identificador . 'CNPJ do emitente' |
||
| 1548 | ); |
||
| 1549 | $this->dom->addChild( |
||
| 1550 | $this->emit, |
||
| 1551 | 'IE', |
||
| 1552 | $IE, |
||
| 1553 | true, |
||
| 1554 | $identificador . 'Inscrição Estadual do Emitente' |
||
| 1555 | ); |
||
| 1556 | $this->dom->addChild( |
||
| 1557 | $this->emit, |
||
| 1558 | 'xNome', |
||
| 1559 | $xNome, |
||
| 1560 | true, |
||
| 1561 | $identificador . 'Razão social ou Nome do emitente' |
||
| 1562 | ); |
||
| 1563 | $this->dom->addChild( |
||
| 1564 | $this->emit, |
||
| 1565 | 'xFant', |
||
| 1566 | $xFant, |
||
| 1567 | true, |
||
| 1568 | $identificador . 'Nome fantasia' |
||
| 1569 | ); |
||
| 1570 | return $this->emit; |
||
| 1571 | } |
||
| 1572 | |||
| 1573 | /** |
||
| 1574 | * Gera as tags para o elemento: "enderEmit" (Endereço do emitente) |
||
| 1575 | * #102 |
||
| 1576 | * Nível: 2 |
||
| 1577 | * Os parâmetros para esta função são todos os elementos da tag "enderEmit" do |
||
| 1578 | * tipo elemento (Ele = E|CE|A) e nível 3 |
||
| 1579 | * |
||
| 1580 | * @param string $xLgr Logradouro |
||
| 1581 | * @param string $nro Número |
||
| 1582 | * @param string $xCpl Complemento |
||
| 1583 | * @param string $xBairro Bairro |
||
| 1584 | * @param string $cMun Código do município (utilizar a tabela do IBGE) |
||
| 1585 | * @param string $xMun Nome do município |
||
| 1586 | * @param string $CEP CEP |
||
| 1587 | * @param string $UF Sigla da UF |
||
| 1588 | * @param string $fone Telefone |
||
| 1589 | * |
||
| 1590 | * @return \DOMElement |
||
| 1591 | */ |
||
| 1592 | public function enderEmitTag( |
||
| 1593 | $xLgr = '', |
||
| 1594 | $nro = '', |
||
| 1595 | $xCpl = '', |
||
| 1596 | $xBairro = '', |
||
| 1597 | $cMun = '', |
||
| 1598 | $xMun = '', |
||
| 1599 | $CEP = '', |
||
| 1600 | $UF = '', |
||
| 1601 | $fone = '' |
||
| 1602 | ) { |
||
| 1603 | $identificador = '#102 <enderEmit> - '; |
||
| 1604 | $this->enderEmit = $this->dom->createElement('enderEmit'); |
||
| 1605 | $this->dom->addChild( |
||
| 1606 | $this->enderEmit, |
||
| 1607 | 'xLgr', |
||
| 1608 | $xLgr, |
||
| 1609 | true, |
||
| 1610 | $identificador . 'Logradouro' |
||
| 1611 | ); |
||
| 1612 | $this->dom->addChild( |
||
| 1613 | $this->enderEmit, |
||
| 1614 | 'nro', |
||
| 1615 | $nro, |
||
| 1616 | true, |
||
| 1617 | $identificador . 'Número' |
||
| 1618 | ); |
||
| 1619 | $this->dom->addChild( |
||
| 1620 | $this->enderEmit, |
||
| 1621 | 'xCpl', |
||
| 1622 | $xCpl, |
||
| 1623 | false, |
||
| 1624 | $identificador . 'Complemento' |
||
| 1625 | ); |
||
| 1626 | $this->dom->addChild( |
||
| 1627 | $this->enderEmit, |
||
| 1628 | 'xBairro', |
||
| 1629 | $xBairro, |
||
| 1630 | true, |
||
| 1631 | $identificador . 'Bairro' |
||
| 1632 | ); |
||
| 1633 | $this->dom->addChild( |
||
| 1634 | $this->enderEmit, |
||
| 1635 | 'cMun', |
||
| 1636 | $cMun, |
||
| 1637 | true, |
||
| 1638 | $identificador . 'Código do município' |
||
| 1639 | ); |
||
| 1640 | $this->dom->addChild( |
||
| 1641 | $this->enderEmit, |
||
| 1642 | 'xMun', |
||
| 1643 | $xMun, |
||
| 1644 | true, |
||
| 1645 | $identificador . 'Nome do município' |
||
| 1646 | ); |
||
| 1647 | $this->dom->addChild( |
||
| 1648 | $this->enderEmit, |
||
| 1649 | 'CEP', |
||
| 1650 | $CEP, |
||
| 1651 | false, |
||
| 1652 | $identificador . 'CEP' |
||
| 1653 | ); |
||
| 1654 | $this->dom->addChild( |
||
| 1655 | $this->enderEmit, |
||
| 1656 | 'UF', |
||
| 1657 | $UF, |
||
| 1658 | true, |
||
| 1659 | $identificador . 'Sigla da UF' |
||
| 1660 | ); |
||
| 1661 | $this->dom->addChild( |
||
| 1662 | $this->enderEmit, |
||
| 1663 | 'fone', |
||
| 1664 | $fone, |
||
| 1665 | false, |
||
| 1666 | $identificador . 'Telefone' |
||
| 1667 | ); |
||
| 1668 | return $this->enderEmit; |
||
| 1669 | } |
||
| 1670 | |||
| 1671 | /** |
||
| 1672 | * Gera as tags para o elemento: "rem" (Informações do Remetente das mercadorias |
||
| 1673 | * transportadas pelo CT-e) |
||
| 1674 | * #112 |
||
| 1675 | * Nível = 1 |
||
| 1676 | * Os parâmetros para esta função são todos os elementos da tag "rem" do |
||
| 1677 | * tipo elemento (Ele = E|CE|A) e nível 2 |
||
| 1678 | * |
||
| 1679 | * @param string $CNPJ Número do CNPJ |
||
| 1680 | * @param string $CPF Número do CPF |
||
| 1681 | * @param string $IE Inscrição Estadual |
||
| 1682 | * @param string $xNome Razão social ou nome do remetente |
||
| 1683 | * @param string $xFant Nome fantasia |
||
| 1684 | * @param string $fone Telefone |
||
| 1685 | * @param string $email Endereço de email |
||
| 1686 | * |
||
| 1687 | * @return \DOMElement |
||
| 1688 | */ |
||
| 1689 | View Code Duplication | public function remTag($CNPJ = '', $CPF = '', $IE = '', $xNome = '', $xFant = '', $fone = '', $email = '') |
|
| 1690 | { |
||
| 1691 | $identificador = '#97 <rem> - '; |
||
| 1692 | $this->rem = $this->dom->createElement('rem'); |
||
| 1693 | if ($CNPJ != '') { |
||
| 1694 | $this->dom->addChild( |
||
| 1695 | $this->rem, |
||
| 1696 | 'CNPJ', |
||
| 1697 | $CNPJ, |
||
| 1698 | true, |
||
| 1699 | $identificador . 'CNPJ do Remente' |
||
| 1700 | ); |
||
| 1701 | } elseif ($CPF != '') { |
||
| 1702 | $this->dom->addChild( |
||
| 1703 | $this->rem, |
||
| 1704 | 'CPF', |
||
| 1705 | $CPF, |
||
| 1706 | true, |
||
| 1707 | $identificador . 'CPF do Remente' |
||
| 1708 | ); |
||
| 1709 | } else { |
||
| 1710 | $this->dom->addChild( |
||
| 1711 | $this->rem, |
||
| 1712 | 'CNPJ', |
||
| 1713 | $CNPJ, |
||
| 1714 | true, |
||
| 1715 | $identificador . 'CNPJ do Remente' |
||
| 1716 | ); |
||
| 1717 | $this->dom->addChild( |
||
| 1718 | $this->rem, |
||
| 1719 | 'CPF', |
||
| 1720 | $CPF, |
||
| 1721 | true, |
||
| 1722 | $identificador . 'CPF do remente' |
||
| 1723 | ); |
||
| 1724 | } |
||
| 1725 | $this->dom->addChild( |
||
| 1726 | $this->rem, |
||
| 1727 | 'IE', |
||
| 1728 | $IE, |
||
| 1729 | true, |
||
| 1730 | $identificador . 'Inscrição Estadual do remente' |
||
| 1731 | ); |
||
| 1732 | $this->dom->addChild( |
||
| 1733 | $this->rem, |
||
| 1734 | 'xNome', |
||
| 1735 | $xNome, |
||
| 1736 | true, |
||
| 1737 | $identificador . 'Razão social ou Nome do remente' |
||
| 1738 | ); |
||
| 1739 | $this->dom->addChild( |
||
| 1740 | $this->rem, |
||
| 1741 | 'xFant', |
||
| 1742 | $xFant, |
||
| 1743 | false, |
||
| 1744 | $identificador . 'Nome fantasia' |
||
| 1745 | ); |
||
| 1746 | $this->dom->addChild( |
||
| 1747 | $this->rem, |
||
| 1748 | 'fone', |
||
| 1749 | $fone, |
||
| 1750 | false, |
||
| 1751 | $identificador . 'Telefone' |
||
| 1752 | ); |
||
| 1753 | $this->dom->addChild( |
||
| 1754 | $this->rem, |
||
| 1755 | 'email', |
||
| 1756 | $email, |
||
| 1757 | false, |
||
| 1758 | $identificador . 'Endereço de email' |
||
| 1759 | ); |
||
| 1760 | return $this->rem; |
||
| 1761 | } |
||
| 1762 | |||
| 1763 | /** |
||
| 1764 | * Gera as tags para o elemento: "enderReme" (Dados do endereço) |
||
| 1765 | * #119 |
||
| 1766 | * Nível: 2 |
||
| 1767 | * Os parâmetros para esta função são todos os elementos da tag "enderReme" do |
||
| 1768 | * tipo elemento (Ele = E|CE|A) e nível 3 |
||
| 1769 | * |
||
| 1770 | * @param string $xLgr Logradouro |
||
| 1771 | * @param string $nro Número |
||
| 1772 | * @param string $xCpl Complemento |
||
| 1773 | * @param string $xBairro Bairro |
||
| 1774 | * @param string $cMun Código do município (utilizar a tabela do IBGE) |
||
| 1775 | * @param string $xMun Nome do município |
||
| 1776 | * @param string $CEP CEP |
||
| 1777 | * @param string $UF Sigla da UF |
||
| 1778 | * @param string $cPais Código do país |
||
| 1779 | * @param string $xPais Nome do país |
||
| 1780 | * |
||
| 1781 | * @return \DOMElement |
||
| 1782 | */ |
||
| 1783 | View Code Duplication | public function enderRemeTag( |
|
| 1784 | $xLgr = '', |
||
| 1785 | $nro = '', |
||
| 1786 | $xCpl = '', |
||
| 1787 | $xBairro = '', |
||
| 1788 | $cMun = '', |
||
| 1789 | $xMun = '', |
||
| 1790 | $CEP = '', |
||
| 1791 | $UF = '', |
||
| 1792 | $cPais = '', |
||
| 1793 | $xPais = '' |
||
| 1794 | ) { |
||
| 1795 | $identificador = '#119 <enderReme> - '; |
||
| 1796 | $this->enderReme = $this->dom->createElement('enderReme'); |
||
| 1797 | $this->dom->addChild( |
||
| 1798 | $this->enderReme, |
||
| 1799 | 'xLgr', |
||
| 1800 | $xLgr, |
||
| 1801 | true, |
||
| 1802 | $identificador . 'Logradouro' |
||
| 1803 | ); |
||
| 1804 | $this->dom->addChild( |
||
| 1805 | $this->enderReme, |
||
| 1806 | 'nro', |
||
| 1807 | $nro, |
||
| 1808 | true, |
||
| 1809 | $identificador . 'Número' |
||
| 1810 | ); |
||
| 1811 | $this->dom->addChild( |
||
| 1812 | $this->enderReme, |
||
| 1813 | 'xCpl', |
||
| 1814 | $xCpl, |
||
| 1815 | false, |
||
| 1816 | $identificador . 'Complemento' |
||
| 1817 | ); |
||
| 1818 | $this->dom->addChild( |
||
| 1819 | $this->enderReme, |
||
| 1820 | 'xBairro', |
||
| 1821 | $xBairro, |
||
| 1822 | true, |
||
| 1823 | $identificador . 'Bairro' |
||
| 1824 | ); |
||
| 1825 | $this->dom->addChild( |
||
| 1826 | $this->enderReme, |
||
| 1827 | 'cMun', |
||
| 1828 | $cMun, |
||
| 1829 | true, |
||
| 1830 | $identificador . 'Código do município (utilizar a tabela do IBGE)' |
||
| 1831 | ); |
||
| 1832 | $this->dom->addChild( |
||
| 1833 | $this->enderReme, |
||
| 1834 | 'xMun', |
||
| 1835 | $xMun, |
||
| 1836 | true, |
||
| 1837 | $identificador . 'Nome do município' |
||
| 1838 | ); |
||
| 1839 | $this->dom->addChild( |
||
| 1840 | $this->enderReme, |
||
| 1841 | 'CEP', |
||
| 1842 | $CEP, |
||
| 1843 | false, |
||
| 1844 | $identificador . 'CEP' |
||
| 1845 | ); |
||
| 1846 | $this->dom->addChild( |
||
| 1847 | $this->enderReme, |
||
| 1848 | 'UF', |
||
| 1849 | $UF, |
||
| 1850 | true, |
||
| 1851 | $identificador . 'Sigla da UF' |
||
| 1852 | ); |
||
| 1853 | $this->dom->addChild( |
||
| 1854 | $this->enderReme, |
||
| 1855 | 'cPais', |
||
| 1856 | $cPais, |
||
| 1857 | false, |
||
| 1858 | $identificador . 'Código do país' |
||
| 1859 | ); |
||
| 1860 | $this->dom->addChild( |
||
| 1861 | $this->enderReme, |
||
| 1862 | 'xPais', |
||
| 1863 | $xPais, |
||
| 1864 | false, |
||
| 1865 | $identificador . 'Nome do país' |
||
| 1866 | ); |
||
| 1867 | |||
| 1868 | $node = $this->rem->getElementsByTagName("email")->item(0); |
||
| 1869 | $this->rem->insertBefore($this->enderReme, $node); |
||
| 1870 | return $this->enderReme; |
||
| 1871 | } |
||
| 1872 | |||
| 1873 | /** |
||
| 1874 | * Gera as tags para o elemento: "exped" (Informações do Expedidor da Carga) |
||
| 1875 | * #142 |
||
| 1876 | * Nível: 1 |
||
| 1877 | * Os parâmetros para esta função são todos os elementos da tag "exped" do |
||
| 1878 | * tipo elemento (Ele = E|CE|A) e nível 2 |
||
| 1879 | * |
||
| 1880 | * @param string $CNPJ Número do CNPJ |
||
| 1881 | * @param string $CPF Número do CPF |
||
| 1882 | * @param string $IE Inscrição Estadual |
||
| 1883 | * @param string $xNome Razão Social ou Nome |
||
| 1884 | * @param string $fone Telefone |
||
| 1885 | * @param string $email Endereço de email |
||
| 1886 | * |
||
| 1887 | * @return \DOMElement |
||
| 1888 | */ |
||
| 1889 | View Code Duplication | public function expedTag($CNPJ = '', $CPF = '', $IE = '', $xNome = '', $fone = '', $email = '') |
|
| 1890 | { |
||
| 1891 | $identificador = '#142 <exped> - '; |
||
| 1892 | $this->exped = $this->dom->createElement('exped'); |
||
| 1893 | if ($CNPJ != '') { |
||
| 1894 | $this->dom->addChild( |
||
| 1895 | $this->exped, |
||
| 1896 | 'CNPJ', |
||
| 1897 | $CNPJ, |
||
| 1898 | true, |
||
| 1899 | $identificador . 'Número do CNPJ' |
||
| 1900 | ); |
||
| 1901 | } elseif ($CPF != '') { |
||
| 1902 | $this->dom->addChild( |
||
| 1903 | $this->exped, |
||
| 1904 | 'CPF', |
||
| 1905 | $CPF, |
||
| 1906 | true, |
||
| 1907 | $identificador . 'Número do CPF' |
||
| 1908 | ); |
||
| 1909 | } else { |
||
| 1910 | $this->dom->addChild( |
||
| 1911 | $this->exped, |
||
| 1912 | 'CNPJ', |
||
| 1913 | $CNPJ, |
||
| 1914 | true, |
||
| 1915 | $identificador . 'Número do CNPJ' |
||
| 1916 | ); |
||
| 1917 | $this->dom->addChild( |
||
| 1918 | $this->exped, |
||
| 1919 | 'CPF', |
||
| 1920 | $CPF, |
||
| 1921 | true, |
||
| 1922 | $identificador . 'Número do CPF' |
||
| 1923 | ); |
||
| 1924 | } |
||
| 1925 | $this->dom->addChild( |
||
| 1926 | $this->exped, |
||
| 1927 | 'IE', |
||
| 1928 | $IE, |
||
| 1929 | true, |
||
| 1930 | $identificador . 'Inscrição Estadual' |
||
| 1931 | ); |
||
| 1932 | $this->dom->addChild( |
||
| 1933 | $this->exped, |
||
| 1934 | 'xNome', |
||
| 1935 | $xNome, |
||
| 1936 | true, |
||
| 1937 | $identificador . 'Razão social ou Nome' |
||
| 1938 | ); |
||
| 1939 | $this->dom->addChild( |
||
| 1940 | $this->exped, |
||
| 1941 | 'fone', |
||
| 1942 | $fone, |
||
| 1943 | false, |
||
| 1944 | $identificador . 'Telefone' |
||
| 1945 | ); |
||
| 1946 | $this->dom->addChild( |
||
| 1947 | $this->exped, |
||
| 1948 | 'email', |
||
| 1949 | $email, |
||
| 1950 | false, |
||
| 1951 | $identificador . 'Endereço de email' |
||
| 1952 | ); |
||
| 1953 | return $this->exped; |
||
| 1954 | } |
||
| 1955 | |||
| 1956 | /** |
||
| 1957 | * Gera as tags para o elemento: "enderExped" (Dados do endereço) |
||
| 1958 | * #148 |
||
| 1959 | * Nível: 2 |
||
| 1960 | * Os parâmetros para esta função são todos os elementos da tag "enderExped" do |
||
| 1961 | * tipo elemento (Ele = E|CE|A) e nível 3 |
||
| 1962 | * |
||
| 1963 | * @param string $xLgr Logradouro |
||
| 1964 | * @param string $nro Número |
||
| 1965 | * @param string $xCpl Complemento |
||
| 1966 | * @param string $xBairro Bairro |
||
| 1967 | * @param string $cMun Código do município (utilizar a tabela do IBGE) |
||
| 1968 | * @param string $xMun Nome do município |
||
| 1969 | * @param string $CEP CEP |
||
| 1970 | * @param string $UF Sigla da UF |
||
| 1971 | * @param string $cPais Código do país |
||
| 1972 | * @param string $xPais Nome do país |
||
| 1973 | * |
||
| 1974 | * @return \DOMElement |
||
| 1975 | */ |
||
| 1976 | View Code Duplication | public function enderExpedTag( |
|
| 1977 | $xLgr = '', |
||
| 1978 | $nro = '', |
||
| 1979 | $xCpl = '', |
||
| 1980 | $xBairro = '', |
||
| 1981 | $cMun = '', |
||
| 1982 | $xMun = '', |
||
| 1983 | $CEP = '', |
||
| 1984 | $UF = '', |
||
| 1985 | $cPais = '', |
||
| 1986 | $xPais = '' |
||
| 1987 | ) { |
||
| 1988 | $identificador = '#148 <enderExped> - '; |
||
| 1989 | $this->enderExped = $this->dom->createElement('enderExped'); |
||
| 1990 | $this->dom->addChild( |
||
| 1991 | $this->enderExped, |
||
| 1992 | 'xLgr', |
||
| 1993 | $xLgr, |
||
| 1994 | true, |
||
| 1995 | $identificador . 'Logradouro' |
||
| 1996 | ); |
||
| 1997 | $this->dom->addChild( |
||
| 1998 | $this->enderExped, |
||
| 1999 | 'nro', |
||
| 2000 | $nro, |
||
| 2001 | true, |
||
| 2002 | $identificador . 'Número' |
||
| 2003 | ); |
||
| 2004 | $this->dom->addChild( |
||
| 2005 | $this->enderExped, |
||
| 2006 | 'xCpl', |
||
| 2007 | $xCpl, |
||
| 2008 | false, |
||
| 2009 | $identificador . 'Complemento' |
||
| 2010 | ); |
||
| 2011 | $this->dom->addChild( |
||
| 2012 | $this->enderExped, |
||
| 2013 | 'xBairro', |
||
| 2014 | $xBairro, |
||
| 2015 | true, |
||
| 2016 | $identificador . 'Bairro' |
||
| 2017 | ); |
||
| 2018 | $this->dom->addChild( |
||
| 2019 | $this->enderExped, |
||
| 2020 | 'cMun', |
||
| 2021 | $cMun, |
||
| 2022 | true, |
||
| 2023 | $identificador . 'Código do município (utilizar a tabela do IBGE)' |
||
| 2024 | ); |
||
| 2025 | $this->dom->addChild( |
||
| 2026 | $this->enderExped, |
||
| 2027 | 'xMun', |
||
| 2028 | $xMun, |
||
| 2029 | true, |
||
| 2030 | $identificador . 'Nome do município' |
||
| 2031 | ); |
||
| 2032 | $this->dom->addChild( |
||
| 2033 | $this->enderExped, |
||
| 2034 | 'CEP', |
||
| 2035 | $CEP, |
||
| 2036 | false, |
||
| 2037 | $identificador . 'CEP' |
||
| 2038 | ); |
||
| 2039 | $this->dom->addChild( |
||
| 2040 | $this->enderExped, |
||
| 2041 | 'UF', |
||
| 2042 | $UF, |
||
| 2043 | true, |
||
| 2044 | $identificador . 'Sigla da UF' |
||
| 2045 | ); |
||
| 2046 | $this->dom->addChild( |
||
| 2047 | $this->enderExped, |
||
| 2048 | 'cPais', |
||
| 2049 | $cPais, |
||
| 2050 | false, |
||
| 2051 | $identificador . 'Código do país' |
||
| 2052 | ); |
||
| 2053 | $this->dom->addChild( |
||
| 2054 | $this->enderExped, |
||
| 2055 | 'xPais', |
||
| 2056 | $xPais, |
||
| 2057 | false, |
||
| 2058 | $identificador . 'Nome do país' |
||
| 2059 | ); |
||
| 2060 | |||
| 2061 | $node = $this->exped->getElementsByTagName("email")->item(0); |
||
| 2062 | $this->exped->insertBefore($this->enderExped, $node); |
||
| 2063 | return $this->enderExped; |
||
| 2064 | } |
||
| 2065 | |||
| 2066 | /** |
||
| 2067 | * Gera as tags para o elemento: "receb" (Informações do Recebedor da Carga) |
||
| 2068 | * #160 |
||
| 2069 | * Nível: 1 |
||
| 2070 | * Os parâmetros para esta função são todos os elementos da tag "receb" do |
||
| 2071 | * tipo elemento (Ele = E|CE|A) e nível 2 |
||
| 2072 | * |
||
| 2073 | * @param string $CNPJ Número do CNPJ |
||
| 2074 | * @param string $CPF Número do CPF |
||
| 2075 | * @param string $IE Inscrição Estadual |
||
| 2076 | * @param string $xNome Razão Social ou Nome |
||
| 2077 | * @param string $fone Telefone |
||
| 2078 | * @param string $email Endereço de email |
||
| 2079 | * |
||
| 2080 | * @return \DOMElement |
||
| 2081 | */ |
||
| 2082 | View Code Duplication | public function recebTag($CNPJ = '', $CPF = '', $IE = '', $xNome = '', $fone = '', $email = '') |
|
| 2083 | { |
||
| 2084 | $identificador = '#160 <receb> - '; |
||
| 2085 | $this->receb = $this->dom->createElement('receb'); |
||
| 2086 | if ($CNPJ != '') { |
||
| 2087 | $this->dom->addChild( |
||
| 2088 | $this->receb, |
||
| 2089 | 'CNPJ', |
||
| 2090 | $CNPJ, |
||
| 2091 | true, |
||
| 2092 | $identificador . 'Número do CNPJ' |
||
| 2093 | ); |
||
| 2094 | } elseif ($CPF != '') { |
||
| 2095 | $this->dom->addChild( |
||
| 2096 | $this->receb, |
||
| 2097 | 'CPF', |
||
| 2098 | $CPF, |
||
| 2099 | true, |
||
| 2100 | $identificador . 'Número do CPF' |
||
| 2101 | ); |
||
| 2102 | } else { |
||
| 2103 | $this->dom->addChild( |
||
| 2104 | $this->receb, |
||
| 2105 | 'CNPJ', |
||
| 2106 | $CNPJ, |
||
| 2107 | true, |
||
| 2108 | $identificador . 'Número do CNPJ' |
||
| 2109 | ); |
||
| 2110 | $this->dom->addChild( |
||
| 2111 | $this->receb, |
||
| 2112 | 'CPF', |
||
| 2113 | $CPF, |
||
| 2114 | true, |
||
| 2115 | $identificador . 'Número do CPF' |
||
| 2116 | ); |
||
| 2117 | } |
||
| 2118 | $this->dom->addChild( |
||
| 2119 | $this->receb, |
||
| 2120 | 'IE', |
||
| 2121 | $IE, |
||
| 2122 | true, |
||
| 2123 | $identificador . 'Inscrição Estadual' |
||
| 2124 | ); |
||
| 2125 | $this->dom->addChild( |
||
| 2126 | $this->receb, |
||
| 2127 | 'xNome', |
||
| 2128 | $xNome, |
||
| 2129 | true, |
||
| 2130 | $identificador . 'Razão social ou Nome' |
||
| 2131 | ); |
||
| 2132 | $this->dom->addChild( |
||
| 2133 | $this->receb, |
||
| 2134 | 'fone', |
||
| 2135 | $fone, |
||
| 2136 | false, |
||
| 2137 | $identificador . 'Telefone' |
||
| 2138 | ); |
||
| 2139 | $this->dom->addChild( |
||
| 2140 | $this->receb, |
||
| 2141 | 'email', |
||
| 2142 | $email, |
||
| 2143 | false, |
||
| 2144 | $identificador . 'Endereço de email' |
||
| 2145 | ); |
||
| 2146 | return $this->receb; |
||
| 2147 | } |
||
| 2148 | |||
| 2149 | /** |
||
| 2150 | * Gera as tags para o elemento: "enderReceb" (Informações do Recebedor da Carga) |
||
| 2151 | * #166 |
||
| 2152 | * Nível: 2 |
||
| 2153 | * Os parâmetros para esta função são todos os elementos da tag "enderReceb" do |
||
| 2154 | * tipo elemento (Ele = E|CE|A) e nível 3 |
||
| 2155 | * |
||
| 2156 | * @param string $xLgr Logradouro |
||
| 2157 | * @param string $nro Número |
||
| 2158 | * @param string $xCpl Complemento |
||
| 2159 | * @param string $xBairro Bairro |
||
| 2160 | * @param string $cMun Código do município (utilizar a tabela do IBGE) |
||
| 2161 | * @param string $xMun Nome do município |
||
| 2162 | * @param string $CEP CEP |
||
| 2163 | * @param string $UF Sigla da UF |
||
| 2164 | * @param string $cPais Código do país |
||
| 2165 | * @param string $xPais Nome do país |
||
| 2166 | * |
||
| 2167 | * @return \DOMElement |
||
| 2168 | */ |
||
| 2169 | View Code Duplication | public function enderRecebTag( |
|
| 2170 | $xLgr = '', |
||
| 2171 | $nro = '', |
||
| 2172 | $xCpl = '', |
||
| 2173 | $xBairro = '', |
||
| 2174 | $cMun = '', |
||
| 2175 | $xMun = '', |
||
| 2176 | $CEP = '', |
||
| 2177 | $UF = '', |
||
| 2178 | $cPais = '', |
||
| 2179 | $xPais = '' |
||
| 2180 | ) { |
||
| 2181 | $identificador = '#160 <enderReceb> - '; |
||
| 2182 | $this->enderReceb = $this->dom->createElement('enderReceb'); |
||
| 2183 | $this->dom->addChild( |
||
| 2184 | $this->enderReceb, |
||
| 2185 | 'xLgr', |
||
| 2186 | $xLgr, |
||
| 2187 | true, |
||
| 2188 | $identificador . 'Logradouro' |
||
| 2189 | ); |
||
| 2190 | $this->dom->addChild( |
||
| 2191 | $this->enderReceb, |
||
| 2192 | 'nro', |
||
| 2193 | $nro, |
||
| 2194 | true, |
||
| 2195 | $identificador . 'Número' |
||
| 2196 | ); |
||
| 2197 | $this->dom->addChild( |
||
| 2198 | $this->enderReceb, |
||
| 2199 | 'xCpl', |
||
| 2200 | $xCpl, |
||
| 2201 | false, |
||
| 2202 | $identificador . 'Complemento' |
||
| 2203 | ); |
||
| 2204 | $this->dom->addChild( |
||
| 2205 | $this->enderReceb, |
||
| 2206 | 'xBairro', |
||
| 2207 | $xBairro, |
||
| 2208 | true, |
||
| 2209 | $identificador . 'Bairro' |
||
| 2210 | ); |
||
| 2211 | $this->dom->addChild( |
||
| 2212 | $this->enderReceb, |
||
| 2213 | 'cMun', |
||
| 2214 | $cMun, |
||
| 2215 | true, |
||
| 2216 | $identificador . 'Código do município (utilizar a tabela do IBGE)' |
||
| 2217 | ); |
||
| 2218 | $this->dom->addChild( |
||
| 2219 | $this->enderReceb, |
||
| 2220 | 'xMun', |
||
| 2221 | $xMun, |
||
| 2222 | true, |
||
| 2223 | $identificador . 'Nome do município' |
||
| 2224 | ); |
||
| 2225 | $this->dom->addChild( |
||
| 2226 | $this->enderReceb, |
||
| 2227 | 'CEP', |
||
| 2228 | $CEP, |
||
| 2229 | false, |
||
| 2230 | $identificador . 'CEP' |
||
| 2231 | ); |
||
| 2232 | $this->dom->addChild( |
||
| 2233 | $this->enderReceb, |
||
| 2234 | 'UF', |
||
| 2235 | $UF, |
||
| 2236 | true, |
||
| 2237 | $identificador . 'Sigla da UF' |
||
| 2238 | ); |
||
| 2239 | $this->dom->addChild( |
||
| 2240 | $this->enderReceb, |
||
| 2241 | 'cPais', |
||
| 2242 | $cPais, |
||
| 2243 | false, |
||
| 2244 | $identificador . 'Código do país' |
||
| 2245 | ); |
||
| 2246 | $this->dom->addChild( |
||
| 2247 | $this->enderReceb, |
||
| 2248 | 'xPais', |
||
| 2249 | $xPais, |
||
| 2250 | false, |
||
| 2251 | $identificador . 'Nome do país' |
||
| 2252 | ); |
||
| 2253 | |||
| 2254 | $node = $this->receb->getElementsByTagName("email")->item(0); |
||
| 2255 | $this->receb->insertBefore($this->enderReceb, $node); |
||
| 2256 | return $this->enderReceb; |
||
| 2257 | } |
||
| 2258 | |||
| 2259 | /** |
||
| 2260 | * Gera as tags para o elemento: "dest" (Informações do Destinatário do CT-e) |
||
| 2261 | * #178 |
||
| 2262 | * Nível: 1 |
||
| 2263 | * Os parâmetros para esta função são todos os elementos da tag "dest" do |
||
| 2264 | * tipo elemento (Ele = E|CE|A) e nível 2 |
||
| 2265 | * |
||
| 2266 | * @param string $CNPJ Número do CNPJ |
||
| 2267 | * @param string $CPF Número do CPF |
||
| 2268 | * @param string $IE Inscrição Estadual |
||
| 2269 | * @param string $xNome Razão Social ou Nome |
||
| 2270 | * @param string $fone Telefone |
||
| 2271 | * @param string $ISUF Inscrição na SUFRAMA |
||
| 2272 | * @param string $email Endereço de email |
||
| 2273 | * |
||
| 2274 | * @return \DOMElement |
||
| 2275 | */ |
||
| 2276 | View Code Duplication | public function destTag($CNPJ = '', $CPF = '', $IE = '', $xNome = '', $fone = '', $ISUF = '', $email = '') |
|
| 2277 | { |
||
| 2278 | $identificador = '#178 <dest> - '; |
||
| 2279 | $this->dest = $this->dom->createElement('dest'); |
||
| 2280 | if ($CNPJ != '') { |
||
| 2281 | $this->dom->addChild( |
||
| 2282 | $this->dest, |
||
| 2283 | 'CNPJ', |
||
| 2284 | $CNPJ, |
||
| 2285 | true, |
||
| 2286 | $identificador . 'Número do CNPJ' |
||
| 2287 | ); |
||
| 2288 | } elseif ($CPF != '') { |
||
| 2289 | $this->dom->addChild( |
||
| 2290 | $this->dest, |
||
| 2291 | 'CPF', |
||
| 2292 | $CPF, |
||
| 2293 | true, |
||
| 2294 | $identificador . 'Número do CPF' |
||
| 2295 | ); |
||
| 2296 | } else { |
||
| 2297 | $this->dom->addChild( |
||
| 2298 | $this->dest, |
||
| 2299 | 'CNPJ', |
||
| 2300 | $CNPJ, |
||
| 2301 | true, |
||
| 2302 | $identificador . 'Número do CNPJ' |
||
| 2303 | ); |
||
| 2304 | $this->dom->addChild( |
||
| 2305 | $this->dest, |
||
| 2306 | 'CPF', |
||
| 2307 | $CPF, |
||
| 2308 | true, |
||
| 2309 | $identificador . 'Número do CPF' |
||
| 2310 | ); |
||
| 2311 | } |
||
| 2312 | $this->dom->addChild( |
||
| 2313 | $this->dest, |
||
| 2314 | 'IE', |
||
| 2315 | $IE, |
||
| 2316 | true, |
||
| 2317 | $identificador . 'Inscrição Estadual' |
||
| 2318 | ); |
||
| 2319 | $this->dom->addChild( |
||
| 2320 | $this->dest, |
||
| 2321 | 'xNome', |
||
| 2322 | $xNome, |
||
| 2323 | true, |
||
| 2324 | $identificador . 'Razão social ou Nome' |
||
| 2325 | ); |
||
| 2326 | $this->dom->addChild( |
||
| 2327 | $this->dest, |
||
| 2328 | 'fone', |
||
| 2329 | $fone, |
||
| 2330 | false, |
||
| 2331 | $identificador . 'Telefone' |
||
| 2332 | ); |
||
| 2333 | $this->dom->addChild( |
||
| 2334 | $this->dest, |
||
| 2335 | 'ISUF', |
||
| 2336 | $ISUF, |
||
| 2337 | false, |
||
| 2338 | $identificador . 'Inscrição na SUFRAMA' |
||
| 2339 | ); |
||
| 2340 | $this->dom->addChild( |
||
| 2341 | $this->dest, |
||
| 2342 | 'email', |
||
| 2343 | $email, |
||
| 2344 | false, |
||
| 2345 | $identificador . 'Endereço de email' |
||
| 2346 | ); |
||
| 2347 | return $this->dest; |
||
| 2348 | } |
||
| 2349 | |||
| 2350 | /** |
||
| 2351 | * Gera as tags para o elemento: "enderDest" (Informações do Recebedor da Carga) |
||
| 2352 | * # = 185 |
||
| 2353 | * Nível = 2 |
||
| 2354 | * Os parâmetros para esta função são todos os elementos da tag "enderDest" do |
||
| 2355 | * tipo elemento (Ele = E|CE|A) e nível 3 |
||
| 2356 | * |
||
| 2357 | * @param string $xLgr Logradouro |
||
| 2358 | * @param string $nro Número |
||
| 2359 | * @param string $xCpl Complemento |
||
| 2360 | * @param string $xBairro Bairro |
||
| 2361 | * @param string $cMun Código do município (utilizar a tabela do IBGE) |
||
| 2362 | * @param string $xMun Nome do município |
||
| 2363 | * @param string $CEP CEP |
||
| 2364 | * @param string $UF Sigla da UF |
||
| 2365 | * @param string $cPais Código do país |
||
| 2366 | * @param string $xPais Nome do país |
||
| 2367 | * |
||
| 2368 | * @return \DOMElement |
||
| 2369 | */ |
||
| 2370 | View Code Duplication | public function enderDestTag( |
|
| 2371 | $xLgr = '', |
||
| 2372 | $nro = '', |
||
| 2373 | $xCpl = '', |
||
| 2374 | $xBairro = '', |
||
| 2375 | $cMun = '', |
||
| 2376 | $xMun = '', |
||
| 2377 | $CEP = '', |
||
| 2378 | $UF = '', |
||
| 2379 | $cPais = '', |
||
| 2380 | $xPais = '' |
||
| 2381 | ) { |
||
| 2382 | $identificador = '#185 <enderDest> - '; |
||
| 2383 | $this->enderDest = $this->dom->createElement('enderDest'); |
||
| 2384 | $this->dom->addChild( |
||
| 2385 | $this->enderDest, |
||
| 2386 | 'xLgr', |
||
| 2387 | $xLgr, |
||
| 2388 | true, |
||
| 2389 | $identificador . 'Logradouro' |
||
| 2390 | ); |
||
| 2391 | $this->dom->addChild( |
||
| 2392 | $this->enderDest, |
||
| 2393 | 'nro', |
||
| 2394 | $nro, |
||
| 2395 | true, |
||
| 2396 | $identificador . 'Número' |
||
| 2397 | ); |
||
| 2398 | $this->dom->addChild( |
||
| 2399 | $this->enderDest, |
||
| 2400 | 'xCpl', |
||
| 2401 | $xCpl, |
||
| 2402 | false, |
||
| 2403 | $identificador . 'Complemento' |
||
| 2404 | ); |
||
| 2405 | $this->dom->addChild( |
||
| 2406 | $this->enderDest, |
||
| 2407 | 'xBairro', |
||
| 2408 | $xBairro, |
||
| 2409 | true, |
||
| 2410 | $identificador . 'Bairro' |
||
| 2411 | ); |
||
| 2412 | $this->dom->addChild( |
||
| 2413 | $this->enderDest, |
||
| 2414 | 'cMun', |
||
| 2415 | $cMun, |
||
| 2416 | true, |
||
| 2417 | $identificador . 'Código do município (utilizar a tabela do IBGE)' |
||
| 2418 | ); |
||
| 2419 | $this->dom->addChild( |
||
| 2420 | $this->enderDest, |
||
| 2421 | 'xMun', |
||
| 2422 | $xMun, |
||
| 2423 | true, |
||
| 2424 | $identificador . 'Nome do município' |
||
| 2425 | ); |
||
| 2426 | $this->dom->addChild( |
||
| 2427 | $this->enderDest, |
||
| 2428 | 'CEP', |
||
| 2429 | $CEP, |
||
| 2430 | false, |
||
| 2431 | $identificador . 'CEP' |
||
| 2432 | ); |
||
| 2433 | $this->dom->addChild( |
||
| 2434 | $this->enderDest, |
||
| 2435 | 'UF', |
||
| 2436 | $UF, |
||
| 2437 | true, |
||
| 2438 | $identificador . 'Sigla da UF' |
||
| 2439 | ); |
||
| 2440 | $this->dom->addChild( |
||
| 2441 | $this->enderDest, |
||
| 2442 | 'cPais', |
||
| 2443 | $cPais, |
||
| 2444 | false, |
||
| 2445 | $identificador . 'Código do país' |
||
| 2446 | ); |
||
| 2447 | $this->dom->addChild( |
||
| 2448 | $this->enderDest, |
||
| 2449 | 'xPais', |
||
| 2450 | $xPais, |
||
| 2451 | false, |
||
| 2452 | $identificador . 'Nome do país' |
||
| 2453 | ); |
||
| 2454 | $node = $this->dest->getElementsByTagName("email")->item(0); |
||
| 2455 | $this->dest->insertBefore($this->enderDest, $node); |
||
| 2456 | return $this->enderDest; |
||
| 2457 | } |
||
| 2458 | |||
| 2459 | /** |
||
| 2460 | * Gera as tags para o elemento: "vPrest" (Local de Entrega constante na Nota Fiscal) |
||
| 2461 | * #208 |
||
| 2462 | * Nível: 1 |
||
| 2463 | * Os parâmetros para esta função são todos os elementos da tag "vPrest" do |
||
| 2464 | * tipo elemento (Ele = E|CE|A) e nível 2 |
||
| 2465 | * |
||
| 2466 | * @param string $vTPrest Valor Total da Prestação do Serviço |
||
| 2467 | * @param string $vRec Valor a Receber |
||
| 2468 | * |
||
| 2469 | * @return \DOMElement |
||
| 2470 | */ |
||
| 2471 | public function vPrestTag($vTPrest = '', $vRec = '') |
||
| 2472 | { |
||
| 2473 | $identificador = '#208 <vPrest> - '; |
||
| 2474 | $this->vPrest = $this->dom->createElement('vPrest'); |
||
| 2475 | $this->dom->addChild( |
||
| 2476 | $this->vPrest, |
||
| 2477 | 'vTPrest', |
||
| 2478 | $vTPrest, |
||
| 2479 | true, |
||
| 2480 | $identificador . 'Valor Total da Prestação do Serviço' |
||
| 2481 | ); |
||
| 2482 | $this->dom->addChild( |
||
| 2483 | $this->vPrest, |
||
| 2484 | 'vRec', |
||
| 2485 | $vRec, |
||
| 2486 | true, |
||
| 2487 | $identificador . 'Valor a Receber' |
||
| 2488 | ); |
||
| 2489 | return $this->vPrest; |
||
| 2490 | } |
||
| 2491 | |||
| 2492 | |||
| 2493 | /** |
||
| 2494 | * tagICMS |
||
| 2495 | * Informações do ICMS da Operação própria e ST N01 pai M01 |
||
| 2496 | * tag NFe/infNFe/det[]/imposto/ICMS |
||
| 2497 | * @param string $nItem |
||
| 2498 | * @param string $orig |
||
| 2499 | * @param string $CST |
||
| 2500 | * @param string $modBC |
||
| 2501 | * @param string $vBC |
||
| 2502 | * @param string $pICMS |
||
| 2503 | * @param string $vICMS |
||
| 2504 | * @param string $vICMSDeson |
||
| 2505 | * @param string $motDesICMS |
||
| 2506 | * @param string $modBCST |
||
| 2507 | * @param string $pMVAST |
||
| 2508 | * @param string $pRedBCST |
||
| 2509 | * @param string $vBCST |
||
| 2510 | * @param string $pICMSST |
||
| 2511 | * @param string $vICMSST |
||
| 2512 | * @param string $pDif |
||
| 2513 | * @param string $vICMSDif |
||
| 2514 | * @param string $vICMSOp |
||
| 2515 | * @param string $vBCSTRet |
||
| 2516 | * @param string $vICMSSTRet |
||
| 2517 | * @return DOMElement |
||
| 2518 | */ |
||
| 2519 | public function icmsTag( |
||
| 2520 | $cst = '', |
||
| 2521 | $pRedBC = '', |
||
| 2522 | $vBC = '', |
||
| 2523 | $pICMS = '', |
||
| 2524 | $vICMS = '', |
||
| 2525 | $vBCSTRet = '', |
||
| 2526 | $vICMSSTRet = '', |
||
| 2527 | $pICMSSTRet = '', |
||
| 2528 | $vCred = '', |
||
| 2529 | $vTotTrib = '', |
||
| 2530 | $outraUF = false |
||
| 2531 | ) { |
||
| 2532 | $identificador = 'N01 <ICMSxx> - '; |
||
| 2533 | switch ($cst) { |
||
| 2534 | case '00': |
||
| 2535 | $icms = $this->dom->createElement("ICMS00"); |
||
| 2536 | $this->dom->addChild($icms, 'CST', $cst, true, "$identificador Tributação do ICMS = 00"); |
||
| 2537 | $this->dom->addChild($icms, 'vBC', $vBC, true, "$identificador Valor da BC do ICMS"); |
||
| 2538 | $this->dom->addChild($icms, 'pICMS', $pICMS, true, "$identificador Alíquota do imposto"); |
||
| 2539 | $this->dom->addChild($icms, 'vICMS', $vICMS, true, "$identificador Valor do ICMS"); |
||
| 2540 | break; |
||
| 2541 | case '20': |
||
| 2542 | $icms = $this->dom->createElement("ICMS20"); |
||
| 2543 | $this->dom->addChild($icms, 'CST', $cst, true, "$identificador Tributação do ICMS = 20"); |
||
| 2544 | $this->dom->addChild($icms, 'pRedBC', $pRedBC, true, "$identificador Percentual da Redução de BC"); |
||
| 2545 | $this->dom->addChild($icms, 'vBC', $vBC, true, "$identificador Valor da BC do ICMS"); |
||
| 2546 | $this->dom->addChild($icms, 'pICMS', $pICMS, true, "$identificador Alíquota do imposto"); |
||
| 2547 | $this->dom->addChild($icms, 'vICMS', $vICMS, true, "$identificador Valor do ICMS"); |
||
| 2548 | break; |
||
| 2549 | case '40': |
||
| 2550 | $icms = $this->dom->createElement("ICMS45"); |
||
| 2551 | $this->dom->addChild($icms, 'CST', $cst, true, "$identificador Tributação do ICMS = 40"); |
||
| 2552 | break; |
||
| 2553 | case '41': |
||
| 2554 | $icms = $this->dom->createElement("ICMS45"); |
||
| 2555 | $this->dom->addChild($icms, 'CST', $cst, true, "$identificador Tributação do ICMS = 41"); |
||
| 2556 | break; |
||
| 2557 | case '51': |
||
| 2558 | $icms = $this->dom->createElement("ICMS45"); |
||
| 2559 | $this->dom->addChild($icms, 'CST', $cst, true, "$identificador Tributação do ICMS = 51"); |
||
| 2560 | break; |
||
| 2561 | case '60': |
||
| 2562 | $icms = $this->dom->createElement("ICMS60"); |
||
| 2563 | $this->dom->addChild($icms, 'CST', $cst, true, "$identificador Tributação do ICMS = 60"); |
||
| 2564 | $this->dom->addChild($icms, 'vBCSTRet', $vBCSTRet, true, "$identificador Valor BC do ICMS ST retido"); |
||
| 2565 | $this->dom->addChild($icms, 'vICMSSTRet', $vICMSSTRet, true, "$identificador Valor do ICMS ST retido"); |
||
| 2566 | $this->dom->addChild($icms, 'pICMSSTRet', $pICMSSTRet, true, "$identificador Valor do ICMS ST retido"); |
||
| 2567 | if ($vCred > 0) { |
||
| 2568 | $this->dom->addChild($icms, 'vCred', $vCred, false, "$identificador Valor do Crédito"); |
||
| 2569 | } |
||
| 2570 | break; |
||
| 2571 | case '90': |
||
| 2572 | if ($outraUF == true) { |
||
| 2573 | $icms = $this->dom->createElement("ICMSOutraUF"); |
||
| 2574 | $this->dom->addChild($icms, 'CST', $cst, true, "$identificador Tributação do ICMS = 90"); |
||
| 2575 | if ($pRedBC > 0) { |
||
| 2576 | $this->dom->addChild($icms, 'pRedBCOutraUF', $pRedBC, false, "$identificador Percentual Red " |
||
| 2577 | . "BC Outra UF"); |
||
| 2578 | } |
||
| 2579 | $this->dom->addChild($icms, 'vBCOutraUF', $vBC, true, "$identificador Valor BC ICMS Outra UF"); |
||
| 2580 | $this->dom->addChild($icms, 'pICMSOutraUF', $pICMS, true, "$identificador Alíquota do " |
||
| 2581 | . "imposto Outra UF"); |
||
| 2582 | $this->dom->addChild($icms, 'vICMSOutraUF', $vICMS, true, "$identificador Valor ICMS Outra UF"); |
||
| 2583 | } else { |
||
| 2584 | $icms = $this->dom->createElement("ICMS90"); |
||
| 2585 | $this->dom->addChild($icms, 'CST', $cst, true, "$identificador Tributação do ICMS = 90"); |
||
| 2586 | if ($pRedBC > 0) { |
||
| 2587 | $this->dom->addChild($icms, 'pRedBC', $pRedBC, false, "$identificador Percentual Redução BC"); |
||
| 2588 | } |
||
| 2589 | $this->dom->addChild($icms, 'vBC', $vBC, true, "$identificador Valor da BC do ICMS"); |
||
| 2590 | $this->dom->addChild($icms, 'pICMS', $pICMS, true, "$identificador Alíquota do imposto"); |
||
| 2591 | $this->dom->addChild($icms, 'vICMS', $vICMS, true, "$identificador Valor do ICMS"); |
||
| 2592 | if ($vCred > 0) { |
||
| 2593 | $this->dom->addChild($icms, 'vCred', $vCred, false, "$identificador Valor do Crédido"); |
||
| 2594 | } |
||
| 2595 | } |
||
| 2596 | break; |
||
| 2597 | case 'SN': |
||
| 2598 | $icms = $this->dom->createElement("ICMSSN"); |
||
| 2599 | $this->dom->addChild($icms, 'indSN', '1', true, "$identificador Indica se contribuinte é SN"); |
||
| 2600 | break; |
||
| 2601 | } |
||
| 2602 | $this->imp = $this->dom->createElement('imp'); |
||
| 2603 | $tagIcms = $this->dom->createElement('ICMS'); |
||
| 2604 | |||
| 2605 | if (isset($icms)) { |
||
| 2606 | $this->imp->appendChild($tagIcms); |
||
| 2607 | } |
||
| 2608 | |||
| 2609 | if (isset($icms)) { |
||
| 2610 | $tagIcms->appendChild($icms); |
||
| 2611 | } |
||
| 2612 | |||
| 2613 | if ($vTotTrib > 0) { |
||
| 2614 | $this->dom->addChild($this->imp, 'vTotTrib', $vTotTrib, false, "$identificador Valor Total dos Tributos"); |
||
| 2615 | } |
||
| 2616 | |||
| 2617 | |||
| 2618 | return $tagIcms; |
||
| 2619 | } |
||
| 2620 | |||
| 2621 | /** |
||
| 2622 | * Gera as tags para o elemento: "Comp" (Local de Entrega constante na Nota Fiscal) |
||
| 2623 | * #211 |
||
| 2624 | * Nível: 2 |
||
| 2625 | * Os parâmetros para esta função são todos os elementos da tag "Comp" do |
||
| 2626 | * tipo elemento (Ele = E|CE|A) e nível 3 |
||
| 2627 | * |
||
| 2628 | * @param string $xNome Nome do componente |
||
| 2629 | * @param string $vComp Valor do componente |
||
| 2630 | * |
||
| 2631 | * @return \DOMElement |
||
| 2632 | */ |
||
| 2633 | public function compTag($xNome = '', $vComp = '') |
||
| 2634 | { |
||
| 2635 | $identificador = '#65 <pass> - '; |
||
| 2636 | $this->comp[] = $this->dom->createElement('Comp'); |
||
| 2637 | $posicao = (integer) count($this->obsCont) - 1; |
||
| 2638 | $this->dom->addChild( |
||
| 2639 | $this->comp[$posicao], |
||
| 2640 | 'xNome', |
||
| 2641 | $xNome, |
||
| 2642 | false, |
||
| 2643 | $identificador . 'Nome do componente' |
||
| 2644 | ); |
||
| 2645 | $this->dom->addChild( |
||
| 2646 | $this->comp[$posicao], |
||
| 2647 | 'vComp', |
||
| 2648 | $vComp, |
||
| 2649 | false, |
||
| 2650 | $identificador . 'Valor do componente' |
||
| 2651 | ); |
||
| 2652 | return $this->comp[$posicao]; |
||
| 2653 | } |
||
| 2654 | |||
| 2655 | /** |
||
| 2656 | * Tag raiz do documento xml |
||
| 2657 | * Função chamada pelo método [ monta ] |
||
| 2658 | * @return \DOMElement |
||
| 2659 | */ |
||
| 2660 | private function zCTeTag() |
||
| 2661 | { |
||
| 2662 | if (empty($this->CTe)) { |
||
| 2663 | $this->CTe = $this->dom->createElement('CTe'); |
||
| 2664 | $this->CTe->setAttribute('xmlns', 'http://www.portalfiscal.inf.br/cte'); |
||
| 2665 | } |
||
| 2666 | return $this->CTe; |
||
| 2667 | } |
||
| 2668 | |||
| 2669 | /** |
||
| 2670 | * Gera as tags para o elemento: "Entrega" (Informações ref. a previsão de entrega) |
||
| 2671 | * #69 |
||
| 2672 | * Nível: 2 |
||
| 2673 | * Os parâmetros para esta função são todos os elementos da tag "Entrega" do |
||
| 2674 | * tipo elemento (Ele = E|CE|A) e nível 3 |
||
| 2675 | * |
||
| 2676 | * @return \DOMElement |
||
| 2677 | */ |
||
| 2678 | private function zEntregaTag() |
||
| 2679 | { |
||
| 2680 | $this->entrega = $this->dom->createElement('Entrega'); |
||
| 2681 | return $this->entrega; |
||
| 2682 | } |
||
| 2683 | |||
| 2684 | public function infCTeNormTag() |
||
| 2689 | |||
| 2690 | View Code Duplication | public function infCargaTag($vCarga = '', $proPred = '', $xOutCat = '') |
|
| 2691 | { |
||
| 2692 | $identificador = '#253 <infCarga> - '; |
||
| 2693 | $this->infCarga = $this->dom->createElement('infCarga'); |
||
| 2694 | $this->dom->addChild($this->infCarga, 'vCarga', $vCarga, false, $identificador . 'Valor Total da Carga'); |
||
| 2695 | $this->dom->addChild($this->infCarga, 'proPred', $proPred, true, $identificador . 'Produto Predominante'); |
||
| 2696 | $this->dom->addChild($this->infCarga, 'xOutCat', $xOutCat, false, $identificador . 'Outras Caract. da Carga'); |
||
| 2697 | |||
| 2698 | return $this->infCarga; |
||
| 2699 | } |
||
| 2700 | |||
| 2701 | public function infQTag($cUnid = '', $tpMed = '', $qCarga = '') |
||
| 2702 | { |
||
| 2703 | $identificador = '#257 <infQ> - '; |
||
| 2704 | $this->infQ = $this->dom->createElement('infQ'); |
||
| 2705 | $this->dom->addChild($this->infQ, 'cUnid', $cUnid, true, $identificador . 'Código da Unidade de Medida'); |
||
| 2706 | $this->dom->addChild($this->infQ, 'tpMed', $tpMed, true, $identificador . 'Tipo da Medida'); |
||
| 2707 | $this->dom->addChild($this->infQ, 'qCarga', $qCarga, true, $identificador . 'Quantidade'); |
||
| 2708 | |||
| 2709 | return $this->infQ; |
||
| 2710 | } |
||
| 2711 | |||
| 2712 | public function infDocTag() |
||
| 2713 | { |
||
| 2714 | $this->infDoc = $this->dom->createElement('infDoc'); |
||
| 2715 | return $this->infDoc; |
||
| 2716 | } |
||
| 2717 | |||
| 2718 | View Code Duplication | public function infNFTag($vCarga = '', $proPred = '', $xOutCat = '') |
|
| 2719 | { |
||
| 2720 | $identificador = '#262 <infNF> - '; |
||
| 2721 | $this->infCarga = $this->dom->createElement('infNF'); |
||
| 2722 | $this->dom->addChild($this->infCarga, 'vCarga', $vCarga, false, $identificador . 'Valor Total da Carga'); |
||
| 2723 | $this->dom->addChild($this->infCarga, 'proPred', $proPred, true, $identificador . 'Produto Predominante'); |
||
| 2724 | $this->dom->addChild($this->infCarga, 'xOutCat', $xOutCat, false, $identificador . 'Outras Caract. da Carga'); |
||
| 2725 | |||
| 2726 | return $this->infCarga; |
||
| 2727 | } |
||
| 2728 | |||
| 2729 | public function infNFeTag($chave = '', $PIN = '', $dPrev = '') |
||
| 2730 | { |
||
| 2731 | $identificador = '#262 <infNFe> - '; |
||
| 2732 | $this->infNFe[] = $this->dom->createElement('infNFe'); |
||
| 2733 | $posicao = (integer) count($this->infNFe) - 1; |
||
| 2734 | $this->dom->addChild($this->infNFe[$posicao], 'chave', $chave, true, $identificador . 'Chave acesso da NF-e'); |
||
| 2735 | $this->dom->addChild($this->infNFe[$posicao], 'PIN', $PIN, false, $identificador . 'PIN SUFRAMA'); |
||
| 2736 | $this->dom->addChild($this->infNFe[$posicao], 'dPrev', $dPrev, false, $identificador . 'Data prevista entrega'); |
||
| 2737 | |||
| 2738 | return $this->infNFe[$posicao]; |
||
| 2739 | } |
||
| 2740 | |||
| 2741 | public function infOutrosTag($tpDoc = '', $descOutros = '', $nDoc = '', $dEmi = '', $vDocFisc = '', $dPrev = '') |
||
| 2742 | { |
||
| 2743 | $ident = '#262 <infOutros> - '; |
||
| 2744 | $this->infOutros[] = $this->dom->createElement('infOutros'); |
||
| 2745 | $posicao = (integer) count($this->infOutros) - 1; |
||
| 2746 | $this->dom->addChild($this->infOutros[$posicao], 'tpDoc', $tpDoc, true, $ident . 'Tipo ' |
||
| 2747 | . 'de documento originário'); |
||
| 2748 | $this->dom->addChild($this->infOutros[$posicao], 'descOutros', $descOutros, false, $ident . 'Descrição ' |
||
| 2749 | . 'do documento'); |
||
| 2750 | $this->dom->addChild($this->infOutros[$posicao], 'nDoc', $nDoc, false, $ident . 'Número ' |
||
| 2751 | . 'do documento'); |
||
| 2752 | $this->dom->addChild($this->infOutros[$posicao], 'dEmi', $dEmi, false, $ident . 'Data de Emissão'); |
||
| 2753 | $this->dom->addChild($this->infOutros[$posicao], 'vDocFisc', $vDocFisc, false, $ident . 'Valor ' |
||
| 2754 | . 'do documento'); |
||
| 2755 | $this->dom->addChild($this->infOutros[$posicao], 'dPrev', $dPrev, false, $ident . 'Data ' |
||
| 2756 | . 'prevista de entrega'); |
||
| 2757 | |||
| 2758 | return $this->infOutros[$posicao]; |
||
| 2759 | } |
||
| 2760 | |||
| 2761 | public function segTag($respSeg = 4) |
||
| 2762 | { |
||
| 2763 | $identificador = '#360 <seg> - '; |
||
| 2764 | $this->seg = $this->dom->createElement('seg'); |
||
| 2765 | $this->dom->addChild($this->seg, 'respSeg', $respSeg, true, $identificador . 'Responsável pelo Seguro'); |
||
| 2766 | return $this->seg; |
||
| 2767 | } |
||
| 2768 | |||
| 2769 | public function infModalTag($versaoModal = '') |
||
| 2776 | |||
| 2777 | public function rodoTag($RNTRC = '', $dPrev = '', $lota = '', $CIOT = '') |
||
| 2778 | { |
||
| 2779 | $identificador = '#1 <rodo> - '; |
||
| 2780 | $this->rodo = $this->dom->createElement('rodo'); |
||
| 2781 | $this->dom->addChild($this->rodo, 'RNTRC', $RNTRC, true, $identificador . 'Registro nacional de transportadores |
||
| 2782 | rodoviários de carga'); |
||
| 2783 | $this->dom->addChild($this->rodo, 'dPrev', $dPrev, true, $identificador . 'Data prevista para entrega da carga |
||
| 2784 | no recebedor'); |
||
| 2785 | $this->dom->addChild($this->rodo, 'lota', $lota, true, $identificador . 'Indicador de lotação'); |
||
| 2786 | $this->dom->addChild($this->rodo, 'CIOT', $CIOT, false, $identificador . 'Codigo identificador da operacao de ' |
||
| 2787 | .'transporte'); |
||
| 2788 | |||
| 2789 | return $this->rodo; |
||
| 2790 | } |
||
| 2791 | } |
||
| 2792 |
This check marks private properties in classes that are never used. Those properties can be removed.