@@ -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 | { |
@@ -1325,8 +1325,7 @@ discard block |
||
| 1325 | 1325 | $texto = $this->getTagValue($this->enderExped, "xLgr") . ', '; |
| 1326 | 1326 | $texto .= $this->getTagValue($this->enderExped, "nro"); |
| 1327 | 1327 | $texto .= $this->getTagValue($this->enderExped, "xCpl") != "" ? |
| 1328 | - ' - ' . $this->getTagValue($this->enderExped, "xCpl") : |
|
| 1329 | - ''; |
|
| 1328 | + ' - ' . $this->getTagValue($this->enderExped, "xCpl") : ''; |
|
| 1330 | 1329 | } else { |
| 1331 | 1330 | $texto = ''; |
| 1332 | 1331 | } |
@@ -1422,8 +1421,7 @@ discard block |
||
| 1422 | 1421 | $texto = $this->getTagValue($this->enderReceb, "xLgr") . ', '; |
| 1423 | 1422 | $texto .= $this->getTagValue($this->enderReceb, "nro"); |
| 1424 | 1423 | $texto .= ($this->getTagValue($this->enderReceb, "xCpl") != "") ? |
| 1425 | - ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : |
|
| 1426 | - ''; |
|
| 1424 | + ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : ''; |
|
| 1427 | 1425 | } else { |
| 1428 | 1426 | $texto = ''; |
| 1429 | 1427 | } |
@@ -1627,7 +1625,7 @@ discard block |
||
| 1627 | 1625 | $qCarga = 0; |
| 1628 | 1626 | foreach ($this->infQ as $infQ) { |
| 1629 | 1627 | if (in_array($this->getTagValue($infQ, "cUnid"), array('01', '02'))) { |
| 1630 | - $qCarga += (float)$this->getTagValue($infQ, "qCarga"); |
|
| 1628 | + $qCarga += (float) $this->getTagValue($infQ, "qCarga"); |
|
| 1631 | 1629 | } |
| 1632 | 1630 | } |
| 1633 | 1631 | $texto = 'PESO BRUTO (KG)'; |
@@ -1678,7 +1676,7 @@ discard block |
||
| 1678 | 1676 | $qCarga = 0; |
| 1679 | 1677 | foreach ($this->infQ as $infQ) { |
| 1680 | 1678 | if ($this->getTagValue($infQ, "cUnid") == '00') { |
| 1681 | - $qCarga += (float)$this->getTagValue($infQ, "qCarga"); |
|
| 1679 | + $qCarga += (float) $this->getTagValue($infQ, "qCarga"); |
|
| 1682 | 1680 | } |
| 1683 | 1681 | } |
| 1684 | 1682 | $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : ''; |
@@ -1695,7 +1693,7 @@ discard block |
||
| 1695 | 1693 | $qCarga = 0; |
| 1696 | 1694 | foreach ($this->infQ as $infQ) { |
| 1697 | 1695 | if ($this->getTagValue($infQ, "cUnid") == '03') { |
| 1698 | - $qCarga += (float)$this->getTagValue($infQ, "qCarga"); |
|
| 1696 | + $qCarga += (float) $this->getTagValue($infQ, "qCarga"); |
|
| 1699 | 1697 | } |
| 1700 | 1698 | } |
| 1701 | 1699 | $texto = !empty($qCarga) ? number_format($qCarga, 3, ",", ".") : ''; |
@@ -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; |
@@ -310,39 +310,39 @@ discard block |
||
| 310 | 310 | { |
| 311 | 311 | $this->textoAdic = ''; |
| 312 | 312 | //informações adicionais |
| 313 | - $fontProduto = [ |
|
| 313 | + $fontProduto = [ |
|
| 314 | 314 | 'font' => $this->fontePadrao, |
| 315 | 315 | 'size' => 8, |
| 316 | 316 | 'style' => '' |
| 317 | 317 | ]; |
| 318 | 318 | $k = $this->pdf->k; |
| 319 | 319 | $this->textadicfontsize = $fontProduto['size'] / $k; |
| 320 | - $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas(); |
|
| 320 | + $this->textoAdic .= $this->geraInformacoesDasNotasReferenciadas(); |
|
| 321 | 321 | if (isset($this->infAdic)) { |
| 322 | 322 | $i = 0; |
| 323 | 323 | if ($this->textoAdic != '') { |
| 324 | 324 | $this->textoAdic .= ". \n"; |
| 325 | 325 | } |
| 326 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl")) |
|
| 326 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl")) |
|
| 327 | 327 | ? 'Inf. Contribuinte: ' . $this->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl")) |
| 328 | 328 | : ''; |
| 329 | - $infPedido = $this->geraInformacoesDaTagCompra(); |
|
| 329 | + $infPedido = $this->geraInformacoesDaTagCompra(); |
|
| 330 | 330 | if ($infPedido != "") { |
| 331 | 331 | $this->textoAdic .= $infPedido; |
| 332 | 332 | } |
| 333 | 333 | $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: '); |
| 334 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco")) |
|
| 334 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco")) |
|
| 335 | 335 | ? "\n Inf. fisco: " . $this->getTagValue($this->infAdic, "infAdFisco") |
| 336 | 336 | : ''; |
| 337 | - $obsCont = $this->infAdic->getElementsByTagName("obsCont"); |
|
| 337 | + $obsCont = $this->infAdic->getElementsByTagName("obsCont"); |
|
| 338 | 338 | if (isset($obsCont)) { |
| 339 | 339 | foreach ($obsCont as $obs) { |
| 340 | 340 | $campo = $obsCont->item($i)->getAttribute("xCampo"); |
| 341 | - $xTexto = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) |
|
| 341 | + $xTexto = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) |
|
| 342 | 342 | ? $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue |
| 343 | 343 | : ''; |
| 344 | 344 | $this->textoAdic .= "\n" . $campo . ': ' . trim($xTexto); |
| 345 | - $i ++; |
|
| 345 | + $i++; |
|
| 346 | 346 | } |
| 347 | 347 | } |
| 348 | 348 | } |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | $flagVTT = $flagVTT && (strpos(strtolower(trim($this->textoAdic)), 'trib') || |
| 357 | 357 | strpos(strtolower(trim($this->textoAdic)), 'imp')); |
| 358 | 358 | $vTotTrib = $this->getTagValue($this->ICMSTot, 'vTotTrib'); |
| 359 | - if ($vTotTrib != '' && ! $flagVTT) { |
|
| 359 | + if ($vTotTrib != '' && !$flagVTT) { |
|
| 360 | 360 | $this->textoAdic .= "\n Valor Aproximado dos Tributos : R$ " |
| 361 | 361 | . number_format($vTotTrib, 2, ",", "."); |
| 362 | 362 | } |
@@ -367,9 +367,9 @@ discard block |
||
| 367 | 367 | $this->textadicfontsize = $this->pdf->fontSize; |
| 368 | 368 | $hdadosadic = ceil($numlinhasdados * ($this->textadicfontsize)); |
| 369 | 369 | if ($hdadosadic > 70) { |
| 370 | - for ($f = 8; $f > 3; $f --) { |
|
| 370 | + for ($f = 8; $f > 3; $f--) { |
|
| 371 | 371 | $this->pdf->setFont($this->fontePadrao, '', $f); |
| 372 | - $fontProduto = [ |
|
| 372 | + $fontProduto = [ |
|
| 373 | 373 | 'font' => $this->fontePadrao, |
| 374 | 374 | 'size' => $f, |
| 375 | 375 | 'style' => '' |
@@ -497,9 +497,9 @@ discard block |
||
| 497 | 497 | $this->hdadosadic = $this->calculoEspacoVericalDadosAdicionais(); |
| 498 | 498 | |
| 499 | 499 | //altura disponivel para os campos da DANFE |
| 500 | - $hcabecalho = 47;//para cabeçalho |
|
| 501 | - $hdestinatario = 25;//para destinatario |
|
| 502 | - $hduplicatas = 12;//para cada grupo de 7 duplicatas |
|
| 500 | + $hcabecalho = 47; //para cabeçalho |
|
| 501 | + $hdestinatario = 25; //para destinatario |
|
| 502 | + $hduplicatas = 12; //para cada grupo de 7 duplicatas |
|
| 503 | 503 | if (isset($this->entrega)) { |
| 504 | 504 | $hlocalentrega = 25; |
| 505 | 505 | } else { |
@@ -510,11 +510,11 @@ discard block |
||
| 510 | 510 | } else { |
| 511 | 511 | $hlocalretirada = 0; |
| 512 | 512 | } |
| 513 | - $himposto = 18;// para imposto |
|
| 514 | - $htransporte = 25;// para transporte |
|
| 515 | - $hissqn = 11;// para issqn |
|
| 516 | - $hfooter = 5;// para rodape |
|
| 517 | - $hCabecItens = 4;//cabeçalho dos itens |
|
| 513 | + $himposto = 18; // para imposto |
|
| 514 | + $htransporte = 25; // para transporte |
|
| 515 | + $hissqn = 11; // para issqn |
|
| 516 | + $hfooter = 5; // para rodape |
|
| 517 | + $hCabecItens = 4; //cabeçalho dos itens |
|
| 518 | 518 | $hOCUPADA = $hcabecalho |
| 519 | 519 | + $hdestinatario |
| 520 | 520 | + $hlocalentrega |
@@ -537,10 +537,10 @@ discard block |
||
| 537 | 537 | $this->sizeExtraTextoFatura());*/ |
| 538 | 538 | |
| 539 | 539 | if ($this->orientacao == 'P') { |
| 540 | - $hDispo1 -= 24 * $this->qCanhoto;//para canhoto |
|
| 541 | - $w = $this->wPrint; |
|
| 540 | + $hDispo1 -= 24 * $this->qCanhoto; //para canhoto |
|
| 541 | + $w = $this->wPrint; |
|
| 542 | 542 | } else { |
| 543 | - $hcanhoto = $this->hPrint;//para canhoto |
|
| 543 | + $hcanhoto = $this->hPrint; //para canhoto |
|
| 544 | 544 | $w = $this->wPrint - $this->wCanhoto; |
| 545 | 545 | } |
| 546 | 546 | //$hDispo1 += 14; |
@@ -561,18 +561,18 @@ discard block |
||
| 561 | 561 | $prod = $itemProd->getElementsByTagName('prod')->item(0); |
| 562 | 562 | $uCom = $prod->getElementsByTagName("uCom")->item(0)->nodeValue; |
| 563 | 563 | $uTrib = $prod->getElementsByTagName("uTrib")->item(0); |
| 564 | - if (! empty($uTrib) && strcmp($uCom, $uTrib->nodeValue) != 0) { |
|
| 564 | + if (!empty($uTrib) && strcmp($uCom, $uTrib->nodeValue) != 0) { |
|
| 565 | 565 | $mostrarUnidadeTributavel = true; |
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | $hUsado += $this->calculeHeight($itemProd, $mostrarUnidadeTributavel); |
| 569 | 569 | if ($hUsado > $hDispo) { |
| 570 | - $totPag ++; |
|
| 570 | + $totPag++; |
|
| 571 | 571 | $hDispo = $hDispo2; |
| 572 | 572 | $hUsado = $hCabecItens; |
| 573 | - $i --; // decrementa para readicionar o item que não coube nessa pagina na outra. |
|
| 573 | + $i--; // decrementa para readicionar o item que não coube nessa pagina na outra. |
|
| 574 | 574 | } |
| 575 | - $i ++; |
|
| 575 | + $i++; |
|
| 576 | 576 | } //fim da soma das areas de itens usadas |
| 577 | 577 | $qtdeItens = $i; //controle da quantidade de itens no DANFE |
| 578 | 578 | //montagem da primeira página |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | $formaPag = []; |
| 605 | 605 | if (isset($this->detPag) && $this->detPag->length > 0) { |
| 606 | 606 | foreach ($this->detPag as $k => $d) { |
| 607 | - $fPag = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
|
| 607 | + $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
|
| 608 | 608 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue |
| 609 | 609 | : '0'; |
| 610 | 610 | $formaPag[$fPag] = $fPag; |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | } |
| 649 | 649 | |
| 650 | 650 | //loop para páginas seguintes |
| 651 | - for ($n = 2; $n <= $totPag; $n ++) { |
|
| 651 | + for ($n = 2; $n <= $totPag; $n++) { |
|
| 652 | 652 | // fixa as margens |
| 653 | 653 | $this->pdf->setMargins($this->margesq, $this->margsup); |
| 654 | 654 | //adiciona nova página |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | } |
| 673 | 673 | //se estiver na última página e ainda restar itens para inserir, adiciona mais uma página |
| 674 | 674 | if ($n == $totPag && $this->qtdeItensProc < $qtdeItens) { |
| 675 | - $totPag ++; |
|
| 675 | + $totPag++; |
|
| 676 | 676 | } |
| 677 | 677 | } |
| 678 | 678 | } |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | if ($startPos === false) { |
| 702 | 702 | return $cdata; |
| 703 | 703 | } |
| 704 | - for ($x = $len; $x > 0; $x --) { |
|
| 704 | + for ($x = $len; $x > 0; $x--) { |
|
| 705 | 705 | if (substr($cdata, $x, 1) == '>') { |
| 706 | 706 | $endPos = $x; |
| 707 | 707 | break; |
@@ -794,15 +794,15 @@ discard block |
||
| 794 | 794 | //grupo CADATA infCpl |
| 795 | 795 | $t = $dom->getElementsByTagName('transmissor')->item(0); |
| 796 | 796 | $r = $dom->getElementsByTagName('receptor')->item(0); |
| 797 | - $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 797 | + $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 798 | 798 | 'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : ''; |
| 799 | - $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 799 | + $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 800 | 800 | 'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : ''; |
| 801 | - $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 801 | + $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 802 | 802 | 'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : ''; |
| 803 | - $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 803 | + $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 804 | 804 | 'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : ''; |
| 805 | - $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
| 805 | + $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
| 806 | 806 | if (isset($t)) { |
| 807 | 807 | if ($t->hasAttributes()) { |
| 808 | 808 | $texto .= " Transmissor "; |
@@ -834,7 +834,7 @@ discard block |
||
| 834 | 834 | */ |
| 835 | 835 | protected function statusNFe() |
| 836 | 836 | { |
| 837 | - if (! isset($this->nfeProc)) { |
|
| 837 | + if (!isset($this->nfeProc)) { |
|
| 838 | 838 | return ['status' => false, 'message' => 'NFe NÃO PROTOCOLADA']; |
| 839 | 839 | } |
| 840 | 840 | if ($this->getTagValue($this->ide, "tpAmb") == '2') { |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | |
| 864 | 864 | protected function notaDPEC() |
| 865 | 865 | { |
| 866 | - return ! empty($this->numdepec); |
|
| 866 | + return !empty($this->numdepec); |
|
| 867 | 867 | } |
| 868 | 868 | |
| 869 | 869 | /** |
@@ -912,7 +912,7 @@ discard block |
||
| 912 | 912 | //se for right separa 2/3 para os dados e o terço seguinte para o logo |
| 913 | 913 | //se não houver logo centraliza dos dados do emitente |
| 914 | 914 | // coloca o logo |
| 915 | - if (! empty($this->logomarca)) { |
|
| 915 | + if (!empty($this->logomarca)) { |
|
| 916 | 916 | $logoInfo = getimagesize($this->logomarca); |
| 917 | 917 | //largura da imagem em mm |
| 918 | 918 | $logoWmm = ($logoInfo[0] / 72) * 25.4; |
@@ -968,7 +968,7 @@ discard block |
||
| 968 | 968 | //endereço |
| 969 | 969 | $y1 = $y1 + 5; |
| 970 | 970 | $aFont = ['font' => $this->fontePadrao, 'size' => 8, 'style' => '']; |
| 971 | - $fone = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 971 | + $fone = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 972 | 972 | ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue |
| 973 | 973 | : ''; |
| 974 | 974 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
@@ -987,8 +987,8 @@ discard block |
||
| 987 | 987 | |
| 988 | 988 | //#################################################################################### |
| 989 | 989 | //coluna central Danfe |
| 990 | - $x += $w; |
|
| 991 | - $w = round($maxW * 0.17, 0);//35; |
|
| 990 | + $x += $w; |
|
| 991 | + $w = round($maxW * 0.17, 0); //35; |
|
| 992 | 992 | $w2 = $w; |
| 993 | 993 | $h = 32; |
| 994 | 994 | $this->pdf->textBox($x, $y, $w, $h); |
@@ -1045,8 +1045,8 @@ discard block |
||
| 1045 | 1045 | |
| 1046 | 1046 | //#################################################################################### |
| 1047 | 1047 | //coluna codigo de barras |
| 1048 | - $x += $w; |
|
| 1049 | - $w = ($maxW - $w1 - $w2);//85; |
|
| 1048 | + $x += $w; |
|
| 1049 | + $w = ($maxW - $w1 - $w2); //85; |
|
| 1050 | 1050 | $w3 = $w; |
| 1051 | 1051 | $h = 32; |
| 1052 | 1052 | $this->pdf->textBox($x, $y, $w, $h); |
@@ -1076,7 +1076,7 @@ discard block |
||
| 1076 | 1076 | } else { |
| 1077 | 1077 | $cabecalhoProtoAutorizacao = 'PROTOCOLO DE AUTORIZAÇÃO DE USO'; |
| 1078 | 1078 | } |
| 1079 | - if (($this->tpEmis == 2 || $this->tpEmis == 5) && ! $this->notaDpec()) { |
|
| 1079 | + if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->notaDpec()) { |
|
| 1080 | 1080 | $cabecalhoProtoAutorizacao = "DADOS DA NF-E"; |
| 1081 | 1081 | $chaveContingencia = $this->geraChaveAdicionalDeContingencia(); |
| 1082 | 1082 | $this->pdf->setFillColor(0, 0, 0); |
@@ -1108,7 +1108,7 @@ discard block |
||
| 1108 | 1108 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1109 | 1109 | $w = $w1 + $w2; |
| 1110 | 1110 | $y = $oldY; |
| 1111 | - $oldY += $h; |
|
| 1111 | + $oldY += $h; |
|
| 1112 | 1112 | $x = $oldX; |
| 1113 | 1113 | $h = 7; |
| 1114 | 1114 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1125,7 +1125,7 @@ discard block |
||
| 1125 | 1125 | // NOTA : DANFE sem protocolo deve existir somente no caso de contingência !!! |
| 1126 | 1126 | // Além disso, existem várias NFes em contingência que eu recebo com protocolo de autorização. |
| 1127 | 1127 | // Na minha opinião, deveríamos mostra-lo, mas o manual da NFe v4.01 diz outra coisa... |
| 1128 | - if (($this->tpEmis == 2 || $this->tpEmis == 5) && ! $this->notaDpec()) { |
|
| 1128 | + if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->notaDpec()) { |
|
| 1129 | 1129 | $aFont = ['font' => $this->fontePadrao, 'size' => 8, 'style' => 'B']; |
| 1130 | 1130 | $texto = $this->formatField( |
| 1131 | 1131 | $chaveContingencia, |
@@ -1139,7 +1139,7 @@ discard block |
||
| 1139 | 1139 | $cStat = ''; |
| 1140 | 1140 | } else { |
| 1141 | 1141 | if (isset($this->nfeProc)) { |
| 1142 | - $texto = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) |
|
| 1142 | + $texto = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) |
|
| 1143 | 1143 | ? $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue |
| 1144 | 1144 | : ''; |
| 1145 | 1145 | $tsHora = $this->toTimestamp( |
@@ -1169,7 +1169,7 @@ discard block |
||
| 1169 | 1169 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1170 | 1170 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1171 | 1171 | //INSCRIÇÃO MUNICIPAL |
| 1172 | - $x += $w; |
|
| 1172 | + $x += $w; |
|
| 1173 | 1173 | $texto = 'INSCRIÇÃO MUNICIPAL'; |
| 1174 | 1174 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1175 | 1175 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1177,29 +1177,29 @@ discard block |
||
| 1177 | 1177 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1178 | 1178 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1179 | 1179 | //INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT. |
| 1180 | - $x += $w; |
|
| 1180 | + $x += $w; |
|
| 1181 | 1181 | $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.'; |
| 1182 | 1182 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1183 | 1183 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1184 | - $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
| 1184 | + $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
| 1185 | 1185 | ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue |
| 1186 | 1186 | : ''; |
| 1187 | 1187 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1188 | 1188 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1189 | 1189 | //CNPJ |
| 1190 | - $x += $w; |
|
| 1190 | + $x += $w; |
|
| 1191 | 1191 | $w = ($maxW - (3 * $w)); |
| 1192 | 1192 | $texto = 'CNPJ'; |
| 1193 | 1193 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1194 | 1194 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1195 | 1195 | //Pegando valor do CPF/CNPJ |
| 1196 | - if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1196 | + if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1197 | 1197 | $texto = $this->formatField( |
| 1198 | 1198 | $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1199 | 1199 | "###.###.###/####-##" |
| 1200 | 1200 | ); |
| 1201 | 1201 | } else { |
| 1202 | - $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 1202 | + $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 1203 | 1203 | ? $this->formatField( |
| 1204 | 1204 | $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1205 | 1205 | "###.###.###-##" |
@@ -1214,7 +1214,7 @@ discard block |
||
| 1214 | 1214 | $tpAmb = $this->ide->getElementsByTagName('tpAmb')->item(0)->nodeValue; |
| 1215 | 1215 | //indicar cancelamento |
| 1216 | 1216 | $resp = $this->statusNFe(); |
| 1217 | - if (! $resp['status']) { |
|
| 1217 | + if (!$resp['status']) { |
|
| 1218 | 1218 | $x = 10; |
| 1219 | 1219 | $y = $this->hPrint - 130; |
| 1220 | 1220 | $h = 25; |
@@ -1284,7 +1284,7 @@ discard block |
||
| 1284 | 1284 | //NOME / RAZÃO SOCIAL |
| 1285 | 1285 | $w = round($maxW * 0.61, 0); |
| 1286 | 1286 | $w1 = $w; |
| 1287 | - $y += 3; |
|
| 1287 | + $y += 3; |
|
| 1288 | 1288 | $texto = 'NOME / RAZÃO SOCIAL'; |
| 1289 | 1289 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1290 | 1290 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1296,20 +1296,20 @@ discard block |
||
| 1296 | 1296 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, ''); |
| 1297 | 1297 | } |
| 1298 | 1298 | //CNPJ / CPF |
| 1299 | - $x += $w; |
|
| 1299 | + $x += $w; |
|
| 1300 | 1300 | $w = round($maxW * 0.23, 0); |
| 1301 | 1301 | $w2 = $w; |
| 1302 | 1302 | $texto = 'CNPJ / CPF'; |
| 1303 | 1303 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1304 | 1304 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1305 | 1305 | //Pegando valor do CPF/CNPJ |
| 1306 | - if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1306 | + if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1307 | 1307 | $texto = $this->formatField( |
| 1308 | 1308 | $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1309 | 1309 | "###.###.###/####-##" |
| 1310 | 1310 | ); |
| 1311 | 1311 | } else { |
| 1312 | - $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 1312 | + $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 1313 | 1313 | ? $this->formatField( |
| 1314 | 1314 | $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1315 | 1315 | "###.###.###-##" |
@@ -1319,17 +1319,17 @@ discard block |
||
| 1319 | 1319 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1320 | 1320 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1321 | 1321 | //DATA DA EMISSÃO |
| 1322 | - $x += $w; |
|
| 1322 | + $x += $w; |
|
| 1323 | 1323 | $w = $maxW - ($w1 + $w2); |
| 1324 | 1324 | $wx = $w; |
| 1325 | 1325 | $texto = 'DATA DA EMISSÃO'; |
| 1326 | 1326 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1327 | 1327 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1328 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) |
|
| 1328 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) |
|
| 1329 | 1329 | ? $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue |
| 1330 | 1330 | : ''; |
| 1331 | 1331 | if ($dEmi == '') { |
| 1332 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) |
|
| 1332 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) |
|
| 1333 | 1333 | ? $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue |
| 1334 | 1334 | : ''; |
| 1335 | 1335 | $aDemi = explode('T', $dEmi); |
@@ -1345,7 +1345,7 @@ discard block |
||
| 1345 | 1345 | //ENDEREÇO |
| 1346 | 1346 | $w = round($maxW * 0.47, 0); |
| 1347 | 1347 | $w1 = $w; |
| 1348 | - $y += $h; |
|
| 1348 | + $y += $h; |
|
| 1349 | 1349 | $x = $oldX; |
| 1350 | 1350 | $texto = 'ENDEREÇO'; |
| 1351 | 1351 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1357,7 +1357,7 @@ discard block |
||
| 1357 | 1357 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1358 | 1358 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
| 1359 | 1359 | //BAIRRO / DISTRITO |
| 1360 | - $x += $w; |
|
| 1360 | + $x += $w; |
|
| 1361 | 1361 | $w = round($maxW * 0.21, 0); |
| 1362 | 1362 | $w2 = $w; |
| 1363 | 1363 | $texto = 'BAIRRO / DISTRITO'; |
@@ -1367,29 +1367,29 @@ discard block |
||
| 1367 | 1367 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1368 | 1368 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1369 | 1369 | //CEP |
| 1370 | - $x += $w; |
|
| 1370 | + $x += $w; |
|
| 1371 | 1371 | $w = $maxW - $w1 - $w2 - $wx; |
| 1372 | 1372 | $w2 = $w; |
| 1373 | 1373 | $texto = 'CEP'; |
| 1374 | 1374 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1375 | 1375 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1376 | - $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) |
|
| 1376 | + $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) |
|
| 1377 | 1377 | ? $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue |
| 1378 | 1378 | : ''; |
| 1379 | 1379 | $texto = $this->formatField($texto, "#####-###"); |
| 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 SAÍDA |
| 1383 | - $x += $w; |
|
| 1383 | + $x += $w; |
|
| 1384 | 1384 | $w = $wx; |
| 1385 | 1385 | $texto = 'DATA DA SAÍDA/ENTRADA'; |
| 1386 | 1386 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1387 | 1387 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1388 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) |
|
| 1388 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) |
|
| 1389 | 1389 | ? $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue |
| 1390 | 1390 | : ''; |
| 1391 | 1391 | if ($dSaiEnt == '') { |
| 1392 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
| 1392 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
| 1393 | 1393 | ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue |
| 1394 | 1394 | : ''; |
| 1395 | 1395 | $aDsaient = explode('T', $dSaiEnt); |
@@ -1400,7 +1400,7 @@ discard block |
||
| 1400 | 1400 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1401 | 1401 | //MUNICÍPIO |
| 1402 | 1402 | $w = $w1; |
| 1403 | - $y += $h; |
|
| 1403 | + $y += $h; |
|
| 1404 | 1404 | $x = $oldX; |
| 1405 | 1405 | $texto = 'MUNICÍPIO'; |
| 1406 | 1406 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1414,7 +1414,7 @@ discard block |
||
| 1414 | 1414 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1415 | 1415 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 1416 | 1416 | //UF |
| 1417 | - $x += $w; |
|
| 1417 | + $x += $w; |
|
| 1418 | 1418 | $w = 8; |
| 1419 | 1419 | $texto = 'UF'; |
| 1420 | 1420 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1423,19 +1423,19 @@ discard block |
||
| 1423 | 1423 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1424 | 1424 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1425 | 1425 | //FONE / FAX |
| 1426 | - $x += $w; |
|
| 1426 | + $x += $w; |
|
| 1427 | 1427 | $w = round(($maxW - $w1 - $wx - 8) / 2, 0); |
| 1428 | 1428 | $w3 = $w; |
| 1429 | 1429 | $texto = 'FONE / FAX'; |
| 1430 | 1430 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1431 | 1431 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1432 | - $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 1432 | + $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 1433 | 1433 | ? $this->dest->getElementsByTagName("fone")->item(0)->nodeValue |
| 1434 | 1434 | : ''; |
| 1435 | 1435 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1436 | 1436 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1437 | 1437 | //INSCRIÇÃO ESTADUAL |
| 1438 | - $x += $w; |
|
| 1438 | + $x += $w; |
|
| 1439 | 1439 | $w = $maxW - $w1 - $wx - 8 - $w3; |
| 1440 | 1440 | $texto = 'INSCRIÇÃO ESTADUAL'; |
| 1441 | 1441 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1445,16 +1445,16 @@ discard block |
||
| 1445 | 1445 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1446 | 1446 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1447 | 1447 | //HORA DA SAÍDA |
| 1448 | - $x += $w; |
|
| 1448 | + $x += $w; |
|
| 1449 | 1449 | $w = $wx; |
| 1450 | 1450 | $texto = 'HORA DA SAÍDA/ENTRADA'; |
| 1451 | 1451 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1452 | 1452 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1453 | - $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) |
|
| 1453 | + $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) |
|
| 1454 | 1454 | ? $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue |
| 1455 | 1455 | : ''; |
| 1456 | 1456 | if ($hSaiEnt == '') { |
| 1457 | - $dhSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
| 1457 | + $dhSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) |
|
| 1458 | 1458 | ? $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue |
| 1459 | 1459 | : ''; |
| 1460 | 1460 | $tsDhSaiEnt = $this->toTimestamp($dhSaiEnt); |
@@ -1498,7 +1498,7 @@ discard block |
||
| 1498 | 1498 | //NOME / RAZÃO SOCIAL |
| 1499 | 1499 | $w = round($maxW * 0.61, 0); |
| 1500 | 1500 | $w1 = $w; |
| 1501 | - $y += 3; |
|
| 1501 | + $y += 3; |
|
| 1502 | 1502 | $texto = 'NOME / RAZÃO SOCIAL'; |
| 1503 | 1503 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1504 | 1504 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1513,20 +1513,20 @@ discard block |
||
| 1513 | 1513 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, ''); |
| 1514 | 1514 | } |
| 1515 | 1515 | //CNPJ / CPF |
| 1516 | - $x += $w; |
|
| 1516 | + $x += $w; |
|
| 1517 | 1517 | $w = round($maxW * 0.23, 0); |
| 1518 | 1518 | $w2 = $w; |
| 1519 | 1519 | $texto = 'CNPJ / CPF'; |
| 1520 | 1520 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1521 | 1521 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1522 | 1522 | //Pegando valor do CPF/CNPJ |
| 1523 | - if (! empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1523 | + if (!empty($this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1524 | 1524 | $texto = $this->formatField( |
| 1525 | 1525 | $this->entrega->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1526 | 1526 | "###.###.###/####-##" |
| 1527 | 1527 | ); |
| 1528 | 1528 | } else { |
| 1529 | - $texto = ! empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1529 | + $texto = !empty($this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1530 | 1530 | $this->formatField( |
| 1531 | 1531 | $this->entrega->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1532 | 1532 | "###.###.###-##" |
@@ -1535,7 +1535,7 @@ discard block |
||
| 1535 | 1535 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1536 | 1536 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1537 | 1537 | //INSCRIÇÃO ESTADUAL |
| 1538 | - $x += $w; |
|
| 1538 | + $x += $w; |
|
| 1539 | 1539 | $w = $maxW - ($w1 + $w2); |
| 1540 | 1540 | $wx = $w; |
| 1541 | 1541 | $texto = 'INSCRIÇÃO ESTADUAL'; |
@@ -1554,7 +1554,7 @@ discard block |
||
| 1554 | 1554 | //ENDEREÇO |
| 1555 | 1555 | $w = round($maxW * 0.355, 0) + $wx; |
| 1556 | 1556 | $w1 = $w; |
| 1557 | - $y += $h; |
|
| 1557 | + $y += $h; |
|
| 1558 | 1558 | $x = $oldX; |
| 1559 | 1559 | $texto = 'ENDEREÇO'; |
| 1560 | 1560 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1565,7 +1565,7 @@ discard block |
||
| 1565 | 1565 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1566 | 1566 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
| 1567 | 1567 | //BAIRRO / DISTRITO |
| 1568 | - $x += $w; |
|
| 1568 | + $x += $w; |
|
| 1569 | 1569 | $w = round($maxW * 0.335, 0); |
| 1570 | 1570 | $w2 = $w; |
| 1571 | 1571 | $texto = 'BAIRRO / DISTRITO'; |
@@ -1575,12 +1575,12 @@ discard block |
||
| 1575 | 1575 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1576 | 1576 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1577 | 1577 | //CEP |
| 1578 | - $x += $w; |
|
| 1578 | + $x += $w; |
|
| 1579 | 1579 | $w = $maxW - ($w1 + $w2); |
| 1580 | 1580 | $texto = 'CEP'; |
| 1581 | 1581 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1582 | 1582 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1583 | - $texto = ! empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1583 | + $texto = !empty($this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1584 | 1584 | $this->entrega->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
| 1585 | 1585 | $texto = $this->formatField($texto, "#####-###"); |
| 1586 | 1586 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
@@ -1588,7 +1588,7 @@ discard block |
||
| 1588 | 1588 | //MUNICÍPIO |
| 1589 | 1589 | $w = round($maxW * 0.805, 0); |
| 1590 | 1590 | $w1 = $w; |
| 1591 | - $y += $h; |
|
| 1591 | + $y += $h; |
|
| 1592 | 1592 | $x = $oldX; |
| 1593 | 1593 | $texto = 'MUNICÍPIO'; |
| 1594 | 1594 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1600,7 +1600,7 @@ discard block |
||
| 1600 | 1600 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1601 | 1601 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 1602 | 1602 | //UF |
| 1603 | - $x += $w; |
|
| 1603 | + $x += $w; |
|
| 1604 | 1604 | $w = 8; |
| 1605 | 1605 | $texto = 'UF'; |
| 1606 | 1606 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1609,12 +1609,12 @@ discard block |
||
| 1609 | 1609 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1610 | 1610 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1611 | 1611 | //FONE / FAX |
| 1612 | - $x += $w; |
|
| 1612 | + $x += $w; |
|
| 1613 | 1613 | $w = $maxW - $w - $w1; |
| 1614 | 1614 | $texto = 'FONE / FAX'; |
| 1615 | 1615 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1616 | 1616 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1617 | - $texto = ! empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1617 | + $texto = !empty($this->entrega->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1618 | 1618 | $this->entrega->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
| 1619 | 1619 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1620 | 1620 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -1651,7 +1651,7 @@ discard block |
||
| 1651 | 1651 | //NOME / RAZÃO SOCIAL |
| 1652 | 1652 | $w = round($maxW * 0.61, 0); |
| 1653 | 1653 | $w1 = $w; |
| 1654 | - $y += 3; |
|
| 1654 | + $y += 3; |
|
| 1655 | 1655 | $texto = 'NOME / RAZÃO SOCIAL'; |
| 1656 | 1656 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1657 | 1657 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1666,20 +1666,20 @@ discard block |
||
| 1666 | 1666 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 1, ''); |
| 1667 | 1667 | } |
| 1668 | 1668 | //CNPJ / CPF |
| 1669 | - $x += $w; |
|
| 1669 | + $x += $w; |
|
| 1670 | 1670 | $w = round($maxW * 0.23, 0); |
| 1671 | 1671 | $w2 = $w; |
| 1672 | 1672 | $texto = 'CNPJ / CPF'; |
| 1673 | 1673 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1674 | 1674 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1675 | 1675 | //Pegando valor do CPF/CNPJ |
| 1676 | - if (! empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1676 | + if (!empty($this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1677 | 1677 | $texto = $this->formatField( |
| 1678 | 1678 | $this->retirada->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1679 | 1679 | "###.###.###/####-##" |
| 1680 | 1680 | ); |
| 1681 | 1681 | } else { |
| 1682 | - $texto = ! empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1682 | + $texto = !empty($this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1683 | 1683 | $this->formatField( |
| 1684 | 1684 | $this->retirada->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1685 | 1685 | "###.###.###-##" |
@@ -1688,7 +1688,7 @@ discard block |
||
| 1688 | 1688 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1689 | 1689 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1690 | 1690 | //INSCRIÇÃO ESTADUAL |
| 1691 | - $x += $w; |
|
| 1691 | + $x += $w; |
|
| 1692 | 1692 | $w = $maxW - ($w1 + $w2); |
| 1693 | 1693 | $wx = $w; |
| 1694 | 1694 | $texto = 'INSCRIÇÃO ESTADUAL'; |
@@ -1707,7 +1707,7 @@ discard block |
||
| 1707 | 1707 | //ENDEREÇO |
| 1708 | 1708 | $w = round($maxW * 0.355, 0) + $wx; |
| 1709 | 1709 | $w1 = $w; |
| 1710 | - $y += $h; |
|
| 1710 | + $y += $h; |
|
| 1711 | 1711 | $x = $oldX; |
| 1712 | 1712 | $texto = 'ENDEREÇO'; |
| 1713 | 1713 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1718,7 +1718,7 @@ discard block |
||
| 1718 | 1718 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1719 | 1719 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
| 1720 | 1720 | //BAIRRO / DISTRITO |
| 1721 | - $x += $w; |
|
| 1721 | + $x += $w; |
|
| 1722 | 1722 | $w = round($maxW * 0.335, 0); |
| 1723 | 1723 | $w2 = $w; |
| 1724 | 1724 | $texto = 'BAIRRO / DISTRITO'; |
@@ -1728,12 +1728,12 @@ discard block |
||
| 1728 | 1728 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1729 | 1729 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1730 | 1730 | //CEP |
| 1731 | - $x += $w; |
|
| 1731 | + $x += $w; |
|
| 1732 | 1732 | $w = $maxW - ($w1 + $w2); |
| 1733 | 1733 | $texto = 'CEP'; |
| 1734 | 1734 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1735 | 1735 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1736 | - $texto = ! empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1736 | + $texto = !empty($this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1737 | 1737 | $this->retirada->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
| 1738 | 1738 | $texto = $this->formatField($texto, "#####-###"); |
| 1739 | 1739 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
@@ -1741,7 +1741,7 @@ discard block |
||
| 1741 | 1741 | //MUNICÍPIO |
| 1742 | 1742 | $w = round($maxW * 0.805, 0); |
| 1743 | 1743 | $w1 = $w; |
| 1744 | - $y += $h; |
|
| 1744 | + $y += $h; |
|
| 1745 | 1745 | $x = $oldX; |
| 1746 | 1746 | $texto = 'MUNICÍPIO'; |
| 1747 | 1747 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1753,7 +1753,7 @@ discard block |
||
| 1753 | 1753 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1754 | 1754 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 1755 | 1755 | //UF |
| 1756 | - $x += $w; |
|
| 1756 | + $x += $w; |
|
| 1757 | 1757 | $w = 8; |
| 1758 | 1758 | $texto = 'UF'; |
| 1759 | 1759 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -1762,12 +1762,12 @@ discard block |
||
| 1762 | 1762 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1763 | 1763 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1764 | 1764 | //FONE / FAX |
| 1765 | - $x += $w; |
|
| 1765 | + $x += $w; |
|
| 1766 | 1766 | $w = $maxW - $w - $w1; |
| 1767 | 1767 | $texto = 'FONE / FAX'; |
| 1768 | 1768 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 1769 | 1769 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1770 | - $texto = ! empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1770 | + $texto = !empty($this->retirada->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1771 | 1771 | $this->retirada->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
| 1772 | 1772 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 1773 | 1773 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -1787,7 +1787,7 @@ discard block |
||
| 1787 | 1787 | if (isset($this->cobr)) { |
| 1788 | 1788 | $fat = $this->cobr->getElementsByTagName("fat")->item(0); |
| 1789 | 1789 | if (isset($fat)) { |
| 1790 | - if (! empty($this->getTagValue($this->ide, "indPag"))) { |
|
| 1790 | + if (!empty($this->getTagValue($this->ide, "indPag"))) { |
|
| 1791 | 1791 | $textoIndPag = ""; |
| 1792 | 1792 | $indPag = $this->getTagValue($this->ide, "indPag"); |
| 1793 | 1793 | if ($indPag === "0") { |
@@ -1862,7 +1862,7 @@ discard block |
||
| 1862 | 1862 | $h = 8; |
| 1863 | 1863 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B']; |
| 1864 | 1864 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1865 | - $y += 3; |
|
| 1865 | + $y += 3; |
|
| 1866 | 1866 | $dups = ""; |
| 1867 | 1867 | $dupcont = 0; |
| 1868 | 1868 | $nFat = $this->dup->length; |
@@ -1896,13 +1896,13 @@ discard block |
||
| 1896 | 1896 | } |
| 1897 | 1897 | $increm = 1; |
| 1898 | 1898 | foreach ($this->dup as $k => $d) { |
| 1899 | - $nDup = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) |
|
| 1899 | + $nDup = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) |
|
| 1900 | 1900 | ? $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue |
| 1901 | 1901 | : ''; |
| 1902 | - $dDup = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
|
| 1902 | + $dDup = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
|
| 1903 | 1903 | ? $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) |
| 1904 | 1904 | : ''; |
| 1905 | - $vDup = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) |
|
| 1905 | + $vDup = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) |
|
| 1906 | 1906 | ? 'R$ ' . number_format( |
| 1907 | 1907 | $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue, |
| 1908 | 1908 | 2, |
@@ -1949,7 +1949,7 @@ discard block |
||
| 1949 | 1949 | } |
| 1950 | 1950 | if ($dupcont == 0) { |
| 1951 | 1951 | $y -= 9; |
| 1952 | - $linha --; |
|
| 1952 | + $linha--; |
|
| 1953 | 1953 | } |
| 1954 | 1954 | |
| 1955 | 1955 | return ($y + $h); |
@@ -1989,7 +1989,7 @@ discard block |
||
| 1989 | 1989 | $h = 8; |
| 1990 | 1990 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B']; |
| 1991 | 1991 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1992 | - $y += 3; |
|
| 1992 | + $y += 3; |
|
| 1993 | 1993 | $dups = ""; |
| 1994 | 1994 | $dupcont = 0; |
| 1995 | 1995 | if ($this->orientacao == 'P') { |
@@ -2018,7 +2018,7 @@ discard block |
||
| 2018 | 2018 | '90' => 'Sem pagamento', |
| 2019 | 2019 | '99' => 'Outros' |
| 2020 | 2020 | ]; |
| 2021 | - $bandeira = [ |
|
| 2021 | + $bandeira = [ |
|
| 2022 | 2022 | '01' => 'Visa', |
| 2023 | 2023 | '02' => 'Mastercard', |
| 2024 | 2024 | '03' => 'American', |
@@ -2031,10 +2031,10 @@ discard block |
||
| 2031 | 2031 | '99' => 'Outros' |
| 2032 | 2032 | ]; |
| 2033 | 2033 | foreach ($this->detPag as $k => $d) { |
| 2034 | - $fPag = ! empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
|
| 2034 | + $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
|
| 2035 | 2035 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue |
| 2036 | 2036 | : '0'; |
| 2037 | - $vPag = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
| 2037 | + $vPag = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
| 2038 | 2038 | ? 'R$ ' . number_format( |
| 2039 | 2039 | $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue, |
| 2040 | 2040 | 2, |
@@ -2077,7 +2077,7 @@ discard block |
||
| 2077 | 2077 | } |
| 2078 | 2078 | if ($dupcont == 0) { |
| 2079 | 2079 | $y -= 9; |
| 2080 | - $linha --; |
|
| 2080 | + $linha--; |
|
| 2081 | 2081 | } |
| 2082 | 2082 | |
| 2083 | 2083 | return ($y + $h); |
@@ -2109,7 +2109,7 @@ discard block |
||
| 2109 | 2109 | $the_field = $this->ICMSTot->getElementsByTagName($campoImposto)->item(0); |
| 2110 | 2110 | if (isset($the_field)) { |
| 2111 | 2111 | $the_value = $the_field->nodeValue; |
| 2112 | - if (! empty($the_value)) { |
|
| 2112 | + if (!empty($the_value)) { |
|
| 2113 | 2113 | $valorImposto = number_format($the_value, 2, ",", "."); |
| 2114 | 2114 | } |
| 2115 | 2115 | } |
@@ -2138,10 +2138,10 @@ discard block |
||
| 2138 | 2138 | $x_inicial = $x; |
| 2139 | 2139 | //##################################################################### |
| 2140 | 2140 | $campos_por_linha = 9; |
| 2141 | - if (! $this->exibirPIS) { |
|
| 2142 | - $campos_por_linha --; |
|
| 2141 | + if (!$this->exibirPIS) { |
|
| 2142 | + $campos_por_linha--; |
|
| 2143 | 2143 | } |
| 2144 | - if (! $this->exibirIcmsInterestadual) { |
|
| 2144 | + if (!$this->exibirIcmsInterestadual) { |
|
| 2145 | 2145 | $campos_por_linha -= 2; |
| 2146 | 2146 | } |
| 2147 | 2147 | |
@@ -2228,12 +2228,12 @@ discard block |
||
| 2228 | 2228 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2229 | 2229 | //NOME / RAZÃO SOCIAL |
| 2230 | 2230 | $w1 = $maxW * 0.29; |
| 2231 | - $y += 3; |
|
| 2231 | + $y += 3; |
|
| 2232 | 2232 | $texto = 'NOME / RAZÃO SOCIAL'; |
| 2233 | 2233 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2234 | 2234 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2235 | 2235 | if (isset($this->transporta)) { |
| 2236 | - $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) |
|
| 2236 | + $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) |
|
| 2237 | 2237 | ? $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue |
| 2238 | 2238 | : ''; |
| 2239 | 2239 | } else { |
@@ -2242,12 +2242,12 @@ discard block |
||
| 2242 | 2242 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2243 | 2243 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 2244 | 2244 | //FRETE POR CONTA |
| 2245 | - $x += $w1; |
|
| 2245 | + $x += $w1; |
|
| 2246 | 2246 | $w2 = $maxW * 0.15; |
| 2247 | 2247 | $texto = 'FRETE'; |
| 2248 | 2248 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2249 | 2249 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2250 | - $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) |
|
| 2250 | + $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) |
|
| 2251 | 2251 | ? $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue |
| 2252 | 2252 | : '0'; |
| 2253 | 2253 | switch ($tipoFrete) { |
@@ -2273,12 +2273,12 @@ discard block |
||
| 2273 | 2273 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2274 | 2274 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 1, ''); |
| 2275 | 2275 | //CÓDIGO ANTT |
| 2276 | - $x += $w2; |
|
| 2276 | + $x += $w2; |
|
| 2277 | 2277 | $texto = 'CÓDIGO ANTT'; |
| 2278 | 2278 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2279 | 2279 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2280 | 2280 | if (isset($this->veicTransp)) { |
| 2281 | - $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) |
|
| 2281 | + $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) |
|
| 2282 | 2282 | ? $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue |
| 2283 | 2283 | : ''; |
| 2284 | 2284 | } else { |
@@ -2287,16 +2287,16 @@ discard block |
||
| 2287 | 2287 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2288 | 2288 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2289 | 2289 | //PLACA DO VEÍC |
| 2290 | - $x += $w2; |
|
| 2290 | + $x += $w2; |
|
| 2291 | 2291 | $texto = 'PLACA DO VEÍCULO'; |
| 2292 | 2292 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2293 | 2293 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2294 | 2294 | if (isset($this->veicTransp)) { |
| 2295 | - $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) |
|
| 2295 | + $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) |
|
| 2296 | 2296 | ? $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue |
| 2297 | 2297 | : ''; |
| 2298 | 2298 | } elseif (isset($this->reboque)) { |
| 2299 | - $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) |
|
| 2299 | + $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) |
|
| 2300 | 2300 | ? $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue |
| 2301 | 2301 | : ''; |
| 2302 | 2302 | } else { |
@@ -2305,17 +2305,17 @@ discard block |
||
| 2305 | 2305 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2306 | 2306 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2307 | 2307 | //UF |
| 2308 | - $x += $w2; |
|
| 2308 | + $x += $w2; |
|
| 2309 | 2309 | $w3 = round($maxW * 0.04, 0); |
| 2310 | 2310 | $texto = 'UF'; |
| 2311 | 2311 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2312 | 2312 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2313 | 2313 | if (isset($this->veicTransp)) { |
| 2314 | - $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2314 | + $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2315 | 2315 | ? $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue |
| 2316 | 2316 | : ''; |
| 2317 | 2317 | } elseif (isset($this->reboque)) { |
| 2318 | - $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2318 | + $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2319 | 2319 | ? $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue |
| 2320 | 2320 | : ''; |
| 2321 | 2321 | } else { |
@@ -2324,20 +2324,20 @@ discard block |
||
| 2324 | 2324 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2325 | 2325 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2326 | 2326 | //CNPJ / CPF |
| 2327 | - $x += $w3; |
|
| 2327 | + $x += $w3; |
|
| 2328 | 2328 | $w = $maxW - ($w1 + 3 * $w2 + $w3); |
| 2329 | 2329 | $texto = 'CNPJ / CPF'; |
| 2330 | 2330 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2331 | 2331 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2332 | 2332 | if (isset($this->transporta)) { |
| 2333 | - $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
|
| 2333 | + $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
|
| 2334 | 2334 | ? $this->formatField( |
| 2335 | 2335 | $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 2336 | 2336 | "##.###.###/####-##" |
| 2337 | 2337 | ) |
| 2338 | 2338 | : ''; |
| 2339 | 2339 | if ($texto == '') { |
| 2340 | - $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 2340 | + $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) |
|
| 2341 | 2341 | ? $this->formatField( |
| 2342 | 2342 | $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 2343 | 2343 | "###.###.###-##" |
@@ -2351,7 +2351,7 @@ discard block |
||
| 2351 | 2351 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2352 | 2352 | //##################################################################### |
| 2353 | 2353 | //ENDEREÇO |
| 2354 | - $y += $h; |
|
| 2354 | + $y += $h; |
|
| 2355 | 2355 | $x = $oldX; |
| 2356 | 2356 | $h = 7; |
| 2357 | 2357 | $w1 = $maxW * 0.44; |
@@ -2359,7 +2359,7 @@ discard block |
||
| 2359 | 2359 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2360 | 2360 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2361 | 2361 | if (isset($this->transporta)) { |
| 2362 | - $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) |
|
| 2362 | + $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) |
|
| 2363 | 2363 | ? $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue |
| 2364 | 2364 | : ''; |
| 2365 | 2365 | } else { |
@@ -2368,13 +2368,13 @@ discard block |
||
| 2368 | 2368 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2369 | 2369 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 2370 | 2370 | //MUNICÍPIO |
| 2371 | - $x += $w1; |
|
| 2371 | + $x += $w1; |
|
| 2372 | 2372 | $w2 = round($maxW * 0.30, 0); |
| 2373 | 2373 | $texto = 'MUNICÍPIO'; |
| 2374 | 2374 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2375 | 2375 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2376 | 2376 | if (isset($this->transporta)) { |
| 2377 | - $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) |
|
| 2377 | + $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) |
|
| 2378 | 2378 | ? $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue |
| 2379 | 2379 | : ''; |
| 2380 | 2380 | } else { |
@@ -2383,13 +2383,13 @@ discard block |
||
| 2383 | 2383 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2384 | 2384 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2385 | 2385 | //UF |
| 2386 | - $x += $w2; |
|
| 2386 | + $x += $w2; |
|
| 2387 | 2387 | $w3 = round($maxW * 0.04, 0); |
| 2388 | 2388 | $texto = 'UF'; |
| 2389 | 2389 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2390 | 2390 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2391 | 2391 | if (isset($this->transporta)) { |
| 2392 | - $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2392 | + $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) |
|
| 2393 | 2393 | ? $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue |
| 2394 | 2394 | : ''; |
| 2395 | 2395 | } else { |
@@ -2398,14 +2398,14 @@ discard block |
||
| 2398 | 2398 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2399 | 2399 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2400 | 2400 | //INSCRIÇÃO ESTADUAL |
| 2401 | - $x += $w3; |
|
| 2401 | + $x += $w3; |
|
| 2402 | 2402 | $w = $maxW - ($w1 + $w2 + $w3); |
| 2403 | 2403 | $texto = 'INSCRIÇÃO ESTADUAL'; |
| 2404 | 2404 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2405 | 2405 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2406 | 2406 | $texto = ''; |
| 2407 | 2407 | if (isset($this->transporta)) { |
| 2408 | - if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
| 2408 | + if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
| 2409 | 2409 | $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue; |
| 2410 | 2410 | } |
| 2411 | 2411 | } |
@@ -2421,13 +2421,13 @@ discard block |
||
| 2421 | 2421 | $pesoBruto = 0; |
| 2422 | 2422 | $pesoLiquido = 0; |
| 2423 | 2423 | foreach ($volumes as $volume) { |
| 2424 | - $quantidade += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
| 2424 | + $quantidade += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
| 2425 | 2425 | $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0; |
| 2426 | - $pesoBruto += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
| 2426 | + $pesoBruto += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
| 2427 | 2427 | $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0; |
| 2428 | - $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
| 2428 | + $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
| 2429 | 2429 | $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0; |
| 2430 | - $texto = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
| 2430 | + $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
| 2431 | 2431 | $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : ''; |
| 2432 | 2432 | if ($texto != $especie && $especie != '') { |
| 2433 | 2433 | //tem várias especies |
@@ -2435,7 +2435,7 @@ discard block |
||
| 2435 | 2435 | } else { |
| 2436 | 2436 | $especie = $texto; |
| 2437 | 2437 | } |
| 2438 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) |
|
| 2438 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) |
|
| 2439 | 2439 | ? $this->transp->getElementsByTagName("marca")->item(0)->nodeValue |
| 2440 | 2440 | : ''; |
| 2441 | 2441 | if ($texto != $marca && $marca != '') { |
@@ -2444,7 +2444,7 @@ discard block |
||
| 2444 | 2444 | } else { |
| 2445 | 2445 | $marca = $texto; |
| 2446 | 2446 | } |
| 2447 | - $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) |
|
| 2447 | + $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) |
|
| 2448 | 2448 | ? $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue |
| 2449 | 2449 | : ''; |
| 2450 | 2450 | if ($texto != $numero && $numero != '') { |
@@ -2457,20 +2457,20 @@ discard block |
||
| 2457 | 2457 | |
| 2458 | 2458 | //##################################################################### |
| 2459 | 2459 | //QUANTIDADE |
| 2460 | - $y += $h; |
|
| 2460 | + $y += $h; |
|
| 2461 | 2461 | $x = $oldX; |
| 2462 | 2462 | $h = 7; |
| 2463 | 2463 | $w1 = round($maxW * 0.10, 0); |
| 2464 | 2464 | $texto = 'QUANTIDADE'; |
| 2465 | 2465 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2466 | 2466 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2467 | - if (! empty($quantidade)) { |
|
| 2467 | + if (!empty($quantidade)) { |
|
| 2468 | 2468 | $texto = $quantidade; |
| 2469 | 2469 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2470 | 2470 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2471 | 2471 | } |
| 2472 | 2472 | //ESPÉCIE |
| 2473 | - $x += $w1; |
|
| 2473 | + $x += $w1; |
|
| 2474 | 2474 | $w2 = round($maxW * 0.17, 0); |
| 2475 | 2475 | $texto = 'ESPÉCIE'; |
| 2476 | 2476 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -2479,16 +2479,16 @@ discard block |
||
| 2479 | 2479 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2480 | 2480 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2481 | 2481 | //MARCA |
| 2482 | - $x += $w2; |
|
| 2482 | + $x += $w2; |
|
| 2483 | 2483 | $texto = 'MARCA'; |
| 2484 | 2484 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2485 | 2485 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2486 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2486 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2487 | 2487 | $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : ''; |
| 2488 | 2488 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2489 | 2489 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2490 | 2490 | //NUMERAÇÃO |
| 2491 | - $x += $w2; |
|
| 2491 | + $x += $w2; |
|
| 2492 | 2492 | $texto = 'NUMERAÇÃO'; |
| 2493 | 2493 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2494 | 2494 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2496,7 +2496,7 @@ discard block |
||
| 2496 | 2496 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2497 | 2497 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2498 | 2498 | //PESO BRUTO |
| 2499 | - $x += $w2; |
|
| 2499 | + $x += $w2; |
|
| 2500 | 2500 | $w3 = round($maxW * 0.20, 0); |
| 2501 | 2501 | $texto = 'PESO BRUTO'; |
| 2502 | 2502 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -2509,7 +2509,7 @@ discard block |
||
| 2509 | 2509 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 2510 | 2510 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 2511 | 2511 | //PESO LÍQUIDO |
| 2512 | - $x += $w3; |
|
| 2512 | + $x += $w3; |
|
| 2513 | 2513 | $w = $maxW - ($w1 + 3 * $w2 + $w3); |
| 2514 | 2514 | $texto = 'PESO LÍQUIDO'; |
| 2515 | 2515 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
@@ -2529,11 +2529,11 @@ discard block |
||
| 2529 | 2529 | protected function descricaoProdutoHelper($origem, $campo, $formato) |
| 2530 | 2530 | { |
| 2531 | 2531 | $valor_original = $origem->getElementsByTagName($campo)->item(0); |
| 2532 | - if (! isset($valor_original)) { |
|
| 2532 | + if (!isset($valor_original)) { |
|
| 2533 | 2533 | return ""; |
| 2534 | 2534 | } |
| 2535 | 2535 | $valor_original = $valor_original->nodeValue; |
| 2536 | - $valor = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
| 2536 | + $valor = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
| 2537 | 2537 | |
| 2538 | 2538 | if ($valor != "") { |
| 2539 | 2539 | return sprintf($formato, $valor); |
@@ -2559,7 +2559,7 @@ discard block |
||
| 2559 | 2559 | $ICMSUFDest = $itemProd->getElementsByTagName("ICMSUFDest")->item(0); |
| 2560 | 2560 | $impostos = ''; |
| 2561 | 2561 | |
| 2562 | - if (! empty($ICMS)) { |
|
| 2562 | + if (!empty($ICMS)) { |
|
| 2563 | 2563 | $impostos .= $this->descricaoProdutoHelper($ICMS, "vBCFCP", " BcFcp=%s"); |
| 2564 | 2564 | $impostos .= $this->descricaoProdutoHelper($ICMS, "pFCP", " pFcp=%s%%"); |
| 2565 | 2565 | $impostos .= $this->descricaoProdutoHelper($ICMS, "vFCP", " vFcp=%s"); |
@@ -2575,7 +2575,7 @@ discard block |
||
| 2575 | 2575 | $impostos .= $this->descricaoProdutoHelper($ICMS, "pST", " pSt=%s"); |
| 2576 | 2576 | $impostos .= $this->descricaoProdutoHelper($ICMS, "vICMSSTRet", " VALOR ICMS ST=%s"); |
| 2577 | 2577 | } |
| 2578 | - if (! empty($ICMSUFDest)) { |
|
| 2578 | + if (!empty($ICMSUFDest)) { |
|
| 2579 | 2579 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pFCPUFDest", " pFCPUFDest=%s%%"); |
| 2580 | 2580 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSUFDest", " pICMSUFDest=%s%%"); |
| 2581 | 2581 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "pICMSInterPart", " pICMSInterPart=%s%%"); |
@@ -2583,20 +2583,20 @@ discard block |
||
| 2583 | 2583 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s"); |
| 2584 | 2584 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s"); |
| 2585 | 2585 | } |
| 2586 | - $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
| 2586 | + $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
| 2587 | 2587 | ? substr( |
| 2588 | 2588 | $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue), |
| 2589 | 2589 | 0, |
| 2590 | 2590 | 500 |
| 2591 | 2591 | ) |
| 2592 | 2592 | : ''; |
| 2593 | - if (! empty($infAdProd)) { |
|
| 2593 | + if (!empty($infAdProd)) { |
|
| 2594 | 2594 | $infAdProd = trim($infAdProd); |
| 2595 | 2595 | $infAdProd .= ' '; |
| 2596 | 2596 | } |
| 2597 | 2597 | $loteTxt = ''; |
| 2598 | 2598 | $rastro = $prod->getElementsByTagName("med"); |
| 2599 | - if (! empty($prod->getElementsByTagName("rastro"))) { |
|
| 2599 | + if (!empty($prod->getElementsByTagName("rastro"))) { |
|
| 2600 | 2600 | $rastro = $prod->getElementsByTagName("rastro"); |
| 2601 | 2601 | $i = 0; |
| 2602 | 2602 | while ($i < $rastro->length) { |
@@ -2605,14 +2605,14 @@ discard block |
||
| 2605 | 2605 | $loteTxt .= $this->getTagDate($rastro->item($i), 'dFab', ' Fab: '); |
| 2606 | 2606 | $loteTxt .= $this->getTagDate($rastro->item($i), 'dVal', ' Val: '); |
| 2607 | 2607 | $loteTxt .= $this->getTagValue($rastro->item($i), 'vPMC', ' PMC: '); |
| 2608 | - $i ++; |
|
| 2608 | + $i++; |
|
| 2609 | 2609 | } |
| 2610 | 2610 | if ($loteTxt != '') { |
| 2611 | 2611 | $loteTxt .= ' '; |
| 2612 | 2612 | } |
| 2613 | 2613 | } |
| 2614 | 2614 | //NT2013.006 FCI |
| 2615 | - $nFCI = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
| 2615 | + $nFCI = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
| 2616 | 2616 | ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
| 2617 | 2617 | $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
| 2618 | 2618 | $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue |
@@ -2662,7 +2662,7 @@ discard block |
||
| 2662 | 2662 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2663 | 2663 | $y += 3; |
| 2664 | 2664 | //desenha a caixa dos dados dos itens da NF |
| 2665 | - $hmax += 1; |
|
| 2665 | + $hmax += 1; |
|
| 2666 | 2666 | $texto = ''; |
| 2667 | 2667 | $this->pdf->textBox($x, $y, $w, $hmax); |
| 2668 | 2668 | //################################################################################## |
@@ -2675,101 +2675,101 @@ discard block |
||
| 2675 | 2675 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2676 | 2676 | $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax); |
| 2677 | 2677 | //DESCRIÇÃO DO PRODUTO / SERVIÇO |
| 2678 | - $x += $w1; |
|
| 2678 | + $x += $w1; |
|
| 2679 | 2679 | $w2 = round($w * 0.25, 0); |
| 2680 | 2680 | $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO'; |
| 2681 | 2681 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2682 | 2682 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2683 | 2683 | $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax); |
| 2684 | 2684 | //NCM/SH |
| 2685 | - $x += $w2; |
|
| 2685 | + $x += $w2; |
|
| 2686 | 2686 | $w3 = round($w * 0.06, 0); |
| 2687 | 2687 | $texto = 'NCM/SH'; |
| 2688 | 2688 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2689 | 2689 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2690 | 2690 | $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax); |
| 2691 | 2691 | //O/CST ou O/CSOSN |
| 2692 | - $x += $w3; |
|
| 2692 | + $x += $w3; |
|
| 2693 | 2693 | $w4 = round($w * 0.05, 0); |
| 2694 | - $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2 |
|
| 2694 | + $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 ou CRT = 2 |
|
| 2695 | 2695 | if ($this->getTagValue($this->emit, 'CRT') == '3') { |
| 2696 | - $texto = 'O/CST';//Regime Normal |
|
| 2696 | + $texto = 'O/CST'; //Regime Normal |
|
| 2697 | 2697 | } |
| 2698 | 2698 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2699 | 2699 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2700 | 2700 | $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax); |
| 2701 | 2701 | //CFOP |
| 2702 | - $x += $w4; |
|
| 2702 | + $x += $w4; |
|
| 2703 | 2703 | $w5 = round($w * 0.04, 0); |
| 2704 | 2704 | $texto = 'CFOP'; |
| 2705 | 2705 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2706 | 2706 | $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2707 | 2707 | $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax); |
| 2708 | 2708 | //UN |
| 2709 | - $x += $w5; |
|
| 2709 | + $x += $w5; |
|
| 2710 | 2710 | $w6 = round($w * 0.03, 0); |
| 2711 | 2711 | $texto = 'UN'; |
| 2712 | 2712 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2713 | 2713 | $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2714 | 2714 | $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax); |
| 2715 | 2715 | //QUANT |
| 2716 | - $x += $w6; |
|
| 2716 | + $x += $w6; |
|
| 2717 | 2717 | $w7 = round($w * 0.08, 0); |
| 2718 | 2718 | $texto = 'QUANT'; |
| 2719 | 2719 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2720 | 2720 | $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2721 | 2721 | $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax); |
| 2722 | 2722 | //VALOR UNIT |
| 2723 | - $x += $w7; |
|
| 2723 | + $x += $w7; |
|
| 2724 | 2724 | $w8 = round($w * 0.06, 0); |
| 2725 | 2725 | $texto = 'VALOR UNIT'; |
| 2726 | 2726 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2727 | 2727 | $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2728 | 2728 | $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax); |
| 2729 | 2729 | //VALOR TOTAL |
| 2730 | - $x += $w8; |
|
| 2730 | + $x += $w8; |
|
| 2731 | 2731 | $w9 = round($w * 0.06, 0); |
| 2732 | 2732 | $texto = 'VALOR TOTAL'; |
| 2733 | 2733 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2734 | 2734 | $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2735 | 2735 | $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax); |
| 2736 | 2736 | //VALOR DESCONTO |
| 2737 | - $x += $w9; |
|
| 2737 | + $x += $w9; |
|
| 2738 | 2738 | $w10 = round($w * 0.05, 0); |
| 2739 | 2739 | $texto = 'VALOR DESC'; |
| 2740 | 2740 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2741 | 2741 | $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2742 | 2742 | $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax); |
| 2743 | 2743 | //B.CÁLC ICMS |
| 2744 | - $x += $w10; |
|
| 2744 | + $x += $w10; |
|
| 2745 | 2745 | $w11 = round($w * 0.06, 0); |
| 2746 | 2746 | $texto = 'B.CÁLC ICMS'; |
| 2747 | 2747 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2748 | 2748 | $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2749 | 2749 | $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax); |
| 2750 | 2750 | //VALOR ICMS |
| 2751 | - $x += $w11; |
|
| 2751 | + $x += $w11; |
|
| 2752 | 2752 | $w12 = round($w * 0.06, 0); |
| 2753 | 2753 | $texto = 'VALOR ICMS'; |
| 2754 | 2754 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2755 | 2755 | $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2756 | 2756 | $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax); |
| 2757 | 2757 | //VALOR IPI |
| 2758 | - $x += $w12; |
|
| 2758 | + $x += $w12; |
|
| 2759 | 2759 | $w13 = round($w * 0.05, 0); |
| 2760 | 2760 | $texto = 'VALOR IPI'; |
| 2761 | 2761 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2762 | 2762 | $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2763 | 2763 | $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax); |
| 2764 | 2764 | //ALÍQ. ICMS |
| 2765 | - $x += $w13; |
|
| 2765 | + $x += $w13; |
|
| 2766 | 2766 | $w14 = round($w * 0.04, 0); |
| 2767 | 2767 | $texto = 'ALÍQ. ICMS'; |
| 2768 | 2768 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 2769 | 2769 | $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2770 | 2770 | $this->pdf->line($x + $w14, $y, $x + $w14, $y + $hmax); |
| 2771 | 2771 | //ALÍQ. IPI |
| 2772 | - $x += $w14; |
|
| 2772 | + $x += $w14; |
|
| 2773 | 2773 | $w15 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13 + $w14); |
| 2774 | 2774 | $texto = 'ALÍQ. IPI'; |
| 2775 | 2775 | $this->pdf->textBox($x, $y, $w15, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
@@ -2806,12 +2806,12 @@ discard block |
||
| 2806 | 2806 | // ambas as informações deverão estar expressas e identificadas no DANFE, podendo ser |
| 2807 | 2807 | // utilizada uma das linhas adicionais previstas, ou o campo de informações adicionais." |
| 2808 | 2808 | // > Manual Integração - Contribuinte 4.01 - NT2009.006, Item 7.1.5, página 91. |
| 2809 | - $mostrarUnidadeTributavel = (! empty($uTrib) && strcmp($uCom, $uTrib->nodeValue)); |
|
| 2809 | + $mostrarUnidadeTributavel = (!empty($uTrib) && strcmp($uCom, $uTrib->nodeValue)); |
|
| 2810 | 2810 | |
| 2811 | 2811 | // Informação sobre unidade de medida tributavel. |
| 2812 | 2812 | // Se não for para exibir a unidade de medida tributavel, então |
| 2813 | 2813 | // A Escrita irá começar em 0. |
| 2814 | - if (! $mostrarUnidadeTributavel) { |
|
| 2814 | + if (!$mostrarUnidadeTributavel) { |
|
| 2815 | 2815 | $yTrib = 0; |
| 2816 | 2816 | } |
| 2817 | 2817 | $h = $this->calculeHeight($thisItem, $mostrarUnidadeTributavel); |
@@ -2846,7 +2846,7 @@ discard block |
||
| 2846 | 2846 | } |
| 2847 | 2847 | $x += $w2; |
| 2848 | 2848 | //NCM |
| 2849 | - $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
| 2849 | + $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
| 2850 | 2850 | $prod->getElementsByTagName("NCM")->item(0)->nodeValue : ''; |
| 2851 | 2851 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2852 | 2852 | $x += $w3; |
@@ -2859,11 +2859,11 @@ discard block |
||
| 2859 | 2859 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2860 | 2860 | } |
| 2861 | 2861 | //CFOP |
| 2862 | - $x += $w4; |
|
| 2862 | + $x += $w4; |
|
| 2863 | 2863 | $texto = $prod->getElementsByTagName("CFOP")->item(0)->nodeValue; |
| 2864 | 2864 | $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2865 | 2865 | //Unidade |
| 2866 | - $x += $w5; |
|
| 2866 | + $x += $w5; |
|
| 2867 | 2867 | $texto = $uCom; |
| 2868 | 2868 | $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2869 | 2869 | //Unidade de medida tributável |
@@ -2884,7 +2884,7 @@ discard block |
||
| 2884 | 2884 | // QTDADE Tributável |
| 2885 | 2885 | if ($mostrarUnidadeTributavel) { |
| 2886 | 2886 | $qTrib = $prod->getElementsByTagName("qTrib")->item(0); |
| 2887 | - if (! empty($qTrib)) { |
|
| 2887 | + if (!empty($qTrib)) { |
|
| 2888 | 2888 | $texto = number_format($qTrib->nodeValue, $this->qComCasasDec, ",", "."); |
| 2889 | 2889 | $this->pdf->textBox($x, $yTrib, $w7, $h, $texto, $aFont, 'T', $alinhamento, 0, ''); |
| 2890 | 2890 | } |
@@ -2897,7 +2897,7 @@ discard block |
||
| 2897 | 2897 | // Valor Unitário Tributável |
| 2898 | 2898 | if ($mostrarUnidadeTributavel) { |
| 2899 | 2899 | $vUnTrib = $prod->getElementsByTagName("vUnTrib")->item(0); |
| 2900 | - if (! empty($vUnTrib)) { |
|
| 2900 | + if (!empty($vUnTrib)) { |
|
| 2901 | 2901 | $texto = number_format($vUnTrib->nodeValue, $this->vUnComCasasDec, ",", "."); |
| 2902 | 2902 | $this->pdf->textBox($x, $yTrib, $w8, $h, $texto, $aFont, 'T', $alinhamento, 0, ''); |
| 2903 | 2903 | } |
@@ -2911,7 +2911,7 @@ discard block |
||
| 2911 | 2911 | $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'T', $alinhamento, 0, ''); |
| 2912 | 2912 | $x += $w9; |
| 2913 | 2913 | //Valor do Desconto |
| 2914 | - $vdesc = ! empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue) |
|
| 2914 | + $vdesc = !empty($prod->getElementsByTagName("vDesc")->item(0)->nodeValue) |
|
| 2915 | 2915 | ? $prod->getElementsByTagName("vDesc")->item(0)->nodeValue : 0; |
| 2916 | 2916 | |
| 2917 | 2917 | $texto = number_format($vdesc, 2, ",", "."); |
@@ -2919,7 +2919,7 @@ discard block |
||
| 2919 | 2919 | //Valor da Base de calculo |
| 2920 | 2920 | $x += $w10; |
| 2921 | 2921 | if (isset($ICMS)) { |
| 2922 | - $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) |
|
| 2922 | + $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) |
|
| 2923 | 2923 | ? number_format( |
| 2924 | 2924 | $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue, |
| 2925 | 2925 | 2, |
@@ -2932,7 +2932,7 @@ discard block |
||
| 2932 | 2932 | //Valor do ICMS |
| 2933 | 2933 | $x += $w11; |
| 2934 | 2934 | if (isset($ICMS)) { |
| 2935 | - $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) |
|
| 2935 | + $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) |
|
| 2936 | 2936 | ? number_format( |
| 2937 | 2937 | $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue, |
| 2938 | 2938 | 2, |
@@ -2945,7 +2945,7 @@ discard block |
||
| 2945 | 2945 | //Valor do IPI |
| 2946 | 2946 | $x += $w12; |
| 2947 | 2947 | if (isset($IPI)) { |
| 2948 | - $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) |
|
| 2948 | + $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) |
|
| 2949 | 2949 | ? number_format( |
| 2950 | 2950 | $IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, |
| 2951 | 2951 | 2, |
@@ -2960,7 +2960,7 @@ discard block |
||
| 2960 | 2960 | // %ICMS |
| 2961 | 2961 | $x += $w13; |
| 2962 | 2962 | if (isset($ICMS)) { |
| 2963 | - $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) |
|
| 2963 | + $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) |
|
| 2964 | 2964 | ? number_format( |
| 2965 | 2965 | $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue, |
| 2966 | 2966 | 2, |
@@ -2973,7 +2973,7 @@ discard block |
||
| 2973 | 2973 | //%IPI |
| 2974 | 2974 | $x += $w14; |
| 2975 | 2975 | if (isset($IPI)) { |
| 2976 | - $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) |
|
| 2976 | + $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) |
|
| 2977 | 2977 | ? number_format( |
| 2978 | 2978 | $IPI->getElementsByTagName("pIPI")->item(0)->nodeValue, |
| 2979 | 2979 | 2, |
@@ -2991,17 +2991,17 @@ discard block |
||
| 2991 | 2991 | $veicProd = $prod->getElementsByTagName("veicProd")->item(0); |
| 2992 | 2992 | // Tag somente é gerada para veiculo 0k, e só é permitido um veiculo por NF-e por conta do detran |
| 2993 | 2993 | // Verifica se a Tag existe |
| 2994 | - if (! empty($veicProd)) { |
|
| 2994 | + if (!empty($veicProd)) { |
|
| 2995 | 2995 | $this->dadosItenVeiculoDANFE($oldX, $y, $nInicio, $h, $prod); |
| 2996 | 2996 | } |
| 2997 | 2997 | |
| 2998 | 2998 | |
| 2999 | 2999 | $y += $h; |
| 3000 | - $i ++; |
|
| 3000 | + $i++; |
|
| 3001 | 3001 | //incrementa o controle dos itens processados. |
| 3002 | - $this->qtdeItensProc ++; |
|
| 3002 | + $this->qtdeItensProc++; |
|
| 3003 | 3003 | } else { |
| 3004 | - $i ++; |
|
| 3004 | + $i++; |
|
| 3005 | 3005 | } |
| 3006 | 3006 | } |
| 3007 | 3007 | |
@@ -3206,23 +3206,23 @@ discard block |
||
| 3206 | 3206 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => 'B']; |
| 3207 | 3207 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 3208 | 3208 | //INSCRIÇÃO MUNICIPAL |
| 3209 | - $y += 3; |
|
| 3209 | + $y += 3; |
|
| 3210 | 3210 | $w = round($this->wPrint * 0.23, 0); |
| 3211 | 3211 | $texto = 'INSCRIÇÃO MUNICIPAL'; |
| 3212 | 3212 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 3213 | 3213 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 3214 | 3214 | //inscrição municipal |
| 3215 | - $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
| 3215 | + $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
| 3216 | 3216 | $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : ''; |
| 3217 | 3217 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 3218 | 3218 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 3219 | 3219 | //VALOR TOTAL DOS SERVIÇOS |
| 3220 | - $x += $w; |
|
| 3220 | + $x += $w; |
|
| 3221 | 3221 | $texto = 'VALOR TOTAL DOS SERVIÇOS'; |
| 3222 | 3222 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 3223 | 3223 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 3224 | 3224 | if (isset($this->ISSQNtot)) { |
| 3225 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
| 3225 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
| 3226 | 3226 | $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : ''; |
| 3227 | 3227 | $texto = number_format($texto, 2, ",", "."); |
| 3228 | 3228 | } else { |
@@ -3231,14 +3231,14 @@ discard block |
||
| 3231 | 3231 | $aFont = ['font' => $this->fontePadrao, 'size' => 10, 'style' => 'B']; |
| 3232 | 3232 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 3233 | 3233 | //BASE DE CÁLCULO DO ISSQN |
| 3234 | - $x += $w; |
|
| 3234 | + $x += $w; |
|
| 3235 | 3235 | $texto = 'BASE DE CÁLCULO DO ISSQN'; |
| 3236 | 3236 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 3237 | 3237 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 3238 | 3238 | if (isset($this->ISSQNtot)) { |
| 3239 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 3239 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 3240 | 3240 | $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : ''; |
| 3241 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3241 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3242 | 3242 | } else { |
| 3243 | 3243 | $texto = ''; |
| 3244 | 3244 | } |
@@ -3255,9 +3255,9 @@ discard block |
||
| 3255 | 3255 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 3256 | 3256 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 3257 | 3257 | if (isset($this->ISSQNtot)) { |
| 3258 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
| 3258 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
| 3259 | 3259 | $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : ''; |
| 3260 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3260 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3261 | 3261 | } else { |
| 3262 | 3262 | $texto = ''; |
| 3263 | 3263 | } |
@@ -3296,7 +3296,7 @@ discard block |
||
| 3296 | 3296 | |
| 3297 | 3297 | //INFORMAÇÕES COMPLEMENTARES |
| 3298 | 3298 | $texto = "INFORMAÇÕES COMPLEMENTARES"; |
| 3299 | - $y += 3; |
|
| 3299 | + $y += 3; |
|
| 3300 | 3300 | $w = $this->wAdic; |
| 3301 | 3301 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => 'B']; |
| 3302 | 3302 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3306,7 +3306,7 @@ discard block |
||
| 3306 | 3306 | //$this->textoAdic com o texto completo do campo |
| 3307 | 3307 | //echo str_replace("\n", "<br>",$this->textoAdic); |
| 3308 | 3308 | //die; |
| 3309 | - $y += 1; |
|
| 3309 | + $y += 1; |
|
| 3310 | 3310 | $aFont = ['font' => $this->fontePadrao, 'size' => $this->textadicfontsize * $this->pdf->k, 'style' => '']; |
| 3311 | 3311 | //$aFont = ['font'=>$this->fontePadrao, 'size'=> 5, 'style'=>'']; |
| 3312 | 3312 | $this->pdf->textBox($x, $y + 2, $w - 2, $h, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
@@ -3357,7 +3357,7 @@ discard block |
||
| 3357 | 3357 | $texto = 'CONTINGÊNCIA SVC-RS' . $dhCont . $xJust; |
| 3358 | 3358 | break; |
| 3359 | 3359 | } |
| 3360 | - $y += 2; |
|
| 3360 | + $y += 2; |
|
| 3361 | 3361 | $aFont = ['font' => $this->fontePadrao, 'size' => 7, 'style' => '']; |
| 3362 | 3362 | $this->pdf->textBox($x, $y, $w - 2, $h, $texto, $aFont, 'T', 'L', 0, '', false); |
| 3363 | 3363 | |
@@ -3412,7 +3412,7 @@ discard block |
||
| 3412 | 3412 | $tpNF = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue; |
| 3413 | 3413 | if ($tpNF == '0') { |
| 3414 | 3414 | //NFe de Entrada |
| 3415 | - $emitente = ''; |
|
| 3415 | + $emitente = ''; |
|
| 3416 | 3416 | $emitente .= $this->dest->getElementsByTagName("xNome")->item(0)->nodeValue . " - "; |
| 3417 | 3417 | $emitente .= $this->enderDest->getElementsByTagName("xLgr")->item(0)->nodeValue . ", "; |
| 3418 | 3418 | $emitente .= $this->enderDest->getElementsByTagName("nro")->item(0)->nodeValue . " - "; |
@@ -3465,10 +3465,10 @@ discard block |
||
| 3465 | 3465 | $texto .= "AO LADO"; |
| 3466 | 3466 | } |
| 3467 | 3467 | $texto .= ". EMISSÃO: "; |
| 3468 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3468 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3469 | 3469 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 3470 | 3470 | if ($dEmi == '') { |
| 3471 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3471 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3472 | 3472 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 3473 | 3473 | $aDemi = explode('T', $dEmi); |
| 3474 | 3474 | $dEmi = $aDemi[0]; |
@@ -3491,12 +3491,12 @@ discard block |
||
| 3491 | 3491 | $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, ''); |
| 3492 | 3492 | //DATA DE RECEBIMENTO |
| 3493 | 3493 | $texto = "DATA DE RECEBIMENTO"; |
| 3494 | - $y += $h; |
|
| 3494 | + $y += $h; |
|
| 3495 | 3495 | $w2 = round($this->wPrint * 0.17, 0); //35; |
| 3496 | 3496 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 3497 | 3497 | $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3498 | 3498 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
| 3499 | - $x += $w2; |
|
| 3499 | + $x += $w2; |
|
| 3500 | 3500 | $w3 = $w - $w2; |
| 3501 | 3501 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
| 3502 | 3502 | $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3507,7 +3507,7 @@ discard block |
||
| 3507 | 3507 | |
| 3508 | 3508 | return $y; |
| 3509 | 3509 | } else { |
| 3510 | - $x --; |
|
| 3510 | + $x--; |
|
| 3511 | 3511 | $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
| 3512 | 3512 | //NUMERO DA NOTA FISCAL LOGO NFE |
| 3513 | 3513 | $w1 = 18; |
@@ -3528,7 +3528,7 @@ discard block |
||
| 3528 | 3528 | $aFont = ['font' => $this->fontePadrao, 'size' => 6, 'style' => '']; |
| 3529 | 3529 | $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3530 | 3530 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
| 3531 | - $y -= $w2; |
|
| 3531 | + $y -= $w2; |
|
| 3532 | 3532 | $w3 = $w - $w2; |
| 3533 | 3533 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
| 3534 | 3534 | $aFont = ['font' => $this->fontePadrao, 'size' => 5.7, 'style' => '']; |
@@ -3549,18 +3549,18 @@ discard block |
||
| 3549 | 3549 | */ |
| 3550 | 3550 | protected function geraInformacoesDaTagCompra() |
| 3551 | 3551 | { |
| 3552 | - if (! $this->gerarInformacoesAutomaticas) { |
|
| 3552 | + if (!$this->gerarInformacoesAutomaticas) { |
|
| 3553 | 3553 | return ''; |
| 3554 | 3554 | } |
| 3555 | 3555 | $saida = ""; |
| 3556 | 3556 | if (isset($this->compra)) { |
| 3557 | - if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
| 3557 | + if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
| 3558 | 3558 | $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue; |
| 3559 | 3559 | } |
| 3560 | - if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
| 3560 | + if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
| 3561 | 3561 | $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue; |
| 3562 | 3562 | } |
| 3563 | - if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
| 3563 | + if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
| 3564 | 3564 | $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue; |
| 3565 | 3565 | } |
| 3566 | 3566 | } |
@@ -3591,10 +3591,10 @@ discard block |
||
| 3591 | 3591 | if ($icmss > 0) { |
| 3592 | 3592 | $icmss = 1; |
| 3593 | 3593 | } |
| 3594 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3594 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3595 | 3595 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 3596 | 3596 | if ($dEmi == '') { |
| 3597 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3597 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3598 | 3598 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 3599 | 3599 | $aDemi = explode('T', $dEmi); |
| 3600 | 3600 | $dEmi = $aDemi[0]; |
@@ -3618,7 +3618,7 @@ discard block |
||
| 3618 | 3618 | */ |
| 3619 | 3619 | protected function geraInformacoesDasNotasReferenciadas() |
| 3620 | 3620 | { |
| 3621 | - if (! $this->gerarInformacoesAutomaticas) { |
|
| 3621 | + if (!$this->gerarInformacoesAutomaticas) { |
|
| 3622 | 3622 | return ''; |
| 3623 | 3623 | } |
| 3624 | 3624 | $formaNfeRef = "\r\nNFe Ref.: série:%d número:%d emit:%s em %s [%s]"; |
@@ -3646,7 +3646,7 @@ discard block |
||
| 3646 | 3646 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
| 3647 | 3647 | $serie = substr($chave_acesso, 22, 3); |
| 3648 | 3648 | $numero = substr($chave_acesso, 25, 9); |
| 3649 | - $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
| 3649 | + $saida .= sprintf($formaNfeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
| 3650 | 3650 | } |
| 3651 | 3651 | $refNF = $nfRef->getElementsByTagName('refNF'); |
| 3652 | 3652 | foreach ($refNF as $umaRefNFe) { |
@@ -3657,7 +3657,7 @@ discard block |
||
| 3657 | 3657 | $numero = $umaRefNFe->getElementsByTagName('nNF')->item(0)->nodeValue; |
| 3658 | 3658 | $data = substr($data, 2, 2) . "/20" . substr($data, 0, 2); |
| 3659 | 3659 | $cnpj = $this->formatField($cnpj, "##.###.###/####-##"); |
| 3660 | - $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod); |
|
| 3660 | + $saida .= sprintf($formaNfRef, $serie, $numero, $cnpj, $data, $mod); |
|
| 3661 | 3661 | } |
| 3662 | 3662 | $refCTe = $nfRef->getElementsByTagName('refCTe'); |
| 3663 | 3663 | foreach ($refCTe as $chave_acessoRef) { |
@@ -3667,7 +3667,7 @@ discard block |
||
| 3667 | 3667 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
| 3668 | 3668 | $serie = substr($chave_acesso, 22, 3); |
| 3669 | 3669 | $numero = substr($chave_acesso, 25, 9); |
| 3670 | - $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
| 3670 | + $saida .= sprintf($formaCTeRef, $serie, $numero, $cnpj, $data, $chave_acessoF); |
|
| 3671 | 3671 | } |
| 3672 | 3672 | $refECF = $nfRef->getElementsByTagName('refECF'); |
| 3673 | 3673 | foreach ($refECF as $umaRefNFe) { |
@@ -3679,10 +3679,9 @@ discard block |
||
| 3679 | 3679 | $refNFP = $nfRef->getElementsByTagName('refNFP'); |
| 3680 | 3680 | foreach ($refNFP as $umaRefNFe) { |
| 3681 | 3681 | $data = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue; |
| 3682 | - $cnpj = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
| 3683 | - $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : |
|
| 3684 | - ''; |
|
| 3685 | - $cpf = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
| 3682 | + $cnpj = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
| 3683 | + $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : ''; |
|
| 3684 | + $cpf = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
| 3686 | 3685 | $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : ''; |
| 3687 | 3686 | $mod = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue; |
| 3688 | 3687 | $serie = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue; |
@@ -3704,7 +3703,7 @@ discard block |
||
| 3704 | 3703 | private function loadDoc($xml) |
| 3705 | 3704 | { |
| 3706 | 3705 | $this->xml = $xml; |
| 3707 | - if (! empty($xml)) { |
|
| 3706 | + if (!empty($xml)) { |
|
| 3708 | 3707 | $this->dom = new Dom(); |
| 3709 | 3708 | $this->dom->loadXML($this->xml); |
| 3710 | 3709 | if (empty($this->dom->getElementsByTagName("infNFe")->item(0))) { |
@@ -3758,7 +3757,7 @@ discard block |
||
| 3758 | 3757 | $numlinhas = $this->pdf->getNumLines($textoProduto, $w2, $aFont); |
| 3759 | 3758 | |
| 3760 | 3759 | if ($mostrarUnidadeTributavel && $numlinhas == 1) { |
| 3761 | - $numlinhas ++; |
|
| 3760 | + $numlinhas++; |
|
| 3762 | 3761 | } |
| 3763 | 3762 | |
| 3764 | 3763 | 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 |
@@ -970,6 +1013,9 @@ discard block |
||
| 970 | 1013 | } |
| 971 | 1014 | } |
| 972 | 1015 | |
| 1016 | + /** |
|
| 1017 | + * @param string $file |
|
| 1018 | + */ |
|
| 973 | 1019 | public function image($file, $x = null, $y = null, $w = 0, $h = 0, $type = '', $link = '') |
| 974 | 1020 | { |
| 975 | 1021 | // Put an image on the page |
@@ -1214,6 +1260,10 @@ discard block |
||
| 1214 | 1260 | } |
| 1215 | 1261 | } |
| 1216 | 1262 | |
| 1263 | + /** |
|
| 1264 | + * @param string $orientation |
|
| 1265 | + * @param string $size |
|
| 1266 | + */ |
|
| 1217 | 1267 | protected function beginPage($orientation, $size, $rotation) |
| 1218 | 1268 | { |
| 1219 | 1269 | $this->page++; |
@@ -1416,6 +1466,9 @@ discard block |
||
| 1416 | 1466 | ]; |
| 1417 | 1467 | } |
| 1418 | 1468 | |
| 1469 | + /** |
|
| 1470 | + * @param string $file |
|
| 1471 | + */ |
|
| 1419 | 1472 | protected function parsePng($file) |
| 1420 | 1473 | { |
| 1421 | 1474 | // 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; |
@@ -219,10 +219,10 @@ discard block |
||
| 219 | 219 | //total inicial de paginas |
| 220 | 220 | $totPag = 1; |
| 221 | 221 | //largura imprimivel em mm: largura da folha menos as margens esq/direita |
| 222 | - $this->wPrint = $maxW-($margEsq*2); |
|
| 222 | + $this->wPrint = $maxW - ($margEsq * 2); |
|
| 223 | 223 | //comprimento (altura) imprimivel em mm: altura da folha menos as margens |
| 224 | 224 | //superior e inferior |
| 225 | - $this->hPrint = $maxH-$margSup-$margInf; |
|
| 225 | + $this->hPrint = $maxH - $margSup - $margInf; |
|
| 226 | 226 | // estabelece contagem de paginas |
| 227 | 227 | $this->pdf->aliasNbPages(); |
| 228 | 228 | $this->pdf->setMargins($margEsq, $margSup); // fixa as margens |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $y = $this->blocoIX($y); //informações sobre tributos |
| 247 | 247 | $y = $this->blocoX($y); //creditos |
| 248 | 248 | |
| 249 | - $ymark = $maxH/4; |
|
| 249 | + $ymark = $maxH / 4; |
|
| 250 | 250 | if ($this->tpAmb == 2) { |
| 251 | 251 | $this->pdf->setTextColor(120, 120, 120); |
| 252 | 252 | $texto = "SEM VALOR FISCAL\nEmitida em ambiente de homologacao"; |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $this->margem, |
| 256 | 256 | $ymark, |
| 257 | 257 | $this->wPrint, |
| 258 | - $maxH/2, |
|
| 258 | + $maxH / 2, |
|
| 259 | 259 | $texto, |
| 260 | 260 | $aFont, |
| 261 | 261 | 'T', |
@@ -272,9 +272,9 @@ discard block |
||
| 272 | 272 | $aFont = ['font' => $this->fontePadrao, 'size' => 24, 'style' => 'B']; |
| 273 | 273 | $this->pdf->textBox( |
| 274 | 274 | $this->margem, |
| 275 | - $ymark+4, |
|
| 275 | + $ymark + 4, |
|
| 276 | 276 | $this->wPrint, |
| 277 | - $maxH/2, |
|
| 277 | + $maxH / 2, |
|
| 278 | 278 | $texto, |
| 279 | 279 | $aFont, |
| 280 | 280 | 'T', |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | $y = $this->blocoVIII($y); //QRCODE |
| 303 | 303 | $y = $this->blocoIX($y); //informações sobre tributos |
| 304 | 304 | $y = $this->blocoX($y); //creditos |
| 305 | - $ymark = $maxH/4; |
|
| 305 | + $ymark = $maxH / 4; |
|
| 306 | 306 | if ($this->tpAmb == 2) { |
| 307 | 307 | $this->pdf->setTextColor(120, 120, 120); |
| 308 | 308 | $texto = "SEM VALOR FISCAL\nEmitida em ambiente de homologacao"; |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | $this->margem, |
| 312 | 312 | $ymark, |
| 313 | 313 | $this->wPrint, |
| 314 | - $maxH/2, |
|
| 314 | + $maxH / 2, |
|
| 315 | 315 | $texto, |
| 316 | 316 | $aFont, |
| 317 | 317 | 'T', |
@@ -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; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $this->pdf->textBox( |
| 25 | 25 | $this->margem, |
| 26 | 26 | $y, |
| 27 | - $this->wPrint/2, |
|
| 27 | + $this->wPrint / 2, |
|
| 28 | 28 | 3, |
| 29 | 29 | $texto, |
| 30 | 30 | $aFont, |
@@ -35,9 +35,9 @@ discard block |
||
| 35 | 35 | false |
| 36 | 36 | ); |
| 37 | 37 | $y1 = $this->pdf->textBox( |
| 38 | - $this->margem+$this->wPrint/2, |
|
| 38 | + $this->margem + $this->wPrint / 2, |
|
| 39 | 39 | $y, |
| 40 | - $this->wPrint/2, |
|
| 40 | + $this->wPrint / 2, |
|
| 41 | 41 | 3, |
| 42 | 42 | $qtd, |
| 43 | 43 | $aFont, |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | $texto = "Valor Total R$"; |
| 52 | 52 | $this->pdf->textBox( |
| 53 | 53 | $this->margem, |
| 54 | - $y+$y1, |
|
| 55 | - $this->wPrint/2, |
|
| 54 | + $y + $y1, |
|
| 55 | + $this->wPrint / 2, |
|
| 56 | 56 | 3, |
| 57 | 57 | $texto, |
| 58 | 58 | $aFont, |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | ); |
| 65 | 65 | $texto = number_format((float) $bruto, 2, ',', '.'); |
| 66 | 66 | $y2 = $this->pdf->textBox( |
| 67 | - $this->margem+$this->wPrint/2, |
|
| 68 | - $y+$y1, |
|
| 69 | - $this->wPrint/2, |
|
| 67 | + $this->margem + $this->wPrint / 2, |
|
| 68 | + $y + $y1, |
|
| 69 | + $this->wPrint / 2, |
|
| 70 | 70 | 3, |
| 71 | 71 | $texto, |
| 72 | 72 | $aFont, |
@@ -80,8 +80,8 @@ discard block |
||
| 80 | 80 | $texto = "Desconto R$"; |
| 81 | 81 | $this->pdf->textBox( |
| 82 | 82 | $this->margem, |
| 83 | - $y+$y1+$y2, |
|
| 84 | - $this->wPrint/2, |
|
| 83 | + $y + $y1 + $y2, |
|
| 84 | + $this->wPrint / 2, |
|
| 85 | 85 | 3, |
| 86 | 86 | $texto, |
| 87 | 87 | $aFont, |
@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | ); |
| 94 | 94 | $texto = number_format((float) $desconto, 2, ',', '.'); |
| 95 | 95 | $y3 = $this->pdf->textBox( |
| 96 | - $this->margem+$this->wPrint/2, |
|
| 97 | - $y+$y1+$y2, |
|
| 98 | - $this->wPrint/2, |
|
| 96 | + $this->margem + $this->wPrint / 2, |
|
| 97 | + $y + $y1 + $y2, |
|
| 98 | + $this->wPrint / 2, |
|
| 99 | 99 | 3, |
| 100 | 100 | $texto, |
| 101 | 101 | $aFont, |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | $texto = "Valor a Pagar R$"; |
| 114 | 114 | $this->pdf->textBox( |
| 115 | 115 | $this->margem, |
| 116 | - $y+$y1+$y2+$y3, |
|
| 117 | - $this->wPrint/2, |
|
| 116 | + $y + $y1 + $y2 + $y3, |
|
| 117 | + $this->wPrint / 2, |
|
| 118 | 118 | 3, |
| 119 | 119 | $texto, |
| 120 | 120 | $aFont, |
@@ -126,9 +126,9 @@ discard block |
||
| 126 | 126 | ); |
| 127 | 127 | $texto = number_format((float) $valor, 2, ',', '.'); |
| 128 | 128 | $y4 = $this->pdf->textBox( |
| 129 | - $this->margem+$this->wPrint/2, |
|
| 130 | - $y+$y1+$y2+$y3, |
|
| 131 | - $this->wPrint/2, |
|
| 129 | + $this->margem + $this->wPrint / 2, |
|
| 130 | + $y + $y1 + $y2 + $y3, |
|
| 131 | + $this->wPrint / 2, |
|
| 132 | 132 | 3, |
| 133 | 133 | $texto, |
| 134 | 134 | $aFont, |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | false |
| 140 | 140 | ); |
| 141 | 141 | |
| 142 | - $this->pdf->dashedHLine($this->margem, $this->bloco4H+$y, $this->wPrint, 0.1, 30); |
|
| 142 | + $this->pdf->dashedHLine($this->margem, $this->bloco4H + $y, $this->wPrint, 0.1, 30); |
|
| 143 | 143 | return $this->bloco4H + $y; |
| 144 | 144 | } |
| 145 | 145 | } |