Passed
Push — master ( f8305a...b6c7f7 )
by Roberto
03:01 queued 11s
created
src/NFe/Daevento.php 3 patches
Doc Comments   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -122,6 +122,9 @@  discard block
 block discarded – undo
122 122
         return $this->pdf->getPdf();
123 123
     }
124 124
 
125
+    /**
126
+     * @param string $xml
127
+     */
125 128
     protected function loadDoc($xml)
126 129
     {
127 130
         $this->dom = new Dom();
@@ -241,9 +244,9 @@  discard block
 block discarded – undo
241 244
 
242 245
     /**
243 246
      * header
244
-     * @param  number $x
245
-     * @param  number $y
246
-     * @param  number $pag
247
+     * @param  integer $x
248
+     * @param  integer $y
249
+     * @param  integer $pag
247 250
      * @return number
248 251
      */
249 252
     private function header($x, $y, $pag)
@@ -474,8 +477,8 @@  discard block
 block discarded – undo
474 477
     /**
475 478
      * body
476 479
      *
477
-     * @param number $x
478
-     * @param number $y
480
+     * @param integer $x
481
+     * @param double $y
479 482
      */
480 483
     private function body($x, $y)
481 484
     {
@@ -501,7 +504,7 @@  discard block
 block discarded – undo
501 504
     /**
502 505
      * footer
503 506
      *
504
-     * @param number $x
507
+     * @param integer $x
505 508
      * @param number $y
506 509
      */
507 510
     private function footer($x, $y)
Please login to merge, or discard this patch.
Spacing   +17 added lines, -19 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         $this->retEvento = $this->dom->getElementsByTagName("retEvento")->item(0);
133 133
         $this->rinfEvento = $this->retEvento->getElementsByTagName("infEvento")->item(0);
134 134
         $this->tpEvento = $this->infEvento->getElementsByTagName("tpEvento")->item(0)->nodeValue;
135
-        if (!in_array($this->tpEvento, ['110110','110111'])) {
135
+        if (!in_array($this->tpEvento, ['110110', '110111'])) {
136 136
             $this->errMsg = 'Evento não implementado ' . $tpEvento . ' !!';
137 137
             $this->errStatus = true;
138 138
             return false;
@@ -152,11 +152,9 @@  discard block
 block discarded – undo
152 152
         $this->cStat = $this->rinfEvento->getElementsByTagName("cStat")->item(0)->nodeValue;
153 153
         $this->xMotivo = $this->rinfEvento->getElementsByTagName("xMotivo")->item(0)->nodeValue;
154 154
         $this->CNPJDest = !empty($this->rinfEvento->getElementsByTagName("CNPJDest")->item(0)->nodeValue) ?
155
-            $this->rinfEvento->getElementsByTagName("CNPJDest")->item(0)->nodeValue :
156
-            '';
155
+            $this->rinfEvento->getElementsByTagName("CNPJDest")->item(0)->nodeValue : '';
157 156
         $this->CPFDest = !empty($this->rinfEvento->getElementsByTagName("CPFDest")->item(0)->nodeValue) ?
158
-            $this->rinfEvento->getElementsByTagName("CPFDest")->item(0)->nodeValue :
159
-            '';
157
+            $this->rinfEvento->getElementsByTagName("CPFDest")->item(0)->nodeValue : '';
160 158
         $this->dhRegEvento = $this->rinfEvento->getElementsByTagName("dhRegEvento")->item(0)->nodeValue;
161 159
         $this->nProt = $this->rinfEvento->getElementsByTagName("nProt")->item(0)->nodeValue;
162 160
     }
@@ -255,9 +253,9 @@  discard block
 block discarded – undo
255 253
         // coluna esquerda identificação do emitente
256 254
         $w = round($maxW * 0.41, 0); // 80;
257 255
         if ($this->orientacao == 'P') {
258
-            $aFont = ['font' => $this->fontePadrao,'size' => 6,'style' => 'I'];
256
+            $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => 'I'];
259 257
         } else {
260
-            $aFont = ['font' => $this->fontePadrao,'size' => 8,'style' => 'B'];
258
+            $aFont = ['font' => $this->fontePadrao, 'size' => 8, 'style' => 'B'];
261 259
         }
262 260
         $w1 = $w;
263 261
         $h = 32;
@@ -410,7 +408,7 @@  discard block
 block discarded – undo
410 408
                 . 'abaixo referenciada, está cancelada, solicitamos que sejam '
411 409
                 . 'aplicadas essas correções ao executar seus lançamentos fiscais.';
412 410
         }
413
-        $aFont = ['font' => $this->fontePadrao,'size' => 10,'style' => ''];
411
+        $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => ''];
414 412
         $this->pdf->textBox($x + 5, $y1, $maxW - 5, 20, $texto, $aFont, 'T', 'L', 0, '', false);
415 413
         // ############################################
416 414
         $x = $oldX;
@@ -421,7 +419,7 @@  discard block
 block discarded – undo
421 419
         if ($this->CPFDest != '') {
422 420
             $texto = 'CPF do Destinatário: ' . $this->formatField($this->CPFDest, "###.###.###-##");
423 421
         }
424
-        $aFont = ['font' => $this->fontePadrao,'size' => 12,'style' => 'B'];
422
+        $aFont = ['font' => $this->fontePadrao, 'size' => 12, 'style' => 'B'];
425 423
         $this->pdf->textBox($x + 2, $y + 13, $w2, 8, $texto, $aFont, 'T', 'L', 0, '');
426 424
         $numNF = substr($this->chNFe, 25, 9);
427 425
         $serie = substr($this->chNFe, 22, 3);
@@ -437,7 +435,7 @@  discard block
 block discarded – undo
437 435
         $this->pdf->code128($x + (($w - $bW) / 2), $y + 2, $this->chNFe, $bW, $bH);
438 436
         $this->pdf->setFillColor(255, 255, 255);
439 437
         $y1 = $y + 2 + $bH;
440
-        $aFont = ['font' => $this->fontePadrao,'size' => 10,'style' => ''];
438
+        $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => ''];
441 439
         $texto = $this->formatField($this->chNFe, $this->formatoChave);
442 440
         $this->pdf->textBox($x, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, '');
443 441
         $retVal = $sY + 2;
@@ -445,7 +443,7 @@  discard block
 block discarded – undo
445 443
             $x = $oldX;
446 444
             $this->pdf->textBox($x, $sY, $maxW, 15);
447 445
             $texto = $this->xCondUso;
448
-            $aFont = ['font' => $this->fontePadrao,'size' => 8,'style' => 'I'];
446
+            $aFont = ['font' => $this->fontePadrao, 'size' => 8, 'style' => 'I'];
449 447
             $this->pdf->textBox($x + 2, $sY + 2, $maxW - 2, 15, $texto, $aFont, 'T', 'L', 0, '', false);
450 448
             $retVal = $sY + 2;
451 449
         }
@@ -461,9 +459,9 @@  discard block
 block discarded – undo
461 459
             $w = $maxW - (2 * $x);
462 460
             $this->pdf->setTextColor(90, 90, 90);
463 461
             $texto = "SEM VALOR FISCAL";
464
-            $aFont = ['font' => $this->fontePadrao,'size' => 48,'style' => 'B'];
462
+            $aFont = ['font' => $this->fontePadrao, 'size' => 48, 'style' => 'B'];
465 463
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
466
-            $aFont = ['font' => $this->fontePadrao,'size' => 30,'style' => 'B'];
464
+            $aFont = ['font' => $this->fontePadrao, 'size' => 30, 'style' => 'B'];
467 465
             $texto = "AMBIENTE DE HOMOLOGAÇÃO";
468 466
             $this->pdf->textBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
469 467
             $this->pdf->setTextColor(0, 0, 0);
@@ -485,7 +483,7 @@  discard block
 block discarded – undo
485 483
         } else {
486 484
             $texto = 'JUSTIFICATIVA DO CANCELAMENTO';
487 485
         }
488
-        $aFont = ['font' => $this->fontePadrao,'size' => 10,'style' => 'B'];
486
+        $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B'];
489 487
         $this->pdf->textBox($x, $y, $maxW, 5, $texto, $aFont, 'T', 'L', 0, '', false);
490 488
         $y += 5;
491 489
         $this->pdf->textBox($x, $y, $maxW, 190);
@@ -494,7 +492,7 @@  discard block
 block discarded – undo
494 492
         } elseif ($this->tpEvento == '110111') {
495 493
             $texto = $this->xJust;
496 494
         }
497
-        $aFont = ['font' => $this->fontePadrao,'size' => 12,'style' => 'B'];
495
+        $aFont = ['font' => $this->fontePadrao, 'size' => 12, 'style' => 'B'];
498 496
         $this->pdf->textBox($x + 2, $y + 2, $maxW - 2, 150, $texto, $aFont, 'T', 'L', 0, '', false);
499 497
     }
500 498
 
@@ -519,15 +517,15 @@  discard block
 block discarded – undo
519 517
                 . "eletrônico XML e pode ser consultada através dos Portais "
520 518
                 . "das SEFAZ.";
521 519
         }
522
-        $aFont = ['font' => $this->fontePadrao,'size' => 10,'style' => 'I'];
520
+        $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'I'];
523 521
         $this->pdf->textBox($x, $y, $w, 20, $texto, $aFont, 'T', 'C', 0, '', false);
524 522
         $y = $this->hPrint - 4;
525 523
         $texto = "Impresso em  " . date('d/m/Y   H:i:s');
526 524
         $w = $this->wPrint - 4;
527
-        $aFont = ['font' => $this->fontePadrao,'size' => 6,'style' => 'I'];
525
+        $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => 'I'];
528 526
         $this->pdf->textBox($x, $y, $w, 4, $texto, $aFont, 'T', 'L', 0, '');
529
-        $texto = $this->creditos .  "  Powered by NFePHP®";
530
-        $aFont = ['font' => $this->fontePadrao,'size' => 6,'style' => 'I'];
527
+        $texto = $this->creditos . "  Powered by NFePHP®";
528
+        $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => 'I'];
531 529
         $this->pdf->textBox($x, $y, $w, 4, $texto, $aFont, 'T', 'R', 0, 'http://www.nfephp.org');
532 530
     }
533 531
 }
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
15 15
  * @author    Roberto L. Machado <linux.rlm at gmail dot com>
16 16
  */
17 17
 
18
-use Exception;
19 18
 use NFePHP\DA\Legacy\Dom;
20 19
 use NFePHP\DA\Legacy\Pdf;
21 20
 use NFePHP\DA\Common\DaCommon;
Please login to merge, or discard this patch.
src/BPe/Dabpe.php 2 patches
Doc Comments   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -249,6 +249,9 @@  discard block
 block discarded – undo
249 249
         $this->creditos = trim($message);
250 250
     }
251 251
 
252
+    /**
253
+     * @param string $logo
254
+     */
252 255
     public function monta(
253 256
         $logo = null
254 257
     ) {
@@ -393,8 +396,7 @@  discard block
 block discarded – undo
393 396
      * Função para transformar o campo cdata do padrão ANFAVEA para
394 397
      * texto imprimível
395 398
      *
396
-     * @param string $cdata campo CDATA
397
-     * @return string conteúdo do campo CDATA como string
399
+     * @return double conteúdo do campo CDATA como string
398 400
      */
399 401
 
400 402
     protected function cabecalhoAgencia($x = 0, $y = 0, $h = 0, $pag = '1', $totPag = '1')
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -319,12 +319,12 @@  discard block
 block discarded – undo
319 319
         $this->pdf->setLineWidth(0.1); // define a largura da linha
320 320
         $this->pdf->setTextColor(0, 0, 0);
321 321
         $this->pdf->textBox(0, 0, $maxW, $maxH); // POR QUE PRECISO DESA LINHA?
322
-        $hcabecalho = 16;//para cabeçalho (dados emitente mais logomarca)  (FIXO)
322
+        $hcabecalho = 16; //para cabeçalho (dados emitente mais logomarca)  (FIXO)
323 323
         if (strlen($this->getTagValue($this->emit, "xNome")) > 40) {
324 324
             $hcabecalho += 2;
325 325
             $tamPapelVert += 2;
326 326
         };
327
-        $hcabecalhoSecundario = 18;//para cabeçalho secundário (cabeçalho sefaz) (FIXO)
327
+        $hcabecalhoSecundario = 18; //para cabeçalho secundário (cabeçalho sefaz) (FIXO)
328 328
         $hagencia = 0;
329 329
         if (!empty($this->agencia)) {
330 330
             if (strlen($this->getTagValue($this->agencia, "xNome")) > 39) {
@@ -334,9 +334,9 @@  discard block
 block discarded – undo
334 334
             $hagencia += 20;
335 335
             $tamPapelVert += 18;
336 336
         }
337
-        $hprodutos = $hLinha + ($qtdItens * $hLinha);//box poduto
337
+        $hprodutos = $hLinha + ($qtdItens * $hLinha); //box poduto
338 338
         $hTotal = 12; //box total (FIXO)
339
-        $hpagamentos = (2 * $hLinha) + ($qtdPgto * $hLinha);//para pagamentos
339
+        $hpagamentos = (2 * $hLinha) + ($qtdPgto * $hLinha); //para pagamentos
340 340
         if (!empty($this->vTroco)) {
341 341
             $hpagamentos += $hLinha;
342 342
         }
@@ -483,13 +483,13 @@  discard block
 block discarded – undo
483 483
         if (!empty($this->logomarca)) {
484 484
             $xImg = $margemInterna;
485 485
             $logoInfo = getimagesize($this->logomarca);
486
-            $logoWmm = ($logoInfo[0]/72)*25.4;
487
-            $logoHmm = ($logoInfo[1]/72)*25.4;
486
+            $logoWmm = ($logoInfo[0] / 72) * 25.4;
487
+            $logoHmm = ($logoInfo[1] / 72) * 25.4;
488 488
             $nImgW = 30;
489
-            $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0);
489
+            $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
490 490
             if ($nImgH > 18) {
491 491
                 $nImgH = 18;
492
-                $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0);
492
+                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
493 493
             }
494 494
             $yImg = 15;
495 495
             $this->pdf->image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, 'jpeg');
Please login to merge, or discard this patch.
src/Common/DaCommon.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -212,6 +212,9 @@
 block discarded – undo
212 212
         return $logo;
213 213
     }
214 214
     
215
+    /**
216
+     * @param resource $image
217
+     */
215 218
     private function getImageStringFromObject($image)
