@@ -6,129 +6,129 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | class Pdf extends Fpdf |
| 8 | 8 | { |
| 9 | - private $t128; // tabela de codigos 128 |
|
| 10 | - private $abcSet=""; // conjunto de caracteres legiveis em 128 |
|
| 11 | - private $aSet=""; // grupo A do conjunto de de caracteres legiveis |
|
| 12 | - private $bSet=""; // grupo B do conjunto de caracteres legiveis |
|
| 13 | - private $cSet=""; // grupo C do conjunto de caracteres legiveis |
|
| 14 | - private $setFrom; // converter de |
|
| 15 | - private $setTo; // converter para |
|
| 16 | - private $jStart = array("A"=>103, "B"=>104, "C"=>105); // Caracteres de seleção do grupo 128 |
|
| 17 | - private $jSwap = array("A"=>101, "B"=>100, "C"=>99); // Caracteres de troca de grupo |
|
| 9 | + private $t128; // tabela de codigos 128 |
|
| 10 | + private $abcSet = ""; // conjunto de caracteres legiveis em 128 |
|
| 11 | + private $aSet = ""; // grupo A do conjunto de de caracteres legiveis |
|
| 12 | + private $bSet = ""; // grupo B do conjunto de caracteres legiveis |
|
| 13 | + private $cSet = ""; // grupo C do conjunto de caracteres legiveis |
|
| 14 | + private $setFrom; // converter de |
|
| 15 | + private $setTo; // converter para |
|
| 16 | + private $jStart = array("A"=>103, "B"=>104, "C"=>105); // Caracteres de seleção do grupo 128 |
|
| 17 | + private $jSwap = array("A"=>101, "B"=>100, "C"=>99); // Caracteres de troca de grupo |
|
| 18 | 18 | |
| 19 | 19 | public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4') |
| 20 | 20 | { |
| 21 | 21 | //passar parametros para a classe principal |
| 22 | 22 | parent::__construct($orientation, $unit, $format); |
| 23 | 23 | // composição dos caracteres do barcode 128 |
| 24 | - $this->t128[] = array(2, 1, 2, 2, 2, 2); //0 : [ ] |
|
| 25 | - $this->t128[] = array(2, 2, 2, 1, 2, 2); //1 : [!] |
|
| 26 | - $this->t128[] = array(2, 2, 2, 2, 2, 1); //2 : ["] |
|
| 27 | - $this->t128[] = array(1, 2, 1, 2, 2, 3); //3 : [#] |
|
| 28 | - $this->t128[] = array(1, 2, 1, 3, 2, 2); //4 : [$] |
|
| 29 | - $this->t128[] = array(1, 3, 1, 2, 2, 2); //5 : [%] |
|
| 30 | - $this->t128[] = array(1, 2, 2, 2, 1, 3); //6 : [&] |
|
| 31 | - $this->t128[] = array(1, 2, 2, 3, 1, 2); //7 : ['] |
|
| 32 | - $this->t128[] = array(1, 3, 2, 2, 1, 2); //8 : [(] |
|
| 33 | - $this->t128[] = array(2, 2, 1, 2, 1, 3); //9 : [)] |
|
| 34 | - $this->t128[] = array(2, 2, 1, 3, 1, 2); //10 : [*] |
|
| 35 | - $this->t128[] = array(2, 3, 1, 2, 1, 2); //11 : [+] |
|
| 36 | - $this->t128[] = array(1, 1, 2, 2, 3, 2); //12 : [,] |
|
| 37 | - $this->t128[] = array(1, 2, 2, 1, 3, 2); //13 : [-] |
|
| 38 | - $this->t128[] = array(1, 2, 2, 2, 3, 1); //14 : [.] |
|
| 39 | - $this->t128[] = array(1, 1, 3, 2, 2, 2); //15 : [/] |
|
| 40 | - $this->t128[] = array(1, 2, 3, 1, 2, 2); //16 : [0] |
|
| 41 | - $this->t128[] = array(1, 2, 3, 2, 2, 1); //17 : [1] |
|
| 42 | - $this->t128[] = array(2, 2, 3, 2, 1, 1); //18 : [2] |
|
| 43 | - $this->t128[] = array(2, 2, 1, 1, 3, 2); //19 : [3] |
|
| 44 | - $this->t128[] = array(2, 2, 1, 2, 3, 1); //20 : [4] |
|
| 45 | - $this->t128[] = array(2, 1, 3, 2, 1, 2); //21 : [5] |
|
| 46 | - $this->t128[] = array(2, 2, 3, 1, 1, 2); //22 : [6] |
|
| 47 | - $this->t128[] = array(3, 1, 2, 1, 3, 1); //23 : [7] |
|
| 48 | - $this->t128[] = array(3, 1, 1, 2, 2, 2); //24 : [8] |
|
| 49 | - $this->t128[] = array(3, 2, 1, 1, 2, 2); //25 : [9] |
|
| 50 | - $this->t128[] = array(3, 2, 1, 2, 2, 1); //26 : [:] |
|
| 51 | - $this->t128[] = array(3, 1, 2, 2, 1, 2); //27 : [;] |
|
| 52 | - $this->t128[] = array(3, 2, 2, 1, 1, 2); //28 : [<] |
|
| 53 | - $this->t128[] = array(3, 2, 2, 2, 1, 1); //29 : [=] |
|
| 54 | - $this->t128[] = array(2, 1, 2, 1, 2, 3); //30 : [>] |
|
| 55 | - $this->t128[] = array(2, 1, 2, 3, 2, 1); //31 : [?] |
|
| 56 | - $this->t128[] = array(2, 3, 2, 1, 2, 1); //32 : [@] |
|
| 57 | - $this->t128[] = array(1, 1, 1, 3, 2, 3); //33 : [A] |
|
| 58 | - $this->t128[] = array(1, 3, 1, 1, 2, 3); //34 : [B] |
|
| 59 | - $this->t128[] = array(1, 3, 1, 3, 2, 1); //35 : [C] |
|
| 60 | - $this->t128[] = array(1, 1, 2, 3, 1, 3); //36 : [D] |
|
| 61 | - $this->t128[] = array(1, 3, 2, 1, 1, 3); //37 : [E] |
|
| 62 | - $this->t128[] = array(1, 3, 2, 3, 1, 1); //38 : [F] |
|
| 63 | - $this->t128[] = array(2, 1, 1, 3, 1, 3); //39 : [G] |
|
| 64 | - $this->t128[] = array(2, 3, 1, 1, 1, 3); //40 : [H] |
|
| 65 | - $this->t128[] = array(2, 3, 1, 3, 1, 1); //41 : [I] |
|
| 66 | - $this->t128[] = array(1, 1, 2, 1, 3, 3); //42 : [J] |
|
| 67 | - $this->t128[] = array(1, 1, 2, 3, 3, 1); //43 : [K] |
|
| 68 | - $this->t128[] = array(1, 3, 2, 1, 3, 1); //44 : [L] |
|
| 69 | - $this->t128[] = array(1, 1, 3, 1, 2, 3); //45 : [M] |
|
| 70 | - $this->t128[] = array(1, 1, 3, 3, 2, 1); //46 : [N] |
|
| 71 | - $this->t128[] = array(1, 3, 3, 1, 2, 1); //47 : [O] |
|
| 72 | - $this->t128[] = array(3, 1, 3, 1, 2, 1); //48 : [P] |
|
| 73 | - $this->t128[] = array(2, 1, 1, 3, 3, 1); //49 : [Q] |
|
| 74 | - $this->t128[] = array(2, 3, 1, 1, 3, 1); //50 : [R] |
|
| 75 | - $this->t128[] = array(2, 1, 3, 1, 1, 3); //51 : [S] |
|
| 76 | - $this->t128[] = array(2, 1, 3, 3, 1, 1); //52 : [T] |
|
| 77 | - $this->t128[] = array(2, 1, 3, 1, 3, 1); //53 : [U] |
|
| 78 | - $this->t128[] = array(3, 1, 1, 1, 2, 3); //54 : [V] |
|
| 79 | - $this->t128[] = array(3, 1, 1, 3, 2, 1); //55 : [W] |
|
| 80 | - $this->t128[] = array(3, 3, 1, 1, 2, 1); //56 : [X] |
|
| 81 | - $this->t128[] = array(3, 1, 2, 1, 1, 3); //57 : [Y] |
|
| 82 | - $this->t128[] = array(3, 1, 2, 3, 1, 1); //58 : [Z] |
|
| 83 | - $this->t128[] = array(3, 3, 2, 1, 1, 1); //59 : [[] |
|
| 84 | - $this->t128[] = array(3, 1, 4, 1, 1, 1); //60 : [\] |
|
| 85 | - $this->t128[] = array(2, 2, 1, 4, 1, 1); //61 : []] |
|
| 86 | - $this->t128[] = array(4, 3, 1, 1, 1, 1); //62 : [^] |
|
| 87 | - $this->t128[] = array(1, 1, 1, 2, 2, 4); //63 : [_] |
|
| 88 | - $this->t128[] = array(1, 1, 1, 4, 2, 2); //64 : [`] |
|
| 89 | - $this->t128[] = array(1, 2, 1, 1, 2, 4); //65 : [a] |
|
| 90 | - $this->t128[] = array(1, 2, 1, 4, 2, 1); //66 : [b] |
|
| 91 | - $this->t128[] = array(1, 4, 1, 1, 2, 2); //67 : [c] |
|
| 92 | - $this->t128[] = array(1, 4, 1, 2, 2, 1); //68 : [d] |
|
| 93 | - $this->t128[] = array(1, 1, 2, 2, 1, 4); //69 : [e] |
|
| 94 | - $this->t128[] = array(1, 1, 2, 4, 1, 2); //70 : [f] |
|
| 95 | - $this->t128[] = array(1, 2, 2, 1, 1, 4); //71 : [g] |
|
| 96 | - $this->t128[] = array(1, 2, 2, 4, 1, 1); //72 : [h] |
|
| 97 | - $this->t128[] = array(1, 4, 2, 1, 1, 2); //73 : [i] |
|
| 98 | - $this->t128[] = array(1, 4, 2, 2, 1, 1); //74 : [j] |
|
| 99 | - $this->t128[] = array(2, 4, 1, 2, 1, 1); //75 : [k] |
|
| 100 | - $this->t128[] = array(2, 2, 1, 1, 1, 4); //76 : [l] |
|
| 101 | - $this->t128[] = array(4, 1, 3, 1, 1, 1); //77 : [m] |
|
| 102 | - $this->t128[] = array(2, 4, 1, 1, 1, 2); //78 : [n] |
|
| 103 | - $this->t128[] = array(1, 3, 4, 1, 1, 1); //79 : [o] |
|
| 104 | - $this->t128[] = array(1, 1, 1, 2, 4, 2); //80 : [p] |
|
| 105 | - $this->t128[] = array(1, 2, 1, 1, 4, 2); //81 : [q] |
|
| 106 | - $this->t128[] = array(1, 2, 1, 2, 4, 1); //82 : [r] |
|
| 107 | - $this->t128[] = array(1, 1, 4, 2, 1, 2); //83 : [s] |
|
| 108 | - $this->t128[] = array(1, 2, 4, 1, 1, 2); //84 : [t] |
|
| 109 | - $this->t128[] = array(1, 2, 4, 2, 1, 1); //85 : [u] |
|
| 110 | - $this->t128[] = array(4, 1, 1, 2, 1, 2); //86 : [v] |
|
| 111 | - $this->t128[] = array(4, 2, 1, 1, 1, 2); //87 : [w] |
|
| 112 | - $this->t128[] = array(4, 2, 1, 2, 1, 1); //88 : [x] |
|
| 113 | - $this->t128[] = array(2, 1, 2, 1, 4, 1); //89 : [y] |
|
| 114 | - $this->t128[] = array(2, 1, 4, 1, 2, 1); //90 : [z] |
|
| 115 | - $this->t128[] = array(4, 1, 2, 1, 2, 1); //91 : [{] |
|
| 116 | - $this->t128[] = array(1, 1, 1, 1, 4, 3); //92 : [|] |
|
| 117 | - $this->t128[] = array(1, 1, 1, 3, 4, 1); //93 : [}] |
|
| 118 | - $this->t128[] = array(1, 3, 1, 1, 4, 1); //94 : [~] |
|
| 119 | - $this->t128[] = array(1, 1, 4, 1, 1, 3); //95 : [DEL] |
|
| 120 | - $this->t128[] = array(1, 1, 4, 3, 1, 1); //96 : [FNC3] |
|
| 121 | - $this->t128[] = array(4, 1, 1, 1, 1, 3); //97 : [FNC2] |
|
| 122 | - $this->t128[] = array(4, 1, 1, 3, 1, 1); //98 : [SHIFT] |
|
| 123 | - $this->t128[] = array(1, 1, 3, 1, 4, 1); //99 : [Cswap] |
|
| 124 | - $this->t128[] = array(1, 1, 4, 1, 3, 1); //100 : [Bswap] |
|
| 125 | - $this->t128[] = array(3, 1, 1, 1, 4, 1); //101 : [Aswap] |
|
| 126 | - $this->t128[] = array(4, 1, 1, 1, 3, 1); //102 : [FNC1] |
|
| 127 | - $this->t128[] = array(2, 1, 1, 4, 1, 2); //103 : [Astart] |
|
| 128 | - $this->t128[] = array(2, 1, 1, 2, 1, 4); //104 : [Bstart] |
|
| 129 | - $this->t128[] = array(2, 1, 1, 2, 3, 2); //105 : [Cstart] |
|
| 130 | - $this->t128[] = array(2, 3, 3, 1, 1, 1); //106 : [STOP] |
|
| 131 | - $this->t128[] = array(2, 1); //107 : [END BAR] |
|
| 24 | + $this->t128[] = array(2, 1, 2, 2, 2, 2); //0 : [ ] |
|
| 25 | + $this->t128[] = array(2, 2, 2, 1, 2, 2); //1 : [!] |
|
| 26 | + $this->t128[] = array(2, 2, 2, 2, 2, 1); //2 : ["] |
|
| 27 | + $this->t128[] = array(1, 2, 1, 2, 2, 3); //3 : [#] |
|
| 28 | + $this->t128[] = array(1, 2, 1, 3, 2, 2); //4 : [$] |
|
| 29 | + $this->t128[] = array(1, 3, 1, 2, 2, 2); //5 : [%] |
|
| 30 | + $this->t128[] = array(1, 2, 2, 2, 1, 3); //6 : [&] |
|
| 31 | + $this->t128[] = array(1, 2, 2, 3, 1, 2); //7 : ['] |
|
| 32 | + $this->t128[] = array(1, 3, 2, 2, 1, 2); //8 : [(] |
|
| 33 | + $this->t128[] = array(2, 2, 1, 2, 1, 3); //9 : [)] |
|
| 34 | + $this->t128[] = array(2, 2, 1, 3, 1, 2); //10 : [*] |
|
| 35 | + $this->t128[] = array(2, 3, 1, 2, 1, 2); //11 : [+] |
|
| 36 | + $this->t128[] = array(1, 1, 2, 2, 3, 2); //12 : [,] |
|
| 37 | + $this->t128[] = array(1, 2, 2, 1, 3, 2); //13 : [-] |
|
| 38 | + $this->t128[] = array(1, 2, 2, 2, 3, 1); //14 : [.] |
|
| 39 | + $this->t128[] = array(1, 1, 3, 2, 2, 2); //15 : [/] |
|
| 40 | + $this->t128[] = array(1, 2, 3, 1, 2, 2); //16 : [0] |
|
| 41 | + $this->t128[] = array(1, 2, 3, 2, 2, 1); //17 : [1] |
|
| 42 | + $this->t128[] = array(2, 2, 3, 2, 1, 1); //18 : [2] |
|
| 43 | + $this->t128[] = array(2, 2, 1, 1, 3, 2); //19 : [3] |
|
| 44 | + $this->t128[] = array(2, 2, 1, 2, 3, 1); //20 : [4] |
|
| 45 | + $this->t128[] = array(2, 1, 3, 2, 1, 2); //21 : [5] |
|
| 46 | + $this->t128[] = array(2, 2, 3, 1, 1, 2); //22 : [6] |
|
| 47 | + $this->t128[] = array(3, 1, 2, 1, 3, 1); //23 : [7] |
|
| 48 | + $this->t128[] = array(3, 1, 1, 2, 2, 2); //24 : [8] |
|
| 49 | + $this->t128[] = array(3, 2, 1, 1, 2, 2); //25 : [9] |
|
| 50 | + $this->t128[] = array(3, 2, 1, 2, 2, 1); //26 : [:] |
|
| 51 | + $this->t128[] = array(3, 1, 2, 2, 1, 2); //27 : [;] |
|
| 52 | + $this->t128[] = array(3, 2, 2, 1, 1, 2); //28 : [<] |
|
| 53 | + $this->t128[] = array(3, 2, 2, 2, 1, 1); //29 : [=] |
|
| 54 | + $this->t128[] = array(2, 1, 2, 1, 2, 3); //30 : [>] |
|
| 55 | + $this->t128[] = array(2, 1, 2, 3, 2, 1); //31 : [?] |
|
| 56 | + $this->t128[] = array(2, 3, 2, 1, 2, 1); //32 : [@] |
|
| 57 | + $this->t128[] = array(1, 1, 1, 3, 2, 3); //33 : [A] |
|
| 58 | + $this->t128[] = array(1, 3, 1, 1, 2, 3); //34 : [B] |
|
| 59 | + $this->t128[] = array(1, 3, 1, 3, 2, 1); //35 : [C] |
|
| 60 | + $this->t128[] = array(1, 1, 2, 3, 1, 3); //36 : [D] |
|
| 61 | + $this->t128[] = array(1, 3, 2, 1, 1, 3); //37 : [E] |
|
| 62 | + $this->t128[] = array(1, 3, 2, 3, 1, 1); //38 : [F] |
|
| 63 | + $this->t128[] = array(2, 1, 1, 3, 1, 3); //39 : [G] |
|
| 64 | + $this->t128[] = array(2, 3, 1, 1, 1, 3); //40 : [H] |
|
| 65 | + $this->t128[] = array(2, 3, 1, 3, 1, 1); //41 : [I] |
|
| 66 | + $this->t128[] = array(1, 1, 2, 1, 3, 3); //42 : [J] |
|
| 67 | + $this->t128[] = array(1, 1, 2, 3, 3, 1); //43 : [K] |
|
| 68 | + $this->t128[] = array(1, 3, 2, 1, 3, 1); //44 : [L] |
|
| 69 | + $this->t128[] = array(1, 1, 3, 1, 2, 3); //45 : [M] |
|
| 70 | + $this->t128[] = array(1, 1, 3, 3, 2, 1); //46 : [N] |
|
| 71 | + $this->t128[] = array(1, 3, 3, 1, 2, 1); //47 : [O] |
|
| 72 | + $this->t128[] = array(3, 1, 3, 1, 2, 1); //48 : [P] |
|
| 73 | + $this->t128[] = array(2, 1, 1, 3, 3, 1); //49 : [Q] |
|
| 74 | + $this->t128[] = array(2, 3, 1, 1, 3, 1); //50 : [R] |
|
| 75 | + $this->t128[] = array(2, 1, 3, 1, 1, 3); //51 : [S] |
|
| 76 | + $this->t128[] = array(2, 1, 3, 3, 1, 1); //52 : [T] |
|
| 77 | + $this->t128[] = array(2, 1, 3, 1, 3, 1); //53 : [U] |
|
| 78 | + $this->t128[] = array(3, 1, 1, 1, 2, 3); //54 : [V] |
|
| 79 | + $this->t128[] = array(3, 1, 1, 3, 2, 1); //55 : [W] |
|
| 80 | + $this->t128[] = array(3, 3, 1, 1, 2, 1); //56 : [X] |
|
| 81 | + $this->t128[] = array(3, 1, 2, 1, 1, 3); //57 : [Y] |
|
| 82 | + $this->t128[] = array(3, 1, 2, 3, 1, 1); //58 : [Z] |
|
| 83 | + $this->t128[] = array(3, 3, 2, 1, 1, 1); //59 : [[] |
|
| 84 | + $this->t128[] = array(3, 1, 4, 1, 1, 1); //60 : [\] |
|
| 85 | + $this->t128[] = array(2, 2, 1, 4, 1, 1); //61 : []] |
|
| 86 | + $this->t128[] = array(4, 3, 1, 1, 1, 1); //62 : [^] |
|
| 87 | + $this->t128[] = array(1, 1, 1, 2, 2, 4); //63 : [_] |
|
| 88 | + $this->t128[] = array(1, 1, 1, 4, 2, 2); //64 : [`] |
|
| 89 | + $this->t128[] = array(1, 2, 1, 1, 2, 4); //65 : [a] |
|
| 90 | + $this->t128[] = array(1, 2, 1, 4, 2, 1); //66 : [b] |
|
| 91 | + $this->t128[] = array(1, 4, 1, 1, 2, 2); //67 : [c] |
|
| 92 | + $this->t128[] = array(1, 4, 1, 2, 2, 1); //68 : [d] |
|
| 93 | + $this->t128[] = array(1, 1, 2, 2, 1, 4); //69 : [e] |
|
| 94 | + $this->t128[] = array(1, 1, 2, 4, 1, 2); //70 : [f] |
|
| 95 | + $this->t128[] = array(1, 2, 2, 1, 1, 4); //71 : [g] |
|
| 96 | + $this->t128[] = array(1, 2, 2, 4, 1, 1); //72 : [h] |
|
| 97 | + $this->t128[] = array(1, 4, 2, 1, 1, 2); //73 : [i] |
|
| 98 | + $this->t128[] = array(1, 4, 2, 2, 1, 1); //74 : [j] |
|
| 99 | + $this->t128[] = array(2, 4, 1, 2, 1, 1); //75 : [k] |
|
| 100 | + $this->t128[] = array(2, 2, 1, 1, 1, 4); //76 : [l] |
|
| 101 | + $this->t128[] = array(4, 1, 3, 1, 1, 1); //77 : [m] |
|
| 102 | + $this->t128[] = array(2, 4, 1, 1, 1, 2); //78 : [n] |
|
| 103 | + $this->t128[] = array(1, 3, 4, 1, 1, 1); //79 : [o] |
|
| 104 | + $this->t128[] = array(1, 1, 1, 2, 4, 2); //80 : [p] |
|
| 105 | + $this->t128[] = array(1, 2, 1, 1, 4, 2); //81 : [q] |
|
| 106 | + $this->t128[] = array(1, 2, 1, 2, 4, 1); //82 : [r] |
|
| 107 | + $this->t128[] = array(1, 1, 4, 2, 1, 2); //83 : [s] |
|
| 108 | + $this->t128[] = array(1, 2, 4, 1, 1, 2); //84 : [t] |
|
| 109 | + $this->t128[] = array(1, 2, 4, 2, 1, 1); //85 : [u] |
|
| 110 | + $this->t128[] = array(4, 1, 1, 2, 1, 2); //86 : [v] |
|
| 111 | + $this->t128[] = array(4, 2, 1, 1, 1, 2); //87 : [w] |
|
| 112 | + $this->t128[] = array(4, 2, 1, 2, 1, 1); //88 : [x] |
|
| 113 | + $this->t128[] = array(2, 1, 2, 1, 4, 1); //89 : [y] |
|
| 114 | + $this->t128[] = array(2, 1, 4, 1, 2, 1); //90 : [z] |
|
| 115 | + $this->t128[] = array(4, 1, 2, 1, 2, 1); //91 : [{] |
|
| 116 | + $this->t128[] = array(1, 1, 1, 1, 4, 3); //92 : [|] |
|
| 117 | + $this->t128[] = array(1, 1, 1, 3, 4, 1); //93 : [}] |
|
| 118 | + $this->t128[] = array(1, 3, 1, 1, 4, 1); //94 : [~] |
|
| 119 | + $this->t128[] = array(1, 1, 4, 1, 1, 3); //95 : [DEL] |
|
| 120 | + $this->t128[] = array(1, 1, 4, 3, 1, 1); //96 : [FNC3] |
|
| 121 | + $this->t128[] = array(4, 1, 1, 1, 1, 3); //97 : [FNC2] |
|
| 122 | + $this->t128[] = array(4, 1, 1, 3, 1, 1); //98 : [SHIFT] |
|
| 123 | + $this->t128[] = array(1, 1, 3, 1, 4, 1); //99 : [Cswap] |
|
| 124 | + $this->t128[] = array(1, 1, 4, 1, 3, 1); //100 : [Bswap] |
|
| 125 | + $this->t128[] = array(3, 1, 1, 1, 4, 1); //101 : [Aswap] |
|
| 126 | + $this->t128[] = array(4, 1, 1, 1, 3, 1); //102 : [FNC1] |
|
| 127 | + $this->t128[] = array(2, 1, 1, 4, 1, 2); //103 : [Astart] |
|
| 128 | + $this->t128[] = array(2, 1, 1, 2, 1, 4); //104 : [Bstart] |
|
| 129 | + $this->t128[] = array(2, 1, 1, 2, 3, 2); //105 : [Cstart] |
|
| 130 | + $this->t128[] = array(2, 3, 3, 1, 1, 1); //106 : [STOP] |
|
| 131 | + $this->t128[] = array(2, 1); //107 : [END BAR] |
|
| 132 | 132 | for ($i = 32; $i <= 95; $i++) { // conjunto de caracteres |
| 133 | 133 | $this->abcSet .= chr($i); |
| 134 | 134 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $this->abcSet .= chr($i); |
| 143 | 143 | $this->bSet .= chr($i); |
| 144 | 144 | } |
| 145 | - $this->cSet="0123456789"; |
|
| 145 | + $this->cSet = "0123456789"; |
|
| 146 | 146 | for ($i = 0; $i < 96; $i++) { |
| 147 | 147 | // convertendo grupos A & B |
| 148 | 148 | if (isset($this->setFrom["A"])) { |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $this->setFrom["B"] .= chr($i + 32); |
| 153 | 153 | } |
| 154 | 154 | if (isset($this->setTo["A"])) { |
| 155 | - $this->setTo["A"] .= chr(($i < 32) ? $i+64 : $i-32); |
|
| 155 | + $this->setTo["A"] .= chr(($i < 32) ? $i + 64 : $i - 32); |
|
| 156 | 156 | } |
| 157 | 157 | if (isset($this->setTo["A"])) { |
| 158 | 158 | $this->setTo["B"] .= chr($i); |
@@ -165,21 +165,21 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | public function code128($x, $y, $code, $w, $h) |
| 167 | 167 | { |
| 168 | - $Aguid=""; |
|
| 169 | - $Bguid=""; |
|
| 170 | - $Cguid=""; |
|
| 171 | - for ($i=0; $i < strlen($code); $i++) { |
|
| 172 | - $needle=substr($code, $i, 1); |
|
| 173 | - $Aguid .= ((strpos($this->aSet, $needle)===false) ? "N" : "O"); |
|
| 174 | - $Bguid .= ((strpos($this->bSet, $needle)===false) ? "N" : "O"); |
|
| 175 | - $Cguid .= ((strpos($this->cSet, $needle)===false) ? "N" : "O"); |
|
| 168 | + $Aguid = ""; |
|
| 169 | + $Bguid = ""; |
|
| 170 | + $Cguid = ""; |
|
| 171 | + for ($i = 0; $i < strlen($code); $i++) { |
|
| 172 | + $needle = substr($code, $i, 1); |
|
| 173 | + $Aguid .= ((strpos($this->aSet, $needle) === false) ? "N" : "O"); |
|
| 174 | + $Bguid .= ((strpos($this->bSet, $needle) === false) ? "N" : "O"); |
|
| 175 | + $Cguid .= ((strpos($this->cSet, $needle) === false) ? "N" : "O"); |
|
| 176 | 176 | } |
| 177 | 177 | $SminiC = "OOOO"; |
| 178 | 178 | $IminiC = 4; |
| 179 | 179 | $crypt = ""; |
| 180 | 180 | while ($code > "") { |
| 181 | 181 | $i = strpos($Cguid, $SminiC); |
| 182 | - if ($i!==false) { |
|
| 182 | + if ($i !== false) { |
|
| 183 | 183 | $Aguid [$i] = "N"; |
| 184 | 184 | $Bguid [$i] = "N"; |
| 185 | 185 | } |
@@ -189,10 +189,10 @@ discard block |
||
| 189 | 189 | if ($made === false) { |
| 190 | 190 | $made = strlen($Cguid); |
| 191 | 191 | } |
| 192 | - if (fmod($made, 2)==1) { |
|
| 192 | + if (fmod($made, 2) == 1) { |
|
| 193 | 193 | $made--; |
| 194 | 194 | } |
| 195 | - for ($i=0; $i < $made; $i += 2) { |
|
| 195 | + for ($i = 0; $i < $made; $i += 2) { |
|
| 196 | 196 | $crypt .= chr(strval(substr($code, $i, 2))); |
| 197 | 197 | } |
| 198 | 198 | $jeu = "C"; |
@@ -205,8 +205,8 @@ discard block |
||
| 205 | 205 | if ($madeB === false) { |
| 206 | 206 | $madeB = strlen($Bguid); |
| 207 | 207 | } |
| 208 | - $made = (($madeA < $madeB) ? $madeB : $madeA ); |
|
| 209 | - $jeu = (($madeA < $madeB) ? "B" : "A" ); |
|
| 208 | + $made = (($madeA < $madeB) ? $madeB : $madeA); |
|
| 209 | + $jeu = (($madeA < $madeB) ? "B" : "A"); |
|
| 210 | 210 | $jeuguid = $jeu . "guid"; |
| 211 | 211 | $crypt .= chr(($crypt > "") ? $this->jSwap["$jeu"] : $this->jStart["$jeu"]); |
| 212 | 212 | $crypt .= strtr(substr($code, 0, $made), $this->setFrom[$jeu], $this->setTo[$jeu]); |
@@ -217,18 +217,18 @@ discard block |
||
| 217 | 217 | $Cguid = substr($Cguid, $made); |
| 218 | 218 | } |
| 219 | 219 | $check = ord($crypt[0]); |
| 220 | - for ($i=0; $i<strlen($crypt); $i++) { |
|
| 220 | + for ($i = 0; $i < strlen($crypt); $i++) { |
|
| 221 | 221 | $check += (ord($crypt[$i]) * $i); |
| 222 | 222 | } |
| 223 | 223 | $check %= 103; |
| 224 | 224 | $crypt .= chr($check) . chr(106) . chr(107); |
| 225 | 225 | $i = (strlen($crypt) * 11) - 8; |
| 226 | - $modul = $w/$i; |
|
| 227 | - for ($i=0; $i<strlen($crypt); $i++) { |
|
| 226 | + $modul = $w / $i; |
|
| 227 | + for ($i = 0; $i < strlen($crypt); $i++) { |
|
| 228 | 228 | $c = $this->t128[ord($crypt[$i])]; |
| 229 | - for ($j=0; $j<count($c); $j++) { |
|
| 230 | - $this->Rect($x, $y, $c[$j]*$modul, $h, "F"); |
|
| 231 | - $x += ($c[$j++]+$c[$j])*$modul; |
|
| 229 | + for ($j = 0; $j < count($c); $j++) { |
|
| 230 | + $this->Rect($x, $y, $c[$j] * $modul, $h, "F"); |
|
| 231 | + $x += ($c[$j++] + $c[$j]) * $modul; |
|
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | 234 | } |
@@ -252,11 +252,11 @@ discard block |
||
| 252 | 252 | } |
| 253 | 253 | $this->angle = $angle; |
| 254 | 254 | if ($angle != 0) { |
| 255 | - $angle *= M_PI/180; |
|
| 255 | + $angle *= M_PI / 180; |
|
| 256 | 256 | $c = cos($angle); |
| 257 | 257 | $s = sin($angle); |
| 258 | - $cx =$x*$this->k; |
|
| 259 | - $cy = ($this->h-$y)*$this->k; |
|
| 258 | + $cx = $x * $this->k; |
|
| 259 | + $cy = ($this->h - $y) * $this->k; |
|
| 260 | 260 | $this->out( |
| 261 | 261 | sprintf( |
| 262 | 262 | 'q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm', |
@@ -294,40 +294,40 @@ discard block |
||
| 294 | 294 | } else { |
| 295 | 295 | $op = 'S'; |
| 296 | 296 | } |
| 297 | - $MyArc = 4/3 * (sqrt(2) - 1); |
|
| 298 | - $this->out(sprintf('%.2F %.2F m', ($x+$r)*$k, ($hp-$y)*$k)); |
|
| 299 | - $xc = $x+$w-$r; |
|
| 300 | - $yc = $y+$r; |
|
| 301 | - $this->out(sprintf('%.2F %.2F l', $xc*$k, ($hp-$y)*$k)); |
|
| 302 | - if (strpos($corners, '2')===false) { |
|
| 303 | - $this->out(sprintf('%.2F %.2F l', ($x+$w)*$k, ($hp-$y)*$k)); |
|
| 297 | + $MyArc = 4 / 3 * (sqrt(2) - 1); |
|
| 298 | + $this->out(sprintf('%.2F %.2F m', ($x + $r) * $k, ($hp - $y) * $k)); |
|
| 299 | + $xc = $x + $w - $r; |
|
| 300 | + $yc = $y + $r; |
|
| 301 | + $this->out(sprintf('%.2F %.2F l', $xc * $k, ($hp - $y) * $k)); |
|
| 302 | + if (strpos($corners, '2') === false) { |
|
| 303 | + $this->out(sprintf('%.2F %.2F l', ($x + $w) * $k, ($hp - $y) * $k)); |
|
| 304 | 304 | } else { |
| 305 | - $this->arc($xc + $r*$MyArc, $yc - $r, $xc + $r, $yc - $r*$MyArc, $xc + $r, $yc); |
|
| 305 | + $this->arc($xc + $r * $MyArc, $yc - $r, $xc + $r, $yc - $r * $MyArc, $xc + $r, $yc); |
|
| 306 | 306 | } |
| 307 | - $xc = $x+$w-$r; |
|
| 308 | - $yc = $y+$h-$r; |
|
| 309 | - $this->out(sprintf('%.2F %.2F l', ($x+$w)*$k, ($hp-$yc)*$k)); |
|
| 310 | - if (strpos($corners, '3')===false) { |
|
| 311 | - $this->out(sprintf('%.2F %.2F l', ($x+$w)*$k, ($hp-($y+$h))*$k)); |
|
| 307 | + $xc = $x + $w - $r; |
|
| 308 | + $yc = $y + $h - $r; |
|
| 309 | + $this->out(sprintf('%.2F %.2F l', ($x + $w) * $k, ($hp - $yc) * $k)); |
|
| 310 | + if (strpos($corners, '3') === false) { |
|
| 311 | + $this->out(sprintf('%.2F %.2F l', ($x + $w) * $k, ($hp - ($y + $h)) * $k)); |
|
| 312 | 312 | } else { |
| 313 | - $this->arc($xc + $r, $yc + $r*$MyArc, $xc + $r*$MyArc, $yc + $r, $xc, $yc + $r); |
|
| 313 | + $this->arc($xc + $r, $yc + $r * $MyArc, $xc + $r * $MyArc, $yc + $r, $xc, $yc + $r); |
|
| 314 | 314 | } |
| 315 | - $xc = $x+$r; |
|
| 316 | - $yc = $y+$h-$r; |
|
| 317 | - $this->out(sprintf('%.2F %.2F l', $xc*$k, ($hp-($y+$h))*$k)); |
|
| 318 | - if (strpos($corners, '4')===false) { |
|
| 319 | - $this->out(sprintf('%.2F %.2F l', ($x)*$k, ($hp-($y+$h))*$k)); |
|
| 315 | + $xc = $x + $r; |
|
| 316 | + $yc = $y + $h - $r; |
|
| 317 | + $this->out(sprintf('%.2F %.2F l', $xc * $k, ($hp - ($y + $h)) * $k)); |
|
| 318 | + if (strpos($corners, '4') === false) { |
|
| 319 | + $this->out(sprintf('%.2F %.2F l', ($x) * $k, ($hp - ($y + $h)) * $k)); |
|
| 320 | 320 | } else { |
| 321 | - $this->arc($xc - $r*$MyArc, $yc + $r, $xc - $r, $yc + $r*$MyArc, $xc - $r, $yc); |
|
| 322 | - } |
|
| 323 | - $xc = $x+$r ; |
|
| 324 | - $yc = $y+$r; |
|
| 325 | - $this->out(sprintf('%.2F %.2F l', ($x)*$k, ($hp-$yc)*$k)); |
|
| 326 | - if (strpos($corners, '1')===false) { |
|
| 327 | - $this->out(sprintf('%.2F %.2F l', ($x)*$k, ($hp-$y)*$k)); |
|
| 328 | - $this->out(sprintf('%.2F %.2F l', ($x+$r)*$k, ($hp-$y)*$k)); |
|
| 321 | + $this->arc($xc - $r * $MyArc, $yc + $r, $xc - $r, $yc + $r * $MyArc, $xc - $r, $yc); |
|
| 322 | + } |
|
| 323 | + $xc = $x + $r; |
|
| 324 | + $yc = $y + $r; |
|
| 325 | + $this->out(sprintf('%.2F %.2F l', ($x) * $k, ($hp - $yc) * $k)); |
|
| 326 | + if (strpos($corners, '1') === false) { |
|
| 327 | + $this->out(sprintf('%.2F %.2F l', ($x) * $k, ($hp - $y) * $k)); |
|
| 328 | + $this->out(sprintf('%.2F %.2F l', ($x + $r) * $k, ($hp - $y) * $k)); |
|
| 329 | 329 | } else { |
| 330 | - $this->arc($xc - $r, $yc - $r*$MyArc, $xc - $r*$MyArc, $yc - $r, $xc, $yc - $r); |
|
| 330 | + $this->arc($xc - $r, $yc - $r * $MyArc, $xc - $r * $MyArc, $yc - $r, $xc, $yc - $r); |
|
| 331 | 331 | } |
| 332 | 332 | $this->out($op); |
| 333 | 333 | } |
@@ -347,12 +347,12 @@ discard block |
||
| 347 | 347 | $this->out( |
| 348 | 348 | sprintf( |
| 349 | 349 | '%.2F %.2F %.2F %.2F %.2F %.2F c ', |
| 350 | - $x1*$this->k, |
|
| 351 | - ($h-$y1)*$this->k, |
|
| 352 | - $x2*$this->k, |
|
| 353 | - ($h-$y2)*$this->k, |
|
| 354 | - $x3*$this->k, |
|
| 355 | - ($h-$y3)*$this->k |
|
| 350 | + $x1 * $this->k, |
|
| 351 | + ($h - $y1) * $this->k, |
|
| 352 | + $x2 * $this->k, |
|
| 353 | + ($h - $y2) * $this->k, |
|
| 354 | + $x3 * $this->k, |
|
| 355 | + ($h - $y3) * $this->k |
|
| 356 | 356 | ) |
| 357 | 357 | ); |
| 358 | 358 | } |
@@ -369,26 +369,26 @@ discard block |
||
| 369 | 369 | public function dashedRect($x1, $y1, $x2, $y2, $width = 1, $nb = 15) |
| 370 | 370 | { |
| 371 | 371 | $this->setLineWidth($width); |
| 372 | - $longueur = abs($x1-$x2); |
|
| 373 | - $hauteur = abs($y1-$y2); |
|
| 372 | + $longueur = abs($x1 - $x2); |
|
| 373 | + $hauteur = abs($y1 - $y2); |
|
| 374 | 374 | if ($longueur > $hauteur) { |
| 375 | - $Pointilles = ($longueur/$nb)/2; |
|
| 375 | + $Pointilles = ($longueur / $nb) / 2; |
|
| 376 | 376 | } else { |
| 377 | - $Pointilles = ($hauteur/$nb)/2; |
|
| 377 | + $Pointilles = ($hauteur / $nb) / 2; |
|
| 378 | 378 | } |
| 379 | - for ($i=$x1; $i<=$x2; $i+=$Pointilles+$Pointilles) { |
|
| 380 | - for ($j=$i; $j<=($i+$Pointilles); $j++) { |
|
| 381 | - if ($j<=($x2-1)) { |
|
| 382 | - $this->line($j, $y1, $j+1, $y1); |
|
| 383 | - $this->line($j, $y2, $j+1, $y2); |
|
| 379 | + for ($i = $x1; $i <= $x2; $i += $Pointilles + $Pointilles) { |
|
| 380 | + for ($j = $i; $j <= ($i + $Pointilles); $j++) { |
|
| 381 | + if ($j <= ($x2 - 1)) { |
|
| 382 | + $this->line($j, $y1, $j + 1, $y1); |
|
| 383 | + $this->line($j, $y2, $j + 1, $y2); |
|
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | 386 | } |
| 387 | - for ($i=$y1; $i<=$y2; $i+=$Pointilles+$Pointilles) { |
|
| 388 | - for ($j=$i; $j<=($i+$Pointilles); $j++) { |
|
| 389 | - if ($j<=($y2-1)) { |
|
| 390 | - $this->line($x1, $j, $x1, $j+1); |
|
| 391 | - $this->line($x2, $j, $x2, $j+1); |
|
| 387 | + for ($i = $y1; $i <= $y2; $i += $Pointilles + $Pointilles) { |
|
| 388 | + for ($j = $i; $j <= ($i + $Pointilles); $j++) { |
|
| 389 | + if ($j <= ($y2 - 1)) { |
|
| 390 | + $this->line($x1, $j, $x1, $j + 1); |
|
| 391 | + $this->line($x2, $j, $x2, $j + 1); |
|
| 392 | 392 | } |
| 393 | 393 | } |
| 394 | 394 | } |
@@ -409,16 +409,16 @@ discard block |
||
| 409 | 409 | $yi = $this->getY(); |
| 410 | 410 | $hrow = $this->fontSize; |
| 411 | 411 | $textrows = $this->drawRows($w, $hrow, $strText, 0, $align, 0, 0, 0); |
| 412 | - $maxrows = floor($h/$this->fontSize); |
|
| 412 | + $maxrows = floor($h / $this->fontSize); |
|
| 413 | 413 | $rows = min($textrows, $maxrows); |
| 414 | 414 | $dy = 0; |
| 415 | 415 | if (strtoupper($valign) == 'M') { |
| 416 | - $dy = ($h-$rows*$this->fontSize)/2; |
|
| 416 | + $dy = ($h - $rows * $this->fontSize) / 2; |
|
| 417 | 417 | } |
| 418 | 418 | if (strtoupper($valign) == 'B') { |
| 419 | - $dy = $h-$rows*$this->fontSize; |
|
| 419 | + $dy = $h - $rows * $this->fontSize; |
|
| 420 | 420 | } |
| 421 | - $this->setY($yi+$dy); |
|
| 421 | + $this->setY($yi + $dy); |
|
| 422 | 422 | $this->setX($xi); |
| 423 | 423 | $this->drawRows($w, $hrow, $strText, 0, $align, false, $rows, 1); |
| 424 | 424 | if ($border) { |
@@ -440,17 +440,17 @@ discard block |
||
| 440 | 440 | */ |
| 441 | 441 | private function drawRows($w, $h, $txt, $border = 0, $align = 'J', $fill = false, $maxline = 0, $prn = 0) |
| 442 | 442 | { |
| 443 | - $cw =& $this->currentFont['cw']; |
|
| 443 | + $cw = & $this->currentFont['cw']; |
|
| 444 | 444 | if ($w == 0) { |
| 445 | - $w = $this->w-$this->rMargin-$this->x; |
|
| 445 | + $w = $this->w - $this->rMargin - $this->x; |
|
| 446 | 446 | } |
| 447 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
| 447 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
| 448 | 448 | $s = str_replace("\r", '', $txt); |
| 449 | 449 | $nb = strlen($s); |
| 450 | - if ($nb > 0 && $s[$nb-1] == "\n") { |
|
| 450 | + if ($nb > 0 && $s[$nb - 1] == "\n") { |
|
| 451 | 451 | $nb--; |
| 452 | 452 | } |
| 453 | - $b=0; |
|
| 453 | + $b = 0; |
|
| 454 | 454 | if ($border) { |
| 455 | 455 | if ($border == 1) { |
| 456 | 456 | $border = 'LTRB'; |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | if (is_int(strpos($border, 'R'))) { |
| 465 | 465 | $b2 .= 'R'; |
| 466 | 466 | } |
| 467 | - $b = is_int(strpos($border, 'T')) ? $b2.'T' : $b2; |
|
| 467 | + $b = is_int(strpos($border, 'T')) ? $b2 . 'T' : $b2; |
|
| 468 | 468 | } |
| 469 | 469 | } |
| 470 | 470 | $sep = -1; |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | } |
| 484 | 484 | } |
| 485 | 485 | if ($prn == 1) { |
| 486 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
| 486 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
| 487 | 487 | } |
| 488 | 488 | $i++; |
| 489 | 489 | $sep = -1; |
@@ -517,19 +517,19 @@ discard block |
||
| 517 | 517 | } |
| 518 | 518 | } |
| 519 | 519 | if ($prn == 1) { |
| 520 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
| 520 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
| 521 | 521 | } |
| 522 | 522 | } else { |
| 523 | 523 | if ($align == 'J') { |
| 524 | - $this->ws = ($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0; |
|
| 524 | + $this->ws = ($ns > 1) ? ($wmax - $ls) / 1000 * $this->FontSize / ($ns - 1) : 0; |
|
| 525 | 525 | if ($prn == 1) { |
| 526 | - $this->out(sprintf('%.3F Tw', $this->ws*$this->k)); |
|
| 526 | + $this->out(sprintf('%.3F Tw', $this->ws * $this->k)); |
|
| 527 | 527 | } |
| 528 | 528 | } |
| 529 | 529 | if ($prn == 1) { |
| 530 | - $this->cell($w, $h, substr($s, $j, $sep-$j), $b, 2, $align, $fill); |
|
| 530 | + $this->cell($w, $h, substr($s, $j, $sep - $j), $b, 2, $align, $fill); |
|
| 531 | 531 | } |
| 532 | - $i = $sep+1; |
|
| 532 | + $i = $sep + 1; |
|
| 533 | 533 | } |
| 534 | 534 | $sep = -1; |
| 535 | 535 | $j = $i; |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | $b .= 'B'; |
| 557 | 557 | } |
| 558 | 558 | if ($prn == 1) { |
| 559 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
| 559 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
| 560 | 560 | } |
| 561 | 561 | $this->x = $this->lMargin; |
| 562 | 562 | return $nl; |
@@ -585,27 +585,27 @@ discard block |
||
| 585 | 585 | $wordwidth = $this->getStringWidth($word); |
| 586 | 586 | if ($wordwidth > $maxwidth) { |
| 587 | 587 | // Word is too long, we cut it |
| 588 | - for ($i=0; $i<strlen($word); $i++) { |
|
| 588 | + for ($i = 0; $i < strlen($word); $i++) { |
|
| 589 | 589 | $wordwidth = $this->getStringWidth(substr($word, $i, 1)); |
| 590 | 590 | if ($width + $wordwidth <= $maxwidth) { |
| 591 | 591 | $width += $wordwidth; |
| 592 | 592 | $text .= substr($word, $i, 1); |
| 593 | 593 | } else { |
| 594 | 594 | $width = $wordwidth; |
| 595 | - $text = rtrim($text)."\n".substr($word, $i, 1); |
|
| 595 | + $text = rtrim($text) . "\n" . substr($word, $i, 1); |
|
| 596 | 596 | $count++; |
| 597 | 597 | } |
| 598 | 598 | } |
| 599 | 599 | } elseif ($width + $wordwidth <= $maxwidth) { |
| 600 | 600 | $width += $wordwidth + $space; |
| 601 | - $text .= $word.' '; |
|
| 601 | + $text .= $word . ' '; |
|
| 602 | 602 | } else { |
| 603 | 603 | $width = $wordwidth + $space; |
| 604 | - $text = rtrim($text)."\n".$word.' '; |
|
| 604 | + $text = rtrim($text) . "\n" . $word . ' '; |
|
| 605 | 605 | $count++; |
| 606 | 606 | } |
| 607 | 607 | } |
| 608 | - $text = rtrim($text)."\n"; |
|
| 608 | + $text = rtrim($text) . "\n"; |
|
| 609 | 609 | $count++; |
| 610 | 610 | } |
| 611 | 611 | $text = rtrim($text); |
@@ -637,21 +637,21 @@ discard block |
||
| 637 | 637 | $scale = false, |
| 638 | 638 | $force = true |
| 639 | 639 | ) { |
| 640 | - $str_width=$this->getStringWidth($txt); |
|
| 640 | + $str_width = $this->getStringWidth($txt); |
|
| 641 | 641 | if ($w == 0) { |
| 642 | - $w = $this->w-$this->rMargin-$this->x; |
|
| 642 | + $w = $this->w - $this->rMargin - $this->x; |
|
| 643 | 643 | } |
| 644 | - $ratio = ($w-$this->cMargin*2)/$str_width; |
|
| 644 | + $ratio = ($w - $this->cMargin * 2) / $str_width; |
|
| 645 | 645 | $fit = ($ratio < 1 || ($ratio > 1 && $force)); |
| 646 | 646 | if ($fit) { |
| 647 | 647 | if ($scale) { |
| 648 | 648 | //Calcula a escala horizontal |
| 649 | - $horiz_scale = $ratio*100.0; |
|
| 649 | + $horiz_scale = $ratio * 100.0; |
|
| 650 | 650 | //Ajusta a escala horizontal |
| 651 | 651 | $this->out(sprintf('BT %.2F Tz ET', $horiz_scale)); |
| 652 | 652 | } else { |
| 653 | 653 | //Calcula o espaçamento de caracteres em pontos |
| 654 | - $char_space = ($w-$this->cMargin*2-$str_width)/max($this->_MBGetStringLength($txt)-1, 1)*$this->k; |
|
| 654 | + $char_space = ($w - $this->cMargin * 2 - $str_width) / max($this->_MBGetStringLength($txt) - 1, 1) * $this->k; |
|
| 655 | 655 | //Ajusta o espaçamento de caracteres |
| 656 | 656 | $this->out(sprintf('BT %.2F Tc ET', $char_space)); |
| 657 | 657 | } |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | $this->cell($w, $h, $txt, $border, $ln, $align, $fill, $link); |
| 663 | 663 | //Reseta o espaçamento de caracteres e a escala horizontal |
| 664 | 664 | if ($fit) { |
| 665 | - $this->out('BT '.($scale ? '100 Tz' : '0 Tc').' ET'); |
|
| 665 | + $this->out('BT ' . ($scale ? '100 Tz' : '0 Tc') . ' ET'); |
|
| 666 | 666 | } |
| 667 | 667 | } |
| 668 | 668 | |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | $len = 0; |
| 758 | 758 | $nbbytes = strlen($s); |
| 759 | 759 | for ($i = 0; $i < $nbbytes; $i++) { |
| 760 | - if (ord($s[$i])<128) { |
|
| 760 | + if (ord($s[$i]) < 128) { |
|
| 761 | 761 | $len++; |
| 762 | 762 | } else { |
| 763 | 763 | $len++; |
@@ -783,11 +783,11 @@ discard block |
||
| 783 | 783 | { |
| 784 | 784 | $this->setDrawColor(110); |
| 785 | 785 | $this->setLineWidth($h); |
| 786 | - $wDash = ($w/$n)/2; |
|
| 787 | - for ($i=$x; $i<=$x+$w; $i += $wDash+$wDash) { |
|
| 788 | - for ($j=$i; $j<= ($i+$wDash); $j++) { |
|
| 789 | - if ($j <= ($x+$w-1)) { |
|
| 790 | - $this->line($j, $y, $j+1, $y); |
|
| 786 | + $wDash = ($w / $n) / 2; |
|
| 787 | + for ($i = $x; $i <= $x + $w; $i += $wDash + $wDash) { |
|
| 788 | + for ($j = $i; $j <= ($i + $wDash); $j++) { |
|
| 789 | + if ($j <= ($x + $w - 1)) { |
|
| 790 | + $this->line($j, $y, $j + 1, $y); |
|
| 791 | 791 | } |
| 792 | 792 | } |
| 793 | 793 | } |
@@ -812,7 +812,7 @@ discard block |
||
| 812 | 812 | $y = $aux; |
| 813 | 813 | } |
| 814 | 814 | while ($y < $yfinal && $n > 0) { |
| 815 | - $this->line($x, $y, $x, $y+1); |
|
| 815 | + $this->line($x, $y, $x, $y + 1); |
|
| 816 | 816 | $y += 3; |
| 817 | 817 | $n--; |
| 818 | 818 | } |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | protected $papel; |
| 27 | 27 | protected $xml; // string XML NFe |
| 28 | - protected $logomarca=''; // path para logomarca em jpg |
|
| 29 | - protected $formatoChave="#### #### #### #### #### #### #### #### #### #### ####"; |
|
| 30 | - protected $debugMode=0; //ativa ou desativa o modo de debug |
|
| 28 | + protected $logomarca = ''; // path para logomarca em jpg |
|
| 29 | + protected $formatoChave = "#### #### #### #### #### #### #### #### #### #### ####"; |
|
| 30 | + protected $debugMode = 0; //ativa ou desativa o modo de debug |
|
| 31 | 31 | protected $tpImp; //ambiente |
| 32 | - protected $fontePadrao='Times'; |
|
| 32 | + protected $fontePadrao = 'Times'; |
|
| 33 | 33 | protected $nfeProc; |
| 34 | 34 | protected $nfe; |
| 35 | 35 | protected $infNFe; |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $this->textoAdic = ''; |
| 259 | 259 | if (isset($this->infAdic)) { |
| 260 | 260 | $this->textoAdic .= !empty($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue) ? |
| 261 | - 'Inf. Contribuinte: '. |
|
| 261 | + 'Inf. Contribuinte: ' . |
|
| 262 | 262 | trim($this->pAnfavea($this->infAdic->getElementsByTagName('infCpl')->item(0)->nodeValue)) : ''; |
| 263 | 263 | if (!empty($this->textoAdic)) { |
| 264 | 264 | $this->textoAdic = str_replace(";", "\n", $this->textoAdic); |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | $orientacao = 'P'; |
| 284 | 284 | } |
| 285 | 285 | $this->orientacao = $orientacao; |
| 286 | - $this->papel = array(80,$tamPapelVert); |
|
| 286 | + $this->papel = array(80, $tamPapelVert); |
|
| 287 | 287 | $this->logoAlign = $logoAlign; |
| 288 | 288 | //$this->situacao_externa = $situacaoExterna; |
| 289 | 289 | $this->numero_registro_dpec = $depecNumReg; |
@@ -307,10 +307,10 @@ discard block |
||
| 307 | 307 | //total inicial de paginas |
| 308 | 308 | $totPag = 1; |
| 309 | 309 | //largura imprimivel em mm: largura da folha menos as margens esq/direita |
| 310 | - $this->wPrint = $maxW-($margEsq*2); |
|
| 310 | + $this->wPrint = $maxW - ($margEsq * 2); |
|
| 311 | 311 | //comprimento (altura) imprimivel em mm: altura da folha menos as margens |
| 312 | 312 | //superior e inferior |
| 313 | - $this->hPrint = $maxH-$margSup-$margInf; |
|
| 313 | + $this->hPrint = $maxH - $margSup - $margInf; |
|
| 314 | 314 | // estabelece contagem de paginas |
| 315 | 315 | $this->pdf->aliasNbPages(); |
| 316 | 316 | $this->pdf->setMargins($margEsq, $margSup); // fixa as margens |
@@ -321,25 +321,25 @@ discard block |
||
| 321 | 321 | $this->pdf->setLineWidth(0.1); // define a largura da linha |
| 322 | 322 | $this->pdf->setTextColor(0, 0, 0); |
| 323 | 323 | $this->pTextBox(0, 0, $maxW, $maxH); // POR QUE PRECISO DESA LINHA? |
| 324 | - $hcabecalho = 27;//para cabeçalho (dados emitente mais logomarca) (FIXO) |
|
| 325 | - $hcabecalhoSecundario = 10;//para cabeçalho secundário (cabeçalho sefaz) (FIXO) |
|
| 326 | - $hprodutos = $hLinha + ($qtdItens*$hMaxLinha) ;//box poduto |
|
| 324 | + $hcabecalho = 27; //para cabeçalho (dados emitente mais logomarca) (FIXO) |
|
| 325 | + $hcabecalhoSecundario = 10; //para cabeçalho secundário (cabeçalho sefaz) (FIXO) |
|
| 326 | + $hprodutos = $hLinha + ($qtdItens * $hMaxLinha); //box poduto |
|
| 327 | 327 | $hTotal = 12; //box total (FIXO) |
| 328 | - $hpagamentos = $hLinha + ($qtdPgto*$hLinha);//para pagamentos |
|
| 328 | + $hpagamentos = $hLinha + ($qtdPgto * $hLinha); //para pagamentos |
|
| 329 | 329 | if (!empty($this->vTroco)) { |
| 330 | 330 | $hpagamentos += $hLinha; |
| 331 | 331 | } |
| 332 | - $hmsgfiscal = 21;// para imposto (FIXO) |
|
| 332 | + $hmsgfiscal = 21; // para imposto (FIXO) |
|
| 333 | 333 | if (!isset($this->dest)) { |
| 334 | - $hcliente = 6;// para cliente (FIXO) |
|
| 334 | + $hcliente = 6; // para cliente (FIXO) |
|
| 335 | 335 | } else { |
| 336 | 336 | $hcliente = 12; |
| 337 | 337 | }// para cliente (FIXO)}; |
| 338 | - $hQRCode = 50;// para qrcode (FIXO) |
|
| 339 | - $hCabecItens = 4;//cabeçalho dos itens |
|
| 338 | + $hQRCode = 50; // para qrcode (FIXO) |
|
| 339 | + $hCabecItens = 4; //cabeçalho dos itens |
|
| 340 | 340 | |
| 341 | 341 | $hUsado = $hCabecItens; |
| 342 | - $w2 = round($this->wPrint*0.31, 0); |
|
| 342 | + $w2 = round($this->wPrint * 0.31, 0); |
|
| 343 | 343 | $totPag = 1; |
| 344 | 344 | $pag = 1; |
| 345 | 345 | $x = $xInic; |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal; |
| 360 | 360 | $y = $this->pPagamentosDANFE($x, $y, $hpagamentos); |
| 361 | 361 | //COLOCA MENSAGEM FISCAL |
| 362 | - $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal+ $hpagamentos; |
|
| 362 | + $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos; |
|
| 363 | 363 | $y = $this->pFiscalDANFE($x, $y, $hmsgfiscal); |
| 364 | 364 | //COLOCA CONSUMIDOR |
| 365 | 365 | $y = $xInic + $hcabecalho + $hcabecalhoSecundario + $hprodutos + $hTotal + $hpagamentos + $hmsgfiscal; |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | //retorna o ID na NFe |
| 381 | - if ($classPdf!==false) { |
|
| 381 | + if ($classPdf !== false) { |
|
| 382 | 382 | $aR = [ |
| 383 | 383 | 'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")), |
| 384 | 384 | 'classe_PDF'=>$this->pdf |
@@ -398,14 +398,14 @@ discard block |
||
| 398 | 398 | $emitIM = $this->getTagValue($this->emit, "IM"); |
| 399 | 399 | $emitFone = $this->getTagValue($this->enderEmit, "fone"); |
| 400 | 400 | $foneLen = strlen($emitFone); |
| 401 | - if ($foneLen>0) { |
|
| 401 | + if ($foneLen > 0) { |
|
| 402 | 402 | $ddd = substr($emitFone, 0, 2); |
| 403 | 403 | $fone1 = substr($emitFone, -8); |
| 404 | 404 | $digito9 = ' '; |
| 405 | 405 | if ($foneLen == 11) { |
| 406 | 406 | $digito9 = substr($emitFone, 2, 1); |
| 407 | 407 | } |
| 408 | - $emitFone = ' - ('.$ddd.') '.$digito9. ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4); |
|
| 408 | + $emitFone = ' - (' . $ddd . ') ' . $digito9 . ' ' . substr($fone1, 0, 4) . '-' . substr($fone1, -4); |
|
| 409 | 409 | } else { |
| 410 | 410 | $emitFone = ''; |
| 411 | 411 | } |
@@ -419,18 +419,18 @@ discard block |
||
| 419 | 419 | // CONFIGURAÇÃO DE POSIÇÃO |
| 420 | 420 | $margemInterna = $this->margemInterna; |
| 421 | 421 | $maxW = $this->wPrint; |
| 422 | - $h = $h-($margemInterna); |
|
| 422 | + $h = $h - ($margemInterna); |
|
| 423 | 423 | //COLOCA LOGOMARCA |
| 424 | 424 | if (is_file($this->logomarca)) { |
| 425 | 425 | $xImg = $margemInterna; |
| 426 | 426 | $yImg = $margemInterna + 1; |
| 427 | 427 | $this->pdf->Image($this->logomarca, $xImg, $yImg, 30, 22.5); |
| 428 | - $xRs = ($maxW*0.4) + $margemInterna; |
|
| 429 | - $wRs = ($maxW*0.6); |
|
| 428 | + $xRs = ($maxW * 0.4) + $margemInterna; |
|
| 429 | + $wRs = ($maxW * 0.6); |
|
| 430 | 430 | $alignEmit = 'L'; |
| 431 | 431 | } else { |
| 432 | 432 | $xRs = $margemInterna; |
| 433 | - $wRs = ($maxW*1); |
|
| 433 | + $wRs = ($maxW * 1); |
|
| 434 | 434 | $alignEmit = 'L'; |
| 435 | 435 | } |
| 436 | 436 | //COLOCA RAZÃO SOCIAL |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | { |
| 451 | 451 | $margemInterna = $this->margemInterna; |
| 452 | 452 | $maxW = $this->wPrint; |
| 453 | - $w = ($maxW*1); |
|
| 453 | + $w = ($maxW * 1); |
|
| 454 | 454 | $hBox1 = 7; |
| 455 | 455 | $texto = "DANFE NFC-e\nDocumento Auxiliar da Nota Fiscal de Consumidor Eletrônica"; |
| 456 | 456 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
@@ -467,13 +467,13 @@ discard block |
||
| 467 | 467 | $margemInterna = $this->margemInterna; |
| 468 | 468 | $maxW = $this->wPrint; |
| 469 | 469 | $qtdItens = $this->det->length; |
| 470 | - $w = ($maxW*1); |
|
| 470 | + $w = ($maxW * 1); |
|
| 471 | 471 | $hLinha = $this->hLinha; |
| 472 | 472 | $aFontCabProdutos = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 473 | - $wBoxCod = $w*0.17; |
|
| 473 | + $wBoxCod = $w * 0.17; |
|
| 474 | 474 | $texto = "CÓDIGO"; |
| 475 | 475 | $this->pTextBox($x, $y, $wBoxCod, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 476 | - $wBoxDescricao = $w*0.43; |
|
| 476 | + $wBoxDescricao = $w * 0.43; |
|
| 477 | 477 | $xBoxDescricao = $wBoxCod + $x; |
| 478 | 478 | $texto = "DESCRICÃO"; |
| 479 | 479 | $this->pTextBox( |
@@ -489,19 +489,19 @@ discard block |
||
| 489 | 489 | '', |
| 490 | 490 | false |
| 491 | 491 | ); |
| 492 | - $wBoxQt = $w*0.08; |
|
| 492 | + $wBoxQt = $w * 0.08; |
|
| 493 | 493 | $xBoxQt = $wBoxDescricao + $xBoxDescricao; |
| 494 | 494 | $texto = "QT"; |
| 495 | 495 | $this->pTextBox($xBoxQt, $y, $wBoxQt, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 496 | - $wBoxUn = $w*0.06; |
|
| 496 | + $wBoxUn = $w * 0.06; |
|
| 497 | 497 | $xBoxUn = $wBoxQt + $xBoxQt; |
| 498 | 498 | $texto = "UN"; |
| 499 | 499 | $this->pTextBox($xBoxUn, $y, $wBoxUn, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 500 | - $wBoxVl = $w*0.13; |
|
| 500 | + $wBoxVl = $w * 0.13; |
|
| 501 | 501 | $xBoxVl = $wBoxUn + $xBoxUn; |
| 502 | 502 | $texto = "VALOR"; |
| 503 | 503 | $this->pTextBox($xBoxVl, $y, $wBoxVl, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
| 504 | - $wBoxTotal = $w*0.13; |
|
| 504 | + $wBoxTotal = $w * 0.13; |
|
| 505 | 505 | $xBoxTotal = $wBoxVl + $xBoxVl; |
| 506 | 506 | $texto = "TOTAL"; |
| 507 | 507 | $this->pTextBox($xBoxTotal, $y, $wBoxTotal, $hLinha, $texto, $aFontCabProdutos, 'T', 'L', 0, '', false); |
@@ -521,13 +521,13 @@ discard block |
||
| 521 | 521 | $vUnCom = number_format($this->getTagValue($prod, "vUnCom"), 2, ",", "."); |
| 522 | 522 | $vProd = number_format($this->getTagValue($prod, "vProd"), 2, ",", "."); |
| 523 | 523 | //COLOCA PRODUTO |
| 524 | - $yBoxProd = $y + $hLinha + ($cont*$hMaxLinha); |
|
| 524 | + $yBoxProd = $y + $hLinha + ($cont * $hMaxLinha); |
|
| 525 | 525 | //COLOCA PRODUTO CÓDIGO |
| 526 | - $wBoxCod = $w*0.17; |
|
| 526 | + $wBoxCod = $w * 0.17; |
|
| 527 | 527 | $texto = $cProd; |
| 528 | 528 | $this->pTextBox($x, $yBoxProd, $wBoxCod, $hMaxLinha, $texto, $aFontProdutos, 'C', 'C', 0, '', false); |
| 529 | 529 | //COLOCA PRODUTO DESCRIÇÃO |
| 530 | - $wBoxDescricao = $w*0.43; |
|
| 530 | + $wBoxDescricao = $w * 0.43; |
|
| 531 | 531 | $xBoxDescricao = $wBoxCod + $x; |
| 532 | 532 | $texto = $xProd; |
| 533 | 533 | $this->pTextBox( |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | false |
| 545 | 545 | ); |
| 546 | 546 | //COLOCA PRODUTO QUANTIDADE |
| 547 | - $wBoxQt = $w*0.08; |
|
| 547 | + $wBoxQt = $w * 0.08; |
|
| 548 | 548 | $xBoxQt = $wBoxDescricao + $xBoxDescricao; |
| 549 | 549 | $texto = $qCom; |
| 550 | 550 | $this->pTextBox( |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | false |
| 562 | 562 | ); |
| 563 | 563 | //COLOCA PRODUTO UNIDADE |
| 564 | - $wBoxUn = $w*0.06; |
|
| 564 | + $wBoxUn = $w * 0.06; |
|
| 565 | 565 | $xBoxUn = $wBoxQt + $xBoxQt; |
| 566 | 566 | $texto = $uCom; |
| 567 | 567 | $this->pTextBox( |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | false |
| 579 | 579 | ); |
| 580 | 580 | //COLOCA PRODUTO VL UNITÁRIO |
| 581 | - $wBoxVl = $w*0.13; |
|
| 581 | + $wBoxVl = $w * 0.13; |
|
| 582 | 582 | $xBoxVl = $wBoxUn + $xBoxUn; |
| 583 | 583 | $texto = $vUnCom; |
| 584 | 584 | $this->pTextBox( |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | false |
| 596 | 596 | ); |
| 597 | 597 | //COLOCA PRODUTO VL TOTAL |
| 598 | - $wBoxTotal = $w*0.13; |
|
| 598 | + $wBoxTotal = $w * 0.13; |
|
| 599 | 599 | $xBoxTotal = $wBoxVl + $xBoxVl; |
| 600 | 600 | $texto = $vProd; |
| 601 | 601 | $this->pTextBox( |
@@ -622,8 +622,8 @@ discard block |
||
| 622 | 622 | $margemInterna = $this->margemInterna; |
| 623 | 623 | $maxW = $this->wPrint; |
| 624 | 624 | $hLinha = 3; |
| 625 | - $wColEsq = ($maxW*0.7); |
|
| 626 | - $wColDir = ($maxW*0.3); |
|
| 625 | + $wColEsq = ($maxW * 0.7); |
|
| 626 | + $wColDir = ($maxW * 0.3); |
|
| 627 | 627 | $xValor = $x + $wColEsq; |
| 628 | 628 | $qtdItens = $this->det->length; |
| 629 | 629 | $vProd = $this->getTagValue($this->ICMSTot, "vProd"); |
@@ -644,28 +644,28 @@ discard block |
||
| 644 | 644 | $texto = "R$ " . number_format($vProd, 2, ",", "."); |
| 645 | 645 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 646 | 646 | $this->pTextBox($xValor, $yTotal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 647 | - $yDesconto = $y + ($hLinha*2); |
|
| 647 | + $yDesconto = $y + ($hLinha * 2); |
|
| 648 | 648 | $texto = "Descontos"; |
| 649 | 649 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 650 | 650 | $this->pTextBox($x, $yDesconto, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 651 | 651 | $texto = "R$ " . $vDesc; |
| 652 | 652 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 653 | 653 | $this->pTextBox($xValor, $yDesconto, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 654 | - $yFrete= $y + ($hLinha*3); |
|
| 654 | + $yFrete = $y + ($hLinha * 3); |
|
| 655 | 655 | $texto = "Frete"; |
| 656 | 656 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 657 | 657 | $this->pTextBox($x, $yFrete, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 658 | 658 | $texto = "R$ " . $vFrete; |
| 659 | 659 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 660 | 660 | $this->pTextBox($xValor, $yFrete, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 661 | - $yTotalFinal = $y + ($hLinha*4); |
|
| 661 | + $yTotalFinal = $y + ($hLinha * 4); |
|
| 662 | 662 | $texto = "Total"; |
| 663 | 663 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 664 | 664 | $this->pTextBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
| 665 | 665 | $texto = "R$ " . $vNF; |
| 666 | 666 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 667 | 667 | $this->pTextBox($xValor, $yTotalFinal, $wColDir, $hLinha, $texto, $aFont, 'T', 'R', 0, '', false); |
| 668 | - $yTotalFinal = $y + ($hLinha*5); |
|
| 668 | + $yTotalFinal = $y + ($hLinha * 5); |
|
| 669 | 669 | $texto = "Informação dos Tributos Totais Incidentes"; |
| 670 | 670 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
| 671 | 671 | $this->pTextBox($x, $yTotalFinal, $wColEsq, $hLinha, $texto, $aFont, 'T', 'L', 0, '', false); |
@@ -680,16 +680,16 @@ discard block |
||
| 680 | 680 | $margemInterna = $this->margemInterna; |
| 681 | 681 | $maxW = $this->wPrint; |
| 682 | 682 | $qtdPgto = $this->pag->length; |
| 683 | - $w = ($maxW*1); |
|
| 683 | + $w = ($maxW * 1); |
|
| 684 | 684 | $hLinha = $this->hLinha; |
| 685 | - $wColEsq = ($maxW*0.7); |
|
| 686 | - $wColDir = ($maxW*0.3); |
|
| 685 | + $wColEsq = ($maxW * 0.7); |
|
| 686 | + $wColDir = ($maxW * 0.3); |
|
| 687 | 687 | $xValor = $x + $wColEsq; |
| 688 | 688 | $aFontPgto = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 689 | - $wBoxEsq = $w*0.7; |
|
| 689 | + $wBoxEsq = $w * 0.7; |
|
| 690 | 690 | $texto = "FORMA DE PAGAMENTO"; |
| 691 | 691 | $this->pTextBox($x, $y, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false); |
| 692 | - $wBoxDir = $w*0.3; |
|
| 692 | + $wBoxDir = $w * 0.3; |
|
| 693 | 693 | $xBoxDescricao = $x + $wBoxEsq; |
| 694 | 694 | $texto = "VALOR PAGO"; |
| 695 | 695 | $this->pTextBox($xBoxDescricao, $y, $wBoxDir, $hLinha, $texto, $aFontPgto, 'T', 'R', 0, '', false); |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | $tBandNome = self::getCardName($tBand); |
| 712 | 712 | } |
| 713 | 713 | //COLOCA PRODUTO |
| 714 | - $yBoxProd = $y + $hLinha + ($cont*$hLinha); |
|
| 714 | + $yBoxProd = $y + $hLinha + ($cont * $hLinha); |
|
| 715 | 715 | //COLOCA PRODUTO CÓDIGO |
| 716 | 716 | $texto = $tPagNome; |
| 717 | 717 | $this->pTextBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false); |
@@ -735,7 +735,7 @@ discard block |
||
| 735 | 735 | } |
| 736 | 736 | |
| 737 | 737 | if (!empty($this->vTroco)) { |
| 738 | - $yBoxProd = $y + $hLinha + ($cont*$hLinha); |
|
| 738 | + $yBoxProd = $y + $hLinha + ($cont * $hLinha); |
|
| 739 | 739 | //COLOCA PRODUTO CÓDIGO |
| 740 | 740 | $texto = 'Troco'; |
| 741 | 741 | $this->pTextBox($x, $yBoxProd, $wBoxEsq, $hLinha, $texto, $aFontPgto, 'T', 'L', 0, '', false); |
@@ -764,7 +764,7 @@ discard block |
||
| 764 | 764 | $y += 6; |
| 765 | 765 | $margemInterna = $this->margemInterna; |
| 766 | 766 | $maxW = $this->wPrint; |
| 767 | - $w = ($maxW*1); |
|
| 767 | + $w = ($maxW * 1); |
|
| 768 | 768 | $hLinha = $this->hLinha; |
| 769 | 769 | $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
| 770 | 770 | $aFontTex = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
@@ -797,18 +797,18 @@ discard block |
||
| 797 | 797 | $urlChave = $this->urlConsulta[$tpAmb][$this->UFSigla[$cUF]]; |
| 798 | 798 | $texto = "ÁREA DE MENSAGEM FISCAL"; |
| 799 | 799 | $this->pTextBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 800 | - $yTex1 = $y + ($hLinha*1); |
|
| 801 | - $hTex1 = $hLinha*2; |
|
| 802 | - $texto = "Número " . $nNF . " Série " . $serieNF . " " .$dhEmiLocalFormat . " - Via Consumidor"; |
|
| 800 | + $yTex1 = $y + ($hLinha * 1); |
|
| 801 | + $hTex1 = $hLinha * 2; |
|
| 802 | + $texto = "Número " . $nNF . " Série " . $serieNF . " " . $dhEmiLocalFormat . " - Via Consumidor"; |
|
| 803 | 803 | $this->pTextBox($x, $yTex1, $w, $hTex1, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 804 | - $yTex2 = $y + ($hLinha*3); |
|
| 805 | - $hTex2 = $hLinha*2; |
|
| 804 | + $yTex2 = $y + ($hLinha * 3); |
|
| 805 | + $hTex2 = $hLinha * 2; |
|
| 806 | 806 | $texto = "Consulte pela Chave de Acesso em " . $urlChave; |
| 807 | 807 | $this->pTextBox($x, $yTex2, $w, $hTex2, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 808 | 808 | $texto = "CHAVE DE ACESSO"; |
| 809 | - $yTit2 = $y + ($hLinha*5); |
|
| 809 | + $yTit2 = $y + ($hLinha * 5); |
|
| 810 | 810 | $this->pTextBox($x, $yTit2, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 811 | - $yTex3 = $y + ($hLinha*6); |
|
| 811 | + $yTex3 = $y + ($hLinha * 6); |
|
| 812 | 812 | $texto = $chNFe; |
| 813 | 813 | $this->pTextBox($x, $yTex3, $w, $hLinha, $texto, $aFontTex, 'C', 'C', 0, '', false); |
| 814 | 814 | } |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | $y += 6; |
| 819 | 819 | $margemInterna = $this->margemInterna; |
| 820 | 820 | $maxW = $this->wPrint; |
| 821 | - $w = ($maxW*1); |
|
| 821 | + $w = ($maxW * 1); |
|
| 822 | 822 | $hLinha = $this->hLinha; |
| 823 | 823 | $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
| 824 | 824 | $aFontTex = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
@@ -834,7 +834,7 @@ discard block |
||
| 834 | 834 | $consCNPJ = !empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue) |
| 835 | 835 | ? $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue |
| 836 | 836 | : ''; |
| 837 | - $cDest = $consCPF.$consCNPJ.$considEstrangeiro; //documentos do consumidor |
|
| 837 | + $cDest = $consCPF . $consCNPJ . $considEstrangeiro; //documentos do consumidor |
|
| 838 | 838 | $enderDest = $this->dest->getElementsByTagName("enderDest")->item(0); |
| 839 | 839 | $consNome = $this->getTagValue($this->dest, "xNome"); |
| 840 | 840 | $consLgr = $this->getTagValue($enderDest, "xLgr"); |
@@ -874,8 +874,8 @@ discard block |
||
| 874 | 874 | $yTex1 = $y + $hLinha; |
| 875 | 875 | $texto = $consNome; |
| 876 | 876 | if (!empty($consDoc)) { |
| 877 | - $texto .= " - ". $consDoc . "\n" . $consEnd; |
|
| 878 | - $this->pTextBox($x, $yTex1, $w, $hLinha*3, $texto, $aFontTex, 'C', 'C', 0, '', false); |
|
| 877 | + $texto .= " - " . $consDoc . "\n" . $consEnd; |
|
| 878 | + $this->pTextBox($x, $yTex1, $w, $hLinha * 3, $texto, $aFontTex, 'C', 'C', 0, '', false); |
|
| 879 | 879 | } |
| 880 | 880 | } else { |
| 881 | 881 | $yTex1 = $y + $hLinha; |
@@ -889,7 +889,7 @@ discard block |
||
| 889 | 889 | $y += 6; |
| 890 | 890 | $margemInterna = $this->margemInterna; |
| 891 | 891 | $maxW = $this->wPrint; |
| 892 | - $w = ($maxW*1)+4; |
|
| 892 | + $w = ($maxW * 1) + 4; |
|
| 893 | 893 | $hLinha = $this->hLinha; |
| 894 | 894 | $hBoxLinha = $this->hBoxLinha; |
| 895 | 895 | $aFontTit = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
@@ -898,7 +898,7 @@ discard block |
||
| 898 | 898 | $nProt = ''; |
| 899 | 899 | if (isset($this->nfeProc)) { |
| 900 | 900 | $nProt = $this->getTagValue($this->nfeProc, "nProt"); |
| 901 | - $dhRecbto = $this->getTagValue($this->nfeProc, "dhRecbto"); |
|
| 901 | + $dhRecbto = $this->getTagValue($this->nfeProc, "dhRecbto"); |
|
| 902 | 902 | } |
| 903 | 903 | $barcode = new Barcode(); |
| 904 | 904 | $bobj = $barcode->getBarcodeObj( |
@@ -912,15 +912,15 @@ discard block |
||
| 912 | 912 | $qrcode = $bobj->getPngData(); |
| 913 | 913 | $wQr = 50; |
| 914 | 914 | $hQr = 50; |
| 915 | - $yQr = ($y+$margemInterna); |
|
| 916 | - $xQr = ($w/2) - ($wQr/2); |
|
| 915 | + $yQr = ($y + $margemInterna); |
|
| 916 | + $xQr = ($w / 2) - ($wQr / 2); |
|
| 917 | 917 | // prepare a base64 encoded "data url" |
| 918 | 918 | $pic = 'data://text/plain;base64,' . base64_encode($qrcode); |
| 919 | 919 | $info = getimagesize($pic); |
| 920 | 920 | $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG'); |
| 921 | 921 | $dt = new DateTime($dhRecbto); |
| 922 | - $yQr = ($yQr+$hQr+$margemInterna); |
|
| 923 | - $this->pTextBox($x, $yQr, $w-4, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n" |
|
| 922 | + $yQr = ($yQr + $hQr + $margemInterna); |
|
| 923 | + $this->pTextBox($x, $yQr, $w - 4, $hBoxLinha, "Protocolo de Autorização: " . $nProt . "\n" |
|
| 924 | 924 | . $dt->format('d/m/Y H:i:s'), $aFontTex, 'C', 'C', 0, '', false); |
| 925 | 925 | } |
| 926 | 926 | |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | $heigthText = $this->pTextBox($x, $y, $w, $hLinha, $texto, $aFontTit, 'C', 'C', 0, '', false); |
| 939 | 939 | |
| 940 | 940 | // seta o textbox do texto adicional |
| 941 | - $this->pTextBox($x, $y+3, $w-2, $hLinha-3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false); |
|
| 941 | + $this->pTextBox($x, $y + 3, $w - 2, $hLinha - 3, $this->textoAdic, $aFontTex, 'T', 'L', 0, '', false); |
|
| 942 | 942 | } |
| 943 | 943 | |
| 944 | 944 | /** |
@@ -998,7 +998,7 @@ discard block |
||
| 998 | 998 | if ($startPos === false) { |
| 999 | 999 | return $cdata; |
| 1000 | 1000 | } |
| 1001 | - for ($x=$len; $x>0; $x--) { |
|
| 1001 | + for ($x = $len; $x > 0; $x--) { |
|
| 1002 | 1002 | if (substr($cdata, $x, 1) == '>') { |
| 1003 | 1003 | $endPos = $x; |
| 1004 | 1004 | break; |
@@ -1009,15 +1009,15 @@ discard block |
||
| 1009 | 1009 | } else { |
| 1010 | 1010 | $parte1 = ''; |
| 1011 | 1011 | } |
| 1012 | - $parte2 = substr($cdata, $startPos, $endPos-$startPos+1); |
|
| 1012 | + $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1); |
|
| 1013 | 1013 | if ($endPos < $len) { |
| 1014 | 1014 | $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1); |
| 1015 | 1015 | } else { |
| 1016 | 1016 | $parte3 = ''; |
| 1017 | 1017 | } |
| 1018 | - $texto = trim($parte1).' '.trim($parte3); |
|
| 1018 | + $texto = trim($parte1) . ' ' . trim($parte3); |
|
| 1019 | 1019 | if (strpos($parte2, '<CDATA>') === false) { |
| 1020 | - $cdata = '<CDATA>'.$parte2.'</CDATA>'; |
|
| 1020 | + $cdata = '<CDATA>' . $parte2 . '</CDATA>'; |
|
| 1021 | 1021 | } else { |
| 1022 | 1022 | $cdata = $parte2; |
| 1023 | 1023 | } |
@@ -1089,15 +1089,15 @@ discard block |
||
| 1089 | 1089 | //grupo CADATA infCpl |
| 1090 | 1090 | $t = $dom->getElementsByTagName('transmissor')->item(0); |
| 1091 | 1091 | $r = $dom->getElementsByTagName('receptor')->item(0); |
| 1092 | - $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 1093 | - 'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : ''; |
|
| 1094 | - $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 1095 | - 'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : ''; |
|
| 1096 | - $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 1097 | - 'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : ''; |
|
| 1098 | - $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 1099 | - 'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : ''; |
|
| 1100 | - $texto .= "".$versao.$especieNF.$fabEntrega.$dca; |
|
| 1092 | + $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 1093 | + 'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : ''; |
|
| 1094 | + $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 1095 | + 'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : ''; |
|
| 1096 | + $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 1097 | + 'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : ''; |
|
| 1098 | + $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 1099 | + 'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : ''; |
|
| 1100 | + $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
| 1101 | 1101 | if (isset($t)) { |
| 1102 | 1102 | if ($t->hasAttributes()) { |
| 1103 | 1103 | $texto .= " Transmissor "; |
@@ -1181,7 +1181,7 @@ discard block |
||
| 1181 | 1181 | $bin = ""; |
| 1182 | 1182 | $iCount = 0; |
| 1183 | 1183 | do { |
| 1184 | - $bin .= chr(hexdec($str{$iCount}.$str{($iCount + 1)})); |
|
| 1184 | + $bin .= chr(hexdec($str{$iCount} . $str{($iCount + 1)})); |
|
| 1185 | 1185 | $iCount += 2; |
| 1186 | 1186 | } while ($iCount < strlen($str)); |
| 1187 | 1187 | return $bin; |
@@ -1215,12 +1215,12 @@ discard block |
||
| 1215 | 1215 | $seq .= '&digVal=' . strtolower($digHex); |
| 1216 | 1216 | $seq .= '&cIdToken=' . $idToken; |
| 1217 | 1217 | //o hash code é calculado com o Token incluso |
| 1218 | - $hash = sha1($seq.$token); |
|
| 1219 | - $seq .= '&cHashQRCode='. strtoupper($hash); |
|
| 1218 | + $hash = sha1($seq . $token); |
|
| 1219 | + $seq .= '&cHashQRCode=' . strtoupper($hash); |
|
| 1220 | 1220 | if (strpos($url, '?') === false) { |
| 1221 | - $seq = $url.'?'.$seq; |
|
| 1221 | + $seq = $url . '?' . $seq; |
|
| 1222 | 1222 | } else { |
| 1223 | - $seq = $url.''.$seq; |
|
| 1223 | + $seq = $url . '' . $seq; |
|
| 1224 | 1224 | } |
| 1225 | 1225 | return $seq; |
| 1226 | 1226 | } |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | $this->textoAdic .= ". \r\n"; |
| 596 | 596 | } |
| 597 | 597 | $this->textoAdic .= "LOCAL DE ENTREGA : ".$txRetCNPJ.'-'.$txRetxLgr.', '.$txRetnro.' '.$txRetxCpl. |
| 598 | - ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n"; |
|
| 598 | + ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n"; |
|
| 599 | 599 | } |
| 600 | 600 | //informações adicionais |
| 601 | 601 | $this->textoAdic .= $this->pGeraInformacoesDasNotasReferenciadas(); |
@@ -791,8 +791,8 @@ discard block |
||
| 791 | 791 | //retorna o ID na NFe |
| 792 | 792 | if ($classPdf!==false) { |
| 793 | 793 | $aR = array( |
| 794 | - 'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")), |
|
| 795 | - 'classe_PDF'=>$this->pdf); |
|
| 794 | + 'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")), |
|
| 795 | + 'classe_PDF'=>$this->pdf); |
|
| 796 | 796 | return $aR; |
| 797 | 797 | } else { |
| 798 | 798 | return str_replace('NFe', '', $this->infNFe->getAttribute("Id")); |
@@ -1003,7 +1003,7 @@ discard block |
||
| 1003 | 1003 | $oldX = $x; |
| 1004 | 1004 | $oldY = $y; |
| 1005 | 1005 | if ($this->orientacao == 'P') { |
| 1006 | - $maxW = $this->wPrint; |
|
| 1006 | + $maxW = $this->wPrint; |
|
| 1007 | 1007 | } else { |
| 1008 | 1008 | if ($pag == 1) { // primeira página |
| 1009 | 1009 | $maxW = $this->wPrint - $this->wCanhoto; |
@@ -1339,8 +1339,8 @@ discard block |
||
| 1339 | 1339 | $w = $maxW-(2*$x); |
| 1340 | 1340 | $this->pdf->SetTextColor(200, 200, 200); |
| 1341 | 1341 | $texto = "DANFE impresso em contingência -\n". |
| 1342 | - "DPEC regularmente recebido pela Receita\n". |
|
| 1343 | - "Federal do Brasil"; |
|
| 1342 | + "DPEC regularmente recebido pela Receita\n". |
|
| 1343 | + "Federal do Brasil"; |
|
| 1344 | 1344 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
| 1345 | 1345 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1346 | 1346 | $this->pdf->SetTextColor(0, 0, 0); |
@@ -1627,13 +1627,13 @@ discard block |
||
| 1627 | 1627 | return ($y + $h); |
| 1628 | 1628 | } //fim da função destinatarioDANFE |
| 1629 | 1629 | |
| 1630 | - /** |
|
| 1631 | - * pGetTextoFatura |
|
| 1632 | - * Gera a String do Texto da Fatura |
|
| 1633 | - * |
|
| 1634 | - * @name getTextoFatura |
|
| 1635 | - * @return uma String com o texto ou ""; |
|
| 1636 | - */ |
|
| 1630 | + /** |
|
| 1631 | + * pGetTextoFatura |
|
| 1632 | + * Gera a String do Texto da Fatura |
|
| 1633 | + * |
|
| 1634 | + * @name getTextoFatura |
|
| 1635 | + * @return uma String com o texto ou ""; |
|
| 1636 | + */ |
|
| 1637 | 1637 | protected function pGetTextoFatura() |
| 1638 | 1638 | { |
| 1639 | 1639 | if (isset($this->cobr)) { |
@@ -1664,13 +1664,13 @@ discard block |
||
| 1664 | 1664 | return ""; |
| 1665 | 1665 | } //fim getTextoFatura |
| 1666 | 1666 | |
| 1667 | - /** |
|
| 1668 | - * pSizeExtraTextoFatura |
|
| 1669 | - * Calcula o espaço ocupado pelo texto da fatura. Este espaço só é utilizado quando não houver duplicata. |
|
| 1670 | - * |
|
| 1671 | - * @name pSizeExtraTextoFatura |
|
| 1672 | - * @return integer |
|
| 1673 | - */ |
|
| 1667 | + /** |
|
| 1668 | + * pSizeExtraTextoFatura |
|
| 1669 | + * Calcula o espaço ocupado pelo texto da fatura. Este espaço só é utilizado quando não houver duplicata. |
|
| 1670 | + * |
|
| 1671 | + * @name pSizeExtraTextoFatura |
|
| 1672 | + * @return integer |
|
| 1673 | + */ |
|
| 1674 | 1674 | protected function pSizeExtraTextoFatura() |
| 1675 | 1675 | { |
| 1676 | 1676 | $textoFatura = $this->pGetTextoFatura(); |
@@ -1835,7 +1835,7 @@ discard block |
||
| 1835 | 1835 | '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível', |
| 1836 | 1836 | '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros'); |
| 1837 | 1837 | $bandeira = array('01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners', |
| 1838 | - '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'); |
|
| 1838 | + '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'); |
|
| 1839 | 1839 | foreach ($this->detPag as $k => $d) { |
| 1840 | 1840 | $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
| 1841 | 1841 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue : '0'; |
@@ -2463,7 +2463,7 @@ discard block |
||
| 2463 | 2463 | $w4 = round($w*0.05, 0); |
| 2464 | 2464 | $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2 |
| 2465 | 2465 | if ($this->getTagValue($this->emit, 'CRT') == '3') { |
| 2466 | - $texto = 'O/CST';//Regime Normal |
|
| 2466 | + $texto = 'O/CST';//Regime Normal |
|
| 2467 | 2467 | } |
| 2468 | 2468 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2469 | 2469 | $this->pTextBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
@@ -2971,9 +2971,9 @@ discard block |
||
| 2971 | 2971 | //DADOS ADICIONAIS |
| 2972 | 2972 | $texto = "DADOS ADICIONAIS"; |
| 2973 | 2973 | if ($this->orientacao == 'P') { |
| 2974 | - $w = $this->wPrint; |
|
| 2974 | + $w = $this->wPrint; |
|
| 2975 | 2975 | } else { |
| 2976 | - $w = $this->wPrint-$this->wCanhoto; |
|
| 2976 | + $w = $this->wPrint-$this->wCanhoto; |
|
| 2977 | 2977 | } |
| 2978 | 2978 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 2979 | 2979 | $this->pTextBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -3053,10 +3053,10 @@ discard block |
||
| 3053 | 3053 | protected function pRodape($x, $y) |
| 3054 | 3054 | { |
| 3055 | 3055 | if ($this->orientacao == 'P') { |
| 3056 | - $w = $this->wPrint; |
|
| 3056 | + $w = $this->wPrint; |
|
| 3057 | 3057 | } else { |
| 3058 | - $w = $this->wPrint-$this->wCanhoto; |
|
| 3059 | - $x = $this->wCanhoto; |
|
| 3058 | + $w = $this->wPrint-$this->wCanhoto; |
|
| 3059 | + $x = $this->wCanhoto; |
|
| 3060 | 3060 | } |
| 3061 | 3061 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'); |
| 3062 | 3062 | $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s'); |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | $this->fontePadrao = $fonteDANFE; |
| 356 | 356 | } |
| 357 | 357 | //se for passado o xml |
| 358 | - if (! empty($this->xml)) { |
|
| 358 | + if (!empty($this->xml)) { |
|
| 359 | 359 | $this->dom = new Dom(); |
| 360 | 360 | $this->dom->loadXML($this->xml); |
| 361 | 361 | $this->nfeProc = $this->dom->getElementsByTagName("nfeProc")->item(0); |
@@ -511,10 +511,10 @@ discard block |
||
| 511 | 511 | //total inicial de paginas |
| 512 | 512 | $totPag = 1; |
| 513 | 513 | //largura imprimivel em mm: largura da folha menos as margens esq/direita |
| 514 | - $this->wPrint = $maxW-($margEsq*2); |
|
| 514 | + $this->wPrint = $maxW - ($margEsq * 2); |
|
| 515 | 515 | //comprimento (altura) imprimivel em mm: altura da folha menos as margens |
| 516 | 516 | //superior e inferior |
| 517 | - $this->hPrint = $maxH-$margSup-$margInf; |
|
| 517 | + $this->hPrint = $maxH - $margSup - $margInf; |
|
| 518 | 518 | // estabelece contagem de paginas |
| 519 | 519 | $this->pdf->aliasNbPages(); |
| 520 | 520 | // fixa as margens |
@@ -552,9 +552,9 @@ discard block |
||
| 552 | 552 | } |
| 553 | 553 | //calcular a altura necessária para os dados adicionais |
| 554 | 554 | if ($this->orientacao == 'P') { |
| 555 | - $this->wAdic = round($this->wPrint*0.66, 0); |
|
| 555 | + $this->wAdic = round($this->wPrint * 0.66, 0); |
|
| 556 | 556 | } else { |
| 557 | - $this->wAdic = round(($this->wPrint-$this->wCanhoto)*0.5, 0); |
|
| 557 | + $this->wAdic = round(($this->wPrint - $this->wCanhoto) * 0.5, 0); |
|
| 558 | 558 | } |
| 559 | 559 | $fontProduto = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
| 560 | 560 | $this->textoAdic = ''; |
@@ -566,8 +566,8 @@ discard block |
||
| 566 | 566 | $txRetxBairro = $this->getTagValue($this->retirada, "xBairro"); |
| 567 | 567 | $txRetxMun = $this->getTagValue($this->retirada, "xMun"); |
| 568 | 568 | $txRetUF = $this->getTagValue($this->retirada, "UF"); |
| 569 | - $this->textoAdic .= "LOCAL DE RETIRADA : ". |
|
| 570 | - $txRetCNPJ. |
|
| 569 | + $this->textoAdic .= "LOCAL DE RETIRADA : " . |
|
| 570 | + $txRetCNPJ . |
|
| 571 | 571 | '-' . |
| 572 | 572 | $txRetxLgr . |
| 573 | 573 | ', ' . |
@@ -594,8 +594,8 @@ discard block |
||
| 594 | 594 | if ($this->textoAdic != '') { |
| 595 | 595 | $this->textoAdic .= ". \r\n"; |
| 596 | 596 | } |
| 597 | - $this->textoAdic .= "LOCAL DE ENTREGA : ".$txRetCNPJ.'-'.$txRetxLgr.', '.$txRetnro.' '.$txRetxCpl. |
|
| 598 | - ' - '.$txRetxBairro.' '.$txRetxMun.' - '.$txRetUF."\r\n"; |
|
| 597 | + $this->textoAdic .= "LOCAL DE ENTREGA : " . $txRetCNPJ . '-' . $txRetxLgr . ', ' . $txRetnro . ' ' . $txRetxCpl . |
|
| 598 | + ' - ' . $txRetxBairro . ' ' . $txRetxMun . ' - ' . $txRetUF . "\r\n"; |
|
| 599 | 599 | } |
| 600 | 600 | //informações adicionais |
| 601 | 601 | $this->textoAdic .= $this->pGeraInformacoesDasNotasReferenciadas(); |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | if ($this->textoAdic != '') { |
| 605 | 605 | $this->textoAdic .= ". \r\n"; |
| 606 | 606 | } |
| 607 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infCpl")) ? |
|
| 607 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infCpl")) ? |
|
| 608 | 608 | 'Inf. Contribuinte: ' . |
| 609 | 609 | $this->pAnfavea($this->getTagValue($this->infAdic, "infCpl")) : ''; |
| 610 | 610 | $infPedido = $this->pGeraInformacoesDaTagCompra(); |
@@ -612,14 +612,14 @@ discard block |
||
| 612 | 612 | $this->textoAdic .= $infPedido; |
| 613 | 613 | } |
| 614 | 614 | $this->textoAdic .= $this->getTagValue($this->dest, "email", ' Email do Destinatário: '); |
| 615 | - $this->textoAdic .= ! empty($this->getTagValue($this->infAdic, "infAdFisco")) ? |
|
| 615 | + $this->textoAdic .= !empty($this->getTagValue($this->infAdic, "infAdFisco")) ? |
|
| 616 | 616 | "\r\n Inf. fisco: " . |
| 617 | 617 | $this->getTagValue($this->infAdic, "infAdFisco") : ''; |
| 618 | 618 | $obsCont = $this->infAdic->getElementsByTagName("obsCont"); |
| 619 | 619 | if (isset($obsCont)) { |
| 620 | 620 | foreach ($obsCont as $obs) { |
| 621 | - $campo = $obsCont->item($i)->getAttribute("xCampo"); |
|
| 622 | - $xTexto = ! empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) ? |
|
| 621 | + $campo = $obsCont->item($i)->getAttribute("xCampo"); |
|
| 622 | + $xTexto = !empty($obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue) ? |
|
| 623 | 623 | $obsCont->item($i)->getElementsByTagName("xTexto")->item(0)->nodeValue : ''; |
| 624 | 624 | $this->textoAdic .= "\r\n" . $campo . ': ' . trim($xTexto); |
| 625 | 625 | $i++; |
@@ -647,38 +647,38 @@ discard block |
||
| 647 | 647 | foreach ($alinhas as $linha) { |
| 648 | 648 | $numlinhasdados += $this->pGetNumLines($linha, $this->wAdic, $fontProduto); |
| 649 | 649 | } |
| 650 | - $hdadosadic = round(($numlinhasdados+3) * $this->pdf->fontSize, 0); |
|
| 650 | + $hdadosadic = round(($numlinhasdados + 3) * $this->pdf->fontSize, 0); |
|
| 651 | 651 | if ($hdadosadic < 10) { |
| 652 | 652 | $hdadosadic = 10; |
| 653 | 653 | } |
| 654 | 654 | //altura disponivel para os campos da DANFE |
| 655 | - $hcabecalho = 47;//para cabeçalho |
|
| 656 | - $hdestinatario = 25;//para destinatario |
|
| 657 | - $hduplicatas = 12;//para cada grupo de 7 duplicatas |
|
| 658 | - $himposto = 18;// para imposto |
|
| 659 | - $htransporte = 25;// para transporte |
|
| 660 | - $hissqn = 11;// para issqn |
|
| 661 | - $hfooter = 5;// para rodape |
|
| 662 | - $hCabecItens = 4;//cabeçalho dos itens |
|
| 655 | + $hcabecalho = 47; //para cabeçalho |
|
| 656 | + $hdestinatario = 25; //para destinatario |
|
| 657 | + $hduplicatas = 12; //para cada grupo de 7 duplicatas |
|
| 658 | + $himposto = 18; // para imposto |
|
| 659 | + $htransporte = 25; // para transporte |
|
| 660 | + $hissqn = 11; // para issqn |
|
| 661 | + $hfooter = 5; // para rodape |
|
| 662 | + $hCabecItens = 4; //cabeçalho dos itens |
|
| 663 | 663 | //alturas disponiveis para os dados |
| 664 | 664 | $hDispo1 = $this->hPrint - 10 - ($hcabecalho + |
| 665 | 665 | $hdestinatario + ($linhasDup * $hduplicatas) + $himposto + $htransporte + |
| 666 | 666 | ($linhaISSQN * $hissqn) + $hdadosadic + $hfooter + $hCabecItens + |
| 667 | 667 | $this->pSizeExtraTextoFatura()); |
| 668 | 668 | if ($this->orientacao == 'P') { |
| 669 | - $hDispo1 -= 24 * $this->qCanhoto;//para canhoto |
|
| 669 | + $hDispo1 -= 24 * $this->qCanhoto; //para canhoto |
|
| 670 | 670 | $w = $this->wPrint; |
| 671 | 671 | } else { |
| 672 | - $hcanhoto = $this->hPrint;//para canhoto |
|
| 672 | + $hcanhoto = $this->hPrint; //para canhoto |
|
| 673 | 673 | $w = $this->wPrint - $this->wCanhoto; |
| 674 | 674 | } |
| 675 | - $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens)-4; |
|
| 675 | + $hDispo2 = $this->hPrint - 10 - ($hcabecalho + $hfooter + $hCabecItens) - 4; |
|
| 676 | 676 | //Contagem da altura ocupada para impressão dos itens |
| 677 | 677 | $fontProduto = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
| 678 | 678 | $i = 0; |
| 679 | 679 | $numlinhas = 0; |
| 680 | 680 | $hUsado = $hCabecItens; |
| 681 | - $w2 = round($w*0.28, 0); |
|
| 681 | + $w2 = round($w * 0.28, 0); |
|
| 682 | 682 | $hDispo = $hDispo1; |
| 683 | 683 | $totPag = 1; |
| 684 | 684 | while ($i < $this->det->length) { |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | $hDispo = $hDispo2; |
| 691 | 691 | $hUsado = $hCabecItens; |
| 692 | 692 | // Remove canhoto para páginas secundárias em modo paisagem ('L') |
| 693 | - $w2 = round($this->wPrint*0.28, 0); |
|
| 693 | + $w2 = round($this->wPrint * 0.28, 0); |
|
| 694 | 694 | $i--; // decrementa para readicionar o item que não coube nessa pagina na outra. |
| 695 | 695 | } |
| 696 | 696 | $i++; |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | //coloca o cabeçalho |
| 715 | 715 | $y = $this->pCabecalhoDANFE($x, $y, $pag, $totPag); |
| 716 | 716 | //coloca os dados do destinatário |
| 717 | - $y = $this->pDestinatarioDANFE($x, $y+1); |
|
| 717 | + $y = $this->pDestinatarioDANFE($x, $y + 1); |
|
| 718 | 718 | |
| 719 | 719 | |
| 720 | 720 | //Verifica as formas de pagamento da nota fiscal |
@@ -728,27 +728,27 @@ discard block |
||
| 728 | 728 | } |
| 729 | 729 | //caso tenha boleto imprimir fatura |
| 730 | 730 | if ($this->dup->length > 0) { |
| 731 | - $y = $this->pFaturaDANFE($x, $y+1); |
|
| 731 | + $y = $this->pFaturaDANFE($x, $y + 1); |
|
| 732 | 732 | } else { |
| 733 | 733 | //Se somente tiver a forma de pagamento sem pagamento ou outros não imprimir nada |
| 734 | - if (count($formaPag)=='1' && (isset($formaPag[90]) || isset($formaPag[99]))) { |
|
| 734 | + if (count($formaPag) == '1' && (isset($formaPag[90]) || isset($formaPag[99]))) { |
|
| 735 | 735 | $y = $y; |
| 736 | 736 | } else { |
| 737 | 737 | //caso tenha mais de uma forma de pagamento ou seja diferente de boleto exibe a |
| 738 | 738 | //forma de pagamento e o valor |
| 739 | - $y = $this->pagamentoDANFE($x, $y+1); |
|
| 739 | + $y = $this->pagamentoDANFE($x, $y + 1); |
|
| 740 | 740 | } |
| 741 | 741 | } |
| 742 | 742 | //coloca os dados dos impostos e totais da NFe |
| 743 | - $y = $this->pImpostoDANFE($x, $y+1); |
|
| 743 | + $y = $this->pImpostoDANFE($x, $y + 1); |
|
| 744 | 744 | //coloca os dados do trasnporte |
| 745 | - $y = $this->pTransporteDANFE($x, $y+1); |
|
| 745 | + $y = $this->pTransporteDANFE($x, $y + 1); |
|
| 746 | 746 | //itens da DANFE |
| 747 | 747 | $nInicial = 0; |
| 748 | - $y = $this->pItensDANFE($x, $y+1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens); |
|
| 748 | + $y = $this->pItensDANFE($x, $y + 1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens); |
|
| 749 | 749 | //coloca os dados do ISSQN |
| 750 | 750 | if ($linhaISSQN == 1) { |
| 751 | - $y = $this->pIssqnDANFE($x, $y+4); |
|
| 751 | + $y = $this->pIssqnDANFE($x, $y + 4); |
|
| 752 | 752 | } else { |
| 753 | 753 | $y += 4; |
| 754 | 754 | } |
@@ -756,7 +756,7 @@ discard block |
||
| 756 | 756 | $y = $this->pDadosAdicionaisDANFE($x, $y, $hdadosadic); |
| 757 | 757 | //coloca o rodapé da página |
| 758 | 758 | if ($this->orientacao == 'P') { |
| 759 | - $this->pRodape($xInic, $y-1); |
|
| 759 | + $this->pRodape($xInic, $y - 1); |
|
| 760 | 760 | } else { |
| 761 | 761 | $this->pRodape($xInic, $this->hPrint + 1); |
| 762 | 762 | } |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | //coloca o cabeçalho na página adicional |
| 777 | 777 | $y = $this->pCabecalhoDANFE($x, $y, $n, $totPag); |
| 778 | 778 | //coloca os itens na página adicional |
| 779 | - $y = $this->pItensDANFE($x, $y+1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens); |
|
| 779 | + $y = $this->pItensDANFE($x, $y + 1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens); |
|
| 780 | 780 | //coloca o rodapé da página |
| 781 | 781 | if ($this->orientacao == 'P') { |
| 782 | 782 | $this->pRodape($xInic, $y + 4); |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | } |
| 790 | 790 | } |
| 791 | 791 | //retorna o ID na NFe |
| 792 | - if ($classPdf!==false) { |
|
| 792 | + if ($classPdf !== false) { |
|
| 793 | 793 | $aR = array( |
| 794 | 794 | 'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")), |
| 795 | 795 | 'classe_PDF'=>$this->pdf); |
@@ -822,7 +822,7 @@ discard block |
||
| 822 | 822 | if ($startPos === false) { |
| 823 | 823 | return $cdata; |
| 824 | 824 | } |
| 825 | - for ($x=$len; $x>0; $x--) { |
|
| 825 | + for ($x = $len; $x > 0; $x--) { |
|
| 826 | 826 | if (substr($cdata, $x, 1) == '>') { |
| 827 | 827 | $endPos = $x; |
| 828 | 828 | break; |
@@ -833,15 +833,15 @@ discard block |
||
| 833 | 833 | } else { |
| 834 | 834 | $parte1 = ''; |
| 835 | 835 | } |
| 836 | - $parte2 = substr($cdata, $startPos, $endPos-$startPos+1); |
|
| 836 | + $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1); |
|
| 837 | 837 | if ($endPos < $len) { |
| 838 | 838 | $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1); |
| 839 | 839 | } else { |
| 840 | 840 | $parte3 = ''; |
| 841 | 841 | } |
| 842 | - $texto = trim($parte1).' '.trim($parte3); |
|
| 842 | + $texto = trim($parte1) . ' ' . trim($parte3); |
|
| 843 | 843 | if (strpos($parte2, '<CDATA>') === false) { |
| 844 | - $cdata = '<CDATA>'.$parte2.'</CDATA>'; |
|
| 844 | + $cdata = '<CDATA>' . $parte2 . '</CDATA>'; |
|
| 845 | 845 | } else { |
| 846 | 846 | $cdata = $parte2; |
| 847 | 847 | } |
@@ -915,15 +915,15 @@ discard block |
||
| 915 | 915 | //grupo CADATA infCpl |
| 916 | 916 | $t = $dom->getElementsByTagName('transmissor')->item(0); |
| 917 | 917 | $r = $dom->getElementsByTagName('receptor')->item(0); |
| 918 | - $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 919 | - 'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : ''; |
|
| 920 | - $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 921 | - 'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : ''; |
|
| 922 | - $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 923 | - 'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : ''; |
|
| 924 | - $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 925 | - 'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : ''; |
|
| 926 | - $texto .= "".$versao.$especieNF.$fabEntrega.$dca; |
|
| 918 | + $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 919 | + 'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : ''; |
|
| 920 | + $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 921 | + 'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : ''; |
|
| 922 | + $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 923 | + 'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : ''; |
|
| 924 | + $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 925 | + 'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : ''; |
|
| 926 | + $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
| 927 | 927 | if (isset($t)) { |
| 928 | 928 | if ($t->hasAttributes()) { |
| 929 | 929 | $texto .= " Transmissor "; |
@@ -1013,14 +1013,14 @@ discard block |
||
| 1013 | 1013 | } |
| 1014 | 1014 | //#################################################################################### |
| 1015 | 1015 | //coluna esquerda identificação do emitente |
| 1016 | - $w = round($maxW*0.41, 0); |
|
| 1016 | + $w = round($maxW * 0.41, 0); |
|
| 1017 | 1017 | if ($this->orientacao == 'P') { |
| 1018 | 1018 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'); |
| 1019 | 1019 | } else { |
| 1020 | 1020 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
| 1021 | 1021 | } |
| 1022 | 1022 | $w1 = $w; |
| 1023 | - $h=32; |
|
| 1023 | + $h = 32; |
|
| 1024 | 1024 | $oldY += $h; |
| 1025 | 1025 | $this->pTextBox($x, $y, $w, $h); |
| 1026 | 1026 | $texto = 'IDENTIFICAÇÃO DO EMITENTE'; |
@@ -1041,39 +1041,39 @@ discard block |
||
| 1041 | 1041 | $type == 'jpg'; |
| 1042 | 1042 | } |
| 1043 | 1043 | //largura da imagem em mm |
| 1044 | - $logoWmm = ($logoInfo[0]/72)*25.4; |
|
| 1044 | + $logoWmm = ($logoInfo[0] / 72) * 25.4; |
|
| 1045 | 1045 | //altura da imagem em mm |
| 1046 | - $logoHmm = ($logoInfo[1]/72)*25.4; |
|
| 1047 | - if ($this->logoAlign=='L') { |
|
| 1048 | - $nImgW = round($w/3, 0); |
|
| 1049 | - $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
|
| 1050 | - $xImg = $x+1; |
|
| 1051 | - $yImg = round(($h-$nImgH)/2, 0)+$y; |
|
| 1046 | + $logoHmm = ($logoInfo[1] / 72) * 25.4; |
|
| 1047 | + if ($this->logoAlign == 'L') { |
|
| 1048 | + $nImgW = round($w / 3, 0); |
|
| 1049 | + $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
|
| 1050 | + $xImg = $x + 1; |
|
| 1051 | + $yImg = round(($h - $nImgH) / 2, 0) + $y; |
|
| 1052 | 1052 | //estabelecer posições do texto |
| 1053 | - $x1 = round($xImg + $nImgW +1, 0); |
|
| 1054 | - $y1 = round($h/3+$y, 0); |
|
| 1055 | - $tw = round(2*$w/3, 0); |
|
| 1056 | - } elseif ($this->logoAlign=='C') { |
|
| 1057 | - $nImgH = round($h/3, 0); |
|
| 1058 | - $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
|
| 1059 | - $xImg = round(($w-$nImgW)/2+$x, 0); |
|
| 1060 | - $yImg = $y+3; |
|
| 1053 | + $x1 = round($xImg + $nImgW + 1, 0); |
|
| 1054 | + $y1 = round($h / 3 + $y, 0); |
|
| 1055 | + $tw = round(2 * $w / 3, 0); |
|
| 1056 | + } elseif ($this->logoAlign == 'C') { |
|
| 1057 | + $nImgH = round($h / 3, 0); |
|
| 1058 | + $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0); |
|
| 1059 | + $xImg = round(($w - $nImgW) / 2 + $x, 0); |
|
| 1060 | + $yImg = $y + 3; |
|
| 1061 | 1061 | $x1 = $x; |
| 1062 | 1062 | $y1 = round($yImg + $nImgH + 1, 0); |
| 1063 | 1063 | $tw = $w; |
| 1064 | - } elseif ($this->logoAlign=='R') { |
|
| 1065 | - $nImgW = round($w/3, 0); |
|
| 1066 | - $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
|
| 1067 | - $xImg = round($x+($w-(1+$nImgW)), 0); |
|
| 1068 | - $yImg = round(($h-$nImgH)/2, 0)+$y; |
|
| 1064 | + } elseif ($this->logoAlign == 'R') { |
|
| 1065 | + $nImgW = round($w / 3, 0); |
|
| 1066 | + $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
|
| 1067 | + $xImg = round($x + ($w - (1 + $nImgW)), 0); |
|
| 1068 | + $yImg = round(($h - $nImgH) / 2, 0) + $y; |
|
| 1069 | 1069 | $x1 = $x; |
| 1070 | - $y1 = round($h/3+$y, 0); |
|
| 1071 | - $tw = round(2*$w/3, 0); |
|
| 1072 | - } elseif ($this->logoAlign=='F') { |
|
| 1073 | - $nImgH = round($h-5, 0); |
|
| 1074 | - $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
|
| 1075 | - $xImg = round(($w-$nImgW)/2+$x, 0); |
|
| 1076 | - $yImg = $y+3; |
|
| 1070 | + $y1 = round($h / 3 + $y, 0); |
|
| 1071 | + $tw = round(2 * $w / 3, 0); |
|
| 1072 | + } elseif ($this->logoAlign == 'F') { |
|
| 1073 | + $nImgH = round($h - 5, 0); |
|
| 1074 | + $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0); |
|
| 1075 | + $xImg = round(($w - $nImgW) / 2 + $x, 0); |
|
| 1076 | + $yImg = $y + 3; |
|
| 1077 | 1077 | $x1 = $x; |
| 1078 | 1078 | $y1 = round($yImg + $nImgH + 1, 0); |
| 1079 | 1079 | $tw = $w; |
@@ -1082,7 +1082,7 @@ discard block |
||
| 1082 | 1082 | $this->pdf->Image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, $type); |
| 1083 | 1083 | } else { |
| 1084 | 1084 | $x1 = $x; |
| 1085 | - $y1 = round($h/3+$y, 0); |
|
| 1085 | + $y1 = round($h / 3 + $y, 0); |
|
| 1086 | 1086 | $tw = $w; |
| 1087 | 1087 | } |
| 1088 | 1088 | // monta as informações apenas se diferente de full logo |
@@ -1092,9 +1092,9 @@ discard block |
||
| 1092 | 1092 | $texto = $this->emit->getElementsByTagName("xNome")->item(0)->nodeValue; |
| 1093 | 1093 | $this->pTextBox($x1, $y1, $tw, 8, $texto, $aFont, 'T', 'C', 0, ''); |
| 1094 | 1094 | //endereço |
| 1095 | - $y1 = $y1+5; |
|
| 1095 | + $y1 = $y1 + 5; |
|
| 1096 | 1096 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
| 1097 | - $fone = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 1097 | + $fone = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 1098 | 1098 | ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue |
| 1099 | 1099 | : ''; |
| 1100 | 1100 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
@@ -1114,37 +1114,37 @@ discard block |
||
| 1114 | 1114 | //#################################################################################### |
| 1115 | 1115 | //coluna central Danfe |
| 1116 | 1116 | $x += $w; |
| 1117 | - $w=round($maxW * 0.17, 0);//35; |
|
| 1117 | + $w = round($maxW * 0.17, 0); //35; |
|
| 1118 | 1118 | $w2 = $w; |
| 1119 | 1119 | $h = 32; |
| 1120 | 1120 | $this->pTextBox($x, $y, $w, $h); |
| 1121 | 1121 | |
| 1122 | - if (! $this->pNotaCancelada()) { |
|
| 1122 | + if (!$this->pNotaCancelada()) { |
|
| 1123 | 1123 | // A PRINCIPIO NÃO PRECISAVA, POIS A NFE ESTÁ AUTORIZADA, |
| 1124 | 1124 | // SÓ SE RETIRA O DANFE PARA NOTAS NÃO AUTORIZADAS |
| 1125 | 1125 | $texto = "DANFE"; |
| 1126 | 1126 | $aFont = array('font'=>$this->fontePadrao, 'size'=>14, 'style'=>'B'); |
| 1127 | - $this->pTextBox($x, $y+1, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1127 | + $this->pTextBox($x, $y + 1, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1128 | 1128 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
| 1129 | 1129 | $texto = 'Documento Auxiliar da Nota Fiscal Eletrônica'; |
| 1130 | 1130 | $h = 20; |
| 1131 | - $this->pTextBox($x, $y+6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false); |
|
| 1131 | + $this->pTextBox($x, $y + 6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false); |
|
| 1132 | 1132 | } |
| 1133 | 1133 | |
| 1134 | 1134 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
| 1135 | 1135 | $texto = '0 - ENTRADA'; |
| 1136 | 1136 | $y1 = $y + 14; |
| 1137 | 1137 | $h = 8; |
| 1138 | - $this->pTextBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1138 | + $this->pTextBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1139 | 1139 | $texto = '1 - SAÍDA'; |
| 1140 | 1140 | $y1 = $y + 17; |
| 1141 | - $this->pTextBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1141 | + $this->pTextBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1142 | 1142 | //tipo de nF |
| 1143 | 1143 | $aFont = array('font'=>$this->fontePadrao, 'size'=>12, 'style'=>'B'); |
| 1144 | 1144 | $y1 = $y + 13; |
| 1145 | 1145 | $h = 7; |
| 1146 | 1146 | $texto = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue; |
| 1147 | - $this->pTextBox($x+27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, ''); |
|
| 1147 | + $this->pTextBox($x + 27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, ''); |
|
| 1148 | 1148 | //numero da NF |
| 1149 | 1149 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
| 1150 | 1150 | $y1 = $y + 20; |
@@ -1166,7 +1166,7 @@ discard block |
||
| 1166 | 1166 | //#################################################################################### |
| 1167 | 1167 | //coluna codigo de barras |
| 1168 | 1168 | $x += $w; |
| 1169 | - $w = ($maxW-$w1-$w2);//85; |
|
| 1169 | + $w = ($maxW - $w1 - $w2); //85; |
|
| 1170 | 1170 | $w3 = $w; |
| 1171 | 1171 | $h = 32; |
| 1172 | 1172 | $this->pTextBox($x, $y, $w, $h); |
@@ -1175,22 +1175,22 @@ discard block |
||
| 1175 | 1175 | $bW = 75; |
| 1176 | 1176 | $bH = 12; |
| 1177 | 1177 | //codigo de barras |
| 1178 | - $this->pdf->Code128($x+(($w-$bW)/2), $y+2, $chave_acesso, $bW, $bH); |
|
| 1178 | + $this->pdf->Code128($x + (($w - $bW) / 2), $y + 2, $chave_acesso, $bW, $bH); |
|
| 1179 | 1179 | //linhas divisorias |
| 1180 | - $this->pdf->Line($x, $y+4+$bH, $x+$w, $y+4+$bH); |
|
| 1181 | - $this->pdf->Line($x, $y+12+$bH, $x+$w, $y+12+$bH); |
|
| 1180 | + $this->pdf->Line($x, $y + 4 + $bH, $x + $w, $y + 4 + $bH); |
|
| 1181 | + $this->pdf->Line($x, $y + 12 + $bH, $x + $w, $y + 12 + $bH); |
|
| 1182 | 1182 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1183 | - $y1 = $y+4+$bH; |
|
| 1183 | + $y1 = $y + 4 + $bH; |
|
| 1184 | 1184 | $h = 7; |
| 1185 | 1185 | $texto = 'CHAVE DE ACESSO'; |
| 1186 | 1186 | $this->pTextBox($x, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1187 | 1187 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B'); |
| 1188 | - $y1 = $y+8+$bH; |
|
| 1188 | + $y1 = $y + 8 + $bH; |
|
| 1189 | 1189 | $texto = $this->pFormat($chave_acesso, $this->formatoChave); |
| 1190 | - $this->pTextBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1191 | - $y1 = $y+12+$bH; |
|
| 1190 | + $this->pTextBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1191 | + $y1 = $y + 12 + $bH; |
|
| 1192 | 1192 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
| 1193 | - $chaveContingencia=""; |
|
| 1193 | + $chaveContingencia = ""; |
|
| 1194 | 1194 | if ($this->pNotaDPEC()) { |
| 1195 | 1195 | $cabecalhoProtoAutorizacao = 'NÚMERO DE REGISTRO DPEC'; |
| 1196 | 1196 | } else { |
@@ -1201,16 +1201,16 @@ discard block |
||
| 1201 | 1201 | $chaveContingencia = $this->pGeraChaveAdicionalDeContingencia(); |
| 1202 | 1202 | $this->pdf->SetFillColor(0, 0, 0); |
| 1203 | 1203 | //codigo de barras |
| 1204 | - $this->pdf->Code128($x+11, $y1+1, $chaveContingencia, $bW*.9, $bH/2); |
|
| 1204 | + $this->pdf->Code128($x + 11, $y1 + 1, $chaveContingencia, $bW * .9, $bH / 2); |
|
| 1205 | 1205 | } else { |
| 1206 | 1206 | $texto = 'Consulta de autenticidade no portal nacional da NF-e'; |
| 1207 | - $this->pTextBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1208 | - $y1 = $y+16+$bH; |
|
| 1207 | + $this->pTextBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1208 | + $y1 = $y + 16 + $bH; |
|
| 1209 | 1209 | $texto = 'www.nfe.fazenda.gov.br/portal ou no site da Sefaz Autorizadora'; |
| 1210 | 1210 | $this->pTextBox( |
| 1211 | - $x+2, |
|
| 1211 | + $x + 2, |
|
| 1212 | 1212 | $y1, |
| 1213 | - $w-2, |
|
| 1213 | + $w - 2, |
|
| 1214 | 1214 | $h, |
| 1215 | 1215 | $texto, |
| 1216 | 1216 | $aFont, |
@@ -1226,7 +1226,7 @@ discard block |
||
| 1226 | 1226 | //natureza da operação |
| 1227 | 1227 | $texto = 'NATUREZA DA OPERAÇÃO'; |
| 1228 | 1228 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1229 | - $w = $w1+$w2; |
|
| 1229 | + $w = $w1 + $w2; |
|
| 1230 | 1230 | $y = $oldY; |
| 1231 | 1231 | $oldY += $h; |
| 1232 | 1232 | $x = $oldX; |
@@ -1256,7 +1256,7 @@ discard block |
||
| 1256 | 1256 | $cStat = ''; |
| 1257 | 1257 | } else { |
| 1258 | 1258 | if (isset($this->nfeProc)) { |
| 1259 | - $texto = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) ? |
|
| 1259 | + $texto = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) ? |
|
| 1260 | 1260 | $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue : ''; |
| 1261 | 1261 | $tsHora = $this->pConvertTime($this->nfeProc->getElementsByTagName("dhRecbto")->item(0)->nodeValue); |
| 1262 | 1262 | if ($texto != '') { |
@@ -1287,25 +1287,25 @@ discard block |
||
| 1287 | 1287 | $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.'; |
| 1288 | 1288 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1289 | 1289 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1290 | - $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
| 1290 | + $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
| 1291 | 1291 | ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue |
| 1292 | 1292 | : ''; |
| 1293 | 1293 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
| 1294 | 1294 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1295 | 1295 | //CNPJ |
| 1296 | 1296 | $x += $w; |
| 1297 | - $w = ($maxW-(2*$w)); |
|
| 1297 | + $w = ($maxW - (2 * $w)); |
|
| 1298 | 1298 | $texto = 'CNPJ / CPF'; |
| 1299 | 1299 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1300 | 1300 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1301 | 1301 | //Pegando valor do CPF/CNPJ |
| 1302 | - if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1302 | + if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1303 | 1303 | $texto = $this->pFormat( |
| 1304 | 1304 | $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1305 | 1305 | "###.###.###/####-##" |
| 1306 | 1306 | ); |
| 1307 | 1307 | } else { |
| 1308 | - $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1308 | + $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1309 | 1309 | $this->pFormat( |
| 1310 | 1310 | $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1311 | 1311 | "###.###.###-##" |
@@ -1321,9 +1321,9 @@ discard block |
||
| 1321 | 1321 | if ($this->pNotaCancelada()) { |
| 1322 | 1322 | //101 Cancelamento |
| 1323 | 1323 | $x = 10; |
| 1324 | - $y = $this->hPrint-130; |
|
| 1324 | + $y = $this->hPrint - 130; |
|
| 1325 | 1325 | $h = 25; |
| 1326 | - $w = $maxW-(2*$x); |
|
| 1326 | + $w = $maxW - (2 * $x); |
|
| 1327 | 1327 | $this->pdf->SetTextColor(90, 90, 90); |
| 1328 | 1328 | $texto = "NFe CANCELADA"; |
| 1329 | 1329 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
@@ -1334,12 +1334,12 @@ discard block |
||
| 1334 | 1334 | if ($this->pNotaDPEC() || $this->tpEmis == 4) { |
| 1335 | 1335 | //DPEC |
| 1336 | 1336 | $x = 10; |
| 1337 | - $y = $this->hPrint-130; |
|
| 1337 | + $y = $this->hPrint - 130; |
|
| 1338 | 1338 | $h = 25; |
| 1339 | - $w = $maxW-(2*$x); |
|
| 1339 | + $w = $maxW - (2 * $x); |
|
| 1340 | 1340 | $this->pdf->SetTextColor(200, 200, 200); |
| 1341 | - $texto = "DANFE impresso em contingência -\n". |
|
| 1342 | - "DPEC regularmente recebido pela Receita\n". |
|
| 1341 | + $texto = "DANFE impresso em contingência -\n" . |
|
| 1342 | + "DPEC regularmente recebido pela Receita\n" . |
|
| 1343 | 1343 | "Federal do Brasil"; |
| 1344 | 1344 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
| 1345 | 1345 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
@@ -1348,22 +1348,22 @@ discard block |
||
| 1348 | 1348 | if ($this->pNotaDenegada()) { |
| 1349 | 1349 | //110 301 302 Denegada |
| 1350 | 1350 | $x = 10; |
| 1351 | - $y = $this->hPrint-130; |
|
| 1351 | + $y = $this->hPrint - 130; |
|
| 1352 | 1352 | $h = 25; |
| 1353 | - $w = $maxW-(2*$x); |
|
| 1353 | + $w = $maxW - (2 * $x); |
|
| 1354 | 1354 | $this->pdf->SetTextColor(90, 90, 90); |
| 1355 | 1355 | $texto = "NFe USO DENEGADO"; |
| 1356 | 1356 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
| 1357 | 1357 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1358 | 1358 | $y += $h; |
| 1359 | 1359 | $h = 5; |
| 1360 | - $w = $maxW-(2*$x); |
|
| 1360 | + $w = $maxW - (2 * $x); |
|
| 1361 | 1361 | if (isset($this->infProt)) { |
| 1362 | 1362 | $xMotivo = $this->infProt->getElementsByTagName("xMotivo")->item(0)->nodeValue; |
| 1363 | 1363 | } else { |
| 1364 | 1364 | $xMotivo = ''; |
| 1365 | 1365 | } |
| 1366 | - $texto = "SEM VALOR FISCAL\n".$xMotivo; |
|
| 1366 | + $texto = "SEM VALOR FISCAL\n" . $xMotivo; |
|
| 1367 | 1367 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
| 1368 | 1368 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1369 | 1369 | $this->pdf->SetTextColor(0, 0, 0); |
@@ -1372,29 +1372,29 @@ discard block |
||
| 1372 | 1372 | if ($tpAmb != 1) { |
| 1373 | 1373 | $x = 10; |
| 1374 | 1374 | if ($this->orientacao == 'P') { |
| 1375 | - $y = round($this->hPrint*2/3, 0); |
|
| 1375 | + $y = round($this->hPrint * 2 / 3, 0); |
|
| 1376 | 1376 | } else { |
| 1377 | - $y = round($this->hPrint/2, 0); |
|
| 1377 | + $y = round($this->hPrint / 2, 0); |
|
| 1378 | 1378 | } |
| 1379 | 1379 | $h = 5; |
| 1380 | - $w = $maxW-(2*$x); |
|
| 1380 | + $w = $maxW - (2 * $x); |
|
| 1381 | 1381 | $this->pdf->SetTextColor(90, 90, 90); |
| 1382 | 1382 | $texto = "SEM VALOR FISCAL"; |
| 1383 | 1383 | $aFont = array('font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B'); |
| 1384 | 1384 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1385 | 1385 | $aFont = array('font'=>$this->fontePadrao, 'size'=>30, 'style'=>'B'); |
| 1386 | 1386 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
| 1387 | - $this->pTextBox($x, $y+14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1387 | + $this->pTextBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1388 | 1388 | $this->pdf->SetTextColor(0, 0, 0); |
| 1389 | 1389 | } else { |
| 1390 | 1390 | $x = 10; |
| 1391 | 1391 | if ($this->orientacao == 'P') { |
| 1392 | - $y = round($this->hPrint*2/3, 0); |
|
| 1392 | + $y = round($this->hPrint * 2 / 3, 0); |
|
| 1393 | 1393 | } else { |
| 1394 | - $y = round($this->hPrint/2, 0); |
|
| 1394 | + $y = round($this->hPrint / 2, 0); |
|
| 1395 | 1395 | }//fim orientacao |
| 1396 | 1396 | $h = 5; |
| 1397 | - $w = $maxW-(2*$x); |
|
| 1397 | + $w = $maxW - (2 * $x); |
|
| 1398 | 1398 | $this->pdf->SetTextColor(90, 90, 90); |
| 1399 | 1399 | //indicar FALTA DO PROTOCOLO se NFe não for em contingência |
| 1400 | 1400 | if (($this->tpEmis == 2 || $this->tpEmis == 5) && !$this->pNotaDPEC()) { |
@@ -1404,7 +1404,7 @@ discard block |
||
| 1404 | 1404 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1405 | 1405 | $aFont = array('font'=>$this->fontePadrao, 'size'=>30, 'style'=>'B'); |
| 1406 | 1406 | $texto = "devido à problemas técnicos"; |
| 1407 | - $this->pTextBox($x, $y+12, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1407 | + $this->pTextBox($x, $y + 12, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1408 | 1408 | } else { |
| 1409 | 1409 | if (!isset($this->nfeProc)) { |
| 1410 | 1410 | if (!$this->pNotaDPEC()) { |
@@ -1415,9 +1415,9 @@ discard block |
||
| 1415 | 1415 | $aFont = array('font'=>$this->fontePadrao, 'size'=>30, 'style'=>'B'); |
| 1416 | 1416 | $texto = "FALTA PROTOCOLO DE APROVAÇÃO DA SEFAZ"; |
| 1417 | 1417 | if (!$this->pNotaDPEC()) { |
| 1418 | - $this->pTextBox($x, $y+12, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1418 | + $this->pTextBox($x, $y + 12, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1419 | 1419 | } else { |
| 1420 | - $this->pTextBox($x, $y+25, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1420 | + $this->pTextBox($x, $y + 25, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1421 | 1421 | } |
| 1422 | 1422 | }//fim nefProc |
| 1423 | 1423 | }//fim tpEmis |
@@ -1452,7 +1452,7 @@ discard block |
||
| 1452 | 1452 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 1453 | 1453 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1454 | 1454 | //NOME / RAZÃO SOCIAL |
| 1455 | - $w = round($maxW*0.61, 0); |
|
| 1455 | + $w = round($maxW * 0.61, 0); |
|
| 1456 | 1456 | $w1 = $w; |
| 1457 | 1457 | $y += 3; |
| 1458 | 1458 | $texto = 'NOME / RAZÃO SOCIAL'; |
@@ -1467,19 +1467,19 @@ discard block |
||
| 1467 | 1467 | } |
| 1468 | 1468 | //CNPJ / CPF |
| 1469 | 1469 | $x += $w; |
| 1470 | - $w = round($maxW*0.23, 0); |
|
| 1470 | + $w = round($maxW * 0.23, 0); |
|
| 1471 | 1471 | $w2 = $w; |
| 1472 | 1472 | $texto = 'CNPJ / CPF'; |
| 1473 | 1473 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1474 | 1474 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1475 | 1475 | //Pegando valor do CPF/CNPJ |
| 1476 | - if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1476 | + if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1477 | 1477 | $texto = $this->pFormat( |
| 1478 | 1478 | $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1479 | 1479 | "###.###.###/####-##" |
| 1480 | 1480 | ); |
| 1481 | 1481 | } else { |
| 1482 | - $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1482 | + $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1483 | 1483 | $this->pFormat( |
| 1484 | 1484 | $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1485 | 1485 | "###.###.###-##" |
@@ -1489,15 +1489,15 @@ discard block |
||
| 1489 | 1489 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1490 | 1490 | //DATA DA EMISSÃO |
| 1491 | 1491 | $x += $w; |
| 1492 | - $w = $maxW-($w1+$w2); |
|
| 1492 | + $w = $maxW - ($w1 + $w2); |
|
| 1493 | 1493 | $wx = $w; |
| 1494 | 1494 | $texto = 'DATA DA EMISSÃO'; |
| 1495 | 1495 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1496 | 1496 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1497 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 1497 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 1498 | 1498 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 1499 | 1499 | if ($dEmi == '') { |
| 1500 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 1500 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 1501 | 1501 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 1502 | 1502 | $aDemi = explode('T', $dEmi); |
| 1503 | 1503 | $dEmi = $aDemi[0]; |
@@ -1510,7 +1510,7 @@ discard block |
||
| 1510 | 1510 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, ''); |
| 1511 | 1511 | } |
| 1512 | 1512 | //ENDEREÇO |
| 1513 | - $w = round($maxW*0.47, 0); |
|
| 1513 | + $w = round($maxW * 0.47, 0); |
|
| 1514 | 1514 | $w1 = $w; |
| 1515 | 1515 | $y += $h; |
| 1516 | 1516 | $x = $oldX; |
@@ -1525,7 +1525,7 @@ discard block |
||
| 1525 | 1525 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
| 1526 | 1526 | //BAIRRO / DISTRITO |
| 1527 | 1527 | $x += $w; |
| 1528 | - $w = round($maxW*0.21, 0); |
|
| 1528 | + $w = round($maxW * 0.21, 0); |
|
| 1529 | 1529 | $w2 = $w; |
| 1530 | 1530 | $texto = 'BAIRRO / DISTRITO'; |
| 1531 | 1531 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
@@ -1535,12 +1535,12 @@ discard block |
||
| 1535 | 1535 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1536 | 1536 | //CEP |
| 1537 | 1537 | $x += $w; |
| 1538 | - $w = $maxW-$w1-$w2-$wx; |
|
| 1538 | + $w = $maxW - $w1 - $w2 - $wx; |
|
| 1539 | 1539 | $w2 = $w; |
| 1540 | 1540 | $texto = 'CEP'; |
| 1541 | 1541 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1542 | 1542 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1543 | - $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1543 | + $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1544 | 1544 | $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
| 1545 | 1545 | $texto = $this->pFormat($texto, "#####-###"); |
| 1546 | 1546 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
@@ -1551,10 +1551,10 @@ discard block |
||
| 1551 | 1551 | $texto = 'DATA DA SAÍDA/ENTRADA'; |
| 1552 | 1552 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1553 | 1553 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1554 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) ? |
|
| 1554 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) ? |
|
| 1555 | 1555 | $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue : ''; |
| 1556 | 1556 | if ($dSaiEnt == '') { |
| 1557 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
| 1557 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
| 1558 | 1558 | $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue : ''; |
| 1559 | 1559 | $aDsaient = explode('T', $dSaiEnt); |
| 1560 | 1560 | $dSaiEnt = $aDsaient[0]; |
@@ -1571,7 +1571,7 @@ discard block |
||
| 1571 | 1571 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1572 | 1572 | $texto = $this->dest->getElementsByTagName("xMun")->item(0)->nodeValue; |
| 1573 | 1573 | if (strtoupper(trim($texto)) == "EXTERIOR" && $this->dest->getElementsByTagName("xPais")->length > 0) { |
| 1574 | - $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
| 1574 | + $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
| 1575 | 1575 | } |
| 1576 | 1576 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
| 1577 | 1577 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -1586,18 +1586,18 @@ discard block |
||
| 1586 | 1586 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1587 | 1587 | //FONE / FAX |
| 1588 | 1588 | $x += $w; |
| 1589 | - $w = round(($maxW -$w1-$wx-8)/2, 0); |
|
| 1589 | + $w = round(($maxW - $w1 - $wx - 8) / 2, 0); |
|
| 1590 | 1590 | $w3 = $w; |
| 1591 | 1591 | $texto = 'FONE / FAX'; |
| 1592 | 1592 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1593 | 1593 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1594 | - $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1594 | + $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1595 | 1595 | $this->dest->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
| 1596 | 1596 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
| 1597 | 1597 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1598 | 1598 | //INSCRIÇÃO ESTADUAL |
| 1599 | 1599 | $x += $w; |
| 1600 | - $w = $maxW -$w1-$wx-8-$w3; |
|
| 1600 | + $w = $maxW - $w1 - $wx - 8 - $w3; |
|
| 1601 | 1601 | $texto = 'INSCRIÇÃO ESTADUAL'; |
| 1602 | 1602 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1603 | 1603 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1611,10 +1611,10 @@ discard block |
||
| 1611 | 1611 | $texto = 'HORA DA SAÍDA/ENTRADA'; |
| 1612 | 1612 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1613 | 1613 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1614 | - $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) ? |
|
| 1614 | + $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) ? |
|
| 1615 | 1615 | $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue : ''; |
| 1616 | 1616 | if ($hSaiEnt == '') { |
| 1617 | - $dhSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
| 1617 | + $dhSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
| 1618 | 1618 | $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue : ''; |
| 1619 | 1619 | $tsDhSaiEnt = $this->pConvertTime($dhSaiEnt); |
| 1620 | 1620 | if ($tsDhSaiEnt != '') { |
@@ -1693,7 +1693,7 @@ discard block |
||
| 1693 | 1693 | protected function pFaturaDANFE($x, $y) |
| 1694 | 1694 | { |
| 1695 | 1695 | $linha = 1; |
| 1696 | - $h = 8+3; |
|
| 1696 | + $h = 8 + 3; |
|
| 1697 | 1697 | $oldx = $x; |
| 1698 | 1698 | $textoFatura = $this->pGetTextoFatura(); |
| 1699 | 1699 | //verificar se existem duplicatas |
@@ -1714,27 +1714,27 @@ discard block |
||
| 1714 | 1714 | $dupcont = 0; |
| 1715 | 1715 | $nFat = $this->dup->length; |
| 1716 | 1716 | if ($textoFatura !== "" && $this->exibirTextoFatura) { |
| 1717 | - $myH=6; |
|
| 1717 | + $myH = 6; |
|
| 1718 | 1718 | $myW = $this->wPrint; |
| 1719 | 1719 | if ($this->orientacao == 'L') { |
| 1720 | 1720 | $myW -= $this->wCanhoto; |
| 1721 | 1721 | } |
| 1722 | 1722 | $aFont = array('font'=>$this->fontePadrao, 'size'=>8, 'style'=>''); |
| 1723 | 1723 | $this->pTextBox($x, $y, $myW, $myH, $textoFatura, $aFont, 'C', 'L', 1, ''); |
| 1724 | - $y+=$myH+1; |
|
| 1724 | + $y += $myH + 1; |
|
| 1725 | 1725 | } |
| 1726 | 1726 | if ($this->orientacao == 'P') { |
| 1727 | - $w = round($this->wPrint/7.018, 0)-1; |
|
| 1727 | + $w = round($this->wPrint / 7.018, 0) - 1; |
|
| 1728 | 1728 | } else { |
| 1729 | 1729 | $w = 28; |
| 1730 | 1730 | } |
| 1731 | 1731 | $increm = 1; |
| 1732 | 1732 | foreach ($this->dup as $k => $d) { |
| 1733 | - $nDup = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) ? |
|
| 1733 | + $nDup = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) ? |
|
| 1734 | 1734 | $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue : ''; |
| 1735 | - $dDup = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) ? |
|
| 1735 | + $dDup = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) ? |
|
| 1736 | 1736 | $this->pYmd2dmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) : ''; |
| 1737 | - $vDup = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) ? |
|
| 1737 | + $vDup = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) ? |
|
| 1738 | 1738 | 'R$ ' . number_format( |
| 1739 | 1739 | $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue, |
| 1740 | 1740 | 2, |
@@ -1743,14 +1743,14 @@ discard block |
||
| 1743 | 1743 | ) : ''; |
| 1744 | 1744 | $h = 8; |
| 1745 | 1745 | $texto = ''; |
| 1746 | - if ($nDup!='0' && $nDup!='') { |
|
| 1746 | + if ($nDup != '0' && $nDup != '') { |
|
| 1747 | 1747 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1748 | 1748 | $this->pTextBox($x, $y, $w, $h, 'Num.', $aFont, 'T', 'L', 1, ''); |
| 1749 | 1749 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 1750 | 1750 | $this->pTextBox($x, $y, $w, $h, $nDup, $aFont, 'T', 'R', 0, ''); |
| 1751 | 1751 | } else { |
| 1752 | 1752 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1753 | - $this->pTextBox($x, $y, $w, $h, ($dupcont+1)."", $aFont, 'T', 'L', 1, ''); |
|
| 1753 | + $this->pTextBox($x, $y, $w, $h, ($dupcont + 1) . "", $aFont, 'T', 'L', 1, ''); |
|
| 1754 | 1754 | } |
| 1755 | 1755 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1756 | 1756 | $this->pTextBox($x, $y, $w, $h, 'Venc.', $aFont, 'C', 'L', 0, ''); |
@@ -1760,7 +1760,7 @@ discard block |
||
| 1760 | 1760 | $this->pTextBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, ''); |
| 1761 | 1761 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 1762 | 1762 | $this->pTextBox($x, $y, $w, $h, $vDup, $aFont, 'B', 'R', 0, ''); |
| 1763 | - $x += $w+$increm; |
|
| 1763 | + $x += $w + $increm; |
|
| 1764 | 1764 | $dupcont += 1; |
| 1765 | 1765 | if ($this->orientacao == 'P') { |
| 1766 | 1766 | $maxDupCont = 6; |
@@ -1782,10 +1782,10 @@ discard block |
||
| 1782 | 1782 | $y -= 9; |
| 1783 | 1783 | $linha--; |
| 1784 | 1784 | } |
| 1785 | - return ($y+$h); |
|
| 1785 | + return ($y + $h); |
|
| 1786 | 1786 | } else { |
| 1787 | 1787 | $linha = 0; |
| 1788 | - return ($y-2); |
|
| 1788 | + return ($y - 2); |
|
| 1789 | 1789 | } |
| 1790 | 1790 | } //fim da função faturaDANFE |
| 1791 | 1791 | |
@@ -1801,7 +1801,7 @@ discard block |
||
| 1801 | 1801 | protected function pagamentoDANFE($x, $y) |
| 1802 | 1802 | { |
| 1803 | 1803 | $linha = 1; |
| 1804 | - $h = 8+3; |
|
| 1804 | + $h = 8 + 3; |
|
| 1805 | 1805 | $oldx = $x; |
| 1806 | 1806 | //verificar se existem cobranças definidas |
| 1807 | 1807 | if (isset($this->detPag) && $this->detPag->length > 0) { |
@@ -1820,7 +1820,7 @@ discard block |
||
| 1820 | 1820 | $dups = ""; |
| 1821 | 1821 | $dupcont = 0; |
| 1822 | 1822 | if ($this->orientacao == 'P') { |
| 1823 | - $w = round($this->wPrint/7.018, 0)-1; |
|
| 1823 | + $w = round($this->wPrint / 7.018, 0) - 1; |
|
| 1824 | 1824 | } else { |
| 1825 | 1825 | $w = 28; |
| 1826 | 1826 | } |
@@ -1830,16 +1830,16 @@ discard block |
||
| 1830 | 1830 | $maxDupCont = 8; |
| 1831 | 1831 | } |
| 1832 | 1832 | $increm = 1; |
| 1833 | - $formaPagamento = array('01'=>'Dinheiro','02'=>'Cheque','03'=>'Cartão de Crédito', |
|
| 1834 | - '04'=>'Cartão de Débito','05'=>'Crédito Loja','10'=>'Vale Alimentação', |
|
| 1835 | - '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível', |
|
| 1836 | - '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros'); |
|
| 1837 | - $bandeira = array('01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners', |
|
| 1838 | - '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros'); |
|
| 1833 | + $formaPagamento = array('01'=>'Dinheiro', '02'=>'Cheque', '03'=>'Cartão de Crédito', |
|
| 1834 | + '04'=>'Cartão de Débito', '05'=>'Crédito Loja', '10'=>'Vale Alimentação', |
|
| 1835 | + '11'=>'Vale Refeição', '12'=>'Vale Presente', '13'=>'Vale Combustível', |
|
| 1836 | + '14'=>'Duplicata Mercantil', '15'=>'Boleto', '90'=>'Sem pagamento', '99'=>'Outros'); |
|
| 1837 | + $bandeira = array('01'=>'Visa', '02'=>'Mastercard', '03'=>'American', '04'=>'Sorocred', '05'=>'Diners', |
|
| 1838 | + '06'=>'Elo', '07'=>'Hipercard', '08'=>'Aura', '09'=>'Cabal', '99'=>'Outros'); |
|
| 1839 | 1839 | foreach ($this->detPag as $k => $d) { |
| 1840 | 1840 | $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
| 1841 | 1841 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue : '0'; |
| 1842 | - $vPag = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
| 1842 | + $vPag = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
| 1843 | 1843 | ? 'R$ ' . number_format( |
| 1844 | 1844 | $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue, |
| 1845 | 1845 | 2, |
@@ -1850,7 +1850,7 @@ discard block |
||
| 1850 | 1850 | $texto = ''; |
| 1851 | 1851 | if (isset($formaPagamento[$fPag])) { |
| 1852 | 1852 | /*Exibir Item sem pagamento ou outros?*/ |
| 1853 | - if ($fPag=='90' || $fPag=='99') { |
|
| 1853 | + if ($fPag == '90' || $fPag == '99') { |
|
| 1854 | 1854 | continue; |
| 1855 | 1855 | } |
| 1856 | 1856 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
@@ -1859,16 +1859,16 @@ discard block |
||
| 1859 | 1859 | $this->pTextBox($x, $y, $w, $h, $formaPagamento[$fPag], $aFont, 'T', 'R', 0, ''); |
| 1860 | 1860 | } else { |
| 1861 | 1861 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
| 1862 | - $this->pTextBox($x, $y, $w, $h, "Forma ".$fPag." não encontrado", $aFont, 'T', 'L', 1, ''); |
|
| 1862 | + $this->pTextBox($x, $y, $w, $h, "Forma " . $fPag . " não encontrado", $aFont, 'T', 'L', 1, ''); |
|
| 1863 | 1863 | } |
| 1864 | 1864 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 1865 | 1865 | $this->pTextBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, ''); |
| 1866 | 1866 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 1867 | 1867 | $this->pTextBox($x, $y, $w, $h, $vPag, $aFont, 'B', 'R', 0, ''); |
| 1868 | - $x += $w+$increm; |
|
| 1868 | + $x += $w + $increm; |
|
| 1869 | 1869 | $dupcont += 1; |
| 1870 | 1870 | |
| 1871 | - if ($dupcont>$maxDupCont) { |
|
| 1871 | + if ($dupcont > $maxDupCont) { |
|
| 1872 | 1872 | $y += 9; |
| 1873 | 1873 | $x = $oldx; |
| 1874 | 1874 | $dupcont = 0; |
@@ -1883,10 +1883,10 @@ discard block |
||
| 1883 | 1883 | $y -= 9; |
| 1884 | 1884 | $linha--; |
| 1885 | 1885 | } |
| 1886 | - return ($y+$h); |
|
| 1886 | + return ($y + $h); |
|
| 1887 | 1887 | } else { |
| 1888 | 1888 | $linha = 0; |
| 1889 | - return ($y-2); |
|
| 1889 | + return ($y - 2); |
|
| 1890 | 1890 | } |
| 1891 | 1891 | } //fim da função pagamentoDANFE |
| 1892 | 1892 | |
@@ -1998,7 +1998,7 @@ discard block |
||
| 1998 | 1998 | } |
| 1999 | 1999 | $x = $this->pImpostoDanfeHelper($x, $y, $w, $h, "V. TOTAL DA NOTA", "vNF"); |
| 2000 | 2000 | |
| 2001 | - return ($y+$h); |
|
| 2001 | + return ($y + $h); |
|
| 2002 | 2002 | } //fim impostoDANFE |
| 2003 | 2003 | |
| 2004 | 2004 | /** |
@@ -2026,13 +2026,13 @@ discard block |
||
| 2026 | 2026 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 2027 | 2027 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2028 | 2028 | //NOME / RAZÃO SOCIAL |
| 2029 | - $w1 = $maxW*0.29; |
|
| 2029 | + $w1 = $maxW * 0.29; |
|
| 2030 | 2030 | $y += 3; |
| 2031 | 2031 | $texto = 'NOME / RAZÃO SOCIAL'; |
| 2032 | 2032 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2033 | 2033 | $this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2034 | 2034 | if (isset($this->transporta)) { |
| 2035 | - $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) ? |
|
| 2035 | + $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) ? |
|
| 2036 | 2036 | $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue : ''; |
| 2037 | 2037 | } else { |
| 2038 | 2038 | $texto = ''; |
@@ -2041,11 +2041,11 @@ discard block |
||
| 2041 | 2041 | $this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 2042 | 2042 | //FRETE POR CONTA |
| 2043 | 2043 | $x += $w1; |
| 2044 | - $w2 = $maxW*0.15; |
|
| 2044 | + $w2 = $maxW * 0.15; |
|
| 2045 | 2045 | $texto = 'FRETE'; |
| 2046 | 2046 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2047 | 2047 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2048 | - $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) ? |
|
| 2048 | + $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) ? |
|
| 2049 | 2049 | $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue : '0'; |
| 2050 | 2050 | switch ($tipoFrete) { |
| 2051 | 2051 | case 0: |
@@ -2075,7 +2075,7 @@ discard block |
||
| 2075 | 2075 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2076 | 2076 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2077 | 2077 | if (isset($this->veicTransp)) { |
| 2078 | - $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) ? |
|
| 2078 | + $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) ? |
|
| 2079 | 2079 | $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue : ''; |
| 2080 | 2080 | } else { |
| 2081 | 2081 | $texto = ''; |
@@ -2088,10 +2088,10 @@ discard block |
||
| 2088 | 2088 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2089 | 2089 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2090 | 2090 | if (isset($this->veicTransp)) { |
| 2091 | - $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
| 2091 | + $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
| 2092 | 2092 | $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue : ''; |
| 2093 | 2093 | } elseif (isset($this->reboque)) { |
| 2094 | - $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
| 2094 | + $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
| 2095 | 2095 | $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue : ''; |
| 2096 | 2096 | } else { |
| 2097 | 2097 | $texto = ''; |
@@ -2100,15 +2100,15 @@ discard block |
||
| 2100 | 2100 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2101 | 2101 | //UF |
| 2102 | 2102 | $x += $w2; |
| 2103 | - $w3 = round($maxW*0.04, 0); |
|
| 2103 | + $w3 = round($maxW * 0.04, 0); |
|
| 2104 | 2104 | $texto = 'UF'; |
| 2105 | 2105 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2106 | 2106 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2107 | 2107 | if (isset($this->veicTransp)) { |
| 2108 | - $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2108 | + $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2109 | 2109 | $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue : ''; |
| 2110 | 2110 | } elseif (isset($this->reboque)) { |
| 2111 | - $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2111 | + $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2112 | 2112 | $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue : ''; |
| 2113 | 2113 | } else { |
| 2114 | 2114 | $texto = ''; |
@@ -2117,18 +2117,18 @@ discard block |
||
| 2117 | 2117 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2118 | 2118 | //CNPJ / CPF |
| 2119 | 2119 | $x += $w3; |
| 2120 | - $w = $maxW-($w1+3*$w2+$w3); |
|
| 2120 | + $w = $maxW - ($w1 + 3 * $w2 + $w3); |
|
| 2121 | 2121 | $texto = 'CNPJ / CPF'; |
| 2122 | 2122 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2123 | 2123 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2124 | 2124 | if (isset($this->transporta)) { |
| 2125 | - $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) ? |
|
| 2125 | + $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) ? |
|
| 2126 | 2126 | $this->pFormat( |
| 2127 | 2127 | $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 2128 | 2128 | "##.###.###/####-##" |
| 2129 | 2129 | ) : ''; |
| 2130 | 2130 | if ($texto == '') { |
| 2131 | - $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 2131 | + $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 2132 | 2132 | $this->pFormat( |
| 2133 | 2133 | $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 2134 | 2134 | "###.###.###-##" |
@@ -2144,12 +2144,12 @@ discard block |
||
| 2144 | 2144 | $y += $h; |
| 2145 | 2145 | $x = $oldX; |
| 2146 | 2146 | $h = 7; |
| 2147 | - $w1 = $maxW*0.44; |
|
| 2147 | + $w1 = $maxW * 0.44; |
|
| 2148 | 2148 | $texto = 'ENDEREÇO'; |
| 2149 | 2149 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2150 | 2150 | $this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2151 | 2151 | if (isset($this->transporta)) { |
| 2152 | - $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) ? |
|
| 2152 | + $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) ? |
|
| 2153 | 2153 | $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue : ''; |
| 2154 | 2154 | } else { |
| 2155 | 2155 | $texto = ''; |
@@ -2158,12 +2158,12 @@ discard block |
||
| 2158 | 2158 | $this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 2159 | 2159 | //MUNICÍPIO |
| 2160 | 2160 | $x += $w1; |
| 2161 | - $w2 = round($maxW*0.30, 0); |
|
| 2161 | + $w2 = round($maxW * 0.30, 0); |
|
| 2162 | 2162 | $texto = 'MUNICÍPIO'; |
| 2163 | 2163 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2164 | 2164 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2165 | 2165 | if (isset($this->transporta)) { |
| 2166 | - $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) ? |
|
| 2166 | + $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) ? |
|
| 2167 | 2167 | $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue : ''; |
| 2168 | 2168 | } else { |
| 2169 | 2169 | $texto = ''; |
@@ -2172,12 +2172,12 @@ discard block |
||
| 2172 | 2172 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2173 | 2173 | //UF |
| 2174 | 2174 | $x += $w2; |
| 2175 | - $w3 = round($maxW*0.04, 0); |
|
| 2175 | + $w3 = round($maxW * 0.04, 0); |
|
| 2176 | 2176 | $texto = 'UF'; |
| 2177 | 2177 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2178 | 2178 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2179 | 2179 | if (isset($this->transporta)) { |
| 2180 | - $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2180 | + $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2181 | 2181 | $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue : ''; |
| 2182 | 2182 | } else { |
| 2183 | 2183 | $texto = ''; |
@@ -2186,13 +2186,13 @@ discard block |
||
| 2186 | 2186 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2187 | 2187 | //INSCRIÇÃO ESTADUAL |
| 2188 | 2188 | $x += $w3; |
| 2189 | - $w = $maxW-($w1+$w2+$w3); |
|
| 2189 | + $w = $maxW - ($w1 + $w2 + $w3); |
|
| 2190 | 2190 | $texto = 'INSCRIÇÃO ESTADUAL'; |
| 2191 | 2191 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2192 | 2192 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2193 | 2193 | $texto = ''; |
| 2194 | 2194 | if (isset($this->transporta)) { |
| 2195 | - if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
| 2195 | + if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
| 2196 | 2196 | $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue; |
| 2197 | 2197 | } |
| 2198 | 2198 | } |
@@ -2205,16 +2205,16 @@ discard block |
||
| 2205 | 2205 | $marca = ''; |
| 2206 | 2206 | $numero = ''; |
| 2207 | 2207 | $texto = ''; |
| 2208 | - $pesoBruto=0; |
|
| 2209 | - $pesoLiquido=0; |
|
| 2208 | + $pesoBruto = 0; |
|
| 2209 | + $pesoLiquido = 0; |
|
| 2210 | 2210 | foreach ($volumes as $volume) { |
| 2211 | - $quantidade += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
| 2211 | + $quantidade += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
| 2212 | 2212 | $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0; |
| 2213 | - $pesoBruto += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
| 2213 | + $pesoBruto += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
| 2214 | 2214 | $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0; |
| 2215 | - $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
| 2215 | + $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
| 2216 | 2216 | $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0; |
| 2217 | - $texto = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
| 2217 | + $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
| 2218 | 2218 | $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : ''; |
| 2219 | 2219 | if ($texto != $especie && $especie != '') { |
| 2220 | 2220 | //tem várias especies |
@@ -2222,7 +2222,7 @@ discard block |
||
| 2222 | 2222 | } else { |
| 2223 | 2223 | $especie = $texto; |
| 2224 | 2224 | } |
| 2225 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2225 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2226 | 2226 | $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : ''; |
| 2227 | 2227 | if ($texto != $marca && $marca != '') { |
| 2228 | 2228 | //tem várias especies |
@@ -2230,7 +2230,7 @@ discard block |
||
| 2230 | 2230 | } else { |
| 2231 | 2231 | $marca = $texto; |
| 2232 | 2232 | } |
| 2233 | - $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) ? |
|
| 2233 | + $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) ? |
|
| 2234 | 2234 | $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue : ''; |
| 2235 | 2235 | if ($texto != $numero && $numero != '') { |
| 2236 | 2236 | //tem várias especies |
@@ -2245,7 +2245,7 @@ discard block |
||
| 2245 | 2245 | $y += $h; |
| 2246 | 2246 | $x = $oldX; |
| 2247 | 2247 | $h = 7; |
| 2248 | - $w1 = round($maxW*0.10, 0); |
|
| 2248 | + $w1 = round($maxW * 0.10, 0); |
|
| 2249 | 2249 | $texto = 'QUANTIDADE'; |
| 2250 | 2250 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2251 | 2251 | $this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2256,7 +2256,7 @@ discard block |
||
| 2256 | 2256 | } |
| 2257 | 2257 | //ESPÉCIE |
| 2258 | 2258 | $x += $w1; |
| 2259 | - $w2 = round($maxW*0.17, 0); |
|
| 2259 | + $w2 = round($maxW * 0.17, 0); |
|
| 2260 | 2260 | $texto = 'ESPÉCIE'; |
| 2261 | 2261 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2262 | 2262 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2268,7 +2268,7 @@ discard block |
||
| 2268 | 2268 | $texto = 'MARCA'; |
| 2269 | 2269 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2270 | 2270 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2271 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2271 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2272 | 2272 | $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : ''; |
| 2273 | 2273 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
| 2274 | 2274 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -2282,7 +2282,7 @@ discard block |
||
| 2282 | 2282 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2283 | 2283 | //PESO BRUTO |
| 2284 | 2284 | $x += $w2; |
| 2285 | - $w3 = round($maxW*0.20, 0); |
|
| 2285 | + $w3 = round($maxW * 0.20, 0); |
|
| 2286 | 2286 | $texto = 'PESO BRUTO'; |
| 2287 | 2287 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2288 | 2288 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2295,7 +2295,7 @@ discard block |
||
| 2295 | 2295 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 2296 | 2296 | //PESO LÍQUIDO |
| 2297 | 2297 | $x += $w3; |
| 2298 | - $w = $maxW -($w1+3*$w2+$w3); |
|
| 2298 | + $w = $maxW - ($w1 + 3 * $w2 + $w3); |
|
| 2299 | 2299 | $texto = 'PESO LÍQUIDO'; |
| 2300 | 2300 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2301 | 2301 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2306,7 +2306,7 @@ discard block |
||
| 2306 | 2306 | } |
| 2307 | 2307 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
| 2308 | 2308 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 2309 | - return ($y+$h); |
|
| 2309 | + return ($y + $h); |
|
| 2310 | 2310 | } //fim transporteDANFE |
| 2311 | 2311 | |
| 2312 | 2312 | |
@@ -2318,7 +2318,7 @@ discard block |
||
| 2318 | 2318 | return ""; |
| 2319 | 2319 | } |
| 2320 | 2320 | $valor_original = $valor_original->nodeValue; |
| 2321 | - $valor = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
| 2321 | + $valor = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
| 2322 | 2322 | |
| 2323 | 2323 | if ($valor != "") { |
| 2324 | 2324 | return sprintf($formato, $valor); |
@@ -2362,13 +2362,13 @@ discard block |
||
| 2362 | 2362 | $impostos .= $this->pDescricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s"); |
| 2363 | 2363 | $impostos .= $this->pDescricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s"); |
| 2364 | 2364 | } |
| 2365 | - $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) ? |
|
| 2365 | + $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) ? |
|
| 2366 | 2366 | substr($this->pAnfavea($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue), 0, 500) : ''; |
| 2367 | - if (! empty($infAdProd)) { |
|
| 2367 | + if (!empty($infAdProd)) { |
|
| 2368 | 2368 | $infAdProd = trim($infAdProd); |
| 2369 | 2369 | $infAdProd .= ' '; |
| 2370 | 2370 | } |
| 2371 | - $loteTxt =''; |
|
| 2371 | + $loteTxt = ''; |
|
| 2372 | 2372 | $rastro = $prod->getElementsByTagName("med"); |
| 2373 | 2373 | if (!isset($rastro)) { |
| 2374 | 2374 | $rastro = $prod->getElementsByTagName("rastro"); |
@@ -2384,14 +2384,14 @@ discard block |
||
| 2384 | 2384 | $i++; |
| 2385 | 2385 | } |
| 2386 | 2386 | if ($loteTxt != '') { |
| 2387 | - $loteTxt.= ' '; |
|
| 2387 | + $loteTxt .= ' '; |
|
| 2388 | 2388 | } |
| 2389 | 2389 | } |
| 2390 | 2390 | //NT2013.006 FCI |
| 2391 | - $nFCI = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
| 2392 | - ' FCI:'.$itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
|
| 2393 | - $tmp_ad=$infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
|
| 2394 | - $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue . (strlen($tmp_ad)!=0?"\n ".$tmp_ad:''); |
|
| 2391 | + $nFCI = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
| 2392 | + ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
|
| 2393 | + $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
|
| 2394 | + $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue . (strlen($tmp_ad) != 0 ? "\n " . $tmp_ad : ''); |
|
| 2395 | 2395 | if ($this->descProdQuebraLinha) { |
| 2396 | 2396 | $texto = str_replace(";", "\n", $texto); |
| 2397 | 2397 | } |
@@ -2439,104 +2439,104 @@ discard block |
||
| 2439 | 2439 | // cabecalho LOOP COM OS DADOS DOS PRODUTOS |
| 2440 | 2440 | //CÓDIGO PRODUTO |
| 2441 | 2441 | $texto = "CÓDIGO PRODUTO"; |
| 2442 | - $w1 = round($w*0.09, 0); |
|
| 2442 | + $w1 = round($w * 0.09, 0); |
|
| 2443 | 2443 | $h = 4; |
| 2444 | 2444 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2445 | 2445 | $this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2446 | - $this->pdf->Line($x+$w1, $y, $x+$w1, $y+$hmax); |
|
| 2446 | + $this->pdf->Line($x + $w1, $y, $x + $w1, $y + $hmax); |
|
| 2447 | 2447 | //DESCRIÇÃO DO PRODUTO / SERVIÇO |
| 2448 | 2448 | $x += $w1; |
| 2449 | - $w2 = round($w*0.28, 0); |
|
| 2449 | + $w2 = round($w * 0.28, 0); |
|
| 2450 | 2450 | $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO'; |
| 2451 | 2451 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2452 | 2452 | $this->pTextBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2453 | - $this->pdf->Line($x+$w2, $y, $x+$w2, $y+$hmax); |
|
| 2453 | + $this->pdf->Line($x + $w2, $y, $x + $w2, $y + $hmax); |
|
| 2454 | 2454 | //NCM/SH |
| 2455 | 2455 | $x += $w2; |
| 2456 | - $w3 = round($w*0.06, 0); |
|
| 2456 | + $w3 = round($w * 0.06, 0); |
|
| 2457 | 2457 | $texto = 'NCM/SH'; |
| 2458 | 2458 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2459 | 2459 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2460 | - $this->pdf->Line($x+$w3, $y, $x+$w3, $y+$hmax); |
|
| 2460 | + $this->pdf->Line($x + $w3, $y, $x + $w3, $y + $hmax); |
|
| 2461 | 2461 | //O/CST ou O/CSOSN |
| 2462 | 2462 | $x += $w3; |
| 2463 | - $w4 = round($w*0.05, 0); |
|
| 2464 | - $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2 |
|
| 2463 | + $w4 = round($w * 0.05, 0); |
|
| 2464 | + $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 ou CRT = 2 |
|
| 2465 | 2465 | if ($this->getTagValue($this->emit, 'CRT') == '3') { |
| 2466 | - $texto = 'O/CST';//Regime Normal |
|
| 2466 | + $texto = 'O/CST'; //Regime Normal |
|
| 2467 | 2467 | } |
| 2468 | 2468 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2469 | 2469 | $this->pTextBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2470 | - $this->pdf->Line($x+$w4, $y, $x+$w4, $y+$hmax); |
|
| 2470 | + $this->pdf->Line($x + $w4, $y, $x + $w4, $y + $hmax); |
|
| 2471 | 2471 | //CFOP |
| 2472 | 2472 | $x += $w4; |
| 2473 | - $w5 = round($w*0.04, 0); |
|
| 2473 | + $w5 = round($w * 0.04, 0); |
|
| 2474 | 2474 | $texto = 'CFOP'; |
| 2475 | 2475 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2476 | 2476 | $this->pTextBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2477 | - $this->pdf->Line($x+$w5, $y, $x+$w5, $y+$hmax); |
|
| 2477 | + $this->pdf->Line($x + $w5, $y, $x + $w5, $y + $hmax); |
|
| 2478 | 2478 | //UN |
| 2479 | 2479 | $x += $w5; |
| 2480 | - $w6 = round($w*0.03, 0); |
|
| 2480 | + $w6 = round($w * 0.03, 0); |
|
| 2481 | 2481 | $texto = 'UN'; |
| 2482 | 2482 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2483 | 2483 | $this->pTextBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2484 | - $this->pdf->Line($x+$w6, $y, $x+$w6, $y+$hmax); |
|
| 2484 | + $this->pdf->Line($x + $w6, $y, $x + $w6, $y + $hmax); |
|
| 2485 | 2485 | //QUANT |
| 2486 | 2486 | $x += $w6; |
| 2487 | - $w7 = round($w*0.07, 0); |
|
| 2487 | + $w7 = round($w * 0.07, 0); |
|
| 2488 | 2488 | $texto = 'QUANT'; |
| 2489 | 2489 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2490 | 2490 | $this->pTextBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2491 | - $this->pdf->Line($x+$w7, $y, $x+$w7, $y+$hmax); |
|
| 2491 | + $this->pdf->Line($x + $w7, $y, $x + $w7, $y + $hmax); |
|
| 2492 | 2492 | //VALOR UNIT |
| 2493 | 2493 | $x += $w7; |
| 2494 | - $w8 = round($w*0.06, 0); |
|
| 2494 | + $w8 = round($w * 0.06, 0); |
|
| 2495 | 2495 | $texto = 'VALOR UNIT'; |
| 2496 | 2496 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2497 | 2497 | $this->pTextBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2498 | - $this->pdf->Line($x+$w8, $y, $x+$w8, $y+$hmax); |
|
| 2498 | + $this->pdf->Line($x + $w8, $y, $x + $w8, $y + $hmax); |
|
| 2499 | 2499 | //VALOR TOTAL |
| 2500 | 2500 | $x += $w8; |
| 2501 | - $w9 = round($w*0.06, 0); |
|
| 2501 | + $w9 = round($w * 0.06, 0); |
|
| 2502 | 2502 | $texto = 'VALOR TOTAL'; |
| 2503 | 2503 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2504 | 2504 | $this->pTextBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2505 | - $this->pdf->Line($x+$w9, $y, $x+$w9, $y+$hmax); |
|
| 2505 | + $this->pdf->Line($x + $w9, $y, $x + $w9, $y + $hmax); |
|
| 2506 | 2506 | //B.CÁLC ICMS |
| 2507 | 2507 | $x += $w9; |
| 2508 | - $w10 = round($w*0.06, 0); |
|
| 2508 | + $w10 = round($w * 0.06, 0); |
|
| 2509 | 2509 | $texto = 'B.CÁLC ICMS'; |
| 2510 | 2510 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2511 | 2511 | $this->pTextBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2512 | - $this->pdf->Line($x+$w10, $y, $x+$w10, $y+$hmax); |
|
| 2512 | + $this->pdf->Line($x + $w10, $y, $x + $w10, $y + $hmax); |
|
| 2513 | 2513 | //VALOR ICMS |
| 2514 | 2514 | $x += $w10; |
| 2515 | - $w11 = round($w*0.06, 0); |
|
| 2515 | + $w11 = round($w * 0.06, 0); |
|
| 2516 | 2516 | $texto = 'VALOR ICMS'; |
| 2517 | 2517 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2518 | 2518 | $this->pTextBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2519 | - $this->pdf->Line($x+$w11, $y, $x+$w11, $y+$hmax); |
|
| 2519 | + $this->pdf->Line($x + $w11, $y, $x + $w11, $y + $hmax); |
|
| 2520 | 2520 | //VALOR IPI |
| 2521 | 2521 | $x += $w11; |
| 2522 | - $w12 = round($w*0.05, 0); |
|
| 2522 | + $w12 = round($w * 0.05, 0); |
|
| 2523 | 2523 | $texto = 'VALOR IPI'; |
| 2524 | 2524 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2525 | 2525 | $this->pTextBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2526 | - $this->pdf->Line($x+$w12, $y, $x+$w12, $y+$hmax); |
|
| 2526 | + $this->pdf->Line($x + $w12, $y, $x + $w12, $y + $hmax); |
|
| 2527 | 2527 | //ALÍQ. ICMS |
| 2528 | 2528 | $x += $w12; |
| 2529 | - $w13 = round($w*0.035, 0); |
|
| 2529 | + $w13 = round($w * 0.035, 0); |
|
| 2530 | 2530 | $texto = 'ALÍQ. ICMS'; |
| 2531 | 2531 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2532 | 2532 | $this->pTextBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2533 | - $this->pdf->Line($x+$w13, $y, $x+$w13, $y+$hmax); |
|
| 2533 | + $this->pdf->Line($x + $w13, $y, $x + $w13, $y + $hmax); |
|
| 2534 | 2534 | //ALÍQ. IPI |
| 2535 | 2535 | $x += $w13; |
| 2536 | - $w14 = $w-($w1+$w2+$w3+$w4+$w5+$w6+$w7+$w8+$w9+$w10+$w11+$w12+$w13); |
|
| 2536 | + $w14 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13); |
|
| 2537 | 2537 | $texto = 'ALÍQ. IPI'; |
| 2538 | 2538 | $this->pTextBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2539 | - $this->pdf->Line($oldX, $y+$h+1, $oldX + $w, $y+$h+1); |
|
| 2539 | + $this->pdf->Line($oldX, $y + $h + 1, $oldX + $w, $y + $h + 1); |
|
| 2540 | 2540 | $y += 5; |
| 2541 | 2541 | //################################################################################## |
| 2542 | 2542 | // LOOP COM OS DADOS DOS PRODUTOS |
@@ -2553,7 +2553,7 @@ discard block |
||
| 2553 | 2553 | $IPI = $imposto->getElementsByTagName("IPI")->item(0); |
| 2554 | 2554 | $textoProduto = $this->pDescricaoProduto($thisItem); |
| 2555 | 2555 | $linhaDescr = $this->pGetNumLines($textoProduto, $w2, $aFont); |
| 2556 | - $h = round(($linhaDescr * $this->pdf->fontSize)+ ($linhaDescr * 0.5), 2); |
|
| 2556 | + $h = round(($linhaDescr * $this->pdf->fontSize) + ($linhaDescr * 0.5), 2); |
|
| 2557 | 2557 | $hUsado += $h; |
| 2558 | 2558 | if ($pag != $totpag) { |
| 2559 | 2559 | if ($hUsado >= $hmax && $i < $totItens) { |
@@ -2563,11 +2563,11 @@ discard block |
||
| 2563 | 2563 | break; |
| 2564 | 2564 | } |
| 2565 | 2565 | } |
| 2566 | - $y_linha=$y+$h; |
|
| 2566 | + $y_linha = $y + $h; |
|
| 2567 | 2567 | // linha entre itens |
| 2568 | 2568 | $this->pdf->DashedHLine($oldX, $y_linha, $w, 0.1, 120); |
| 2569 | 2569 | //corrige o x |
| 2570 | - $x=$oldX; |
|
| 2570 | + $x = $oldX; |
|
| 2571 | 2571 | //codigo do produto |
| 2572 | 2572 | $texto = $prod->getElementsByTagName("cProd")->item(0)->nodeValue; |
| 2573 | 2573 | $this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'C', 0, ''); |
@@ -2580,16 +2580,16 @@ discard block |
||
| 2580 | 2580 | } |
| 2581 | 2581 | $x += $w2; |
| 2582 | 2582 | //NCM |
| 2583 | - $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
| 2583 | + $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
| 2584 | 2584 | $prod->getElementsByTagName("NCM")->item(0)->nodeValue : ''; |
| 2585 | 2585 | $this->pTextBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2586 | 2586 | $x += $w3; |
| 2587 | 2587 | //CST |
| 2588 | 2588 | if (isset($ICMS)) { |
| 2589 | - $origem = $this->getTagValue($ICMS, "orig"); |
|
| 2590 | - $cst = $this->getTagValue($ICMS, "CST"); |
|
| 2591 | - $csosn = $this->getTagValue($ICMS, "CSOSN"); |
|
| 2592 | - $texto = $origem.$cst.$csosn; |
|
| 2589 | + $origem = $this->getTagValue($ICMS, "orig"); |
|
| 2590 | + $cst = $this->getTagValue($ICMS, "CST"); |
|
| 2591 | + $csosn = $this->getTagValue($ICMS, "CSOSN"); |
|
| 2592 | + $texto = $origem . $cst . $csosn; |
|
| 2593 | 2593 | $this->pTextBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2594 | 2594 | } |
| 2595 | 2595 | //CFOP |
@@ -2623,7 +2623,7 @@ discard block |
||
| 2623 | 2623 | //Valor da Base de calculo |
| 2624 | 2624 | $x += $w9; |
| 2625 | 2625 | if (isset($ICMS)) { |
| 2626 | - $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 2626 | + $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 2627 | 2627 | number_format( |
| 2628 | 2628 | $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue, |
| 2629 | 2629 | 2, |
@@ -2635,7 +2635,7 @@ discard block |
||
| 2635 | 2635 | //Valor do ICMS |
| 2636 | 2636 | $x += $w10; |
| 2637 | 2637 | if (isset($ICMS)) { |
| 2638 | - $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ? |
|
| 2638 | + $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ? |
|
| 2639 | 2639 | number_format( |
| 2640 | 2640 | $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue, |
| 2641 | 2641 | 2, |
@@ -2647,8 +2647,8 @@ discard block |
||
| 2647 | 2647 | //Valor do IPI |
| 2648 | 2648 | $x += $w11; |
| 2649 | 2649 | if (isset($IPI)) { |
| 2650 | - $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) ? |
|
| 2651 | - number_format($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, 2, ",", ".") :''; |
|
| 2650 | + $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) ? |
|
| 2651 | + number_format($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, 2, ",", ".") : ''; |
|
| 2652 | 2652 | } else { |
| 2653 | 2653 | $texto = ''; |
| 2654 | 2654 | } |
@@ -2656,7 +2656,7 @@ discard block |
||
| 2656 | 2656 | // %ICMS |
| 2657 | 2657 | $x += $w12; |
| 2658 | 2658 | if (isset($ICMS)) { |
| 2659 | - $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ? |
|
| 2659 | + $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ? |
|
| 2660 | 2660 | number_format( |
| 2661 | 2661 | $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue, |
| 2662 | 2662 | 2, |
@@ -2668,7 +2668,7 @@ discard block |
||
| 2668 | 2668 | //%IPI |
| 2669 | 2669 | $x += $w13; |
| 2670 | 2670 | if (isset($IPI)) { |
| 2671 | - $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) ? |
|
| 2671 | + $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) ? |
|
| 2672 | 2672 | number_format($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue, 2, ",", ".") : ''; |
| 2673 | 2673 | } else { |
| 2674 | 2674 | $texto = ''; |
@@ -2693,7 +2693,7 @@ discard block |
||
| 2693 | 2693 | $i++; |
| 2694 | 2694 | } |
| 2695 | 2695 | } |
| 2696 | - return $oldY+$hmax; |
|
| 2696 | + return $oldY + $hmax; |
|
| 2697 | 2697 | } |
| 2698 | 2698 | |
| 2699 | 2699 | |
@@ -2727,7 +2727,7 @@ discard block |
||
| 2727 | 2727 | |
| 2728 | 2728 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
| 2729 | 2729 | |
| 2730 | - $w1 = round($w*0.09, 0); |
|
| 2730 | + $w1 = round($w * 0.09, 0); |
|
| 2731 | 2731 | |
| 2732 | 2732 | // Tabela Renavam Combustivel |
| 2733 | 2733 | $renavamCombustivel = array( |
@@ -2825,54 +2825,54 @@ discard block |
||
| 2825 | 2825 | |
| 2826 | 2826 | $yVeic = $y + $h; |
| 2827 | 2827 | $texto = 'Chassi: ............: ' . $veiculoChassi; |
| 2828 | - $this->pTextBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2828 | + $this->pTextBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2829 | 2829 | $yVeic += $h; |
| 2830 | 2830 | $texto = 'Cor...................: ' . $veiculoCor; |
| 2831 | - $this->pTextBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2831 | + $this->pTextBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2832 | 2832 | $yVeic += $h; |
| 2833 | 2833 | $texto = 'Cilindrada........: ' . $veiculoCilindrada; |
| 2834 | - $this->pTextBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2834 | + $this->pTextBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2835 | 2835 | $yVeic += $h; |
| 2836 | 2836 | $texto = 'Cmkg...............: ' . $veiculoCmkg; |
| 2837 | - $this->pTextBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2837 | + $this->pTextBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2838 | 2838 | $yVeic += $h; |
| 2839 | 2839 | $texto = 'Tipo.................: ' . $renavamTiposVeiculos[intval($veiculoTipo)]; |
| 2840 | - $this->pTextBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2840 | + $this->pTextBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2841 | 2841 | $yVeic = $y + $h; |
| 2842 | 2842 | $xVeic = $x + 65; |
| 2843 | 2843 | $texto = 'Nº Motor: .........: ' . $veiculoMotor; |
| 2844 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2844 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2845 | 2845 | $yVeic += $h; |
| 2846 | 2846 | $texto = 'Renavam...........: ' . $veiculoRenavam; |
| 2847 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2847 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2848 | 2848 | $yVeic += $h; |
| 2849 | 2849 | $texto = 'HP.....................: ' . $veiculoHp; |
| 2850 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2850 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2851 | 2851 | $yVeic += $h; |
| 2852 | 2852 | $texto = 'Placa.................: ' . $veiculoPlaca; |
| 2853 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2853 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2854 | 2854 | $yVeic += $h; |
| 2855 | 2855 | $texto = 'Tipo Pintura......: ' . $renavamTipoPintura[$veiculoTipoPintura]; |
| 2856 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2856 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2857 | 2857 | $yVeic = $y + $h; |
| 2858 | 2858 | $xVeic = $xVeic + 55; |
| 2859 | 2859 | $texto = 'Marca / Modelo.....: ' . $veiculoMarcaModelo; |
| 2860 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2860 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2861 | 2861 | $yVeic += $h; |
| 2862 | 2862 | $texto = 'Especie..................: ' . $renavamEspecie[intval($veiculoEspecie)]; |
| 2863 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2863 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2864 | 2864 | $yVeic += $h; |
| 2865 | 2865 | $texto = 'Combustivel..........: ' . $renavamCombustivel[intval($veiculoCombustivel)]; |
| 2866 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2866 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2867 | 2867 | $yVeic += $h; |
| 2868 | 2868 | $texto = 'Serial.....................: ' . $veiculoSerial; |
| 2869 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2869 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2870 | 2870 | $yVeic += $h; |
| 2871 | - $texto = 'Ano Fab/Mod........: '. $veiculoFabricacao . '/' . $veiculoModelo; |
|
| 2872 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2871 | + $texto = 'Ano Fab/Mod........: ' . $veiculoFabricacao . '/' . $veiculoModelo; |
|
| 2872 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2873 | 2873 | $yVeic += $h; |
| 2874 | - $texto = 'Distancia Entre Eixos(mm)..: '. $veiculoDistancia; |
|
| 2875 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2874 | + $texto = 'Distancia Entre Eixos(mm)..: ' . $veiculoDistancia; |
|
| 2875 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2876 | 2876 | } |
| 2877 | 2877 | |
| 2878 | 2878 | /** |
@@ -2896,12 +2896,12 @@ discard block |
||
| 2896 | 2896 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2897 | 2897 | //INSCRIÇÃO MUNICIPAL |
| 2898 | 2898 | $y += 3; |
| 2899 | - $w = round($this->wPrint*0.23, 0); |
|
| 2899 | + $w = round($this->wPrint * 0.23, 0); |
|
| 2900 | 2900 | $texto = 'INSCRIÇÃO MUNICIPAL'; |
| 2901 | 2901 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2902 | 2902 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2903 | 2903 | //inscrição municipal |
| 2904 | - $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
| 2904 | + $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
| 2905 | 2905 | $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : ''; |
| 2906 | 2906 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
| 2907 | 2907 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -2911,7 +2911,7 @@ discard block |
||
| 2911 | 2911 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2912 | 2912 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2913 | 2913 | if (isset($this->ISSQNtot)) { |
| 2914 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
| 2914 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
| 2915 | 2915 | $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : ''; |
| 2916 | 2916 | $texto = number_format($texto, 2, ",", "."); |
| 2917 | 2917 | } else { |
@@ -2925,9 +2925,9 @@ discard block |
||
| 2925 | 2925 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2926 | 2926 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2927 | 2927 | if (isset($this->ISSQNtot)) { |
| 2928 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 2928 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 2929 | 2929 | $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : ''; |
| 2930 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 2930 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 2931 | 2931 | } else { |
| 2932 | 2932 | $texto = ''; |
| 2933 | 2933 | } |
@@ -2938,21 +2938,21 @@ discard block |
||
| 2938 | 2938 | if ($this->orientacao == 'P') { |
| 2939 | 2939 | $w = $this->wPrint - (3 * $w); |
| 2940 | 2940 | } else { |
| 2941 | - $w = $this->wPrint - (3 * $w)-$this->wCanhoto; |
|
| 2941 | + $w = $this->wPrint - (3 * $w) - $this->wCanhoto; |
|
| 2942 | 2942 | } |
| 2943 | 2943 | $texto = 'VALOR TOTAL DO ISSQN'; |
| 2944 | 2944 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 2945 | 2945 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2946 | 2946 | if (isset($this->ISSQNtot)) { |
| 2947 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
| 2947 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
| 2948 | 2948 | $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : ''; |
| 2949 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 2949 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 2950 | 2950 | } else { |
| 2951 | 2951 | $texto = ''; |
| 2952 | 2952 | } |
| 2953 | 2953 | $aFont = array('font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B'); |
| 2954 | 2954 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 2955 | - return ($y+$h+1); |
|
| 2955 | + return ($y + $h + 1); |
|
| 2956 | 2956 | } |
| 2957 | 2957 | |
| 2958 | 2958 | /** |
@@ -2973,7 +2973,7 @@ discard block |
||
| 2973 | 2973 | if ($this->orientacao == 'P') { |
| 2974 | 2974 | $w = $this->wPrint; |
| 2975 | 2975 | } else { |
| 2976 | - $w = $this->wPrint-$this->wCanhoto; |
|
| 2976 | + $w = $this->wPrint - $this->wCanhoto; |
|
| 2977 | 2977 | } |
| 2978 | 2978 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B'); |
| 2979 | 2979 | $this->pTextBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -2989,15 +2989,15 @@ discard block |
||
| 2989 | 2989 | //$this->textoAdic com o texto completo do campo |
| 2990 | 2990 | $y += 1; |
| 2991 | 2991 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
| 2992 | - $this->pTextBox($x, $y+2, $w-2, $h-3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
|
| 2992 | + $this->pTextBox($x, $y + 2, $w - 2, $h - 3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
|
| 2993 | 2993 | //RESERVADO AO FISCO |
| 2994 | 2994 | $texto = "RESERVADO AO FISCO"; |
| 2995 | 2995 | $x += $w; |
| 2996 | 2996 | $y -= 1; |
| 2997 | 2997 | if ($this->orientacao == 'P') { |
| 2998 | - $w = $this->wPrint-$w; |
|
| 2998 | + $w = $this->wPrint - $w; |
|
| 2999 | 2999 | } else { |
| 3000 | - $w = $this->wPrint-$w-$this->wCanhoto; |
|
| 3000 | + $w = $this->wPrint - $w - $this->wCanhoto; |
|
| 3001 | 3001 | } |
| 3002 | 3002 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'B'); |
| 3003 | 3003 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3036,8 +3036,8 @@ discard block |
||
| 3036 | 3036 | } |
| 3037 | 3037 | $y += 2; |
| 3038 | 3038 | $aFont = array('font'=>$this->fontePadrao, 'size'=>7, 'style'=>''); |
| 3039 | - $this->pTextBox($x, $y, $w-2, $h-3, $texto, $aFont, 'T', 'L', 0, '', false); |
|
| 3040 | - return $y+$h; |
|
| 3039 | + $this->pTextBox($x, $y, $w - 2, $h - 3, $texto, $aFont, 'T', 'L', 0, '', false); |
|
| 3040 | + return $y + $h; |
|
| 3041 | 3041 | } |
| 3042 | 3042 | |
| 3043 | 3043 | /** |
@@ -3055,13 +3055,13 @@ discard block |
||
| 3055 | 3055 | if ($this->orientacao == 'P') { |
| 3056 | 3056 | $w = $this->wPrint; |
| 3057 | 3057 | } else { |
| 3058 | - $w = $this->wPrint-$this->wCanhoto; |
|
| 3058 | + $w = $this->wPrint - $this->wCanhoto; |
|
| 3059 | 3059 | $x = $this->wCanhoto; |
| 3060 | 3060 | } |
| 3061 | 3061 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I'); |
| 3062 | - $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s'); |
|
| 3062 | + $texto = "Impresso em " . date('d/m/Y') . " as " . date('H:i:s'); |
|
| 3063 | 3063 | $this->pTextBox($x, $y, $w, 0, $texto, $aFont, 'T', 'L', false); |
| 3064 | - $texto = $this->creditos . " Powered by NFePHP"; |
|
| 3064 | + $texto = $this->creditos . " Powered by NFePHP"; |
|
| 3065 | 3065 | $this->pTextBox($x, $y, $w, 0, $texto, $aFont, 'T', 'R', false, ''); |
| 3066 | 3066 | } |
| 3067 | 3067 | |
@@ -3114,9 +3114,9 @@ discard block |
||
| 3114 | 3114 | } else { |
| 3115 | 3115 | //linha separadora do canhoto - 238 |
| 3116 | 3116 | //posicao altura |
| 3117 | - $y = $this->wPrint-85; |
|
| 3117 | + $y = $this->wPrint - 85; |
|
| 3118 | 3118 | //altura |
| 3119 | - $w = $this->wPrint-85-24; |
|
| 3119 | + $w = $this->wPrint - 85 - 24; |
|
| 3120 | 3120 | } |
| 3121 | 3121 | $h = 10; |
| 3122 | 3122 | //desenha caixa |
@@ -3139,21 +3139,21 @@ discard block |
||
| 3139 | 3139 | $texto .= "AO LADO"; |
| 3140 | 3140 | } |
| 3141 | 3141 | $texto .= ". EMISSÃO: "; |
| 3142 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3142 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3143 | 3143 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 3144 | 3144 | if ($dEmi == '') { |
| 3145 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3145 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3146 | 3146 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 3147 | 3147 | $aDemi = explode('T', $dEmi); |
| 3148 | 3148 | $dEmi = $aDemi[0]; |
| 3149 | 3149 | } |
| 3150 | - $texto .= $this->pYmd2dmy($dEmi) ." "; |
|
| 3150 | + $texto .= $this->pYmd2dmy($dEmi) . " "; |
|
| 3151 | 3151 | $texto .= "VALOR TOTAL: R$ "; |
| 3152 | 3152 | $texto .= number_format($this->ICMSTot->getElementsByTagName("vNF")->item(0)->nodeValue, 2, ",", ".") . " "; |
| 3153 | 3153 | $texto .= "DESTINATÁRIO: "; |
| 3154 | 3154 | $texto .= $destinatario; |
| 3155 | 3155 | if ($this->orientacao == 'P') { |
| 3156 | - $this->pTextBox($x, $y, $w-1, $h, $texto, $aFont, 'C', 'L', 0, '', false); |
|
| 3156 | + $this->pTextBox($x, $y, $w - 1, $h, $texto, $aFont, 'C', 'L', 0, '', false); |
|
| 3157 | 3157 | $x1 = $x + $w; |
| 3158 | 3158 | $w1 = $this->wPrint - $w; |
| 3159 | 3159 | $texto = "NF-e"; |
@@ -3166,12 +3166,12 @@ discard block |
||
| 3166 | 3166 | //DATA DE RECEBIMENTO |
| 3167 | 3167 | $texto = "DATA DE RECEBIMENTO"; |
| 3168 | 3168 | $y += $h; |
| 3169 | - $w2 = round($this->wPrint*0.17, 0); //35; |
|
| 3169 | + $w2 = round($this->wPrint * 0.17, 0); //35; |
|
| 3170 | 3170 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 3171 | 3171 | $this->pTextBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3172 | 3172 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
| 3173 | 3173 | $x += $w2; |
| 3174 | - $w3 = $w-$w2; |
|
| 3174 | + $w3 = $w - $w2; |
|
| 3175 | 3175 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
| 3176 | 3176 | $this->pTextBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3177 | 3177 | $x = $oldX; |
@@ -3181,7 +3181,7 @@ discard block |
||
| 3181 | 3181 | return $y; |
| 3182 | 3182 | } else { |
| 3183 | 3183 | $x--; |
| 3184 | - $x = $this->pTextBox90($x, $y, $w-1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
|
| 3184 | + $x = $this->pTextBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
|
| 3185 | 3185 | //NUMERO DA NOTA FISCAL LOGO NFE |
| 3186 | 3186 | $w1 = 18; |
| 3187 | 3187 | $x1 = $oldX; |
@@ -3195,18 +3195,18 @@ discard block |
||
| 3195 | 3195 | $this->pTextBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, ''); |
| 3196 | 3196 | //DATA DO RECEBIMENTO |
| 3197 | 3197 | $texto = "DATA DO RECEBIMENTO"; |
| 3198 | - $y = $this->wPrint-85; |
|
| 3198 | + $y = $this->wPrint - 85; |
|
| 3199 | 3199 | $x = 12; |
| 3200 | - $w2 = round($this->wPrint*0.17, 0); //35; |
|
| 3200 | + $w2 = round($this->wPrint * 0.17, 0); //35; |
|
| 3201 | 3201 | $aFont = array('font'=>$this->fontePadrao, 'size'=>6, 'style'=>''); |
| 3202 | 3202 | $this->pTextBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3203 | 3203 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
| 3204 | 3204 | $y -= $w2; |
| 3205 | - $w3 = $w-$w2; |
|
| 3205 | + $w3 = $w - $w2; |
|
| 3206 | 3206 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
| 3207 | 3207 | $aFont = array('font'=>$this->fontePadrao, 'size'=>5.7, 'style'=>''); |
| 3208 | 3208 | $x = $this->pTextBox90($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3209 | - $this->pdf->DashedVLine(23, $oldY, 0.1, $this->wPrint-20, 67); |
|
| 3209 | + $this->pdf->DashedVLine(23, $oldY, 0.1, $this->wPrint - 20, 67); |
|
| 3210 | 3210 | return $x; |
| 3211 | 3211 | } |
| 3212 | 3212 | } |
@@ -3223,13 +3223,13 @@ discard block |
||
| 3223 | 3223 | { |
| 3224 | 3224 | $saida = ""; |
| 3225 | 3225 | if (isset($this->compra)) { |
| 3226 | - if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
| 3226 | + if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
| 3227 | 3227 | $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue; |
| 3228 | 3228 | } |
| 3229 | - if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
| 3229 | + if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
| 3230 | 3230 | $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue; |
| 3231 | 3231 | } |
| 3232 | - if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
| 3232 | + if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
| 3233 | 3233 | $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue; |
| 3234 | 3234 | } |
| 3235 | 3235 | } |
@@ -3255,21 +3255,21 @@ discard block |
||
| 3255 | 3255 | if ($vICMS > 0) { |
| 3256 | 3256 | $vICMS = 1; |
| 3257 | 3257 | } |
| 3258 | - $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue; |
|
| 3258 | + $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue; |
|
| 3259 | 3259 | if ($icmss > 0) { |
| 3260 | 3260 | $icmss = 1; |
| 3261 | 3261 | } |
| 3262 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3262 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3263 | 3263 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 3264 | 3264 | if ($dEmi == '') { |
| 3265 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3265 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3266 | 3266 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 3267 | 3267 | $aDemi = explode('T', $dEmi); |
| 3268 | 3268 | $dEmi = $aDemi[0]; |
| 3269 | 3269 | } |
| 3270 | 3270 | $dd = $dEmi; |
| 3271 | 3271 | $rpos = strrpos($dd, '-'); |
| 3272 | - $dd = substr($dd, $rpos +1); |
|
| 3272 | + $dd = substr($dd, $rpos + 1); |
|
| 3273 | 3273 | $chave = sprintf($forma, $cUF, $this->tpEmis, $CNPJ, $vNF, $vICMS, $icmss, $dd); |
| 3274 | 3274 | $chave = $chave . $this->pModulo11($chave); |
| 3275 | 3275 | return $chave; |
@@ -3290,7 +3290,7 @@ discard block |
||
| 3290 | 3290 | $formaNfRef = "\r\nNF Ref.: série:%d numero:%d emit:%s em %s modelo: %d"; |
| 3291 | 3291 | $formaECFRef = "\r\nECF Ref.: modelo: %s ECF:%d COO:%d"; |
| 3292 | 3292 | $formaNfpRef = "\r\nNFP Ref.: série:%d número:%d emit:%s em %s modelo: %d IE:%s"; |
| 3293 | - $saida=''; |
|
| 3293 | + $saida = ''; |
|
| 3294 | 3294 | $nfRefs = $this->ide->getElementsByTagName('NFref'); |
| 3295 | 3295 | if (0 === $nfRefs->length) { |
| 3296 | 3296 | return $saida; |
@@ -3306,7 +3306,7 @@ discard block |
||
| 3306 | 3306 | foreach ($refNFe as $chave_acessoRef) { |
| 3307 | 3307 | $chave_acesso = $chave_acessoRef->nodeValue; |
| 3308 | 3308 | $chave_acessoF = $this->pFormat($chave_acesso, $this->formatoChave); |
| 3309 | - $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2); |
|
| 3309 | + $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2); |
|
| 3310 | 3310 | $cnpj = $this->pFormat(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
| 3311 | 3311 | $serie = substr($chave_acesso, 22, 3); |
| 3312 | 3312 | $numero = substr($chave_acesso, 25, 9); |
@@ -3327,7 +3327,7 @@ discard block |
||
| 3327 | 3327 | foreach ($refCTe as $chave_acessoRef) { |
| 3328 | 3328 | $chave_acesso = $chave_acessoRef->nodeValue; |
| 3329 | 3329 | $chave_acessoF = $this->pFormat($chave_acesso, $this->formatoChave); |
| 3330 | - $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2); |
|
| 3330 | + $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2); |
|
| 3331 | 3331 | $cnpj = $this->pFormat(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
| 3332 | 3332 | $serie = substr($chave_acesso, 22, 3); |
| 3333 | 3333 | $numero = substr($chave_acesso, 25, 9); |
@@ -3343,10 +3343,9 @@ discard block |
||
| 3343 | 3343 | $refNFP = $nfRef->getElementsByTagName('refNFP'); |
| 3344 | 3344 | foreach ($refNFP as $umaRefNFe) { |
| 3345 | 3345 | $data = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue; |
| 3346 | - $cnpj = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
| 3347 | - $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : |
|
| 3348 | - ''; |
|
| 3349 | - $cpf = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
| 3346 | + $cnpj = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
| 3347 | + $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : ''; |
|
| 3348 | + $cpf = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
| 3350 | 3349 | $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : ''; |
| 3351 | 3350 | $mod = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue; |
| 3352 | 3351 | $serie = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue; |
@@ -3372,6 +3371,6 @@ discard block |
||
| 3372 | 3371 | imagedestroy($image); |
| 3373 | 3372 | $stringdata = ob_get_contents(); // read from buffer |
| 3374 | 3373 | ob_end_clean(); |
| 3375 | - return 'data://text/plain;base64,'.base64_encode($stringdata); |
|
| 3374 | + return 'data://text/plain;base64,' . base64_encode($stringdata); |
|
| 3376 | 3375 | } |
| 3377 | 3376 | } |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $this->toma4 = $this->dom->getElementsByTagName("toma4")->item(0); |
| 212 | 212 | $this->toma03 = $this->dom->getElementsByTagName("toma3")->item(0); |
| 213 | 213 | //Tag tomador é identificado por toma03 na versão 2.00 |
| 214 | - if ($this->infCte->getAttribute("versao")=="2.00") { |
|
| 214 | + if ($this->infCte->getAttribute("versao") == "2.00") { |
|
| 215 | 215 | $this->toma03 = $this->dom->getElementsByTagName("toma03")->item(0); |
| 216 | 216 | } |
| 217 | 217 | //modal aquaviário |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | } |
| 457 | 457 | $x = $xInic; |
| 458 | 458 | $r = $this->zObs($x, $y); |
| 459 | - $y = $y-6; |
|
| 459 | + $y = $y - 6; |
|
| 460 | 460 | switch ($this->modal) { |
| 461 | 461 | case '1': |
| 462 | 462 | $y += 25.9; |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | 'font' => $this->fontePadrao, |
| 660 | 660 | 'size' => 7, |
| 661 | 661 | 'style' => ''); |
| 662 | - $fone = $this->getTagValue($this->enderEmit, "fone")!=""? $this->zFormatFone($this->enderEmit):''; |
|
| 662 | + $fone = $this->getTagValue($this->enderEmit, "fone") != "" ? $this->zFormatFone($this->enderEmit) : ''; |
|
| 663 | 663 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
| 664 | 664 | $nro = $this->getTagValue($this->enderEmit, "nro"); |
| 665 | 665 | $cpl = $this->getTagValue($this->enderEmit, "xCpl"); |
@@ -752,31 +752,31 @@ discard block |
||
| 752 | 752 | $this->pdf->Line($x, $y1 + 8, $w + 3, $y1 + 8); |
| 753 | 753 | $toma = $this->getTagValue($this->ide, "indGlobalizado"); |
| 754 | 754 | //0-Remetente;1-Expedidor;2-Recebedor;3-Destinatário;4 - Outros |
| 755 | - if ($toma==1) { |
|
| 755 | + if ($toma == 1) { |
|
| 756 | 756 | $aFont = array( |
| 757 | 757 | 'font' => $this->fontePadrao, |
| 758 | 758 | 'size' => 11, |
| 759 | 759 | 'style' => ''); |
| 760 | - $this->pTextBox($x-14.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
| 760 | + $this->pTextBox($x - 14.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
| 761 | 761 | } else { |
| 762 | 762 | $aFont = array( |
| 763 | 763 | 'font' => $this->fontePadrao, |
| 764 | 764 | 'size' => 11, |
| 765 | 765 | 'style' => ''); |
| 766 | - $this->pTextBox($x+3.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
| 766 | + $this->pTextBox($x + 3.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
| 767 | 767 | } |
| 768 | 768 | $aFont = $this->formatNegrito; |
| 769 | - $this->pdf->Line($x+5, $x+48, $x+5, $x+52); |
|
| 770 | - $this->pdf->Line($x+10, $x+48, $x+10, $x+52); |
|
| 771 | - $this->pdf->Line($x+5, $x+48, $x+10, $x+48); |
|
| 772 | - $this->pdf->Line($x+5, $x+52, $x+10, $x+52); |
|
| 773 | - $this->pTextBox($x-9, $y2+1.4 + 3, $w * 0.5, $h1, 'SIM', $aFont, 'T', 'C', 0, '', false); |
|
| 769 | + $this->pdf->Line($x + 5, $x + 48, $x + 5, $x + 52); |
|
| 770 | + $this->pdf->Line($x + 10, $x + 48, $x + 10, $x + 52); |
|
| 771 | + $this->pdf->Line($x + 5, $x + 48, $x + 10, $x + 48); |
|
| 772 | + $this->pdf->Line($x + 5, $x + 52, $x + 10, $x + 52); |
|
| 773 | + $this->pTextBox($x - 9, $y2 + 1.4 + 3, $w * 0.5, $h1, 'SIM', $aFont, 'T', 'C', 0, '', false); |
|
| 774 | 774 | |
| 775 | - $this->pdf->Line($x+23, $x+48, $x+23, $x+52); |
|
| 776 | - $this->pdf->Line($x+28, $x+48, $x+28, $x+52); |
|
| 777 | - $this->pdf->Line($x+23, $x+48, $x+28, $x+48); |
|
| 778 | - $this->pdf->Line($x+23, $x+52, $x+28, $x+52); |
|
| 779 | - $this->pTextBox($x+9.8, $y2+1.4 + 3, $w * 0.5, $h1, 'NÃO', $aFont, 'T', 'C', 0, '', false); |
|
| 775 | + $this->pdf->Line($x + 23, $x + 48, $x + 23, $x + 52); |
|
| 776 | + $this->pdf->Line($x + 28, $x + 48, $x + 28, $x + 52); |
|
| 777 | + $this->pdf->Line($x + 23, $x + 48, $x + 28, $x + 48); |
|
| 778 | + $this->pdf->Line($x + 23, $x + 52, $x + 28, $x + 52); |
|
| 779 | + $this->pTextBox($x + 9.8, $y2 + 1.4 + 3, $w * 0.5, $h1, 'NÃO', $aFont, 'T', 'C', 0, '', false); |
|
| 780 | 780 | |
| 781 | 781 | //FORMA DE PAGAMENTO |
| 782 | 782 | $texto = 'INFORMAÇÕES DO CT-E GLOBALIZADO'; |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | 'font' => $this->fontePadrao, |
| 786 | 786 | 'size' => 8, |
| 787 | 787 | 'style' => ''); |
| 788 | - $this->pTextBox($x+2 + $wa + 4.5, $y2-0.7, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 788 | + $this->pTextBox($x + 2 + $wa + 4.5, $y2 - 0.7, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 789 | 789 | $forma = $this->getTagValue($this->ide, "forPag"); |
| 790 | 790 | //################################################################## |
| 791 | 791 | //coluna direita |
@@ -893,7 +893,7 @@ discard block |
||
| 893 | 893 | 'style' => ''); |
| 894 | 894 | $this->pTextBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 895 | 895 | //$texto = '1/1'; |
| 896 | - $texto = $pag."/".$totPag; |
|
| 896 | + $texto = $pag . "/" . $totPag; |
|
| 897 | 897 | $aFont = $this->formatNegrito; |
| 898 | 898 | $this->pTextBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 899 | 899 | $this->pdf->Line($xa + $wa, $y, $xa + $wa, $y + $h + 1); |
@@ -1095,7 +1095,7 @@ discard block |
||
| 1095 | 1095 | $this->pdf->SetTextColor(0, 0, 0); |
| 1096 | 1096 | } |
| 1097 | 1097 | //indicar sem valor |
| 1098 | - if ($tpAmb != 1 && $this->preVisualizar=='0') { // caso não seja uma DA de produção |
|
| 1098 | + if ($tpAmb != 1 && $this->preVisualizar == '0') { // caso não seja uma DA de produção |
|
| 1099 | 1099 | $x = 10; |
| 1100 | 1100 | if ($this->orientacao == 'P') { |
| 1101 | 1101 | $y = round($this->hPrint * 2 / 3, 0); |
@@ -1118,7 +1118,7 @@ discard block |
||
| 1118 | 1118 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
| 1119 | 1119 | $this->pTextBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1120 | 1120 | $this->pdf->SetTextColor(0, 0, 0); |
| 1121 | - } elseif ($this->preVisualizar=='1') { // caso seja uma DA de Pré-Visualização |
|
| 1121 | + } elseif ($this->preVisualizar == '1') { // caso seja uma DA de Pré-Visualização |
|
| 1122 | 1122 | $h = 5; |
| 1123 | 1123 | $w = $maxW - (2 * 10); |
| 1124 | 1124 | $x = 55; |
@@ -1136,14 +1136,14 @@ discard block |
||
| 1136 | 1136 | 'size' => 41, |
| 1137 | 1137 | 'style' => 'B'); |
| 1138 | 1138 | $texto = "Sem Validade Jurídica"; |
| 1139 | - $this->pTextBox90($x+20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1139 | + $this->pTextBox90($x + 20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1140 | 1140 | $this->pdf->SetTextColor(90, 90, 90); |
| 1141 | 1141 | $texto = "SEM VALOR FISCAL"; |
| 1142 | 1142 | $aFont = array( |
| 1143 | 1143 | 'font' => $this->fontePadrao, |
| 1144 | 1144 | 'size' => 48, |
| 1145 | 1145 | 'style' => 'B'); |
| 1146 | - $this->pTextBox90($x+40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1146 | + $this->pTextBox90($x + 40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1147 | 1147 | $this->pdf->SetTextColor(0, 0, 0); // voltar a cor default |
| 1148 | 1148 | } else { |
| 1149 | 1149 | $x = 10; |
@@ -1230,7 +1230,7 @@ discard block |
||
| 1230 | 1230 | 'size' => 6, |
| 1231 | 1231 | 'style' => ''); |
| 1232 | 1232 | $this->pTextBox($x, $y, $w, 4, $texto, $aFont, 'T', 'L', 0, ''); |
| 1233 | - $texto = 'Desenvolvido por '.$this->nomeDesenvolvedor . ' - '. $this->siteDesenvolvedor; |
|
| 1233 | + $texto = 'Desenvolvido por ' . $this->nomeDesenvolvedor . ' - ' . $this->siteDesenvolvedor; |
|
| 1234 | 1234 | $aFont = array( |
| 1235 | 1235 | 'font' => $this->fontePadrao, |
| 1236 | 1236 | 'size' => 6, |
@@ -1321,7 +1321,7 @@ discard block |
||
| 1321 | 1321 | $aFont = $this->formatPadrao; |
| 1322 | 1322 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1323 | 1323 | //$texto = $this->zFormatFone($this->rem); |
| 1324 | - $texto = $this->getTagValue($this->rem, "fone")!=""? $this->zFormatFone($this->rem):''; |
|
| 1324 | + $texto = $this->getTagValue($this->rem, "fone") != "" ? $this->zFormatFone($this->rem) : ''; |
|
| 1325 | 1325 | $aFont = $this->formatNegrito; |
| 1326 | 1326 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1327 | 1327 | } //fim da função remetenteDACTE |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | $aFont = $this->formatPadrao; |
| 1409 | 1409 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1410 | 1410 | //$texto = $this->zFormatFone($this->dest); |
| 1411 | - $texto = $this->getTagValue($this->dest, "fone")!=""? $this->zFormatFone($this->dest):''; |
|
| 1411 | + $texto = $this->getTagValue($this->dest, "fone") != "" ? $this->zFormatFone($this->dest) : ''; |
|
| 1412 | 1412 | $aFont = $this->formatNegrito; |
| 1413 | 1413 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1414 | 1414 | } //fim da função destinatarioDACTE |
@@ -1448,8 +1448,7 @@ discard block |
||
| 1448 | 1448 | $texto = $this->getTagValue($this->enderExped, "xLgr") . ', '; |
| 1449 | 1449 | $texto .= $this->getTagValue($this->enderExped, "nro"); |
| 1450 | 1450 | $texto .= $this->getTagValue($this->enderExped, "xCpl") != "" ? |
| 1451 | - ' - ' . $this->getTagValue($this->enderExped, "xCpl") : |
|
| 1452 | - ''; |
|
| 1451 | + ' - ' . $this->getTagValue($this->enderExped, "xCpl") : ''; |
|
| 1453 | 1452 | } else { |
| 1454 | 1453 | $texto = ''; |
| 1455 | 1454 | } |
@@ -1504,7 +1503,7 @@ discard block |
||
| 1504 | 1503 | $aFont = $this->formatPadrao; |
| 1505 | 1504 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1506 | 1505 | if (isset($this->exped)) { |
| 1507 | - $texto = $this->getTagValue($this->exped, "fone")!=""? $this->zFormatFone($this->exped):''; |
|
| 1506 | + $texto = $this->getTagValue($this->exped, "fone") != "" ? $this->zFormatFone($this->exped) : ''; |
|
| 1508 | 1507 | $aFont = $this->formatNegrito; |
| 1509 | 1508 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1510 | 1509 | } |
@@ -1545,8 +1544,7 @@ discard block |
||
| 1545 | 1544 | $texto = $this->getTagValue($this->enderReceb, "xLgr") . ', '; |
| 1546 | 1545 | $texto .= $this->getTagValue($this->enderReceb, "nro"); |
| 1547 | 1546 | $texto .= ($this->getTagValue($this->enderReceb, "xCpl") != "") ? |
| 1548 | - ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : |
|
| 1549 | - ''; |
|
| 1547 | + ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : ''; |
|
| 1550 | 1548 | } else { |
| 1551 | 1549 | $texto = ''; |
| 1552 | 1550 | } |
@@ -1601,7 +1599,7 @@ discard block |
||
| 1601 | 1599 | $aFont = $this->formatPadrao; |
| 1602 | 1600 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1603 | 1601 | if (isset($this->receb)) { |
| 1604 | - $texto = $this->getTagValue($this->receb, "fone")!=""? $this->zFormatFone($this->receb):''; |
|
| 1602 | + $texto = $this->getTagValue($this->receb, "fone") != "" ? $this->zFormatFone($this->receb) : ''; |
|
| 1605 | 1603 | $aFont = $this->formatNegrito; |
| 1606 | 1604 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1607 | 1605 | } |
@@ -1691,7 +1689,7 @@ discard block |
||
| 1691 | 1689 | $texto = 'FONE'; |
| 1692 | 1690 | $aFont = $this->formatPadrao; |
| 1693 | 1691 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1694 | - $texto = $this->getTagValue($this->toma, "fone")!=""? $this->zFormatFone($this->toma):''; |
|
| 1692 | + $texto = $this->getTagValue($this->toma, "fone") != "" ? $this->zFormatFone($this->toma) : ''; |
|
| 1695 | 1693 | $aFont = $this->formatNegrito; |
| 1696 | 1694 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1697 | 1695 | } //fim da função tomadorDACTE |
@@ -1759,46 +1757,46 @@ discard block |
||
| 1759 | 1757 | 'font' => $this->fontePadrao, |
| 1760 | 1758 | 'size' => 5, |
| 1761 | 1759 | 'style' => ''); |
| 1762 | - $this->pTextBox($x+8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1760 | + $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1763 | 1761 | $texto = number_format($qCarga, 3, ",", "."); |
| 1764 | 1762 | $aFont = array( |
| 1765 | 1763 | 'font' => $this->fontePadrao, |
| 1766 | 1764 | 'size' => 7, |
| 1767 | 1765 | 'style' => 'B'); |
| 1768 | - $this->pTextBox($x+2, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1766 | + $this->pTextBox($x + 2, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1769 | 1767 | $x = $w * 0.12; |
| 1770 | - $this->pdf->Line($x+13.5, $y, $x+13.5, $y + 9); |
|
| 1768 | + $this->pdf->Line($x + 13.5, $y, $x + 13.5, $y + 9); |
|
| 1771 | 1769 | $texto = 'PESO BASE CÁLCULO (KG)'; |
| 1772 | 1770 | $aFont = array( |
| 1773 | 1771 | 'font' => $this->fontePadrao, |
| 1774 | 1772 | 'size' => 5, |
| 1775 | 1773 | 'style' => ''); |
| 1776 | - $this->pTextBox($x+20, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1774 | + $this->pTextBox($x + 20, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1777 | 1775 | $texto = number_format($qCarga, 3, ",", "."); |
| 1778 | 1776 | $aFont = array( |
| 1779 | 1777 | 'font' => $this->fontePadrao, |
| 1780 | 1778 | 'size' => 7, |
| 1781 | 1779 | 'style' => 'B'); |
| 1782 | - $this->pTextBox($x+17, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1780 | + $this->pTextBox($x + 17, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1783 | 1781 | $x = $w * 0.24; |
| 1784 | - $this->pdf->Line($x+25, $y, $x+25, $y + 9); |
|
| 1782 | + $this->pdf->Line($x + 25, $y, $x + 25, $y + 9); |
|
| 1785 | 1783 | $texto = 'PESO AFERIDO (KG)'; |
| 1786 | 1784 | $aFont = array( |
| 1787 | 1785 | 'font' => $this->fontePadrao, |
| 1788 | 1786 | 'size' => 5, |
| 1789 | 1787 | 'style' => ''); |
| 1790 | - $this->pTextBox($x+35, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1788 | + $this->pTextBox($x + 35, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1791 | 1789 | $texto = number_format($qCarga, 3, ",", "."); |
| 1792 | 1790 | $aFont = array( |
| 1793 | 1791 | 'font' => $this->fontePadrao, |
| 1794 | 1792 | 'size' => 7, |
| 1795 | 1793 | 'style' => 'B'); |
| 1796 | - $this->pTextBox($x+28, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1794 | + $this->pTextBox($x + 28, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1797 | 1795 | $x = $w * 0.36; |
| 1798 | - $this->pdf->Line($x+41.3, $y, $x+41.3, $y + 9); |
|
| 1796 | + $this->pdf->Line($x + 41.3, $y, $x + 41.3, $y + 9); |
|
| 1799 | 1797 | $texto = 'CUBAGEM(M3)'; |
| 1800 | 1798 | $aFont = $this->formatPadrao; |
| 1801 | - $this->pTextBox($x+60, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1799 | + $this->pTextBox($x + 60, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1802 | 1800 | $qCarga = ''; |
| 1803 | 1801 | foreach ($this->infQ as $infQ) { |
| 1804 | 1802 | if ($this->getTagValue($infQ, "cUnid") == '00') { |
@@ -1810,12 +1808,12 @@ discard block |
||
| 1810 | 1808 | 'font' => $this->fontePadrao, |
| 1811 | 1809 | 'size' => 7, |
| 1812 | 1810 | 'style' => 'B'); |
| 1813 | - $this->pTextBox($x+50, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1811 | + $this->pTextBox($x + 50, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1814 | 1812 | $x = $w * 0.45; |
| 1815 | 1813 | //$this->pdf->Line($x+37, $y, $x+37, $y + 9); |
| 1816 | 1814 | $texto = 'QTDE(VOL)'; |
| 1817 | 1815 | $aFont = $this->formatPadrao; |
| 1818 | - $this->pTextBox($x+85, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1816 | + $this->pTextBox($x + 85, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1819 | 1817 | $qCarga = ''; |
| 1820 | 1818 | foreach ($this->infQ as $infQ) { |
| 1821 | 1819 | if ($this->getTagValue($infQ, "cUnid") == '03') { |
@@ -1827,9 +1825,9 @@ discard block |
||
| 1827 | 1825 | 'font' => $this->fontePadrao, |
| 1828 | 1826 | 'size' => 7, |
| 1829 | 1827 | 'style' => 'B'); |
| 1830 | - $this->pTextBox($x+85, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1828 | + $this->pTextBox($x + 85, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1831 | 1829 | $x = $w * 0.53; |
| 1832 | - $this->pdf->Line($x+56, $y, $x+56, $y + 9); |
|
| 1830 | + $this->pdf->Line($x + 56, $y, $x + 56, $y + 9); |
|
| 1833 | 1831 | /*$texto = 'NOME DA SEGURADORA'; |
| 1834 | 1832 | $aFont = $this->formatPadrao; |
| 1835 | 1833 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -2008,7 +2006,7 @@ discard block |
||
| 2008 | 2006 | $aFont = $this->formatPadrao; |
| 2009 | 2007 | $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2010 | 2008 | |
| 2011 | - $wCol02=0.15; |
|
| 2009 | + $wCol02 = 0.15; |
|
| 2012 | 2010 | $x += $w * $wCol02; |
| 2013 | 2011 | $this->pdf->Line($x, $y, $x, $y + 9.5); |
| 2014 | 2012 | $texto = 'ALÍQ ICMS'; |
@@ -2334,7 +2332,7 @@ discard block |
||
| 2334 | 2332 | $this->arrayNFe[] = $chaveNFe; |
| 2335 | 2333 | } |
| 2336 | 2334 | $qtdeNFe = 1; |
| 2337 | - if (count($this->arrayNFe) >15) { |
|
| 2335 | + if (count($this->arrayNFe) > 15) { |
|
| 2338 | 2336 | $this->flagDocOrigContinuacao = 1; |
| 2339 | 2337 | $qtdeNFe = count($this->arrayNFe); |
| 2340 | 2338 | } |
@@ -2514,9 +2512,9 @@ discard block |
||
| 2514 | 2512 | //$h = 6 + 3; // de altura do texto (primeira linha |
| 2515 | 2513 | //$h = 9 + 3.5 ;// segunda linha |
| 2516 | 2514 | //$h = 9 + 3.5+ 3.5 ;// segunda linha |
| 2517 | - $h = (( ( count($this->arrayNFe)/2 ) - 9) * 3.5)+9; |
|
| 2518 | - if (count($this->arrayNFe)%2 !=0) { |
|
| 2519 | - $h = $h+3.5; |
|
| 2515 | + $h = (((count($this->arrayNFe) / 2) - 9) * 3.5) + 9; |
|
| 2516 | + if (count($this->arrayNFe) % 2 != 0) { |
|
| 2517 | + $h = $h + 3.5; |
|
| 2520 | 2518 | } // Caso tenha apenas 1 registro na ultima linha |
| 2521 | 2519 | |
| 2522 | 2520 | $texto = 'DOCUMENTOS ORIGINÁRIOS - CONTINUACÃO'; |
@@ -2574,7 +2572,7 @@ discard block |
||
| 2574 | 2572 | $yIniDados += 3; |
| 2575 | 2573 | |
| 2576 | 2574 | while ($contador < (count($this->arrayNFe))) { |
| 2577 | - if ($contador%(116*($i-1)) == 0) { |
|
| 2575 | + if ($contador % (116 * ($i - 1)) == 0) { |
|
| 2578 | 2576 | // $contador++; |
| 2579 | 2577 | break; |
| 2580 | 2578 | } |
@@ -2717,14 +2715,14 @@ discard block |
||
| 2717 | 2715 | $texto .= $xObs; |
| 2718 | 2716 | } |
| 2719 | 2717 | $textoObs = explode("Motorista:", $texto); |
| 2720 | - $textoObs[1] = isset($textoObs[1]) ? "Motorista: ".$textoObs[1]: ''; |
|
| 2718 | + $textoObs[1] = isset($textoObs[1]) ? "Motorista: " . $textoObs[1] : ''; |
|
| 2721 | 2719 | $texto .= $this->getTagValue($this->imp, "infAdFisco", "\r\n"); |
| 2722 | 2720 | $aFont = array( |
| 2723 | 2721 | 'font' => $this->fontePadrao, |
| 2724 | 2722 | 'size' => 7.5, |
| 2725 | 2723 | 'style' => ''); |
| 2726 | 2724 | $this->pTextBox($x, $y, $w, $h, $textoObs[0], $aFont, 'T', 'L', 0, '', false); |
| 2727 | - $this->pTextBox($x, $y+11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
| 2725 | + $this->pTextBox($x, $y + 11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
| 2728 | 2726 | } //fim da função obsDACTE |
| 2729 | 2727 | |
| 2730 | 2728 | /** |
@@ -2763,11 +2761,11 @@ discard block |
||
| 2763 | 2761 | $this->pTextBox($x, $y + 3, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2764 | 2762 | $x += $w * 0.23; |
| 2765 | 2763 | |
| 2766 | - $this->pdf->Line($x-20, $y, $x-20, $y + 6); // LINHA A FRENTE DA RNTRC DA EMPRESA |
|
| 2764 | + $this->pdf->Line($x - 20, $y, $x - 20, $y + 6); // LINHA A FRENTE DA RNTRC DA EMPRESA |
|
| 2767 | 2765 | |
| 2768 | 2766 | $texto = 'ESTE CONHECIMENTO DE TRANSPORTE ATENDE À LEGISLAÇÃO DE TRANSPORTE RODOVIÁRIO EM VIGOR'; |
| 2769 | 2767 | $aFont = $this->formatPadrao; |
| 2770 | - $this->pTextBox($x-20, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 2768 | + $this->pTextBox($x - 20, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 2771 | 2769 | } //fim da função zModalRod |
| 2772 | 2770 | |
| 2773 | 2771 | /** |
@@ -2801,13 +2799,13 @@ discard block |
||
| 2801 | 2799 | |
| 2802 | 2800 | $texto = 'CLASSE DA TARIFA'; |
| 2803 | 2801 | $aFont = $this->formatPadrao; |
| 2804 | - $this->pTextBox($x+50, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2802 | + $this->pTextBox($x + 50, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2805 | 2803 | $texto = 'CÓDIGO DA TARIFA'; |
| 2806 | 2804 | $aFont = $this->formatPadrao; |
| 2807 | - $this->pTextBox($x+80, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2805 | + $this->pTextBox($x + 80, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2808 | 2806 | $texto = 'VALOR DA TARIFA'; |
| 2809 | 2807 | $aFont = $this->formatPadrao; |
| 2810 | - $this->pTextBox($x+110, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2808 | + $this->pTextBox($x + 110, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2811 | 2809 | |
| 2812 | 2810 | $texto = $this->getTagValue($this->aereo, "nOCA"); |
| 2813 | 2811 | $aFont = $this->formatNegrito; |
@@ -3291,7 +3289,7 @@ discard block |
||
| 3291 | 3289 | */ |
| 3292 | 3290 | protected function zCanhoto($x = 0, $y = 0) |
| 3293 | 3291 | { |
| 3294 | - $this->zhDashedLine($x, $y+2, $this->wPrint, 0.1, 80); |
|
| 3292 | + $this->zhDashedLine($x, $y + 2, $this->wPrint, 0.1, 80); |
|
| 3295 | 3293 | $y = $y + 2; |
| 3296 | 3294 | $oldX = $x; |
| 3297 | 3295 | $oldY = $y; |
@@ -3330,7 +3328,7 @@ discard block |
||
| 3330 | 3328 | |
| 3331 | 3329 | $this->pdf->Line($x, $y, $x, $y + 16.5); |
| 3332 | 3330 | |
| 3333 | - $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n". "\r\n"; |
|
| 3331 | + $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n" . "\r\n"; |
|
| 3334 | 3332 | $texto .= ' INÍCIO DA PRESTAÇÃO - DATA/HORA'; |
| 3335 | 3333 | $aFont = array( |
| 3336 | 3334 | 'font' => $this->fontePadrao, |
@@ -3340,14 +3338,14 @@ discard block |
||
| 3340 | 3338 | $x = $oldX; |
| 3341 | 3339 | $y = $y + 5; |
| 3342 | 3340 | |
| 3343 | - $this->pdf->Line($x, $y+3, $w * 0.255, $y+3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
| 3341 | + $this->pdf->Line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
| 3344 | 3342 | |
| 3345 | 3343 | $texto = 'RG'; |
| 3346 | 3344 | $aFont = array( |
| 3347 | 3345 | 'font' => $this->fontePadrao, |
| 3348 | 3346 | 'size' => 6, |
| 3349 | 3347 | 'style' => ''); |
| 3350 | - $this->pTextBox($x, $y+3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3348 | + $this->pTextBox($x, $y + 3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3351 | 3349 | $x += $w * 0.85; |
| 3352 | 3350 | |
| 3353 | 3351 | $this->pdf->Line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | $y += 19; |
| 376 | 376 | $x = $xInic; |
| 377 | 377 | $r = $this->zSeguro($x, $y); |
| 378 | - $y = $y-12; |
|
| 378 | + $y = $y - 12; |
|
| 379 | 379 | |
| 380 | 380 | |
| 381 | 381 | switch ($this->modal) { |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | 'font' => $this->fontePadrao, |
| 581 | 581 | 'size' => 7, |
| 582 | 582 | 'style' => ''); |
| 583 | - $fone = $this->getTagValue($this->enderEmit, "fone")!=""? $this->zFormatFone($this->enderEmit):''; |
|
| 583 | + $fone = $this->getTagValue($this->enderEmit, "fone") != "" ? $this->zFormatFone($this->enderEmit) : ''; |
|
| 584 | 584 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
| 585 | 585 | $nro = $this->getTagValue($this->enderEmit, "nro"); |
| 586 | 586 | $cpl = $this->getTagValue($this->enderEmit, "xCpl"); |
@@ -968,7 +968,7 @@ discard block |
||
| 968 | 968 | $this->pdf->SetTextColor(0, 0, 0); |
| 969 | 969 | } |
| 970 | 970 | //indicar sem valor |
| 971 | - if ($tpAmb != 1 && $this->preVisualizar=='0') { // caso não seja uma DA de produção |
|
| 971 | + if ($tpAmb != 1 && $this->preVisualizar == '0') { // caso não seja uma DA de produção |
|
| 972 | 972 | $x = 10; |
| 973 | 973 | if ($this->orientacao == 'P') { |
| 974 | 974 | $y = round($this->hPrint / 2, 0); |
@@ -991,7 +991,7 @@ discard block |
||
| 991 | 991 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
| 992 | 992 | $this->pTextBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 993 | 993 | $this->pdf->SetTextColor(0, 0, 0); |
| 994 | - } elseif ($this->preVisualizar=='1') { // caso seja uma DA de Pré-Visualização |
|
| 994 | + } elseif ($this->preVisualizar == '1') { // caso seja uma DA de Pré-Visualização |
|
| 995 | 995 | $h = 5; |
| 996 | 996 | $w = $maxW - (2 * 10); |
| 997 | 997 | $x = 55; |
@@ -1009,14 +1009,14 @@ discard block |
||
| 1009 | 1009 | 'size' => 41, |
| 1010 | 1010 | 'style' => 'B'); |
| 1011 | 1011 | $texto = "Sem Validade Jurídica"; |
| 1012 | - $this->pTextBox90($x+20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1012 | + $this->pTextBox90($x + 20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1013 | 1013 | $this->pdf->SetTextColor(90, 90, 90); |
| 1014 | 1014 | $texto = "SEM VALOR FISCAL"; |
| 1015 | 1015 | $aFont = array( |
| 1016 | 1016 | 'font' => $this->fontePadrao, |
| 1017 | 1017 | 'size' => 48, |
| 1018 | 1018 | 'style' => 'B'); |
| 1019 | - $this->pTextBox90($x+40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1019 | + $this->pTextBox90($x + 40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1020 | 1020 | $this->pdf->SetTextColor(0, 0, 0); // voltar a cor default |
| 1021 | 1021 | } else { |
| 1022 | 1022 | $x = 10; |
@@ -1102,13 +1102,13 @@ discard block |
||
| 1102 | 1102 | 'font' => $this->fontePadrao, |
| 1103 | 1103 | 'size' => 6, |
| 1104 | 1104 | 'style' => ''); |
| 1105 | - $this->pTextBox($x-1, $y+2, $w, 4, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1106 | - $texto = $this->nomeDesenvolvedor . ' - '. $this->siteDesenvolvedor; |
|
| 1105 | + $this->pTextBox($x - 1, $y + 2, $w, 4, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1106 | + $texto = $this->nomeDesenvolvedor . ' - ' . $this->siteDesenvolvedor; |
|
| 1107 | 1107 | $aFont = array( |
| 1108 | 1108 | 'font' => $this->fontePadrao, |
| 1109 | 1109 | 'size' => 6, |
| 1110 | 1110 | 'style' => ''); |
| 1111 | - $this->pTextBox($x-50, $y+2, $w, 4, $texto, $aFont, 'T', 'R', 0, $this->siteDesenvolvedor); |
|
| 1111 | + $this->pTextBox($x - 50, $y + 2, $w, 4, $texto, $aFont, 'T', 'R', 0, $this->siteDesenvolvedor); |
|
| 1112 | 1112 | } //fim zRodape |
| 1113 | 1113 | |
| 1114 | 1114 | /** |
@@ -1195,7 +1195,7 @@ discard block |
||
| 1195 | 1195 | $texto = 'FONE'; |
| 1196 | 1196 | $aFont = $this->formatPadrao; |
| 1197 | 1197 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1198 | - $texto = $this->getTagValue($this->toma, "fone")!=""? $this->zFormatFone($this->toma):''; |
|
| 1198 | + $texto = $this->getTagValue($this->toma, "fone") != "" ? $this->zFormatFone($this->toma) : ''; |
|
| 1199 | 1199 | $aFont = $this->formatNegrito; |
| 1200 | 1200 | $this->pTextBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1201 | 1201 | } //fim da função tomadorDACTE |
@@ -1335,7 +1335,7 @@ discard block |
||
| 1335 | 1335 | $aFont = $this->formatPadrao; |
| 1336 | 1336 | $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1337 | 1337 | |
| 1338 | - $wCol02=0.18; |
|
| 1338 | + $wCol02 = 0.18; |
|
| 1339 | 1339 | $x += $w * $wCol02; |
| 1340 | 1340 | $this->pdf->Line($x, $y, $x, $y + 9.5); |
| 1341 | 1341 | $texto = 'ALÍQ ICMS'; |
@@ -1411,7 +1411,7 @@ discard block |
||
| 1411 | 1411 | $x += $w * $wCol02; |
| 1412 | 1412 | |
| 1413 | 1413 | $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ? |
| 1414 | - number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".").'%' :''; |
|
| 1414 | + number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".") . '%' : ''; |
|
| 1415 | 1415 | $aFont = $this->formatNegrito; |
| 1416 | 1416 | $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1417 | 1417 | |
@@ -1639,14 +1639,14 @@ discard block |
||
| 1639 | 1639 | $texto .= $xObs; |
| 1640 | 1640 | } |
| 1641 | 1641 | $textoObs = explode("Motorista:", $texto); |
| 1642 | - $textoObs[1] = isset($textoObs[1]) ? "Motorista: ".$textoObs[1]: ''; |
|
| 1642 | + $textoObs[1] = isset($textoObs[1]) ? "Motorista: " . $textoObs[1] : ''; |
|
| 1643 | 1643 | $texto .= $this->getTagValue($this->imp, "infAdFisco", "\r\n"); |
| 1644 | 1644 | $aFont = array( |
| 1645 | 1645 | 'font' => $this->fontePadrao, |
| 1646 | 1646 | 'size' => 7.5, |
| 1647 | 1647 | 'style' => ''); |
| 1648 | 1648 | $this->pTextBox($x, $y, $w, $h, $textoObs[0], $aFont, 'T', 'L', 0, '', false); |
| 1649 | - $this->pTextBox($x, $y+11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
| 1649 | + $this->pTextBox($x, $y + 11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
| 1650 | 1650 | } //fim da função obsDACTE |
| 1651 | 1651 | |
| 1652 | 1652 | /** |
@@ -1684,7 +1684,7 @@ discard block |
||
| 1684 | 1684 | $aFont = $this->formatPadrao; |
| 1685 | 1685 | $this->pTextBox($x, $y, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1686 | 1686 | |
| 1687 | - $wCol02=0.33; |
|
| 1687 | + $wCol02 = 0.33; |
|
| 1688 | 1688 | $x += $w * $wCol02; |
| 1689 | 1689 | $this->pdf->Line($x, $y, $x, $y + 9.5); |
| 1690 | 1690 | $texto = 'NÚMERO DA APÓLICE'; |
@@ -1744,7 +1744,7 @@ discard block |
||
| 1744 | 1744 | $aFont = $this->formatPadrao; |
| 1745 | 1745 | $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1746 | 1746 | |
| 1747 | - $wCol02=0.18; |
|
| 1747 | + $wCol02 = 0.18; |
|
| 1748 | 1748 | $x += $w * $wCol02; |
| 1749 | 1749 | $this->pdf->Line($x, $y, $x, $y + 9.5); |
| 1750 | 1750 | $texto = 'PLACA DO VEÍCULO'; |
@@ -1786,8 +1786,7 @@ discard block |
||
| 1786 | 1786 | $x += $w * $wCol02; |
| 1787 | 1787 | |
| 1788 | 1788 | $texto = !empty($this->getTagValue($this->veic->item(0), "CPF")) ? |
| 1789 | - $this->getTagValue($this->veic->item(0), "CPF") : |
|
| 1790 | - (!empty($this->getTagValue($this->veic->item(0), "CNPJ")) ? |
|
| 1789 | + $this->getTagValue($this->veic->item(0), "CPF") : (!empty($this->getTagValue($this->veic->item(0), "CNPJ")) ? |
|
| 1791 | 1790 | $this->getTagValue($this->veic->item(0), "CNPJ") : ''); |
| 1792 | 1791 | $aFont = $this->formatNegrito; |
| 1793 | 1792 | $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -2256,7 +2255,7 @@ discard block |
||
| 2256 | 2255 | */ |
| 2257 | 2256 | protected function zCanhoto($x = 0, $y = 0) |
| 2258 | 2257 | { |
| 2259 | - $this->zhDashedLine($x, $y+2, $this->wPrint, 0.1, 80); |
|
| 2258 | + $this->zhDashedLine($x, $y + 2, $this->wPrint, 0.1, 80); |
|
| 2260 | 2259 | $y = $y + 2; |
| 2261 | 2260 | $oldX = $x; |
| 2262 | 2261 | $oldY = $y; |
@@ -2295,7 +2294,7 @@ discard block |
||
| 2295 | 2294 | |
| 2296 | 2295 | $this->pdf->Line($x, $y, $x, $y + 16.5); |
| 2297 | 2296 | |
| 2298 | - $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n". "\r\n"; |
|
| 2297 | + $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n" . "\r\n"; |
|
| 2299 | 2298 | $texto .= ' INÍCIO DA PRESTAÇÃO - DATA/HORA'; |
| 2300 | 2299 | $aFont = array( |
| 2301 | 2300 | 'font' => $this->fontePadrao, |
@@ -2305,14 +2304,14 @@ discard block |
||
| 2305 | 2304 | $x = $oldX; |
| 2306 | 2305 | $y = $y + 5; |
| 2307 | 2306 | |
| 2308 | - $this->pdf->Line($x, $y+3, $w * 0.255, $y+3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
| 2307 | + $this->pdf->Line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
| 2309 | 2308 | |
| 2310 | 2309 | $texto = 'RG'; |
| 2311 | 2310 | $aFont = array( |
| 2312 | 2311 | 'font' => $this->fontePadrao, |
| 2313 | 2312 | 'size' => 6, |
| 2314 | 2313 | 'style' => ''); |
| 2315 | - $this->pTextBox($x, $y+3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2314 | + $this->pTextBox($x, $y + 3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2316 | 2315 | $x += $w * 0.85; |
| 2317 | 2316 | |
| 2318 | 2317 | $this->pdf->Line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | } |
| 433 | 433 | $x = $xInic; |
| 434 | 434 | $r = $this->zObs($x, $y); |
| 435 | - $y = $y-6; |
|
| 435 | + $y = $y - 6; |
|
| 436 | 436 | switch ($this->modal) { |
| 437 | 437 | case '1': |
| 438 | 438 | $y += 17.9; |
@@ -879,7 +879,7 @@ discard block |
||
| 879 | 879 | 'style' => ''); |
| 880 | 880 | $this->pTextBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 881 | 881 | //$texto = '1/1'; |
| 882 | - $texto = $pag."/".$totPag; |
|
| 882 | + $texto = $pag . "/" . $totPag; |
|
| 883 | 883 | $aFont = $this->formatNegrito; |
| 884 | 884 | $this->pTextBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 885 | 885 | $this->pdf->Line($xa + $wa, $y, $xa + $wa, $y + $h + 1); |
@@ -1081,7 +1081,7 @@ discard block |
||
| 1081 | 1081 | $this->pdf->SetTextColor(0, 0, 0); |
| 1082 | 1082 | } |
| 1083 | 1083 | //indicar sem valor |
| 1084 | - if ($tpAmb != 1 && $this->preVisualizar=='0') { // caso não seja uma DA de produção |
|
| 1084 | + if ($tpAmb != 1 && $this->preVisualizar == '0') { // caso não seja uma DA de produção |
|
| 1085 | 1085 | $x = 10; |
| 1086 | 1086 | if ($this->orientacao == 'P') { |
| 1087 | 1087 | $y = round($this->hPrint * 2 / 3, 0); |
@@ -1104,7 +1104,7 @@ discard block |
||
| 1104 | 1104 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
| 1105 | 1105 | $this->pTextBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1106 | 1106 | $this->pdf->SetTextColor(0, 0, 0); |
| 1107 | - } elseif ($this->preVisualizar=='1') { // caso seja uma DA de Pré-Visualização |
|
| 1107 | + } elseif ($this->preVisualizar == '1') { // caso seja uma DA de Pré-Visualização |
|
| 1108 | 1108 | $h = 5; |
| 1109 | 1109 | $w = $maxW - (2 * 10); |
| 1110 | 1110 | $x = 55; |
@@ -1122,14 +1122,14 @@ discard block |
||
| 1122 | 1122 | 'size' => 41, |
| 1123 | 1123 | 'style' => 'B'); |
| 1124 | 1124 | $texto = "Sem Validade Jurídica"; |
| 1125 | - $this->pTextBox90($x+20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1125 | + $this->pTextBox90($x + 20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1126 | 1126 | $this->pdf->SetTextColor(90, 90, 90); |
| 1127 | 1127 | $texto = "SEM VALOR FISCAL"; |
| 1128 | 1128 | $aFont = array( |
| 1129 | 1129 | 'font' => $this->fontePadrao, |
| 1130 | 1130 | 'size' => 48, |
| 1131 | 1131 | 'style' => 'B'); |
| 1132 | - $this->pTextBox90($x+40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1132 | + $this->pTextBox90($x + 40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1133 | 1133 | $this->pdf->SetTextColor(0, 0, 0); // voltar a cor default |
| 1134 | 1134 | } else { |
| 1135 | 1135 | $x = 10; |
@@ -1432,8 +1432,7 @@ discard block |
||
| 1432 | 1432 | $texto = $this->getTagValue($this->enderExped, "xLgr") . ', '; |
| 1433 | 1433 | $texto .= $this->getTagValue($this->enderExped, "nro"); |
| 1434 | 1434 | $texto .= $this->getTagValue($this->enderExped, "xCpl") != "" ? |
| 1435 | - ' - ' . $this->getTagValue($this->enderExped, "xCpl") : |
|
| 1436 | - ''; |
|
| 1435 | + ' - ' . $this->getTagValue($this->enderExped, "xCpl") : ''; |
|
| 1437 | 1436 | } else { |
| 1438 | 1437 | $texto = ''; |
| 1439 | 1438 | } |
@@ -1529,8 +1528,7 @@ discard block |
||
| 1529 | 1528 | $texto = $this->getTagValue($this->enderReceb, "xLgr") . ', '; |
| 1530 | 1529 | $texto .= $this->getTagValue($this->enderReceb, "nro"); |
| 1531 | 1530 | $texto .= ($this->getTagValue($this->enderReceb, "xCpl") != "") ? |
| 1532 | - ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : |
|
| 1533 | - ''; |
|
| 1531 | + ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : ''; |
|
| 1534 | 1532 | } else { |
| 1535 | 1533 | $texto = ''; |
| 1536 | 1534 | } |
@@ -1804,8 +1802,7 @@ discard block |
||
| 1804 | 1802 | 3, |
| 1805 | 1803 | ".", |
| 1806 | 1804 | "" |
| 1807 | - ) : |
|
| 1808 | - ''; |
|
| 1805 | + ) : ''; |
|
| 1809 | 1806 | $texto = $this->getTagValue($this->infQ->item(2), "qCarga") == '' ? '' : $texto; |
| 1810 | 1807 | $texto .= ' ' . $this->zUnidade($this->getTagValue($this->infQ->item(2), "cUnid")); |
| 1811 | 1808 | $aFont = array( |
@@ -2021,7 +2018,7 @@ discard block |
||
| 2021 | 2018 | $aFont = $this->formatPadrao; |
| 2022 | 2019 | $this->pTextBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2023 | 2020 | |
| 2024 | - $wCol02=0.18; |
|
| 2021 | + $wCol02 = 0.18; |
|
| 2025 | 2022 | $x += $w * $wCol02; |
| 2026 | 2023 | $this->pdf->Line($x, $y, $x, $y + 9.5); |
| 2027 | 2024 | $texto = 'ALÍQ ICMS'; |
@@ -2098,7 +2095,7 @@ discard block |
||
| 2098 | 2095 | $x += $w * $wCol02; |
| 2099 | 2096 | |
| 2100 | 2097 | $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ? |
| 2101 | - number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".").'%' :''; |
|
| 2098 | + number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".") . '%' : ''; |
|
| 2102 | 2099 | $aFont = $this->formatNegrito; |
| 2103 | 2100 | $this->pTextBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2104 | 2101 | |
@@ -2268,13 +2265,13 @@ discard block |
||
| 2268 | 2265 | $chaveNFe = $this->infNFe->item($k)->getElementsByTagName('chave')->item(0)->nodeValue; |
| 2269 | 2266 | $this->arrayNFe[] = $chaveNFe; |
| 2270 | 2267 | } |
| 2271 | - if (count($this->arrayNFe) >15) { |
|
| 2268 | + if (count($this->arrayNFe) > 15) { |
|
| 2272 | 2269 | $this->flagDocOrigContinuacao = 1; |
| 2273 | 2270 | $totPag = '2'; |
| 2274 | 2271 | } else { |
| 2275 | 2272 | $totPag = '1'; |
| 2276 | 2273 | } |
| 2277 | - $totPag = count($this->arrayNFe) >15 ? '2' : '1'; |
|
| 2274 | + $totPag = count($this->arrayNFe) > 15 ? '2' : '1'; |
|
| 2278 | 2275 | $r = $this->zCabecalho(1, 1, '1', $totPag); |
| 2279 | 2276 | $contador = 0; |
| 2280 | 2277 | while ($contador < count($this->arrayNFe)) { |
@@ -2375,9 +2372,9 @@ discard block |
||
| 2375 | 2372 | //$h = 6 + 3; // de altura do texto (primeira linha |
| 2376 | 2373 | //$h = 9 + 3.5 ;// segunda linha |
| 2377 | 2374 | //$h = 9 + 3.5+ 3.5 ;// segunda linha |
| 2378 | - $h = (( ( count($this->arrayNFe)/2 ) - 9) * 3.5)+9; |
|
| 2379 | - if (count($this->arrayNFe)%2 !=0) { |
|
| 2380 | - $h = $h+3.5; |
|
| 2375 | + $h = (((count($this->arrayNFe) / 2) - 9) * 3.5) + 9; |
|
| 2376 | + if (count($this->arrayNFe) % 2 != 0) { |
|
| 2377 | + $h = $h + 3.5; |
|
| 2381 | 2378 | } // Caso tenha apenas 1 registro na ultima linha |
| 2382 | 2379 | |
| 2383 | 2380 | $texto = 'DOCUMENTOS ORIGINÁRIOS - CONTINUACÃO'; |
@@ -2638,22 +2635,22 @@ discard block |
||
| 2638 | 2635 | $x += $w * 0.23; |
| 2639 | 2636 | |
| 2640 | 2637 | //$this->pdf->Line($x, $y, $x, $y + 8.5); |
| 2641 | - $this->pdf->Line($x-20, $y, $x-20, $y + 8.5); // LINHA A FRENTE DA RNTRC DA EMPRESA |
|
| 2638 | + $this->pdf->Line($x - 20, $y, $x - 20, $y + 8.5); // LINHA A FRENTE DA RNTRC DA EMPRESA |
|
| 2642 | 2639 | $texto = 'CIOT'; |
| 2643 | 2640 | $aFont = $this->formatPadrao; |
| 2644 | - $this->pTextBox($x-20, $y, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2641 | + $this->pTextBox($x - 20, $y, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2645 | 2642 | $texto = $this->getTagValue($this->rodo, "CIOT"); |
| 2646 | 2643 | $aFont = $this->formatNegrito; |
| 2647 | - $this->pTextBox($x-20, $y + 3, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2644 | + $this->pTextBox($x - 20, $y + 3, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2648 | 2645 | |
| 2649 | 2646 | //$this->pdf->Line($x, $y, $x, $y + 8.5); |
| 2650 | - $this->pdf->Line($x+10, $y, $x+10, $y + 8.5); // LINHA A FRENTE DO CIOT |
|
| 2647 | + $this->pdf->Line($x + 10, $y, $x + 10, $y + 8.5); // LINHA A FRENTE DO CIOT |
|
| 2651 | 2648 | $texto = 'LOTAÇÃO'; |
| 2652 | 2649 | $aFont = $this->formatPadrao; |
| 2653 | - $this->pTextBox($x+10, $y, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2650 | + $this->pTextBox($x + 10, $y, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2654 | 2651 | $texto = $lotacao; |
| 2655 | 2652 | $aFont = $this->formatNegrito; |
| 2656 | - $this->pTextBox($x+10, $y + 3, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2653 | + $this->pTextBox($x + 10, $y + 3, $w * 0.13, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2657 | 2654 | |
| 2658 | 2655 | $x += $w * 0.13; |
| 2659 | 2656 | $this->pdf->Line($x, $y, $x, $y + 8.5); |
@@ -2777,7 +2774,7 @@ discard block |
||
| 2777 | 2774 | 'style' => ''); |
| 2778 | 2775 | $this->pTextBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2779 | 2776 | //$texto = !empty($this->moto) ? $this->getTagValue($this->moto, "CPF") : ''; // CPF SEM MASCARA |
| 2780 | - $texto = !empty($this->moto) ? $this->zFormatCNPJCPF($this->moto) : ''; // CPF COM MASCARA |
|
| 2777 | + $texto = !empty($this->moto) ? $this->zFormatCNPJCPF($this->moto) : ''; // CPF COM MASCARA |
|
| 2781 | 2778 | $aFont = array( |
| 2782 | 2779 | 'font' => $this->fontePadrao, |
| 2783 | 2780 | 'size' => 7, |
@@ -3282,7 +3279,7 @@ discard block |
||
| 3282 | 3279 | */ |
| 3283 | 3280 | protected function zCanhoto($x = 0, $y = 0) |
| 3284 | 3281 | { |
| 3285 | - $this->zhDashedLine($x, $y+2, $this->wPrint, 0.1, 80); |
|
| 3282 | + $this->zhDashedLine($x, $y + 2, $this->wPrint, 0.1, 80); |
|
| 3286 | 3283 | $y = $y + 2; |
| 3287 | 3284 | $oldX = $x; |
| 3288 | 3285 | $oldY = $y; |
@@ -3321,7 +3318,7 @@ discard block |
||
| 3321 | 3318 | |
| 3322 | 3319 | $this->pdf->Line($x, $y, $x, $y + 16.5); |
| 3323 | 3320 | |
| 3324 | - $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n". "\r\n"; |
|
| 3321 | + $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n" . "\r\n"; |
|
| 3325 | 3322 | $texto .= ' INÍCIO DA PRESTAÇÃO - DATA/HORA'; |
| 3326 | 3323 | $aFont = array( |
| 3327 | 3324 | 'font' => $this->fontePadrao, |
@@ -3331,14 +3328,14 @@ discard block |
||
| 3331 | 3328 | $x = $oldX; |
| 3332 | 3329 | $y = $y + 5; |
| 3333 | 3330 | |
| 3334 | - $this->pdf->Line($x, $y+3, $w * 0.255, $y+3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
| 3331 | + $this->pdf->Line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
| 3335 | 3332 | |
| 3336 | 3333 | $texto = 'RG'; |
| 3337 | 3334 | $aFont = array( |
| 3338 | 3335 | 'font' => $this->fontePadrao, |
| 3339 | 3336 | 'size' => 6, |
| 3340 | 3337 | 'style' => ''); |
| 3341 | - $this->pTextBox($x, $y+3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3338 | + $this->pTextBox($x, $y + 3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3342 | 3339 | $x += $w * 0.85; |
| 3343 | 3340 | |
| 3344 | 3341 | $this->pdf->Line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E |