@@ -98,6 +98,9 @@ discard block |
||
| 98 | 98 | $this->loadDoc($xml); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | + /** |
|
| 102 | + * @param string $xml |
|
| 103 | + */ |
|
| 101 | 104 | private function loadDoc($xml) |
| 102 | 105 | { |
| 103 | 106 | $this->xml = $xml; |
@@ -211,10 +214,6 @@ discard block |
||
| 211 | 214 | * A definição de margens e posições iniciais para a impressão são estabelecidas no |
| 212 | 215 | * pelo conteúdo da funçao e podem ser modificados. |
| 213 | 216 | * |
| 214 | - * @param string $orientacao (Opcional) Estabelece a orientação da |
|
| 215 | - * impressão (ex. P-retrato), se nada for fornecido será |
|
| 216 | - * usado o padrão da NFe |
|
| 217 | - * @param string $papel (Opcional) Estabelece o tamanho do papel (ex. A4) |
|
| 218 | 217 | * @return string O ID da NFe numero de 44 digitos extraido do arquivo XML |
| 219 | 218 | */ |
| 220 | 219 | protected function monta( |
@@ -441,8 +440,8 @@ discard block |
||
| 441 | 440 | * cabecalho |
| 442 | 441 | * Monta o cabelhalho da DACTE ( retrato e paisagem ) |
| 443 | 442 | * |
| 444 | - * @param number $x Posição horizontal inicial, canto esquerdo |
|
| 445 | - * @param number $y Posição vertical inicial, canto superior |
|
| 443 | + * @param integer $x Posição horizontal inicial, canto esquerdo |
|
| 444 | + * @param integer $y Posição vertical inicial, canto superior |
|
| 446 | 445 | * @param number $pag Número da Página |
| 447 | 446 | * @param number $totPag Total de páginas |
| 448 | 447 | * @return number Posição vertical final |
@@ -1096,8 +1095,7 @@ discard block |
||
| 1096 | 1095 | * rodapeDACTE |
| 1097 | 1096 | * Monta o rodape no final da DACTE ( retrato e paisagem ) |
| 1098 | 1097 | * |
| 1099 | - * @param number $xInic Posição horizontal canto esquerdo |
|
| 1100 | - * @param number $yFinal Posição vertical final para impressão |
|
| 1098 | + * @param integer $x |
|
| 1101 | 1099 | */ |
| 1102 | 1100 | protected function rodape($x, $y) |
| 1103 | 1101 | { |
@@ -1121,8 +1119,8 @@ discard block |
||
| 1121 | 1119 | * remetente |
| 1122 | 1120 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1123 | 1121 | * |
| 1124 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1125 | - * @param number $y Posição vertical canto superior |
|
| 1122 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1123 | + * @param integer $y Posição vertical canto superior |
|
| 1126 | 1124 | * @return number Posição vertical final |
| 1127 | 1125 | */ |
| 1128 | 1126 | protected function remetente($x = 0, $y = 0) |
@@ -1209,8 +1207,8 @@ discard block |
||
| 1209 | 1207 | * destinatario |
| 1210 | 1208 | * Monta o campo com os dados do destinatário na DACTE. |
| 1211 | 1209 | * |
| 1212 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1213 | - * @param number $y Posição vertical canto superior |
|
| 1210 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1211 | + * @param integer $y Posição vertical canto superior |
|
| 1214 | 1212 | * @return number Posição vertical final |
| 1215 | 1213 | */ |
| 1216 | 1214 | protected function destinatario($x = 0, $y = 0) |
@@ -1296,8 +1294,8 @@ discard block |
||
| 1296 | 1294 | * expedidor |
| 1297 | 1295 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1298 | 1296 | * |
| 1299 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1300 | - * @param number $y Posição vertical canto superior |
|
| 1297 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1298 | + * @param integer $y Posição vertical canto superior |
|
| 1301 | 1299 | * @return number Posição vertical final |
| 1302 | 1300 | */ |
| 1303 | 1301 | protected function expedidor($x = 0, $y = 0) |
@@ -1393,8 +1391,8 @@ discard block |
||
| 1393 | 1391 | * recebedor |
| 1394 | 1392 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1395 | 1393 | * |
| 1396 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1397 | - * @param number $y Posição vertical canto superior |
|
| 1394 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1395 | + * @param integer $y Posição vertical canto superior |
|
| 1398 | 1396 | * @return number Posição vertical final |
| 1399 | 1397 | */ |
| 1400 | 1398 | protected function recebedor($x = 0, $y = 0) |
@@ -1490,8 +1488,8 @@ discard block |
||
| 1490 | 1488 | * tomador |
| 1491 | 1489 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1492 | 1490 | * |
| 1493 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1494 | - * @param number $y Posição vertical canto superior |
|
| 1491 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1492 | + * @param integer $y Posição vertical canto superior |
|
| 1495 | 1493 | * @return number Posição vertical final |
| 1496 | 1494 | */ |
| 1497 | 1495 | protected function tomador($x = 0, $y = 0) |
@@ -1579,8 +1577,8 @@ discard block |
||
| 1579 | 1577 | * descricaoCarga |
| 1580 | 1578 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1581 | 1579 | * |
| 1582 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1583 | - * @param number $y Posição vertical canto superior |
|
| 1580 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1581 | + * @param integer $y Posição vertical canto superior |
|
| 1584 | 1582 | * @return number Posição vertical final |
| 1585 | 1583 | */ |
| 1586 | 1584 | protected function descricaoCarga($x = 0, $y = 0) |
@@ -1756,8 +1754,8 @@ discard block |
||
| 1756 | 1754 | * compValorServ |
| 1757 | 1755 | * Monta o campo com os componentes da prestação de serviços. |
| 1758 | 1756 | * |
| 1759 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1760 | - * @param number $y Posição vertical canto superior |
|
| 1757 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1758 | + * @param integer $y Posição vertical canto superior |
|
| 1761 | 1759 | * @return number Posição vertical final |
| 1762 | 1760 | */ |
| 1763 | 1761 | protected function compValorServ($x = 0, $y = 0) |
@@ -1855,8 +1853,8 @@ discard block |
||
| 1855 | 1853 | * impostos |
| 1856 | 1854 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1857 | 1855 | * |
| 1858 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1859 | - * @param number $y Posição vertical canto superior |
|
| 1856 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1857 | + * @param integer $y Posição vertical canto superior |
|
| 1860 | 1858 | * @return number Posição vertical final |
| 1861 | 1859 | */ |
| 1862 | 1860 | protected function impostos($x = 0, $y = 0) |
@@ -2401,8 +2399,8 @@ discard block |
||
| 2401 | 2399 | * docOrig |
| 2402 | 2400 | * Monta o campo com os documentos originarios. |
| 2403 | 2401 | * |
| 2404 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2405 | - * @param number $y Posição vertical canto superior |
|
| 2402 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2403 | + * @param integer $y Posição vertical canto superior |
|
| 2406 | 2404 | * @return number Posição vertical final |
| 2407 | 2405 | */ |
| 2408 | 2406 | protected function docOrig($x = 0, $y = 0) |
@@ -2697,8 +2695,8 @@ discard block |
||
| 2697 | 2695 | * docOrigContinuacao |
| 2698 | 2696 | * Monta o campo com os documentos originarios. |
| 2699 | 2697 | * |
| 2700 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2701 | - * @param number $y Posição vertical canto superior |
|
| 2698 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2699 | + * @param integer $y Posição vertical canto superior |
|
| 2702 | 2700 | * @return number Posição vertical final |
| 2703 | 2701 | */ |
| 2704 | 2702 | protected function docOrigContinuacao($x = 0, $y = 0) |
@@ -2818,8 +2816,8 @@ discard block |
||
| 2818 | 2816 | * docCompl |
| 2819 | 2817 | * Monta o campo com os dados do remetente na DACTE. |
| 2820 | 2818 | * |
| 2821 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2822 | - * @param number $y Posição vertical canto superior |
|
| 2819 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2820 | + * @param integer $y Posição vertical canto superior |
|
| 2823 | 2821 | * @return number Posição vertical final |
| 2824 | 2822 | */ |
| 2825 | 2823 | protected function docCompl($x = 0, $y = 0) |
@@ -2887,8 +2885,8 @@ discard block |
||
| 2887 | 2885 | * observacao |
| 2888 | 2886 | * Monta o campo com os dados do remetente na DACTE. |
| 2889 | 2887 | * |
| 2890 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2891 | - * @param number $y Posição vertical canto superior |
|
| 2888 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2889 | + * @param integer $y Posição vertical canto superior |
|
| 2892 | 2890 | * @return number Posição vertical final |
| 2893 | 2891 | */ |
| 2894 | 2892 | protected function observacao($x = 0, $y = 0) |
@@ -2930,8 +2928,8 @@ discard block |
||
| 2930 | 2928 | * modalRod |
| 2931 | 2929 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 2932 | 2930 | * |
| 2933 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2934 | - * @param number $y Posição vertical canto superior |
|
| 2931 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2932 | + * @param integer $y Posição vertical canto superior |
|
| 2935 | 2933 | * @return number Posição vertical final |
| 2936 | 2934 | */ |
| 2937 | 2935 | protected function modalRod($x = 0, $y = 0) |
@@ -2971,8 +2969,8 @@ discard block |
||
| 2971 | 2969 | * modalAereo |
| 2972 | 2970 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 2973 | 2971 | * |
| 2974 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2975 | - * @param number $y Posição vertical canto superior |
|
| 2972 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2973 | + * @param integer $y Posição vertical canto superior |
|
| 2976 | 2974 | * @return number Posição vertical final |
| 2977 | 2975 | */ |
| 2978 | 2976 | protected function modalAereo($x = 0, $y = 0) |
@@ -3028,8 +3026,8 @@ discard block |
||
| 3028 | 3026 | * modalAquaviario |
| 3029 | 3027 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 3030 | 3028 | * |
| 3031 | - * @param number $x Posição horizontal canto esquerdo |
|
| 3032 | - * @param number $y Posição vertical canto superior |
|
| 3029 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 3030 | + * @param integer $y Posição vertical canto superior |
|
| 3033 | 3031 | * @return number Posição vertical final |
| 3034 | 3032 | */ |
| 3035 | 3033 | protected function modalAquaviario($x = 0, $y = 0) |
@@ -3145,8 +3143,8 @@ discard block |
||
| 3145 | 3143 | * modalFerr |
| 3146 | 3144 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 3147 | 3145 | * |
| 3148 | - * @param number $x Posição horizontal canto esquerdo |
|
| 3149 | - * @param number $y Posição vertical canto superior |
|
| 3146 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 3147 | + * @param integer $y Posição vertical canto superior |
|
| 3150 | 3148 | * @return number Posição vertical final |
| 3151 | 3149 | */ |
| 3152 | 3150 | protected function modalFerr($x = 0, $y = 0) |
@@ -3423,8 +3421,8 @@ discard block |
||
| 3423 | 3421 | * canhoto |
| 3424 | 3422 | * Monta o campo com os dados do remetente na DACTE. |
| 3425 | 3423 | * |
| 3426 | - * @param number $x Posição horizontal canto esquerdo |
|
| 3427 | - * @param number $y Posição vertical canto superior |
|
| 3424 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 3425 | + * @param integer $y Posição vertical canto superior |
|
| 3428 | 3426 | * @return number Posição vertical final |
| 3429 | 3427 | */ |
| 3430 | 3428 | protected function canhoto($x = 0, $y = 0) |
@@ -3497,9 +3495,10 @@ discard block |
||
| 3497 | 3495 | * dadosAdic |
| 3498 | 3496 | * Coloca o grupo de dados adicionais da DACTE. |
| 3499 | 3497 | * |
| 3500 | - * @param number $x Posição horizontal canto esquerdo |
|
| 3501 | - * @param number $y Posição vertical canto superior |
|
| 3502 | - * @param number $h altura do campo |
|
| 3498 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 3499 | + * @param double $y Posição vertical canto superior |
|
| 3500 | + * @param integer $h altura do campo |
|
| 3501 | + * @param integer $pag |
|
| 3503 | 3502 | * @return number Posição vertical final |
| 3504 | 3503 | */ |
| 3505 | 3504 | protected function dadosAdic($x, $y, $pag, $h) |
@@ -3692,7 +3691,7 @@ discard block |
||
| 3692 | 3691 | * Fornece a imformação multiplicação de peso contida na CTe |
| 3693 | 3692 | * |
| 3694 | 3693 | * @param interger $U Informação de peso extraida da CTe |
| 3695 | - * @return interger |
|
| 3694 | + * @return integer |
|
| 3696 | 3695 | */ |
| 3697 | 3696 | protected function multiUniPeso($U = '') |
| 3698 | 3697 | { |
@@ -945,7 +945,7 @@ discard block |
||
| 945 | 945 | $n = count($resp['message']); |
| 946 | 946 | $alttot = $n * 15; |
| 947 | 947 | $x = 10; |
| 948 | - $y = $this->hPrint/2 - $alttot/2; |
|
| 948 | + $y = $this->hPrint / 2 - $alttot / 2; |
|
| 949 | 949 | $h = 15; |
| 950 | 950 | $w = $maxW - (2 * $x); |
| 951 | 951 | $this->pdf->settextcolor(90, 90, 90); |
@@ -1271,8 +1271,7 @@ discard block |
||
| 1271 | 1271 | $texto = $this->getTagValue($this->enderExped, "xLgr") . ', '; |
| 1272 | 1272 | $texto .= $this->getTagValue($this->enderExped, "nro"); |
| 1273 | 1273 | $texto .= $this->getTagValue($this->enderExped, "xCpl") != "" ? |
| 1274 | - ' - ' . $this->getTagValue($this->enderExped, "xCpl") : |
|
| 1275 | - ''; |
|
| 1274 | + ' - ' . $this->getTagValue($this->enderExped, "xCpl") : ''; |
|
| 1276 | 1275 | } else { |
| 1277 | 1276 | $texto = ''; |
| 1278 | 1277 | } |
@@ -1368,8 +1367,7 @@ discard block |
||
| 1368 | 1367 | $texto = $this->getTagValue($this->enderReceb, "xLgr") . ', '; |
| 1369 | 1368 | $texto .= $this->getTagValue($this->enderReceb, "nro"); |
| 1370 | 1369 | $texto .= ($this->getTagValue($this->enderReceb, "xCpl") != "") ? |
| 1371 | - ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : |
|
| 1372 | - ''; |
|
| 1370 | + ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : ''; |
|
| 1373 | 1371 | } else { |
| 1374 | 1372 | $texto = ''; |
| 1375 | 1373 | } |
@@ -1625,7 +1623,7 @@ discard block |
||
| 1625 | 1623 | $qCarga = 0; |
| 1626 | 1624 | foreach ($this->infQ as $infQ) { |
| 1627 | 1625 | if ($this->getTagValue($infQ, "cUnid") == '00') { |
| 1628 | - $qCarga += (float)$this->getTagValue($infQ, "qCarga"); |
|
| 1626 | + $qCarga += (float) $this->getTagValue($infQ, "qCarga"); |
|
| 1629 | 1627 | } |
| 1630 | 1628 | } |
| 1631 | 1629 | $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : ''; |
@@ -1642,7 +1640,7 @@ discard block |
||
| 1642 | 1640 | $qCarga = 0; |
| 1643 | 1641 | foreach ($this->infQ as $infQ) { |
| 1644 | 1642 | if ($this->getTagValue($infQ, "cUnid") == '03') { |
| 1645 | - $qCarga += (float)$this->getTagValue($infQ, "qCarga"); |
|
| 1643 | + $qCarga += (float) $this->getTagValue($infQ, "qCarga"); |
|
| 1646 | 1644 | } |
| 1647 | 1645 | } |
| 1648 | 1646 | $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : ''; |
@@ -3572,7 +3570,7 @@ discard block |
||
| 3572 | 3570 | $y = $y + 5; |
| 3573 | 3571 | $this->pdf->line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
| 3574 | 3572 | $texto = 'RG'; |
| 3575 | - $aFont = ['font' => $this->fontePadrao,'size' => 6,'style' => '']; |
|
| 3573 | + $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
|
| 3576 | 3574 | $this->pdf->textBox($x, $y + 3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 3577 | 3575 | $x += $w * 0.85; |
| 3578 | 3576 | $this->pdf->line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | //ativar modo debug |
| 122 | 122 | error_reporting(E_ALL); |
| 123 | 123 | ini_set('display_errors', 'On'); |
| 124 | - set_error_handler(function (int $errnum, string $errmsg, string $errfile, int $errline) { |
|
| 124 | + set_error_handler(function(int $errnum, string $errmsg, string $errfile, int $errline) { |
|
| 125 | 125 | throw new \Exception("Erro identificado $errnum: '$errmsg' $errfile [linha:" . $errline . "]"); |
| 126 | 126 | }); |
| 127 | 127 | } else { |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | } |
| 276 | 276 | if (substr($logo, 0, 24) !== 'data://text/plain;base64') { |
| 277 | 277 | if (is_file($logo)) { |
| 278 | - $logo = 'data://text/plain;base64,'. base64_encode(file_get_contents($logo)); |
|
| 278 | + $logo = 'data://text/plain;base64,' . base64_encode(file_get_contents($logo)); |
|
| 279 | 279 | } else { |
| 280 | 280 | //se não é uma string e nem um file retorna nulo |
| 281 | 281 | return null; |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | imagedestroy($image); |
| 318 | 318 | $logo = ob_get_contents(); // read from buffer |
| 319 | 319 | ob_end_clean(); |
| 320 | - return 'data://text/plain;base64,'.base64_encode($logo); |
|
| 320 | + return 'data://text/plain;base64,' . base64_encode($logo); |
|
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | /** |
@@ -875,8 +875,8 @@ discard block |
||
| 875 | 875 | *header |
| 876 | 876 | * Monta o cabelhalho da DANFE (retrato e paisagem) |
| 877 | 877 | * |
| 878 | - * @param number $x Posição horizontal inicial, canto esquerdo |
|
| 879 | - * @param number $y Posição vertical inicial, canto superior |
|
| 878 | + * @param integer $x Posição horizontal inicial, canto esquerdo |
|
| 879 | + * @param integer $y Posição vertical inicial, canto superior |
|
| 880 | 880 | * @param number $pag Número da Página |
| 881 | 881 | * @param number $totPag Total de páginas |
| 882 | 882 | * |
@@ -1265,8 +1265,8 @@ discard block |
||
| 1265 | 1265 | * |
| 1266 | 1266 | * @name destinatarioDANFE |
| 1267 | 1267 | * |
| 1268 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1269 | - * @param number $y Posição vertical canto superior |
|
| 1268 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1269 | + * @param integer $y Posição vertical canto superior |
|
| 1270 | 1270 | * |
| 1271 | 1271 | * @return number Posição vertical final |
| 1272 | 1272 | */ |
@@ -1480,8 +1480,8 @@ discard block |
||
| 1480 | 1480 | * |
| 1481 | 1481 | * @name localEntregaDANFE |
| 1482 | 1482 | * |
| 1483 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1484 | - * @param number $y Posição vertical canto superior |
|
| 1483 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1484 | + * @param integer $y Posição vertical canto superior |
|
| 1485 | 1485 | * |
| 1486 | 1486 | * @return number Posição vertical final |
| 1487 | 1487 | */ |
@@ -1633,8 +1633,8 @@ discard block |
||
| 1633 | 1633 | * |
| 1634 | 1634 | * @name localretiradaDANFE |
| 1635 | 1635 | * |
| 1636 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1637 | - * @param number $y Posição vertical canto superior |
|
| 1636 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1637 | + * @param integer $y Posição vertical canto superior |
|
| 1638 | 1638 | * |
| 1639 | 1639 | * @return number Posição vertical final |
| 1640 | 1640 | */ |
@@ -1785,7 +1785,7 @@ discard block |
||
| 1785 | 1785 | * Gera a String do Texto da Fatura |
| 1786 | 1786 | * |
| 1787 | 1787 | * @name getTextoFatura |
| 1788 | - * @return uma String com o texto ou ""; |
|
| 1788 | + * @return string String com o texto ou ""; |
|
| 1789 | 1789 | */ |
| 1790 | 1790 | protected function getTextoFatura() |
| 1791 | 1791 | { |
@@ -1843,8 +1843,8 @@ discard block |
||
| 1843 | 1843 | * |
| 1844 | 1844 | * @name fatura |
| 1845 | 1845 | * |
| 1846 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1847 | - * @param number $y Posição vertical canto superior |
|
| 1846 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1847 | + * @param double $y Posição vertical canto superior |
|
| 1848 | 1848 | * |
| 1849 | 1849 | * @return number Posição vertical final |
| 1850 | 1850 | */ |
@@ -1971,8 +1971,8 @@ discard block |
||
| 1971 | 1971 | * |
| 1972 | 1972 | * @name pagamento |
| 1973 | 1973 | * |
| 1974 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1975 | - * @param number $y Posição vertical canto superior |
|
| 1974 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1975 | + * @param double $y Posição vertical canto superior |
|
| 1976 | 1976 | * |
| 1977 | 1977 | * @return number Posição vertical final |
| 1978 | 1978 | */ |
@@ -2105,6 +2105,8 @@ discard block |
||
| 2105 | 2105 | * @param float $h Altura do campo |
| 2106 | 2106 | * @param float $h Título do campo |
| 2107 | 2107 | * @param float $h Valor do imposto |
| 2108 | + * @param string $titulo |
|
| 2109 | + * @param string $campoImposto |
|
| 2108 | 2110 | * |
| 2109 | 2111 | * @return float Sugestão do $x do próximo imposto |
| 2110 | 2112 | */ |
@@ -2133,10 +2135,10 @@ discard block |
||
| 2133 | 2135 | * imposto |
| 2134 | 2136 | * Monta o campo de impostos e totais da DANFE (retrato e paisagem) |
| 2135 | 2137 | * |
| 2136 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2137 | - * @param number $y Posição vertical canto superior |
|
| 2138 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2139 | + * @param double $y Posição vertical canto superior |
|
| 2138 | 2140 | * |
| 2139 | - * @return number Posição vertical final |
|
| 2141 | + * @return double Posição vertical final |
|
| 2140 | 2142 | */ |
| 2141 | 2143 | protected function imposto($x, $y) |
| 2142 | 2144 | { |
@@ -2531,6 +2533,10 @@ discard block |
||
| 2531 | 2533 | } //fim transporte |
| 2532 | 2534 | |
| 2533 | 2535 | |
| 2536 | + /** |
|
| 2537 | + * @param string $campo |
|
| 2538 | + * @param string $formato |
|
| 2539 | + */ |
|
| 2534 | 2540 | protected function descricaoProdutoHelper($origem, $campo, $formato) |
| 2535 | 2541 | { |
| 2536 | 2542 | $valor_original = $origem->getElementsByTagName($campo)->item(0); |
@@ -2640,7 +2646,6 @@ discard block |
||
| 2640 | 2646 | * @param float $x Posição horizontal canto esquerdo |
| 2641 | 2647 | * @param float $y Posição vertical canto superior |
| 2642 | 2648 | * @param float $nInicio Número do item inicial |
| 2643 | - * @param float $max Número do item final |
|
| 2644 | 2649 | * @param float $hmax Altura máxima do campo de itens em mm |
| 2645 | 2650 | * |
| 2646 | 2651 | * @return float Posição vertical final |
@@ -3385,8 +3390,8 @@ discard block |
||
| 3385 | 3390 | * |
| 3386 | 3391 | * @name canhotoDANFE |
| 3387 | 3392 | * |
| 3388 | - * @param number $x Posição horizontal canto esquerdo |
|
| 3389 | - * @param number $y Posição vertical canto superior |
|
| 3393 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 3394 | + * @param integer $y Posição vertical canto superior |
|
| 3390 | 3395 | * |
| 3391 | 3396 | * @return number Posição vertical final |
| 3392 | 3397 | * |
@@ -3691,6 +3696,9 @@ discard block |
||
| 3691 | 3696 | return $saida; |
| 3692 | 3697 | } |
| 3693 | 3698 | |
| 3699 | + /** |
|
| 3700 | + * @param string $xml |
|
| 3701 | + */ |
|
| 3694 | 3702 | private function loadDoc($xml) |
| 3695 | 3703 | { |
| 3696 | 3704 | $this->xml = $xml; |
@@ -334,28 +334,28 @@ discard block |
||
| 334 | 334 | { |
| 335 | 335 | $this->textoAdic = ''; |
| 336 | 336 | //informações adicionais |
| 337 | - $fontProduto = [ |
|
| 337 | + $fontProduto = [ |
|
| 338 | 338 | 'font' => $this->fontePadrao, |
| 339 | 339 | 'size' => 8, |
| 340 | 340 | 'style' => '' |
| 341 | 341 | ]; |
| 342 | 342 | $k = $this->pdf->k; |
| 343 | 343 | $this->textadicfontsize = $fontProduto['size'] / $k; |
| 344 | - $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas(); |
|
| 344 | + $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas(); |
|
| 345 | 345 | if (isset($this->infAdic)) { |
| 346 | 346 | $i = 0; |
| 347 | 347 | if ($this->textoAdic != '') { |
| 348 | 348 | $this->textoAdic .= ". \n"; |
| 349 | 349 | } |
| 350 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl")) |
|
| 350 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl")) |
|
| 351 | 351 | ? 'Inf. Contribuinte: ' . $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl")) |
| 352 | 352 | : ''; |
| 353 | - $infPedido = $this->geraInformacoesDaTagCompra(); |
|
| 353 | + $infPedido = $this->geraInformacoesDaTagCompra(); |
|
| 354 | 354 | if ($infPedido != "") { |
| 355 | 355 | $this->textoAdic .= $infPedido; |
| 356 | 356 | } |
| 357 | 357 | $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: '); |
| 358 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco")) |
|
| 358 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco")) |
|
| 359 | 359 | ? "\n Inf. fisco: " . $this->getTagValue($this->infAdic, "infAdFisco") |
| 360 | 360 | : ''; |
| 361 | 361 | if ($this->obsshow) { |
@@ -363,11 +363,11 @@ discard block |
||
| 363 | 363 | if (isset($obsCont)) { |
| 364 | 364 | foreach ($obsCont as $obs) { |
| 365 | 365 | $campo = $obsCont->item($i)->getAttribute("xCampo"); |
| 366 | - $xTexto = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) |
|
| 366 | + $xTexto = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) |
|
| 367 | 367 | ? $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue |
| 368 | 368 | : ''; |
| 369 | 369 | $this->textoAdic .= "\n" . $campo . ': ' . trim($xTexto); |
| 370 | - $i ++; |
|
| 370 | + $i++; |
|
| 371 | 371 | } |
| 372 | 372 | } |
| 373 | 373 | } |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | $flagVTT = $flagVTT && (strpos(strtolower(trim($this->textoAdic)), 'trib') || |
| 383 | 383 | strpos(strtolower(trim($this->textoAdic)), 'imp')); |
| 384 | 384 | $vTotTrib = $this->getTagValue($this->ICMSTot, 'vTotTrib'); |
| 385 | - if ($vTotTrib != '' && ! $flagVTT) { |
|
| 385 | + if ($vTotTrib != '' && !$flagVTT) { |
|
| 386 | 386 | $this->textoAdic .= "\n Valor Aproximado dos Tributos : R$ " |
| 387 | 387 | . number_format($vTotTrib, 2, ",", "."); |
| 388 | 388 | } |
@@ -393,9 +393,9 @@ discard block |
||
| 393 | 393 | $this->textadicfontsize = $this->pdf->fontSize; |
| 394 | 394 | $hdadosadic = ceil($numlinhasdados * ($this->textadicfontsize)); |
| 395 | 395 | if ($hdadosadic > 70) { |
| 396 | - for ($f = 8; $f > 3; $f --) { |
|
| 396 | + for ($f = 8; $f > 3; $f--) { |
|
| 397 | 397 | $this->pdf->setFont($this->fontePadrao, '', $f); |
| 398 | - $fontProduto = [ |
|
| 398 | + $fontProduto = [ |
|
| 399 | 399 | 'font' => $this->fontePadrao, |
| 400 | 400 | 'size' => $f, |
| 401 | 401 | 'style' => '' |
@@ -519,9 +519,9 @@ discard block |
||
| 519 | 519 | $this->hdadosadic = $this->calculoEspacoVericalDadosAdicionais(); |
| 520 | 520 | |
| 521 | 521 | //altura disponivel para os campos da DANFE |
| 522 | - $hcabecalho = 47;//para cabeçalho |
|
| 523 | - $hdestinatario = 25;//para destinatario |
|
| 524 | - $hduplicatas = 12;//para cada grupo de 7 duplicatas |
|
| 522 | + $hcabecalho = 47; //para cabeçalho |
|
| 523 | + $hdestinatario = 25; //para destinatario |
|
| 524 | + $hduplicatas = 12; //para cada grupo de 7 duplicatas |
|
| 525 | 525 | if (isset($this->entrega)) { |
| 526 | 526 | $hlocalentrega = 25; |
| 527 | 527 | } else { |
@@ -532,11 +532,11 @@ discard block |
||
| 532 | 532 | } else { |
| 533 | 533 | $hlocalretirada = 0; |
| 534 | 534 | } |
| 535 | - $himposto = 18;// para imposto |
|
| 536 | - $htransporte = 25;// para transporte |
|
| 537 | - $hissqn = 11;// para issqn |
|
| 538 | - $hfooter = 5;// para rodape |
|
| 539 | - $hCabecItens = 4;//cabeçalho dos itens |
|
| 535 | + $himposto = 18; // para imposto |
|
| 536 | + $htransporte = 25; // para transporte |
|
| 537 | + $hissqn = 11; // para issqn |
|
| 538 | + $hfooter = 5; // para rodape |
|
| 539 | + $hCabecItens = 4; //cabeçalho dos itens |
|
| 540 | 540 | $hOCUPADA = $hcabecalho |
| 541 | 541 | + $hdestinatario |
| 542 | 542 | + $hlocalentrega |
@@ -559,10 +559,10 @@ discard block |
||
| 559 | 559 | $this->sizeExtraTextoFatura());*/ |
| 560 | 560 | |
| 561 | 561 | if ($this->orientacao == 'P') { |
| 562 | - $hDispo1 -= 24 * $this->qCanhoto;//para canhoto |
|
| 563 | - $w = $this->wPrint; |
|
| 562 | + $hDispo1 -= 24 * $this->qCanhoto; //para canhoto |
|
| 563 | + $w = $this->wPrint; |
|
| 564 | 564 | } else { |
| 565 | - $hcanhoto = $this->hPrint;//para canhoto |
|
| 565 | + $hcanhoto = $this->hPrint; //para canhoto |
|
| 566 | 566 | $w = $this->wPrint - $this->wCanhoto; |
| 567 | 567 | } |
| 568 | 568 | //$hDispo1 += 14; |
@@ -597,12 +597,12 @@ discard block |
||
| 597 | 597 | ); |
| 598 | 598 | $hUsado += $this->calculeHeight($itemProd, $mostrarUnidadeTributavel); |
| 599 | 599 | if ($hUsado > $hDispo) { |
| 600 | - $totPag ++; |
|
| 600 | + $totPag++; |
|
| 601 | 601 | $hDispo = $hDispo2; |
| 602 | 602 | $hUsado = $hCabecItens; |
| 603 | - $i --; // decrementa para readicionar o item que não coube nessa pagina na outra. |
|
| 603 | + $i--; // decrementa para readicionar o item que não coube nessa pagina na outra. |
|
| 604 | 604 | } |
| 605 | - $i ++; |
|
| 605 | + $i++; |
|
| 606 | 606 | } //fim da soma das areas de itens usadas |
| 607 | 607 | $qtdeItens = $i; //controle da quantidade de itens no DANFE |
| 608 | 608 | //montagem da primeira página |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | $formaPag = []; |
| 635 | 635 | if (isset($this->detPag) && $this->detPag->length > 0) { |
| 636 | 636 | foreach ($this->detPag as $k => $d) { |
| 637 | - $fPag = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
|
| 637 | + $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
|
| 638 | 638 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue |
| 639 | 639 | : '0'; |
| 640 | 640 | $formaPag[$fPag] = $fPag; |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | } |
| 679 | 679 | |
| 680 | 680 | //loop para páginas seguintes |
| 681 | - for ($n = 2; $n <= $totPag; $n ++) { |
|
| 681 | + for ($n = 2; $n <= $totPag; $n++) { |
|
| 682 | 682 | // fixa as margens |
| 683 | 683 | $this->pdf->setMargins($this->margesq, $this->margsup); |
| 684 | 684 | //adiciona nova página |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | } |
| 703 | 703 | //se estiver na última página e ainda restar itens para inserir, adiciona mais uma página |
| 704 | 704 | if ($n == $totPag && $this->qtdeItensProc < $qtdeItens) { |
| 705 | - $totPag ++; |
|
| 705 | + $totPag++; |
|
| 706 | 706 | } |
| 707 | 707 | } |
| 708 | 708 | } |
@@ -731,7 +731,7 @@ discard block |
||
| 731 | 731 | if ($startPos === false) { |
| 732 | 732 | return $cdata; |
| 733 | 733 | } |
| 734 | - for ($x = $len; $x > 0; $x --) { |
|
| 734 | + for ($x = $len; $x > 0; $x--) { |
|
| 735 | 735 | if (substr($cdata, $x, 1) == '>') { |
| 736 | 736 | $endPos = $x; |
| 737 | 737 | break; |
@@ -827,15 +827,15 @@ discard block |
||
| 827 | 827 | //grupo CADATA infCpl |
| 828 | 828 | $t = $dom->getElementsByTagName('transmissor')->item(0); |
| 829 | 829 | $r = $dom->getElementsByTagName('receptor')->item(0); |
| 830 | - $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 830 | + $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 831 | 831 | 'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : ''; |
| 832 | - $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 832 | + $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 833 | 833 | 'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : ''; |
| 834 | - $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 834 | + $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 835 | 835 | 'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : ''; |
| 836 | - $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 836 | + $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 837 | 837 | 'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : ''; |
| 838 | - $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
| 838 | + $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
| 839 | 839 | if (isset($t)) { |
| 840 | 840 | if ($t->hasAttributes()) { |
| 841 | 841 | $texto .= " Transmissor "; |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | } else { |
| 882 | 882 | if ($this->getTagValue($this->ide, "tpAmb") == '2') { |
| 883 | 883 | $resp['status'] = false; |
| 884 | - $resp['message'][] = "NFe EMITIDA EM HOMOLOGAÇÃO"; |
|
| 884 | + $resp['message'][] = "NFe EMITIDA EM HOMOLOGAÇÃO"; |
|
| 885 | 885 | } |
| 886 | 886 | $retEvento = $this->nfeProc->getElementsByTagName('retEvento')->item(0); |
| 887 | 887 | $cStat = $this->getTagValue($this->nfeProc, "cStat"); |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | } elseif (!empty($retEvento)) { |
| 903 | 903 | $infEvento = $retEvento->getElementsByTagName('infEvento')->item(0); |
| 904 | 904 | $cStat = $this->getTagValue($infEvento, "cStat"); |
| 905 | - $tpEvento= $this->getTagValue($infEvento, "tpEvento"); |
|
| 905 | + $tpEvento = $this->getTagValue($infEvento, "tpEvento"); |
|
| 906 | 906 | $dhEvento = date("d/m/Y H:i:s", $this->toTimestamp($this->getTagValue($infEvento, "dhRegEvento"))); |
| 907 | 907 | $nProt = $this->getTagValue($infEvento, "nProt"); |
| 908 | 908 | if ($tpEvento == '110111' && |
@@ -966,7 +966,7 @@ discard block |
||
| 966 | 966 | //se for right separa 2/3 para os dados e o terço seguinte para o logo |
| 967 | 967 | //se não houver logo centraliza dos dados do emitente |
| 968 | 968 | // coloca o logo |
| 969 | - if (! empty($this->logomarca)) { |
|
| 969 | + if (!empty($this->logomarca)) { |
|
| 970 | 970 | $logoInfo = getimagesize($this->logomarca); |
| 971 | 971 | //largura da imagem em mm |
| 972 | 972 | $logoWmm = ($logoInfo[0] / 72) * 25.4; |
@@ -1022,7 +1022,7 @@ discard block |
||
| 1022 | 1022 | //endereço |
| 1023 | 1023 | $y1 = $y1 + 5; |
| 1024 | 1024 | $aFont = ['font' => $this->fontePadrao, 'size' => 8, 'style' => '']; |
| 1025 | - $fone = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 1025 | + $fone = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 1026 | 1026 | ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue |
| 1027 | 1027 | : ''; |
| 1028 | 1028 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
@@ -1041,8 +1041,8 @@ discard block |
||
| 1041 | 1041 | |
| 1042 | 1042 | //#################################################################################### |
| 1043 | 1043 | //coluna central Danfe |
| 1044 | - $x += $w; |
|
| 1045 | - $w = round($maxW * 0.17, 0);//35; |
|
| 1044 | + $x += $w; |
|
| 1045 | + $w = round($maxW * 0.17, 0); //35; |
|
| 1046 | 1046 | $w2 = $w; |
| 1047 | 1047 | $h = 32; |
| 1048 | 1048 | $this->pdf->textBox($x, $y, $w, $h); |
@@ -1099,8 +1099,8 @@ discard block |
||
| 1099 | 1099 | |
| 1100 | 1100 | //#################################################################################### |
| 1101 | 1101 | //coluna codigo de barras |
| 1102 | - $x += $w; |
|
| 1103 | - $w = ($maxW - $w1 - $w2);//85; |
|
| 1102 | + $x += $w; |
|
| 1103 | + $w = ($maxW - $w1 - $w2); //85; |
|
| 1104 | 1104 | $w3 = $w; |
| 1105 | 1105 | $h = 32; |
| 1106 | 1106 | $this->pdf->textBox($x, $y, $w, $h); |
@@ -1162,7 +1162,7 @@ discard block |
||
| 1162 | 1162 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1163 | 1163 | $w = $w1 + $w2; |
| 1164 | 1164 | $y = $oldY; |
| 1165 | - $oldY += $h; |
|
| 1165 | + $oldY += $h; |
|
| 1166 | 1166 | $x = $oldX; |
| 1167 | 1167 | $h = 7; |
| 1168 | 1168 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1193,7 +1193,7 @@ discard block |
||
| 1193 | 1193 | $cStat = ''; |
| 1194 | 1194 | } else { |
| 1195 | 1195 | if (isset($this->nfeProc)) { |
| 1196 | - $texto = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) |
|
| 1196 | + $texto = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) |
|
| 1197 | 1197 | ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue |
| 1198 | 1198 | : ''; |
| 1199 | 1199 | $tsHora = $this->toTimestamp( |
@@ -1223,7 +1223,7 @@ discard block |
||
| 1223 | 1223 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1224 | 1224 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1225 | 1225 | //INSCRIÇÃO MUNICIPAL |
| 1226 | - $x += $w; |
|
| 1226 | + $x += $w; |
|
| 1227 | 1227 | $texto = 'INSCRIÇÃO MUNICIPAL'; |
| 1228 | 1228 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1229 | 1229 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1231,29 +1231,29 @@ discard block |
||
| 1231 | 1231 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1232 | 1232 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1233 | 1233 | //INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT. |
| 1234 | - $x += $w; |
|
| 1234 | + $x += $w; |
|
| 1235 | 1235 | $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.'; |
| 1236 | 1236 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1237 | 1237 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1238 | - $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
| 1238 | + $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
| 1239 | 1239 | ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue |
| 1240 | 1240 | : ''; |
| 1241 | 1241 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1242 | 1242 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1243 | 1243 | //CNPJ |
| 1244 | - $x += $w; |
|
| 1244 | + $x += $w; |
|
| 1245 | 1245 | $w = ($maxW - (3 * $w)); |
| 1246 | 1246 | $texto = 'CNPJ / CPF'; |
| 1247 | 1247 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1248 | 1248 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1249 | 1249 | //Pegando valor do CPF/CNPJ |
| 1250 | - if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1250 | + if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1251 | 1251 | $texto = $this->formatField( |
| 1252 | 1252 | $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1253 | 1253 | "###.###.###/####-##" |
| 1254 | 1254 | ); |
| 1255 | 1255 | } else { |
| 1256 | - $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 1256 | + $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 1257 | 1257 | ? $this->formatField( |
| 1258 | 1258 | $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1259 | 1259 | "###.###.###-##" |
@@ -1272,7 +1272,7 @@ discard block |
||
| 1272 | 1272 | $n = count($resp['message']); |
| 1273 | 1273 | $alttot = $n * 15; |
| 1274 | 1274 | $x = 10; |
| 1275 | - $y = $this->hPrint/2 - $alttot/2; |
|
| 1275 | + $y = $this->hPrint / 2 - $alttot / 2; |
|
| 1276 | 1276 | $h = 15; |
| 1277 | 1277 | $w = $maxW - (2 * $x); |
| 1278 | 1278 | $this->pdf->settextcolor(90, 90, 90); |
@@ -1345,7 +1345,7 @@ discard block |
||
| 1345 | 1345 | //NOME / RAZÃO SOCIAL |
| 1346 | 1346 | $w = round($maxW * 0.61, 0); |
| 1347 | 1347 | $w1 = $w; |
| 1348 | - $y += 3; |
|
| 1348 | + $y += 3; |
|
| 1349 | 1349 | $texto = 'NOME / RAZÃO SOCIAL'; |
| 1350 | 1350 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1351 | 1351 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1357,20 +1357,20 @@ discard block |
||
| 1357 | 1357 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, ''); |
| 1358 | 1358 | } |
| 1359 | 1359 | //CNPJ / CPF |
| 1360 | - $x += $w; |
|
| 1360 | + $x += $w; |
|
| 1361 | 1361 | $w = round($maxW * 0.23, 0); |
| 1362 | 1362 | $w2 = $w; |
| 1363 | 1363 | $texto = 'CNPJ / CPF'; |
| 1364 | 1364 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1365 | 1365 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1366 | 1366 | //Pegando valor do CPF/CNPJ |
| 1367 | - if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1367 | + if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1368 | 1368 | $texto = $this->formatField( |
| 1369 | 1369 | $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1370 | 1370 | "###.###.###/####-##" |
| 1371 | 1371 | ); |
| 1372 | 1372 | } else { |
| 1373 | - $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 1373 | + $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 1374 | 1374 | ? $this->formatField( |
| 1375 | 1375 | $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1376 | 1376 | "###.###.###-##" |
@@ -1380,17 +1380,17 @@ discard block |
||
| 1380 | 1380 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1381 | 1381 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1382 | 1382 | //DATA DA EMISSÃO |
| 1383 | - $x += $w; |
|
| 1383 | + $x += $w; |
|
| 1384 | 1384 | $w = $maxW - ($w1 + $w2); |
| 1385 | 1385 | $wx = $w; |
| 1386 | 1386 | $texto = 'DATA DA EMISSÃO'; |
| 1387 | 1387 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1388 | 1388 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1389 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) |
|
| 1389 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) |
|
| 1390 | 1390 | ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue |
| 1391 | 1391 | : ''; |
| 1392 | 1392 | if ($dEmi == '') { |
| 1393 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) |
|
| 1393 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) |
|
| 1394 | 1394 | ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue |
| 1395 | 1395 | : ''; |
| 1396 | 1396 | $aDemi = explode('T', $dEmi); |
@@ -1406,7 +1406,7 @@ discard block |
||
| 1406 | 1406 | //ENDEREÇO |
| 1407 | 1407 | $w = round($maxW * 0.47, 0); |
| 1408 | 1408 | $w1 = $w; |
| 1409 | - $y += $h; |
|
| 1409 | + $y += $h; |
|
| 1410 | 1410 | $x = $oldX; |
| 1411 | 1411 | $texto = 'ENDEREÇO'; |
| 1412 | 1412 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1418,7 +1418,7 @@ discard block |
||
| 1418 | 1418 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1419 | 1419 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
| 1420 | 1420 | //BAIRRO / DISTRITO |
| 1421 | - $x += $w; |
|
| 1421 | + $x += $w; |
|
| 1422 | 1422 | $w = round($maxW * 0.21, 0); |
| 1423 | 1423 | $w2 = $w; |
| 1424 | 1424 | $texto = 'BAIRRO / DISTRITO'; |
@@ -1428,29 +1428,29 @@ discard block |
||
| 1428 | 1428 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1429 | 1429 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1430 | 1430 | //CEP |
| 1431 | - $x += $w; |
|
| 1431 | + $x += $w; |
|
| 1432 | 1432 | $w = $maxW - $w1 - $w2 - $wx; |
| 1433 | 1433 | $w2 = $w; |
| 1434 | 1434 | $texto = 'CEP'; |
| 1435 | 1435 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1436 | 1436 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1437 | - $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) |
|
| 1437 | + $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) |
|
| 1438 | 1438 | ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue |
| 1439 | 1439 | : ''; |
| 1440 | 1440 | $texto = $this->formatField($texto, "#####-###"); |
| 1441 | 1441 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1442 | 1442 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1443 | 1443 | //DATA DA SAÍDA |
| 1444 | - $x += $w; |
|
| 1444 | + $x += $w; |
|
| 1445 | 1445 | $w = $wx; |
| 1446 | 1446 | $texto = 'DATA DA SAÍDA/ENTRADA'; |
| 1447 | 1447 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1448 | 1448 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1449 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) |
|
| 1449 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) |
|
| 1450 | 1450 | ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue |
| 1451 | 1451 | : ''; |
| 1452 | 1452 | if ($dSaiEnt == '') { |
| 1453 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
| 1453 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
| 1454 | 1454 | ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue |
| 1455 | 1455 | : ''; |
| 1456 | 1456 | $aDsaient = explode('T', $dSaiEnt); |
@@ -1461,7 +1461,7 @@ discard block |
||
| 1461 | 1461 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1462 | 1462 | //MUNICÍPIO |
| 1463 | 1463 | $w = $w1; |
| 1464 | - $y += $h; |
|
| 1464 | + $y += $h; |
|
| 1465 | 1465 | $x = $oldX; |
| 1466 | 1466 | $texto = 'MUNICÍPIO'; |
| 1467 | 1467 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1475,7 +1475,7 @@ discard block |
||
| 1475 | 1475 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1476 | 1476 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 1477 | 1477 | //UF |
| 1478 | - $x += $w; |
|
| 1478 | + $x += $w; |
|
| 1479 | 1479 | $w = 8; |
| 1480 | 1480 | $texto = 'UF'; |
| 1481 | 1481 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1484,19 +1484,19 @@ discard block |
||
| 1484 | 1484 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1485 | 1485 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1486 | 1486 | //FONE / FAX |
| 1487 | - $x += $w; |
|
| 1487 | + $x += $w; |
|
| 1488 | 1488 | $w = round(($maxW - $w1 - $wx - 8) / 2, 0); |
| 1489 | 1489 | $w3 = $w; |
| 1490 | 1490 | $texto = 'FONE / FAX'; |
| 1491 | 1491 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1492 | 1492 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1493 | - $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 1493 | + $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 1494 | 1494 | ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue |
| 1495 | 1495 | : ''; |
| 1496 | 1496 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1497 | 1497 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1498 | 1498 | //INSCRIÇÃO ESTADUAL |
| 1499 | - $x += $w; |
|
| 1499 | + $x += $w; |
|
| 1500 | 1500 | $w = $maxW - $w1 - $wx - 8 - $w3; |
| 1501 | 1501 | $texto = 'INSCRIÇÃO ESTADUAL'; |
| 1502 | 1502 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1506,16 +1506,16 @@ discard block |
||
| 1506 | 1506 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1507 | 1507 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1508 | 1508 | //HORA DA SAÍDA |
| 1509 | - $x += $w; |
|
| 1509 | + $x += $w; |
|
| 1510 | 1510 | $w = $wx; |
| 1511 | 1511 | $texto = 'HORA DA SAÍDA/ENTRADA'; |
| 1512 | 1512 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1513 | 1513 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1514 | - $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) |
|
| 1514 | + $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) |
|
| 1515 | 1515 | ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue |
| 1516 | 1516 | : ''; |
| 1517 | 1517 | if ($hSaiEnt == '') { |
| 1518 | - $dhSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
| 1518 | + $dhSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
| 1519 | 1519 | ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue |
| 1520 | 1520 | : ''; |
| 1521 | 1521 | $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt); |
@@ -1559,7 +1559,7 @@ discard block |
||
| 1559 | 1559 | //NOME / RAZÃO SOCIAL |
| 1560 | 1560 | $w = round($maxW * 0.61, 0); |
| 1561 | 1561 | $w1 = $w; |
| 1562 | - $y += 3; |
|
| 1562 | + $y += 3; |
|
| 1563 | 1563 | $texto = 'NOME / RAZÃO SOCIAL'; |
| 1564 | 1564 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1565 | 1565 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1574,20 +1574,20 @@ discard block |
||
| 1574 | 1574 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, ''); |
| 1575 | 1575 | } |
| 1576 | 1576 | //CNPJ / CPF |
| 1577 | - $x += $w; |
|
| 1577 | + $x += $w; |
|
| 1578 | 1578 | $w = round($maxW * 0.23, 0); |
| 1579 | 1579 | $w2 = $w; |
| 1580 | 1580 | $texto = 'CNPJ / CPF'; |
| 1581 | 1581 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1582 | 1582 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1583 | 1583 | //Pegando valor do CPF/CNPJ |
| 1584 | - if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1584 | + if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1585 | 1585 | $texto = $this->formatField( |
| 1586 | 1586 | $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1587 | 1587 | "###.###.###/####-##" |
| 1588 | 1588 | ); |
| 1589 | 1589 | } else { |
| 1590 | - $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1590 | + $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1591 | 1591 | $this->formatField( |
| 1592 | 1592 | $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1593 | 1593 | "###.###.###-##" |
@@ -1596,7 +1596,7 @@ discard block |
||
| 1596 | 1596 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1597 | 1597 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1598 | 1598 | //INSCRIÇÃO ESTADUAL |
| 1599 | - $x += $w; |
|
| 1599 | + $x += $w; |
|
| 1600 | 1600 | $w = $maxW - ($w1 + $w2); |
| 1601 | 1601 | $wx = $w; |
| 1602 | 1602 | $texto = 'INSCRIÇÃO ESTADUAL'; |
@@ -1615,7 +1615,7 @@ discard block |
||
| 1615 | 1615 | //ENDEREÇO |
| 1616 | 1616 | $w = round($maxW * 0.355, 0) + $wx; |
| 1617 | 1617 | $w1 = $w; |
| 1618 | - $y += $h; |
|
| 1618 | + $y += $h; |
|
| 1619 | 1619 | $x = $oldX; |
| 1620 | 1620 | $texto = 'ENDEREÇO'; |
| 1621 | 1621 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1626,7 +1626,7 @@ discard block |
||
| 1626 | 1626 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1627 | 1627 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
| 1628 | 1628 | //BAIRRO / DISTRITO |
| 1629 | - $x += $w; |
|
| 1629 | + $x += $w; |
|
| 1630 | 1630 | $w = round($maxW * 0.335, 0); |
| 1631 | 1631 | $w2 = $w; |
| 1632 | 1632 | $texto = 'BAIRRO / DISTRITO'; |
@@ -1636,12 +1636,12 @@ discard block |
||
| 1636 | 1636 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1637 | 1637 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1638 | 1638 | //CEP |
| 1639 | - $x += $w; |
|
| 1639 | + $x += $w; |
|
| 1640 | 1640 | $w = $maxW - ($w1 + $w2); |
| 1641 | 1641 | $texto = 'CEP'; |
| 1642 | 1642 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1643 | 1643 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1644 | - $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1644 | + $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1645 | 1645 | $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
| 1646 | 1646 | $texto = $this->formatField($texto, "#####-###"); |
| 1647 | 1647 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
@@ -1649,7 +1649,7 @@ discard block |
||
| 1649 | 1649 | //MUNICÍPIO |
| 1650 | 1650 | $w = round($maxW * 0.805, 0); |
| 1651 | 1651 | $w1 = $w; |
| 1652 | - $y += $h; |
|
| 1652 | + $y += $h; |
|
| 1653 | 1653 | $x = $oldX; |
| 1654 | 1654 | $texto = 'MUNICÍPIO'; |
| 1655 | 1655 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1661,7 +1661,7 @@ discard block |
||
| 1661 | 1661 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1662 | 1662 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 1663 | 1663 | //UF |
| 1664 | - $x += $w; |
|
| 1664 | + $x += $w; |
|
| 1665 | 1665 | $w = 8; |
| 1666 | 1666 | $texto = 'UF'; |
| 1667 | 1667 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1670,12 +1670,12 @@ discard block |
||
| 1670 | 1670 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1671 | 1671 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1672 | 1672 | //FONE / FAX |
| 1673 | - $x += $w; |
|
| 1673 | + $x += $w; |
|
| 1674 | 1674 | $w = $maxW - $w - $w1; |
| 1675 | 1675 | $texto = 'FONE / FAX'; |
| 1676 | 1676 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1677 | 1677 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1678 | - $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1678 | + $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1679 | 1679 | $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
| 1680 | 1680 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1681 | 1681 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -1712,7 +1712,7 @@ discard block |
||
| 1712 | 1712 | //NOME / RAZÃO SOCIAL |
| 1713 | 1713 | $w = round($maxW * 0.61, 0); |
| 1714 | 1714 | $w1 = $w; |
| 1715 | - $y += 3; |
|
| 1715 | + $y += 3; |
|
| 1716 | 1716 | $texto = 'NOME / RAZÃO SOCIAL'; |
| 1717 | 1717 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1718 | 1718 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1727,20 +1727,20 @@ discard block |
||
| 1727 | 1727 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, ''); |
| 1728 | 1728 | } |
| 1729 | 1729 | //CNPJ / CPF |
| 1730 | - $x += $w; |
|
| 1730 | + $x += $w; |
|
| 1731 | 1731 | $w = round($maxW * 0.23, 0); |
| 1732 | 1732 | $w2 = $w; |
| 1733 | 1733 | $texto = 'CNPJ / CPF'; |
| 1734 | 1734 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1735 | 1735 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1736 | 1736 | //Pegando valor do CPF/CNPJ |
| 1737 | - if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1737 | + if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1738 | 1738 | $texto = $this->formatField( |
| 1739 | 1739 | $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1740 | 1740 | "###.###.###/####-##" |
| 1741 | 1741 | ); |
| 1742 | 1742 | } else { |
| 1743 | - $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1743 | + $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1744 | 1744 | $this->formatField( |
| 1745 | 1745 | $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1746 | 1746 | "###.###.###-##" |
@@ -1749,7 +1749,7 @@ discard block |
||
| 1749 | 1749 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1750 | 1750 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1751 | 1751 | //INSCRIÇÃO ESTADUAL |
| 1752 | - $x += $w; |
|
| 1752 | + $x += $w; |
|
| 1753 | 1753 | $w = $maxW - ($w1 + $w2); |
| 1754 | 1754 | $wx = $w; |
| 1755 | 1755 | $texto = 'INSCRIÇÃO ESTADUAL'; |
@@ -1768,7 +1768,7 @@ discard block |
||
| 1768 | 1768 | //ENDEREÇO |
| 1769 | 1769 | $w = round($maxW * 0.355, 0) + $wx; |
| 1770 | 1770 | $w1 = $w; |
| 1771 | - $y += $h; |
|
| 1771 | + $y += $h; |
|
| 1772 | 1772 | $x = $oldX; |
| 1773 | 1773 | $texto = 'ENDEREÇO'; |
| 1774 | 1774 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1779,7 +1779,7 @@ discard block |
||
| 1779 | 1779 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1780 | 1780 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
| 1781 | 1781 | //BAIRRO / DISTRITO |
| 1782 | - $x += $w; |
|
| 1782 | + $x += $w; |
|
| 1783 | 1783 | $w = round($maxW * 0.335, 0); |
| 1784 | 1784 | $w2 = $w; |
| 1785 | 1785 | $texto = 'BAIRRO / DISTRITO'; |
@@ -1789,12 +1789,12 @@ discard block |
||
| 1789 | 1789 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1790 | 1790 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1791 | 1791 | //CEP |
| 1792 | - $x += $w; |
|
| 1792 | + $x += $w; |
|
| 1793 | 1793 | $w = $maxW - ($w1 + $w2); |
| 1794 | 1794 | $texto = 'CEP'; |
| 1795 | 1795 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1796 | 1796 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1797 | - $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1797 | + $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1798 | 1798 | $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
| 1799 | 1799 | $texto = $this->formatField($texto, "#####-###"); |
| 1800 | 1800 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
@@ -1802,7 +1802,7 @@ discard block |
||
| 1802 | 1802 | //MUNICÍPIO |
| 1803 | 1803 | $w = round($maxW * 0.805, 0); |
| 1804 | 1804 | $w1 = $w; |
| 1805 | - $y += $h; |
|
| 1805 | + $y += $h; |
|
| 1806 | 1806 | $x = $oldX; |
| 1807 | 1807 | $texto = 'MUNICÍPIO'; |
| 1808 | 1808 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1814,7 +1814,7 @@ discard block |
||
| 1814 | 1814 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1815 | 1815 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 1816 | 1816 | //UF |
| 1817 | - $x += $w; |
|
| 1817 | + $x += $w; |
|
| 1818 | 1818 | $w = 8; |
| 1819 | 1819 | $texto = 'UF'; |
| 1820 | 1820 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1823,12 +1823,12 @@ discard block |
||
| 1823 | 1823 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1824 | 1824 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1825 | 1825 | //FONE / FAX |
| 1826 | - $x += $w; |
|
| 1826 | + $x += $w; |
|
| 1827 | 1827 | $w = $maxW - $w - $w1; |
| 1828 | 1828 | $texto = 'FONE / FAX'; |
| 1829 | 1829 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1830 | 1830 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1831 | - $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1831 | + $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1832 | 1832 | $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
| 1833 | 1833 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1834 | 1834 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -1848,7 +1848,7 @@ discard block |
||
| 1848 | 1848 | if (isset($this->cobr)) { |
| 1849 | 1849 | $fat = $this->cobr->getElementsByTagName("fat")->item(0); |
| 1850 | 1850 | if (isset($fat)) { |
| 1851 | - if (! empty($this->getTagValue($this->ide, "indPag"))) { |
|
| 1851 | + if (!empty($this->getTagValue($this->ide, "indPag"))) { |
|
| 1852 | 1852 | $textoIndPag = ""; |
| 1853 | 1853 | $indPag = $this->getTagValue($this->ide, "indPag"); |
| 1854 | 1854 | if ($indPag === "0") { |
@@ -1922,7 +1922,7 @@ discard block |
||
| 1922 | 1922 | $h = 8; |
| 1923 | 1923 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B']; |
| 1924 | 1924 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1925 | - $y += 3; |
|
| 1925 | + $y += 3; |
|
| 1926 | 1926 | $dups = ""; |
| 1927 | 1927 | $dupcont = 0; |
| 1928 | 1928 | $nFat = $this->dup->length; |
@@ -1956,13 +1956,13 @@ discard block |
||
| 1956 | 1956 | } |
| 1957 | 1957 | $increm = 1; |
| 1958 | 1958 | foreach ($this->dup as $k => $d) { |
| 1959 | - $nDup = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) |
|
| 1959 | + $nDup = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) |
|
| 1960 | 1960 | ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue |
| 1961 | 1961 | : ''; |
| 1962 | - $dDup = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
|
| 1962 | + $dDup = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
|
| 1963 | 1963 | ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
| 1964 | 1964 | : ''; |
| 1965 | - $vDup = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) |
|
| 1965 | + $vDup = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) |
|
| 1966 | 1966 | ? 'R$ ' . number_format( |
| 1967 | 1967 | $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue, |
| 1968 | 1968 | 2, |
@@ -2009,7 +2009,7 @@ discard block |
||
| 2009 | 2009 | } |
| 2010 | 2010 | if ($dupcont == 0) { |
| 2011 | 2011 | $y -= 9; |
| 2012 | - $linha --; |
|
| 2012 | + $linha--; |
|
| 2013 | 2013 | } |
| 2014 | 2014 | |
| 2015 | 2015 | return ($y + $h); |
@@ -2049,7 +2049,7 @@ discard block |
||
| 2049 | 2049 | $h = 8; |
| 2050 | 2050 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B']; |
| 2051 | 2051 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2052 | - $y += 3; |
|
| 2052 | + $y += 3; |
|
| 2053 | 2053 | $dups = ""; |
| 2054 | 2054 | $dupcont = 0; |
| 2055 | 2055 | if ($this->orientacao == 'P') { |
@@ -2082,7 +2082,7 @@ discard block |
||
| 2082 | 2082 | '90' => 'Sem pagamento', |
| 2083 | 2083 | '99' => 'Outros' |
| 2084 | 2084 | ]; |
| 2085 | - $bandeira = [ |
|
| 2085 | + $bandeira = [ |
|
| 2086 | 2086 | '01' => 'Visa', |
| 2087 | 2087 | '02' => 'Mastercard', |
| 2088 | 2088 | '03' => 'American', |
@@ -2095,10 +2095,10 @@ discard block |
||
| 2095 | 2095 | '99' => 'Outros' |
| 2096 | 2096 | ]; |
| 2097 | 2097 | foreach ($this->detPag as $k => $d) { |
| 2098 | - $fPag = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
|
| 2098 | + $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
|
| 2099 | 2099 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue |
| 2100 | 2100 | : '0'; |
| 2101 | - $vPag = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
| 2101 | + $vPag = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
| 2102 | 2102 | ? 'R$ ' . number_format( |
| 2103 | 2103 | $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue, |
| 2104 | 2104 | 2, |
@@ -2141,7 +2141,7 @@ discard block |
||
| 2141 | 2141 | } |
| 2142 | 2142 | if ($dupcont == 0) { |
| 2143 | 2143 | $y -= 9; |
| 2144 | - $linha --; |
|
| 2144 | + $linha--; |
|
| 2145 | 2145 | } |
| 2146 | 2146 | |
| 2147 | 2147 | return ($y + $h); |
@@ -2173,7 +2173,7 @@ discard block |
||
| 2173 | 2173 | $the_field = $this->ICMSTot->getElementsByTagName($campoImposto)->item(0); |
| 2174 | 2174 | if (isset($the_field)) { |
| 2175 | 2175 | $the_value = $the_field->nodeValue; |
| 2176 | - if (! empty($the_value)) { |
|
| 2176 | + if (!empty($the_value)) { |
|
| 2177 | 2177 | $valorImposto = number_format($the_value, 2, ",", "."); |
| 2178 | 2178 | } |
| 2179 | 2179 | } |
@@ -2202,10 +2202,10 @@ discard block |
||
| 2202 | 2202 | $x_inicial = $x; |
| 2203 | 2203 | //##################################################################### |
| 2204 | 2204 | $campos_por_linha = 9; |
| 2205 | - if (! $this->exibirPIS) { |
|
| 2206 | - $campos_por_linha --; |
|
| 2205 | + if (!$this->exibirPIS) { |
|
| 2206 | + $campos_por_linha--; |
|
| 2207 | 2207 | } |
| 2208 | - if (! $this->exibirIcmsInterestadual) { |
|
| 2208 | + if (!$this->exibirIcmsInterestadual) { |
|
| 2209 | 2209 | $campos_por_linha -= 2; |
| 2210 | 2210 | } |
| 2211 | 2211 | |
@@ -2292,12 +2292,12 @@ discard block |
||
| 2292 | 2292 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2293 | 2293 | //NOME / RAZÃO SOCIAL |
| 2294 | 2294 | $w1 = $maxW * 0.29; |
| 2295 | - $y += 3; |
|
| 2295 | + $y += 3; |
|
| 2296 | 2296 | $texto = 'NOME / RAZÃO SOCIAL'; |
| 2297 | 2297 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2298 | 2298 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2299 | 2299 | if (isset($this->transporta)) { |
| 2300 | - $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) |
|
| 2300 | + $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) |
|
| 2301 | 2301 | ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue |
| 2302 | 2302 | : ''; |
| 2303 | 2303 | } else { |
@@ -2306,12 +2306,12 @@ discard block |
||
| 2306 | 2306 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2307 | 2307 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 2308 | 2308 | //FRETE POR CONTA |
| 2309 | - $x += $w1; |
|
| 2309 | + $x += $w1; |
|
| 2310 | 2310 | $w2 = $maxW * 0.15; |
| 2311 | 2311 | $texto = 'FRETE'; |
| 2312 | 2312 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2313 | 2313 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2314 | - $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) |
|
| 2314 | + $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) |
|
| 2315 | 2315 | ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue |
| 2316 | 2316 | : '0'; |
| 2317 | 2317 | switch ($tipoFrete) { |
@@ -2337,12 +2337,12 @@ discard block |
||
| 2337 | 2337 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2338 | 2338 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 1, ''); |
| 2339 | 2339 | //CÓDIGO ANTT |
| 2340 | - $x += $w2; |
|
| 2340 | + $x += $w2; |
|
| 2341 | 2341 | $texto = 'CÓDIGO ANTT'; |
| 2342 | 2342 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2343 | 2343 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2344 | 2344 | if (isset($this->veicTransp)) { |
| 2345 | - $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) |
|
| 2345 | + $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) |
|
| 2346 | 2346 | ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue |
| 2347 | 2347 | : ''; |
| 2348 | 2348 | } else { |
@@ -2351,16 +2351,16 @@ discard block |
||
| 2351 | 2351 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2352 | 2352 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2353 | 2353 | //PLACA DO VEÍC |
| 2354 | - $x += $w2; |
|
| 2354 | + $x += $w2; |
|
| 2355 | 2355 | $texto = 'PLACA DO VEÍCULO'; |
| 2356 | 2356 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2357 | 2357 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2358 | 2358 | if (isset($this->veicTransp)) { |
| 2359 | - $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) |
|
| 2359 | + $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) |
|
| 2360 | 2360 | ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue |
| 2361 | 2361 | : ''; |
| 2362 | 2362 | } elseif (isset($this->reboque)) { |
| 2363 | - $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) |
|
| 2363 | + $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) |
|
| 2364 | 2364 | ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue |
| 2365 | 2365 | : ''; |
| 2366 | 2366 | } else { |
@@ -2369,17 +2369,17 @@ discard block |
||
| 2369 | 2369 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2370 | 2370 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2371 | 2371 | //UF |
| 2372 | - $x += $w2; |
|
| 2372 | + $x += $w2; |
|
| 2373 | 2373 | $w3 = round($maxW * 0.04, 0); |
| 2374 | 2374 | $texto = 'UF'; |
| 2375 | 2375 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2376 | 2376 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2377 | 2377 | if (isset($this->veicTransp)) { |
| 2378 | - $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2378 | + $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2379 | 2379 | ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue |
| 2380 | 2380 | : ''; |
| 2381 | 2381 | } elseif (isset($this->reboque)) { |
| 2382 | - $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2382 | + $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2383 | 2383 | ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue |
| 2384 | 2384 | : ''; |
| 2385 | 2385 | } else { |
@@ -2388,20 +2388,20 @@ discard block |
||
| 2388 | 2388 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2389 | 2389 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2390 | 2390 | //CNPJ / CPF |
| 2391 | - $x += $w3; |
|
| 2391 | + $x += $w3; |
|
| 2392 | 2392 | $w = $maxW - ($w1 + 3 * $w2 + $w3); |
| 2393 | 2393 | $texto = 'CNPJ / CPF'; |
| 2394 | 2394 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2395 | 2395 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2396 | 2396 | if (isset($this->transporta)) { |
| 2397 | - $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
|
| 2397 | + $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
|
| 2398 | 2398 | ? $this->formatField( |
| 2399 | 2399 | $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 2400 | 2400 | "##.###.###/####-##" |
| 2401 | 2401 | ) |
| 2402 | 2402 | : ''; |
| 2403 | 2403 | if ($texto == '') { |
| 2404 | - $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 2404 | + $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 2405 | 2405 | ? $this->formatField( |
| 2406 | 2406 | $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 2407 | 2407 | "###.###.###-##" |
@@ -2415,7 +2415,7 @@ discard block |
||
| 2415 | 2415 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2416 | 2416 | //##################################################################### |
| 2417 | 2417 | //ENDEREÇO |
| 2418 | - $y += $h; |
|
| 2418 | + $y += $h; |
|
| 2419 | 2419 | $x = $oldX; |
| 2420 | 2420 | $h = 7; |
| 2421 | 2421 | $w1 = $maxW * 0.44; |
@@ -2423,7 +2423,7 @@ discard block |
||
| 2423 | 2423 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2424 | 2424 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2425 | 2425 | if (isset($this->transporta)) { |
| 2426 | - $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) |
|
| 2426 | + $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) |
|
| 2427 | 2427 | ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue |
| 2428 | 2428 | : ''; |
| 2429 | 2429 | } else { |
@@ -2432,13 +2432,13 @@ discard block |
||
| 2432 | 2432 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2433 | 2433 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 2434 | 2434 | //MUNICÍPIO |
| 2435 | - $x += $w1; |
|
| 2435 | + $x += $w1; |
|
| 2436 | 2436 | $w2 = round($maxW * 0.30, 0); |
| 2437 | 2437 | $texto = 'MUNICÍPIO'; |
| 2438 | 2438 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2439 | 2439 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2440 | 2440 | if (isset($this->transporta)) { |
| 2441 | - $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) |
|
| 2441 | + $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) |
|
| 2442 | 2442 | ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue |
| 2443 | 2443 | : ''; |
| 2444 | 2444 | } else { |
@@ -2447,13 +2447,13 @@ discard block |
||
| 2447 | 2447 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2448 | 2448 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2449 | 2449 | //UF |
| 2450 | - $x += $w2; |
|
| 2450 | + $x += $w2; |
|
| 2451 | 2451 | $w3 = round($maxW * 0.04, 0); |
| 2452 | 2452 | $texto = 'UF'; |
| 2453 | 2453 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2454 | 2454 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2455 | 2455 | if (isset($this->transporta)) { |
| 2456 | - $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2456 | + $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2457 | 2457 | ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue |
| 2458 | 2458 | : ''; |
| 2459 | 2459 | } else { |
@@ -2462,14 +2462,14 @@ discard block |
||
| 2462 | 2462 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2463 | 2463 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2464 | 2464 | //INSCRIÇÃO ESTADUAL |
| 2465 | - $x += $w3; |
|
| 2465 | + $x += $w3; |
|
| 2466 | 2466 | $w = $maxW - ($w1 + $w2 + $w3); |
| 2467 | 2467 | $texto = 'INSCRIÇÃO ESTADUAL'; |
| 2468 | 2468 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2469 | 2469 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2470 | 2470 | $texto = ''; |
| 2471 | 2471 | if (isset($this->transporta)) { |
| 2472 | - if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
| 2472 | + if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
| 2473 | 2473 | $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue; |
| 2474 | 2474 | } |
| 2475 | 2475 | } |
@@ -2485,13 +2485,13 @@ discard block |
||
| 2485 | 2485 | $pesoBruto = 0; |
| 2486 | 2486 | $pesoLiquido = 0; |
| 2487 | 2487 | foreach ($volumes as $volume) { |
| 2488 | - $quantidade += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
| 2488 | + $quantidade += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
| 2489 | 2489 | $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0; |
| 2490 | - $pesoBruto += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
| 2490 | + $pesoBruto += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
| 2491 | 2491 | $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0; |
| 2492 | - $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
| 2492 | + $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
| 2493 | 2493 | $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0; |
| 2494 | - $texto = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
| 2494 | + $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
| 2495 | 2495 | $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : ''; |
| 2496 | 2496 | if ($texto != $especie && $especie != '') { |
| 2497 | 2497 | //tem várias especies |
@@ -2499,7 +2499,7 @@ discard block |
||
| 2499 | 2499 | } else { |
| 2500 | 2500 | $especie = $texto; |
| 2501 | 2501 | } |
| 2502 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) |
|
| 2502 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) |
|
| 2503 | 2503 | ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue |
| 2504 | 2504 | : ''; |
| 2505 | 2505 | if ($texto != $marca && $marca != '') { |
@@ -2508,7 +2508,7 @@ discard block |
||
| 2508 | 2508 | } else { |
| 2509 | 2509 | $marca = $texto; |
| 2510 | 2510 | } |
| 2511 | - $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) |
|
| 2511 | + $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) |
|
| 2512 | 2512 | ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue |
| 2513 | 2513 | : ''; |
| 2514 | 2514 | if ($texto != $numero && $numero != '') { |
@@ -2521,20 +2521,20 @@ discard block |
||
| 2521 | 2521 | |
| 2522 | 2522 | //##################################################################### |
| 2523 | 2523 | //QUANTIDADE |
| 2524 | - $y += $h; |
|
| 2524 | + $y += $h; |
|
| 2525 | 2525 | $x = $oldX; |
| 2526 | 2526 | $h = 7; |
| 2527 | 2527 | $w1 = round($maxW * 0.10, 0); |
| 2528 | 2528 | $texto = 'QUANTIDADE'; |
| 2529 | 2529 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2530 | 2530 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2531 | - if (! empty($quantidade)) { |
|
| 2531 | + if (!empty($quantidade)) { |
|
| 2532 | 2532 | $texto = $quantidade; |
| 2533 | 2533 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2534 | 2534 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2535 | 2535 | } |
| 2536 | 2536 | //ESPÉCIE |
| 2537 | - $x += $w1; |
|
| 2537 | + $x += $w1; |
|
| 2538 | 2538 | $w2 = round($maxW * 0.17, 0); |
| 2539 | 2539 | $texto = 'ESPÉCIE'; |
| 2540 | 2540 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -2543,16 +2543,16 @@ discard block |
||
| 2543 | 2543 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2544 | 2544 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2545 | 2545 | //MARCA |
| 2546 | - $x += $w2; |
|
| 2546 | + $x += $w2; |
|
| 2547 | 2547 | $texto = 'MARCA'; |
| 2548 | 2548 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2549 | 2549 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2550 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2550 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2551 | 2551 | $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : ''; |
| 2552 | 2552 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2553 | 2553 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2554 | 2554 | //NUMERAÇÃO |
| 2555 | - $x += $w2; |
|
| 2555 | + $x += $w2; |
|
| 2556 | 2556 | $texto = 'NUMERAÇÃO'; |
| 2557 | 2557 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2558 | 2558 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2560,7 +2560,7 @@ discard block |
||
| 2560 | 2560 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2561 | 2561 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2562 | 2562 | //PESO BRUTO |
| 2563 | - $x += $w2; |
|
| 2563 | + $x += $w2; |
|
| 2564 | 2564 | $w3 = round($maxW * 0.20, 0); |
| 2565 | 2565 | $texto = 'PESO BRUTO'; |
| 2566 | 2566 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -2573,7 +2573,7 @@ discard block |
||
| 2573 | 2573 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2574 | 2574 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 2575 | 2575 | //PESO LÍQUIDO |
| 2576 | - $x += $w3; |
|
| 2576 | + $x += $w3; |
|
| 2577 | 2577 | $w = $maxW - ($w1 + 3 * $w2 + $w3); |
| 2578 | 2578 | $texto = 'PESO LÍQUIDO'; |
| 2579 | 2579 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -2593,11 +2593,11 @@ discard block |
||
| 2593 | 2593 | protected function descricaoProdutoHelper($origem, $campo, $formato) |
| 2594 | 2594 | { |
| 2595 | 2595 | $valor_original = $origem->getElementsByTagName($campo)->item(0); |
| 2596 | - if (! isset($valor_original)) { |
|
| 2596 | + if (!isset($valor_original)) { |
|
| 2597 | 2597 | return ""; |
| 2598 | 2598 | } |
| 2599 | 2599 | $valor_original = $valor_original->nodeValue; |
| 2600 | - $valor = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
| 2600 | + $valor = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
| 2601 | 2601 | |
| 2602 | 2602 | if ($valor != "") { |
| 2603 | 2603 | return sprintf($formato, $valor); |
@@ -2623,7 +2623,7 @@ discard block |
||
| 2623 | 2623 | $ICMSUFDest = $itemProd->getElementsByTagName("ICMSUFDest")->item(0); |
| 2624 | 2624 | $impostos = ''; |
| 2625 | 2625 | |
| 2626 | - if (! empty($ICMS)) { |
|
| 2626 | + if (!empty($ICMS)) { |
|
| 2627 | 2627 | $impostos .= $this->descricaoProdutoHelper($ICMS, "vBCFCP", " BcFcp=%s"); |
| 2628 | 2628 | $impostos .= $this->descricaoProdutoHelper($ICMS, "pFCP", " pFcp=%s%%"); |
| 2629 | 2629 | $impostos .= $this->descricaoProdutoHelper($ICMS, "vFCP", " vFcp=%s"); |
@@ -2639,7 +2639,7 @@ discard block |
||
| 2639 | 2639 | $impostos .= $this->descricaoProdutoHelper($ICMS, "pST", " pSt=%s"); |
| 2640 | 2640 | $impostos .= $this->descricaoProdutoHelper($ICMS, "vICMSSTRet", " VALOR ICMS ST=%s"); |
| 2641 | 2641 | } |
| 2642 | - if (! empty($ICMSUFDest)) { |
|
| 2642 | + if (!empty($ICMSUFDest)) { |
|
| 2643 | 2643 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pFCPUFDest", " pFCPUFDest=%s%%"); |
| 2644 | 2644 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSUFDest", " pICMSUFDest=%s%%"); |
| 2645 | 2645 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSInterPart", " pICMSInterPart=%s%%"); |
@@ -2647,20 +2647,20 @@ discard block |
||
| 2647 | 2647 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s"); |
| 2648 | 2648 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s"); |
| 2649 | 2649 | } |
| 2650 | - $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
| 2650 | + $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
| 2651 | 2651 | ? substr( |
| 2652 | 2652 | $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue), |
| 2653 | 2653 | 0, |
| 2654 | 2654 | 500 |
| 2655 | 2655 | ) |
| 2656 | 2656 | : ''; |
| 2657 | - if (! empty($infAdProd)) { |
|
| 2657 | + if (!empty($infAdProd)) { |
|
| 2658 | 2658 | $infAdProd = trim($infAdProd); |
| 2659 | 2659 | $infAdProd .= ' '; |
| 2660 | 2660 | } |
| 2661 | 2661 | $loteTxt = ''; |
| 2662 | 2662 | $rastro = $prod->getElementsByTagName("med"); |
| 2663 | - if (! empty($prod->getElementsByTagName("rastro"))) { |
|
| 2663 | + if (!empty($prod->getElementsByTagName("rastro"))) { |
|
| 2664 | 2664 | $rastro = $prod->getElementsByTagName("rastro"); |
| 2665 | 2665 | $i = 0; |
| 2666 | 2666 | while ($i < $rastro->length) { |
@@ -2669,14 +2669,14 @@ discard block |
||
| 2669 | 2669 | $loteTxt .= $this->getTagDate($rastro->item($i), 'dFab', ' Fab: '); |
| 2670 | 2670 | $loteTxt .= $this->getTagDate($rastro->item($i), 'dVal', ' Val: '); |
| 2671 | 2671 | $loteTxt .= $this->getTagValue($rastro->item($i), 'vPMC', ' PMC: '); |
| 2672 | - $i ++; |
|
| 2672 | + $i++; |
|
| 2673 | 2673 | } |
| 2674 | 2674 | if ($loteTxt != '') { |
| 2675 | 2675 | $loteTxt .= ' '; |
| 2676 | 2676 | } |
| 2677 | 2677 | } |
| 2678 | 2678 | //NT2013.006 FCI |
| 2679 | - $nFCI = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
| 2679 | + $nFCI = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
| 2680 | 2680 | ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
| 2681 | 2681 | $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
| 2682 | 2682 | $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue |
@@ -2726,7 +2726,7 @@ discard block |
||
| 2726 | 2726 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2727 | 2727 | $y += 3; |
| 2728 | 2728 | //desenha a caixa dos dados dos itens da NF |
| 2729 | - $hmax += 1; |
|
| 2729 | + $hmax += 1; |
|
| 2730 | 2730 | $texto = ''; |
| 2731 | 2731 | $this->pdf->textBox($x, $y, $w, $hmax); |
| 2732 | 2732 | //################################################################################## |
@@ -2739,101 +2739,101 @@ discard block |
||
| 2739 | 2739 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2740 | 2740 | $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax); |
| 2741 | 2741 | //DESCRIÇÃO DO PRODUTO / SERVIÇO |
| 2742 | - $x += $w1; |
|
| 2742 | + $x += $w1; |
|
| 2743 | 2743 | $w2 = round($w * 0.25, 0); |
| 2744 | 2744 | $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO'; |
| 2745 | 2745 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2746 | 2746 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2747 | 2747 | $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax); |
| 2748 | 2748 | //NCM/SH |
| 2749 | - $x += $w2; |
|
| 2749 | + $x += $w2; |
|
| 2750 | 2750 | $w3 = round($w * 0.06, 0); |
| 2751 | 2751 | $texto = 'NCM/SH'; |
| 2752 | 2752 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2753 | 2753 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2754 | 2754 | $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax); |
| 2755 | 2755 | //O/CST ou O/CSOSN |
| 2756 | - $x += $w3; |
|
| 2756 | + $x += $w3; |
|
| 2757 | 2757 | $w4 = round($w * 0.05, 0); |
| 2758 | 2758 | $texto = 'O/CST'; // CRT = 2 ou CRT = 3 |
| 2759 | 2759 | if ($this->getTagValue($this->emit, 'CRT') == '1') { |
| 2760 | - $texto = 'O/CSOSN';//Regime do Simples CRT = 1 |
|
| 2760 | + $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 |
|
| 2761 | 2761 | } |
| 2762 | 2762 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2763 | 2763 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2764 | 2764 | $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax); |
| 2765 | 2765 | //CFOP |
| 2766 | - $x += $w4; |
|
| 2766 | + $x += $w4; |
|
| 2767 | 2767 | $w5 = round($w * 0.04, 0); |
| 2768 | 2768 | $texto = 'CFOP'; |
| 2769 | 2769 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2770 | 2770 | $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2771 | 2771 | $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax); |
| 2772 | 2772 | //UN |
| 2773 | - $x += $w5; |
|
| 2773 | + $x += $w5; |
|
| 2774 | 2774 | $w6 = round($w * 0.03, 0); |
| 2775 | 2775 | $texto = 'UN'; |
| 2776 | 2776 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2777 | 2777 | $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2778 | 2778 | $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax); |
| 2779 | 2779 | //QUANT |
| 2780 | - $x += $w6; |
|
| 2780 | + $x += $w6; |
|
| 2781 | 2781 | $w7 = round($w * 0.08, 0); |
| 2782 | 2782 | $texto = 'QUANT'; |
| 2783 | 2783 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2784 | 2784 | $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2785 | 2785 | $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax); |
| 2786 | 2786 | //VALOR UNIT |
| 2787 | - $x += $w7; |
|
| 2787 | + $x += $w7; |
|
| 2788 | 2788 | $w8 = round($w * 0.06, 0); |
| 2789 | 2789 | $texto = 'VALOR UNIT'; |
| 2790 | 2790 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2791 | 2791 | $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2792 | 2792 | $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax); |
| 2793 | 2793 | //VALOR TOTAL |
| 2794 | - $x += $w8; |
|
| 2794 | + $x += $w8; |
|
| 2795 | 2795 | $w9 = round($w * 0.06, 0); |
| 2796 | 2796 | $texto = 'VALOR TOTAL'; |
| 2797 | 2797 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2798 | 2798 | $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2799 | 2799 | $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax); |
| 2800 | 2800 | //VALOR DESCONTO |
| 2801 | - $x += $w9; |
|
| 2801 | + $x += $w9; |
|
| 2802 | 2802 | $w10 = round($w * 0.05, 0); |
| 2803 | 2803 | $texto = 'VALOR DESC'; |
| 2804 | 2804 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2805 | 2805 | $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2806 | 2806 | $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax); |
| 2807 | 2807 | //B.CÁLC ICMS |
| 2808 | - $x += $w10; |
|
| 2808 | + $x += $w10; |
|
| 2809 | 2809 | $w11 = round($w * 0.06, 0); |
| 2810 | 2810 | $texto = 'B.CÁLC ICMS'; |
| 2811 | 2811 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2812 | 2812 | $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2813 | 2813 | $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax); |
| 2814 | 2814 | //VALOR ICMS |
| 2815 | - $x += $w11; |
|
| 2815 | + $x += $w11; |
|
| 2816 | 2816 | $w12 = round($w * 0.06, 0); |
| 2817 | 2817 | $texto = 'VALOR ICMS'; |
| 2818 | 2818 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2819 | 2819 | $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2820 | 2820 | $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax); |
| 2821 | 2821 | //VALOR IPI |
| 2822 | - $x += $w12; |
|
| 2822 | + $x += $w12; |
|
| 2823 | 2823 | $w13 = round($w * 0.05, 0); |
| 2824 | 2824 | $texto = 'VALOR IPI'; |
| 2825 | 2825 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2826 | 2826 | $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2827 | 2827 | $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax); |
| 2828 | 2828 | //ALÍQ. ICMS |
| 2829 | - $x += $w13; |
|
| 2829 | + $x += $w13; |
|
| 2830 | 2830 | $w14 = round($w * 0.04, 0); |
| 2831 | 2831 | $texto = 'ALÍQ. ICMS'; |
| 2832 | 2832 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2833 | 2833 | $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2834 | 2834 | $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax); |
| 2835 | 2835 | //ALÍQ. IPI |
| 2836 | - $x += $w14; |
|
| 2836 | + $x += $w14; |
|
| 2837 | 2837 | $w15 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14); |
| 2838 | 2838 | $texto = 'ALÍQ. IPI'; |
| 2839 | 2839 | $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
@@ -2886,7 +2886,7 @@ discard block |
||
| 2886 | 2886 | // Informação sobre unidade de medida tributavel. |
| 2887 | 2887 | // Se não for para exibir a unidade de medida tributavel, então |
| 2888 | 2888 | // A Escrita irá começar em 0. |
| 2889 | - if (! $mostrarUnidadeTributavel) { |
|
| 2889 | + if (!$mostrarUnidadeTributavel) { |
|
| 2890 | 2890 | $yTrib = 0; |
| 2891 | 2891 | } |
| 2892 | 2892 | $h = $this->calculeHeight($thisItem, $mostrarUnidadeTributavel); |
@@ -2921,7 +2921,7 @@ discard block |
||
| 2921 | 2921 | } |
| 2922 | 2922 | $x += $w2; |
| 2923 | 2923 | //NCM |
| 2924 | - $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
| 2924 | + $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
| 2925 | 2925 | $prod->getElementsByTagName("NCM")->item(0)->nodeValue : ''; |
| 2926 | 2926 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2927 | 2927 | $x += $w3; |
@@ -2934,11 +2934,11 @@ discard block |
||
| 2934 | 2934 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2935 | 2935 | } |
| 2936 | 2936 | //CFOP |
| 2937 | - $x += $w4; |
|
| 2937 | + $x += $w4; |
|
| 2938 | 2938 | $texto = $prod->getElementsByTagName("CFOP")->item(0)->nodeValue; |
| 2939 | 2939 | $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2940 | 2940 | //Unidade |
| 2941 | - $x += $w5; |
|
| 2941 | + $x += $w5; |
|
| 2942 | 2942 | $texto = $uCom; |
| 2943 | 2943 | $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2944 | 2944 | //Unidade de medida tributável |
@@ -2960,7 +2960,7 @@ discard block |
||
| 2960 | 2960 | // QTDADE Tributável |
| 2961 | 2961 | if ($mostrarUnidadeTributavel) { |
| 2962 | 2962 | $qTrib = $prod->getElementsByTagName("qTrib")->item(0); |
| 2963 | - if (! empty($qTrib)) { |
|
| 2963 | + if (!empty($qTrib)) { |
|
| 2964 | 2964 | $texto = number_format($qTrib->nodeValue, $this->qComCasasDec, ",", "."); |
| 2965 | 2965 | $this->pdf->textBox($x, $yTrib, $w7, $h, $texto, $aFont, 'T', $alinhamento, 0, ''); |
| 2966 | 2966 | } |
@@ -2973,7 +2973,7 @@ discard block |
||
| 2973 | 2973 | // Valor Unitário Tributável |
| 2974 | 2974 | if ($mostrarUnidadeTributavel) { |
| 2975 | 2975 | $vUnTrib = $prod->getElementsByTagName("vUnTrib")->item(0); |
| 2976 | - if (! empty($vUnTrib)) { |
|
| 2976 | + if (!empty($vUnTrib)) { |
|
| 2977 | 2977 | $texto = number_format($vUnTrib->nodeValue, $this->vUnComCasasDec, ",", "."); |
| 2978 | 2978 | $this->pdf->textBox($x, $yTrib, $w8, $h, $texto, $aFont, 'T', $alinhamento, 0, ''); |
| 2979 | 2979 | } |
@@ -2987,7 +2987,7 @@ discard block |
||
| 2987 | 2987 | $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'T', $alinhamento, 0, ''); |
| 2988 | 2988 | $x += $w9; |
| 2989 | 2989 | //Valor do Desconto |
| 2990 | - $vdesc = ! empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue) |
|
| 2990 | + $vdesc = !empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue) |
|
| 2991 | 2991 | ? $prod->getElementsByTagName("vDesc")->item(0)->nodeValue : 0; |
| 2992 | 2992 | |
| 2993 | 2993 | $texto = number_format($vdesc, 2, ",", "."); |
@@ -2995,7 +2995,7 @@ discard block |
||
| 2995 | 2995 | //Valor da Base de calculo |
| 2996 | 2996 | $x += $w10; |
| 2997 | 2997 | if (isset($ICMS)) { |
| 2998 | - $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) |
|
| 2998 | + $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) |
|
| 2999 | 2999 | ? number_format( |
| 3000 | 3000 | $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue, |
| 3001 | 3001 | 2, |
@@ -3008,7 +3008,7 @@ discard block |
||
| 3008 | 3008 | //Valor do ICMS |
| 3009 | 3009 | $x += $w11; |
| 3010 | 3010 | if (isset($ICMS)) { |
| 3011 | - $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) |
|
| 3011 | + $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) |
|
| 3012 | 3012 | ? number_format( |
| 3013 | 3013 | $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue, |
| 3014 | 3014 | 2, |
@@ -3021,7 +3021,7 @@ discard block |
||
| 3021 | 3021 | //Valor do IPI |
| 3022 | 3022 | $x += $w12; |
| 3023 | 3023 | if (isset($IPI)) { |
| 3024 | - $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) |
|
| 3024 | + $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) |
|
| 3025 | 3025 | ? number_format( |
| 3026 | 3026 | $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, |
| 3027 | 3027 | 2, |
@@ -3036,7 +3036,7 @@ discard block |
||
| 3036 | 3036 | // %ICMS |
| 3037 | 3037 | $x += $w13; |
| 3038 | 3038 | if (isset($ICMS)) { |
| 3039 | - $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) |
|
| 3039 | + $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) |
|
| 3040 | 3040 | ? number_format( |
| 3041 | 3041 | $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue, |
| 3042 | 3042 | 2, |
@@ -3049,7 +3049,7 @@ discard block |
||
| 3049 | 3049 | //%IPI |
| 3050 | 3050 | $x += $w14; |
| 3051 | 3051 | if (isset($IPI)) { |
| 3052 | - $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) |
|
| 3052 | + $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) |
|
| 3053 | 3053 | ? number_format( |
| 3054 | 3054 | $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue, |
| 3055 | 3055 | 2, |
@@ -3067,17 +3067,17 @@ discard block |
||
| 3067 | 3067 | $veicProd = $prod->getElementsByTagName("veicProd")->item(0); |
| 3068 | 3068 | // Tag somente é gerada para veiculo 0k, e só é permitido um veiculo por NF-e por conta do detran |
| 3069 | 3069 | // Verifica se a Tag existe |
| 3070 | - if (! empty($veicProd)) { |
|
| 3070 | + if (!empty($veicProd)) { |
|
| 3071 | 3071 | $this->dadosItenVeiculoDANFE($oldX, $y, $nInicio, $h, $prod); |
| 3072 | 3072 | } |
| 3073 | 3073 | |
| 3074 | 3074 | |
| 3075 | 3075 | $y += $h; |
| 3076 | - $i ++; |
|
| 3076 | + $i++; |
|
| 3077 | 3077 | //incrementa o controle dos itens processados. |
| 3078 | - $this->qtdeItensProc ++; |
|
| 3078 | + $this->qtdeItensProc++; |
|
| 3079 | 3079 | } else { |
| 3080 | - $i ++; |
|
| 3080 | + $i++; |
|
| 3081 | 3081 | } |
| 3082 | 3082 | } |
| 3083 | 3083 | |
@@ -3282,23 +3282,23 @@ discard block |
||
| 3282 | 3282 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B']; |
| 3283 | 3283 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 3284 | 3284 | //INSCRIÇÃO MUNICIPAL |
| 3285 | - $y += 3; |
|
| 3285 | + $y += 3; |
|
| 3286 | 3286 | $w = round($this->wPrint * 0.23, 0); |
| 3287 | 3287 | $texto = 'INSCRIÇÃO MUNICIPAL'; |
| 3288 | 3288 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 3289 | 3289 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 3290 | 3290 | //inscrição municipal |
| 3291 | - $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
| 3291 | + $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
| 3292 | 3292 | $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : ''; |
| 3293 | 3293 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 3294 | 3294 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 3295 | 3295 | //VALOR TOTAL DOS SERVIÇOS |
| 3296 | - $x += $w; |
|
| 3296 | + $x += $w; |
|
| 3297 | 3297 | $texto = 'VALOR TOTAL DOS SERVIÇOS'; |
| 3298 | 3298 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 3299 | 3299 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 3300 | 3300 | if (isset($this->ISSQNtot)) { |
| 3301 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
| 3301 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
| 3302 | 3302 | $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : ''; |
| 3303 | 3303 | $texto = number_format($texto, 2, ",", "."); |
| 3304 | 3304 | } else { |
@@ -3307,14 +3307,14 @@ discard block |
||
| 3307 | 3307 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 3308 | 3308 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 3309 | 3309 | //BASE DE CÁLCULO DO ISSQN |
| 3310 | - $x += $w; |
|
| 3310 | + $x += $w; |
|
| 3311 | 3311 | $texto = 'BASE DE CÁLCULO DO ISSQN'; |
| 3312 | 3312 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 3313 | 3313 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 3314 | 3314 | if (isset($this->ISSQNtot)) { |
| 3315 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 3315 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 3316 | 3316 | $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : ''; |
| 3317 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3317 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3318 | 3318 | } else { |
| 3319 | 3319 | $texto = ''; |
| 3320 | 3320 | } |
@@ -3331,9 +3331,9 @@ discard block |
||
| 3331 | 3331 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 3332 | 3332 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 3333 | 3333 | if (isset($this->ISSQNtot)) { |
| 3334 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
| 3334 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
| 3335 | 3335 | $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : ''; |
| 3336 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3336 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3337 | 3337 | } else { |
| 3338 | 3338 | $texto = ''; |
| 3339 | 3339 | } |
@@ -3372,7 +3372,7 @@ discard block |
||
| 3372 | 3372 | |
| 3373 | 3373 | //INFORMAÇÕES COMPLEMENTARES |
| 3374 | 3374 | $texto = "INFORMAÇÕES COMPLEMENTARES"; |
| 3375 | - $y += 3; |
|
| 3375 | + $y += 3; |
|
| 3376 | 3376 | $w = $this->wAdic; |
| 3377 | 3377 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => 'B']; |
| 3378 | 3378 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3382,7 +3382,7 @@ discard block |
||
| 3382 | 3382 | //$this->textoAdic com o texto completo do campo |
| 3383 | 3383 | //echo str_replace("\n", "<br>",$this->textoAdic); |
| 3384 | 3384 | //die; |
| 3385 | - $y += 1; |
|
| 3385 | + $y += 1; |
|
| 3386 | 3386 | $aFont = ['font' => $this->fontePadrao, 'size' => $this->textadicfontsize * $this->pdf->k, 'style' => '']; |
| 3387 | 3387 | //$aFont = ['font'=>$this->fontePadrao, 'size'=> 5, 'style'=>'']; |
| 3388 | 3388 | $this->pdf->textBox($x, $y + 2, $w - 2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
@@ -3427,7 +3427,7 @@ discard block |
||
| 3427 | 3427 | $texto = "CONTINGÊNCIA SVC-RS\n" . $dhCont . "\n" . $xJust; |
| 3428 | 3428 | break; |
| 3429 | 3429 | } |
| 3430 | - $y += 2; |
|
| 3430 | + $y += 2; |
|
| 3431 | 3431 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => '']; |
| 3432 | 3432 | $this->pdf->textBox($x, $y, $w - 2, $h, $texto, $aFont, 'T', 'L', 0, '', false); |
| 3433 | 3433 | |
@@ -3482,7 +3482,7 @@ discard block |
||
| 3482 | 3482 | $tpNF = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue; |
| 3483 | 3483 | if ($tpNF == '0') { |
| 3484 | 3484 | //NFe de Entrada |
| 3485 | - $emitente = ''; |
|
| 3485 | + $emitente = ''; |
|
| 3486 | 3486 | $emitente .= $this->dest->getElementsByTagName("xNome")->item(0)->nodeValue . " - "; |
| 3487 | 3487 | $emitente .= $this->enderDest->getElementsByTagName("xLgr")->item(0)->nodeValue . ", "; |
| 3488 | 3488 | $emitente .= $this->enderDest->getElementsByTagName("nro")->item(0)->nodeValue . " - "; |
@@ -3535,10 +3535,10 @@ discard block |
||
| 3535 | 3535 | $texto .= "AO LADO"; |
| 3536 | 3536 | } |
| 3537 | 3537 | $texto .= ". EMISSÃO: "; |
| 3538 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3538 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3539 | 3539 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 3540 | 3540 | if ($dEmi == '') { |
| 3541 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3541 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3542 | 3542 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 3543 | 3543 | $aDemi = explode('T', $dEmi); |
| 3544 | 3544 | $dEmi = $aDemi[0]; |
@@ -3561,12 +3561,12 @@ discard block |
||
| 3561 | 3561 | $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, ''); |
| 3562 | 3562 | //DATA DE RECEBIMENTO |
| 3563 | 3563 | $texto = "DATA DE RECEBIMENTO"; |
| 3564 | - $y += $h; |
|
| 3564 | + $y += $h; |
|
| 3565 | 3565 | $w2 = round($this->wPrint * 0.17, 0); //35; |
| 3566 | 3566 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 3567 | 3567 | $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3568 | 3568 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
| 3569 | - $x += $w2; |
|
| 3569 | + $x += $w2; |
|
| 3570 | 3570 | $w3 = $w - $w2; |
| 3571 | 3571 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
| 3572 | 3572 | $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3577,7 +3577,7 @@ discard block |
||
| 3577 | 3577 | |
| 3578 | 3578 | return $y; |
| 3579 | 3579 | } else { |
| 3580 | - $x --; |
|
| 3580 | + $x--; |
|
| 3581 | 3581 | $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
| 3582 | 3582 | //NUMERO DA NOTA FISCAL LOGO NFE |
| 3583 | 3583 | $w1 = 18; |
@@ -3598,7 +3598,7 @@ discard block |
||
| 3598 | 3598 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 3599 | 3599 | $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3600 | 3600 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
| 3601 | - $y -= $w2; |
|
| 3601 | + $y -= $w2; |
|
| 3602 | 3602 | $w3 = $w - $w2; |
| 3603 | 3603 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
| 3604 | 3604 | $aFont = ['font' => $this->fontePadrao, 'size' => 5.7, 'style' => '']; |
@@ -3619,18 +3619,18 @@ discard block |
||
| 3619 | 3619 | */ |
| 3620 | 3620 | protected function geraInformacoesDaTagCompra() |
| 3621 | 3621 | { |
| 3622 | - if (! $this->gerarInformacoesAutomaticas) { |
|
| 3622 | + if (!$this->gerarInformacoesAutomaticas) { |
|
| 3623 | 3623 | return ''; |
| 3624 | 3624 | } |
| 3625 | 3625 | $saida = ""; |
| 3626 | 3626 | if (isset($this->compra)) { |
| 3627 | - if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
| 3627 | + if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
| 3628 | 3628 | $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue; |
| 3629 | 3629 | } |
| 3630 | - if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
| 3630 | + if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
| 3631 | 3631 | $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue; |
| 3632 | 3632 | } |
| 3633 | - if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
| 3633 | + if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
| 3634 | 3634 | $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue; |
| 3635 | 3635 | } |
| 3636 | 3636 | } |
@@ -3661,10 +3661,10 @@ discard block |
||
| 3661 | 3661 | if ($icmss > 0) { |
| 3662 | 3662 | $icmss = 1; |
| 3663 | 3663 | } |
| 3664 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3664 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3665 | 3665 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 3666 | 3666 | if ($dEmi == '') { |
| 3667 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3667 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3668 | 3668 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 3669 | 3669 | $aDemi = explode('T', $dEmi); |
| 3670 | 3670 | $dEmi = $aDemi[0]; |
@@ -3688,7 +3688,7 @@ discard block |
||
| 3688 | 3688 | */ |
| 3689 | 3689 | protected function geraInformacoesDasNotasReferenciadas() |
| 3690 | 3690 | { |
| 3691 | - if (! $this->gerarInformacoesAutomaticas) { |
|
| 3691 | + if (!$this->gerarInformacoesAutomaticas) { |
|
| 3692 | 3692 | return ''; |
| 3693 | 3693 | } |
| 3694 | 3694 | $formaNfeRef = "\r\nNFe Ref.: série:%d número:%d emit:%s em %s [%s]"; |
@@ -3716,7 +3716,7 @@ discard block |
||
| 3716 | 3716 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
| 3717 | 3717 | $serie = substr($chave_acesso, 22, 3); |
| 3718 | 3718 | $numero = substr($chave_acesso, 25, 9); |
| 3719 | - $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
| 3719 | + $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
| 3720 | 3720 | } |
| 3721 | 3721 | $refNF = $nfRef->getElementsByTagName('refNF'); |
| 3722 | 3722 | foreach ($refNF as $umaRefNFe) { |
@@ -3727,7 +3727,7 @@ discard block |
||
| 3727 | 3727 | $numero = $umaRefNFe->getElementsByTagName('nNF')->item(0)->nodeValue; |
| 3728 | 3728 | $data = substr($data, 2, 2) . "/20" . substr($data, 0, 2); |
| 3729 | 3729 | $cnpj = $this->formatField($cnpj, "##.###.###/####-##"); |
| 3730 | - $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod); |
|
| 3730 | + $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod); |
|
| 3731 | 3731 | } |
| 3732 | 3732 | $refCTe = $nfRef->getElementsByTagName('refCTe'); |
| 3733 | 3733 | foreach ($refCTe as $chave_acessoRef) { |
@@ -3737,7 +3737,7 @@ discard block |
||
| 3737 | 3737 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
| 3738 | 3738 | $serie = substr($chave_acesso, 22, 3); |
| 3739 | 3739 | $numero = substr($chave_acesso, 25, 9); |
| 3740 | - $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
| 3740 | + $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
| 3741 | 3741 | } |
| 3742 | 3742 | $refECF = $nfRef->getElementsByTagName('refECF'); |
| 3743 | 3743 | foreach ($refECF as $umaRefNFe) { |
@@ -3749,10 +3749,9 @@ discard block |
||
| 3749 | 3749 | $refNFP = $nfRef->getElementsByTagName('refNFP'); |
| 3750 | 3750 | foreach ($refNFP as $umaRefNFe) { |
| 3751 | 3751 | $data = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue; |
| 3752 | - $cnpj = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
| 3753 | - $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : |
|
| 3754 | - ''; |
|
| 3755 | - $cpf = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
| 3752 | + $cnpj = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
| 3753 | + $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : ''; |
|
| 3754 | + $cpf = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
| 3756 | 3755 | $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : ''; |
| 3757 | 3756 | $mod = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue; |
| 3758 | 3757 | $serie = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue; |
@@ -3774,7 +3773,7 @@ discard block |
||
| 3774 | 3773 | private function loadDoc($xml) |
| 3775 | 3774 | { |
| 3776 | 3775 | $this->xml = $xml; |
| 3777 | - if (! empty($xml)) { |
|
| 3776 | + if (!empty($xml)) { |
|
| 3778 | 3777 | $this->dom = new Dom(); |
| 3779 | 3778 | $this->dom->loadXML($this->xml); |
| 3780 | 3779 | if (empty($this->dom->getElementsByTagName("infNFe")->item(0))) { |
@@ -3828,7 +3827,7 @@ discard block |
||
| 3828 | 3827 | $numlinhas = $this->pdf->getNumLines($textoProduto, $w2, $aFont); |
| 3829 | 3828 | |
| 3830 | 3829 | if ($mostrarUnidadeTributavel && $numlinhas == 1) { |
| 3831 | - $numlinhas ++; |
|
| 3830 | + $numlinhas++; |
|
| 3832 | 3831 | } |
| 3833 | 3832 | |
| 3834 | 3833 | return round(($numlinhas * $this->pdf->fontSize) + ($numlinhas * 0.5), 2); |
@@ -7,64 +7,64 @@ discard block |
||
| 7 | 7 | const FPDF_VERSION = '1.81'; |
| 8 | 8 | const FPDF_FONTPATH = 'font/'; |
| 9 | 9 | |
| 10 | - protected $page; // current page number |
|
| 11 | - protected $n; // current object number |
|
| 12 | - protected $offsets; // array of object offsets |
|
| 13 | - protected $buffer; // buffer holding in-memory PDF |
|
| 14 | - protected $pages; // array containing pages |
|
| 15 | - protected $state; // current document state |
|
| 16 | - protected $compress; // compression flag |
|
| 17 | - public $k; // scale factor (number of points in user unit) |
|
| 18 | - protected $defOrientation; // default orientation |
|
| 19 | - protected $curOrientation; // current orientation |
|
| 20 | - protected $stdPageSizes; // standard page sizes |
|
| 21 | - protected $defPageSize; // default page size |
|
| 22 | - protected $curPageSize; // current page size |
|
| 23 | - protected $curRotation; // current page rotation |
|
| 24 | - protected $pageInfo; // page-related data |
|
| 10 | + protected $page; // current page number |
|
| 11 | + protected $n; // current object number |
|
| 12 | + protected $offsets; // array of object offsets |
|
| 13 | + protected $buffer; // buffer holding in-memory PDF |
|
| 14 | + protected $pages; // array containing pages |
|
| 15 | + protected $state; // current document state |
|
| 16 | + protected $compress; // compression flag |
|
| 17 | + public $k; // scale factor (number of points in user unit) |
|
| 18 | + protected $defOrientation; // default orientation |
|
| 19 | + protected $curOrientation; // current orientation |
|
| 20 | + protected $stdPageSizes; // standard page sizes |
|
| 21 | + protected $defPageSize; // default page size |
|
| 22 | + protected $curPageSize; // current page size |
|
| 23 | + protected $curRotation; // current page rotation |
|
| 24 | + protected $pageInfo; // page-related data |
|
| 25 | 25 | protected $wPt; |
| 26 | - protected $hPt; // dimensions of current page in points |
|
| 26 | + protected $hPt; // dimensions of current page in points |
|
| 27 | 27 | protected $w; |
| 28 | - protected $h; // dimensions of current page in user unit |
|
| 29 | - protected $lMargin; // left margin |
|
| 30 | - protected $tMargin; // top margin |
|
| 31 | - protected $rMargin; // right margin |
|
| 32 | - protected $bMargin; // page break margin |
|
| 33 | - protected $cMargin; // cell margin |
|
| 28 | + protected $h; // dimensions of current page in user unit |
|
| 29 | + protected $lMargin; // left margin |
|
| 30 | + protected $tMargin; // top margin |
|
| 31 | + protected $rMargin; // right margin |
|
| 32 | + protected $bMargin; // page break margin |
|
| 33 | + protected $cMargin; // cell margin |
|
| 34 | 34 | protected $x; |
| 35 | - protected $y; // current position in user unit |
|
| 36 | - protected $lasth; // height of last printed cell |
|
| 37 | - protected $lineWidth; // line width in user unit |
|
| 38 | - protected $fontpath; // path containing fonts |
|
| 39 | - protected $coreFonts; // array of core font names |
|
| 40 | - protected $fonts; // array of used fonts |
|
| 41 | - protected $fontFiles; // array of font files |
|
| 42 | - protected $encodings; // array of encodings |
|
| 43 | - protected $cmaps; // array of ToUnicode CMaps |
|
| 44 | - protected $fontFamily; // current font family |
|
| 45 | - protected $fontStyle; // current font style |
|
| 46 | - protected $underline; // underlining flag |
|
| 47 | - protected $currentFont; // current font info |
|
| 48 | - protected $fontSizePt; // current font size in points |
|
| 49 | - public $fontSize; // current font size in user unit |
|
| 50 | - protected $drawColor; // commands for drawing color |
|
| 51 | - protected $fillColor; // commands for filling color |
|
| 52 | - protected $textColor; // commands for text color |
|
| 53 | - protected $colorFlag; // indicates whether fill and text colors are different |
|
| 54 | - protected $withAlpha; // indicates whether alpha channel is used |
|
| 55 | - protected $ws; // word spacing |
|
| 56 | - protected $images; // array of used images |
|
| 57 | - protected $pageLinks; // array of links in pages |
|
| 58 | - protected $links; // array of internal links |
|
| 59 | - protected $autoPageBreak; // automatic page breaking |
|
| 60 | - protected $pageBreakTrigger; // threshold used to trigger page breaks |
|
| 61 | - protected $inHeader; // flag set when processing header |
|
| 62 | - protected $infooter; // flag set when processing footer |
|
| 63 | - protected $aliasNbPages; // alias for total number of pages |
|
| 64 | - protected $zoomMode; // zoom display mode |
|
| 65 | - protected $layoutMode; // layout display mode |
|
| 66 | - protected $metadata; // document properties |
|
| 67 | - protected $pdfVersion; // PDF version number |
|
| 35 | + protected $y; // current position in user unit |
|
| 36 | + protected $lasth; // height of last printed cell |
|
| 37 | + protected $lineWidth; // line width in user unit |
|
| 38 | + protected $fontpath; // path containing fonts |
|
| 39 | + protected $coreFonts; // array of core font names |
|
| 40 | + protected $fonts; // array of used fonts |
|
| 41 | + protected $fontFiles; // array of font files |
|
| 42 | + protected $encodings; // array of encodings |
|
| 43 | + protected $cmaps; // array of ToUnicode CMaps |
|
| 44 | + protected $fontFamily; // current font family |
|
| 45 | + protected $fontStyle; // current font style |
|
| 46 | + protected $underline; // underlining flag |
|
| 47 | + protected $currentFont; // current font info |
|
| 48 | + protected $fontSizePt; // current font size in points |
|
| 49 | + public $fontSize; // current font size in user unit |
|
| 50 | + protected $drawColor; // commands for drawing color |
|
| 51 | + protected $fillColor; // commands for filling color |
|
| 52 | + protected $textColor; // commands for text color |
|
| 53 | + protected $colorFlag; // indicates whether fill and text colors are different |
|
| 54 | + protected $withAlpha; // indicates whether alpha channel is used |
|
| 55 | + protected $ws; // word spacing |
|
| 56 | + protected $images; // array of used images |
|
| 57 | + protected $pageLinks; // array of links in pages |
|
| 58 | + protected $links; // array of internal links |
|
| 59 | + protected $autoPageBreak; // automatic page breaking |
|
| 60 | + protected $pageBreakTrigger; // threshold used to trigger page breaks |
|
| 61 | + protected $inHeader; // flag set when processing header |
|
| 62 | + protected $infooter; // flag set when processing footer |
|
| 63 | + protected $aliasNbPages; // alias for total number of pages |
|
| 64 | + protected $zoomMode; // zoom display mode |
|
| 65 | + protected $layoutMode; // layout display mode |
|
| 66 | + protected $metadata; // document properties |
|
| 67 | + protected $pdfVersion; // PDF version number |
|
| 68 | 68 | |
| 69 | 69 | public function __construct($orientation = 'P', $unit = 'mm', $size = 'A4') |
| 70 | 70 | { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $this->withAlpha = false; |
| 98 | 98 | $this->ws = 0; |
| 99 | 99 | |
| 100 | - $this->fontpath = __DIR__. FPDF_FONTPATH; |
|
| 100 | + $this->fontpath = __DIR__ . FPDF_FONTPATH; |
|
| 101 | 101 | |
| 102 | 102 | // Core fonts |
| 103 | 103 | $this->coreFonts = [ |
@@ -172,6 +172,9 @@ discard block |
||
| 172 | 172 | $this->pdfVersion = '1.3'; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | + /** |
|
| 176 | + * @param integer $right |
|
| 177 | + */ |
|
| 175 | 178 | public function setMargins($left, $top, $right = null) |
| 176 | 179 | { |
| 177 | 180 | // Set left, top and right margins |
@@ -204,6 +207,9 @@ discard block |
||
| 204 | 207 | $this->rMargin = $margin; |
| 205 | 208 | } |
| 206 | 209 | |
| 210 | + /** |
|
| 211 | + * @param boolean $auto |
|
| 212 | + */ |
|
| 207 | 213 | public function setautoPageBreak($auto, $margin = 0) |
| 208 | 214 | { |
| 209 | 215 | // Set auto page break mode and triggering margin |
@@ -211,6 +217,10 @@ discard block |
||
| 211 | 217 | $this->bMargin = $margin; |
| 212 | 218 | $this->pageBreakTrigger = $this->h - $margin; |
| 213 | 219 | } |
| 220 | + |
|
| 221 | + /** |
|
| 222 | + * @param string $zoom |
|
| 223 | + */ |
|
| 214 | 224 | public function setDisplayMode($zoom, $layout = 'default') |
| 215 | 225 | { |
| 216 | 226 | // Set display mode in viewer |
@@ -226,6 +236,9 @@ discard block |
||
| 226 | 236 | } |
| 227 | 237 | } |
| 228 | 238 | |
| 239 | + /** |
|
| 240 | + * @param boolean $compress |
|
| 241 | + */ |
|
| 229 | 242 | public function setCompression($compress) |
| 230 | 243 | { |
| 231 | 244 | // Set page compression |
@@ -272,6 +285,9 @@ discard block |
||
| 272 | 285 | $this->aliasNbPages = $alias; |
| 273 | 286 | } |
| 274 | 287 | |
| 288 | + /** |
|
| 289 | + * @param string $msg |
|
| 290 | + */ |
|
| 275 | 291 | public function error($msg) |
| 276 | 292 | { |
| 277 | 293 | // Fatal error |
@@ -382,6 +398,12 @@ discard block |
||
| 382 | 398 | // Get current page number |
| 383 | 399 | return $this->page; |
| 384 | 400 | } |
| 401 | + |
|
| 402 | + /** |
|
| 403 | + * @param integer $r |
|
| 404 | + * @param integer $g |
|
| 405 | + * @param integer $b |
|
| 406 | + */ |
|
| 385 | 407 | public function setdrawColor($r, $g = null, $b = null) |
| 386 | 408 | { |
| 387 | 409 | // Set color for all stroking operations |
@@ -395,6 +417,11 @@ discard block |
||
| 395 | 417 | } |
| 396 | 418 | } |
| 397 | 419 | |
| 420 | + /** |
|
| 421 | + * @param integer $r |
|
| 422 | + * @param integer $g |
|
| 423 | + * @param integer $b |
|
| 424 | + */ |
|
| 398 | 425 | public function setfillColor($r, $g = null, $b = null) |
| 399 | 426 | { |
| 400 | 427 | // Set color for all filling operations |
@@ -409,6 +436,11 @@ discard block |
||
| 409 | 436 | } |
| 410 | 437 | } |
| 411 | 438 | |
| 439 | + /** |
|
| 440 | + * @param integer $r |
|
| 441 | + * @param integer $g |
|
| 442 | + * @param integer $b |
|
| 443 | + */ |
|
| 412 | 444 | public function settextColor($r, $g = null, $b = null) |
| 413 | 445 | { |
| 414 | 446 | // Set color for text |
@@ -478,6 +510,9 @@ discard block |
||
| 478 | 510 | ); |
| 479 | 511 | } |
| 480 | 512 | |
| 513 | + /** |
|
| 514 | + * @param string $family |
|
| 515 | + */ |
|
| 481 | 516 | public function addFont($family, $style = '', $file = '') |
| 482 | 517 | { |
| 483 | 518 | // Add a TrueType, OpenType or Type1 font |
@@ -594,6 +629,10 @@ discard block |
||
| 594 | 629 | $this->links[$link] = [$page, $y]; |
| 595 | 630 | } |
| 596 | 631 | |
| 632 | + /** |
|
| 633 | + * @param double $y |
|
| 634 | + * @param string $link |
|
| 635 | + */ |
|
| 597 | 636 | public function link($x, $y, $w, $h, $link) |
| 598 | 637 | { |
| 599 | 638 | // Put a link on the page |
@@ -606,6 +645,10 @@ discard block |
||
| 606 | 645 | ]; |
| 607 | 646 | } |
| 608 | 647 | |
| 648 | + /** |
|
| 649 | + * @param double $y |
|
| 650 | + * @param string $txt |
|
| 651 | + */ |
|
| 609 | 652 | public function text($x, $y, $txt) |
| 610 | 653 | { |
| 611 | 654 | // output a string |
@@ -770,6 +813,9 @@ discard block |
||
| 770 | 813 | } |
| 771 | 814 | } |
| 772 | 815 | |
| 816 | + /** |
|
| 817 | + * @param integer $h |
|
| 818 | + */ |
|
| 773 | 819 | public function multiCell($w, $h, $txt, $border = 0, $align = 'J', $fill = false) |
| 774 | 820 | { |
| 775 | 821 | // output text with automatic or explicit line breaks |
@@ -970,6 +1016,9 @@ discard block |
||
| 970 | 1016 | } |
| 971 | 1017 | } |
| 972 | 1018 | |
| 1019 | + /** |
|
| 1020 | + * @param string $file |
|
| 1021 | + */ |
|
| 973 | 1022 | public function image($file, $x = null, $y = null, $w = 0, $h = 0, $type = '', $link = '') |
| 974 | 1023 | { |
| 975 | 1024 | // Put an image on the page |
@@ -1214,6 +1263,10 @@ discard block |
||
| 1214 | 1263 | } |
| 1215 | 1264 | } |
| 1216 | 1265 | |
| 1266 | + /** |
|
| 1267 | + * @param string $orientation |
|
| 1268 | + * @param string $size |
|
| 1269 | + */ |
|
| 1217 | 1270 | protected function beginPage($orientation, $size, $rotation) |
| 1218 | 1271 | { |
| 1219 | 1272 | $this->page++; |
@@ -1416,6 +1469,9 @@ discard block |
||
| 1416 | 1469 | ]; |
| 1417 | 1470 | } |
| 1418 | 1471 | |
| 1472 | + /** |
|
| 1473 | + * @param string $file |
|
| 1474 | + */ |
|
| 1419 | 1475 | protected function parsePng($file) |
| 1420 | 1476 | { |
| 1421 | 1477 | // Extract info from a PNG file |
@@ -279,7 +279,6 @@ |
||
| 279 | 279 | |
| 280 | 280 | /** |
| 281 | 281 | * Carrega os dados do xml na classe |
| 282 | - * @param string $xml |
|
| 283 | 282 | * |
| 284 | 283 | * @throws InvalidArgumentException |
| 285 | 284 | */ |
@@ -13,13 +13,11 @@ |
||
| 13 | 13 | * @link http://github.com/nfephp-org/sped-da for the canonical source repository |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -use DateTime; |
|
| 17 | 16 | use Exception; |
| 18 | 17 | use InvalidArgumentException; |
| 19 | 18 | use NFePHP\DA\Legacy\Dom; |
| 20 | 19 | use NFePHP\DA\Legacy\Pdf; |
| 21 | 20 | use NFePHP\DA\Common\DaCommon; |
| 22 | -use Com\Tecnick\Barcode\Barcode; |
|
| 23 | 21 | |
| 24 | 22 | class Danfce extends DaCommon |
| 25 | 23 | { |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | protected $paperwidth = 80; |
| 28 | 28 | protected $descPercent = 0.38; |
| 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 $nfeProc; |
| 33 | 33 | protected $nfe; |
| 34 | 34 | protected $infNFe; |
@@ -221,10 +221,10 @@ discard block |
||
| 221 | 221 | //total inicial de paginas |
| 222 | 222 | $totPag = 1; |
| 223 | 223 | //largura imprimivel em mm: largura da folha menos as margens esq/direita |
| 224 | - $this->wPrint = $maxW-($margEsq*2); |
|
| 224 | + $this->wPrint = $maxW - ($margEsq * 2); |
|
| 225 | 225 | //comprimento (altura) imprimivel em mm: altura da folha menos as margens |
| 226 | 226 | //superior e inferior |
| 227 | - $this->hPrint = $maxH-$margSup-$margInf; |
|
| 227 | + $this->hPrint = $maxH - $margSup - $margInf; |
|
| 228 | 228 | // estabelece contagem de paginas |
| 229 | 229 | $this->pdf->aliasNbPages(); |
| 230 | 230 | $this->pdf->setMargins($margEsq, $margSup); // fixa as margens |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | $y = $this->blocoIX($y); //informações complementares e sobre tributos |
| 249 | 249 | $y = $this->blocoX($y); //creditos |
| 250 | 250 | |
| 251 | - $ymark = $maxH/4; |
|
| 251 | + $ymark = $maxH / 4; |
|
| 252 | 252 | if ($this->tpAmb == 2) { |
| 253 | 253 | $this->pdf->setTextColor(120, 120, 120); |
| 254 | 254 | $texto = "SEM VALOR FISCAL\nEmitida em ambiente de homologacao"; |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | $this->margem, |
| 258 | 258 | $ymark, |
| 259 | 259 | $this->wPrint, |
| 260 | - $maxH/2, |
|
| 260 | + $maxH / 2, |
|
| 261 | 261 | $texto, |
| 262 | 262 | $aFont, |
| 263 | 263 | 'T', |
@@ -274,9 +274,9 @@ discard block |
||
| 274 | 274 | $aFont = ['font' => $this->fontePadrao, 'size' => 24, 'style' => 'B']; |
| 275 | 275 | $this->pdf->textBox( |
| 276 | 276 | $this->margem, |
| 277 | - $ymark+4, |
|
| 277 | + $ymark + 4, |
|
| 278 | 278 | $this->wPrint, |
| 279 | - $maxH/2, |
|
| 279 | + $maxH / 2, |
|
| 280 | 280 | $texto, |
| 281 | 281 | $aFont, |
| 282 | 282 | 'T', |
@@ -288,9 +288,9 @@ discard block |
||
| 288 | 288 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 289 | 289 | $this->pdf->textBox( |
| 290 | 290 | $this->margem, |
| 291 | - $ymark+14, |
|
| 291 | + $ymark + 14, |
|
| 292 | 292 | $this->wPrint, |
| 293 | - $maxH/2, |
|
| 293 | + $maxH / 2, |
|
| 294 | 294 | $this->submessage, |
| 295 | 295 | $aFont, |
| 296 | 296 | 'T', |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | $y = $this->blocoVIII($y); //QRCODE |
| 319 | 319 | $y = $this->blocoIX($y); //informações sobre tributos |
| 320 | 320 | $y = $this->blocoX($y); //creditos |
| 321 | - $ymark = $maxH/4; |
|
| 321 | + $ymark = $maxH / 4; |
|
| 322 | 322 | if ($this->tpAmb == 2) { |
| 323 | 323 | $this->pdf->setTextColor(120, 120, 120); |
| 324 | 324 | $texto = "SEM VALOR FISCAL\nEmitida em ambiente de homologacao"; |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | $this->margem, |
| 328 | 328 | $ymark, |
| 329 | 329 | $this->wPrint, |
| 330 | - $maxH/2, |
|
| 330 | + $maxH / 2, |
|
| 331 | 331 | $texto, |
| 332 | 332 | $aFont, |
| 333 | 333 | 'T', |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | } elseif (!empty($retEvento = $this->nfeProc->getElementsByTagName('retEvento')->item(0))) { |
| 414 | 414 | $infEvento = $retEvento->getElementsByTagName('infEvento')->item(0); |
| 415 | 415 | $cStat = $this->getTagValue($infEvento, "cStat"); |
| 416 | - $tpEvento= $this->getTagValue($infEvento, "tpEvento"); |
|
| 416 | + $tpEvento = $this->getTagValue($infEvento, "tpEvento"); |
|
| 417 | 417 | $dhEvento = date( |
| 418 | 418 | "d/m/Y H:i:s", |
| 419 | 419 | $this->toTimestamp( |
@@ -31,13 +31,13 @@ discard block |
||
| 31 | 31 | $xImg = $this->margem; |
| 32 | 32 | $yImg = $this->margem + 1; |
| 33 | 33 | $logoInfo = getimagesize($this->logomarca); |
| 34 | - $logoWmm = ($logoInfo[0]/72)*25.4; |
|
| 35 | - $logoHmm = ($logoInfo[1]/72)*25.4; |
|
| 36 | - $nImgW = $this->wPrint/4; |
|
| 37 | - $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
|
| 34 | + $logoWmm = ($logoInfo[0] / 72) * 25.4; |
|
| 35 | + $logoHmm = ($logoInfo[1] / 72) * 25.4; |
|
| 36 | + $nImgW = $this->wPrint / 4; |
|
| 37 | + $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
|
| 38 | 38 | if ($nImgH > $maxHimg) { |
| 39 | 39 | $nImgH = $maxHimg; |
| 40 | - $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
|
| 40 | + $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0); |
|
| 41 | 41 | } |
| 42 | 42 | $xRs = ($nImgW) + $this->margem; |
| 43 | 43 | $wRs = ($this->wPrint - $nImgW); |
@@ -52,10 +52,10 @@ discard block |
||
| 52 | 52 | $aFont = ['font'=>$this->fontePadrao, 'size' => 8, 'style' => '']; |
| 53 | 53 | $texto = "{$emitRazao}"; |
| 54 | 54 | $y += $this->pdf->textBox( |
| 55 | - $xRs+2, |
|
| 55 | + $xRs + 2, |
|
| 56 | 56 | $this->margem, |
| 57 | - $wRs-2, |
|
| 58 | - $this->bloco1H-$this->margem-1, |
|
| 57 | + $wRs - 2, |
|
| 58 | + $this->bloco1H - $this->margem - 1, |
|
| 59 | 59 | $texto, |
| 60 | 60 | $aFont, |
| 61 | 61 | 'T', |
@@ -68,13 +68,13 @@ discard block |
||
| 68 | 68 | $aFont = ['font'=>$this->fontePadrao, 'size' => $this->pdf->fontSizePt, 'style' => '']; |
| 69 | 69 | } |
| 70 | 70 | $texto = "CNPJ: {$emitCnpj} IE: {$emitIE}"; |
| 71 | - $y += $this->pdf->textBox($xRs+2, $y, $wRs-2, 3, $texto, $aFont, 'T', $alignH, false, '', true); |
|
| 71 | + $y += $this->pdf->textBox($xRs + 2, $y, $wRs - 2, 3, $texto, $aFont, 'T', $alignH, false, '', true); |
|
| 72 | 72 | $texto = $emitLgr . ", " . $emitNro; |
| 73 | - $y += $this->pdf->textBox($xRs+2, $y, $wRs-2, 3, $texto, $aFont, 'T', $alignH, false, '', true); |
|
| 73 | + $y += $this->pdf->textBox($xRs + 2, $y, $wRs - 2, 3, $texto, $aFont, 'T', $alignH, false, '', true); |
|
| 74 | 74 | $texto = $emitBairro; |
| 75 | - $y += $this->pdf->textBox($xRs+2, $y, $wRs-2, 3, $texto, $aFont, 'T', $alignH, false, '', true); |
|
| 75 | + $y += $this->pdf->textBox($xRs + 2, $y, $wRs - 2, 3, $texto, $aFont, 'T', $alignH, false, '', true); |
|
| 76 | 76 | $texto = $emitMun . "-" . $emitUF; |
| 77 | - $y += $this->pdf->textBox($xRs+2, $y, $wRs-2, 3, $texto, $aFont, 'T', $alignH, false, '', true); |
|
| 77 | + $y += $this->pdf->textBox($xRs + 2, $y, $wRs - 2, 3, $texto, $aFont, 'T', $alignH, false, '', true); |
|
| 78 | 78 | $this->pdf->dashedHLine($this->margem, $this->bloco1H, $this->wPrint, 0.1, 30); |
| 79 | 79 | return $this->bloco1H; |
| 80 | 80 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => '']; |
| 35 | 35 | $y1 += $this->pdf->textBox( |
| 36 | 36 | $this->margem, |
| 37 | - $y+$y1, |
|
| 37 | + $y + $y1, |
|
| 38 | 38 | $this->wPrint, |
| 39 | 39 | 2, |
| 40 | 40 | $texto, |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $aFont = ['font'=> $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 51 | 51 | $y2 = $this->pdf->textBox( |
| 52 | 52 | $this->margem, |
| 53 | - $y+$y1, |
|
| 53 | + $y + $y1, |
|
| 54 | 54 | $this->wPrint, |
| 55 | 55 | 4, |
| 56 | 56 | $texto, |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $aFont = ['font'=> $this->fontePadrao, 'size' => 8, 'style' => 'I']; |
| 67 | 67 | $this->pdf->textBox( |
| 68 | 68 | $this->margem, |
| 69 | - $y+$y1+$y2, |
|
| 69 | + $y + $y1 + $y2, |
|
| 70 | 70 | $this->wPrint, |
| 71 | 71 | 3, |
| 72 | 72 | $texto, |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => '']; |
| 84 | 84 | $y1 = $this->pdf->textBox( |
| 85 | 85 | $this->margem, |
| 86 | - $this->bloco1H-2, |
|
| 86 | + $this->bloco1H - 2, |
|
| 87 | 87 | $this->wPrint, |
| 88 | 88 | $this->bloco2H, |
| 89 | 89 | $texto, |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | true |
| 96 | 96 | ); |
| 97 | 97 | } |
| 98 | - $this->pdf->dashedHLine($this->margem, $this->bloco2H+$y, $this->wPrint, 0.1, 30); |
|
| 98 | + $this->pdf->dashedHLine($this->margem, $this->bloco2H + $y, $this->wPrint, 0.1, 30); |
|
| 99 | 99 | return $this->bloco2H + $y; |
| 100 | 100 | } |
| 101 | 101 | } |
@@ -30,11 +30,11 @@ discard block |
||
| 30 | 30 | false |
| 31 | 31 | ); |
| 32 | 32 | |
| 33 | - $texto = $this->urlChave; |
|
| 33 | + $texto = $this->urlChave; |
|
| 34 | 34 | $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => '']; |
| 35 | 35 | $y2 = $this->pdf->textBox( |
| 36 | 36 | $this->margem, |
| 37 | - $y+$y1, |
|
| 37 | + $y + $y1, |
|
| 38 | 38 | $this->wPrint, |
| 39 | 39 | 2, |
| 40 | 40 | $texto, |
@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | false |
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | - $chave = str_replace('NFe', '', $this->infNFe->getAttribute("Id")); |
|
| 49 | + $chave = str_replace('NFe', '', $this->infNFe->getAttribute("Id")); |
|
| 50 | 50 | $texto = $this->formatField($chave, $this->formatoChave); |
| 51 | 51 | $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => '']; |
| 52 | 52 | $y3 = $this->pdf->textBox( |
| 53 | 53 | $this->margem, |
| 54 | - $y+$y1+$y2+1, |
|
| 54 | + $y + $y1 + $y2 + 1, |
|
| 55 | 55 | $this->wPrint, |
| 56 | 56 | 2, |
| 57 | 57 | $texto, |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | '', |
| 63 | 63 | true |
| 64 | 64 | ); |
| 65 | - $this->pdf->dashedHLine($this->margem, $this->bloco6H+$y, $this->wPrint, 0.1, 30); |
|
| 65 | + $this->pdf->dashedHLine($this->margem, $this->bloco6H + $y, $this->wPrint, 0.1, 30); |
|
| 66 | 66 | return $this->bloco6H + $y; |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -7,6 +7,9 @@ |
||
| 7 | 7 | */ |
| 8 | 8 | trait TraitBlocoVI |
| 9 | 9 | { |
| 10 | + /** |
|
| 11 | + * @param double $y |
|
| 12 | + */ |
|
| 10 | 13 | protected function blocoVI($y) |
| 11 | 14 | { |
| 12 | 15 | //$this->bloco6H = 10; |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | $maxW = $this->wPrint; |
| 22 | - $w = ($maxW*1)+4; |
|
| 22 | + $w = ($maxW * 1) + 4; |
|
| 23 | 23 | $barcode = new Barcode(); |
| 24 | 24 | $bobj = $barcode->getBarcodeObj( |
| 25 | 25 | 'QRCODE,M', |
@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | $wQr = 50; |
| 34 | 34 | $hQr = 50; |
| 35 | 35 | $yQr = ($y); |
| 36 | - $xQr = ($w/2) - ($wQr/2); |
|
| 36 | + $xQr = ($w / 2) - ($wQr / 2); |
|
| 37 | 37 | $pic = 'data://text/plain;base64,' . base64_encode($qrcode); |
| 38 | 38 | $info = getimagesize($pic); |
| 39 | 39 | $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG'); |
| 40 | - return $this->bloco8H+$y; |
|
| 40 | + return $this->bloco8H + $y; |
|
| 41 | 41 | } |
| 42 | 42 | } |
@@ -8,6 +8,9 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | trait TraitBlocoVIII |
| 10 | 10 | { |
| 11 | + /** |
|
| 12 | + * @param integer $y |
|
| 13 | + */ |
|
| 11 | 14 | protected function blocoVIII($y) |
| 12 | 15 | { |
| 13 | 16 | //$this->bloco8H = 50; |