216 219
     {
217 220
         ob_start();
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             //ativar modo debug
42 42
             error_reporting(E_ALL);
43 43
             ini_set('display_errors', 'On');
44
-            set_error_handler(function (int $number, string $message, string $errfile, int $errline) {
44
+            set_error_handler(function(int $number, string $message, string $errfile, int $errline) {
45 45
                 throw new \Exception("Handler captured error $number: '$message' $errfile [linha:" . $errline . "]");
46 46
             });
47 47
         } else {
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
     {
184 184
         if (substr($logo, 0, 24) !== 'data://text/plain;base64') {
185 185
             if (is_file($logo)) {
186
-                $logo = 'data://text/plain;base64,'. base64_encode(file_get_contents($logo));
186
+                $logo = 'data://text/plain;base64,' . base64_encode(file_get_contents($logo));
187 187
             } else {
188 188
                 $logo = '';
189 189
             }
@@ -219,6 +219,6 @@  discard block
 block discarded – undo
219 219
         imagedestroy($image);
220 220
         $logo = ob_get_contents(); // read from buffer
221 221
         ob_end_clean();
222
-        return 'data://text/plain;base64,'.base64_encode($logo);
222
+        return 'data://text/plain;base64,' . base64_encode($logo);
223 223
     }
224 224
 }
Please login to merge, or discard this patch.
src/CTe/Dacte.php 1 patch
Doc Comments   +45 added lines, -42 removed lines patch added patch discarded remove patch
@@ -104,6 +104,9 @@  discard block
 block discarded – undo
104 104
     }
105 105
 
106 106
 
107
+    /**
108
+     * @param string $xml
109
+     */
107 110
     private function loadDoc($xml)
108 111
     {
109 112
         $this->xml = $xml;
@@ -432,8 +435,8 @@  discard block
 block discarded – undo
432 435
      * cabecalho
433 436
      * Monta o cabelhalho da DACTE ( retrato e paisagem )
434 437
      *
435
-     * @param  number $x Posição horizontal inicial, canto esquerdo
436
-     * @param  number $y Posição vertical inicial, canto superior
438
+     * @param  integer $x Posição horizontal inicial, canto esquerdo
439
+     * @param  integer $y Posição vertical inicial, canto superior
437 440
      * @param  number $pag Número da Página
438 441
      * @param  number $totPag Total de páginas
439 442
      * @return number Posição vertical final
@@ -1087,8 +1090,7 @@  discard block
 block discarded – undo
1087 1090
      * rodapeDACTE
1088 1091
      * Monta o rodape no final da DACTE ( retrato e paisagem )
1089 1092
      *
1090
-     * @param number $xInic Posição horizontal canto esquerdo
1091
-     * @param number $yFinal Posição vertical final para impressão
1093
+     * @param integer $x
1092 1094
      */
1093 1095
     protected function rodape($x, $y)
1094 1096
     {
@@ -1111,8 +1113,8 @@  discard block
 block discarded – undo
1111 1113
      * remetente
1112 1114
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1113 1115
      *
1114
-     * @param  number $x Posição horizontal canto esquerdo
1115
-     * @param  number $y Posição vertical canto superior
1116
+     * @param  integer $x Posição horizontal canto esquerdo
1117
+     * @param  integer $y Posição vertical canto superior
1116 1118
      * @return number Posição vertical final
1117 1119
      */
1118 1120
     protected function remetente($x = 0, $y = 0)
@@ -1199,8 +1201,8 @@  discard block
 block discarded – undo
1199 1201
      * destinatario
1200 1202
      * Monta o campo com os dados do destinatário na DACTE.
1201 1203
      *
1202
-     * @param  number $x Posição horizontal canto esquerdo
1203
-     * @param  number $y Posição vertical canto superior
1204
+     * @param  integer $x Posição horizontal canto esquerdo
1205
+     * @param  integer $y Posição vertical canto superior
1204 1206
      * @return number Posição vertical final
1205 1207
      */
1206 1208
     protected function destinatario($x = 0, $y = 0)
@@ -1286,8 +1288,8 @@  discard block
 block discarded – undo
1286 1288
      * expedidor
1287 1289
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1288 1290
      *
1289
-     * @param  number $x Posição horizontal canto esquerdo
1290
-     * @param  number $y Posição vertical canto superior
1291
+     * @param  integer $x Posição horizontal canto esquerdo
1292
+     * @param  integer $y Posição vertical canto superior
1291 1293
      * @return number Posição vertical final
1292 1294
      */
1293 1295
     protected function expedidor($x = 0, $y = 0)
@@ -1383,8 +1385,8 @@  discard block
 block discarded – undo
1383 1385
      * recebedor
1384 1386
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1385 1387
      *
1386
-     * @param  number $x Posição horizontal canto esquerdo
1387
-     * @param  number $y Posição vertical canto superior
1388
+     * @param  integer $x Posição horizontal canto esquerdo
1389
+     * @param  integer $y Posição vertical canto superior
1388 1390
      * @return number Posição vertical final
1389 1391
      */
1390 1392
     protected function recebedor($x = 0, $y = 0)
@@ -1480,8 +1482,8 @@  discard block
 block discarded – undo
1480 1482
      * tomador
1481 1483
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1482 1484
      *
1483
-     * @param  number $x Posição horizontal canto esquerdo
1484
-     * @param  number $y Posição vertical canto superior
1485
+     * @param  integer $x Posição horizontal canto esquerdo
1486
+     * @param  integer $y Posição vertical canto superior
1485 1487
      * @return number Posição vertical final
1486 1488
      */
1487 1489
     protected function tomador($x = 0, $y = 0)
@@ -1569,8 +1571,8 @@  discard block
 block discarded – undo
1569 1571
      * descricaoCarga
1570 1572
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1571 1573
      *
1572
-     * @param  number $x Posição horizontal canto esquerdo
1573
-     * @param  number $y Posição vertical canto superior
1574
+     * @param  integer $x Posição horizontal canto esquerdo
1575
+     * @param  integer $y Posição vertical canto superior
1574 1576
      * @return number Posição vertical final
1575 1577
      */
1576 1578
     protected function descricaoCarga($x = 0, $y = 0)
@@ -1746,8 +1748,8 @@  discard block
 block discarded – undo
1746 1748
      * compValorServ
1747 1749
      * Monta o campo com os componentes da prestação de serviços.
1748 1750
      *
1749
-     * @param  number $x Posição horizontal canto esquerdo
1750
-     * @param  number $y Posição vertical canto superior
1751
+     * @param  integer $x Posição horizontal canto esquerdo
1752
+     * @param  integer $y Posição vertical canto superior
1751 1753
      * @return number Posição vertical final
1752 1754
      */
1753 1755
     protected function compValorServ($x = 0, $y = 0)
@@ -1845,8 +1847,8 @@  discard block
 block discarded – undo
1845 1847
      * impostos
1846 1848
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1847 1849
      *
1848
-     * @param  number $x Posição horizontal canto esquerdo
1849
-     * @param  number $y Posição vertical canto superior
1850
+     * @param  integer $x Posição horizontal canto esquerdo
1851
+     * @param  integer $y Posição vertical canto superior
1850 1852
      * @return number Posição vertical final
1851 1853
      */
1852 1854
     protected function impostos($x = 0, $y = 0)
@@ -2063,8 +2065,8 @@  discard block
 block discarded – undo
2063 2065
      * docOrig
2064 2066
      * Monta o campo com os documentos originarios.
2065 2067
      *
2066
-     * @param  number $x Posição horizontal canto esquerdo
2067
-     * @param  number $y Posição vertical canto superior
2068
+     * @param  integer $x Posição horizontal canto esquerdo
2069
+     * @param  integer $y Posição vertical canto superior
2068 2070
      * @return number Posição vertical final
2069 2071
      */
2070 2072
     protected function docOrig($x = 0, $y = 0)
@@ -2359,8 +2361,8 @@  discard block
 block discarded – undo
2359 2361
      * docOrigContinuacao
2360 2362
      * Monta o campo com os documentos originarios.
2361 2363
      *
2362
-     * @param  number $x Posição horizontal canto esquerdo
2363
-     * @param  number $y Posição vertical canto superior
2364
+     * @param  integer $x Posição horizontal canto esquerdo
2365
+     * @param  integer $y Posição vertical canto superior
2364 2366
      * @return number Posição vertical final
2365 2367
      */
2366 2368
     protected function docOrigContinuacao($x = 0, $y = 0)
@@ -2480,8 +2482,8 @@  discard block
 block discarded – undo
2480 2482
      * docCompl
2481 2483
      * Monta o campo com os dados do remetente na DACTE.
2482 2484
      *
2483
-     * @param number $x Posição horizontal canto esquerdo
2484
-     * @param number $y Posição vertical canto superior
2485
+     * @param integer $x Posição horizontal canto esquerdo
2486
+     * @param integer $y Posição vertical canto superior
2485 2487
      * @return number Posição vertical final
2486 2488
      */
2487 2489
     protected function docCompl($x = 0, $y = 0)
@@ -2549,8 +2551,8 @@  discard block
 block discarded – undo
2549 2551
      * observacao
2550 2552
      * Monta o campo com os dados do remetente na DACTE.
2551 2553
      *
2552
-     * @param  number $x Posição horizontal canto esquerdo
2553
-     * @param  number $y Posição vertical canto superior
2554
+     * @param  integer $x Posição horizontal canto esquerdo
2555
+     * @param  integer $y Posição vertical canto superior
2554 2556
      * @return number Posição vertical final
2555 2557
      */
2556 2558
     protected function observacao($x = 0, $y = 0)
@@ -2592,8 +2594,8 @@  discard block
 block discarded – undo
2592 2594
      * modalRod
2593 2595
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2594 2596
      *
2595
-     * @param  number $x Posição horizontal canto esquerdo
2596
-     * @param  number $y Posição vertical canto superior
2597
+     * @param  integer $x Posição horizontal canto esquerdo
2598
+     * @param  integer $y Posição vertical canto superior
2597 2599
      * @return number Posição vertical final
2598 2600
      */
2599 2601
     protected function modalRod($x = 0, $y = 0)
@@ -2633,8 +2635,8 @@  discard block
 block discarded – undo
2633 2635
      * modalAereo
2634 2636
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2635 2637
      *
2636
-     * @param  number $x Posição horizontal canto esquerdo
2637
-     * @param  number $y Posição vertical canto superior
2638
+     * @param  integer $x Posição horizontal canto esquerdo
2639
+     * @param  integer $y Posição vertical canto superior
2638 2640
      * @return number Posição vertical final
2639 2641
      */
2640 2642
     protected function modalAereo($x = 0, $y = 0)
@@ -2690,8 +2692,8 @@  discard block
 block discarded – undo
2690 2692
      * modalAquaviario
2691 2693
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2692 2694
      *
2693
-     * @param  number $x Posição horizontal canto esquerdo
2694
-     * @param  number $y Posição vertical canto superior
2695
+     * @param  integer $x Posição horizontal canto esquerdo
2696
+     * @param  integer $y Posição vertical canto superior
2695 2697
      * @return number Posição vertical final
2696 2698
      */
2697 2699
     protected function modalAquaviario($x = 0, $y = 0)
@@ -2859,8 +2861,8 @@  discard block
 block discarded – undo
2859 2861
      * modalFerr
2860 2862
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
2861 2863
      *
2862
-     * @param  number $x Posição horizontal canto esquerdo
2863
-     * @param  number $y Posição vertical canto superior
2864
+     * @param  integer $x Posição horizontal canto esquerdo
2865
+     * @param  integer $y Posição vertical canto superior
2864 2866
      * @return number Posição vertical final
2865 2867
      */
2866 2868
     protected function modalFerr($x = 0, $y = 0)
@@ -3137,8 +3139,8 @@  discard block
 block discarded – undo
3137 3139
      * canhoto
3138 3140
      * Monta o campo com os dados do remetente na DACTE.
3139 3141
      *
3140
-     * @param  number $x Posição horizontal canto esquerdo
3141
-     * @param  number $y Posição vertical canto superior
3142
+     * @param  integer $x Posição horizontal canto esquerdo
3143
+     * @param  integer $y Posição vertical canto superior
3142 3144
      * @return number Posição vertical final
3143 3145
      */
3144 3146
     protected function canhoto($x = 0, $y = 0)
@@ -3211,9 +3213,10 @@  discard block
 block discarded – undo
3211 3213
      * dadosAdic
3212 3214
      * Coloca o grupo de dados adicionais da DACTE.
3213 3215
      *
3214
-     * @param  number $x Posição horizontal canto esquerdo
3215
-     * @param  number $y Posição vertical canto superior
3216
-     * @param  number $h altura do campo
3216
+     * @param  integer $x Posição horizontal canto esquerdo
3217
+     * @param  double $y Posição vertical canto superior
3218
+     * @param  integer $h altura do campo
3219
+     * @param integer $pag
3217 3220
      * @return number Posição vertical final
3218 3221
      */
3219 3222
     protected function dadosAdic($x, $y, $pag, $h)
@@ -3406,7 +3409,7 @@  discard block
 block discarded – undo
3406 3409
      * Fornece a imformação multiplicação de peso contida na CTe
3407 3410
      *
3408 3411
      * @param  interger $U Informação de peso extraida da CTe
3409
-     * @return interger
3412
+     * @return integer
3410 3413
      */
3411 3414
     protected function multiUniPeso($U = '')
3412 3415
     {
Please login to merge, or discard this patch.
src/CTe/DacteOS.php 1 patch
Doc Comments   +33 added lines, -30 removed lines patch added patch discarded remove patch
@@ -93,6 +93,9 @@  discard block
 block discarded – undo
93 93
         $this->loadDoc($xml);
94 94
     }
95 95
 
96
+    /**
97
+     * @param string $xml
98
+     */
96 99
     private function loadDoc($xml)
97 100
     {
98 101
         $this->xml = $xml;
@@ -370,8 +373,8 @@  discard block
 block discarded – undo
370 373
      * cabecalho
371 374
      * Monta o cabelhalho da DACTE ( retrato e paisagem )
372 375
      *
373
-     * @param  number $x Posição horizontal inicial, canto esquerdo
374
-     * @param  number $y Posição vertical inicial, canto superior
376
+     * @param  integer $x Posição horizontal inicial, canto esquerdo
377
+     * @param  integer $y Posição vertical inicial, canto superior
375 378
      * @param  number $pag Número da Página
376 379
      * @param  number $totPag Total de páginas
377 380
      * @return number Posição vertical final
@@ -979,8 +982,7 @@  discard block
 block discarded – undo
979 982
      * rodapeDACTE
980 983
      * Monta o rodape no final da DACTE ( retrato e paisagem )
981 984
      *
982
-     * @param number $xInic Posição horizontal canto esquerdo
983
-     * @param number $yFinal Posição vertical final para impressão
985
+     * @param integer $x
984 986
      */
985 987
     protected function rodape($x, $y)
986 988
     {
@@ -1000,8 +1002,8 @@  discard block
 block discarded – undo
1000 1002
      * tomador
1001 1003
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1002 1004
      *
1003
-     * @param  number $x Posição horizontal canto esquerdo
1004
-     * @param  number $y Posição vertical canto superior
1005
+     * @param  integer $x Posição horizontal canto esquerdo
1006
+     * @param  integer $y Posição vertical canto superior
1005 1007
      * @return number Posição vertical final
1006 1008
      */
1007 1009
     protected function tomador($x = 0, $y = 0)
@@ -1089,8 +1091,8 @@  discard block
 block discarded – undo
1089 1091
      * compValorServ
1090 1092
      * Monta o campo com os componentes da prestação de serviços.
1091 1093
      *
1092
-     * @param  number $x Posição horizontal canto esquerdo
1093
-     * @param  number $y Posição vertical canto superior
1094
+     * @param  integer $x Posição horizontal canto esquerdo
1095
+     * @param  integer $y Posição vertical canto superior
1094 1096
      * @return number Posição vertical final
1095 1097
      */
1096 1098
     protected function compValorServ($x = 0, $y = 0)
@@ -1189,8 +1191,8 @@  discard block
 block discarded – undo
1189 1191
      * impostos
1190 1192
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1191 1193
      *
1192
-     * @param  number $x Posição horizontal canto esquerdo
1193
-     * @param  number $y Posição vertical canto superior
1194
+     * @param  integer $x Posição horizontal canto esquerdo
1195
+     * @param  integer $y Posição vertical canto superior
1194 1196
      * @return number Posição vertical final
1195 1197
      */
1196 1198
     protected function impostos($x = 0, $y = 0)
@@ -1351,8 +1353,8 @@  discard block
 block discarded – undo
1351 1353
      * infPrestacaoServico
1352 1354
      * Monta o campo com das informações da prestação do serviço
1353 1355
      *
1354
-     * @param  number $x Posição horizontal canto esquerdo
1355
-     * @param  number $y Posição vertical canto superior
1356
+     * @param  integer $x Posição horizontal canto esquerdo
1357
+     * @param  integer $y Posição vertical canto superior
1356 1358
      * @return number Posição vertical final
1357 1359
      */
1358 1360
     protected function infPrestacaoServico($x = 0, $y = 0)
@@ -1432,8 +1434,8 @@  discard block
 block discarded – undo
1432 1434
      * docCompl
1433 1435
      * Monta o campo com os dados do remetente na DACTE.
1434 1436
      *
1435
-     * @param number $x Posição horizontal canto esquerdo
1436
-     * @param number $y Posição vertical canto superior
1437
+     * @param integer $x Posição horizontal canto esquerdo
1438
+     * @param integer $y Posição vertical canto superior
1437 1439
      * @return number Posição vertical final
1438 1440
      */
1439 1441
     protected function docCompl($x = 0, $y = 0)
@@ -1495,8 +1497,8 @@  discard block
 block discarded – undo
1495 1497
      * observacoes
1496 1498
      * Monta o campo com os dados do remetente na DACTE.
1497 1499
      *
1498
-     * @param  number $x Posição horizontal canto esquerdo
1499
-     * @param  number $y Posição vertical canto superior
1500
+     * @param  integer $x Posição horizontal canto esquerdo
1501
+     * @param  integer $y Posição vertical canto superior
1500 1502
      * @return number Posição vertical final
1501 1503
      */
1502 1504
     protected function observacoes($x = 0, $y = 0)
@@ -1538,8 +1540,8 @@  discard block
 block discarded – undo
1538 1540
      * seguro
1539 1541
      * Monta o campo com os dados de seguro do CT-e OS.
1540 1542
      *
1541
-     * @param  number $x Posição horizontal canto esquerdo
1542
-     * @param  number $y Posição vertical canto superior
1543
+     * @param  integer $x Posição horizontal canto esquerdo
1544
+     * @param  integer $y Posição vertical canto superior
1543 1545
      * @return number Posição vertical final
1544 1546
      */
1545 1547
     protected function seguro($x = 0, $y = 0)
@@ -1598,8 +1600,8 @@  discard block
 block discarded – undo
1598 1600
      * modalRod
1599 1601
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1600 1602
      *
1601
-     * @param  number $x Posição horizontal canto esquerdo
1602
-     * @param  number $y Posição vertical canto superior
1603
+     * @param  integer $x Posição horizontal canto esquerdo
1604
+     * @param  integer $y Posição vertical canto superior
1603 1605
      * @return number Posição vertical final
1604 1606
      */
1605 1607
     protected function modalRod($x = 0, $y = 0)
@@ -1687,8 +1689,8 @@  discard block
 block discarded – undo
1687 1689
      * modalAquaviario
1688 1690
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1689 1691
      *
1690
-     * @param  number $x Posição horizontal canto esquerdo
1691
-     * @param  number $y Posição vertical canto superior
1692
+     * @param  integer $x Posição horizontal canto esquerdo
1693
+     * @param  integer $y Posição vertical canto superior
1692 1694
      * @return number Posição vertical final
1693 1695
      */
1694 1696
     protected function modalAquaviario($x = 0, $y = 0)
@@ -1857,8 +1859,8 @@  discard block
 block discarded – undo
1857 1859
      * modalFerr
1858 1860
      * Monta o campo com os dados do remetente na DACTE. ( retrato  e paisagem  )
1859 1861
      *
1860
-     * @param  number $x Posição horizontal canto esquerdo
1861
-     * @param  number $y Posição vertical canto superior
1862
+     * @param  integer $x Posição horizontal canto esquerdo
1863
+     * @param  integer $y Posição vertical canto superior
1862 1864
      * @return number Posição vertical final
1863 1865
      */
1864 1866
     protected function modalFerr($x = 0, $y = 0)
@@ -2135,8 +2137,8 @@  discard block
 block discarded – undo
2135 2137
      * canhoto
2136 2138
      * Monta o campo com os dados do remetente na DACTE.
2137 2139
      *
2138
-     * @param  number $x Posição horizontal canto esquerdo
2139
-     * @param  number $y Posição vertical canto superior
2140
+     * @param  integer $x Posição horizontal canto esquerdo
2141
+     * @param  integer $y Posição vertical canto superior
2140 2142
      * @return number Posição vertical final
2141 2143
      */
2142 2144
     protected function canhoto($x = 0, $y = 0)
@@ -2219,9 +2221,10 @@  discard block
 block discarded – undo
2219 2221
      * dadosAdic
2220 2222
      * Coloca o grupo de dados adicionais da DACTE.
2221 2223
      *
2222
-     * @param  number $x Posição horizontal canto esquerdo
2223
-     * @param  number $y Posição vertical canto superior
2224
-     * @param  number $h altura do campo
2224
+     * @param  integer $x Posição horizontal canto esquerdo
2225
+     * @param  double $y Posição vertical canto superior
2226
+     * @param  integer $h altura do campo
2227
+     * @param integer $pag
2225 2228
      * @return number Posição vertical final
2226 2229
      */
2227 2230
     protected function dadosAdic($x, $y, $pag, $h)
@@ -2414,7 +2417,7 @@  discard block
 block discarded – undo
2414 2417
      * Fornece a imformação multiplicação de peso contida na CTe
2415 2418
      *
2416 2419
      * @param  interger $U Informação de peso extraida da CTe
2417
-     * @return interger
2420
+     * @return integer
2418 2421
      */
2419 2422
     protected function multiUniPeso($U = '')
2420 2423
     {
Please login to merge, or discard this patch.
src/CTe/Daevento.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,6 +77,9 @@  discard block
 block discarded – undo
77 77
         $this->loadDoc($xml);
78 78
     }
79 79
 
80
+    /**
81
+     * @param string $xml
82
+     */
80 83
     protected function loadDoc($xml)
81 84
     {
82 85
         $this->dom = new \DomDocument;
@@ -211,7 +214,7 @@  discard block
 block discarded – undo
211 214
      * @param integer $x
212 215
      * @param integer $y
213 216
      * @param integer $pag
214
-     * @return integer
217
+     * @return double
215 218
      */
216 219
     private function header(
217 220
         $x,
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,6 @@
 block discarded – undo
15 15
  * @author    Roberto L. Machado <linux.rlm at gmail dot com>
16 16
  */
17 17
 
18
-use Exception;
19
-use NFePHP\DA\Legacy\Dom;
20 18
 use NFePHP\DA\Legacy\Pdf;
21 19
 use NFePHP\DA\Common\DaCommon;
22 20
 
Please login to merge, or discard this patch.
src/MDFe/Damdfe.php 2 patches
Doc Comments   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,6 +63,9 @@  discard block
 block discarded – undo
63 63
         $this->loadDoc($xml);
64 64
     }
65 65
 
66
+    /**
67
+     * @param string $xml
68
+     */
66 69
     private function loadDoc($xml)
67 70
     {
68 71
         $this->xml = $xml;
@@ -224,7 +227,7 @@  discard block
 block discarded – undo
224 227
      * @param  float $x
225 228
      * @param  float $y
226 229
      * @param  integer $pag
227
-     * @return string
230
+     * @return double
228 231
      */
229 232
     private function headerMDFePaisagem($x, $y, $pag)
230 233
     {
@@ -368,7 +371,7 @@  discard block
 block discarded – undo
368 371
      * @param  float $x
369 372
      * @param  float $y
370 373
      * @param  integer $pag
371
-     * @return string
374
+     * @return double
372 375
      */
373 376
     private function headerMDFeRetrato($x, $y, $pag)
374 377
     {
@@ -535,7 +538,7 @@  discard block
 block discarded – undo
535 538
      *
536 539
      * @param  float $x
537 540
      * @param  float $y
538
-     * @return void
541
+     * @return double
539 542
      */
540 543
     private function bodyMDFe($x, $y)
541 544
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     protected $pdf; // objeto fpdf()
29 29
     protected $xml; // string XML NFe
30 30
     protected $errMsg = ''; // mesagens de erro
31
-    protected $errStatus = false;// status de erro TRUE um erro ocorreu false sem erros
31
+    protected $errStatus = false; // status de erro TRUE um erro ocorreu false sem erros
32 32
     protected $orientacao = 'P'; //orientação da DANFE P-Retrato ou L-Paisagem
33 33
     protected $papel = 'A4'; //formato do papel
34 34
     protected $fontePadrao = 'Times'; //Nome da Fonte para gerar o DANFE
Please login to merge, or discard this patch.
src/NFe/Danfce.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -992,6 +992,9 @@
 block discarded – undo
992 992
         return $texto;
993 993
     }
994 994
     
995
+    /**
996
+     * @param string $tBand
997
+     */
995 998
     protected static function getCardName($tBand)
996 999
     {
997 1000
         switch ($tBand) {
Please login to merge, or discard this patch.
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
     protected $paperwidth = 80;
28 28
     protected $creditos;
29 29
     protected $xml; // string XML NFe
30
-    protected $logomarca=''; // path para logomarca em jpg
31
-    protected $formatoChave="#### #### #### #### #### #### #### #### #### #### ####";
30
+    protected $logomarca = ''; // path para logomarca em jpg
31
+    protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####";
32 32
     protected $tpImp; //ambiente
33
-    protected $fontePadrao='Times';
33
+    protected $fontePadrao = 'Times';
34 34
     protected $nfeProc;
35 35
     protected $nfe;
36 36
     protected $infNFe;
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         $this->textoAdic = '';
160 160
         if (isset($this->infAdic)) {
161 161
             $this->textoAdic .= !empty($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue) ?
162
-            'Inf. Contribuinte: '.
162
+            'Inf. Contribuinte: ' .
163 163
             trim($this->anfaveaDANFE($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue)) : '';
164 164
             if (!empty($this->textoAdic)) {
165 165
                 $this->textoAdic = str_replace(";", "\n", $this->textoAdic);
@@ -200,10 +200,10 @@  discard block
 block discarded – undo
200 200
         //total inicial de paginas
201 201
         $totPag = 1;
202 202
         //largura imprimivel em mm: largura da folha menos as margens esq/direita
203
-        $this->wPrint = $maxW-($margEsq*2);
203
+        $this->wPrint = $maxW - ($margEsq * 2);
204 204
         //comprimento (altura) imprimivel em mm: altura da folha menos as margens
205 205
         //superior e inferior
206
-        $this->hPrint = $maxH-$margSup-$margInf;
206
+        $this->hPrint = $maxH - $margSup - $margInf;
207 207
         // estabelece contagem de paginas
208 208
         $this->pdf->aliasNbPages();
209 209
         $this->pdf->setMargins($margEsq, $margSup); // fixa as margens
@@ -214,11 +214,11 @@  discard block
 block discarded – undo
214 214
         $this->pdf->setLineWidth(0.1); // define a largura da linha
215 215
         $this->pdf->setTextColor(0, 0, 0);
216 216
         $this->pdf->textBox(0, 0, $maxW, $maxH); // POR QUE PRECISO DESA LINHA?
217
-        $hcabecalho = 27;//para cabeçalho (dados emitente mais logomarca)  (FIXO)
218
-        $hcabecalhoSecundario = 10 + 3;//para cabeçalho secundário (cabeçalho sefaz) (FIXO)
219
-        $hprodutos = $hLinha + ($qtdItens * $hMaxLinha) ;//box poduto
217
+        $hcabecalho = 27; //para cabeçalho (dados emitente mais logomarca)  (FIXO)
218
+        $hcabecalhoSecundario = 10 + 3; //para cabeçalho secundário (cabeçalho sefaz) (FIXO)
219
+        $hprodutos = $hLinha + ($qtdItens * $hMaxLinha); //box poduto
220 220
         $hTotal = 12; //box total (FIXO)
221
-        $hpagamentos = $hLinha + ($qtdPgto * $hLinha) + 3;//para pagamentos
221
+        $hpagamentos = $hLinha + ($qtdPgto * $hLinha) + 3; //para pagamentos
222 222
         if (!empty($this->vTroco)) {
223 223
             $hpagamentos += $hLinha;
224 224
         }
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal;
252 252
         $y = $this->pagamentosDANFE($x, $y, $hpagamentos);
253 253
         //COLOCA MENSAGEM FISCAL
254
-        $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal+ $hpagamentos;
254
+        $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos;
255 255
         $y = $this->fiscalDANFE($x, $y, $hmsgfiscal);
256 256
         //COLOCA CONSUMIDOR
257 257
         $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos + $hmsgfiscal;
@@ -279,14 +279,14 @@  discard block
 block discarded – undo
279 279
         $emitIM     = $this->getTagValue($this->emit, "IM");
280 280
         $emitFone = $this->getTagValue($this->enderEmit, "fone");
281 281
         $foneLen = strlen($emitFone);
282
-        if ($foneLen>0) {
282
+        if ($foneLen > 0) {
283 283
             $ddd = substr($emitFone, 0, 2);
284 284
             $fone1 = substr($emitFone, -8);
285 285
             $digito9 = ' ';
286 286
             if ($foneLen == 11) {
287 287
                 $digito9 = substr($emitFone, 2, 1);
288 288
             }
289
-            $emitFone = ' - ('.$ddd.') '.$digito9. ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4);
289
+            $emitFone = ' - (' . $ddd . ') ' . $digito9 . ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4);
290 290
         } else {
291 291
             $emitFone = '';
292 292
         }
@@ -300,24 +300,24 @@  discard block
 block discarded – undo
300 300
         // CONFIGURAÇÃO DE POSIÇÃO
301 301
         $margemInterna = $this->margemInterna;
302 302
         $maxW = $this->wPrint;
303
-        $h = $h-($margemInterna);
303
+        $h = $h - ($margemInterna);
304 304
         //COLOCA LOGOMARCA
305 305
         if (!empty($this->logomarca)) {
306 306
             $xImg = $margemInterna;
307 307
             $yImg = $margemInterna + 1;
308 308
             $logoInfo = getimagesize($this->logomarca);
309
-            $logoWmm = ($logoInfo[0]/72)*25.4;
310
-            $logoHmm = ($logoInfo[1]/72)*25.4;
309
+            $logoWmm = ($logoInfo[0] / 72) * 25.4;
310
+            $logoHmm = ($logoInfo[1] / 72) * 25.4;
311 311
             $nImgW = 30;
312
-            $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0);
313
-            $yImg = $margemInterna + $nImgH/2;
312
+            $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
313
+            $yImg = $margemInterna + $nImgH / 2;
314 314
             $this->pdf->image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, 'jpeg');
315
-            $xRs = ($maxW*0.4) + $margemInterna;
316
-            $wRs = ($maxW*0.6);
315
+            $xRs = ($maxW * 0.4) + $margemInterna;
316
+            $wRs = ($maxW * 0.6);
317 317
             $alignEmit = 'L';
318 318
         } else {
319 319
             $xRs = $margemInterna;
320
-            $wRs = ($maxW*1);
320
+            $wRs = ($maxW * 1);
321 321
             $alignEmit = 'L';
322 322
         }
323 323
         //COLOCA RAZÃO SOCIAL
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
     {
338 338
         $margemInterna = $this->margemInterna;
339 339
         $maxW = $this->wPrint;
340
-        $w = ($maxW*1);
340
+        $w = ($maxW * 1);
341 341
         $hBox1 = 7;
342 342
         $texto = "DANFE NFC-e\nDocumento Auxiliar da Nota Fiscal de Consumidor Eletrônica";
343 343
         $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B');
@@ -354,13 +354,13 @@  discard block
 block discarded – undo
354 354
         $margemInterna = $this->margemInterna;
355 355
         $maxW = $this->wPrint;
356 356
         $qtdItens = $this->det->length;
357
-        $w = ($maxW*1);
357
+        $w = ($maxW * 1);
358 358
         $hLinha = $this->hLinha;
359 359
         $aFontCabProdutos = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
360
-        $wBoxCod = $w*0.17;
360
+        $wBoxCod = $w * 0.17;
361 361
         $texto = "CÓDIGO";
362 362
         $this->pdf->textBox($x, $y, $wBoxCod, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
363
-        $wBoxDescricao = $w*0.43;
363
+        $wBoxDescricao = $w * 0.43;
364 364
         $xBoxDescricao = $wBoxCod + $x;
365 365
         $texto = "DESCRICÃO";
366 366
         $this->pdf->textBox(
@@ -376,19 +376,19 @@  discard block
 block discarded – undo
376 376
             '',
377 377
             false
378 378
         );
379
-        $wBoxQt = $w*0.08;
379
+        $wBoxQt = $w * 0.08;
380 380
         $xBoxQt = $wBoxDescricao + $xBoxDescricao;
381 381
         $texto = "QT";
382 382
         $this->pdf->textBox($xBoxQt, $y, $wBoxQt, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
383
-        $wBoxUn = $w*0.06;
383
+        $wBoxUn = $w * 0.06;
384 384
         $xBoxUn = $wBoxQt + $xBoxQt;
385 385
         $texto = "UN";
386 386
         $this->pdf->textBox($xBoxUn, $y, $wBoxUn, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
387
-        $wBoxVl = $w*0.13;
387
+        $wBoxVl = $w * 0.13;
388 388
         $xBoxVl = $wBoxUn + $xBoxUn;
389 389
         $texto = "VALOR";
390 390
         $this->pdf->textBox($xBoxVl, $y, $wBoxVl, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
391
-        $wBoxTotal = $w*0.13;
391
+        $wBoxTotal = $w * 0.13;
392 392
         $xBoxTotal = $wBoxVl + $xBoxVl;
393 393
         $texto = "TOTAL";
394 394
         $this->pdf->textBox($xBoxTotal, $y, $wBoxTotal, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false);
@@ -408,9 +408,9 @@  discard block
 block discarded – undo
408 408
                 $vUnCom     = number_format($this->getTagValue($prod, "vUnCom"), 2, ",", ".");
409 409
                 $vProd      = number_format($this->getTagValue($prod, "vProd"), 2, ",", ".");
410 410
                 //COLOCA PRODUTO
411
-                $yBoxProd = $y + $hLinha + ($cont*$hMaxLinha);
411
+                $yBoxProd = $y + $hLinha + ($cont * $hMaxLinha);
412 412
                 //COLOCA PRODUTO CÓDIGO
413
-                $wBoxCod = $w*0.17;
413
+                $wBoxCod = $w * 0.17;
414 414
                 $texto = $cProd;
415 415
                 $this->pdf->textBox(
416 416
                     $x,
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
                     false
427 427
                 );
428 428
                 //COLOCA PRODUTO DESCRIÇÃO
429
-                $wBoxDescricao = $w*0.43;
429
+                $wBoxDescricao = $w * 0.43;
430 430
                 $xBoxDescricao = $wBoxCod + $x;
431 431
                 $texto = $xProd;
432 432
                 $this->pdf->textBox(
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
                     false
444 444
                 );
445 445
                 //COLOCA PRODUTO QUANTIDADE
446
-                $wBoxQt = $w*0.08;
446
+                $wBoxQt = $w * 0.08;
447 447
                 $xBoxQt = $wBoxDescricao + $xBoxDescricao;
448 448
                 $texto = $qCom;
449 449
                 $this->pdf->textBox(
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
                     false
461 461
                 );
462 462
                 //COLOCA PRODUTO UNIDADE
463
-                $wBoxUn = $w*0.06;
463
+                $wBoxUn = $w * 0.06;
464 464
                 $xBoxUn = $wBoxQt + $xBoxQt;
465 465
                 $texto = $uCom;
466 466
                 $this->pdf->textBox(
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
                     false
478 478
                 );
479 479
                 //COLOCA PRODUTO VL UNITÁRIO
480
-                $wBoxVl = $w*0.13;
480
+                $wBoxVl = $w * 0.13;
481 481
                 $xBoxVl = $wBoxUn + $xBoxUn;
482 482
                 $texto = $vUnCom;
483 483
                 $this->pdf->textBox(
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
                     false
495 495
                 );
496 496
                 //COLOCA PRODUTO VL TOTAL
497
-                $wBoxTotal = $w*0.13;
497
+                $wBoxTotal = $w * 0.13;
498 498
                 $xBoxTotal = $wBoxVl + $xBoxVl;
499 499
                 $texto = $vProd;
500 500
                 $this->pdf->textBox(
@@ -521,8 +521,8 @@  discard block
 block discarded – undo
521 521
         $margemInterna = $this->margemInterna;
522 522
         $maxW = $this->wPrint;
523 523
         $hLinha = 3;
524
-        $wColEsq = ($maxW*0.7);
525
-        $wColDir = ($maxW*0.3);
524
+        $wColEsq = ($maxW * 0.7);
525
+        $wColDir = ($maxW * 0.3);
526 526
         $xValor = $x + $wColEsq;
527 527
         $qtdItens = $this->det->length;
528 528
         $vProd = $this->getTagValue($this->ICMSTot, "vProd");
@@ -543,28 +543,28 @@  discard block
 block discarded – undo
543 543
         $texto = "R$ " . number_format($vProd, 2, ",", ".");
544 544
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
545 545
         $this->pdf->textBox($xValor, $yTotal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
546
-        $yDesconto = $y + ($hLinha*2);
546
+        $yDesconto = $y + ($hLinha * 2);
547 547
         $texto = "Descontos";
548 548
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
549 549
         $this->pdf->textBox($x, $yDesconto, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
550 550
         $texto = "R$ " . $vDesc;
551 551
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
552 552
         $this->pdf->textBox($xValor, $yDesconto, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
553
-        $yFrete= $y + ($hLinha*3);
553
+        $yFrete = $y + ($hLinha * 3);
554 554
         $texto = "Frete";
555 555
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
556 556
         $this->pdf->textBox($x, $yFrete, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
557 557
         $texto = "R$ " . $vFrete;
558 558
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
559 559
         $this->pdf->textBox($xValor, $yFrete, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
560
-        $yTotalFinal = $y + ($hLinha*4);
560
+        $yTotalFinal = $y + ($hLinha * 4);
561 561
         $texto = "Total";
562 562
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
563 563
         $this->pdf->textBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
564 564
         $texto = "R$ " . $vNF;
565 565
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
566 566
         $this->pdf->textBox($xValor, $yTotalFinal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false);
567
-        $yTotalFinal = $y + ($hLinha*5);
567
+        $yTotalFinal = $y + ($hLinha * 5);
568 568
         $texto = "Informação dos Tributos Totais Incidentes";
569 569
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
570 570
         $this->pdf->textBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false);
@@ -579,16 +579,16 @@  discard block
 block discarded – undo
579 579
         $margemInterna = $this->margemInterna;
580 580
         $maxW = $this->wPrint;
581 581
         $qtdPgto = $this->pag->length;
582
-        $w = ($maxW*1);
582
+        $w = ($maxW * 1);
583 583
         $hLinha = $this->hLinha;
584
-        $wColEsq = ($maxW*0.7);
585
-        $wColDir = ($maxW*0.3);
584
+        $wColEsq = ($maxW * 0.7);
585
+        $wColDir = ($maxW * 0.3);
586 586
         $xValor = $x + $wColEsq;
587 587
         $aFontPgto = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
588
-        $wBoxEsq = $w*0.7;
588
+        $wBoxEsq = $w * 0.7;
589 589
         $texto = "FORMA DE PAGAMENTO";
590 590
         $this->pdf->textBox($x, $y, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false);
591
-        $wBoxDir = $w*0.3;
591
+        $wBoxDir = $w * 0.3;
592 592
         $xBoxDescricao = $x + $wBoxEsq;
593 593
         $texto = "VALOR PAGO";
594 594
         $this->pdf->textBox($xBoxDescricao, $y, $wBoxDir, $hLinha, $texto, $aFontPgto, 'T', 'R', 0, '', false);
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
                     $tBandNome = self::getCardName($tBand);
611 611
                 }
612 612
                 //COLOCA PRODUTO
613
-                $yBoxProd = $y + $hLinha + ($cont*$hLinha);
613
+                $yBoxProd = $y + $hLinha + ($cont * $hLinha);
614 614
                 //COLOCA PRODUTO CÓDIGO
615 615
                 $texto = $tPagNome;
616 616
                 $this->pdf->textBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false);
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
             }
635 635
             
636 636
             if (!empty($this->vTroco)) {
637
-                $yBoxProd = $y + $hLinha + ($cont*$hLinha);
637
+                $yBoxProd = $y + $hLinha + ($cont * $hLinha);
638 638
                 //COLOCA PRODUTO CÓDIGO
639 639
                 $texto = 'Troco';
640 640
                 $this->pdf->textBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false);
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
         $y += 6;
664 664
         $margemInterna = $this->margemInterna;
665 665
         $maxW = $this->wPrint;
666
-        $w = ($maxW*1);
666
+        $w = ($maxW * 1);
667 667
         $hLinha = $this->hLinha;
668 668
         $aFontTit = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'];
669 669
         $aFontTex = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
@@ -695,19 +695,19 @@  discard block
 block discarded – undo
695 695
         $dhEmiLocalFormat = $dhEmilocal->format('d/m/Y H:i:s');
696 696
         $texto = "ÁREA DE MENSAGEM FISCAL";
697 697
         $this->pdf->textBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false);
698
-        $yTex1 = $y + ($hLinha*1);
699
-        $hTex1 = $hLinha*2;
700
-        $texto = "Número " . $nNF . " Série " . $serieNF . " " .$dhEmiLocalFormat . " - Via Consumidor";
698
+        $yTex1 = $y + ($hLinha * 1);
699
+        $hTex1 = $hLinha * 2;
700
+        $texto = "Número " . $nNF . " Série " . $serieNF . " " . $dhEmiLocalFormat . " - Via Consumidor";
701 701
         $this->pdf->textBox($x, $yTex1, $w, $hTex1, $texto, $aFontTex, 'C', 'C', 0, '', false);
702
-        $yTex2 = $y + ($hLinha*3);
703
-        $hTex2 = $hLinha*2;
702
+        $yTex2 = $y + ($hLinha * 3);
703
+        $hTex2 = $hLinha * 2;
704 704
         
705 705
         $texto = !empty($this->urlChave) ? "Consulte pela Chave de Acesso em " . $this->urlChave : '';
706 706
         $this->pdf->textBox($x, $yTex2, $w, $hTex2, $texto, $aFontTex, 'C', 'C', 0, '', false);
707 707
         $texto = "CHAVE DE ACESSO";
708
-        $yTit2 = $y + ($hLinha*5);
708
+        $yTit2 = $y + ($hLinha * 5);
709 709
         $this->pdf->textBox($x, $yTit2, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false);
710
-        $yTex3 = $y + ($hLinha*6);
710
+        $yTex3 = $y + ($hLinha * 6);
711 711
         $texto = $chNFe;
712 712
         $this->pdf->textBox($x, $yTex3, $w, $hLinha, $texto, $aFontTex, 'C', 'C', 0, '', false);
713 713
     }
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
         $y += 6;
718 718
         $margemInterna = $this->margemInterna;
719 719
         $maxW = $this->wPrint;
720
-        $w = ($maxW*1);
720
+        $w = ($maxW * 1);
721 721
         $hLinha = $this->hLinha;
722 722
         $aFontTit = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'];
723 723
         $aFontTex = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
             $consCNPJ = !empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)
734 734
                     ? $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue
735 735
                     : '';
736
-            $cDest = $consCPF.$consCNPJ.$considEstrangeiro; //documentos do consumidor
736
+            $cDest = $consCPF . $consCNPJ . $considEstrangeiro; //documentos do consumidor
737 737
             $enderDest = $this->dest->getElementsByTagName("enderDest")->item(0);
738 738
             $consNome = $this->getTagValue($this->dest, "xNome");
739 739
             $consLgr = $this->getTagValue($enderDest, "xLgr");
@@ -773,8 +773,8 @@  discard block
 block discarded – undo
773 773
             $yTex1 = $y + $hLinha;
774 774
             $texto = $consNome;
775 775
             if (!empty($consDoc)) {
776
-                $texto .= " - ". $consDoc . "\n" . $consEnd;
777
-                $this->pdf->textBox($x, $yTex1, $w, $hLinha*3, $texto, $aFontTex, 'C', 'C', 0, '', false);
776
+                $texto .= " - " . $consDoc . "\n" . $consEnd;
777
+                $this->pdf->textBox($x, $yTex1, $w, $hLinha * 3, $texto, $aFontTex, 'C', 'C', 0, '', false);
778 778
             }
779 779
         } else {
780 780
             $yTex1 = $y + $hLinha;
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
         $y += 6;
789 789
         $margemInterna = $this->margemInterna;
790 790
         $maxW = $this->wPrint;
791
-        $w = ($maxW*1)+4;
791
+        $w = ($maxW * 1) + 4;
792 792
         $hLinha = $this->hLinha;
793 793
         $hBoxLinha = $this->hBoxLinha;
794 794
         $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B');
@@ -797,7 +797,7 @@  discard block
 block discarded – undo
797 797
         $nProt = '';
798 798
         if (isset($this->nfeProc)) {
799 799
             $nProt = $this->getTagValue($this->nfeProc, "nProt");
800
-            $dhRecbto  = $this->getTagValue($this->nfeProc, "dhRecbto");
800
+            $dhRecbto = $this->getTagValue($this->nfeProc, "dhRecbto");
801 801
         }
802 802
         $barcode = new Barcode();
803 803
         $bobj = $barcode->getBarcodeObj(
@@ -811,15 +811,15 @@  discard block
 block discarded – undo
811 811
         $qrcode = $bobj->getPngData();
812 812
         $wQr = 50;
813 813
         $hQr = 50;
814
-        $yQr = ($y+$margemInterna);
815
-        $xQr = ($w/2) - ($wQr/2);
814
+        $yQr = ($y + $margemInterna);
815
+        $xQr = ($w / 2) - ($wQr / 2);
816 816
         // prepare a base64 encoded "data url"
817 817
         $pic = 'data://text/plain;base64,' . base64_encode($qrcode);
818 818
         $info = getimagesize($pic);
819 819
         $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG');
820 820
         $dt = new DateTime($dhRecbto);
821
-        $yQr = ($yQr+$hQr+$margemInterna);
822
-        $this->pdf->textBox($x, $yQr, $w-4, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n"
821
+        $yQr = ($yQr + $hQr + $margemInterna);
822
+        $this->pdf->textBox($x, $yQr, $w - 4, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n"
823 823
             . $dt->format('d/m/Y H:i:s'), $aFontTex, 'C', 'C', 0, '', false);
824 824
     }
825 825
    
@@ -843,7 +843,7 @@  discard block
 block discarded – undo
843 843
             $heigthText = $this->pdf->textBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false);
844 844
         }
845 845
         // seta o textbox do texto adicional
846
-        $this->pdf->textBox($x, $y+3, $w-2, $hLinha-3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false);
846
+        $this->pdf->textBox($x, $y + 3, $w - 2, $hLinha - 3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false);
847 847
     }
848 848
     
849 849
     /**
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
         if ($startPos === false) {
870 870
             return $cdata;
871 871
         }
872
-        for ($x=$len; $x>0; $x--) {
872
+        for ($x = $len; $x > 0; $x--) {
873 873
             if (substr($cdata, $x, 1) == '>') {
874 874
                 $endPos = $x;
875 875
                 break;
@@ -880,15 +880,15 @@  discard block
 block discarded – undo
880 880
         } else {
881 881
             $parte1 = '';
882 882
         }
883
-        $parte2 = substr($cdata, $startPos, $endPos-$startPos+1);
883
+        $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1);
884 884
         if ($endPos < $len) {
885 885
             $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1);
886 886
         } else {
887 887
             $parte3 = '';
888 888
         }
889
-        $texto = trim($parte1).' '.trim($parte3);
889
+        $texto = trim($parte1) . ' ' . trim($parte3);
890 890
         if (strpos($parte2, '<CDATA>') === false) {
891
-            $cdata = '<CDATA>'.$parte2.'</CDATA>';
891
+            $cdata = '<CDATA>' . $parte2 . '</CDATA>';
892 892
         } else {
893 893
             $cdata = $parte2;
894 894
         }
@@ -960,15 +960,15 @@  discard block
 block discarded – undo
960 960
         //grupo CADATA infCpl
961 961
         $t = $dom->getElementsByTagName('transmissor')->item(0);
962 962
         $r = $dom->getElementsByTagName('receptor')->item(0);
963
-        $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
964
-        'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : '';
965
-        $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
966
-        'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : '';
967
-        $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
968
-        'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : '';
969
-        $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
970
-        'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : '';
971
-        $texto .= "".$versao.$especieNF.$fabEntrega.$dca;
963
+        $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
964
+        'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : '';
965
+        $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
966
+        'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : '';
967
+        $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
968
+        'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : '';
969
+        $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
970
+        'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : '';
971
+        $texto .= "" . $versao . $especieNF . $fabEntrega . $dca;
972 972
         if (isset($t)) {
973 973
             if ($t->hasAttributes()) {
974 974
                 $texto .= " Transmissor ";
Please login to merge, or discard this patch.
src/NFe/Danfe.php 4 patches
Doc Comments   +27 added lines, -19 removed lines patch added patch discarded remove patch
@@ -858,8 +858,8 @@  discard block
 block discarded – undo
858 858
      *header
859 859
      * Monta o cabelhalho da DANFE (retrato e paisagem)
860 860
      *
861
-     * @param  number $x      Posição horizontal inicial, canto esquerdo
862
-     * @param  number $y      Posição vertical inicial, canto superior
861
+     * @param  integer $x      Posição horizontal inicial, canto esquerdo
862
+     * @param  integer $y      Posição vertical inicial, canto superior
863 863
      * @param  number $pag    Número da Página
864 864
      * @param  number $totPag Total de páginas
865 865
      * @return number Posição vertical final
@@ -1344,8 +1344,8 @@  discard block
 block discarded – undo
1344 1344
      * Monta o campo com os dados do destinatário na DANFE. (retrato e paisagem)
1345 1345
      *
1346 1346
      * @name   destinatarioDANFE
1347
-     * @param  number $x Posição horizontal canto esquerdo
1348
-     * @param  number $y Posição vertical canto superior
1347
+     * @param  integer $x Posição horizontal canto esquerdo
1348
+     * @param  integer $y Posição vertical canto superior
1349 1349
      * @return number Posição vertical final
1350 1350
      */
1351 1351
     protected function destinatarioDANFE($x = 0, $y = 0)
@@ -1556,8 +1556,8 @@  discard block
 block discarded – undo
1556 1556
      * Monta o campo com os dados do local de entrega na DANFE. (retrato e paisagem)
1557 1557
      *
1558 1558
      * @name   localEntregaDANFE
1559
-     * @param  number $x Posição horizontal canto esquerdo
1560
-     * @param  number $y Posição vertical canto superior
1559
+     * @param  integer $x Posição horizontal canto esquerdo
1560
+     * @param  integer $y Posição vertical canto superior
1561 1561
      * @return number Posição vertical final
1562 1562
      */
1563 1563
     protected function localEntregaDANFE($x = 0, $y = 0)
@@ -1706,8 +1706,8 @@  discard block
 block discarded – undo
1706 1706
      * Monta o campo com os dados do local de entrega na DANFE. (retrato e paisagem)
1707 1707
      *
1708 1708
      * @name   localretiradaDANFE
1709
-     * @param  number $x Posição horizontal canto esquerdo
1710
-     * @param  number $y Posição vertical canto superior
1709
+     * @param  integer $x Posição horizontal canto esquerdo
1710
+     * @param  integer $y Posição vertical canto superior
1711 1711
      * @return number Posição vertical final
1712 1712
      */
1713 1713
     protected function localRetiradaDANFE($x = 0, $y = 0)
@@ -1856,7 +1856,7 @@  discard block
 block discarded – undo
1856 1856
      * Gera a String do Texto da Fatura
1857 1857
       *
1858 1858
      * @name   getTextoFatura
1859
-     * @return uma String com o texto ou "";
1859
+     * @return string String com o texto ou "";
1860 1860
      */
1861 1861
     protected function getTextoFatura()
1862 1862
     {
@@ -1910,8 +1910,8 @@  discard block
 block discarded – undo
1910 1910
      * Monta o campo de duplicatas da DANFE (retrato e paisagem)
1911 1911
      *
1912 1912
      * @name   fatura
1913
-     * @param  number $x Posição horizontal canto esquerdo
1914
-     * @param  number $y Posição vertical canto superior
1913
+     * @param  integer $x Posição horizontal canto esquerdo
1914
+     * @param  double $y Posição vertical canto superior
1915 1915
      * @return number Posição vertical final
1916 1916
      */
1917 1917
     protected function fatura($x, $y)
@@ -2033,8 +2033,8 @@  discard block
 block discarded – undo
2033 2033
      * Monta o campo de pagamentos da DANFE (retrato e paisagem) (foi baseada na fatura)
2034 2034
      *
2035 2035
      * @name   pagamento
2036
-     * @param  number $x Posição horizontal canto esquerdo
2037
-     * @param  number $y Posição vertical canto superior
2036
+     * @param  integer $x Posição horizontal canto esquerdo
2037
+     * @param  double $y Posição vertical canto superior
2038 2038
      * @return number Posição vertical final
2039 2039
      */
2040 2040
     protected function pagamento($x, $y)
@@ -2142,6 +2142,8 @@  discard block
 block discarded – undo
2142 2142
      * @param  float $h Altura do campo
2143 2143
      * @param  float $h Título do campo
2144 2144
      * @param  float $h Valor do imposto
2145
+     * @param string $titulo
2146
+     * @param string $campoImposto
2145 2147
      * @return float Sugestão do $x do próximo imposto
2146 2148
      */
2147 2149
     protected function impostoHelper($x, $y, $w, $h, $titulo, $campoImposto)
@@ -2168,9 +2170,9 @@  discard block
 block discarded – undo
2168 2170
      * imposto
2169 2171
      * Monta o campo de impostos e totais da DANFE (retrato e paisagem)
2170 2172
      *
2171
-     * @param  number $x Posição horizontal canto esquerdo
2172
-     * @param  number $y Posição vertical canto superior
2173
-     * @return number Posição vertical final
2173
+     * @param  integer $x Posição horizontal canto esquerdo
2174
+     * @param  double $y Posição vertical canto superior
2175
+     * @return double Posição vertical final
2174 2176
      */
2175 2177
     protected function imposto($x, $y)
2176 2178
     {
@@ -2566,6 +2568,10 @@  discard block
 block discarded – undo
2566 2568
 
2567 2569
 
2568 2570
 
2571
+    /**
2572
+     * @param string $campo
2573
+     * @param string $formato
2574
+     */
2569 2575
     protected function descricaoProdutoHelper($origem, $campo, $formato)
2570 2576
     {
2571 2577
         $valor_original = $origem->getElementsByTagName($campo)->item(0);
@@ -2670,7 +2676,6 @@  discard block
 block discarded – undo
2670 2676
      * @param  float $x       Posição horizontal canto esquerdo
2671 2677
      * @param  float $y       Posição vertical canto superior
2672 2678
      * @param  float $nInicio Número do item inicial
2673
-     * @param  float $max     Número do item final
2674 2679
      * @param  float $hmax    Altura máxima do campo de itens em mm
2675 2680
      * @return float Posição vertical final
2676 2681
      */
@@ -3369,8 +3374,8 @@  discard block
 block discarded – undo
3369 3374
      * Monta o canhoto da DANFE (retrato e paisagem)
3370 3375
      *
3371 3376
      * @name   canhotoDANFE
3372
-     * @param  number $x Posição horizontal canto esquerdo
3373
-     * @param  number $y Posição vertical canto superior
3377
+     * @param  integer $x Posição horizontal canto esquerdo
3378
+     * @param  integer $y Posição vertical canto superior
3374 3379
      * @return number Posição vertical final
3375 3380
      *
3376 3381
      * TODO 21/07/14 fmertins: quando orientação L-paisagem, o canhoto está sendo gerado incorretamente
@@ -3663,6 +3668,9 @@  discard block
 block discarded – undo
3663 3668
         return $saida;
3664 3669
     }
3665 3670
     
3671
+    /**
3672
+     * @param string $xml
3673
+     */
3666 3674
     private function loadDoc($xml)
3667 3675
     {
3668 3676
         $this->xml = $xml;
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace NFePHP\DA\NFe;
4 4
 
5
-use InvalidArgumentException;
6 5
 use NFePHP\DA\Legacy\Dom;
7 6
 use NFePHP\DA\Legacy\Pdf;
8 7
 use \NFePHP\DA\Common\DaCommon;
Please login to merge, or discard this patch.
Indentation   +30 added lines, -31 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
      * @var string
28 28
      */
29 29
     protected $numero_registro_dpec = '';
30
-     /**
31
-     * Parâmetro para exibir ou ocultar os valores do PIS/COFINS.
32
-     * @var boolean
33
-     */
30
+        /**
31
+         * Parâmetro para exibir ou ocultar os valores do PIS/COFINS.
32
+         * @var boolean
33
+         */
34 34
     protected $qCanhoto = 1;
35 35
     /**
36 36
      * Define a exbição dos valores de PIS e Cofins
@@ -304,7 +304,6 @@  discard block
 block discarded – undo
304 304
      * A definição de margens e posições iniciais para a impressão são estabelecidas
305 305
      * pelo conteúdo da funçao e podem ser modificados.
306 306
      *
307
-
308 307
      * @return string O ID da NFe numero de 44 digitos extraido do arquivo XML
309 308
      */
310 309
     public function monta(
@@ -436,7 +435,7 @@  discard block
 block discarded – undo
436 435
                 $this->textoAdic .= ". \r\n";
437 436
             }
438 437
             $this->textoAdic .= "LOCAL DE ENTREGA : ".$txRetCNPJ.'-'.$txRetxLgr.', '.$txRetnro.' '.$txRetxCpl.
439
-               ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n";
438
+                ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n";
440 439
         }
441 440
         //informações adicionais
442 441
         $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas();
@@ -869,7 +868,7 @@  discard block
 block discarded – undo
869 868
         $oldX = $x;
870 869
         $oldY = $y;
871 870
         if ($this->orientacao == 'P') {
872
-              $maxW = $this->wPrint;
871
+                $maxW = $this->wPrint;
873 872
         } else {
874 873
             if ($pag == 1) { // primeira página
875 874
                 $maxW = $this->wPrint - $this->wCanhoto;
@@ -1246,8 +1245,8 @@  discard block
 block discarded – undo
1246 1245
             $w = $maxW-(2*$x);
1247 1246
             $this->pdf->SetTextColor(200, 200, 200);
1248 1247
             $texto = "DANFE impresso em contingência -\n".
1249
-                     "DPEC regularmente recebido pela Receita\n".
1250
-                     "Federal do Brasil";
1248
+                        "DPEC regularmente recebido pela Receita\n".
1249
+                        "Federal do Brasil";
1251 1250
             $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
1252 1251
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
1253 1252
             $this->pdf->SetTextColor(0, 0, 0);
@@ -1851,13 +1850,13 @@  discard block
 block discarded – undo
1851 1850
         return ($y + $h);
1852 1851
     } //fim da função localRetiradaDANFE
1853 1852
     
1854
-     /**
1855
-     * getTextoFatura
1856
-     * Gera a String do Texto da Fatura
1857
-      *
1858
-     * @name   getTextoFatura
1859
-     * @return uma String com o texto ou "";
1860
-     */
1853
+        /**
1854
+         * getTextoFatura
1855
+         * Gera a String do Texto da Fatura
1856
+         *
1857
+         * @name   getTextoFatura
1858
+         * @return uma String com o texto ou "";
1859
+         */
1861 1860
     protected function getTextoFatura()
1862 1861
     {
1863 1862
         if (isset($this->cobr)) {
@@ -1888,13 +1887,13 @@  discard block
 block discarded – undo
1888 1887
         return "";
1889 1888
     }
1890 1889
 
1891
-     /**
1892
-     * sizeExtraTextoFatura
1893
-     * Calcula o espaço ocupado pelo texto da fatura. Este espaço só é utilizado quando não houver duplicata.
1894
-      *
1895
-     * @name   sizeExtraTextoFatura
1896
-     * @return integer
1897
-     */
1890
+        /**
1891
+         * sizeExtraTextoFatura
1892
+         * Calcula o espaço ocupado pelo texto da fatura. Este espaço só é utilizado quando não houver duplicata.
1893
+         *
1894
+         * @name   sizeExtraTextoFatura
1895
+         * @return integer
1896
+         */
1898 1897
     protected function sizeExtraTextoFatura()
1899 1898
     {
1900 1899
         $textoFatura = $this->getTextoFatura();
@@ -2074,7 +2073,7 @@  discard block
 block discarded – undo
2074 2073
                                     '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível',
2075 2074
                                     '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros'];
2076 2075
             $bandeira = ['01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners',
2077
-                              '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'];
2076
+                                '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'];
2078 2077
             foreach ($this->detPag as $k => $d) {
2079 2078
                 $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2080 2079
                 ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
@@ -2727,7 +2726,7 @@  discard block
 block discarded – undo
2727 2726
         $w4 = round($w*0.05, 0);
2728 2727
         $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2
2729 2728
         if ($this->getTagValue($this->emit, 'CRT') == '3') {
2730
-             $texto = 'O/CST';//Regime Normal
2729
+                $texto = 'O/CST';//Regime Normal
2731 2730
         }
2732 2731
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2733 2732
         $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false);
@@ -3131,7 +3130,7 @@  discard block
 block discarded – undo
3131 3130
         $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3132 3131
         $yVeic += $h;
3133 3132
         $texto = 'Tipo.................: ' . ($renavamTiposVeiculos[intval($veiculoTipo)] ?? $veiculoTipo);
3134
-         $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3133
+            $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3135 3134
         $yVeic = $y + $h;
3136 3135
         $xVeic = $x + 65;
3137 3136
         $texto = 'Nº Motor: .........: ' . $veiculoMotor;
@@ -3265,9 +3264,9 @@  discard block
 block discarded – undo
3265 3264
         //DADOS ADICIONAIS
3266 3265
         $texto = "DADOS ADICIONAIS";
3267 3266
         if ($this->orientacao == 'P') {
3268
-              $w = $this->wPrint;
3267
+                $w = $this->wPrint;
3269 3268
         } else {
3270
-              $w = $this->wPrint-$this->wCanhoto;
3269
+                $w = $this->wPrint-$this->wCanhoto;
3271 3270
         }
3272 3271
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
3273 3272
         $this->pdf->textBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, '');
@@ -3351,10 +3350,10 @@  discard block
 block discarded – undo
3351 3350
         
3352 3351
         $y = $this->maxH - 4;
3353 3352
         if ($this->orientacao == 'P') {
3354
-              $w = $this->wPrint;
3353
+                $w = $this->wPrint;
3355 3354
         } else {
3356
-              $w = $this->wPrint-$this->wCanhoto;
3357
-              $x = $this->wCanhoto;
3355
+                $w = $this->wPrint-$this->wCanhoto;
3356
+                $x = $this->wCanhoto;
3358 3357
         }
3359 3358
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'];
3360 3359
         $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s')
Please login to merge, or discard this patch.
Spacing   +345 added lines, -346 removed lines patch added patch discarded remove patch
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
             if ($papel == 'A4') {
339 339
                 $this->maxW = 297;
340 340
                 $this->maxH = 210;
341
-                $xInic = $this->margEsq+10;
341
+                $xInic = $this->margEsq + 10;
342 342
                 //se paisagem multiplica a largura do canhoto pela quantidade de canhotos
343 343
                 //$this->wCanhoto *= $this->qCanhoto;
344 344
             }
@@ -346,10 +346,10 @@  discard block
 block discarded – undo
346 346
         //total inicial de paginas
347 347
         $totPag = 1;
348 348
         //largura imprimivel em mm: largura da folha menos as margens esq/direita
349
-        $this->wPrint = $this->maxW-($this->margEsq * 2);
349
+        $this->wPrint = $this->maxW - ($this->margEsq * 2);
350 350
         //comprimento (altura) imprimivel em mm: altura da folha menos as margens
351 351
         //superior e inferior
352
-        $this->hPrint = $this->maxH-$this->margSup-$this->margInf;
352
+        $this->hPrint = $this->maxH - $this->margSup - $this->margInf;
353 353
         // estabelece contagem de paginas
354 354
         $this->pdf->aliasNbPages();
355 355
         // fixa as margens
@@ -393,9 +393,9 @@  discard block
 block discarded – undo
393 393
         }
394 394
         //calcular a altura necessária para os dados adicionais
395 395
         if ($this->orientacao == 'P') {
396
-            $this->wAdic = round($this->wPrint*0.66, 0);
396
+            $this->wAdic = round($this->wPrint * 0.66, 0);
397 397
         } else {
398
-            $this->wAdic = round(($this->wPrint-$this->wCanhoto)*0.5, 0);
398
+            $this->wAdic = round(($this->wPrint - $this->wCanhoto) * 0.5, 0);
399 399
         }
400 400
         $fontProduto = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
401 401
         $this->textoAdic = '';
@@ -407,8 +407,8 @@  discard block
 block discarded – undo
407 407
             $txRetxBairro = $this->getTagValue($this->retirada, "xBairro");
408 408
             $txRetxMun = $this->getTagValue($this->retirada, "xMun");
409 409
             $txRetUF = $this->getTagValue($this->retirada, "UF");
410
-            $this->textoAdic .= "LOCAL DE RETIRADA : ".
411
-                    $txRetCNPJ.
410
+            $this->textoAdic .= "LOCAL DE RETIRADA : " .
411
+                    $txRetCNPJ .
412 412
                     '-' .
413 413
                     $txRetxLgr .
414 414
                     ', ' .
@@ -435,8 +435,8 @@  discard block
 block discarded – undo
435 435
             if ($this->textoAdic != '') {
436 436
                 $this->textoAdic .= ". \r\n";
437 437
             }
438
-            $this->textoAdic .= "LOCAL DE ENTREGA : ".$txRetCNPJ.'-'.$txRetxLgr.', '.$txRetnro.' '.$txRetxCpl.
439
-               ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n";
438
+            $this->textoAdic .= "LOCAL DE ENTREGA : " . $txRetCNPJ . '-' . $txRetxLgr . ', ' . $txRetnro . ' ' . $txRetxCpl .
439
+               ' - ' . $txRetxBairro . ' ' . $txRetxMun . ' - ' . $txRetUF . "\r\n";
440 440
         }
441 441
         //informações adicionais
442 442
         $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas();
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
             if ($this->textoAdic != '') {
446 446
                 $this->textoAdic .= ". \r\n";
447 447
             }
448
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl"))
448
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl"))
449 449
             ? 'Inf. Contribuinte: ' . $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl"))
450 450
             : '';
451 451
             $infPedido = $this->geraInformacoesDaTagCompra();
@@ -453,14 +453,14 @@  discard block
 block discarded – undo
453 453
                 $this->textoAdic .= $infPedido;
454 454
             }
455 455
             $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: ');
456
-            $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco"))
456
+            $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco"))
457 457
             ? "\r\n Inf. fisco: " . $this->getTagValue($this->infAdic, "infAdFisco")
458 458
             : '';
459 459
             $obsCont = $this->infAdic->getElementsByTagName("obsCont");
460 460
             if (isset($obsCont)) {
461 461
                 foreach ($obsCont as $obs) {
462
-                    $campo =  $obsCont->item($i)->getAttribute("xCampo");
463
-                    $xTexto = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
462
+                    $campo = $obsCont->item($i)->getAttribute("xCampo");
463
+                    $xTexto = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue)
464 464
                     ? $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue
465 465
                     : '';
466 466
                     $this->textoAdic .= "\r\n" . $campo . ':  ' . trim($xTexto);
@@ -491,11 +491,11 @@  discard block
 block discarded – undo
491 491
             $numlinhasdados += $this->pdf->getNumLines($linha, $this->wAdic, $fontProduto);
492 492
         }
493 493
         $this->textadicfontsize = $this->pdf->fontSize;
494
-        $hdadosadic = round(($numlinhasdados+3) * $this->textadicfontsize, 0);
494
+        $hdadosadic = round(($numlinhasdados + 3) * $this->textadicfontsize, 0);
495 495
         if ($hdadosadic > 70) {
496
-            for ($per=1; $per>=0.01; $per=$per-0.01) {
497
-                $this->textadicfontsize = $this->pdf->fontSize*$per;
498
-                $hdadosadic = round(($numlinhasdados+3) * $this->textadicfontsize, 0);
496
+            for ($per = 1; $per >= 0.01; $per = $per - 0.01) {
497
+                $this->textadicfontsize = $this->pdf->fontSize * $per;
498
+                $hdadosadic = round(($numlinhasdados + 3) * $this->textadicfontsize, 0);
499 499
                 if ($hdadosadic <= 90) {
500 500
                     $hdadosadic = 70;
501 501
                     break;
@@ -507,9 +507,9 @@  discard block
 block discarded – undo
507 507
             $hdadosadic = 10;
508 508
         }
509 509
         //altura disponivel para os campos da DANFE
510
-        $hcabecalho = 47;//para cabeçalho
511
-        $hdestinatario = 25;//para destinatario
512
-        $hduplicatas = 12;//para cada grupo de 7 duplicatas
510
+        $hcabecalho = 47; //para cabeçalho
511
+        $hdestinatario = 25; //para destinatario
512
+        $hduplicatas = 12; //para cada grupo de 7 duplicatas
513 513
         if (isset($this->entrega)) {
514 514
             $hlocalentrega = 25;
515 515
         } else {
@@ -520,11 +520,11 @@  discard block
 block discarded – undo
520 520
         } else {
521 521
             $hlocalretirada = 0;
522 522
         }
523
-        $himposto = 18;// para imposto
524
-        $htransporte = 25;// para transporte
525
-        $hissqn = 11;// para issqn
526
-        $hfooter = 5;// para rodape
527
-        $hCabecItens = 4;//cabeçalho dos itens
523
+        $himposto = 18; // para imposto
524
+        $htransporte = 25; // para transporte
525
+        $hissqn = 11; // para issqn
526
+        $hfooter = 5; // para rodape
527
+        $hCabecItens = 4; //cabeçalho dos itens
528 528
         //alturas disponiveis para os dados
529 529
         $hDispo1 = $this->hPrint - 10 - ($hcabecalho +
530 530
             //$hdestinatario + ($linhasDup * $hduplicatas) + $himposto + $htransporte +
@@ -533,18 +533,18 @@  discard block
 block discarded – undo
533 533
             ($linhaISSQN * $hissqn) + $hdadosadic + $hfooter + $hCabecItens +
534 534
             $this->sizeExtraTextoFatura());
535 535
         if ($this->orientacao == 'P') {
536
-            $hDispo1 -= 24 * $this->qCanhoto;//para canhoto
536
+            $hDispo1 -= 24 * $this->qCanhoto; //para canhoto
537 537
             $w = $this->wPrint;
538 538
         } else {
539
-            $hcanhoto = $this->hPrint;//para canhoto
539
+            $hcanhoto = $this->hPrint; //para canhoto
540 540
             $w = $this->wPrint - $this->wCanhoto;
541 541
         }
542
-        $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens)-4;
542
+        $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens) - 4;
543 543
         //Contagem da altura ocupada para impressão dos itens
544 544
         $fontProduto = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
545 545
         $numlinhas = 0;
546 546
         $hUsado = $hCabecItens;
547
-        $w2 = round($w*0.28, 0);
547
+        $w2 = round($w * 0.28, 0);
548 548
         $hDispo = $hDispo1;
549 549
         $totPag = 1;
550 550
         $i = 0;
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
                 $hDispo = $hDispo2;
558 558
                 $hUsado = $hCabecItens;
559 559
                 // Remove canhoto para páginas secundárias em modo paisagem ('L')
560
-                $w2 = round($this->wPrint*0.28, 0);
560
+                $w2 = round($this->wPrint * 0.28, 0);
561 561
                 $i--; // decrementa para readicionar o item que não coube nessa pagina na outra.
562 562
             }
563 563
             $i++;
@@ -581,15 +581,15 @@  discard block
 block discarded – undo
581 581
         //coloca o cabeçalho
582 582
         $y = $this->header($x, $y, $pag, $totPag);
583 583
         //coloca os dados do destinatário
584
-        $y = $this->destinatarioDANFE($x, $y+1);
584
+        $y = $this->destinatarioDANFE($x, $y + 1);
585 585
         
586 586
         //coloca os dados do local de retirada
587 587
         if (isset($this->retirada)) {
588
-            $y = $this->localRetiradaDANFE($x, $y+1);
588
+            $y = $this->localRetiradaDANFE($x, $y + 1);
589 589
         }
590 590
         //coloca os dados do local de entrega
591 591
         if (isset($this->entrega)) {
592
-            $y = $this->localEntregaDANFE($x, $y+1);
592
+            $y = $this->localEntregaDANFE($x, $y + 1);
593 593
         }
594 594
         
595 595
         //Verifica as formas de pagamento da nota fiscal
@@ -604,29 +604,29 @@  discard block
 block discarded – undo
604 604
         }
605 605
         //caso tenha boleto imprimir fatura
606 606
         if ($this->dup->length > 0) {
607
-            $y = $this->fatura($x, $y+1);
607
+            $y = $this->fatura($x, $y + 1);
608 608
         } else {
609 609
             //Se somente tiver a forma de pagamento sem pagamento ou outros não imprimir nada
610
-            if (count($formaPag)=='1' && (isset($formaPag[90]) || isset($formaPag[99]))) {
610
+            if (count($formaPag) == '1' && (isset($formaPag[90]) || isset($formaPag[99]))) {
611 611
                 $y = $y;
612 612
             } else {
613 613
                 //caso tenha mais de uma forma de pagamento ou seja diferente de boleto exibe a
614 614
                 //forma de pagamento e o valor
615
-                $y = $this->pagamento($x, $y+1);
615
+                $y = $this->pagamento($x, $y + 1);
616 616
             }
617 617
         }
618 618
         //coloca os dados dos impostos e totais da NFe
619
-        $y = $this->imposto($x, $y+1);
619
+        $y = $this->imposto($x, $y + 1);
620 620
         //coloca os dados do trasnporte
621
-        $y = $this->transporte($x, $y+1);
621
+        $y = $this->transporte($x, $y + 1);
622 622
         //itens da DANFE
623 623
         $nInicial = 0;
624 624
 
625
-        $y = $this->itens($x, $y+1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens);
625
+        $y = $this->itens($x, $y + 1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens);
626 626
 
627 627
         //coloca os dados do ISSQN
628 628
         if ($linhaISSQN == 1) {
629
-            $y = $this->issqn($x, $y+4);
629
+            $y = $this->issqn($x, $y + 4);
630 630
         } else {
631 631
             $y += 4;
632 632
         }
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
             //coloca o cabeçalho na página adicional
656 656
             $y = $this->header($x, $y, $n, $totPag);
657 657
             //coloca os itens na página adicional
658
-            $y = $this->itens($x, $y+1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens);
658
+            $y = $this->itens($x, $y + 1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens);
659 659
             //coloca o rodapé da página
660 660
             if ($this->orientacao == 'P') {
661 661
                 $this->rodape($margEsq);
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
         if ($startPos === false) {
693 693
             return $cdata;
694 694
         }
695
-        for ($x=$len; $x>0; $x--) {
695
+        for ($x = $len; $x > 0; $x--) {
696 696
             if (substr($cdata, $x, 1) == '>') {
697 697
                 $endPos = $x;
698 698
                 break;
@@ -703,15 +703,15 @@  discard block
 block discarded – undo
703 703
         } else {
704 704
             $parte1 = '';
705 705
         }
706
-        $parte2 = substr($cdata, $startPos, $endPos-$startPos+1);
706
+        $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1);
707 707
         if ($endPos < $len) {
708 708
             $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1);
709 709
         } else {
710 710
             $parte3 = '';
711 711
         }
712
-        $texto = trim($parte1).' '.trim($parte3);
712
+        $texto = trim($parte1) . ' ' . trim($parte3);
713 713
         if (strpos($parte2, '<CDATA>') === false) {
714
-            $cdata = '<CDATA>'.$parte2.'</CDATA>';
714
+            $cdata = '<CDATA>' . $parte2 . '</CDATA>';
715 715
         } else {
716 716
             $cdata = $parte2;
717 717
         }
@@ -785,15 +785,15 @@  discard block
 block discarded – undo
785 785
         //grupo CADATA infCpl
786 786
         $t = $dom->getElementsByTagName('transmissor')->item(0);
787 787
         $r = $dom->getElementsByTagName('receptor')->item(0);
788
-        $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
789
-            'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : '';
790
-        $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
791
-            'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : '';
792
-        $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
793
-            'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : '';
794
-        $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
795
-            'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : '';
796
-        $texto .= "".$versao.$especieNF.$fabEntrega.$dca;
788
+        $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ?
789
+            'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : '';
790
+        $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ?
791
+            'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : '';
792
+        $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ?
793
+            'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : '';
794
+        $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ?
795
+            'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : '';
796
+        $texto .= "" . $versao . $especieNF . $fabEntrega . $dca;
797 797
         if (isset($t)) {
798 798
             if ($t->hasAttributes()) {
799 799
                 $texto .= " Transmissor ";
@@ -879,14 +879,14 @@  discard block
 block discarded – undo
879 879
         }
880 880
         //####################################################################################
881 881
         //coluna esquerda identificação do emitente
882
-        $w = round($maxW*0.41, 0);
882
+        $w = round($maxW * 0.41, 0);
883 883
         if ($this->orientacao == 'P') {
884 884
             $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'];
885 885
         } else {
886 886
             $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'];
887 887
         }
888 888
         $w1 = $w;
889
-        $h=32;
889
+        $h = 32;
890 890
         $oldY += $h;
891 891
         $this->pdf->textBox($x, $y, $w, $h);
892 892
         $texto = 'IDENTIFICAÇÃO DO EMITENTE';
@@ -902,39 +902,39 @@  discard block
 block discarded – undo
902 902
         if (!empty($this->logomarca)) {
903 903
             $logoInfo = getimagesize($this->logomarca);
904 904
             //largura da imagem em mm
905
-            $logoWmm = ($logoInfo[0]/72)*25.4;
905
+            $logoWmm = ($logoInfo[0] / 72) * 25.4;
906 906
             //altura da imagem em mm
907
-            $logoHmm = ($logoInfo[1]/72)*25.4;
908
-            if ($this->logoAlign=='L') {
909
-                $nImgW = round($w/3, 0);
910
-                $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0);
911
-                $xImg = $x+1;
912
-                $yImg = round(($h-$nImgH)/2, 0)+$y;
907
+            $logoHmm = ($logoInfo[1] / 72) * 25.4;
908
+            if ($this->logoAlign == 'L') {
909
+                $nImgW = round($w / 3, 0);
910
+                $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
911
+                $xImg = $x + 1;
912
+                $yImg = round(($h - $nImgH) / 2, 0) + $y;
913 913
                 //estabelecer posições do texto
914
-                $x1 = round($xImg + $nImgW +1, 0);
915
-                $y1 = round($h/3+$y, 0);
916
-                $tw = round(2*$w/3, 0);
917
-            } elseif ($this->logoAlign=='C') {
918
-                $nImgH = round($h/3, 0);
919
-                $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0);
920
-                $xImg = round(($w-$nImgW)/2+$x, 0);
921
-                $yImg = $y+3;
914
+                $x1 = round($xImg + $nImgW + 1, 0);
915
+                $y1 = round($h / 3 + $y, 0);
916
+                $tw = round(2 * $w / 3, 0);
917
+            } elseif ($this->logoAlign == 'C') {
918
+                $nImgH = round($h / 3, 0);
919
+                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
920
+                $xImg = round(($w - $nImgW) / 2 + $x, 0);
921
+                $yImg = $y + 3;
922 922
                 $x1 = $x;
923 923
                 $y1 = round($yImg + $nImgH + 1, 0);
924 924
                 $tw = $w;
925
-            } elseif ($this->logoAlign=='R') {
926
-                $nImgW = round($w/3, 0);
927
-                $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0);
928
-                $xImg = round($x+($w-(1+$nImgW)), 0);
929
-                $yImg = round(($h-$nImgH)/2, 0)+$y;
925
+            } elseif ($this->logoAlign == 'R') {
926
+                $nImgW = round($w / 3, 0);
927
+                $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0);
928
+                $xImg = round($x + ($w - (1 + $nImgW)), 0);
929
+                $yImg = round(($h - $nImgH) / 2, 0) + $y;
930 930
                 $x1 = $x;
931
-                $y1 = round($h/3+$y, 0);
932
-                $tw = round(2*$w/3, 0);
933
-            } elseif ($this->logoAlign=='F') {
934
-                $nImgH = round($h-5, 0);
935
-                $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0);
936
-                $xImg = round(($w-$nImgW)/2+$x, 0);
937
-                $yImg = $y+3;
931
+                $y1 = round($h / 3 + $y, 0);
932
+                $tw = round(2 * $w / 3, 0);
933
+            } elseif ($this->logoAlign == 'F') {
934
+                $nImgH = round($h - 5, 0);
935
+                $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0);
936
+                $xImg = round(($w - $nImgW) / 2 + $x, 0);
937
+                $yImg = $y + 3;
938 938
                 $x1 = $x;
939 939
                 $y1 = round($yImg + $nImgH + 1, 0);
940 940
                 $tw = $w;
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
             $this->pdf->Image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, 'jpeg');
944 944
         } else {
945 945
             $x1 = $x;
946
-            $y1 = round($h/3+$y, 0);
946
+            $y1 = round($h / 3 + $y, 0);
947 947
             $tw = $w;
948 948
         }
949 949
         // monta as informações apenas se diferente de full logo
@@ -953,9 +953,9 @@  discard block
 block discarded – undo
953 953
             $texto = $this->emit->getElementsByTagName("xNome")->item(0)->nodeValue;
954 954
             $this->pdf->textBox($x1, $y1, $tw, 8, $texto, $aFont, 'T', 'C', 0, '');
955 955
             //endereço
956
-            $y1 = $y1+5;
956
+            $y1 = $y1 + 5;
957 957
             $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
958
-            $fone = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
958
+            $fone = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue)
959 959
             ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue
960 960
             : '';
961 961
             $lgr = $this->getTagValue($this->enderEmit, "xLgr");
@@ -975,33 +975,33 @@  discard block
 block discarded – undo
975 975
         //####################################################################################
976 976
         //coluna central Danfe
977 977
         $x += $w;
978
-        $w=round($maxW * 0.17, 0);//35;
978
+        $w = round($maxW * 0.17, 0); //35;
979 979
         $w2 = $w;
980 980
         $h = 32;
981 981
         $this->pdf->textBox($x, $y, $w, $h);
982 982
   
983 983
         $texto = "DANFE";
984 984
         $aFont = ['font'=>$this->fontePadrao, 'size'=>14, 'style'=>'B'];
985
-        $this->pdf->textBox($x, $y+1, $w, $h, $texto, $aFont, 'T', 'C', 0, '');
985
+        $this->pdf->textBox($x, $y + 1, $w, $h, $texto, $aFont, 'T', 'C', 0, '');
986 986
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
987 987
         $texto = 'Documento Auxiliar da Nota Fiscal Eletrônica';
988 988
         $h = 20;
989
-        $this->pdf->textBox($x, $y+6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false);
989
+        $this->pdf->textBox($x, $y + 6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false);
990 990
 
991 991
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
992 992
         $texto = '0 - ENTRADA';
993 993
         $y1 = $y + 14;
994 994
         $h = 8;
995
-        $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
995
+        $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
996 996
         $texto = '1 - SAÍDA';
997 997
         $y1 = $y + 17;
998
-        $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
998
+        $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
999 999
         //tipo de nF
1000 1000
         $aFont = ['font'=>$this->fontePadrao, 'size'=>12, 'style'=>'B'];
1001 1001
         $y1 = $y + 13;
1002 1002
         $h = 7;
1003 1003
         $texto = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue;
1004
-        $this->pdf->textBox($x+27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, '');
1004
+        $this->pdf->textBox($x + 27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, '');
1005 1005
         //numero da NF
1006 1006
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
1007 1007
         $y1 = $y + 20;
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
         //####################################################################################
1034 1034
         //coluna codigo de barras
1035 1035
         $x += $w;
1036
-        $w = ($maxW-$w1-$w2);//85;
1036
+        $w = ($maxW - $w1 - $w2); //85;
1037 1037
         $w3 = $w;
1038 1038
         $h = 32;
1039 1039
         $this->pdf->textBox($x, $y, $w, $h);
@@ -1042,22 +1042,22 @@  discard block
 block discarded – undo
1042 1042
         $bW = 75;
1043 1043
         $bH = 12;
1044 1044
         //codigo de barras
1045
-        $this->pdf->code128($x+(($w-$bW)/2), $y+2, $chave_acesso, $bW, $bH);
1045
+        $this->pdf->code128($x + (($w - $bW) / 2), $y + 2, $chave_acesso, $bW, $bH);
1046 1046
         //linhas divisorias
1047
-        $this->pdf->line($x, $y+4+$bH, $x+$w, $y+4+$bH);
1048
-        $this->pdf->line($x, $y+12+$bH, $x+$w, $y+12+$bH);
1047
+        $this->pdf->line($x, $y + 4 + $bH, $x + $w, $y + 4 + $bH);
1048
+        $this->pdf->line($x, $y + 12 + $bH, $x + $w, $y + 12 + $bH);
1049 1049
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1050
-        $y1 = $y+4+$bH;
1050
+        $y1 = $y + 4 + $bH;
1051 1051
         $h = 7;
1052 1052
         $texto = 'CHAVE DE ACESSO';
1053 1053
         $this->pdf->textBox($x, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1054 1054
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'];
1055
-        $y1 = $y+8+$bH;
1055
+        $y1 = $y + 8 + $bH;
1056 1056
         $texto = $this->formatField($chave_acesso, $this->formatoChave);
1057
-        $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, '');
1058
-        $y1 = $y+12+$bH;
1057
+        $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, '');
1058
+        $y1 = $y + 12 + $bH;
1059 1059
         $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
1060
-        $chaveContingencia="";
1060
+        $chaveContingencia = "";
1061 1061
         if ($this->notaDpec()) {
1062 1062
             $cabecalhoProtoAutorizacao = 'NÚMERO DE REGISTRO DPEC';
1063 1063
         } else {
@@ -1068,16 +1068,16 @@  discard block
 block discarded – undo
1068 1068
             $chaveContingencia = $this->geraChaveAdicionalDeContingencia();
1069 1069
             $this->pdf->setFillColor(0, 0, 0);
1070 1070
             //codigo de barras
1071
-            $this->pdf->code128($x+11, $y1+1, $chaveContingencia, $bW*.9, $bH/2);
1071
+            $this->pdf->code128($x + 11, $y1 + 1, $chaveContingencia, $bW * .9, $bH / 2);
1072 1072
         } else {
1073 1073
             $texto = 'Consulta de autenticidade no portal nacional da NF-e';
1074
-            $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, '');
1075
-            $y1 = $y+16+$bH;
1074
+            $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, '');
1075
+            $y1 = $y + 16 + $bH;
1076 1076
             $texto = 'www.nfe.fazenda.gov.br/portal ou no site da Sefaz Autorizadora';
1077 1077
             $this->pdf->textBox(
1078
-                $x+2,
1078
+                $x + 2,
1079 1079
                 $y1,
1080
-                $w-2,
1080
+                $w - 2,
1081 1081
                 $h,
1082 1082
                 $texto,
1083 1083
                 $aFont,
@@ -1093,7 +1093,7 @@  discard block
 block discarded – undo
1093 1093
         //natureza da operação
1094 1094
         $texto = 'NATUREZA DA OPERAÇÃO';
1095 1095
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1096
-        $w = $w1+$w2;
1096
+        $w = $w1 + $w2;
1097 1097
         $y = $oldY;
1098 1098
         $oldY += $h;
1099 1099
         $x = $oldX;
@@ -1126,7 +1126,7 @@  discard block
 block discarded – undo
1126 1126
                 $cStat = '';
1127 1127
             } else {
1128 1128
                 if (isset($this->nfeProc)) {
1129
-                    $texto = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1129
+                    $texto = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue)
1130 1130
                     ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue
1131 1131
                     : '';
1132 1132
                     $tsHora = $this->toTimestamp(
@@ -1168,25 +1168,25 @@  discard block
 block discarded – undo
1168 1168
         $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.';
1169 1169
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1170 1170
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1171
-        $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1171
+        $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue)
1172 1172
         ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue
1173 1173
         : '';
1174 1174
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
1175 1175
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1176 1176
         //CNPJ
1177 1177
         $x += $w;
1178
-        $w = ($maxW-(3 * $w));
1178
+        $w = ($maxW - (3 * $w));
1179 1179
         $texto = 'CNPJ';
1180 1180
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1181 1181
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1182 1182
         //Pegando valor do CPF/CNPJ
1183
-        if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1183
+        if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1184 1184
             $texto = $this->formatField(
1185 1185
                 $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1186 1186
                 "###.###.###/####-##"
1187 1187
             );
1188 1188
         } else {
1189
-            $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1189
+            $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue)
1190 1190
             ? $this->formatField(
1191 1191
                 $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue,
1192 1192
                 "###.###.###-##"
@@ -1203,22 +1203,22 @@  discard block
 block discarded – undo
1203 1203
         $resp = $this->statusNFe();
1204 1204
         if (!$resp['status']) {
1205 1205
             $x = 10;
1206
-            $y = $this->hPrint-130;
1206
+            $y = $this->hPrint - 130;
1207 1207
             $h = 25;
1208
-            $w = $maxW-(2*$x);
1208
+            $w = $maxW - (2 * $x);
1209 1209
             $this->pdf->settextcolor(90, 90, 90);
1210 1210
             $texto = $resp['message'];
1211 1211
             $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
1212 1212
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
1213 1213
             $y += $h;
1214 1214
             $h = 5;
1215
-            $w = $maxW-(2*$x);
1215
+            $w = $maxW - (2 * $x);
1216 1216
             if (isset($this->infProt) && $resp['status']) {
1217 1217
                 $xMotivo = $this->infProt->getElementsByTagName("xMotivo")->item(0)->nodeValue;
1218 1218
             } else {
1219 1219
                 $xMotivo = '';
1220 1220
             }
1221
-            $texto = "SEM VALOR FISCAL\n".$xMotivo;
1221
+            $texto = "SEM VALOR FISCAL\n" . $xMotivo;
1222 1222
             $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
1223 1223
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
1224 1224
             $this->pdf->settextcolor(0, 0, 0);
@@ -1241,12 +1241,12 @@  discard block
 block discarded – undo
1241 1241
         if ($this->notaDpec() || $this->tpEmis == 4) {
1242 1242
             //DPEC
1243 1243
             $x = 10;
1244
-            $y = $this->hPrint-130;
1244
+            $y = $this->hPrint - 130;
1245 1245
             $h = 25;
1246
-            $w = $maxW-(2*$x);
1246
+            $w = $maxW - (2 * $x);
1247 1247
             $this->pdf->SetTextColor(200, 200, 200);
1248
-            $texto = "DANFE impresso em contingência -\n".
1249
-                     "DPEC regularmente recebido pela Receita\n".
1248
+            $texto = "DANFE impresso em contingência -\n" .
1249
+                     "DPEC regularmente recebido pela Receita\n" .
1250 1250
                      "Federal do Brasil";
1251 1251
             $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'];
1252 1252
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, '');
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
1366 1366
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1367 1367
         //NOME / RAZÃO SOCIAL
1368
-        $w = round($maxW*0.61, 0);
1368
+        $w = round($maxW * 0.61, 0);
1369 1369
         $w1 = $w;
1370 1370
         $y += 3;
1371 1371
         $texto = 'NOME / RAZÃO SOCIAL';
@@ -1380,19 +1380,19 @@  discard block
 block discarded – undo
1380 1380
         }
1381 1381
         //CNPJ / CPF
1382 1382
         $x += $w;
1383
-        $w = round($maxW*0.23, 0);
1383
+        $w = round($maxW * 0.23, 0);
1384 1384
         $w2 = $w;
1385 1385
         $texto = 'CNPJ / CPF';
1386 1386
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1387 1387
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1388 1388
         //Pegando valor do CPF/CNPJ
1389
-        if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1389
+        if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1390 1390
             $texto = $this->formatField(
1391 1391
                 $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1392 1392
                 "###.###.###/####-##"
1393 1393
             );
1394 1394
         } else {
1395
-            $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1395
+            $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue)
1396 1396
             ? $this->formatField(
1397 1397
                 $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue,
1398 1398
                 "###.###.###-##"
@@ -1403,16 +1403,16 @@  discard block
 block discarded – undo
1403 1403
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1404 1404
         //DATA DA EMISSÃO
1405 1405
         $x += $w;
1406
-        $w = $maxW-($w1+$w2);
1406
+        $w = $maxW - ($w1 + $w2);
1407 1407
         $wx = $w;
1408 1408
         $texto = 'DATA DA EMISSÃO';
1409 1409
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1410 1410
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1411
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1411
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue)
1412 1412
         ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue
1413 1413
         : '';
1414 1414
         if ($dEmi == '') {
1415
-            $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1415
+            $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue)
1416 1416
             ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue
1417 1417
             : '';
1418 1418
             $aDemi = explode('T', $dEmi);
@@ -1426,7 +1426,7 @@  discard block
 block discarded – undo
1426 1426
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, '');
1427 1427
         }
1428 1428
         //ENDEREÇO
1429
-        $w = round($maxW*0.47, 0);
1429
+        $w = round($maxW * 0.47, 0);
1430 1430
         $w1 = $w;
1431 1431
         $y += $h;
1432 1432
         $x = $oldX;
@@ -1441,7 +1441,7 @@  discard block
 block discarded – undo
1441 1441
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1442 1442
         //BAIRRO / DISTRITO
1443 1443
         $x += $w;
1444
-        $w = round($maxW*0.21, 0);
1444
+        $w = round($maxW * 0.21, 0);
1445 1445
         $w2 = $w;
1446 1446
         $texto = 'BAIRRO / DISTRITO';
1447 1447
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
@@ -1451,12 +1451,12 @@  discard block
 block discarded – undo
1451 1451
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1452 1452
         //CEP
1453 1453
         $x += $w;
1454
-        $w = $maxW-$w1-$w2-$wx;
1454
+        $w = $maxW - $w1 - $w2 - $wx;
1455 1455
         $w2 = $w;
1456 1456
         $texto = 'CEP';
1457 1457
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1458 1458
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1459
-        $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1459
+        $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue)
1460 1460
         ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue
1461 1461
         : '';
1462 1462
         $texto = $this->formatField($texto, "#####-###");
@@ -1468,11 +1468,11 @@  discard block
 block discarded – undo
1468 1468
         $texto = 'DATA DA SAÍDA/ENTRADA';
1469 1469
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1470 1470
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1471
-        $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1471
+        $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue)
1472 1472
             ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue
1473 1473
             : '';
1474 1474
         if ($dSaiEnt == '') {
1475
-            $dSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1475
+            $dSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1476 1476
                 ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1477 1477
                 : '';
1478 1478
             $aDsaient = explode('T', $dSaiEnt);
@@ -1492,7 +1492,7 @@  discard block
 block discarded – undo
1492 1492
         if (strtoupper(trim($texto)) == "EXTERIOR"
1493 1493
             && $this->dest->getElementsByTagName("xPais")->length > 0
1494 1494
         ) {
1495
-            $texto .= " - " .  $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue;
1495
+            $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue;
1496 1496
         }
1497 1497
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
1498 1498
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
@@ -1507,19 +1507,19 @@  discard block
 block discarded – undo
1507 1507
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1508 1508
         //FONE / FAX
1509 1509
         $x += $w;
1510
-        $w = round(($maxW -$w1-$wx-8)/2, 0);
1510
+        $w = round(($maxW - $w1 - $wx - 8) / 2, 0);
1511 1511
         $w3 = $w;
1512 1512
         $texto = 'FONE / FAX';
1513 1513
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1514 1514
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1515
-        $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1515
+        $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue)
1516 1516
         ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue
1517 1517
         : '';
1518 1518
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
1519 1519
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1520 1520
         //INSCRIÇÃO ESTADUAL
1521 1521
         $x += $w;
1522
-        $w = $maxW -$w1-$wx-8-$w3;
1522
+        $w = $maxW - $w1 - $wx - 8 - $w3;
1523 1523
         $texto = 'INSCRIÇÃO ESTADUAL';
1524 1524
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1525 1525
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -1533,11 +1533,11 @@  discard block
 block discarded – undo
1533 1533
         $texto = 'HORA DA SAÍDA/ENTRADA';
1534 1534
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1535 1535
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1536
-        $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1536
+        $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue)
1537 1537
         ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue
