Complex classes like DacteV3 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 DacteV3, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 23 | class DacteV3 extends Common |
||
| 24 | { |
||
| 25 | const NFEPHP_SITUACAO_EXTERNA_CANCELADA = 1; |
||
| 26 | const NFEPHP_SITUACAO_EXTERNA_DENEGADA = 2; |
||
| 27 | const SIT_DPEC = 3; |
||
| 28 | |||
| 29 | protected $logoAlign = 'C'; |
||
| 30 | protected $yDados = 0; |
||
| 31 | protected $situacao_externa = 0; |
||
| 32 | protected $numero_registro_dpec = ''; |
||
| 33 | protected $pdf; |
||
| 34 | protected $xml; |
||
| 35 | protected $logomarca = ''; |
||
| 36 | protected $errMsg = ''; |
||
| 37 | protected $errStatus = false; |
||
| 38 | protected $orientacao = 'P'; |
||
| 39 | protected $papel = 'A4'; |
||
| 40 | protected $destino = 'I'; |
||
| 41 | protected $pdfDir = ''; |
||
| 42 | protected $fontePadrao = 'Times'; |
||
| 43 | protected $version = '1.3.0'; |
||
| 44 | protected $wPrint; |
||
| 45 | protected $hPrint; |
||
| 46 | protected $dom; |
||
| 47 | protected $infCte; |
||
| 48 | protected $infCteComp; |
||
| 49 | protected $infCteAnu; |
||
| 50 | protected $chaveCTeRef; |
||
| 51 | protected $tpCTe; |
||
| 52 | protected $ide; |
||
| 53 | protected $emit; |
||
| 54 | protected $enderEmit; |
||
| 55 | protected $rem; |
||
| 56 | protected $enderReme; |
||
| 57 | protected $dest; |
||
| 58 | protected $enderDest; |
||
| 59 | protected $exped; |
||
| 60 | protected $enderExped; |
||
| 61 | protected $receb; |
||
| 62 | protected $enderReceb; |
||
| 63 | protected $infCarga; |
||
| 64 | protected $infQ; |
||
| 65 | protected $seg; |
||
| 66 | protected $modal; |
||
| 67 | protected $rodo; |
||
| 68 | protected $moto; |
||
| 69 | protected $veic; |
||
| 70 | protected $ferrov; |
||
| 71 | protected $Comp; |
||
| 72 | protected $infNF; |
||
| 73 | protected $infNFe; |
||
| 74 | protected $compl; |
||
| 75 | protected $ICMS; |
||
| 76 | protected $ICMSSN; |
||
| 77 | protected $ICMSOutraUF; |
||
| 78 | protected $imp; |
||
| 79 | protected $toma4; |
||
| 80 | protected $toma03; |
||
| 81 | protected $tpEmis; |
||
| 82 | protected $tpImp; |
||
| 83 | protected $tpAmb; |
||
| 84 | protected $vPrest; |
||
| 85 | protected $wAdic = 150; |
||
| 86 | protected $textoAdic = ''; |
||
| 87 | protected $debugMode = 2; |
||
| 88 | protected $formatPadrao; |
||
| 89 | protected $formatNegrito; |
||
| 90 | protected $aquav; |
||
| 91 | protected $preVisualizar; |
||
| 92 | protected $flagDocOrigContinuacao; |
||
| 93 | protected $arrayNFe = array(); |
||
| 94 | protected $siteDesenvolvedor; |
||
| 95 | protected $nomeDesenvolvedor; |
||
| 96 | protected $totPag; |
||
| 97 | protected $idDocAntEle = []; |
||
| 98 | |||
| 99 | /** |
||
| 100 | * __construct |
||
| 101 | * |
||
| 102 | * @param string $docXML Arquivo XML da CTe |
||
| 103 | * @param string $sOrientacao (Opcional) Orientação da impressão P ou L |
||
| 104 | * @param string $sPapel Tamanho do papel (Ex. A4) |
||
| 105 | * @param string $sPathLogo Caminho para o arquivo do logo |
||
| 106 | * @param string $sDestino Estabelece a direção do envio do documento PDF |
||
| 107 | * @param string $sDirPDF Caminho para o diretorio de armaz. dos PDF |
||
| 108 | * @param string $fonteDACTE Nome da fonte a ser utilizada |
||
| 109 | * @param number $mododebug 0-Não 1-Sim e 2-nada (2 default) |
||
| 110 | * @param string $preVisualizar 0-Não 1-Sim |
||
| 111 | */ |
||
| 112 | public function __construct( |
||
| 113 | $docXML = '', |
||
| 114 | $sOrientacao = '', |
||
| 115 | $sPapel = '', |
||
| 116 | $sPathLogo = '', |
||
| 117 | $sDestino = 'I', |
||
| 118 | $sDirPDF = '', |
||
| 119 | $fonteDACTE = '', |
||
| 120 | $mododebug = 2, |
||
| 121 | $preVisualizar = false, |
||
| 122 | $nomeDesenvolvedor = 'Powered by NFePHP (GNU/GPLv3 GNU/LGPLv3) © www.nfephp.org', |
||
| 123 | $siteDesenvolvedor = 'http://www.nfephp.org' |
||
| 124 | ) { |
||
| 125 | |||
| 126 | if (is_numeric($mododebug)) { |
||
| 127 | $this->debugMode = $mododebug; |
||
|
|
|||
| 128 | } |
||
| 129 | if ($mododebug == 1) { |
||
| 130 | //ativar modo debug |
||
| 131 | error_reporting(E_ALL); |
||
| 132 | ini_set('display_errors', 'On'); |
||
| 133 | } elseif ($mododebug == 0) { |
||
| 134 | //desativar modo debug |
||
| 135 | error_reporting(0); |
||
| 136 | ini_set('display_errors', 'Off'); |
||
| 137 | } |
||
| 138 | $this->orientacao = $sOrientacao; |
||
| 139 | $this->papel = $sPapel; |
||
| 140 | $this->pdf = ''; |
||
| 141 | $this->xml = $docXML; |
||
| 142 | $this->logomarca = $sPathLogo; |
||
| 143 | $this->destino = $sDestino; |
||
| 144 | $this->pdfDir = $sDirPDF; |
||
| 145 | $this->preVisualizar = $preVisualizar; |
||
| 146 | $this->siteDesenvolvedor = $siteDesenvolvedor; |
||
| 147 | $this->nomeDesenvolvedor = $nomeDesenvolvedor; |
||
| 148 | // verifica se foi passa a fonte a ser usada |
||
| 149 | if (!empty($fonteDACTE)) { |
||
| 150 | $this->fontePadrao = $fonteDACTE; |
||
| 151 | } |
||
| 152 | $this->formatPadrao = array( |
||
| 153 | 'font' => $this->fontePadrao, |
||
| 154 | 'size' => 6, |
||
| 155 | 'style' => ''); |
||
| 156 | $this->formatNegrito = array( |
||
| 157 | 'font' => $this->fontePadrao, |
||
| 158 | 'size' => 7, |
||
| 159 | 'style' => 'B'); |
||
| 160 | //se for passado o xml |
||
| 161 | if (!empty($this->xml)) { |
||
| 162 | $this->dom = new Dom(); |
||
| 163 | $this->dom->loadXML($this->xml); |
||
| 164 | $this->cteProc = $this->dom->getElementsByTagName("cteProc")->item(0); |
||
| 165 | $this->infCte = $this->dom->getElementsByTagName("infCte")->item(0); |
||
| 166 | $this->ide = $this->dom->getElementsByTagName("ide")->item(0); |
||
| 167 | $this->tpCTe = $this->pSimpleGetValue($this->ide, "tpCTe"); |
||
| 168 | $this->emit = $this->dom->getElementsByTagName("emit")->item(0); |
||
| 169 | $this->enderEmit = $this->dom->getElementsByTagName("enderEmit")->item(0); |
||
| 170 | $this->rem = $this->dom->getElementsByTagName("rem")->item(0); |
||
| 171 | $this->enderReme = $this->dom->getElementsByTagName("enderReme")->item(0); |
||
| 172 | $this->dest = $this->dom->getElementsByTagName("dest")->item(0); |
||
| 173 | $this->enderDest = $this->dom->getElementsByTagName("enderDest")->item(0); |
||
| 174 | $this->exped = $this->dom->getElementsByTagName("exped")->item(0); |
||
| 175 | $this->enderExped = $this->dom->getElementsByTagName("enderExped")->item(0); |
||
| 176 | $this->receb = $this->dom->getElementsByTagName("receb")->item(0); |
||
| 177 | $this->enderReceb = $this->dom->getElementsByTagName("enderReceb")->item(0); |
||
| 178 | $this->infCarga = $this->dom->getElementsByTagName("infCarga")->item(0); |
||
| 179 | $this->infQ = $this->dom->getElementsByTagName("infQ"); |
||
| 180 | $this->seg = $this->dom->getElementsByTagName("seg")->item(0); |
||
| 181 | $this->rodo = $this->dom->getElementsByTagName("rodo")->item(0); |
||
| 182 | $this->aereo = $this->dom->getElementsByTagName("aereo")->item(0); |
||
| 183 | $this->lota = $this->pSimpleGetValue($this->rodo, "lota"); |
||
| 184 | $this->moto = $this->dom->getElementsByTagName("moto")->item(0); |
||
| 185 | $this->veic = $this->dom->getElementsByTagName("veic"); |
||
| 186 | $this->ferrov = $this->dom->getElementsByTagName("ferrov")->item(0); |
||
| 187 | // adicionar outros modais |
||
| 188 | |||
| 189 | $this->infCteComp = $this->dom->getElementsByTagName("infCteComp")->item(0); |
||
| 190 | $this->infCteAnu = $this->dom->getElementsByTagName("infCteAnu")->item(0); |
||
| 191 | if ($this->tpCTe == 1) { |
||
| 192 | $this->chaveCTeRef = $this->pSimpleGetValue($this->infCteComp, "chCTe"); |
||
| 193 | } else { |
||
| 194 | $this->chaveCTeRef = $this->pSimpleGetValue($this->infCteAnu, "chCte"); |
||
| 195 | } |
||
| 196 | $this->vPrest = $this->dom->getElementsByTagName("vPrest")->item(0); |
||
| 197 | $this->Comp = $this->dom->getElementsByTagName("Comp"); |
||
| 198 | $this->infNF = $this->dom->getElementsByTagName("infNF"); |
||
| 199 | $this->infNFe = $this->dom->getElementsByTagName("infNFe"); |
||
| 200 | $this->infOutros = $this->dom->getElementsByTagName("infOutros"); |
||
| 201 | $this->compl = $this->dom->getElementsByTagName("compl"); |
||
| 202 | $this->ICMS = $this->dom->getElementsByTagName("ICMS")->item(0); |
||
| 203 | $this->ICMSSN = $this->dom->getElementsByTagName("ICMSSN")->item(0); |
||
| 204 | $this->ICMSOutraUF = $this->dom->getElementsByTagName("ICMSOutraUF")->item(0); |
||
| 205 | $this->imp = $this->dom->getElementsByTagName("imp")->item(0); |
||
| 206 | if (!empty($this->pSimpleGetValue($this->imp, "vTotTrib"))) { |
||
| 207 | $textoAdic = number_format($this->pSimpleGetValue($this->imp, "vTotTrib"), 2, ",", "."); |
||
| 208 | $this->textoAdic = "o valor aproximado de tributos incidentes sobre o preço deste serviço é de R$" |
||
| 209 | .$textoAdic; |
||
| 210 | } |
||
| 211 | $this->toma4 = $this->dom->getElementsByTagName("toma4")->item(0); |
||
| 212 | $this->toma03 = $this->dom->getElementsByTagName("toma3")->item(0); |
||
| 213 | //Tag tomador é identificado por toma03 na versão 2.00 |
||
| 214 | if ($this->infCte->getAttribute("versao")=="2.00") { |
||
| 215 | $this->toma03 = $this->dom->getElementsByTagName("toma03")->item(0); |
||
| 216 | } |
||
| 217 | //modal aquaviário |
||
| 218 | $this->aquav = $this->dom->getElementsByTagName("aquav")->item(0); |
||
| 219 | $tomador = $this->pSimpleGetValue($this->toma03, "toma"); |
||
| 220 | //0-Remetente;1-Expedidor;2-Recebedor;3-Destinatário;4-Outros |
||
| 221 | switch ($tomador) { |
||
| 222 | case '0': |
||
| 223 | $this->toma = $this->rem; |
||
| 224 | $this->enderToma = $this->enderReme; |
||
| 225 | break; |
||
| 226 | case '1': |
||
| 227 | $this->toma = $this->exped; |
||
| 228 | $this->enderToma = $this->enderExped; |
||
| 229 | break; |
||
| 230 | case '2': |
||
| 231 | $this->toma = $this->receb; |
||
| 232 | $this->enderToma = $this->enderReceb; |
||
| 233 | break; |
||
| 234 | case '3': |
||
| 235 | $this->toma = $this->dest; |
||
| 236 | $this->enderToma = $this->enderDest; |
||
| 237 | break; |
||
| 238 | default: |
||
| 239 | $this->toma = $this->toma4; |
||
| 240 | $this->enderToma = $this->pSimpleGetValue($this->toma4, "enderToma"); |
||
| 241 | break; |
||
| 242 | } |
||
| 243 | /*$seguro = $this->pSimpleGetValue($this->seg, "respSeg"); |
||
| 244 | switch ($seguro) { |
||
| 245 | case '0': |
||
| 246 | $this->respSeg = 'Remetente'; |
||
| 247 | break; |
||
| 248 | case '1': |
||
| 249 | $this->respSeg = 'Expedidor'; |
||
| 250 | break; |
||
| 251 | case '2': |
||
| 252 | $this->respSeg = 'Recebedor'; |
||
| 253 | break; |
||
| 254 | case '3': |
||
| 255 | $this->respSeg = 'Destinatário'; |
||
| 256 | break; |
||
| 257 | case '4': |
||
| 258 | $this->respSeg = 'Emitente'; |
||
| 259 | break; |
||
| 260 | case '5': |
||
| 261 | $this->respSeg = 'Tomador'; |
||
| 262 | break; |
||
| 263 | default: |
||
| 264 | $this->respSeg = ''; |
||
| 265 | break; |
||
| 266 | }*/ |
||
| 267 | $this->tpEmis = $this->pSimpleGetValue($this->ide, "tpEmis"); |
||
| 268 | $this->tpImp = $this->pSimpleGetValue($this->ide, "tpImp"); |
||
| 269 | $this->tpAmb = $this->pSimpleGetValue($this->ide, "tpAmb"); |
||
| 270 | $this->tpCTe = $this->pSimpleGetValue($this->ide, "tpCTe"); |
||
| 271 | |||
| 272 | $this->protCTe = $this->dom->getElementsByTagName("protCTe")->item(0); |
||
| 273 | //01-Rodoviário; //02-Aéreo; //03-Aquaviário; //04-Ferroviário;//05-Dutoviário |
||
| 274 | $this->modal = $this->pSimpleGetValue($this->ide, "modal"); |
||
| 275 | } |
||
| 276 | } |
||
| 277 | |||
| 278 | /** |
||
| 279 | * monta |
||
| 280 | * @param string $orientacao L ou P |
||
| 281 | * @param string $papel A4 |
||
| 282 | * @param string $logoAlign C, L ou R |
||
| 283 | * @param Pdf $classPDF |
||
| 284 | * @return string montagem |
||
| 285 | */ |
||
| 286 | public function monta( |
||
| 287 | $orientacao = '', |
||
| 288 | $papel = 'A4', |
||
| 289 | $logoAlign = 'C', |
||
| 290 | $classPDF = false |
||
| 291 | ) { |
||
| 292 | |||
| 293 | return $this->montaDACTE($orientacao, $papel, $logoAlign, $classPDF); |
||
| 294 | } |
||
| 295 | |||
| 296 | /** |
||
| 297 | * printDocument |
||
| 298 | * @param string $nome |
||
| 299 | * @param string $destino |
||
| 300 | * @param string $printer |
||
| 301 | * @return |
||
| 302 | */ |
||
| 303 | public function printDocument($nome = '', $destino = 'I', $printer = '') |
||
| 304 | { |
||
| 305 | return $this->printDACTE($nome, $destino, $printer); |
||
| 306 | } |
||
| 307 | |||
| 308 | /** |
||
| 309 | * Dados brutos do PDF |
||
| 310 | * @return string |
||
| 311 | */ |
||
| 312 | public function render() |
||
| 313 | { |
||
| 314 | return $this->pdf->getPdf(); |
||
| 315 | } |
||
| 316 | |||
| 317 | |||
| 318 | protected function zCteDPEC() |
||
| 319 | { |
||
| 320 | return $this->situacao_externa == self::SIT_DPEC && $this->numero_registro_dpec != ''; |
||
| 321 | } |
||
| 322 | |||
| 323 | |||
| 324 | /** |
||
| 325 | * montaDACTE |
||
| 326 | * Esta função monta a DACTE conforme as informações fornecidas para a classe |
||
| 327 | * durante sua construção. |
||
| 328 | * A definição de margens e posições iniciais para a impressão são estabelecidas no |
||
| 329 | * pelo conteúdo da funçao e podem ser modificados. |
||
| 330 | * |
||
| 331 | * @param string $orientacao (Opcional) Estabelece a orientação da |
||
| 332 | * impressão (ex. P-retrato), se nada for fornecido será |
||
| 333 | * usado o padrão da NFe |
||
| 334 | * @param string $papel (Opcional) Estabelece o tamanho do papel (ex. A4) |
||
| 335 | * @return string O ID da NFe numero de 44 digitos extraido do arquivo XML |
||
| 336 | */ |
||
| 337 | public function montaDACTE( |
||
| 338 | $orientacao = '', |
||
| 339 | $papel = 'A4', |
||
| 340 | $logoAlign = 'C', |
||
| 341 | $classPDF = false |
||
| 342 | ) { |
||
| 343 | |||
| 344 | //se a orientação estiver em branco utilizar o padrão estabelecido na NF |
||
| 345 | if ($orientacao == '') { |
||
| 346 | if ($this->tpImp == '1') { |
||
| 347 | $orientacao = 'P'; |
||
| 348 | } else { |
||
| 349 | $orientacao = 'P'; |
||
| 350 | } |
||
| 351 | } |
||
| 352 | $this->orientacao = $orientacao; |
||
| 353 | $this->papel = $papel; |
||
| 354 | $this->logoAlign = $logoAlign; |
||
| 355 | |||
| 356 | //$this->situacao_externa = $situacao_externa; |
||
| 357 | //instancia a classe pdf |
||
| 358 | if ($classPDF !== false) { |
||
| 359 | $this->pdf = $classPDF; |
||
| 360 | } else { |
||
| 361 | $this->pdf = new Pdf($this->orientacao, 'mm', $this->papel); |
||
| 362 | } |
||
| 363 | if ($this->orientacao == 'P') { |
||
| 364 | // margens do PDF |
||
| 365 | $margSup = 2; |
||
| 366 | $margEsq = 2; |
||
| 367 | $margDir = 2; |
||
| 368 | // posição inicial do relatorio |
||
| 369 | $xInic = 1; |
||
| 370 | $yInic = 1; |
||
| 371 | if ($papel == 'A4') { |
||
| 372 | //A4 210x297mm |
||
| 373 | $maxW = 210; |
||
| 374 | $maxH = 297; |
||
| 375 | } |
||
| 376 | } else { |
||
| 377 | // margens do PDF |
||
| 378 | $margSup = 3; |
||
| 379 | $margEsq = 3; |
||
| 380 | $margDir = 3; |
||
| 381 | // posição inicial do relatorio |
||
| 382 | $xInic = 5; |
||
| 383 | $yInic = 5; |
||
| 384 | if ($papel == 'A4') { |
||
| 385 | //A4 210x297mm |
||
| 386 | $maxH = 210; |
||
| 387 | $maxW = 297; |
||
| 388 | $this->wCanhoto = 25; |
||
| 389 | } |
||
| 390 | } |
||
| 391 | //total inicial de paginas |
||
| 392 | $totPag = 1; |
||
| 393 | //largura imprimivel em mm |
||
| 394 | $this->wPrint = $maxW - ($margEsq + $xInic); |
||
| 395 | //comprimento imprimivel em mm |
||
| 396 | $this->hPrint = $maxH - ($margSup + $yInic); |
||
| 397 | // estabelece contagem de paginas |
||
| 398 | $this->pdf->AliasNbPages(); |
||
| 399 | // fixa as margens |
||
| 400 | $this->pdf->SetMargins($margEsq, $margSup, $margDir); |
||
| 401 | $this->pdf->SetDrawColor(0, 0, 0); |
||
| 402 | $this->pdf->SetFillColor(255, 255, 255); |
||
| 403 | // inicia o documento |
||
| 404 | $this->pdf->Open(); |
||
| 405 | // adiciona a primeira página |
||
| 406 | $this->pdf->AddPage($this->orientacao, $this->papel); |
||
| 407 | $this->pdf->SetLineWidth(0.1); |
||
| 408 | $this->pdf->SetTextColor(0, 0, 0); |
||
| 409 | //calculo do numero de páginas ??? |
||
| 410 | $totPag = 1; |
||
| 411 | //montagem da primeira página |
||
| 412 | $pag = 1; |
||
| 413 | $x = $xInic; |
||
| 414 | $y = $yInic; |
||
| 415 | //coloca o cabeçalho |
||
| 416 | //$r = $this->zCabecalho($x, $y, $pag, $totPag); |
||
| 417 | $y += 70; |
||
| 418 | $r = $this->zRemetente($x, $y); |
||
| 419 | $x = $this->wPrint * 0.5 + 2; |
||
| 420 | $r = $this->zDestinatario($x, $y); |
||
| 421 | $y += 19; |
||
| 422 | $x = $xInic; |
||
| 423 | $r = $this->zExpedidor($x, $y); |
||
| 424 | $x = $this->wPrint * 0.5 + 2; |
||
| 425 | $r = $this->zRecebedor($x, $y); |
||
| 426 | $y += 19; |
||
| 427 | $x = $xInic; |
||
| 428 | $r = $this->zTomador($x, $y); |
||
| 429 | if ($this->tpCTe == '0') { |
||
| 430 | //Normal |
||
| 431 | $y += 10; |
||
| 432 | $x = $xInic; |
||
| 433 | $r = $this->zDescricaoCarga($x, $y); |
||
| 434 | $y += 17; |
||
| 435 | $x = $xInic; |
||
| 436 | $r = $this->zCompValorServ($x, $y); |
||
| 437 | $y += 25; |
||
| 438 | $x = $xInic; |
||
| 439 | $r = $this->zImpostos($x, $y); |
||
| 440 | $y += 13; |
||
| 441 | $x = $xInic; |
||
| 442 | $r = $this->zDocOrig($x, $y); |
||
| 443 | if ($this->modal == '1') { |
||
| 444 | if ($this->lota == 1) { |
||
| 445 | //$y += 24.95; |
||
| 446 | $y += 35; |
||
| 447 | } else { |
||
| 448 | $y += 53; |
||
| 449 | } |
||
| 450 | } elseif ($this->modal == '2') { |
||
| 451 | $y += 53; |
||
| 452 | } elseif ($this->modal == '3') { |
||
| 453 | $y += 37.75; |
||
| 454 | } else { |
||
| 455 | $y += 24.95; |
||
| 456 | } |
||
| 457 | $x = $xInic; |
||
| 458 | $r = $this->zObs($x, $y); |
||
| 459 | $y = $y-6; |
||
| 460 | switch ($this->modal) { |
||
| 461 | case '1': |
||
| 462 | $y += 25.9; |
||
| 463 | $x = $xInic; |
||
| 464 | $r = $this->zModalRod($x, $y); |
||
| 465 | break; |
||
| 466 | case '2': |
||
| 467 | $y += 25.9; |
||
| 468 | $x = $xInic; |
||
| 469 | $r = $this->zModalAereo($x, $y); |
||
| 470 | break; |
||
| 471 | case '3': |
||
| 472 | $y += 17.9; |
||
| 473 | $x = $xInic; |
||
| 474 | $r = $this->zModalAquaviario($x, $y); |
||
| 475 | break; |
||
| 476 | case '4': |
||
| 477 | $y += 17.9; |
||
| 478 | $x = $xInic; |
||
| 479 | $r = $this->zModalFerr($x, $y); |
||
| 480 | break; |
||
| 481 | case '5': |
||
| 482 | $y += 17.9; |
||
| 483 | $x = $xInic; |
||
| 484 | // TODO fmertins 31/10/14: este método não existe... |
||
| 485 | $r = $this->zModalDutoviario($x, $y); |
||
| 486 | break; |
||
| 487 | } |
||
| 488 | if ($this->modal == '1') { |
||
| 489 | if ($this->lota == 1) { |
||
| 490 | $y += 37; |
||
| 491 | } else { |
||
| 492 | $y += 8.9; |
||
| 493 | } |
||
| 494 | } elseif ($this->modal == '2') { |
||
| 495 | $y += 8.9; |
||
| 496 | } elseif ($this->modal == '3') { |
||
| 497 | $y += 24.15; |
||
| 498 | } else { |
||
| 499 | $y += 37; |
||
| 500 | } |
||
| 501 | } else { |
||
| 502 | $r = $this->zCabecalho(1, 1, $pag, $totPag); |
||
| 503 | //Complementado |
||
| 504 | $y += 10; |
||
| 505 | $x = $xInic; |
||
| 506 | $r = $this->zDocCompl($x, $y); |
||
| 507 | $y += 80; |
||
| 508 | $x = $xInic; |
||
| 509 | $r = $this->zCompValorServ($x, $y); |
||
| 510 | $y += 25; |
||
| 511 | $x = $xInic; |
||
| 512 | $r = $this->zImpostos($x, $y); |
||
| 513 | $y += 13; |
||
| 514 | $x = $xInic; |
||
| 515 | $r = $this->zObs($x, $y); |
||
| 516 | $y += 15; |
||
| 517 | } |
||
| 518 | $x = $xInic; |
||
| 519 | $r = $this->zDadosAdic($x, $y, $pag, $totPag); |
||
| 520 | |||
| 521 | //$y += 19; |
||
| 522 | $y += 11; |
||
| 523 | $y = $this->zCanhoto($x, $y); |
||
| 524 | |||
| 525 | //coloca o rodapé da página |
||
| 526 | if ($this->orientacao == 'P') { |
||
| 527 | $this->zRodape(2, $this->hPrint - 2); |
||
| 528 | } else { |
||
| 529 | $this->zRodape($xInic, $this->hPrint + 2.3); |
||
| 530 | } |
||
| 531 | if ($this->flagDocOrigContinuacao == 1) { |
||
| 532 | $this->zdocOrigContinuacao(1, 71); |
||
| 533 | } |
||
| 534 | //retorna o ID na CTe |
||
| 535 | if ($classPDF !== false) { |
||
| 536 | $aR = array('id' => str_replace('CTe', '', $this->infCte->getAttribute("Id")), 'classe_PDF' => $this->pdf); |
||
| 537 | return $aR; |
||
| 538 | } else { |
||
| 539 | return str_replace('CTe', '', $this->infCte->getAttribute("Id")); |
||
| 540 | } |
||
| 541 | } //fim da função montaDACTE |
||
| 542 | |||
| 543 | /** |
||
| 544 | * printDACTE |
||
| 545 | * Esta função envia a DACTE em PDF criada para o dispositivo informado. |
||
| 546 | * O destino da impressão pode ser : |
||
| 547 | * I-browser |
||
| 548 | * D-browser com download |
||
| 549 | * F-salva em um arquivo local com o nome informado |
||
| 550 | * S-retorna o documento como uma string e o nome é ignorado. |
||
| 551 | * Para enviar o pdf diretamente para uma impressora indique o |
||
| 552 | * nome da impressora e o destino deve ser 'S'. |
||
| 553 | * |
||
| 554 | * @param string $nome Path completo com o nome do arquivo pdf |
||
| 555 | * @param string $destino Direção do envio do PDF |
||
| 556 | * @param string $printer Identificação da impressora no sistema |
||
| 557 | * @return string Caso o destino seja S o pdf é retornado como uma string |
||
| 558 | * @todo Rotina de impressão direta do arquivo pdf criado |
||
| 559 | */ |
||
| 560 | public function printDACTE($nome = '', $destino = 'I', $printer = '') |
||
| 561 | { |
||
| 562 | $arq = $this->pdf->Output($nome, $destino); |
||
| 563 | if ($destino == 'S') { |
||
| 564 | //aqui pode entrar a rotina de impressão direta |
||
| 565 | } |
||
| 566 | return $arq; |
||
| 567 | } //fim função printDACTE |
||
| 568 | |||
| 569 | /** |
||
| 570 | * zCabecalho |
||
| 571 | * Monta o cabelhalho da DACTE ( retrato e paisagem ) |
||
| 572 | * |
||
| 573 | * @param number $x Posição horizontal inicial, canto esquerdo |
||
| 574 | * @param number $y Posição vertical inicial, canto superior |
||
| 575 | * @param number $pag Número da Página |
||
| 576 | * @param number $totPag Total de páginas |
||
| 577 | * @return number Posição vertical final |
||
| 578 | */ |
||
| 579 | protected function zCabecalho($x = 0, $y = 0, $pag = '1', $totPag = '1') |
||
| 580 | { |
||
| 581 | $oldX = $x; |
||
| 582 | $oldY = $y; |
||
| 583 | if ($this->orientacao == 'P') { |
||
| 584 | $maxW = $this->wPrint; |
||
| 585 | } else { |
||
| 586 | if ($pag == 1) { |
||
| 587 | // primeira página |
||
| 588 | $maxW = $this->wPrint - $this->wCanhoto; |
||
| 589 | } else { |
||
| 590 | // páginas seguintes |
||
| 591 | $maxW = $this->wPrint; |
||
| 592 | } |
||
| 593 | } |
||
| 594 | //################################################################## |
||
| 595 | //coluna esquerda identificação do emitente |
||
| 596 | $w = round($maxW * 0.42); |
||
| 597 | if ($this->orientacao == 'P') { |
||
| 598 | $aFont = array( |
||
| 599 | 'font' => $this->fontePadrao, |
||
| 600 | 'size' => 6, |
||
| 601 | 'style' => ''); |
||
| 602 | } else { |
||
| 603 | $aFont = $this->formatNegrito; |
||
| 604 | } |
||
| 605 | $w1 = $w; |
||
| 606 | $h = 35; |
||
| 607 | $oldY += $h; |
||
| 608 | //desenha a caixa |
||
| 609 | $this->pTextBox($x, $y, $w + 2, $h + 1); |
||
| 610 | // coloca o logo |
||
| 611 | if (is_file($this->logomarca)) { |
||
| 612 | $logoInfo = getimagesize($this->logomarca); |
||
| 613 | //largura da imagem em mm |
||
| 614 | $logoWmm = ($logoInfo[0] / 72) * 25.4; |
||
| 615 | //altura da imagem em mm |
||
| 616 | $logoHmm = ($logoInfo[1] / 72) * 25.4; |
||
| 617 | if ($this->logoAlign == 'L') { |
||
| 618 | $nImgW = round($w / 3, 0); |
||
| 619 | $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
||
| 620 | $xImg = $x + 1; |
||
| 621 | $yImg = round(($h - $nImgH) / 2, 0) + $y; |
||
| 622 | //estabelecer posições do texto |
||
| 623 | $x1 = round($xImg + $nImgW + 1, 0); |
||
| 624 | $y1 = round($h / 3 + $y, 0); |
||
| 625 | $tw = round(2 * $w / 3, 0); |
||
| 626 | } elseif ($this->logoAlign == 'C') { |
||
| 627 | $nImgH = round($h / 3, 0); |
||
| 628 | $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0); |
||
| 629 | $xImg = round(($w - $nImgW) / 2 + $x, 0); |
||
| 630 | $yImg = $y + 3; |
||
| 631 | $x1 = $x; |
||
| 632 | $y1 = round($yImg + $nImgH + 1, 0); |
||
| 633 | $tw = $w; |
||
| 634 | } elseif ($this->logoAlign == 'R') { |
||
| 635 | $nImgW = round($w / 3, 0); |
||
| 636 | $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
||
| 637 | $xImg = round($x + ($w - (1 + $nImgW)), 0); |
||
| 638 | $yImg = round(($h - $nImgH) / 2, 0) + $y; |
||
| 639 | $x1 = $x; |
||
| 640 | $y1 = round($h / 3 + $y, 0); |
||
| 641 | $tw = round(2 * $w / 3, 0); |
||
| 642 | } |
||
| 643 | $this->pdf->Image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, 'jpeg'); |
||
| 644 | } else { |
||
| 645 | $x1 = $x; |
||
| 646 | $y1 = round($h / 3 + $y, 0); |
||
| 647 | $tw = $w; |
||
| 648 | } |
||
| 649 | //Nome emitente |
||
| 650 | $aFont = array( |
||
| 651 | 'font' => $this->fontePadrao, |
||
| 652 | 'size' => 9, |
||
| 653 | 'style' => 'B'); |
||
| 654 | $texto = $this->pSimpleGetValue($this->emit, "xNome"); |
||
| 655 | $this->pTextBox($x1, $y1, $tw, 8, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 656 | //endereço |
||
| 657 | $y1 = $y1 + 3; |
||
| 658 | $aFont = array( |
||
| 659 | 'font' => $this->fontePadrao, |
||
| 660 | 'size' => 7, |
||
| 661 | 'style' => ''); |
||
| 662 | $fone = $this->pSimpleGetValue($this->enderEmit, "fone")!=""? $this->zFormatFone($this->enderEmit):''; |
||
| 663 | $lgr = $this->pSimpleGetValue($this->enderEmit, "xLgr"); |
||
| 664 | $nro = $this->pSimpleGetValue($this->enderEmit, "nro"); |
||
| 665 | $cpl = $this->pSimpleGetValue($this->enderEmit, "xCpl"); |
||
| 666 | $bairro = $this->pSimpleGetValue($this->enderEmit, "xBairro"); |
||
| 667 | $CEP = $this->pSimpleGetValue($this->enderEmit, "CEP"); |
||
| 668 | $CEP = $this->pFormat($CEP, "#####-###"); |
||
| 669 | $mun = $this->pSimpleGetValue($this->enderEmit, "xMun"); |
||
| 670 | $UF = $this->pSimpleGetValue($this->enderEmit, "UF"); |
||
| 671 | $xPais = $this->pSimpleGetValue($this->enderEmit, "xPais"); |
||
| 672 | $texto = $lgr . "," . $nro . "\n" . $bairro . " - " |
||
| 673 | . $CEP . " - " . $mun . " - " . $UF . " " . $xPais |
||
| 674 | . "\n Fone/Fax: " . $fone; |
||
| 675 | $this->pTextBox($x1 - 5, $y1 + 2, $tw + 5, 8, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 676 | //CNPJ/CPF IE |
||
| 677 | $cpfCnpj = $this->zFormatCNPJCPF($this->emit); |
||
| 678 | $ie = $this->pSimpleGetValue($this->emit, "IE"); |
||
| 679 | $texto = 'CNPJ/CPF: ' . $cpfCnpj . ' Insc.Estadual: ' . $ie; |
||
| 680 | $this->pTextBox($x1 - 1, $y1 + 12, $tw + 5, 8, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 681 | //outra caixa |
||
| 682 | $h1 = 17.5; |
||
| 683 | $y1 = $y + $h + 1; |
||
| 684 | $this->pTextBox($x, $y1, $w + 2, $h1); |
||
| 685 | //TIPO DO CT-E |
||
| 686 | $texto = 'TIPO DO CTE'; |
||
| 687 | $wa = 37; |
||
| 688 | $aFont = array( |
||
| 689 | 'font' => $this->fontePadrao, |
||
| 690 | 'size' => 8, |
||
| 691 | 'style' => ''); |
||
| 692 | $this->pTextBox($x, $y1, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 693 | $tpCTe = $this->pSimpleGetValue($this->ide, "tpCTe"); |
||
| 694 | //0 - CT-e Normal,1 - CT-e de Complemento de Valores, |
||
| 695 | //2 - CT-e de Anulação de Valores,3 - CT-e Substituto |
||
| 696 | switch ($tpCTe) { |
||
| 697 | case '0': |
||
| 698 | $texto = 'Normal'; |
||
| 699 | break; |
||
| 700 | case '1': |
||
| 701 | $texto = 'Complemento de Valores'; |
||
| 702 | break; |
||
| 703 | case '2': |
||
| 704 | $texto = 'Anulação de Valores'; |
||
| 705 | break; |
||
| 706 | case '3': |
||
| 707 | $texto = 'Substituto'; |
||
| 708 | break; |
||
| 709 | default: |
||
| 710 | $texto = 'ERRO' . $tpCTe . $tpServ; |
||
| 711 | } |
||
| 712 | $aFont = $this->formatNegrito; |
||
| 713 | $this->pTextBox($x, $y1 + 3, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, '', false); |
||
| 714 | //TIPO DO SERVIÇO |
||
| 715 | $texto = 'TIPO DO SERVIÇO'; |
||
| 716 | $wb = 36; |
||
| 717 | $aFont = array( |
||
| 718 | 'font' => $this->fontePadrao, |
||
| 719 | 'size' => 8, |
||
| 720 | 'style' => ''); |
||
| 721 | $this->pTextBox($x + $wa + 4.5, $y1, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 722 | $tpServ = $this->pSimpleGetValue($this->ide, "tpServ"); |
||
| 723 | //0 - Normal;1 - Subcontratação;2 - Redespacho;3 - Redespacho Intermediário |
||
| 724 | switch ($tpServ) { |
||
| 725 | case '0': |
||
| 726 | $texto = 'Normal'; |
||
| 727 | break; |
||
| 728 | case '1': |
||
| 729 | $texto = 'Subcontratação'; |
||
| 730 | break; |
||
| 731 | case '2': |
||
| 732 | $texto = 'Redespacho'; |
||
| 733 | break; |
||
| 734 | case '3': |
||
| 735 | $texto = 'Redespacho Intermediário'; |
||
| 736 | break; |
||
| 737 | default: |
||
| 738 | $texto = 'ERRO' . $tpServ; |
||
| 739 | } |
||
| 740 | $aFont = $this->formatNegrito; |
||
| 741 | $this->pTextBox($x + $wa + 4.5, $y1 + 3, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, '', false); |
||
| 742 | $this->pdf->Line($w * 0.5, $y1, $w * 0.5, $y1 + $h1); |
||
| 743 | //TOMADOR DO SERVIÇO |
||
| 744 | $texto = 'INDICADOR DO CT-E GLOBALIZADO'; |
||
| 745 | $wc = 37; |
||
| 746 | $y2 = $y1 + 8; |
||
| 747 | $aFont = array( |
||
| 748 | 'font' => $this->fontePadrao, |
||
| 749 | 'size' => 6, |
||
| 750 | 'style' => ''); |
||
| 751 | $this->pTextBox($x, $y2, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 752 | $this->pdf->Line($x, $y1 + 8, $w + 3, $y1 + 8); |
||
| 753 | $toma = $this->pSimpleGetValue($this->ide, "indGlobalizado"); |
||
| 754 | //0-Remetente;1-Expedidor;2-Recebedor;3-Destinatário;4 - Outros |
||
| 755 | if ($toma==1) { |
||
| 756 | $aFont = array( |
||
| 757 | 'font' => $this->fontePadrao, |
||
| 758 | 'size' => 11, |
||
| 759 | 'style' => ''); |
||
| 760 | $this->pTextBox($x-14.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
||
| 761 | } else { |
||
| 762 | $aFont = array( |
||
| 763 | 'font' => $this->fontePadrao, |
||
| 764 | 'size' => 11, |
||
| 765 | 'style' => ''); |
||
| 766 | $this->pTextBox($x+3.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
||
| 767 | } |
||
| 768 | $aFont = $this->formatNegrito; |
||
| 769 | $this->pdf->Line($x+5, $x+48, $x+5, $x+52); |
||
| 770 | $this->pdf->Line($x+10, $x+48, $x+10, $x+52); |
||
| 771 | $this->pdf->Line($x+5, $x+48, $x+10, $x+48); |
||
| 772 | $this->pdf->Line($x+5, $x+52, $x+10, $x+52); |
||
| 773 | $this->pTextBox($x-9, $y2+1.4 + 3, $w * 0.5, $h1, 'SIM', $aFont, 'T', 'C', 0, '', false); |
||
| 774 | |||
| 775 | $this->pdf->Line($x+23, $x+48, $x+23, $x+52); |
||
| 776 | $this->pdf->Line($x+28, $x+48, $x+28, $x+52); |
||
| 777 | $this->pdf->Line($x+23, $x+48, $x+28, $x+48); |
||
| 778 | $this->pdf->Line($x+23, $x+52, $x+28, $x+52); |
||
| 779 | $this->pTextBox($x+9.8, $y2+1.4 + 3, $w * 0.5, $h1, 'NÃO', $aFont, 'T', 'C', 0, '', false); |
||
| 780 | |||
| 781 | //FORMA DE PAGAMENTO |
||
| 782 | $texto = 'INFORMAÇÕES DO CT-E GLOBALIZADO'; |
||
| 783 | $wd = 36; |
||
| 784 | $aFont = array( |
||
| 785 | 'font' => $this->fontePadrao, |
||
| 786 | 'size' => 8, |
||
| 787 | 'style' => ''); |
||
| 788 | $this->pTextBox($x+2 + $wa + 4.5, $y2-0.7, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 789 | $forma = $this->pSimpleGetValue($this->ide, "forPag"); |
||
| 790 | //################################################################## |
||
| 791 | //coluna direita |
||
| 792 | $x += $w + 2; |
||
| 793 | $w = round($maxW * 0.335); |
||
| 794 | $w1 = $w; |
||
| 795 | $h = 11; |
||
| 796 | $this->pTextBox($x, $y, $w + 2, $h + 1); |
||
| 797 | $texto = "DACTE"; |
||
| 798 | $aFont = array( |
||
| 799 | 'font' => $this->fontePadrao, |
||
| 800 | 'size' => 10, |
||
| 801 | 'style' => 'B'); |
||
| 802 | $this->pTextBox($x, $y + 1, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 803 | $aFont = array( |
||
| 804 | 'font' => $this->fontePadrao, |
||
| 805 | 'size' => 8, |
||
| 806 | 'style' => ''); |
||
| 807 | $texto = "Documento Auxiliar do Conhecimento\nde Transporte Eletrônico"; |
||
| 808 | $h = 10; |
||
| 809 | $this->pTextBox($x, $y + 4, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false); |
||
| 810 | $x1 = $x + $w + 2; |
||
| 811 | $w = round($maxW * 0.22, 0); |
||
| 812 | $w2 = $w; |
||
| 813 | $h = 11; |
||
| 814 | $this->pTextBox($x1, $y, $w + 0.5, $h + 1); |
||
| 815 | $texto = "MODAL"; |
||
| 816 | $aFont = array( |
||
| 817 | 'font' => $this->fontePadrao, |
||
| 818 | 'size' => 8, |
||
| 819 | 'style' => ''); |
||
| 820 | $this->pTextBox($x1, $y + 1, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 821 | switch ($this->modal) { |
||
| 822 | case '1': |
||
| 823 | $texto = 'Rodoviário'; |
||
| 824 | break; |
||
| 825 | case '2': |
||
| 826 | $texto = 'Aéreo'; |
||
| 827 | break; |
||
| 828 | case '3': |
||
| 829 | $texto = 'Aquaviário'; |
||
| 830 | break; |
||
| 831 | case '4': |
||
| 832 | $texto = 'Ferroviário'; |
||
| 833 | break; |
||
| 834 | case '5': |
||
| 835 | $texto = 'Dutoviário'; |
||
| 836 | break; |
||
| 837 | } |
||
| 838 | $aFont = array( |
||
| 839 | 'font' => $this->fontePadrao, |
||
| 840 | 'size' => 10, |
||
| 841 | 'style' => 'B'); |
||
| 842 | $this->pTextBox($x1, $y + 5, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 843 | //outra caixa |
||
| 844 | $y += 12; |
||
| 845 | $h = 9; |
||
| 846 | $w = $w1 + $w2 + 2; |
||
| 847 | $this->pTextBox($x, $y, $w + 0.5, $h + 1); |
||
| 848 | //modelo |
||
| 849 | $wa = 12; |
||
| 850 | $xa = $x; |
||
| 851 | $texto = 'MODELO'; |
||
| 852 | $aFont = array( |
||
| 853 | 'font' => $this->fontePadrao, |
||
| 854 | 'size' => 8, |
||
| 855 | 'style' => ''); |
||
| 856 | $this->pTextBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 857 | $texto = $this->pSimpleGetValue($this->ide, "mod"); |
||
| 858 | $aFont = $this->formatNegrito; |
||
| 859 | $this->pTextBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 860 | $this->pdf->Line($x + $wa, $y, $x + $wa, $y + $h + 1); |
||
| 861 | //serie |
||
| 862 | $xa += $wa; |
||
| 863 | $texto = 'SÉRIE'; |
||
| 864 | $aFont = array( |
||
| 865 | 'font' => $this->fontePadrao, |
||
| 866 | 'size' => 8, |
||
| 867 | 'style' => ''); |
||
| 868 | $this->pTextBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 869 | $texto = $this->pSimpleGetValue($this->ide, "serie"); |
||
| 870 | $aFont = $this->formatNegrito; |
||
| 871 | $this->pTextBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 872 | $this->pdf->Line($xa + $wa, $y, $xa + $wa, $y + $h + 1); |
||
| 873 | //numero |
||
| 874 | $xa += $wa; |
||
| 875 | $wa = 20; |
||
| 876 | $texto = 'NÚMERO'; |
||
| 877 | $aFont = array( |
||
| 878 | 'font' => $this->fontePadrao, |
||
| 879 | 'size' => 8, |
||
| 880 | 'style' => ''); |
||
| 881 | $this->pTextBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 882 | $texto = $this->pSimpleGetValue($this->ide, "nCT"); |
||
| 883 | $aFont = $this->formatNegrito; |
||
| 884 | $this->pTextBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 885 | $this->pdf->Line($xa + $wa, $y, $xa + $wa, $y + $h + 1); |
||
| 886 | //folha |
||
| 887 | $xa += $wa; |
||
| 888 | $wa = 12; |
||
| 889 | $texto = 'FL'; |
||
| 890 | $aFont = array( |
||
| 891 | 'font' => $this->fontePadrao, |
||
| 892 | 'size' => 8, |
||
| 893 | 'style' => ''); |
||
| 894 | $this->pTextBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 895 | //$texto = '1/1'; |
||
| 896 | $texto = $pag."/".$totPag; |
||
| 897 | $aFont = $this->formatNegrito; |
||
| 898 | $this->pTextBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 899 | $this->pdf->Line($xa + $wa, $y, $xa + $wa, $y + $h + 1); |
||
| 900 | //data hora de emissão |
||
| 901 | $xa += $wa; |
||
| 902 | $wa = 30; |
||
| 903 | $texto = 'DATA E HORA DE EMISSÃO'; |
||
| 904 | $aFont = array( |
||
| 905 | 'font' => $this->fontePadrao, |
||
| 906 | 'size' => 8, |
||
| 907 | 'style' => ''); |
||
| 908 | $this->pTextBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 909 | $texto = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
||
| 910 | date('d/m/Y H:i:s', $this->pConvertTime($this->pSimpleGetValue($this->ide, "dhEmi"))) : ''; |
||
| 911 | $aFont = $this->formatNegrito; |
||
| 912 | $this->pTextBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 913 | $this->pdf->Line($xa + $wa, $y, $xa + $wa, $y + $h + 1); |
||
| 914 | //ISUF |
||
| 915 | $xa += $wa; |
||
| 916 | $wa = 32; |
||
| 917 | $texto = 'INSC. SUFRAMA DO DESTINATÁRIO'; |
||
| 918 | $aFont = $this->formatPadrao; |
||
| 919 | $this->pTextBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 920 | $texto = $this->pSimpleGetValue($this->dest, "ISUF"); |
||
| 921 | $aFont = array( |
||
| 922 | 'font' => $this->fontePadrao, |
||
| 923 | 'size' => 7, |
||
| 924 | 'style' => 'B'); |
||
| 925 | $this->pTextBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 926 | //outra caixa |
||
| 927 | $y += $h + 1; |
||
| 928 | $h = 23; |
||
| 929 | $h1 = 14; |
||
| 930 | $this->pTextBox($x, $y, $w + 0.5, $h1); |
||
| 931 | //CODIGO DE BARRAS |
||
| 932 | $chave_acesso = str_replace('CTe', '', $this->infCte->getAttribute("Id")); |
||
| 933 | $bW = 85; |
||
| 934 | $bH = 10; |
||
| 935 | //codigo de barras |
||
| 936 | $this->pdf->SetFillColor(0, 0, 0); |
||
| 937 | $this->pdf->Code128($x + (($w - $bW) / 2), $y + 2, $chave_acesso, $bW, $bH); |
||
| 938 | $this->pTextBox($x, $y + $h1, $w + 0.5, $h1 - 6); |
||
| 939 | $texto = 'CHAVE DE ACESSO'; |
||
| 940 | $aFont = $this->formatPadrao; |
||
| 941 | $this->pTextBox($x, $y + $h1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 942 | $aFont = $this->formatNegrito; |
||
| 943 | $texto = $this->pFormat($chave_acesso, '##.####.##.###.###/####-##-##-###-###.###.###-###.###.###-#'); |
||
| 944 | $this->pTextBox($x, $y + $h1 + 3, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 945 | $this->pTextBox($x, $y + $h1 + 8, $w + 0.5, $h1 - 4.5); |
||
| 946 | $texto = "Consulta de autenticidade no portal nacional do CT-e, "; |
||
| 947 | $texto .= "no site da Sefaz Autorizadora, \r\n ou em http://www.cte.fazenda.gov.br"; |
||
| 948 | if ($this->tpEmis == 5 || $this->tpEmis == 7 || $this->tpEmis == 8) { |
||
| 949 | $texto = ""; |
||
| 950 | $this->pdf->SetFillColor(0, 0, 0); |
||
| 951 | if ($this->tpEmis == 5) { |
||
| 952 | $chaveContingencia = $this->zGeraChaveAdicCont(); |
||
| 953 | $this->pdf->Code128($x + 20, $y1 + 10, $chaveContingencia, $bW * .9, $bH / 2); |
||
| 954 | } else { |
||
| 955 | $chaveContingencia = $this->pSimpleGetValue($this->protCTe, "nProt"); |
||
| 956 | $this->pdf->Code128($x + 40, $y1 + 10, $chaveContingencia, $bW * .4, $bH / 2); |
||
| 957 | } |
||
| 958 | //codigo de barras |
||
| 959 | } |
||
| 960 | $aFont = array( |
||
| 961 | 'font' => $this->fontePadrao, |
||
| 962 | 'size' => 8, |
||
| 963 | 'style' => ''); |
||
| 964 | $this->pTextBox($x, $y + $h1 + 9, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 965 | //outra caixa |
||
| 966 | $y += $h + 1; |
||
| 967 | $h = 8.5; |
||
| 968 | $wa = $w; |
||
| 969 | $this->pTextBox($x, $y + 7.5, $w + 0.5, $h); |
||
| 970 | if ($this->zCteDPEC()) { |
||
| 971 | $texto = 'NÚMERO DE REGISTRO DPEC'; |
||
| 972 | } elseif ($this->tpEmis == 5 || $this->tpEmis == 7 || $this->tpEmis == 8) { |
||
| 973 | $texto = "DADOS DO CT-E"; |
||
| 974 | } else { |
||
| 975 | $texto = 'PROTOCOLO DE AUTORIZAÇÃO DE USO'; |
||
| 976 | } |
||
| 977 | $aFont = $this->formatPadrao; |
||
| 978 | $this->pTextBox($x, $y + 7.5, $wa, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 979 | if ($this->zCteDPEC()) { |
||
| 980 | $texto = $this->numero_registro_dpec; |
||
| 981 | } elseif ($this->tpEmis == 5) { |
||
| 982 | $chaveContingencia = $this->zGeraChaveAdicCont(); |
||
| 983 | $aFont = array( |
||
| 984 | 'font' => $this->fontePadrao, |
||
| 985 | 'size' => 8, |
||
| 986 | 'style' => 'B'); |
||
| 987 | $texto = $this->pFormat($chaveContingencia, "#### #### #### #### #### #### #### #### ####"); |
||
| 988 | $cStat = ''; |
||
| 989 | } else { |
||
| 990 | $texto = $this->pSimpleGetValue($this->protCTe, "nProt") . " - "; |
||
| 991 | // empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) |
||
| 992 | if (!empty($this->protCTe) |
||
| 993 | && !empty($this->protCTe->getElementsByTagName("dhRecbto")->item(0)->nodeValue) |
||
| 994 | ) { |
||
| 995 | $texto .= date( |
||
| 996 | 'd/m/Y H:i:s', |
||
| 997 | $this->pConvertTime($this->pSimpleGetValue($this->protCTe, "dhRecbto")) |
||
| 998 | ); |
||
| 999 | } |
||
| 1000 | $texto = $this->pSimpleGetValue($this->protCTe, "nProt") == '' ? '' : $texto; |
||
| 1001 | } |
||
| 1002 | $aFont = $this->formatNegrito; |
||
| 1003 | $this->pTextBox($x, $y + 12, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
||
| 1004 | //CFOP |
||
| 1005 | $x = $oldX; |
||
| 1006 | $h = 8.5; |
||
| 1007 | $w = round($maxW * 0.42); |
||
| 1008 | $y1 = $y + 7.5; |
||
| 1009 | $this->pTextBox($x, $y1, $w + 2, $h); |
||
| 1010 | $texto = 'CFOP - NATUREZA DA PRESTAÇÃO'; |
||
| 1011 | $aFont = array( |
||
| 1012 | 'font' => $this->fontePadrao, |
||
| 1013 | 'size' => 8, |
||
| 1014 | 'style' => ''); |
||
| 1015 | $this->pTextBox($x, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1016 | $texto = $this->pSimpleGetValue($this->ide, "CFOP") . ' - ' . $this->pSimpleGetValue($this->ide, "natOp"); |
||
| 1017 | $aFont = $this->formatNegrito; |
||
| 1018 | $this->pTextBox($x, $y1 + 3.5, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1019 | //ORIGEM DA PRESTAÇÃO |
||
| 1020 | $y += $h + 7.5; |
||
| 1021 | $x = $oldX; |
||
| 1022 | $h = 8; |
||
| 1023 | $w = ($maxW * 0.5); |
||
| 1024 | $this->pTextBox($x, $y, $w + 0.5, $h); |
||
| 1025 | $texto = 'INÍCIO DA PRESTAÇÃO'; |
||
| 1026 | $aFont = array( |
||
| 1027 | 'font' => $this->fontePadrao, |
||
| 1028 | 'size' => 8, |
||
| 1029 | 'style' => ''); |
||
| 1030 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1031 | $texto = $this->pSimpleGetValue($this->ide, "xMunIni") . ' - ' . $this->pSimpleGetValue($this->ide, "UFIni"); |
||
| 1032 | $aFont = $this->formatNegrito; |
||
| 1033 | $this->pTextBox($x, $y + 3.5, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1034 | //DESTINO DA PRESTAÇÃO |
||
| 1035 | $x = $oldX + $w + 1; |
||
| 1036 | $h = 8; |
||
| 1037 | $w = $w - 1.3; |
||
| 1038 | $this->pTextBox($x - 0.5, $y, $w + 0.5, $h); |
||
| 1039 | $texto = 'TÉRMINO DA PRESTAÇÃO'; |
||
| 1040 | $aFont = array( |
||
| 1041 | 'font' => $this->fontePadrao, |
||
| 1042 | 'size' => 8, |
||
| 1043 | 'style' => ''); |
||
| 1044 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1045 | $texto = $this->pSimpleGetValue($this->ide, "xMunFim") . ' - ' . $this->pSimpleGetValue($this->ide, "UFFim"); |
||
| 1046 | $aFont = $this->formatNegrito; |
||
| 1047 | $this->pTextBox($x, $y + 3.5, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1048 | //######################################################################### |
||
| 1049 | //Indicação de CTe Homologação, cancelamento e falta de protocolo |
||
| 1050 | $tpAmb = $this->ide->getElementsByTagName('tpAmb')->item(0)->nodeValue; |
||
| 1051 | //indicar cancelamento |
||
| 1052 | $cStat = $this->pSimpleGetValue($this->cteProc, "cStat"); |
||
| 1053 | if ($cStat == '101' || $cStat == '135' || $this->situacao_externa == self::NFEPHP_SITUACAO_EXTERNA_CANCELADA) { |
||
| 1054 | //101 Cancelamento |
||
| 1055 | $x = 10; |
||
| 1056 | $y = $this->hPrint - 130; |
||
| 1057 | $h = 25; |
||
| 1058 | $w = $maxW - (2 * $x); |
||
| 1059 | $this->pdf->SetTextColor(90, 90, 90); |
||
| 1060 | $texto = "CTe CANCELADO"; |
||
| 1061 | $aFont = array( |
||
| 1062 | 'font' => $this->fontePadrao, |
||
| 1063 | 'size' => 48, |
||
| 1064 | 'style' => 'B'); |
||
| 1065 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 1066 | $this->pdf->SetTextColor(0, 0, 0); |
||
| 1067 | } |
||
| 1068 | $cStat = $this->pSimpleGetValue($this->cteProc, "cStat"); |
||
| 1069 | if ($cStat == '110' || |
||
| 1070 | $cStat == '301' || |
||
| 1071 | $cStat == '302' || |
||
| 1072 | $this->situacao_externa == self::NFEPHP_SITUACAO_EXTERNA_DENEGADA |
||
| 1073 | ) { |
||
| 1074 | //110 Denegada |
||
| 1075 | $x = 10; |
||
| 1076 | $y = $this->hPrint - 130; |
||
| 1077 | $h = 25; |
||
| 1078 | $w = $maxW - (2 * $x); |
||
| 1079 | $this->pdf->SetTextColor(90, 90, 90); |
||
| 1080 | $texto = "CTe USO DENEGADO"; |
||
| 1081 | $aFont = array( |
||
| 1082 | 'font' => $this->fontePadrao, |
||
| 1083 | 'size' => 48, |
||
| 1084 | 'style' => 'B'); |
||
| 1085 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 1086 | $y += $h; |
||
| 1087 | $h = 5; |
||
| 1088 | $w = $maxW - (2 * $x); |
||
| 1089 | $texto = "SEM VALOR FISCAL"; |
||
| 1090 | $aFont = array( |
||
| 1091 | 'font' => $this->fontePadrao, |
||
| 1092 | 'size' => 48, |
||
| 1093 | 'style' => 'B'); |
||
| 1094 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 1095 | $this->pdf->SetTextColor(0, 0, 0); |
||
| 1096 | } |
||
| 1097 | //indicar sem valor |
||
| 1098 | if ($tpAmb != 1 && $this->preVisualizar=='0') { // caso não seja uma DA de produção |
||
| 1099 | $x = 10; |
||
| 1100 | if ($this->orientacao == 'P') { |
||
| 1101 | $y = round($this->hPrint * 2 / 3, 0); |
||
| 1102 | } else { |
||
| 1103 | $y = round($this->hPrint / 2, 0); |
||
| 1104 | } |
||
| 1105 | $h = 5; |
||
| 1106 | $w = $maxW - (2 * $x); |
||
| 1107 | $this->pdf->SetTextColor(90, 90, 90); |
||
| 1108 | $texto = "SEM VALOR FISCAL"; |
||
| 1109 | $aFont = array( |
||
| 1110 | 'font' => $this->fontePadrao, |
||
| 1111 | 'size' => 48, |
||
| 1112 | 'style' => 'B'); |
||
| 1113 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 1114 | $aFont = array( |
||
| 1115 | 'font' => $this->fontePadrao, |
||
| 1116 | 'size' => 30, |
||
| 1117 | 'style' => 'B'); |
||
| 1118 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
||
| 1119 | $this->pTextBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 1120 | $this->pdf->SetTextColor(0, 0, 0); |
||
| 1121 | } elseif ($this->preVisualizar=='1') { // caso seja uma DA de Pré-Visualização |
||
| 1122 | $h = 5; |
||
| 1123 | $w = $maxW - (2 * 10); |
||
| 1124 | $x = 55; |
||
| 1125 | $y = 240; |
||
| 1126 | $this->pdf->SetTextColor(255, 100, 100); |
||
| 1127 | $aFont = array( |
||
| 1128 | 'font' => $this->fontePadrao, |
||
| 1129 | 'size' => 40, |
||
| 1130 | 'style' => 'B'); |
||
| 1131 | $texto = "Pré-visualização"; |
||
| 1132 | $this->pTextBox90($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 1133 | $this->pdf->SetTextColor(255, 100, 100); |
||
| 1134 | $aFont = array( |
||
| 1135 | 'font' => $this->fontePadrao, |
||
| 1136 | 'size' => 41, |
||
| 1137 | 'style' => 'B'); |
||
| 1138 | $texto = "Sem Validade Jurídica"; |
||
| 1139 | $this->pTextBox90($x+20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 1140 | $this->pdf->SetTextColor(90, 90, 90); |
||
| 1141 | $texto = "SEM VALOR FISCAL"; |
||
| 1142 | $aFont = array( |
||
| 1143 | 'font' => $this->fontePadrao, |
||
| 1144 | 'size' => 48, |
||
| 1145 | 'style' => 'B'); |
||
| 1146 | $this->pTextBox90($x+40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 1147 | $this->pdf->SetTextColor(0, 0, 0); // voltar a cor default |
||
| 1148 | } else { |
||
| 1149 | $x = 10; |
||
| 1150 | if ($this->orientacao == 'P') { |
||
| 1151 | $y = round($this->hPrint * 2 / 3, 0); |
||
| 1152 | } else { |
||
| 1153 | $y = round($this->hPrint / 2, 0); |
||
| 1154 | } //fim orientacao |
||
| 1155 | $h = 5; |
||
| 1156 | $w = $maxW - (2 * $x); |
||
| 1157 | $this->pdf->SetTextColor(90, 90, 90); |
||
| 1158 | //indicar FALTA DO PROTOCOLO se NFe não for em contingência |
||
| 1159 | if (($this->tpEmis == 5 || $this->tpEmis == 7 || $this->tpEmis == 8) && !$this->zCteDPEC()) { |
||
| 1160 | //Contingência |
||
| 1161 | $texto = "DACTE Emitido em Contingência"; |
||
| 1162 | $aFont = array( |
||
| 1163 | 'font' => $this->fontePadrao, |
||
| 1164 | 'size' => 48, |
||
| 1165 | 'style' => 'B'); |
||
| 1166 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 1167 | $aFont = array( |
||
| 1168 | 'font' => $this->fontePadrao, |
||
| 1169 | 'size' => 30, |
||
| 1170 | 'style' => 'B'); |
||
| 1171 | $texto = "devido à problemas técnicos"; |
||
| 1172 | $this->pTextBox($x, $y + 12, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 1173 | } else { |
||
| 1174 | if (!isset($this->protCTe)) { |
||
| 1175 | if (!$this->zCteDPEC()) { |
||
| 1176 | $texto = "SEM VALOR FISCAL"; |
||
| 1177 | $aFont = array( |
||
| 1178 | 'font' => $this->fontePadrao, |
||
| 1179 | 'size' => 48, |
||
| 1180 | 'style' => 'B'); |
||
| 1181 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 1182 | } |
||
| 1183 | $aFont = array( |
||
| 1184 | 'font' => $this->fontePadrao, |
||
| 1185 | 'size' => 30, |
||
| 1186 | 'style' => 'B'); |
||
| 1187 | $texto = "FALTA PROTOCOLO DE APROVAÇÃO DA SEFAZ"; |
||
| 1188 | if (!$this->zCteDPEC()) { |
||
| 1189 | $this->pTextBox($x, $y + 12, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 1190 | } else { |
||
| 1191 | $this->pTextBox($x, $y + 25, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 1192 | } |
||
| 1193 | } //fim cteProc |
||
| 1194 | if ($this->tpEmis == 4) { |
||
| 1195 | //DPEC |
||
| 1196 | $x = 10; |
||
| 1197 | $y = $this->hPrint - 130; |
||
| 1198 | $h = 25; |
||
| 1199 | $w = $maxW - (2 * $x); |
||
| 1200 | $this->pdf->SetTextColor(200, 200, 200); // 90,90,90 é muito escuro |
||
| 1201 | $texto = "DACTE impresso em contingência -\n" |
||
| 1202 | . "DPEC regularmente recebido pela Receita\n" |
||
| 1203 | . "Federal do Brasil"; |
||
| 1204 | $aFont = array( |
||
| 1205 | 'font' => $this->fontePadrao, |
||
| 1206 | 'size' => 48, |
||
| 1207 | 'style' => 'B'); |
||
| 1208 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
||
| 1209 | $this->pdf->SetTextColor(0, 0, 0); |
||
| 1210 | } |
||
| 1211 | } //fim tpEmis |
||
| 1212 | $this->pdf->SetTextColor(0, 0, 0); |
||
| 1213 | } |
||
| 1214 | return $oldY; |
||
| 1215 | } //fim zCabecalho |
||
| 1216 | |||
| 1217 | /** |
||
| 1218 | * rodapeDACTE |
||
| 1219 | * Monta o rodape no final da DACTE ( retrato e paisagem ) |
||
| 1220 | * |
||
| 1221 | * @param number $xInic Posição horizontal canto esquerdo |
||
| 1222 | * @param number $yFinal Posição vertical final para impressão |
||
| 1223 | */ |
||
| 1224 | protected function zRodape($x, $y) |
||
| 1225 | { |
||
| 1226 | $texto = "Impresso em " . date('d/m/Y H:i:s'); |
||
| 1227 | $w = $this->wPrint - 4; |
||
| 1228 | $aFont = array( |
||
| 1229 | 'font' => $this->fontePadrao, |
||
| 1230 | 'size' => 6, |
||
| 1231 | 'style' => ''); |
||
| 1232 | $this->pTextBox($x, $y, $w, 4, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1233 | $texto = 'Desenvolvido por '.$this->nomeDesenvolvedor . ' - '. $this->siteDesenvolvedor; |
||
| 1234 | $aFont = array( |
||
| 1235 | 'font' => $this->fontePadrao, |
||
| 1236 | 'size' => 6, |
||
| 1237 | 'style' => ''); |
||
| 1238 | $this->pTextBox($x, $y, $w, 4, $texto, $aFont, 'T', 'R', 0, $this->siteDesenvolvedor); |
||
| 1239 | } //fim zRodape |
||
| 1240 | |||
| 1241 | /** |
||
| 1242 | * zRemetente |
||
| 1243 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
||
| 1244 | * |
||
| 1245 | * @param number $x Posição horizontal canto esquerdo |
||
| 1246 | * @param number $y Posição vertical canto superior |
||
| 1247 | * @return number Posição vertical final |
||
| 1248 | */ |
||
| 1249 | protected function zRemetente($x = 0, $y = 0) |
||
| 1250 | { |
||
| 1251 | $oldX = $x; |
||
| 1252 | $oldY = $y; |
||
| 1253 | if ($this->orientacao == 'P') { |
||
| 1254 | $maxW = $this->wPrint; |
||
| 1255 | } else { |
||
| 1256 | $maxW = $this->wPrint - $this->wCanhoto; |
||
| 1257 | } |
||
| 1258 | $w = $maxW * 0.5 + 0.5; |
||
| 1259 | $h = 19; |
||
| 1260 | $x1 = $x + 16; |
||
| 1261 | $texto = 'REMETENTE'; |
||
| 1262 | $aFont = $this->formatPadrao; |
||
| 1263 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
||
| 1264 | $aFont = $this->formatNegrito; |
||
| 1265 | $texto = $this->pSimpleGetValue($this->rem, "xNome"); |
||
| 1266 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1267 | $y += 3; |
||
| 1268 | $texto = 'ENDEREÇO'; |
||
| 1269 | $aFont = $this->formatPadrao; |
||
| 1270 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1271 | $aFont = $this->formatNegrito; |
||
| 1272 | $texto = $this->pSimpleGetValue($this->enderReme, "xLgr") . ','; |
||
| 1273 | $texto .= $this->pSimpleGetValue($this->enderReme, "nro"); |
||
| 1274 | $texto .= ($this->pSimpleGetValue($this->enderReme, "xCpl") != "") ? |
||
| 1275 | ' - ' . $this->pSimpleGetValue($this->enderReme, "xCpl") : ''; |
||
| 1276 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1277 | $y += 3; |
||
| 1278 | $texto = $this->pSimpleGetValue($this->enderReme, "xBairro"); |
||
| 1279 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1280 | $y += 3; |
||
| 1281 | $texto = 'MUNICÍPIO'; |
||
| 1282 | $aFont = $this->formatPadrao; |
||
| 1283 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1284 | $texto = $this->pSimpleGetValue($this->enderReme, "xMun") . ' - '; |
||
| 1285 | $texto .= $this->pSimpleGetValue($this->enderReme, "UF"); |
||
| 1286 | $aFont = $this->formatNegrito; |
||
| 1287 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1288 | $x = $w - 18; |
||
| 1289 | $texto = 'CEP'; |
||
| 1290 | $aFont = $this->formatPadrao; |
||
| 1291 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1292 | $texto = $this->pFormat($this->pSimpleGetValue($this->enderReme, "CEP"), "#####-###"); |
||
| 1293 | $aFont = $this->formatNegrito; |
||
| 1294 | $this->pTextBox($x + 6, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1295 | $x = $oldX; |
||
| 1296 | $y += 3; |
||
| 1297 | $texto = 'CNPJ/CPF'; |
||
| 1298 | $aFont = $this->formatPadrao; |
||
| 1299 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1300 | $cpfCnpj = $this->zFormatCNPJCPF($this->rem); |
||
| 1301 | $aFont = $this->formatNegrito; |
||
| 1302 | $this->pTextBox($x1, $y, $w, $h, $cpfCnpj, $aFont, 'T', 'L', 0, ''); |
||
| 1303 | $x = $w - 45; |
||
| 1304 | $texto = 'INSCRIÇÃO ESTADUAL'; |
||
| 1305 | $aFont = $this->formatPadrao; |
||
| 1306 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1307 | $texto = $this->pSimpleGetValue($this->rem, "IE"); |
||
| 1308 | $aFont = $this->formatNegrito; |
||
| 1309 | $this->pTextBox($x + 28, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1310 | $x = $oldX; |
||
| 1311 | $y += 3; |
||
| 1312 | $texto = 'PAÍS'; |
||
| 1313 | $aFont = $this->formatPadrao; |
||
| 1314 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1315 | $texto = $this->pSimpleGetValue($this->rem, "xPais") != "" ? |
||
| 1316 | $this->pSimpleGetValue($this->rem, "xPais") : 'BRASIL'; |
||
| 1317 | $aFont = $this->formatNegrito; |
||
| 1318 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1319 | $x = $w - 25; |
||
| 1320 | $texto = 'FONE'; |
||
| 1321 | $aFont = $this->formatPadrao; |
||
| 1322 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1323 | //$texto = $this->zFormatFone($this->rem); |
||
| 1324 | $texto = $this->pSimpleGetValue($this->rem, "fone")!=""? $this->zFormatFone($this->rem):''; |
||
| 1325 | $aFont = $this->formatNegrito; |
||
| 1326 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1327 | } //fim da função remetenteDACTE |
||
| 1328 | |||
| 1329 | /** |
||
| 1330 | * zDestinatario |
||
| 1331 | * Monta o campo com os dados do destinatário na DACTE. |
||
| 1332 | * |
||
| 1333 | * @param number $x Posição horizontal canto esquerdo |
||
| 1334 | * @param number $y Posição vertical canto superior |
||
| 1335 | * @return number Posição vertical final |
||
| 1336 | */ |
||
| 1337 | protected function zDestinatario($x = 0, $y = 0) |
||
| 1338 | { |
||
| 1339 | $oldX = $x; |
||
| 1340 | $oldY = $y; |
||
| 1341 | if ($this->orientacao == 'P') { |
||
| 1342 | $maxW = $this->wPrint; |
||
| 1343 | } else { |
||
| 1344 | $maxW = $this->wPrint - $this->wCanhoto; |
||
| 1345 | } |
||
| 1346 | $w = ($maxW * 0.5) - 0.7; |
||
| 1347 | $h = 19; |
||
| 1348 | $x1 = $x + 19; |
||
| 1349 | $texto = 'DESTINATÁRIO'; |
||
| 1350 | $aFont = $this->formatPadrao; |
||
| 1351 | $this->pTextBox($x - 0.5, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
||
| 1352 | $aFont = $this->formatNegrito; |
||
| 1353 | $texto = $this->pSimpleGetValue($this->dest, "xNome"); |
||
| 1354 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1355 | $y += 3; |
||
| 1356 | $texto = 'ENDEREÇO'; |
||
| 1357 | $aFont = $this->formatPadrao; |
||
| 1358 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1359 | $aFont = $this->formatNegrito; |
||
| 1360 | $texto = $this->pSimpleGetValue($this->enderDest, "xLgr") . ','; |
||
| 1361 | $texto .= $this->pSimpleGetValue($this->enderDest, "nro"); |
||
| 1362 | $texto .= $this->pSimpleGetValue($this->enderDest, "xCpl") != "" ? |
||
| 1363 | ' - ' . $this->pSimpleGetValue($this->enderDest, "xCpl") : ''; |
||
| 1364 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1365 | $y += 3; |
||
| 1366 | $texto = $this->pSimpleGetValue($this->enderDest, "xBairro"); |
||
| 1367 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1368 | $y += 3; |
||
| 1369 | $texto = 'MUNICÍPIO'; |
||
| 1370 | $aFont = $this->formatPadrao; |
||
| 1371 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1372 | $texto = $this->pSimpleGetValue($this->enderDest, "xMun") . ' - '; |
||
| 1373 | $texto .= $this->pSimpleGetValue($this->enderDest, "UF"); |
||
| 1374 | $aFont = $this->formatNegrito; |
||
| 1375 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1376 | $x = $w - 19 + $oldX; |
||
| 1377 | $texto = 'CEP'; |
||
| 1378 | $aFont = $this->formatPadrao; |
||
| 1379 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1380 | $texto = $this->pFormat($this->pSimpleGetValue($this->enderDest, "CEP"), "#####-###"); |
||
| 1381 | $aFont = $this->formatNegrito; |
||
| 1382 | $this->pTextBox($x + 5, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1383 | $x = $oldX; |
||
| 1384 | $y += 3; |
||
| 1385 | $texto = 'CNPJ/CPF'; |
||
| 1386 | $aFont = $this->formatPadrao; |
||
| 1387 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1388 | $cpfCnpj = $this->zFormatCNPJCPF($this->dest); |
||
| 1389 | $aFont = $this->formatNegrito; |
||
| 1390 | $this->pTextBox($x1, $y, $w, $h, $cpfCnpj, $aFont, 'T', 'L', 0, ''); |
||
| 1391 | $x = $w - 47.5 + $oldX; |
||
| 1392 | $texto = 'INSCRIÇÃO ESTADUAL'; |
||
| 1393 | $aFont = $this->formatPadrao; |
||
| 1394 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1395 | $texto = $this->pSimpleGetValue($this->dest, "IE"); |
||
| 1396 | $aFont = $this->formatNegrito; |
||
| 1397 | $this->pTextBox($x + 28, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1398 | $x = $oldX; |
||
| 1399 | $y += 3; |
||
| 1400 | $texto = 'PAÍS'; |
||
| 1401 | $aFont = $this->formatPadrao; |
||
| 1402 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1403 | $texto = $this->pSimpleGetValue($this->dest, "xPais"); |
||
| 1404 | $aFont = $this->formatNegrito; |
||
| 1405 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1406 | $x = $w - 27 + $oldX; |
||
| 1407 | $texto = 'FONE'; |
||
| 1408 | $aFont = $this->formatPadrao; |
||
| 1409 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1410 | //$texto = $this->zFormatFone($this->dest); |
||
| 1411 | $texto = $this->pSimpleGetValue($this->dest, "fone")!=""? $this->zFormatFone($this->dest):''; |
||
| 1412 | $aFont = $this->formatNegrito; |
||
| 1413 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1414 | } //fim da função destinatarioDACTE |
||
| 1415 | |||
| 1416 | /** |
||
| 1417 | * zExpedidor |
||
| 1418 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
||
| 1419 | * |
||
| 1420 | * @param number $x Posição horizontal canto esquerdo |
||
| 1421 | * @param number $y Posição vertical canto superior |
||
| 1422 | * @return number Posição vertical final |
||
| 1423 | */ |
||
| 1424 | protected function zExpedidor($x = 0, $y = 0) |
||
| 1425 | { |
||
| 1426 | $oldX = $x; |
||
| 1427 | $oldY = $y; |
||
| 1428 | if ($this->orientacao == 'P') { |
||
| 1429 | $maxW = $this->wPrint; |
||
| 1430 | } else { |
||
| 1431 | $maxW = $this->wPrint - $this->wCanhoto; |
||
| 1432 | } |
||
| 1433 | $w = $maxW * 0.5 + 0.5; |
||
| 1434 | $h = 19; |
||
| 1435 | $x1 = $x + 16; |
||
| 1436 | $texto = 'EXPEDIDOR'; |
||
| 1437 | $aFont = $this->formatPadrao; |
||
| 1438 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
||
| 1439 | $aFont = $this->formatNegrito; |
||
| 1440 | $texto = $this->pSimpleGetValue($this->exped, "xNome"); |
||
| 1441 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1442 | $y += 3; |
||
| 1443 | $texto = 'ENDEREÇO'; |
||
| 1444 | $aFont = $this->formatPadrao; |
||
| 1445 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1446 | $aFont = $this->formatNegrito; |
||
| 1447 | if (isset($this->enderExped)) { |
||
| 1448 | $texto = $this->pSimpleGetValue($this->enderExped, "xLgr") . ', '; |
||
| 1449 | $texto .= $this->pSimpleGetValue($this->enderExped, "nro"); |
||
| 1450 | $texto .= $this->pSimpleGetValue($this->enderExped, "xCpl") != "" ? |
||
| 1451 | ' - ' . $this->pSimpleGetValue($this->enderExped, "xCpl") : |
||
| 1452 | ''; |
||
| 1453 | } else { |
||
| 1454 | $texto = ''; |
||
| 1455 | } |
||
| 1456 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1457 | $y += 3; |
||
| 1458 | $texto = $this->pSimpleGetValue($this->enderExped, "xBairro"); |
||
| 1459 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1460 | $y += 3; |
||
| 1461 | $texto = 'MUNICÍPIO'; |
||
| 1462 | $aFont = $this->formatPadrao; |
||
| 1463 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1464 | if (isset($this->enderExped)) { |
||
| 1465 | $texto = $this->pSimpleGetValue($this->enderExped, "xMun") . ' - '; |
||
| 1466 | $texto .= $this->pSimpleGetValue($this->enderExped, "UF"); |
||
| 1467 | } else { |
||
| 1468 | $texto = ''; |
||
| 1469 | } |
||
| 1470 | $aFont = $this->formatNegrito; |
||
| 1471 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1472 | $x = $w - 18; |
||
| 1473 | $texto = 'CEP'; |
||
| 1474 | $aFont = $this->formatPadrao; |
||
| 1475 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1476 | $texto = $this->pFormat($this->pSimpleGetValue($this->enderExped, "CEP"), "#####-###"); |
||
| 1477 | $aFont = $this->formatNegrito; |
||
| 1478 | $this->pTextBox($x + 6, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1479 | $x = $oldX; |
||
| 1480 | $y += 3; |
||
| 1481 | $texto = 'CNPJ/CPF'; |
||
| 1482 | $aFont = $this->formatPadrao; |
||
| 1483 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1484 | $cpfCnpj = $this->zFormatCNPJCPF($this->exped); |
||
| 1485 | $aFont = $this->formatNegrito; |
||
| 1486 | $this->pTextBox($x1, $y, $w, $h, $cpfCnpj, $aFont, 'T', 'L', 0, ''); |
||
| 1487 | $x = $w - 45; |
||
| 1488 | $texto = 'INSCRIÇÃO ESTADUAL'; |
||
| 1489 | $aFont = $this->formatPadrao; |
||
| 1490 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1491 | $texto = $this->pSimpleGetValue($this->exped, "IE"); |
||
| 1492 | $aFont = $this->formatNegrito; |
||
| 1493 | $this->pTextBox($x + 28, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1494 | $x = $oldX; |
||
| 1495 | $y += 3; |
||
| 1496 | $texto = 'PAÍS'; |
||
| 1497 | $aFont = $this->formatPadrao; |
||
| 1498 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1499 | $texto = $this->pSimpleGetValue($this->exped, "xPais"); |
||
| 1500 | $aFont = $this->formatNegrito; |
||
| 1501 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1502 | $x = $w - 25; |
||
| 1503 | $texto = 'FONE'; |
||
| 1504 | $aFont = $this->formatPadrao; |
||
| 1505 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1506 | if (isset($this->exped)) { |
||
| 1507 | $texto = $this->pSimpleGetValue($this->exped, "fone")!=""? $this->zFormatFone($this->exped):''; |
||
| 1508 | $aFont = $this->formatNegrito; |
||
| 1509 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1510 | } |
||
| 1511 | } //fim da função remetenteDACTE |
||
| 1512 | |||
| 1513 | /** |
||
| 1514 | * zRecebedor |
||
| 1515 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
||
| 1516 | * |
||
| 1517 | * @param number $x Posição horizontal canto esquerdo |
||
| 1518 | * @param number $y Posição vertical canto superior |
||
| 1519 | * @return number Posição vertical final |
||
| 1520 | */ |
||
| 1521 | protected function zRecebedor($x = 0, $y = 0) |
||
| 1522 | { |
||
| 1523 | $oldX = $x; |
||
| 1524 | $oldY = $y; |
||
| 1525 | if ($this->orientacao == 'P') { |
||
| 1526 | $maxW = $this->wPrint; |
||
| 1527 | } else { |
||
| 1528 | $maxW = $this->wPrint - $this->wCanhoto; |
||
| 1529 | } |
||
| 1530 | $w = ($maxW * 0.5) - 0.7; |
||
| 1531 | $h = 19; |
||
| 1532 | $x1 = $x + 19; |
||
| 1533 | $texto = 'RECEBEDOR'; |
||
| 1534 | $aFont = $this->formatPadrao; |
||
| 1535 | $this->pTextBox($x - 0.5, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
||
| 1536 | $aFont = $this->formatNegrito; |
||
| 1537 | $texto = $this->pSimpleGetValue($this->receb, "xNome"); |
||
| 1538 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1539 | $y += 3; |
||
| 1540 | $texto = 'ENDEREÇO'; |
||
| 1541 | $aFont = $this->formatPadrao; |
||
| 1542 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1543 | $aFont = $this->formatNegrito; |
||
| 1544 | if (isset($this->enderReceb)) { |
||
| 1545 | $texto = $this->pSimpleGetValue($this->enderReceb, "xLgr") . ', '; |
||
| 1546 | $texto .= $this->pSimpleGetValue($this->enderReceb, "nro"); |
||
| 1547 | $texto .= ($this->pSimpleGetValue($this->enderReceb, "xCpl") != "") ? |
||
| 1548 | ' - ' . $this->pSimpleGetValue($this->enderReceb, "xCpl") : |
||
| 1549 | ''; |
||
| 1550 | } else { |
||
| 1551 | $texto = ''; |
||
| 1552 | } |
||
| 1553 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1554 | $y += 3; |
||
| 1555 | $texto = $this->pSimpleGetValue($this->enderReceb, "xBairro"); |
||
| 1556 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1557 | $y += 3; |
||
| 1558 | $texto = 'MUNICÍPIO'; |
||
| 1559 | $aFont = $this->formatPadrao; |
||
| 1560 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1561 | if (isset($this->enderReceb)) { |
||
| 1562 | $texto = $this->pSimpleGetValue($this->enderReceb, "xMun") . ' - '; |
||
| 1563 | $texto .= $this->pSimpleGetValue($this->enderReceb, "UF"); |
||
| 1564 | } else { |
||
| 1565 | $texto = ''; |
||
| 1566 | } |
||
| 1567 | $aFont = $this->formatNegrito; |
||
| 1568 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1569 | $x = $w - 19 + $oldX; |
||
| 1570 | $texto = 'CEP'; |
||
| 1571 | $aFont = $this->formatPadrao; |
||
| 1572 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1573 | $texto = $this->pFormat($this->pSimpleGetValue($this->enderReceb, "CEP"), "#####-###"); |
||
| 1574 | $aFont = $this->formatNegrito; |
||
| 1575 | $this->pTextBox($x + 5, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1576 | $x = $oldX; |
||
| 1577 | $y += 3; |
||
| 1578 | $texto = 'CNPJ/CPF'; |
||
| 1579 | $aFont = $this->formatPadrao; |
||
| 1580 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1581 | $texto = $this->zFormatCNPJCPF($this->receb); |
||
| 1582 | $aFont = $this->formatNegrito; |
||
| 1583 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1584 | $x = $w - 47 + $oldX; |
||
| 1585 | $texto = 'INSCRIÇÃO ESTADUAL'; |
||
| 1586 | $aFont = $this->formatPadrao; |
||
| 1587 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1588 | $texto = $this->pSimpleGetValue($this->receb, "IE"); |
||
| 1589 | $aFont = $this->formatNegrito; |
||
| 1590 | $this->pTextBox($x + 28, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1591 | $x = $oldX; |
||
| 1592 | $y += 3; |
||
| 1593 | $texto = 'PAÍS'; |
||
| 1594 | $aFont = $this->formatPadrao; |
||
| 1595 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1596 | $texto = $this->pSimpleGetValue($this->receb, "xPais"); |
||
| 1597 | $aFont = $this->formatNegrito; |
||
| 1598 | $this->pTextBox($x1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1599 | $x = $w - 27 + $oldX; |
||
| 1600 | $texto = 'FONE'; |
||
| 1601 | $aFont = $this->formatPadrao; |
||
| 1602 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1603 | if (isset($this->receb)) { |
||
| 1604 | $texto = $this->pSimpleGetValue($this->receb, "fone")!=""? $this->zFormatFone($this->receb):''; |
||
| 1605 | $aFont = $this->formatNegrito; |
||
| 1606 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1607 | } |
||
| 1608 | } //fim da função recebedorDACTE |
||
| 1609 | |||
| 1610 | /** |
||
| 1611 | * zTomador |
||
| 1612 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
||
| 1613 | * |
||
| 1614 | * @param number $x Posição horizontal canto esquerdo |
||
| 1615 | * @param number $y Posição vertical canto superior |
||
| 1616 | * @return number Posição vertical final |
||
| 1617 | */ |
||
| 1618 | protected function zTomador($x = 0, $y = 0) |
||
| 1619 | { |
||
| 1620 | $oldX = $x; |
||
| 1621 | $oldY = $y; |
||
| 1622 | if ($this->orientacao == 'P') { |
||
| 1623 | $maxW = $this->wPrint; |
||
| 1624 | } else { |
||
| 1625 | $maxW = $this->wPrint - $this->wCanhoto; |
||
| 1626 | } |
||
| 1627 | $w = $maxW; |
||
| 1628 | $h = 10; |
||
| 1629 | $texto = 'TOMADOR DO SERVIÇO'; |
||
| 1630 | $aFont = $this->formatPadrao; |
||
| 1631 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
||
| 1632 | $aFont = $this->formatNegrito; |
||
| 1633 | $texto = $this->pSimpleGetValue($this->toma, "xNome"); |
||
| 1634 | $this->pTextBox($x + 29, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1635 | $x = $maxW * 0.60; |
||
| 1636 | $texto = 'MUNICÍPIO'; |
||
| 1637 | $aFont = $this->formatPadrao; |
||
| 1638 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1639 | $texto = $this->pSimpleGetValue($this->toma, "xMun"); |
||
| 1640 | $aFont = $this->formatNegrito; |
||
| 1641 | $this->pTextBox($x + 15, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1642 | $x = $maxW * 0.85; |
||
| 1643 | $texto = 'UF'; |
||
| 1644 | $aFont = $this->formatPadrao; |
||
| 1645 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1646 | $texto = $this->pSimpleGetValue($this->toma, "UF"); |
||
| 1647 | $aFont = $this->formatNegrito; |
||
| 1648 | $this->pTextBox($x + 4, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1649 | $x = $w - 18; |
||
| 1650 | $texto = 'CEP'; |
||
| 1651 | $aFont = $this->formatPadrao; |
||
| 1652 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1653 | $texto = $this->pFormat($this->pSimpleGetValue($this->toma, "CEP"), "#####-###"); |
||
| 1654 | $aFont = $this->formatNegrito; |
||
| 1655 | $this->pTextBox($x + 6, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1656 | $y += 3; |
||
| 1657 | $x = $oldX; |
||
| 1658 | $texto = 'ENDEREÇO'; |
||
| 1659 | $aFont = $this->formatPadrao; |
||
| 1660 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1661 | $aFont = $this->formatNegrito; |
||
| 1662 | $texto = $this->pSimpleGetValue($this->toma, "xLgr") . ','; |
||
| 1663 | $texto .= $this->pSimpleGetValue($this->toma, "nro"); |
||
| 1664 | $texto .= ($this->pSimpleGetValue($this->toma, "xCpl") != "") ? |
||
| 1665 | ' - ' . $this->pSimpleGetValue($this->toma, "xCpl") : ''; |
||
| 1666 | $texto .= ' - ' . $this->pSimpleGetValue($this->toma, "xBairro"); |
||
| 1667 | $this->pTextBox($x + 16, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1668 | $y += 3; |
||
| 1669 | $texto = 'CNPJ/CPF'; |
||
| 1670 | $aFont = $this->formatPadrao; |
||
| 1671 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1672 | $texto = $this->zFormatCNPJCPF($this->toma); |
||
| 1673 | $aFont = $this->formatNegrito; |
||
| 1674 | $this->pTextBox($x + 13, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1675 | $x = $x + 65; |
||
| 1676 | $texto = 'INSCRIÇÃO ESTADUAL'; |
||
| 1677 | $aFont = $this->formatPadrao; |
||
| 1678 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1679 | $texto = $this->pSimpleGetValue($this->toma, "IE"); |
||
| 1680 | $aFont = $this->formatNegrito; |
||
| 1681 | $this->pTextBox($x + 28, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1682 | $x = $w * 0.75; |
||
| 1683 | $texto = 'PAÍS'; |
||
| 1684 | $aFont = $this->formatPadrao; |
||
| 1685 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1686 | $texto = $this->pSimpleGetValue($this->toma, "xPais") != "" ? |
||
| 1687 | $this->pSimpleGetValue($this->toma, "xPais") : 'BRASIL'; |
||
| 1688 | $aFont = $this->formatNegrito; |
||
| 1689 | $this->pTextBox($x + 6, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1690 | $x = $w - 27; |
||
| 1691 | $texto = 'FONE'; |
||
| 1692 | $aFont = $this->formatPadrao; |
||
| 1693 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1694 | $texto = $this->pSimpleGetValue($this->toma, "fone")!=""? $this->zFormatFone($this->toma):''; |
||
| 1695 | $aFont = $this->formatNegrito; |
||
| 1696 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1697 | } //fim da função tomadorDACTE |
||
| 1698 | |||
| 1699 | /** |
||
| 1700 | * zDescricaoCarga |
||
| 1701 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
||
| 1702 | * |
||
| 1703 | * @param number $x Posição horizontal canto esquerdo |
||
| 1704 | * @param number $y Posição vertical canto superior |
||
| 1705 | * @return number Posição vertical final |
||
| 1706 | */ |
||
| 1707 | protected function zDescricaoCarga($x = 0, $y = 0) |
||
| 1708 | { |
||
| 1709 | $oldX = $x; |
||
| 1710 | $oldY = $y; |
||
| 1711 | if ($this->orientacao == 'P') { |
||
| 1712 | $maxW = $this->wPrint; |
||
| 1713 | } else { |
||
| 1714 | $maxW = $this->wPrint - $this->wCanhoto; |
||
| 1715 | } |
||
| 1716 | $w = $maxW; |
||
| 1717 | $h = 17; |
||
| 1718 | $texto = 'PRODUTO PREDOMINANTE'; |
||
| 1719 | $aFont = array( |
||
| 1720 | 'font' => $this->fontePadrao, |
||
| 1721 | 'size' => 6, |
||
| 1722 | 'style' => ''); |
||
| 1723 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
||
| 1724 | $texto = $this->pSimpleGetValue($this->infCarga, "proPred"); |
||
| 1725 | $aFont = $this->formatNegrito; |
||
| 1726 | $this->pTextBox($x, $y + 2.8, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1727 | $x = $w * 0.56; |
||
| 1728 | $this->pdf->Line($x, $y, $x, $y + 8); |
||
| 1729 | $aFont = $this->formatPadrao; |
||
| 1730 | $texto = 'OUTRAS CARACTERÍSTICAS DA CARGA'; |
||
| 1731 | $this->pTextBox($x + 1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1732 | $texto = $this->pSimpleGetValue($this->infCarga, "xOutCat"); |
||
| 1733 | $aFont = $this->formatNegrito; |
||
| 1734 | $this->pTextBox($x + 1, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1735 | $x = $w * 0.8; |
||
| 1736 | $this->pdf->Line($x, $y, $x, $y + 8); |
||
| 1737 | $aFont = $this->formatPadrao; |
||
| 1738 | $texto = 'VALOR TOTAL DA CARGA'; |
||
| 1739 | $this->pTextBox($x + 1, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1740 | $texto = $this->pSimpleGetValue($this->infCarga, "vCarga") == "" ? |
||
| 1741 | $this->pSimpleGetValue($this->infCarga, "vMerc") : $this->pSimpleGetValue($this->infCarga, "vCarga"); |
||
| 1742 | $texto = number_format($texto, 2, ",", "."); |
||
| 1743 | $aFont = $this->formatNegrito; |
||
| 1744 | $this->pTextBox($x + 1, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1745 | $y += 8; |
||
| 1746 | $x = $oldX; |
||
| 1747 | $this->pdf->Line($x, $y, $w + 1, $y); |
||
| 1748 | //Identifica código da unidade |
||
| 1749 | //01 = KG (QUILOS) |
||
| 1750 | if ($this->pSimpleGetValue($this->infQ->item(0), "cUnid") == '01') { |
||
| 1751 | $qCarga = $this->pSimpleGetValue($this->infQ->item(0), "qCarga"); |
||
| 1752 | } elseif ($this->pSimpleGetValue($this->infQ->item(1), "cUnid") == '01') { |
||
| 1753 | $qCarga = $this->pSimpleGetValue($this->infQ->item(1), "qCarga"); |
||
| 1754 | } elseif ($this->pSimpleGetValue($this->infQ->item(2), "cUnid") == '01') { |
||
| 1755 | $qCarga = $this->pSimpleGetValue($this->infQ->item(2), "qCarga"); |
||
| 1756 | } |
||
| 1757 | $texto = 'PESO BRUTO (KG)'; |
||
| 1758 | $aFont = array( |
||
| 1759 | 'font' => $this->fontePadrao, |
||
| 1760 | 'size' => 5, |
||
| 1761 | 'style' => ''); |
||
| 1762 | $this->pTextBox($x+8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1763 | $texto = number_format($qCarga, 3, ",", "."); |
||
| 1764 | $aFont = array( |
||
| 1765 | 'font' => $this->fontePadrao, |
||
| 1766 | 'size' => 7, |
||
| 1767 | 'style' => 'B'); |
||
| 1768 | $this->pTextBox($x+2, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1769 | $x = $w * 0.12; |
||
| 1770 | $this->pdf->Line($x+13.5, $y, $x+13.5, $y + 9); |
||
| 1771 | $texto = 'PESO BASE CÁLCULO (KG)'; |
||
| 1772 | $aFont = array( |
||
| 1773 | 'font' => $this->fontePadrao, |
||
| 1774 | 'size' => 5, |
||
| 1775 | 'style' => ''); |
||
| 1776 | $this->pTextBox($x+20, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1777 | $texto = number_format($qCarga, 3, ",", "."); |
||
| 1778 | $aFont = array( |
||
| 1779 | 'font' => $this->fontePadrao, |
||
| 1780 | 'size' => 7, |
||
| 1781 | 'style' => 'B'); |
||
| 1782 | $this->pTextBox($x+17, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1783 | $x = $w * 0.24; |
||
| 1784 | $this->pdf->Line($x+25, $y, $x+25, $y + 9); |
||
| 1785 | $texto = 'PESO AFERIDO (KG)'; |
||
| 1786 | $aFont = array( |
||
| 1787 | 'font' => $this->fontePadrao, |
||
| 1788 | 'size' => 5, |
||
| 1789 | 'style' => ''); |
||
| 1790 | $this->pTextBox($x+35, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1791 | $texto = number_format($qCarga, 3, ",", "."); |
||
| 1792 | $aFont = array( |
||
| 1793 | 'font' => $this->fontePadrao, |
||
| 1794 | 'size' => 7, |
||
| 1795 | 'style' => 'B'); |
||
| 1796 | $this->pTextBox($x+28, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1797 | $x = $w * 0.36; |
||
| 1798 | $this->pdf->Line($x+41.3, $y, $x+41.3, $y + 9); |
||
| 1799 | $texto = 'CUBAGEM(M3)'; |
||
| 1800 | $aFont = $this->formatPadrao; |
||
| 1801 | $this->pTextBox($x+60, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1802 | $qCarga = ''; |
||
| 1803 | foreach ($this->infQ as $infQ) { |
||
| 1804 | if ($this->pSimpleGetValue($infQ, "cUnid") == '00') { |
||
| 1805 | $qCarga = $this->pSimpleGetValue($infQ, "qCarga"); |
||
| 1806 | } |
||
| 1807 | } |
||
| 1808 | $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : ''; |
||
| 1809 | $aFont = array( |
||
| 1810 | 'font' => $this->fontePadrao, |
||
| 1811 | 'size' => 7, |
||
| 1812 | 'style' => 'B'); |
||
| 1813 | $this->pTextBox($x+50, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1814 | $x = $w * 0.45; |
||
| 1815 | //$this->pdf->Line($x+37, $y, $x+37, $y + 9); |
||
| 1816 | $texto = 'QTDE(VOL)'; |
||
| 1817 | $aFont = $this->formatPadrao; |
||
| 1818 | $this->pTextBox($x+85, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1819 | $qCarga = ''; |
||
| 1820 | foreach ($this->infQ as $infQ) { |
||
| 1821 | if ($this->pSimpleGetValue($infQ, "cUnid") == '03') { |
||
| 1822 | $qCarga = $this->pSimpleGetValue($infQ, "qCarga"); |
||
| 1823 | } |
||
| 1824 | } |
||
| 1825 | $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : ''; |
||
| 1826 | $aFont = array( |
||
| 1827 | 'font' => $this->fontePadrao, |
||
| 1828 | 'size' => 7, |
||
| 1829 | 'style' => 'B'); |
||
| 1830 | $this->pTextBox($x+85, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1831 | $x = $w * 0.53; |
||
| 1832 | $this->pdf->Line($x+56, $y, $x+56, $y + 9); |
||
| 1833 | /*$texto = 'NOME DA SEGURADORA'; |
||
| 1834 | $aFont = $this->formatPadrao; |
||
| 1835 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1836 | $texto = $this->pSimpleGetValue($this->seg, "xSeg"); |
||
| 1837 | $aFont = array( |
||
| 1838 | 'font' => $this->fontePadrao, |
||
| 1839 | 'size' => 7, |
||
| 1840 | 'style' => 'B'); |
||
| 1841 | $this->pTextBox($x + 31, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1842 | $y += 3; |
||
| 1843 | $this->pdf->Line($x, $y, $w + 1, $y); |
||
| 1844 | $texto = 'RESPONSÁVEL'; |
||
| 1845 | $aFont = $this->formatPadrao; |
||
| 1846 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1847 | $texto = $this->respSeg; |
||
| 1848 | $aFont = array( |
||
| 1849 | 'font' => $this->fontePadrao, |
||
| 1850 | 'size' => 7, |
||
| 1851 | 'style' => 'B'); |
||
| 1852 | $this->pTextBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1853 | $x = $w * 0.68; |
||
| 1854 | $this->pdf->Line($x, $y, $x, $y + 6); |
||
| 1855 | $texto = 'NÚMERO DA APOLICE'; |
||
| 1856 | $aFont = $this->formatPadrao; |
||
| 1857 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1858 | $texto = $this->pSimpleGetValue($this->seg, "nApol"); |
||
| 1859 | $aFont = array( |
||
| 1860 | 'font' => $this->fontePadrao, |
||
| 1861 | 'size' => 7, |
||
| 1862 | 'style' => 'B'); |
||
| 1863 | $this->pTextBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1864 | $x = $w * 0.85; |
||
| 1865 | $this->pdf->Line($x, $y, $x, $y + 6); |
||
| 1866 | $texto = 'NÚMERO DA AVERBAÇÃO'; |
||
| 1867 | $aFont = $this->formatPadrao; |
||
| 1868 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
||
| 1869 | $texto = $this->pSimpleGetValue($this->seg, "nAver"); |
||
| 1870 | $aFont = array( |
||
| 1871 | 'font' => $this->fontePadrao, |
||
| 1872 | 'size' => 7, |
||
| 1873 | 'style' => 'B'); |
||
| 1874 | $this->pTextBox($x, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, '');*/ |
||
| 1875 | } //fim da função zDescricaoCarga |
||
| 1876 | |||
| 1877 | /** |
||
| 1878 | * zCompValorServ |
||
| 1879 | * Monta o campo com os componentes da prestação de serviços. |
||
| 1880 | * |
||
| 1881 | * @param number $x Posição horizontal canto esquerdo |
||
| 1882 | * @param number $y Posição vertical canto superior |
||
| 1883 | * @return number Posição vertical final |
||
| 1884 | */ |
||
| 1885 | protected function zCompValorServ($x = 0, $y = 0) |
||
| 1975 | |||
| 1976 | /** |
||
| 1977 | * zImpostos |
||
| 1978 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
||
| 1979 | * |
||
| 1980 | * @param number $x Posição horizontal canto esquerdo |
||
| 1981 | * @param number $y Posição vertical canto superior |
||
| 1982 | * @return number Posição vertical final |
||
| 1983 | */ |
||
| 1984 | protected function zImpostos($x = 0, $y = 0) |
||
| 1985 | { |
||
| 1986 | $oldX = $x; |
||
| 1987 | $oldY = $y; |
||
| 1988 | if ($this->orientacao == 'P') { |
||
| 1989 | $maxW = $this->wPrint; |
||
| 1990 | } else { |
||
| 2171 | |||
| 2172 | /** |
||
| 2173 | * zGeraChaveAdicCont |
||
| 2174 | * |
||
| 2175 | * @return string chave |
||
| 2176 | */ |
||
| 2177 | protected function zGeraChaveAdicCont() |
||
| 2212 | |||
| 2213 | /** |
||
| 2214 | * zDocOrig |
||
| 2215 | * Monta o campo com os documentos originarios. |
||
| 2216 | * |
||
| 2217 | * @param number $x Posição horizontal canto esquerdo |
||
| 2218 | * @param number $y Posição vertical canto superior |
||
| 2219 | * @return number Posição vertical final |
||
| 2220 | */ |
||
| 2221 | protected function zDocOrig($x = 0, $y = 0) |
||
| 2485 | |||
| 2486 | /** |
||
| 2487 | * zDocOrigContinuacao |
||
| 2488 | * Monta o campo com os documentos originarios. |
||
| 2489 | * |
||
| 2490 | * @param number $x Posição horizontal canto esquerdo |
||
| 2491 | * @param number $y Posição vertical canto superior |
||
| 2492 | * @return number Posição vertical final |
||
| 2493 | */ |
||
| 2494 | protected function zDocOrigContinuacao($x = 0, $y = 0) |
||
| 2615 | |||
| 2616 | /** |
||
| 2617 | * zDocCompl |
||
| 2618 | * Monta o campo com os dados do remetente na DACTE. |
||
| 2619 | * |
||
| 2620 | * @param number $x Posição horizontal canto esquerdo |
||
| 2621 | * @param number $y Posição vertical canto superior |
||
| 2622 | * @return number Posição vertical final |
||
| 2623 | */ |
||
| 2624 | protected function zDocCompl($x = 0, $y = 0) |
||
| 2686 | |||
| 2687 | /** |
||
| 2688 | * zObs |
||
| 2689 | * Monta o campo com os dados do remetente na DACTE. |
||
| 2690 | * |
||
| 2691 | * @param number $x Posição horizontal canto esquerdo |
||
| 2692 | * @param number $y Posição vertical canto superior |
||
| 2693 | * @return number Posição vertical final |
||
| 2694 | */ |
||
| 2695 | protected function zObs($x = 0, $y = 0) |
||
| 2729 | |||
| 2730 | /** |
||
| 2731 | * zModalRod |
||
| 2732 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
||
| 2733 | * |
||
| 2734 | * @param number $x Posição horizontal canto esquerdo |
||
| 2735 | * @param number $y Posição vertical canto superior |
||
| 2736 | * @return number Posição vertical final |
||
| 2737 | */ |
||
| 2738 | protected function zModalRod($x = 0, $y = 0) |
||
| 2772 | |||
| 2773 | /** |
||
| 2774 | * zModalAereo |
||
| 2775 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
||
| 2776 | * |
||
| 2777 | * @param number $x Posição horizontal canto esquerdo |
||
| 2778 | * @param number $y Posição vertical canto superior |
||
| 2779 | * @return number Posição vertical final |
||
| 2780 | */ |
||
| 2781 | protected function zModalAereo($x = 0, $y = 0) |
||
| 2835 | |||
| 2836 | /** |
||
| 2837 | * zModalAquaviario |
||
| 2838 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
||
| 2839 | * |
||
| 2840 | * @param number $x Posição horizontal canto esquerdo |
||
| 2841 | * @param number $y Posição vertical canto superior |
||
| 2842 | * @return number Posição vertical final |
||
| 2843 | */ |
||
| 2844 | protected function zModalAquaviario($x = 0, $y = 0) |
||
| 3005 | |||
| 3006 | /** |
||
| 3007 | * zModalFerr |
||
| 3008 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
||
| 3009 | * |
||
| 3010 | * @param number $x Posição horizontal canto esquerdo |
||
| 3011 | * @param number $y Posição vertical canto superior |
||
| 3012 | * @return number Posição vertical final |
||
| 3013 | */ |
||
| 3014 | protected function zModalFerr($x = 0, $y = 0) |
||
| 3283 | |||
| 3284 | /** |
||
| 3285 | * zCanhoto |
||
| 3286 | * Monta o campo com os dados do remetente na DACTE. |
||
| 3287 | * |
||
| 3288 | * @param number $x Posição horizontal canto esquerdo |
||
| 3289 | * @param number $y Posição vertical canto superior |
||
| 3290 | * @return number Posição vertical final |
||
| 3291 | */ |
||
| 3292 | protected function zCanhoto($x = 0, $y = 0) |
||
| 3368 | |||
| 3369 | /** |
||
| 3370 | * zDadosAdic |
||
| 3371 | * Coloca o grupo de dados adicionais da DACTE. |
||
| 3372 | * |
||
| 3373 | * @param number $x Posição horizontal canto esquerdo |
||
| 3374 | * @param number $y Posição vertical canto superior |
||
| 3375 | * @param number $h altura do campo |
||
| 3376 | * @return number Posição vertical final |
||
| 3377 | */ |
||
| 3378 | protected function zDadosAdic($x, $y, $pag, $h) |
||
| 3451 | |||
| 3452 | /** |
||
| 3453 | * zhDashedLine |
||
| 3454 | * Desenha uma linha horizontal tracejada com o FPDF |
||
| 3455 | * |
||
| 3456 | * @param number $x Posição horizontal inicial, em mm |
||
| 3457 | * @param number $y Posição vertical inicial, em mm |
||
| 3458 | * @param number $w Comprimento da linha, em mm |
||
| 3459 | * @param number $h Espessura da linha, em mm |
||
| 3460 | * @param number $n Numero de traços na seção da linha com o comprimento $w |
||
| 3461 | * @return none |
||
| 3462 | */ |
||
| 3463 | protected function zhDashedLine($x, $y, $w, $h, $n) |
||
| 3475 | |||
| 3476 | /** |
||
| 3477 | * zhDashedVerticalLine |
||
| 3478 | * Desenha uma linha vertical tracejada com o FPDF |
||
| 3479 | * |
||
| 3480 | * @param number $x Posição horizontal inicial, em mm |
||
| 3481 | * @param number $y Posição vertical inicial, em mm |
||
| 3482 | * @param number $w Comprimento da linha, em mm |
||
| 3483 | * @param number $yfinal Espessura da linha, em mm |
||
| 3484 | * @param number $n Numero de traços na seção da linha com o comprimento $w |
||
| 3485 | * @return none |
||
| 3486 | */ |
||
| 3487 | protected function zhDashedVerticalLine($x, $y, $w, $yfinal, $n) |
||
| 3502 | |||
| 3503 | /** |
||
| 3504 | * zFormatCNPJCPF |
||
| 3505 | * Formata campo CnpjCpf contida na CTe |
||
| 3506 | * |
||
| 3507 | * @param string $field campo cnpjCpf da CT-e |
||
| 3508 | * @return string |
||
| 3509 | */ |
||
| 3510 | protected function zFormatCNPJCPF($field) |
||
| 3525 | |||
| 3526 | /** |
||
| 3527 | * zFormatFone |
||
| 3528 | * Formata campo fone contida na CTe |
||
| 3529 | * |
||
| 3530 | * @param string $field campo fone da CT-e |
||
| 3531 | * @return string |
||
| 3532 | */ |
||
| 3533 | protected function zFormatFone($field) |
||
| 3551 | |||
| 3552 | /** |
||
| 3553 | * zUnidade |
||
| 3554 | * Converte a imformação de peso contida na CTe |
||
| 3555 | * |
||
| 3556 | * @param string $c unidade de trafego extraida da CTe |
||
| 3557 | * @return string |
||
| 3558 | */ |
||
| 3559 | protected function zUnidade($c = '') |
||
| 3585 | |||
| 3586 | /** |
||
| 3587 | * zConvertUnidTrafego |
||
| 3588 | * Converte a imformação de peso contida na CTe |
||
| 3589 | * |
||
| 3590 | * @param string $U Informação de trafego extraida da CTe |
||
| 3591 | * @return string |
||
| 3592 | */ |
||
| 3593 | protected function zConvertUnidTrafego($U = '') |
||
| 3613 | |||
| 3614 | /** |
||
| 3615 | * zMultiUniPeso |
||
| 3616 | * Fornece a imformação multiplicação de peso contida na CTe |
||
| 3617 | * |
||
| 3618 | * @param interger $U Informação de peso extraida da CTe |
||
| 3619 | * @return interger |
||
| 3620 | */ |
||
| 3621 | protected function zMultiUniPeso($U = '') |
||
| 3630 | } |
||
| 3631 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountIdthat can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theidproperty of an instance of theAccountclass. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.