1538 1538
         : '';
1539 1539
         if ($hSaiEnt == '') {
1540
-            $dhSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1540
+            $dhSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue)
1541 1541
             ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue
1542 1542
             : '';
1543 1543
             $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt);
@@ -1576,7 +1576,7 @@  discard block
 block discarded – undo
1576 1576
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
1577 1577
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1578 1578
         //NOME / RAZÃO SOCIAL
1579
-        $w = round($maxW*0.61, 0);
1579
+        $w = round($maxW * 0.61, 0);
1580 1580
         $w1 = $w;
1581 1581
         $y += 3;
1582 1582
         $texto = 'NOME / RAZÃO SOCIAL';
@@ -1594,19 +1594,19 @@  discard block
 block discarded – undo
1594 1594
         }
1595 1595
         //CNPJ / CPF
1596 1596
         $x += $w;
1597
-        $w = round($maxW*0.23, 0);
1597
+        $w = round($maxW * 0.23, 0);
1598 1598
         $w2 = $w;
1599 1599
         $texto = 'CNPJ / CPF';
1600 1600
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1601 1601
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1602 1602
         //Pegando valor do CPF/CNPJ
1603
-        if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1603
+        if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1604 1604
             $texto = $this->formatField(
1605 1605
                 $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1606 1606
                 "###.###.###/####-##"
1607 1607
             );
1608 1608
         } else {
1609
-            $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1609
+            $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1610 1610
                     $this->formatField(
1611 1611
                         $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue,
1612 1612
                         "###.###.###-##"
@@ -1616,7 +1616,7 @@  discard block
 block discarded – undo
1616 1616
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1617 1617
         //INSCRIÇÃO ESTADUAL
1618 1618
         $x += $w;
1619
-        $w = $maxW-($w1+$w2);
1619
+        $w = $maxW - ($w1 + $w2);
1620 1620
         $wx = $w;
1621 1621
         $texto = 'INSCRIÇÃO ESTADUAL';
1622 1622
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
@@ -1632,7 +1632,7 @@  discard block
 block discarded – undo
1632 1632
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, '');
1633 1633
         }
1634 1634
         //ENDEREÇO
1635
-        $w = round($maxW*0.355, 0) + $wx;
1635
+        $w = round($maxW * 0.355, 0) + $wx;
1636 1636
         $w1 = $w;
1637 1637
         $y += $h;
1638 1638
         $x = $oldX;
@@ -1646,7 +1646,7 @@  discard block
 block discarded – undo
1646 1646
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1647 1647
         //BAIRRO / DISTRITO
1648 1648
         $x += $w;
1649
-        $w = round($maxW*0.335, 0);
1649
+        $w = round($maxW * 0.335, 0);
1650 1650
         $w2 = $w;
1651 1651
         $texto = 'BAIRRO / DISTRITO';
1652 1652
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
@@ -1656,17 +1656,17 @@  discard block
 block discarded – undo
1656 1656
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1657 1657
         //CEP
1658 1658
         $x += $w;
1659
-        $w = $maxW-($w1+$w2);
1659
+        $w = $maxW - ($w1 + $w2);
1660 1660
         $texto = 'CEP';
1661 1661
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1662 1662
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1663
-        $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1663
+        $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1664 1664
                 $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1665 1665
         $texto = $this->formatField($texto, "#####-###");
1666 1666
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1667 1667
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1668 1668
         //MUNICÍPIO
1669
-        $w = round($maxW*0.805, 0);
1669
+        $w = round($maxW * 0.805, 0);
1670 1670
         $w1 = $w;
1671 1671
         $y += $h;
1672 1672
         $x = $oldX;
@@ -1675,7 +1675,7 @@  discard block
 block discarded – undo
1675 1675
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1676 1676
         $texto = $this->entrega->getElementsByTagName("xMun")->item(0)->nodeValue;
1677 1677
         if (strtoupper(trim($texto)) == "EXTERIOR" && $this->entrega->getElementsByTagName("xPais")->length > 0) {
1678
-            $texto .= " - " .  $this->entrega->getElementsByTagName("xPais")->item(0)->nodeValue;
1678
+            $texto .= " - " . $this->entrega->getElementsByTagName("xPais")->item(0)->nodeValue;
1679 1679
         }
1680 1680
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1681 1681
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
@@ -1690,11 +1690,11 @@  discard block
 block discarded – undo
1690 1690
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1691 1691
         //FONE / FAX
1692 1692
         $x += $w;
1693
-        $w = $maxW-$w-$w1;
1693
+        $w = $maxW - $w - $w1;
1694 1694
         $texto = 'FONE / FAX';
1695 1695
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1696 1696
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1697
-        $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1697
+        $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ?
1698 1698
                 $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : '';
1699 1699
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1700 1700
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1726,7 +1726,7 @@  discard block
 block discarded – undo
1726 1726
         $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B');
1727 1727
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
1728 1728
         //NOME / RAZÃO SOCIAL
1729
-        $w = round($maxW*0.61, 0);
1729
+        $w = round($maxW * 0.61, 0);
1730 1730
         $w1 = $w;
1731 1731
         $y += 3;
1732 1732
         $texto = 'NOME / RAZÃO SOCIAL';
@@ -1744,19 +1744,19 @@  discard block
 block discarded – undo
1744 1744
         }
1745 1745
         //CNPJ / CPF
1746 1746
         $x += $w;
1747
-        $w = round($maxW*0.23, 0);
1747
+        $w = round($maxW * 0.23, 0);
1748 1748
         $w2 = $w;
1749 1749
         $texto = 'CNPJ / CPF';
1750 1750
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1751 1751
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1752 1752
         //Pegando valor do CPF/CNPJ
1753
-        if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1753
+        if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) {
1754 1754
             $texto = $this->formatField(
1755 1755
                 $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue,
1756 1756
                 "###.###.###/####-##"
1757 1757
             );
1758 1758
         } else {
1759
-            $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1759
+            $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ?
1760 1760
                     $this->formatField(
1761 1761
                         $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue,
1762 1762
                         "###.###.###-##"
@@ -1766,7 +1766,7 @@  discard block
 block discarded – undo
1766 1766
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1767 1767
         //INSCRIÇÃO ESTADUAL
1768 1768
         $x += $w;
1769
-        $w = $maxW-($w1+$w2);
1769
+        $w = $maxW - ($w1 + $w2);
1770 1770
         $wx = $w;
1771 1771
         $texto = 'INSCRIÇÃO ESTADUAL';
1772 1772
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
@@ -1782,7 +1782,7 @@  discard block
 block discarded – undo
1782 1782
             $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, '');
1783 1783
         }
1784 1784
         //ENDEREÇO
1785
-        $w = round($maxW*0.355, 0) + $wx;
1785
+        $w = round($maxW * 0.355, 0) + $wx;
1786 1786
         $w1 = $w;
1787 1787
         $y += $h;
1788 1788
         $x = $oldX;
@@ -1796,7 +1796,7 @@  discard block
 block discarded – undo
1796 1796
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true);
1797 1797
         //BAIRRO / DISTRITO
1798 1798
         $x += $w;
1799
-        $w = round($maxW*0.335, 0);
1799
+        $w = round($maxW * 0.335, 0);
1800 1800
         $w2 = $w;
1801 1801
         $texto = 'BAIRRO / DISTRITO';
1802 1802
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
@@ -1806,17 +1806,17 @@  discard block
 block discarded – undo
1806 1806
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1807 1807
         //CEP
1808 1808
         $x += $w;
1809
-        $w = $maxW-($w1+$w2);
1809
+        $w = $maxW - ($w1 + $w2);
1810 1810
         $texto = 'CEP';
1811 1811
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1812 1812
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1813
-        $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1813
+        $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ?
1814 1814
                 $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : '';
1815 1815
         $texto = $this->formatField($texto, "#####-###");
1816 1816
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1817 1817
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1818 1818
         //MUNICÍPIO
1819
-        $w = round($maxW*0.805, 0);
1819
+        $w = round($maxW * 0.805, 0);
1820 1820
         $w1 = $w;
1821 1821
         $y += $h;
1822 1822
         $x = $oldX;
@@ -1825,7 +1825,7 @@  discard block
 block discarded – undo
1825 1825
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1826 1826
         $texto = $this->retirada->getElementsByTagName("xMun")->item(0)->nodeValue;
1827 1827
         if (strtoupper(trim($texto)) == "EXTERIOR" && $this->retirada->getElementsByTagName("xPais")->length > 0) {
1828
-            $texto .= " - " .  $this->retirada->getElementsByTagName("xPais")->item(0)->nodeValue;
1828
+            $texto .= " - " . $this->retirada->getElementsByTagName("xPais")->item(0)->nodeValue;
1829 1829
         }
1830 1830
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1831 1831
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
@@ -1840,11 +1840,11 @@  discard block
 block discarded – undo
1840 1840
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
1841 1841
         //FONE / FAX
1842 1842
         $x += $w;
1843
-        $w = $maxW-$w-$w1;
1843
+        $w = $maxW - $w - $w1;
1844 1844
         $texto = 'FONE / FAX';
1845 1845
         $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'');
1846 1846
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
1847
-        $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1847
+        $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ?
1848 1848
                 $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : '';
1849 1849
         $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B');
1850 1850
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -1917,7 +1917,7 @@  discard block
 block discarded – undo
1917 1917
     protected function fatura($x, $y)
1918 1918
     {
1919 1919
         $linha = 1;
1920
-        $h = 8+3;
1920
+        $h = 8 + 3;
1921 1921
         $oldx = $x;
1922 1922
         $textoFatura = $this->getTextoFatura();
1923 1923
         //verificar se existem duplicatas
@@ -1950,29 +1950,29 @@  discard block
 block discarded – undo
1950 1950
                 return ($y + $h - 3);
1951 1951
             }
1952 1952
             if ($textoFatura !== "" && $this->exibirTextoFatura) {
1953
-                $myH=6;
1953
+                $myH = 6;
1954 1954
                 $myW = $this->wPrint;
1955 1955
                 if ($this->orientacao == 'L') {
1956 1956
                     $myW -= $this->wCanhoto;
1957 1957
                 }
1958 1958
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>''];
1959 1959
                 $this->pdf->textBox($x, $y, $myW, $myH, $textoFatura, $aFont, 'C', 'L', 1, '');
1960
-                $y+=$myH+1;
1960
+                $y += $myH + 1;
1961 1961
             }
1962 1962
             if ($this->orientacao == 'P') {
1963
-                $w = round($this->wPrint/7.018, 0)-1;
1963
+                $w = round($this->wPrint / 7.018, 0) - 1;
1964 1964
             } else {
1965 1965
                 $w = 28;
1966 1966
             }
1967 1967
             $increm = 1;
1968 1968
             foreach ($this->dup as $k => $d) {
1969
-                $nDup = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1969
+                $nDup = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue)
1970 1970
                 ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue
1971 1971
                 : '';
1972
-                $dDup = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1972
+                $dDup = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1973 1973
                 ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue)
1974 1974
                 : '';
1975
-                $vDup = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1975
+                $vDup = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue)
1976 1976
                 ? 'R$ ' . number_format(
1977 1977
                     $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue,
1978 1978
                     2,
@@ -1982,14 +1982,14 @@  discard block
 block discarded – undo
1982 1982
                 : '';
1983 1983
                 $h = 8;
1984 1984
                 $texto = '';
1985
-                if ($nDup!='0' && $nDup!='') {
1985
+                if ($nDup != '0' && $nDup != '') {
1986 1986
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1987 1987
                     $this->pdf->textBox($x, $y, $w, $h, 'Num.', $aFont, 'T', 'L', 1, '');
1988 1988
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
1989 1989
                     $this->pdf->textBox($x, $y, $w, $h, $nDup, $aFont, 'T', 'R', 0, '');
1990 1990
                 } else {
1991 1991
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1992
-                    $this->pdf->textBox($x, $y, $w, $h, ($dupcont+1)."", $aFont, 'T', 'L', 1, '');
1992
+                    $this->pdf->textBox($x, $y, $w, $h, ($dupcont + 1) . "", $aFont, 'T', 'L', 1, '');
1993 1993
                 }
1994 1994
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
1995 1995
                 $this->pdf->textBox($x, $y, $w, $h, 'Venc.', $aFont, 'C', 'L', 0, '');
@@ -1999,7 +1999,7 @@  discard block
 block discarded – undo
1999 1999
                 $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, '');
2000 2000
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
2001 2001
                 $this->pdf->textBox($x, $y, $w, $h, $vDup, $aFont, 'B', 'R', 0, '');
2002
-                $x += $w+$increm;
2002
+                $x += $w + $increm;
2003 2003
                 $dupcont += 1;
2004 2004
                 if ($this->orientacao == 'P') {
2005 2005
                     $maxDupCont = 6;
@@ -2021,10 +2021,10 @@  discard block
 block discarded – undo
2021 2021
                 $y -= 9;
2022 2022
                 $linha--;
2023 2023
             }
2024
-            return ($y+$h);
2024
+            return ($y + $h);
2025 2025
         } else {
2026 2026
             $linha = 0;
2027
-            return ($y-2);
2027
+            return ($y - 2);
2028 2028
         }
2029 2029
     }
2030 2030
 
@@ -2040,7 +2040,7 @@  discard block
 block discarded – undo
2040 2040
     protected function pagamento($x, $y)
2041 2041
     {
2042 2042
         $linha = 1;
2043
-        $h = 8+3;
2043
+        $h = 8 + 3;
2044 2044
         $oldx = $x;
2045 2045
         //verificar se existem cobranças definidas
2046 2046
         if (isset($this->detPag) && $this->detPag->length > 0) {
@@ -2059,7 +2059,7 @@  discard block
 block discarded – undo
2059 2059
             $dups = "";
2060 2060
             $dupcont = 0;
2061 2061
             if ($this->orientacao == 'P') {
2062
-                $w = round($this->wPrint/7.018, 0)-1;
2062
+                $w = round($this->wPrint / 7.018, 0) - 1;
2063 2063
             } else {
2064 2064
                 $w = 28;
2065 2065
             }
@@ -2069,17 +2069,17 @@  discard block
 block discarded – undo
2069 2069
                 $maxDupCont = 8;
2070 2070
             }
2071 2071
             $increm = 1;
2072
-            $formaPagamento = ['01'=>'Dinheiro','02'=>'Cheque','03'=>'Cartão de Crédito',
2073
-                                    '04'=>'Cartão de Débito','05'=>'Crédito Loja','10'=>'Vale Alimentação',
2074
-                                    '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível',
2075
-                                    '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros'];
2076
-            $bandeira = ['01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners',
2077
-                              '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'];
2072
+            $formaPagamento = ['01'=>'Dinheiro', '02'=>'Cheque', '03'=>'Cartão de Crédito',
2073
+                                    '04'=>'Cartão de Débito', '05'=>'Crédito Loja', '10'=>'Vale Alimentação',
2074
+                                    '11'=>'Vale Refeição', '12'=>'Vale Presente', '13'=>'Vale Combustível',
2075
+                                    '14'=>'Duplicata Mercantil', '15'=>'Boleto', '90'=>'Sem pagamento', '99'=>'Outros'];
2076
+            $bandeira = ['01'=>'Visa', '02'=>'Mastercard', '03'=>'American', '04'=>'Sorocred', '05'=>'Diners',
2077
+                              '06'=>'Elo', '07'=>'Hipercard', '08'=>'Aura', '09'=>'Cabal', '99'=>'Outros'];
2078 2078
             foreach ($this->detPag as $k => $d) {
2079 2079
                 $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue)
2080 2080
                 ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue
2081 2081
                 : '0';
2082
-                $vPag = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2082
+                $vPag = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue)
2083 2083
                 ? 'R$ ' . number_format(
2084 2084
                     $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue,
2085 2085
                     2,
@@ -2091,7 +2091,7 @@  discard block
 block discarded – undo
2091 2091
                 $texto = '';
2092 2092
                 if (isset($formaPagamento[$fPag])) {
2093 2093
                     /*Exibir Item sem pagamento ou outros?*/
2094
-                    if ($fPag=='90' || $fPag=='99') {
2094
+                    if ($fPag == '90' || $fPag == '99') {
2095 2095
                         continue;
2096 2096
                     }
2097 2097
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
@@ -2100,16 +2100,16 @@  discard block
 block discarded – undo
2100 2100
                     $this->pdf->textBox($x, $y, $w, $h, $formaPagamento[$fPag], $aFont, 'T', 'R', 0, '');
2101 2101
                 } else {
2102 2102
                     $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
2103
-                    $this->pdf->textBox($x, $y, $w, $h, "Forma ".$fPag." não encontrado", $aFont, 'T', 'L', 1, '');
2103
+                    $this->pdf->textBox($x, $y, $w, $h, "Forma " . $fPag . " não encontrado", $aFont, 'T', 'L', 1, '');
2104 2104
                 }
2105 2105
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2106 2106
                 $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, '');
2107 2107
                 $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
2108 2108
                 $this->pdf->textBox($x, $y, $w, $h, $vPag, $aFont, 'B', 'R', 0, '');
2109
-                $x += $w+$increm;
2109
+                $x += $w + $increm;
2110 2110
                 $dupcont += 1;
2111 2111
 
2112
-                if ($dupcont>$maxDupCont) {
2112
+                if ($dupcont > $maxDupCont) {
2113 2113
                     $y += 9;
2114 2114
                     $x = $oldx;
2115 2115
                     $dupcont = 0;
@@ -2124,10 +2124,10 @@  discard block
 block discarded – undo
2124 2124
                 $y -= 9;
2125 2125
                 $linha--;
2126 2126
             }
2127
-            return ($y+$h);
2127
+            return ($y + $h);
2128 2128
         } else {
2129 2129
             $linha = 0;
2130
-            return ($y-2);
2130
+            return ($y - 2);
2131 2131
         }
2132 2132
     } //fim da função pagamento
2133 2133
     
@@ -2239,7 +2239,7 @@  discard block
 block discarded – undo
2239 2239
         }
2240 2240
         $x = $this->impostoHelper($x, $y, $w, $h, "V. TOTAL DA NOTA", "vNF");
2241 2241
 
2242
-        return ($y+$h);
2242
+        return ($y + $h);
2243 2243
     } //fim imposto
2244 2244
 
2245 2245
     /**
@@ -2267,13 +2267,13 @@  discard block
 block discarded – undo
2267 2267
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
2268 2268
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
2269 2269
         //NOME / RAZÃO SOCIAL
2270
-        $w1 = $maxW*0.29;
2270
+        $w1 = $maxW * 0.29;
2271 2271
         $y += 3;
2272 2272
         $texto = 'NOME / RAZÃO SOCIAL';
2273 2273
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2274 2274
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2275 2275
         if (isset($this->transporta)) {
2276
-            $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2276
+            $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue)
2277 2277
             ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue
2278 2278
             : '';
2279 2279
         } else {
@@ -2283,11 +2283,11 @@  discard block
 block discarded – undo
2283 2283
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2284 2284
         //FRETE POR CONTA
2285 2285
         $x += $w1;
2286
-        $w2 = $maxW*0.15;
2286
+        $w2 = $maxW * 0.15;
2287 2287
         $texto = 'FRETE';
2288 2288
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2289 2289
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2290
-        $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2290
+        $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue)
2291 2291
         ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue
2292 2292
         : '0';
2293 2293
         switch ($tipoFrete) {
@@ -2318,7 +2318,7 @@  discard block
 block discarded – undo
2318 2318
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2319 2319
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2320 2320
         if (isset($this->veicTransp)) {
2321
-            $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2321
+            $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue)
2322 2322
             ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue
2323 2323
             : '';
2324 2324
         } else {
@@ -2332,11 +2332,11 @@  discard block
 block discarded – undo
2332 2332
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2333 2333
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2334 2334
         if (isset($this->veicTransp)) {
2335
-            $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2335
+            $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue)
2336 2336
             ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue
2337 2337
             : '';
2338 2338
         } elseif (isset($this->reboque)) {
2339
-            $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2339
+            $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue)
2340 2340
             ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue
2341 2341
             : '';
2342 2342
         } else {
@@ -2346,16 +2346,16 @@  discard block
 block discarded – undo
2346 2346
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2347 2347
         //UF
2348 2348
         $x += $w2;
2349
-        $w3 = round($maxW*0.04, 0);
2349
+        $w3 = round($maxW * 0.04, 0);
2350 2350
         $texto = 'UF';
2351 2351
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2352 2352
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2353 2353
         if (isset($this->veicTransp)) {
2354
-            $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2354
+            $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue)
2355 2355
             ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue
2356 2356
             : '';
2357 2357
         } elseif (isset($this->reboque)) {
2358
-            $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2358
+            $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue)
2359 2359
             ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue
2360 2360
             : '';
2361 2361
         } else {
@@ -2365,19 +2365,19 @@  discard block
 block discarded – undo
2365 2365
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2366 2366
         //CNPJ / CPF
2367 2367
         $x += $w3;
2368
-        $w = $maxW-($w1+3*$w2+$w3);
2368
+        $w = $maxW - ($w1 + 3 * $w2 + $w3);
2369 2369
         $texto = 'CNPJ / CPF';
2370 2370
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2371 2371
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2372 2372
         if (isset($this->transporta)) {
2373
-            $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2373
+            $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue)
2374 2374
             ? $this->formatField(
2375 2375
                 $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue,
2376 2376
                 "##.###.###/####-##"
2377 2377
             )
2378 2378
             : '';
2379 2379
             if ($texto == '') {
2380
-                $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2380
+                $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue)
2381 2381
                 ? $this->formatField(
2382 2382
                     $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue,
2383 2383
                     "###.###.###-##"
@@ -2394,12 +2394,12 @@  discard block
 block discarded – undo
2394 2394
         $y += $h;
2395 2395
         $x = $oldX;
2396 2396
         $h = 7;
2397
-        $w1 = $maxW*0.44;
2397
+        $w1 = $maxW * 0.44;
2398 2398
         $texto = 'ENDEREÇO';
2399 2399
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2400 2400
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
2401 2401
         if (isset($this->transporta)) {
2402
-            $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2402
+            $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue)
2403 2403
                 ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue
2404 2404
                 : '';
2405 2405
         } else {
@@ -2409,12 +2409,12 @@  discard block
 block discarded – undo
2409 2409
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, '');
2410 2410
         //MUNICÍPIO
2411 2411
         $x += $w1;
2412
-        $w2 = round($maxW*0.30, 0);
2412
+        $w2 = round($maxW * 0.30, 0);
2413 2413
         $texto = 'MUNICÍPIO';
2414 2414
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2415 2415
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2416 2416
         if (isset($this->transporta)) {
2417
-            $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2417
+            $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue)
2418 2418
                 ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue
2419 2419
                 : '';
2420 2420
         } else {
@@ -2424,12 +2424,12 @@  discard block
 block discarded – undo
2424 2424
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2425 2425
         //UF
2426 2426
         $x += $w2;
2427
-        $w3 = round($maxW*0.04, 0);
2427
+        $w3 = round($maxW * 0.04, 0);
2428 2428
         $texto = 'UF';
2429 2429
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2430 2430
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
2431 2431
         if (isset($this->transporta)) {
2432
-            $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2432
+            $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue)
2433 2433
                 ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue
2434 2434
                 : '';
2435 2435
         } else {
@@ -2439,13 +2439,13 @@  discard block
 block discarded – undo
2439 2439
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, '');
2440 2440
         //INSCRIÇÃO ESTADUAL
2441 2441
         $x += $w3;
2442
-        $w = $maxW-($w1+$w2+$w3);
2442
+        $w = $maxW - ($w1 + $w2 + $w3);
2443 2443
         $texto = 'INSCRIÇÃO ESTADUAL';
2444 2444
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2445 2445
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
2446 2446
         $texto = '';
2447 2447
         if (isset($this->transporta)) {
2448
-            if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2448
+            if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) {
2449 2449
                 $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue;
2450 2450
             }
2451 2451
         }
@@ -2458,16 +2458,16 @@  discard block
 block discarded – undo
2458 2458
         $marca = '';
2459 2459
         $numero = '';
2460 2460
         $texto = '';
2461
-        $pesoBruto=0;
2462
-        $pesoLiquido=0;
2461
+        $pesoBruto = 0;
2462
+        $pesoLiquido = 0;
2463 2463
         foreach ($volumes as $volume) {
2464
-            $quantidade += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2464
+            $quantidade += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ?
2465 2465
                     $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0;
2466
-            $pesoBruto += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2466
+            $pesoBruto += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ?
2467 2467
                     $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0;
2468
-            $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2468
+            $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ?
2469 2469
                     $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0;
2470
-            $texto = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2470
+            $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ?
2471 2471
                     $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : '';
2472 2472
             if ($texto != $especie && $especie != '') {
2473 2473
                 //tem várias especies
@@ -2475,7 +2475,7 @@  discard block
 block discarded – undo
2475 2475
             } else {
2476 2476
                 $especie = $texto;
2477 2477
             }
2478
-            $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2478
+            $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue)
2479 2479
                 ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue
2480 2480
                 : '';
2481 2481
             if ($texto != $marca && $marca != '') {
@@ -2484,7 +2484,7 @@  discard block
 block discarded – undo
2484 2484
             } else {
2485 2485
                 $marca = $texto;
2486 2486
             }
2487
-            $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2487
+            $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue)
2488 2488
                 ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue
2489 2489
                 : '';
2490 2490
             if ($texto != $numero && $numero != '') {
@@ -2500,7 +2500,7 @@  discard block
 block discarded – undo
2500 2500
         $y += $h;
2501 2501
         $x = $oldX;
2502 2502
         $h = 7;
2503
-        $w1 = round($maxW*0.10, 0);
2503
+        $w1 = round($maxW * 0.10, 0);
2504 2504
         $texto = 'QUANTIDADE';
2505 2505
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2506 2506
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2511,7 +2511,7 @@  discard block
 block discarded – undo
2511 2511
         }
2512 2512
         //ESPÉCIE
2513 2513
         $x += $w1;
2514
-        $w2 = round($maxW*0.17, 0);
2514
+        $w2 = round($maxW * 0.17, 0);
2515 2515
         $texto = 'ESPÉCIE';
2516 2516
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2517 2517
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2523,7 +2523,7 @@  discard block
 block discarded – undo
2523 2523
         $texto = 'MARCA';
2524 2524
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2525 2525
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, '');
2526
-        $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2526
+        $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ?
2527 2527
                 $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : '';
2528 2528
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
2529 2529
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
@@ -2537,7 +2537,7 @@  discard block
 block discarded – undo
2537 2537
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, '');
2538 2538
         //PESO BRUTO
2539 2539
         $x += $w2;
2540
-        $w3 = round($maxW*0.20, 0);
2540
+        $w3 = round($maxW * 0.20, 0);
2541 2541
         $texto = 'PESO BRUTO';
2542 2542
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2543 2543
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2550,7 +2550,7 @@  discard block
 block discarded – undo
2550 2550
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, '');
2551 2551
         //PESO LÍQUIDO
2552 2552
         $x += $w3;
2553
-        $w = $maxW -($w1+3*$w2+$w3);
2553
+        $w = $maxW - ($w1 + 3 * $w2 + $w3);
2554 2554
         $texto = 'PESO LÍQUIDO';
2555 2555
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2556 2556
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -2561,7 +2561,7 @@  discard block
 block discarded – undo
2561 2561
         }
2562 2562
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
2563 2563
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
2564
-        return ($y+$h);
2564
+        return ($y + $h);
2565 2565
     } //fim transporte
2566 2566
 
2567 2567
 
@@ -2573,7 +2573,7 @@  discard block
 block discarded – undo
2573 2573
             return "";
2574 2574
         }
2575 2575
         $valor_original = $valor_original->nodeValue;
2576
-        $valor = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2576
+        $valor = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : '';
2577 2577
 
2578 2578
         if ($valor != "") {
2579 2579
             return sprintf($formato, $valor);
@@ -2620,18 +2620,18 @@  discard block
 block discarded – undo
2620 2620
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s");
2621 2621
             $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s");
2622 2622
         }
2623
-        $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2623
+        $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue)
2624 2624
         ? substr(
2625 2625
             $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue),
2626 2626
             0,
2627 2627
             500
2628 2628
         )
2629 2629
         : '';
2630
-        if (! empty($infAdProd)) {
2630
+        if (!empty($infAdProd)) {
2631 2631
             $infAdProd = trim($infAdProd);
2632 2632
             $infAdProd .= ' ';
2633 2633
         }
2634
-        $loteTxt ='';
2634
+        $loteTxt = '';
2635 2635
         $rastro = $prod->getElementsByTagName("med");
2636 2636
         if (!empty($prod->getElementsByTagName("rastro"))) {
2637 2637
             $rastro = $prod->getElementsByTagName("rastro");
@@ -2645,15 +2645,15 @@  discard block
 block discarded – undo
2645 2645
                 $i++;
2646 2646
             }
2647 2647
             if ($loteTxt != '') {
2648
-                $loteTxt.= ' ';
2648
+                $loteTxt .= ' ';
2649 2649
             }
2650 2650
         }
2651 2651
         //NT2013.006 FCI
2652
-        $nFCI = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2653
-                ' FCI:'.$itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2654
-        $tmp_ad=$infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2652
+        $nFCI = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ?
2653
+                ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : '';
2654
+        $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : '');
2655 2655
         $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue
2656
-            . (strlen($tmp_ad)!=0?"\n    ".$tmp_ad:'');
2656
+            . (strlen($tmp_ad) != 0 ? "\n    " . $tmp_ad : '');
2657 2657
         //decodifica os caracteres html no xml
2658 2658
         $texto = html_entity_decode($texto);
2659 2659
         if ($this->descProdQuebraLinha) {
@@ -2703,111 +2703,111 @@  discard block
 block discarded – undo
2703 2703
         // cabecalho LOOP COM OS DADOS DOS PRODUTOS
2704 2704
         //CÓDIGO PRODUTO
2705 2705
         $texto = "CÓDIGO PRODUTO";
2706
-        $w1 = round($w*0.09, 0);
2706
+        $w1 = round($w * 0.09, 0);
2707 2707
         $h = 4;
2708 2708
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2709 2709
         $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2710
-        $this->pdf->line($x+$w1, $y, $x+$w1, $y+$hmax);
2710
+        $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax);
2711 2711
         //DESCRIÇÃO DO PRODUTO / SERVIÇO
2712 2712
         $x += $w1;
2713
-        $w2 = round($w*0.25, 0);
2713
+        $w2 = round($w * 0.25, 0);
2714 2714
         $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO';
2715 2715
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2716 2716
         $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2717
-        $this->pdf->line($x+$w2, $y, $x+$w2, $y+$hmax);
2717
+        $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax);
2718 2718
         //NCM/SH
2719 2719
         $x += $w2;
2720
-        $w3 = round($w*0.06, 0);
2720
+        $w3 = round($w * 0.06, 0);
2721 2721
         $texto = 'NCM/SH';
2722 2722
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2723 2723
         $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2724
-        $this->pdf->line($x+$w3, $y, $x+$w3, $y+$hmax);
2724
+        $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax);
2725 2725
         //O/CST ou O/CSOSN
2726 2726
         $x += $w3;
2727
-        $w4 = round($w*0.05, 0);
2728
-        $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2
2727
+        $w4 = round($w * 0.05, 0);
2728
+        $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 ou CRT = 2
2729 2729
         if ($this->getTagValue($this->emit, 'CRT') == '3') {
2730
-             $texto = 'O/CST';//Regime Normal
2730
+             $texto = 'O/CST'; //Regime Normal
2731 2731
         }
2732 2732
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2733 2733
         $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2734
-        $this->pdf->line($x+$w4, $y, $x+$w4, $y+$hmax);
2734
+        $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax);
2735 2735
         //CFOP
2736 2736
         $x += $w4;
2737
-        $w5 = round($w*0.04, 0);
2737
+        $w5 = round($w * 0.04, 0);
2738 2738
         $texto = 'CFOP';
2739 2739
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2740 2740
         $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2741
-        $this->pdf->line($x+$w5, $y, $x+$w5, $y+$hmax);
2741
+        $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax);
2742 2742
         //UN
2743 2743
         $x += $w5;
2744
-        $w6 = round($w*0.03, 0);
2744
+        $w6 = round($w * 0.03, 0);
2745 2745
         $texto = 'UN';
2746 2746
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2747 2747
         $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2748
-        $this->pdf->line($x+$w6, $y, $x+$w6, $y+$hmax);
2748
+        $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax);
2749 2749
         //QUANT
2750 2750
         $x += $w6;
2751
-        $w7 = round($w*0.08, 0);
2751
+        $w7 = round($w * 0.08, 0);
2752 2752
         $texto = 'QUANT';
2753 2753
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2754 2754
         $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2755
-        $this->pdf->line($x+$w7, $y, $x+$w7, $y+$hmax);
2755
+        $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax);
2756 2756
         //VALOR UNIT
2757 2757
         $x += $w7;
2758
-        $w8 = round($w*0.06, 0);
2758
+        $w8 = round($w * 0.06, 0);
2759 2759
         $texto = 'VALOR UNIT';
2760 2760
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2761 2761
         $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2762
-        $this->pdf->line($x+$w8, $y, $x+$w8, $y+$hmax);
2762
+        $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax);
2763 2763
         //VALOR TOTAL
2764 2764
         $x += $w8;
2765
-        $w9 = round($w*0.06, 0);
2765
+        $w9 = round($w * 0.06, 0);
2766 2766
         $texto = 'VALOR TOTAL';
2767 2767
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2768 2768
         $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2769
-        $this->pdf->line($x+$w9, $y, $x+$w9, $y+$hmax);
2769
+        $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax);
2770 2770
         //VALOR DESCONTO
2771 2771
         $x += $w9;
2772
-        $w10 = round($w*0.05, 0);
2772
+        $w10 = round($w * 0.05, 0);
2773 2773
         $texto = 'VALOR DESC';
2774 2774
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2775 2775
         $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2776
-        $this->pdf->line($x+$w10, $y, $x+$w10, $y+$hmax);
2776
+        $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax);
2777 2777
         //B.CÁLC ICMS
2778 2778
         $x += $w10;
2779
-        $w11 = round($w*0.06, 0);
2779
+        $w11 = round($w * 0.06, 0);
2780 2780
         $texto = 'B.CÁLC ICMS';
2781 2781
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2782 2782
         $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2783
-        $this->pdf->line($x+$w11, $y, $x+$w11, $y+$hmax);
2783
+        $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax);
2784 2784
         //VALOR ICMS
2785 2785
         $x += $w11;
2786
-        $w12 = round($w*0.06, 0);
2786
+        $w12 = round($w * 0.06, 0);
2787 2787
         $texto = 'VALOR ICMS';
2788 2788
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2789 2789
         $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2790
-        $this->pdf->line($x+$w12, $y, $x+$w12, $y+$hmax);
2790
+        $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax);
2791 2791
         //VALOR IPI
2792 2792
         $x += $w12;
2793
-        $w13 = round($w*0.05, 0);
2793
+        $w13 = round($w * 0.05, 0);
2794 2794
         $texto = 'VALOR IPI';
2795 2795
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2796 2796
         $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2797
-        $this->pdf->line($x+$w13, $y, $x+$w13, $y+$hmax);
2797
+        $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax);
2798 2798
         //ALÍQ. ICMS
2799 2799
         $x += $w13;
2800
-        $w14 = round($w*0.04, 0);
2800
+        $w14 = round($w * 0.04, 0);
2801 2801
         $texto = 'ALÍQ. ICMS';
2802 2802
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
2803 2803
         $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2804
-        $this->pdf->line($x+$w14, $y, $x+$w14, $y+$hmax);
2804
+        $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax);
2805 2805
         //ALÍQ. IPI
2806 2806
         $x += $w14;
2807
-        $w15 = $w-($w1+$w2+$w3+$w4+$w5+$w6+$w7+$w8+$w9+$w10+$w11+$w12+$w13+$w14);
2807
+        $w15 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14);
2808 2808
         $texto = 'ALÍQ. IPI';
2809 2809
         $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false);
2810
-        $this->pdf->line($oldX, $y+$h+1, $oldX + $w, $y+$h+1);
2810
+        $this->pdf->line($oldX, $y + $h + 1, $oldX + $w, $y + $h + 1);
2811 2811
         $y += 5;
2812 2812
         //##################################################################################
2813 2813
         // LOOP COM OS DADOS DOS PRODUTOS
@@ -2825,7 +2825,7 @@  discard block
 block discarded – undo
2825 2825
                 $textoProduto = trim($this->descricaoProduto($thisItem));
2826 2826
 
2827 2827
                 $linhaDescr = $this->pdf->getNumLines($textoProduto, $w2, $aFont);
2828
-                $h = round(($linhaDescr * $this->pdf->fontSize)+ ($linhaDescr * 0.5), 2);
2828
+                $h = round(($linhaDescr * $this->pdf->fontSize) + ($linhaDescr * 0.5), 2);
2829 2829
                 $hUsado += $h;
2830 2830
 
2831 2831
                 $diffH = $hmax - $hUsado;
@@ -2838,11 +2838,11 @@  discard block
 block discarded – undo
2838 2838
                         break;
2839 2839
                     }
2840 2840
                 }
2841
-                $y_linha=$y+$h;
2841
+                $y_linha = $y + $h;
2842 2842
                 // linha entre itens
2843 2843
                 $this->pdf->dashedHLine($oldX, $y_linha, $w, 0.1, 120);
2844 2844
                 //corrige o x
2845
-                $x=$oldX;
2845
+                $x = $oldX;
2846 2846
                 //codigo do produto
2847 2847
                 $texto = $prod->getElementsByTagName("cProd")->item(0)->nodeValue;
2848 2848
                 $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'C', 0, '');
@@ -2855,16 +2855,16 @@  discard block
 block discarded – undo
2855 2855
                 }
2856 2856
                 $x += $w2;
2857 2857
                 //NCM
2858
-                $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2858
+                $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ?
2859 2859
                         $prod->getElementsByTagName("NCM")->item(0)->nodeValue : '';
2860 2860
                 $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, '');
2861 2861
                 $x += $w3;
2862 2862
                 //CST
2863 2863
                 if (isset($ICMS)) {
2864
-                    $origem =  $this->getTagValue($ICMS, "orig");
2865
-                    $cst =  $this->getTagValue($ICMS, "CST");
2866
-                    $csosn =  $this->getTagValue($ICMS, "CSOSN");
2867
-                    $texto = $origem.$cst.$csosn;
2864
+                    $origem = $this->getTagValue($ICMS, "orig");
2865
+                    $cst = $this->getTagValue($ICMS, "CST");
2866
+                    $csosn = $this->getTagValue($ICMS, "CSOSN");
2867
+                    $texto = $origem . $cst . $csosn;
2868 2868
                     $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, '');
2869 2869
                 }
2870 2870
                 //CFOP
@@ -2905,7 +2905,7 @@  discard block
 block discarded – undo
2905 2905
                 //Valor da Base de calculo
2906 2906
                 $x += $w10;
2907 2907
                 if (isset($ICMS)) {
2908
-                    $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2908
+                    $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue)
2909 2909
                     ? number_format(
2910 2910
                         $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue,
2911 2911
                         2,
@@ -2918,7 +2918,7 @@  discard block
 block discarded – undo
2918 2918
                 //Valor do ICMS
2919 2919
                 $x += $w11;
2920 2920
                 if (isset($ICMS)) {
2921
-                    $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
2921
+                    $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue)
2922 2922
                     ? number_format(
2923 2923
                         $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue,
2924 2924
                         2,
@@ -2931,7 +2931,7 @@  discard block
 block discarded – undo
2931 2931
                 //Valor do IPI
2932 2932
                 $x += $w12;
2933 2933
                 if (isset($IPI)) {
2934
-                    $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
2934
+                    $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue)
2935 2935
                     ? number_format(
2936 2936
                         $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue,
2937 2937
                         2,
@@ -2946,7 +2946,7 @@  discard block
 block discarded – undo
2946 2946
                 // %ICMS
2947 2947
                 $x += $w13;
2948 2948
                 if (isset($ICMS)) {
2949
-                    $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
2949
+                    $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue)
2950 2950
                     ? number_format(
2951 2951
                         $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue,
2952 2952
                         2,
@@ -2959,7 +2959,7 @@  discard block
 block discarded – undo
2959 2959
                 //%IPI
2960 2960
                 $x += $w14;
2961 2961
                 if (isset($IPI)) {
2962
-                    $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
2962
+                    $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue)
2963 2963
                     ? number_format(
2964 2964
                         $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue,
2965 2965
                         2,
@@ -2990,7 +2990,7 @@  discard block
 block discarded – undo
2990 2990
                 $i++;
2991 2991
             }
2992 2992
         }
2993
-        return $oldY+$hmax;
2993
+        return $oldY + $hmax;
2994 2994
     }
2995 2995
 
2996 2996
 
@@ -3024,7 +3024,7 @@  discard block
 block discarded – undo
3024 3024
 
3025 3025
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
3026 3026
 
3027
-        $w1 = round($w*0.09, 0);
3027
+        $w1 = round($w * 0.09, 0);
3028 3028
 
3029 3029
         // Tabela Renavam Combustivel
3030 3030
         $renavamCombustivel = [
@@ -3119,54 +3119,54 @@  discard block
 block discarded – undo
3119 3119
 
3120 3120
         $yVeic = $y + $h;
3121 3121
         $texto = 'Chassi: ............: ' . $veiculoChassi;
3122
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3122
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3123 3123
         $yVeic += $h;
3124 3124
         $texto = 'Cor...................: ' . $veiculoCor;
3125
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3125
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3126 3126
         $yVeic += $h;
3127 3127
         $texto = 'Cilindrada........: ' . $veiculoCilindrada;
3128
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3128
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3129 3129
         $yVeic += $h;
3130 3130
         $texto = 'Cmkg...............: ' . $veiculoCmkg;
3131
-        $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3131
+        $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3132 3132
         $yVeic += $h;
3133 3133
         $texto = 'Tipo.................: ' . ($renavamTiposVeiculos[intval($veiculoTipo)] ?? $veiculoTipo);
3134
-         $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, '');
3134
+         $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, '');
3135 3135
         $yVeic = $y + $h;
3136 3136
         $xVeic = $x + 65;
3137 3137
         $texto = 'Nº Motor: .........: ' . $veiculoMotor;
3138
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3138
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3139 3139
         $yVeic += $h;
3140 3140
         $texto = 'Renavam...........: ' . $veiculoRenavam;
3141
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3141
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3142 3142
         $yVeic += $h;
3143 3143
         $texto = 'HP.....................: ' . $veiculoHp;
3144
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3144
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3145 3145
         $yVeic += $h;
3146 3146
         $texto = 'Placa.................: ' . $veiculoPlaca;
3147
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3147
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3148 3148
         $yVeic += $h;
3149 3149
         $texto = 'Tipo Pintura......: ' . ($renavamEspecie[intval($veiculoTipoPintura)] ?? $veiculoTipoPintura);
3150
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3150
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3151 3151
         $yVeic = $y + $h;
3152 3152
         $xVeic = $xVeic + 55;
3153 3153
         $texto = 'Marca / Modelo.....: ' . $veiculoMarcaModelo;
3154
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3154
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3155 3155
         $yVeic += $h;
3156 3156
         $texto = 'Especie..................: ' . ($renavamEspecie[intval($veiculoEspecie)] ?? $veiculoEspecie);
3157
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3157
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3158 3158
         $yVeic += $h;
3159 3159
         $texto = 'Combustivel..........: ' . ($renavamCombustivel[intval($veiculoCombustivel)] ?? $veiculoCombustivel);
3160
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3160
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3161 3161
         $yVeic += $h;
3162 3162
         $texto = 'Serial.....................: ' . $veiculoSerial;
3163
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3163
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3164 3164
         $yVeic += $h;
3165
-        $texto = 'Ano Fab/Mod........: '. $veiculoFabricacao . '/' . $veiculoModelo;
3166
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3165
+        $texto = 'Ano Fab/Mod........: ' . $veiculoFabricacao . '/' . $veiculoModelo;
3166
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3167 3167
         $yVeic += $h;
3168
-        $texto = 'Distancia Entre Eixos(mm)..: '. $veiculoDistancia;
3169
-        $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, '');
3168
+        $texto = 'Distancia Entre Eixos(mm)..: ' . $veiculoDistancia;
3169
+        $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, '');
3170 3170
     }
3171 3171
 
3172 3172
     /**
@@ -3190,12 +3190,12 @@  discard block
 block discarded – undo
3190 3190
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, '');
3191 3191
         //INSCRIÇÃO MUNICIPAL
3192 3192
         $y += 3;
3193
-        $w = round($this->wPrint*0.23, 0);
3193
+        $w = round($this->wPrint * 0.23, 0);
3194 3194
         $texto = 'INSCRIÇÃO MUNICIPAL';
3195 3195
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3196 3196
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3197 3197
         //inscrição municipal
3198
-        $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3198
+        $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ?
3199 3199
                 $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : '';
3200 3200
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
3201 3201
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '');
@@ -3205,7 +3205,7 @@  discard block
 block discarded – undo
3205 3205
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3206 3206
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3207 3207
         if (isset($this->ISSQNtot)) {
3208
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3208
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ?
3209 3209
                     $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : '';
3210 3210
             $texto = number_format($texto, 2, ",", ".");
3211 3211
         } else {
@@ -3219,9 +3219,9 @@  discard block
 block discarded – undo
3219 3219
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3220 3220
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3221 3221
         if (isset($this->ISSQNtot)) {
3222
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3222
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ?
3223 3223
                     $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : '';
3224
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3224
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3225 3225
         } else {
3226 3226
             $texto = '';
3227 3227
         }
@@ -3232,21 +3232,21 @@  discard block
 block discarded – undo
3232 3232
         if ($this->orientacao == 'P') {
3233 3233
             $w = $this->wPrint - (3 * $w);
3234 3234
         } else {
3235
-            $w = $this->wPrint - (3 * $w)-$this->wCanhoto;
3235
+            $w = $this->wPrint - (3 * $w) - $this->wCanhoto;
3236 3236
         }
3237 3237
         $texto = 'VALOR TOTAL DO ISSQN';
3238 3238
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3239 3239
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
3240 3240
         if (isset($this->ISSQNtot)) {
3241
-            $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3241
+            $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ?
3242 3242
                     $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : '';
3243
-            $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : '';
3243
+            $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : '';
3244 3244
         } else {
3245 3245
             $texto = '';
3246 3246
         }
3247 3247
         $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'];
3248 3248
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, '');
3249
-        return ($y+$h+1);
3249
+        return ($y + $h + 1);
3250 3250
     }
3251 3251
 
3252 3252
     /**
@@ -3267,7 +3267,7 @@  discard block
 block discarded – undo
3267 3267
         if ($this->orientacao == 'P') {
3268 3268
               $w = $this->wPrint;
3269 3269
         } else {
3270
-              $w = $this->wPrint-$this->wCanhoto;
3270
+              $w = $this->wPrint - $this->wCanhoto;
3271 3271
         }
3272 3272
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'];
3273 3273
         $this->pdf->textBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, '');
@@ -3282,8 +3282,8 @@  discard block
 block discarded – undo
3282 3282
         //$this->wAdic com a largura do campo
3283 3283
         //$this->textoAdic com o texto completo do campo
3284 3284
         $y += 1;
3285
-        $aFont = ['font'=>$this->fontePadrao, 'size'=>$this->textadicfontsize*$this->pdf->k, 'style'=>''];
3286
-        $this->pdf->textBox($x, $y+2, $w-2, $h-3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
3285
+        $aFont = ['font'=>$this->fontePadrao, 'size'=>$this->textadicfontsize * $this->pdf->k, 'style'=>''];
3286
+        $this->pdf->textBox($x, $y + 2, $w - 2, $h - 3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false);
3287 3287
         //RESERVADO AO FISCO
3288 3288
         $texto = "RESERVADO AO FISCO";
3289 3289
         if (isset($this->nfeProc) && $this->nfeProc->getElementsByTagName("xMsg")->length) {
@@ -3292,9 +3292,9 @@  discard block
 block discarded – undo
3292 3292
         $x += $w;
3293 3293
         $y -= 1;
3294 3294
         if ($this->orientacao == 'P') {
3295
-            $w = $this->wPrint-$w;
3295
+            $w = $this->wPrint - $w;
3296 3296
         } else {
3297
-            $w = $this->wPrint-$w-$this->wCanhoto;
3297
+            $w = $this->wPrint - $w - $this->wCanhoto;
3298 3298
         }
3299 3299
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'B'];
3300 3300
         $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, '');
@@ -3333,8 +3333,8 @@  discard block
 block discarded – undo
3333 3333
         }
3334 3334
         $y += 2;
3335 3335
         $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>''];
3336
-        $this->pdf->textBox($x, $y, $w-2, $h-3, $texto, $aFont, 'T', 'L', 0, '', false);
3337
-        return $y+$h;
3336
+        $this->pdf->textBox($x, $y, $w - 2, $h - 3, $texto, $aFont, 'T', 'L', 0, '', false);
3337
+        return $y + $h;
3338 3338
     }
3339 3339
 
3340 3340
     /**
@@ -3353,11 +3353,11 @@  discard block
 block discarded – undo
3353 3353
         if ($this->orientacao == 'P') {
3354 3354
               $w = $this->wPrint;
3355 3355
         } else {
3356
-              $w = $this->wPrint-$this->wCanhoto;
3356
+              $w = $this->wPrint - $this->wCanhoto;
3357 3357
               $x = $this->wCanhoto;
3358 3358
         }
3359 3359
         $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'];
3360
-        $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s')
3360
+        $texto = "Impresso em " . date('d/m/Y') . " as " . date('H:i:s')
3361 3361
             . '  ' . $this->creditos;
3362 3362
         $this->pdf->textBox($x, $y, $w, 0, $texto, $aFont, 'T', 'L', false);
3363 3363
         $texto = "Powered by NFePHP®";
@@ -3413,9 +3413,9 @@  discard block
 block discarded – undo
3413 3413
         } else {
3414 3414
             //linha separadora do canhoto - 238
3415 3415
             //posicao altura
3416
-            $y = $this->wPrint-85;
3416
+            $y = $this->wPrint - 85;
3417 3417
             //altura
3418
-            $w = $this->wPrint-85-24;
3418
+            $w = $this->wPrint - 85 - 24;
3419 3419
         }
3420 3420
         $h = 10;
3421 3421
         //desenha caixa
@@ -3438,21 +3438,21 @@  discard block
 block discarded – undo
3438 3438
             $texto .= "AO LADO";
3439 3439
         }
3440 3440
         $texto .= ". EMISSÃO: ";
3441
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3441
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3442 3442
                 $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3443 3443
         if ($dEmi == '') {
3444
-            $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3444
+            $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3445 3445
                     $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3446 3446
             $aDemi = explode('T', $dEmi);
3447 3447
             $dEmi = $aDemi[0];
3448 3448
         }
3449
-        $texto .= $this->ymdTodmy($dEmi) ." ";
3449
+        $texto .= $this->ymdTodmy($dEmi) . " ";
3450 3450
         $texto .= "VALOR TOTAL: R$ ";
3451 3451
         $texto .= number_format($this->ICMSTot->getElementsByTagName("vNF")->item(0)->nodeValue, 2, ",", ".") . " ";
3452 3452
         $texto .= "DESTINATÁRIO: ";
3453 3453
         $texto .= $destinatario;
3454 3454
         if ($this->orientacao == 'P') {
3455
-            $this->pdf->textBox($x, $y, $w-1, $h, $texto, $aFont, 'C', 'L', 0, '', false);
3455
+            $this->pdf->textBox($x, $y, $w - 1, $h, $texto, $aFont, 'C', 'L', 0, '', false);
3456 3456
             $x1 = $x + $w;
3457 3457
             $w1 = $this->wPrint - $w;
3458 3458
             $texto = "NF-e";
@@ -3465,12 +3465,12 @@  discard block
 block discarded – undo
3465 3465
             //DATA DE RECEBIMENTO
3466 3466
             $texto = "DATA DE RECEBIMENTO";
3467 3467
             $y += $h;
3468
-            $w2 = round($this->wPrint*0.17, 0); //35;
3468
+            $w2 = round($this->wPrint * 0.17, 0); //35;
3469 3469
             $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3470 3470
             $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3471 3471
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3472 3472
             $x += $w2;
3473
-            $w3 = $w-$w2;
3473
+            $w3 = $w - $w2;
3474 3474
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3475 3475
             $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
3476 3476
             $x = $oldX;
@@ -3480,7 +3480,7 @@  discard block
 block discarded – undo
3480 3480
             return $y;
3481 3481
         } else {
3482 3482
             $x--;
3483
-            $x = $this->pdf->textBox90($x, $y, $w-1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3483
+            $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false);
3484 3484
             //NUMERO DA NOTA FISCAL LOGO NFE
3485 3485
             $w1 = 18;
3486 3486
             $x1 = $oldX;
@@ -3494,14 +3494,14 @@  discard block
 block discarded – undo
3494 3494
             $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, '');
3495 3495
             //DATA DO RECEBIMENTO
3496 3496
             $texto = "DATA DO RECEBIMENTO";
3497
-            $y = $this->wPrint-85;
3497
+            $y = $this->wPrint - 85;
3498 3498
             $x = 12;
3499
-            $w2 = round($this->wPrint*0.17, 0); //35;
3499
+            $w2 = round($this->wPrint * 0.17, 0); //35;
3500 3500
             $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>''];
3501 3501
             $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, '');
3502 3502
             //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR
3503 3503
             $y -= $w2;
3504
-            $w3 = $w-$w2;
3504
+            $w3 = $w - $w2;
3505 3505
             $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR";
3506 3506
             $aFont = ['font'=>$this->fontePadrao, 'size'=>5.7, 'style'=>''];
3507 3507
             $x = $this->pdf->textBox90($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, '');
@@ -3522,13 +3522,13 @@  discard block
 block discarded – undo
3522 3522
     {
3523 3523
         $saida = "";
3524 3524
         if (isset($this->compra)) {
3525
-            if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3525
+            if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) {
3526 3526
                 $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue;
3527 3527
             }
3528
-            if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3528
+            if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) {
3529 3529
                 $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue;
3530 3530
             }
3531
-            if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3531
+            if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) {
3532 3532
                 $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue;
3533 3533
             }
3534 3534
         }
@@ -3554,21 +3554,21 @@  discard block
 block discarded – undo
3554 3554
         if ($vICMS > 0) {
3555 3555
             $vICMS = 1;
3556 3556
         }
3557
-        $icmss  = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue;
3557
+        $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue;
3558 3558
         if ($icmss > 0) {
3559 3559
             $icmss = 1;
3560 3560
         }
3561
-        $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3561
+        $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ?
3562 3562
                 $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : '';
3563 3563
         if ($dEmi == '') {
3564
-            $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3564
+            $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ?
3565 3565
                     $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : '';
3566 3566
             $aDemi = explode('T', $dEmi);
3567 3567
             $dEmi = $aDemi[0];
3568 3568
         }
3569 3569
         $dd  = $dEmi;
3570 3570
         $rpos = strrpos($dd, '-');
3571
-        $dd  = substr($dd, $rpos +1);
3571
+        $dd  = substr($dd, $rpos + 1);
3572 3572
         $chave = sprintf($forma, $cUF, $this->tpEmis, $CNPJ, $vNF, $vICMS, $icmss, $dd);
3573 3573
         $chave = $chave . $this->modulo11($chave);
3574 3574
         return $chave;
@@ -3589,7 +3589,7 @@  discard block
 block discarded – undo
3589 3589
         $formaNfRef = "\r\nNF  Ref.: série:%d numero:%d emit:%s em %s modelo: %d";
3590 3590
         $formaECFRef = "\r\nECF Ref.: modelo: %s ECF:%d COO:%d";
3591 3591
         $formaNfpRef = "\r\nNFP Ref.: série:%d número:%d emit:%s em %s modelo: %d IE:%s";
3592
-        $saida='';
3592
+        $saida = '';
3593 3593
         $nfRefs = $this->ide->getElementsByTagName('NFref');
3594 3594
         if (0 === $nfRefs->length) {
3595 3595
             return $saida;
@@ -3605,7 +3605,7 @@  discard block
 block discarded – undo
3605 3605
             foreach ($refNFe as $chave_acessoRef) {
3606 3606
                 $chave_acesso = $chave_acessoRef->nodeValue;
3607 3607
                 $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave);
3608
-                $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2);
3608
+                $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2);
3609 3609
                 $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3610 3610
                 $serie  = substr($chave_acesso, 22, 3);
3611 3611
                 $numero = substr($chave_acesso, 25, 9);
@@ -3626,7 +3626,7 @@  discard block
 block discarded – undo
3626 3626
             foreach ($refCTe as $chave_acessoRef) {
3627 3627
                 $chave_acesso = $chave_acessoRef->nodeValue;
3628 3628
                 $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave);
3629
-                $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2);
3629
+                $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2);
3630 3630
                 $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##");
3631 3631
                 $serie  = substr($chave_acesso, 22, 3);
3632 3632
                 $numero = substr($chave_acesso, 25, 9);
@@ -3642,10 +3642,9 @@  discard block
 block discarded – undo
3642 3642
             $refNFP = $nfRef->getElementsByTagName('refNFP');
3643 3643
             foreach ($refNFP as $umaRefNFe) {
3644 3644
                 $data = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue;
3645
-                $cnpj = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3646
-                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue :
3647
-                    '';
3648
-                $cpf = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3645
+                $cnpj = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ?
3646
+                    $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : '';
3647
+                $cpf = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ?
3649 3648
                         $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : '';
3650 3649
                 $mod = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue;
3651 3650
                 $serie = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue;
Please login to merge, or discard this patch.