@@ -8,64 +8,64 @@ discard block |
||
| 8 | 8 | { |
| 9 | 9 | const FPDF_VERSION = '1.6'; |
| 10 | 10 | |
| 11 | - public $page; //current page number |
|
| 12 | - public $n; //current object number |
|
| 13 | - public $offsets; //array of object offsets |
|
| 14 | - public $buffer; //buffer holding in-memory PDF |
|
| 15 | - public $pages; //array containing pages |
|
| 16 | - public $state; //current document state |
|
| 17 | - public $compress; //compression flag |
|
| 18 | - public $k; //scale factor (number of points in user unit) |
|
| 19 | - public $defOrientation; //default orientation |
|
| 20 | - public $curOrientation; //current orientation |
|
| 21 | - public $pageFormats; //available page formats |
|
| 22 | - public $defPageFormat; //default page format |
|
| 23 | - public $curPageFormat; //current page format |
|
| 24 | - public $pageSizes; //array storing non-default page sizes |
|
| 11 | + public $page; //current page number |
|
| 12 | + public $n; //current object number |
|
| 13 | + public $offsets; //array of object offsets |
|
| 14 | + public $buffer; //buffer holding in-memory PDF |
|
| 15 | + public $pages; //array containing pages |
|
| 16 | + public $state; //current document state |
|
| 17 | + public $compress; //compression flag |
|
| 18 | + public $k; //scale factor (number of points in user unit) |
|
| 19 | + public $defOrientation; //default orientation |
|
| 20 | + public $curOrientation; //current orientation |
|
| 21 | + public $pageFormats; //available page formats |
|
| 22 | + public $defPageFormat; //default page format |
|
| 23 | + public $curPageFormat; //current page format |
|
| 24 | + public $pageSizes; //array storing non-default page sizes |
|
| 25 | 25 | public $wPt; |
| 26 | - public $hPt; //dimensions of current page in points |
|
| 26 | + public $hPt; //dimensions of current page in points |
|
| 27 | 27 | public $w; |
| 28 | - public $h; //dimensions of current page in user unit |
|
| 29 | - public $lMargin; //left margin |
|
| 30 | - public $tMargin; //top margin |
|
| 31 | - public $rMargin; //right margin |
|
| 32 | - public $bMargin; //page break margin |
|
| 33 | - public $cMargin; //cell margin |
|
| 28 | + public $h; //dimensions of current page in user unit |
|
| 29 | + public $lMargin; //left margin |
|
| 30 | + public $tMargin; //top margin |
|
| 31 | + public $rMargin; //right margin |
|
| 32 | + public $bMargin; //page break margin |
|
| 33 | + public $cMargin; //cell margin |
|
| 34 | 34 | public $x; |
| 35 | - public $y; //current position in user unit |
|
| 36 | - public $lasth; //height of last printed cell |
|
| 37 | - public $lineWidth; //line width in user unit |
|
| 38 | - public $coreFonts; //array of standard font names |
|
| 39 | - public $fonts; //array of used fonts |
|
| 40 | - public $fontFiles; //array of font files |
|
| 41 | - public $diffs; //array of encoding differences |
|
| 42 | - public $fontFamily; //current font family |
|
| 43 | - public $fontStyle; //current font style |
|
| 44 | - public $underline; //underlining flag |
|
| 45 | - public $currentFont; //current font info |
|
| 46 | - public $fontSizePt; //current font size in points |
|
| 47 | - public $fontSize; //current font size in user unit |
|
| 48 | - public $drawColor; //commands for drawing color |
|
| 49 | - public $fillColor; //commands for filling color |
|
| 50 | - public $textColor; //commands for text color |
|
| 51 | - public $colorFlag; //indicates whether fill and text colors are different |
|
| 52 | - public $ws; //word spacing |
|
| 53 | - public $images; //array of used images |
|
| 54 | - public $PageLinks; //array of links in pages |
|
| 55 | - public $links; //array of internal links |
|
| 56 | - public $autoPageBreak; //automatic page breaking |
|
| 57 | - public $pageBreakTrigger; //threshold used to trigger page breaks |
|
| 58 | - public $inHeader; //flag set when processing header |
|
| 59 | - public $inFooter; //flag set when processing footer |
|
| 60 | - public $zoomMode; //zoom display mode |
|
| 61 | - public $layoutMode; //layout display mode |
|
| 62 | - public $title; //title |
|
| 63 | - public $subject; //subject |
|
| 64 | - public $author; //author |
|
| 65 | - public $keywords; //keywords |
|
| 66 | - public $creator; //creator |
|
| 67 | - public $aliasNbPages; //alias for total number of pages |
|
| 68 | - public $pdfVersion; //PDF version number |
|
| 35 | + public $y; //current position in user unit |
|
| 36 | + public $lasth; //height of last printed cell |
|
| 37 | + public $lineWidth; //line width in user unit |
|
| 38 | + public $coreFonts; //array of standard font names |
|
| 39 | + public $fonts; //array of used fonts |
|
| 40 | + public $fontFiles; //array of font files |
|
| 41 | + public $diffs; //array of encoding differences |
|
| 42 | + public $fontFamily; //current font family |
|
| 43 | + public $fontStyle; //current font style |
|
| 44 | + public $underline; //underlining flag |
|
| 45 | + public $currentFont; //current font info |
|
| 46 | + public $fontSizePt; //current font size in points |
|
| 47 | + public $fontSize; //current font size in user unit |
|
| 48 | + public $drawColor; //commands for drawing color |
|
| 49 | + public $fillColor; //commands for filling color |
|
| 50 | + public $textColor; //commands for text color |
|
| 51 | + public $colorFlag; //indicates whether fill and text colors are different |
|
| 52 | + public $ws; //word spacing |
|
| 53 | + public $images; //array of used images |
|
| 54 | + public $PageLinks; //array of links in pages |
|
| 55 | + public $links; //array of internal links |
|
| 56 | + public $autoPageBreak; //automatic page breaking |
|
| 57 | + public $pageBreakTrigger; //threshold used to trigger page breaks |
|
| 58 | + public $inHeader; //flag set when processing header |
|
| 59 | + public $inFooter; //flag set when processing footer |
|
| 60 | + public $zoomMode; //zoom display mode |
|
| 61 | + public $layoutMode; //layout display mode |
|
| 62 | + public $title; //title |
|
| 63 | + public $subject; //subject |
|
| 64 | + public $author; //author |
|
| 65 | + public $keywords; //keywords |
|
| 66 | + public $creator; //creator |
|
| 67 | + public $aliasNbPages; //alias for total number of pages |
|
| 68 | + public $pdfVersion; //PDF version number |
|
| 69 | 69 | |
| 70 | 70 | public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4') |
| 71 | 71 | { |
@@ -116,21 +116,21 @@ discard block |
||
| 116 | 116 | if ($unit == 'pt') { |
| 117 | 117 | $this->k = 1; |
| 118 | 118 | } elseif ($unit == 'mm') { |
| 119 | - $this->k = 72/25.4; |
|
| 119 | + $this->k = 72 / 25.4; |
|
| 120 | 120 | } elseif ($unit == 'cm') { |
| 121 | - $this->k = 72/2.54; |
|
| 121 | + $this->k = 72 / 2.54; |
|
| 122 | 122 | } elseif ($unit == 'in') { |
| 123 | 123 | $this->k = 72; |
| 124 | 124 | } else { |
| 125 | - $this->error('Incorrect unit: '.$unit); |
|
| 125 | + $this->error('Incorrect unit: ' . $unit); |
|
| 126 | 126 | } |
| 127 | 127 | //Page format |
| 128 | 128 | $this->pageFormats = [ |
| 129 | - 'a3' => [841.89,1190.55], |
|
| 130 | - 'a4' => [595.28,841.89], |
|
| 131 | - 'a5' => [420.94,595.28], |
|
| 132 | - 'letter' => [612,792], |
|
| 133 | - 'legal' => [612,1008] |
|
| 129 | + 'a3' => [841.89, 1190.55], |
|
| 130 | + 'a4' => [595.28, 841.89], |
|
| 131 | + 'a5' => [420.94, 595.28], |
|
| 132 | + 'letter' => [612, 792], |
|
| 133 | + 'legal' => [612, 1008] |
|
| 134 | 134 | ]; |
| 135 | 135 | if (is_string($format)) { |
| 136 | 136 | $format = $this->getpageformat($format); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | //Page orientation |
| 141 | 141 | $orientation = strtolower($orientation); |
| 142 | 142 | if ($orientation == 'p' || $orientation == 'portrait') { |
| 143 | - $this->defOrientation='P'; |
|
| 143 | + $this->defOrientation = 'P'; |
|
| 144 | 144 | $this->w = $this->defPageFormat[0]; |
| 145 | 145 | $this->h = $this->defPageFormat[1]; |
| 146 | 146 | } elseif ($orientation == 'l' || $orientation == 'landscape') { |
@@ -148,26 +148,26 @@ discard block |
||
| 148 | 148 | $this->w = $this->defPageFormat[1]; |
| 149 | 149 | $this->h = $this->defPageFormat[0]; |
| 150 | 150 | } else { |
| 151 | - $this->error('Incorrect orientation: '.$orientation); |
|
| 151 | + $this->error('Incorrect orientation: ' . $orientation); |
|
| 152 | 152 | } |
| 153 | 153 | $this->curOrientation = $this->defOrientation; |
| 154 | - $this->wPt = $this->w*$this->k; |
|
| 155 | - $this->hPt = $this->h*$this->k; |
|
| 154 | + $this->wPt = $this->w * $this->k; |
|
| 155 | + $this->hPt = $this->h * $this->k; |
|
| 156 | 156 | //Page margins (1 cm) |
| 157 | - $margin = 28.35/$this->k; |
|
| 157 | + $margin = 28.35 / $this->k; |
|
| 158 | 158 | $this->setMargins($margin, $margin); |
| 159 | 159 | //Interior cell margin (1 mm) |
| 160 | - $this->cMargin = $margin/10; |
|
| 160 | + $this->cMargin = $margin / 10; |
|
| 161 | 161 | //Line width (0.2 mm) |
| 162 | - $this->lineWidth = .567/$this->k; |
|
| 162 | + $this->lineWidth = .567 / $this->k; |
|
| 163 | 163 | //Automatic page break |
| 164 | - $this->setAutoPageBreak(true, 2*$margin); |
|
| 164 | + $this->setAutoPageBreak(true, 2 * $margin); |
|
| 165 | 165 | //Full width display mode |
| 166 | 166 | $this->setDisplayMode('fullwidth'); |
| 167 | 167 | //Enable compression |
| 168 | 168 | $this->setCompression(true); |
| 169 | 169 | //Set default PDF version number |
| 170 | - $this->pdfVersion='1.3'; |
|
| 170 | + $this->pdfVersion = '1.3'; |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | public function setMargins($left, $top, $right = null) |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | if ($right === null) { |
| 179 | 179 | $right = $left; |
| 180 | 180 | } |
| 181 | - $this->rMargin=$right; |
|
| 181 | + $this->rMargin = $right; |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | public function setLeftMargin($margin) |
@@ -207,21 +207,21 @@ discard block |
||
| 207 | 207 | //Set auto page break mode and triggering margin |
| 208 | 208 | $this->autoPageBreak = $auto; |
| 209 | 209 | $this->bMargin = $margin; |
| 210 | - $this->pageBreakTrigger = $this->h-$margin; |
|
| 210 | + $this->pageBreakTrigger = $this->h - $margin; |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | public function setDisplayMode($zoom, $layout = 'continuous') |
| 214 | 214 | { |
| 215 | 215 | //Set display mode in viewer |
| 216 | - if ($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom)) { |
|
| 216 | + if ($zoom == 'fullpage' || $zoom == 'fullwidth' || $zoom == 'real' || $zoom == 'default' || !is_string($zoom)) { |
|
| 217 | 217 | $this->zoomMode = $zoom; |
| 218 | 218 | } else { |
| 219 | - $this->error('Incorrect zoom display mode: '.$zoom); |
|
| 219 | + $this->error('Incorrect zoom display mode: ' . $zoom); |
|
| 220 | 220 | } |
| 221 | - if ($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default') { |
|
| 221 | + if ($layout == 'single' || $layout == 'continuous' || $layout == 'two' || $layout == 'default') { |
|
| 222 | 222 | $this->layoutMode = $layout; |
| 223 | 223 | } else { |
| 224 | - $this->error('Incorrect layout display mode: '.$layout); |
|
| 224 | + $this->error('Incorrect layout display mode: ' . $layout); |
|
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | if ($isUTF8) { |
| 260 | 260 | $author = $this->utf8Toutf16($author); |
| 261 | 261 | } |
| 262 | - $this->author=$author; |
|
| 262 | + $this->author = $author; |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | public function setKeywords($keywords, $isUTF8 = false) |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | public function aliasNbPages($alias = '{nb}') |
| 284 | 284 | { |
| 285 | 285 | //Define an alias for total number of pages |
| 286 | - $this->aliasNbPages=$alias; |
|
| 286 | + $this->aliasNbPages = $alias; |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | public function error($msg) |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | $this->open(); |
| 323 | 323 | } |
| 324 | 324 | $family = $this->fontFamily; |
| 325 | - $style = $this->fontStyle.($this->underline ? 'U' : ''); |
|
| 325 | + $style = $this->fontStyle . ($this->underline ? 'U' : ''); |
|
| 326 | 326 | $size = $this->fontSizePt; |
| 327 | 327 | $lw = $this->lineWidth; |
| 328 | 328 | $dc = $this->drawColor; |
@@ -343,14 +343,14 @@ discard block |
||
| 343 | 343 | $this->out('2 J'); |
| 344 | 344 | //Set line width |
| 345 | 345 | $this->lineWidth = $lw; |
| 346 | - $this->out(sprintf('%.2F w', $lw*$this->k)); |
|
| 346 | + $this->out(sprintf('%.2F w', $lw * $this->k)); |
|
| 347 | 347 | //Set font |
| 348 | 348 | if ($family) { |
| 349 | 349 | $this->setFont($family, $style, $size); |
| 350 | 350 | } |
| 351 | 351 | //Set colors |
| 352 | 352 | $this->drawColor = $dc; |
| 353 | - if ($dc!='0 G') { |
|
| 353 | + if ($dc != '0 G') { |
|
| 354 | 354 | $this->out($dc); |
| 355 | 355 | } |
| 356 | 356 | $this->fillColor = $fc; |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | //Restore line width |
| 367 | 367 | if ($this->lineWidth != $lw) { |
| 368 | 368 | $this->lineWidth = $lw; |
| 369 | - $this->out(sprintf('%.2F w', $lw*$this->k)); |
|
| 369 | + $this->out(sprintf('%.2F w', $lw * $this->k)); |
|
| 370 | 370 | } |
| 371 | 371 | //Restore font |
| 372 | 372 | if ($family) { |
@@ -404,10 +404,10 @@ discard block |
||
| 404 | 404 | public function setDrawColor($r, $g = null, $b = null) |
| 405 | 405 | { |
| 406 | 406 | //Set color for all stroking operations |
| 407 | - if (($r==0 && $g==0 && $b==0) || $g===null) { |
|
| 408 | - $this->drawColor = sprintf('%.3F G', $r/255); |
|
| 407 | + if (($r == 0 && $g == 0 && $b == 0) || $g === null) { |
|
| 408 | + $this->drawColor = sprintf('%.3F G', $r / 255); |
|
| 409 | 409 | } else { |
| 410 | - $this->drawColor = sprintf('%.3F %.3F %.3F RG', $r/255, $g/255, $b/255); |
|
| 410 | + $this->drawColor = sprintf('%.3F %.3F %.3F RG', $r / 255, $g / 255, $b / 255); |
|
| 411 | 411 | } |
| 412 | 412 | if ($this->page > 0) { |
| 413 | 413 | $this->out($this->drawColor); |
@@ -417,10 +417,10 @@ discard block |
||
| 417 | 417 | public function setFillColor($r, $g = null, $b = null) |
| 418 | 418 | { |
| 419 | 419 | //Set color for all filling operations |
| 420 | - if (($r==0 && $g==0 && $b==0) || $g===null) { |
|
| 421 | - $this->fillColor = sprintf('%.3F g', $r/255); |
|
| 420 | + if (($r == 0 && $g == 0 && $b == 0) || $g === null) { |
|
| 421 | + $this->fillColor = sprintf('%.3F g', $r / 255); |
|
| 422 | 422 | } else { |
| 423 | - $this->fillColor = sprintf('%.3F %.3F %.3F rg', $r/255, $g/255, $b/255); |
|
| 423 | + $this->fillColor = sprintf('%.3F %.3F %.3F rg', $r / 255, $g / 255, $b / 255); |
|
| 424 | 424 | } |
| 425 | 425 | $this->colorFlag = ($this->fillColor != $this->textColor); |
| 426 | 426 | if ($this->page > 0) { |
@@ -431,10 +431,10 @@ discard block |
||
| 431 | 431 | public function settextColor($r, $g = null, $b = null) |
| 432 | 432 | { |
| 433 | 433 | //Set color for text |
| 434 | - if (($r==0 && $g==0 && $b==0) || $g===null) { |
|
| 435 | - $this->textColor = sprintf('%.3F g', $r/255); |
|
| 434 | + if (($r == 0 && $g == 0 && $b == 0) || $g === null) { |
|
| 435 | + $this->textColor = sprintf('%.3F g', $r / 255); |
|
| 436 | 436 | } else { |
| 437 | - $this->textColor = sprintf('%.3F %.3F %.3F rg', $r/255, $g/255, $b/255); |
|
| 437 | + $this->textColor = sprintf('%.3F %.3F %.3F rg', $r / 255, $g / 255, $b / 255); |
|
| 438 | 438 | } |
| 439 | 439 | $this->colorFlag = ($this->fillColor != $this->textColor); |
| 440 | 440 | } |
@@ -442,14 +442,14 @@ discard block |
||
| 442 | 442 | public function getStringWidth($s) |
| 443 | 443 | { |
| 444 | 444 | //Get width of a string in the current font |
| 445 | - $s = (string)$s; |
|
| 446 | - $cw =& $this->currentFont['cw']; |
|
| 445 | + $s = (string) $s; |
|
| 446 | + $cw = & $this->currentFont['cw']; |
|
| 447 | 447 | $w = 0; |
| 448 | 448 | $l = strlen($s); |
| 449 | - for ($i=0; $i<$l; $i++) { |
|
| 449 | + for ($i = 0; $i < $l; $i++) { |
|
| 450 | 450 | $w += $cw[$s[$i]]; |
| 451 | 451 | } |
| 452 | - return $w*$this->fontSize/1000; |
|
| 452 | + return $w * $this->fontSize / 1000; |
|
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | public function setLineWidth($width) |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | //Set line width |
| 458 | 458 | $this->lineWidth = $width; |
| 459 | 459 | if ($this->page > 0) { |
| 460 | - $this->out(sprintf('%.2F w', $width*$this->k)); |
|
| 460 | + $this->out(sprintf('%.2F w', $width * $this->k)); |
|
| 461 | 461 | } |
| 462 | 462 | } |
| 463 | 463 | |
@@ -467,10 +467,10 @@ discard block |
||
| 467 | 467 | $this->out( |
| 468 | 468 | sprintf( |
| 469 | 469 | '%.2F %.2F m %.2F %.2F l S', |
| 470 | - $x1*$this->k, |
|
| 471 | - ($this->h-$y1)*$this->k, |
|
| 472 | - $x2*$this->k, |
|
| 473 | - ($this->h-$y2)*$this->k |
|
| 470 | + $x1 * $this->k, |
|
| 471 | + ($this->h - $y1) * $this->k, |
|
| 472 | + $x2 * $this->k, |
|
| 473 | + ($this->h - $y2) * $this->k |
|
| 474 | 474 | ) |
| 475 | 475 | ); |
| 476 | 476 | } |
@@ -488,10 +488,10 @@ discard block |
||
| 488 | 488 | $this->out( |
| 489 | 489 | sprintf( |
| 490 | 490 | '%.2F %.2F %.2F %.2F re %s', |
| 491 | - $x*$this->k, |
|
| 492 | - ($this->h-$y)*$this->k, |
|
| 493 | - $w*$this->k, |
|
| 494 | - -$h*$this->k, |
|
| 491 | + $x * $this->k, |
|
| 492 | + ($this->h - $y) * $this->k, |
|
| 493 | + $w * $this->k, |
|
| 494 | + -$h * $this->k, |
|
| 495 | 495 | $op |
| 496 | 496 | ) |
| 497 | 497 | ); |
@@ -502,24 +502,24 @@ discard block |
||
| 502 | 502 | //Add a TrueType or Type1 font |
| 503 | 503 | $family = strtolower($family); |
| 504 | 504 | if ($file == '') { |
| 505 | - $file = str_replace(' ', '', $family).strtolower($style).'.php'; |
|
| 505 | + $file = str_replace(' ', '', $family) . strtolower($style) . '.php'; |
|
| 506 | 506 | } |
| 507 | - if ($family=='arial') { |
|
| 508 | - $family='helvetica'; |
|
| 507 | + if ($family == 'arial') { |
|
| 508 | + $family = 'helvetica'; |
|
| 509 | 509 | } |
| 510 | 510 | $style = strtoupper($style); |
| 511 | 511 | if ($style == 'IB') { |
| 512 | 512 | $style = 'BI'; |
| 513 | 513 | } |
| 514 | - $fontkey = $family.$style; |
|
| 514 | + $fontkey = $family . $style; |
|
| 515 | 515 | if (isset($this->fonts[$fontkey])) { |
| 516 | 516 | return; |
| 517 | 517 | } |
| 518 | - include $this->getFontPath().$file; |
|
| 518 | + include $this->getFontPath() . $file; |
|
| 519 | 519 | if (!isset($name)) { |
| 520 | 520 | $this->error('Could not include font definition file'); |
| 521 | 521 | } |
| 522 | - $i = count($this->fonts)+1; |
|
| 522 | + $i = count($this->fonts) + 1; |
|
| 523 | 523 | $this->fonts[$fontkey] = [ |
| 524 | 524 | 'i'=>$i, |
| 525 | 525 | 'type'=>$type, |
@@ -535,20 +535,20 @@ discard block |
||
| 535 | 535 | //Search existing encodings |
| 536 | 536 | $d = 0; |
| 537 | 537 | $nb = count($this->diffs); |
| 538 | - for ($i=1; $i<=$nb; $i++) { |
|
| 538 | + for ($i = 1; $i <= $nb; $i++) { |
|
| 539 | 539 | if ($this->diffs[$i] == $diff) { |
| 540 | 540 | $d = $i; |
| 541 | 541 | break; |
| 542 | 542 | } |
| 543 | 543 | } |
| 544 | 544 | if ($d == 0) { |
| 545 | - $d = $nb+1; |
|
| 545 | + $d = $nb + 1; |
|
| 546 | 546 | $this->diffs[$d] = $diff; |
| 547 | 547 | } |
| 548 | 548 | $this->fonts[$fontkey]['diff'] = $d; |
| 549 | 549 | } |
| 550 | 550 | if ($file) { |
| 551 | - if ($type=='TrueType') { |
|
| 551 | + if ($type == 'TrueType') { |
|
| 552 | 552 | $this->fontFiles[$file] = ['length1'=>$originalsize]; |
| 553 | 553 | } else { |
| 554 | 554 | $this->fontFiles[$file] = ['length1'=>$size1, 'length2'=>$size2]; |
@@ -583,39 +583,39 @@ discard block |
||
| 583 | 583 | $size = $this->fontSizePt; |
| 584 | 584 | } |
| 585 | 585 | //Test if font is already selected |
| 586 | - if ($this->fontFamily==$family && $this->fontStyle==$style && $this->fontSizePt==$size) { |
|
| 586 | + if ($this->fontFamily == $family && $this->fontStyle == $style && $this->fontSizePt == $size) { |
|
| 587 | 587 | return; |
| 588 | 588 | } |
| 589 | 589 | //Test if used for the first time |
| 590 | - $fontkey = $family.$style; |
|
| 590 | + $fontkey = $family . $style; |
|
| 591 | 591 | if (!isset($this->fonts[$fontkey])) { |
| 592 | 592 | //Check if one of the standard fonts |
| 593 | 593 | if (isset($this->coreFonts[$fontkey])) { |
| 594 | 594 | if (!isset($fpdf_charwidths[$fontkey])) { |
| 595 | 595 | //Load metric file |
| 596 | - $file=$family; |
|
| 597 | - if ($family=='times' || $family=='helvetica') { |
|
| 596 | + $file = $family; |
|
| 597 | + if ($family == 'times' || $family == 'helvetica') { |
|
| 598 | 598 | $file .= strtolower($style); |
| 599 | 599 | } |
| 600 | - include $this->getFontPath().$file.'.php'; |
|
| 600 | + include $this->getFontPath() . $file . '.php'; |
|
| 601 | 601 | if (!isset($fpdf_charwidths[$fontkey])) { |
| 602 | 602 | $this->error('Could not include font metric file'); |
| 603 | 603 | } |
| 604 | 604 | } |
| 605 | - $i = count($this->fonts)+1; |
|
| 605 | + $i = count($this->fonts) + 1; |
|
| 606 | 606 | $name = $this->coreFonts[$fontkey]; |
| 607 | 607 | $cw = $fpdf_charwidths[$fontkey]; |
| 608 | 608 | $this->fonts[$fontkey] = ['i'=>$i, 'type'=>'core', 'name'=>$name, 'up'=>-100, 'ut'=>50, 'cw'=>$cw]; |
| 609 | 609 | } else { |
| 610 | - $this->error('Undefined font: '.$family.' '.$style); |
|
| 610 | + $this->error('Undefined font: ' . $family . ' ' . $style); |
|
| 611 | 611 | } |
| 612 | 612 | } |
| 613 | 613 | //Select it |
| 614 | 614 | $this->fontFamily = $family; |
| 615 | 615 | $this->fontStyle = $style; |
| 616 | 616 | $this->fontSizePt = $size; |
| 617 | - $this->fontSize = $size/$this->k; |
|
| 618 | - $this->currentFont =& $this->fonts[$fontkey]; |
|
| 617 | + $this->fontSize = $size / $this->k; |
|
| 618 | + $this->currentFont = & $this->fonts[$fontkey]; |
|
| 619 | 619 | if ($this->page > 0) { |
| 620 | 620 | $this->out(sprintf('BT /F%d %.2F Tf ET', $this->currentFont['i'], $this->fontSizePt)); |
| 621 | 621 | } |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | return; |
| 629 | 629 | } |
| 630 | 630 | $this->fontSizePt = $size; |
| 631 | - $this->fontSize = $size/$this->k; |
|
| 631 | + $this->fontSize = $size / $this->k; |
|
| 632 | 632 | if ($this->page > 0) { |
| 633 | 633 | $this->out(sprintf('BT /F%d %.2F Tf ET', $this->currentFont['i'], $this->fontSizePt)); |
| 634 | 634 | } |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | public function addlink() |
| 638 | 638 | { |
| 639 | 639 | //Create a new internal link |
| 640 | - $n = count($this->links)+1; |
|
| 640 | + $n = count($this->links) + 1; |
|
| 641 | 641 | $this->links[$n] = [0, 0]; |
| 642 | 642 | return $n; |
| 643 | 643 | } |
@@ -658,10 +658,10 @@ discard block |
||
| 658 | 658 | { |
| 659 | 659 | //Put a link on the page |
| 660 | 660 | $this->PageLinks[$this->page][] = [ |
| 661 | - $x*$this->k, |
|
| 662 | - $this->hPt-$y*$this->k, |
|
| 663 | - $w*$this->k, |
|
| 664 | - $h*$this->k, |
|
| 661 | + $x * $this->k, |
|
| 662 | + $this->hPt - $y * $this->k, |
|
| 663 | + $w * $this->k, |
|
| 664 | + $h * $this->k, |
|
| 665 | 665 | $link |
| 666 | 666 | ]; |
| 667 | 667 | } |
@@ -669,12 +669,12 @@ discard block |
||
| 669 | 669 | public function text($x, $y, $txt) |
| 670 | 670 | { |
| 671 | 671 | //Output a string |
| 672 | - $s = sprintf('BT %.2F %.2F Td (%s) Tj ET', $x*$this->k, ($this->h-$y)*$this->k, $this->escape($txt)); |
|
| 673 | - if ($this->underline && $txt!='') { |
|
| 674 | - $s .= ' '.$this->doUnderLine($x, $y, $txt); |
|
| 672 | + $s = sprintf('BT %.2F %.2F Td (%s) Tj ET', $x * $this->k, ($this->h - $y) * $this->k, $this->escape($txt)); |
|
| 673 | + if ($this->underline && $txt != '') { |
|
| 674 | + $s .= ' ' . $this->doUnderLine($x, $y, $txt); |
|
| 675 | 675 | } |
| 676 | 676 | if ($this->colorFlag) { |
| 677 | - $s = 'q '.$this->textColor.' '.$s.' Q'; |
|
| 677 | + $s = 'q ' . $this->textColor . ' ' . $s . ' Q'; |
|
| 678 | 678 | } |
| 679 | 679 | $this->out($s); |
| 680 | 680 | } |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | { |
| 690 | 690 | //Output a cell |
| 691 | 691 | $k = $this->k; |
| 692 | - if ($this->y+$h > $this->pageBreakTrigger |
|
| 692 | + if ($this->y + $h > $this->pageBreakTrigger |
|
| 693 | 693 | && !$this->InHeader |
| 694 | 694 | && !$this->InFooter |
| 695 | 695 | && $this->acceptPageBreak() |
@@ -705,77 +705,77 @@ discard block |
||
| 705 | 705 | $this->x = $x; |
| 706 | 706 | if ($ws > 0) { |
| 707 | 707 | $this->ws = $ws; |
| 708 | - $this->out(sprintf('%.3F Tw', $ws*$k)); |
|
| 708 | + $this->out(sprintf('%.3F Tw', $ws * $k)); |
|
| 709 | 709 | } |
| 710 | 710 | } |
| 711 | 711 | if ($w == 0) { |
| 712 | - $w = $this->w-$this->rMargin-$this->x; |
|
| 712 | + $w = $this->w - $this->rMargin - $this->x; |
|
| 713 | 713 | } |
| 714 | - $s=''; |
|
| 715 | - if ($fill || $border==1) { |
|
| 714 | + $s = ''; |
|
| 715 | + if ($fill || $border == 1) { |
|
| 716 | 716 | if ($fill) { |
| 717 | - $op=($border==1) ? 'B' : 'f'; |
|
| 717 | + $op = ($border == 1) ? 'B' : 'f'; |
|
| 718 | 718 | } else { |
| 719 | - $op='S'; |
|
| 719 | + $op = 'S'; |
|
| 720 | 720 | } |
| 721 | - $s=sprintf('%.2F %.2F %.2F %.2F re %s ', $this->x*$k, ($this->h-$this->y)*$k, $w*$k, -$h*$k, $op); |
|
| 721 | + $s = sprintf('%.2F %.2F %.2F %.2F re %s ', $this->x * $k, ($this->h - $this->y) * $k, $w * $k, -$h * $k, $op); |
|
| 722 | 722 | } |
| 723 | 723 | if (is_string($border)) { |
| 724 | 724 | $x = $this->x; |
| 725 | 725 | $y = $this->y; |
| 726 | 726 | if (strpos($border, 'L') !== false) { |
| 727 | - $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x*$k, ($this->h-$y)*$k, $x*$k, ($this->h-($y+$h))*$k); |
|
| 727 | + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - $y) * $k, $x * $k, ($this->h - ($y + $h)) * $k); |
|
| 728 | 728 | } |
| 729 | 729 | if (strpos($border, 'T') !== false) { |
| 730 | - $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x*$k, ($this->h-$y)*$k, ($x+$w)*$k, ($this->h-$y)*$k); |
|
| 730 | + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - $y) * $k, ($x + $w) * $k, ($this->h - $y) * $k); |
|
| 731 | 731 | } |
| 732 | 732 | if (strpos($border, 'R') !== false) { |
| 733 | 733 | $s .= sprintf( |
| 734 | 734 | '%.2F %.2F m %.2F %.2F l S ', |
| 735 | - ($x+$w)*$k, |
|
| 736 | - ($this->h-$y)*$k, |
|
| 737 | - ($x+$w)*$k, |
|
| 738 | - ($this->h-($y+$h))*$k |
|
| 735 | + ($x + $w) * $k, |
|
| 736 | + ($this->h - $y) * $k, |
|
| 737 | + ($x + $w) * $k, |
|
| 738 | + ($this->h - ($y + $h)) * $k |
|
| 739 | 739 | ); |
| 740 | 740 | } |
| 741 | 741 | if (strpos($border, 'B') !== false) { |
| 742 | 742 | $s .= sprintf( |
| 743 | 743 | '%.2F %.2F m %.2F %.2F l S ', |
| 744 | - $x*$k, |
|
| 745 | - ($this->h-($y+$h))*$k, |
|
| 746 | - ($x+$w)*$k, |
|
| 747 | - ($this->h-($y+$h))*$k |
|
| 744 | + $x * $k, |
|
| 745 | + ($this->h - ($y + $h)) * $k, |
|
| 746 | + ($x + $w) * $k, |
|
| 747 | + ($this->h - ($y + $h)) * $k |
|
| 748 | 748 | ); |
| 749 | 749 | } |
| 750 | 750 | } |
| 751 | 751 | if ($txt !== '') { |
| 752 | 752 | if ($align == 'R') { |
| 753 | - $dx = $w-$this->cMargin-$this->getStringWidth($txt); |
|
| 753 | + $dx = $w - $this->cMargin - $this->getStringWidth($txt); |
|
| 754 | 754 | } elseif ($align == 'C') { |
| 755 | - $dx = ($w-$this->getStringWidth($txt))/2; |
|
| 755 | + $dx = ($w - $this->getStringWidth($txt)) / 2; |
|
| 756 | 756 | } else { |
| 757 | 757 | $dx = $this->cMargin; |
| 758 | 758 | } |
| 759 | 759 | if ($this->colorFlag) { |
| 760 | - $s .= 'q '.$this->textColor.' '; |
|
| 760 | + $s .= 'q ' . $this->textColor . ' '; |
|
| 761 | 761 | } |
| 762 | 762 | $txt2 = str_replace(')', '\\)', str_replace('(', '\\(', str_replace('\\', '\\\\', $txt))); |
| 763 | 763 | $s .= sprintf( |
| 764 | 764 | 'BT %.2F %.2F Td (%s) Tj ET', |
| 765 | - ($this->x+$dx)*$k, |
|
| 766 | - ($this->h-($this->y+.5*$h+.3*$this->fontSize))*$k, |
|
| 765 | + ($this->x + $dx) * $k, |
|
| 766 | + ($this->h - ($this->y + .5 * $h + .3 * $this->fontSize)) * $k, |
|
| 767 | 767 | $txt2 |
| 768 | 768 | ); |
| 769 | 769 | if ($this->underline) { |
| 770 | - $s .= ' '.$this->doUnderLine($this->x+$dx, $this->y+.5*$h+.3*$this->fontSize, $txt); |
|
| 770 | + $s .= ' ' . $this->doUnderLine($this->x + $dx, $this->y + .5 * $h + .3 * $this->fontSize, $txt); |
|
| 771 | 771 | } |
| 772 | 772 | if ($this->colorFlag) { |
| 773 | - $s.=' Q'; |
|
| 773 | + $s .= ' Q'; |
|
| 774 | 774 | } |
| 775 | 775 | if ($link) { |
| 776 | 776 | $this->link( |
| 777 | - $this->x+$dx, |
|
| 778 | - $this->y+.5*$h-.5*$this->fontSize, |
|
| 777 | + $this->x + $dx, |
|
| 778 | + $this->y + .5 * $h - .5 * $this->fontSize, |
|
| 779 | 779 | $this->getStringWidth($txt), |
| 780 | 780 | $this->fontSize, |
| 781 | 781 | $link |
@@ -800,14 +800,14 @@ discard block |
||
| 800 | 800 | public function multicell($w, $h, $txt, $border = 0, $align = 'J', $fill = false) |
| 801 | 801 | { |
| 802 | 802 | //Output text with automatic or explicit line breaks |
| 803 | - $cw =& $this->currentFont['cw']; |
|
| 803 | + $cw = & $this->currentFont['cw']; |
|
| 804 | 804 | if ($w == 0) { |
| 805 | - $w = $this->w-$this->rMargin-$this->x; |
|
| 805 | + $w = $this->w - $this->rMargin - $this->x; |
|
| 806 | 806 | } |
| 807 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
| 807 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
| 808 | 808 | $s = str_replace("\r", '', $txt); |
| 809 | 809 | $nb = strlen($s); |
| 810 | - if ($nb>0 && $s[$nb-1] == "\n") { |
|
| 810 | + if ($nb > 0 && $s[$nb - 1] == "\n") { |
|
| 811 | 811 | $nb--; |
| 812 | 812 | } |
| 813 | 813 | $b = 0; |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | if (strpos($border, 'R') !== false) { |
| 825 | 825 | $b2 .= 'R'; |
| 826 | 826 | } |
| 827 | - $b=(strpos($border, 'T') !== false) ? $b2.'T' : $b2; |
|
| 827 | + $b = (strpos($border, 'T') !== false) ? $b2 . 'T' : $b2; |
|
| 828 | 828 | } |
| 829 | 829 | } |
| 830 | 830 | $sep = -1; |
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | $l = 0; |
| 834 | 834 | $ns = 0; |
| 835 | 835 | $nl = 1; |
| 836 | - while ($i<$nb) { |
|
| 836 | + while ($i < $nb) { |
|
| 837 | 837 | //Get next character |
| 838 | 838 | $c = $s[$i]; |
| 839 | 839 | if ($c == "\n") { |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | $this->ws = 0; |
| 843 | 843 | $this->out('0 Tw'); |
| 844 | 844 | } |
| 845 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
| 845 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
| 846 | 846 | $i++; |
| 847 | 847 | $sep = -1; |
| 848 | 848 | $j = $i; |
@@ -850,7 +850,7 @@ discard block |
||
| 850 | 850 | $ns = 0; |
| 851 | 851 | $nl++; |
| 852 | 852 | if ($border && $nl == 2) { |
| 853 | - $b=$b2; |
|
| 853 | + $b = $b2; |
|
| 854 | 854 | } |
| 855 | 855 | continue; |
| 856 | 856 | } |
@@ -870,14 +870,14 @@ discard block |
||
| 870 | 870 | $this->ws = 0; |
| 871 | 871 | $this->out('0 Tw'); |
| 872 | 872 | } |
| 873 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
| 873 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
| 874 | 874 | } else { |
| 875 | - if ($align=='J') { |
|
| 876 | - $this->ws = ($ns>1) ? ($wmax-$ls)/1000*$this->fontSize/($ns-1) : 0; |
|
| 877 | - $this->out(sprintf('%.3F Tw', $this->ws*$this->k)); |
|
| 875 | + if ($align == 'J') { |
|
| 876 | + $this->ws = ($ns > 1) ? ($wmax - $ls) / 1000 * $this->fontSize / ($ns - 1) : 0; |
|
| 877 | + $this->out(sprintf('%.3F Tw', $this->ws * $this->k)); |
|
| 878 | 878 | } |
| 879 | - $this->cell($w, $h, substr($s, $j, $sep-$j), $b, 2, $align, $fill); |
|
| 880 | - $i = $sep+1; |
|
| 879 | + $this->cell($w, $h, substr($s, $j, $sep - $j), $b, 2, $align, $fill); |
|
| 880 | + $i = $sep + 1; |
|
| 881 | 881 | } |
| 882 | 882 | $sep = -1; |
| 883 | 883 | $j = $i; |
@@ -896,10 +896,10 @@ discard block |
||
| 896 | 896 | $this->ws = 0; |
| 897 | 897 | $this->out('0 Tw'); |
| 898 | 898 | } |
| 899 | - if ($border && strpos($border, 'B')!==false) { |
|
| 899 | + if ($border && strpos($border, 'B') !== false) { |
|
| 900 | 900 | $b .= 'B'; |
| 901 | 901 | } |
| 902 | - $this->cell($w, $h, substr($s, $j, $i-$j), $b, 2, $align, $fill); |
|
| 902 | + $this->cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); |
|
| 903 | 903 | $this->x = $this->lMargin; |
| 904 | 904 | } |
| 905 | 905 | |
@@ -907,9 +907,9 @@ discard block |
||
| 907 | 907 | public function write($h, $txt, $link = '') |
| 908 | 908 | { |
| 909 | 909 | //Output text in flowing mode |
| 910 | - $cw =& $this->currentFont['cw']; |
|
| 911 | - $w = $this->w-$this->rMargin-$this->x; |
|
| 912 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
| 910 | + $cw = & $this->currentFont['cw']; |
|
| 911 | + $w = $this->w - $this->rMargin - $this->x; |
|
| 912 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
| 913 | 913 | $s = str_replace("\r", '', $txt); |
| 914 | 914 | $nb = strlen($s); |
| 915 | 915 | $sep = -1; |
@@ -919,18 +919,18 @@ discard block |
||
| 919 | 919 | $nl = 1; |
| 920 | 920 | while ($i < $nb) { |
| 921 | 921 | //Get next character |
| 922 | - $c=$s[$i]; |
|
| 923 | - if ($c=="\n") { |
|
| 922 | + $c = $s[$i]; |
|
| 923 | + if ($c == "\n") { |
|
| 924 | 924 | //Explicit line break |
| 925 | - $this->cell($w, $h, substr($s, $j, $i-$j), 0, 2, '', 0, $link); |
|
| 925 | + $this->cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link); |
|
| 926 | 926 | $i++; |
| 927 | 927 | $sep = -1; |
| 928 | 928 | $j = $i; |
| 929 | 929 | $l = 0; |
| 930 | 930 | if ($nl == 1) { |
| 931 | 931 | $this->x = $this->lMargin; |
| 932 | - $w = $this->w-$this->rMargin-$this->x; |
|
| 933 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
| 932 | + $w = $this->w - $this->rMargin - $this->x; |
|
| 933 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
| 934 | 934 | } |
| 935 | 935 | $nl++; |
| 936 | 936 | continue; |
@@ -946,8 +946,8 @@ discard block |
||
| 946 | 946 | //Move to next line |
| 947 | 947 | $this->x = $this->lMargin; |
| 948 | 948 | $this->y += $h; |
| 949 | - $w = $this->w-$this->rMargin-$this->x; |
|
| 950 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
| 949 | + $w = $this->w - $this->rMargin - $this->x; |
|
| 950 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
| 951 | 951 | $i++; |
| 952 | 952 | $nl++; |
| 953 | 953 | continue; |
@@ -955,18 +955,18 @@ discard block |
||
| 955 | 955 | if ($i == $j) { |
| 956 | 956 | $i++; |
| 957 | 957 | } |
| 958 | - $this->cell($w, $h, substr($s, $j, $i-$j), 0, 2, '', 0, $link); |
|
| 958 | + $this->cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link); |
|
| 959 | 959 | } else { |
| 960 | - $this->cell($w, $h, substr($s, $j, $sep-$j), 0, 2, '', 0, $link); |
|
| 961 | - $i = $sep+1; |
|
| 960 | + $this->cell($w, $h, substr($s, $j, $sep - $j), 0, 2, '', 0, $link); |
|
| 961 | + $i = $sep + 1; |
|
| 962 | 962 | } |
| 963 | 963 | $sep = -1; |
| 964 | 964 | $j = $i; |
| 965 | 965 | $l = 0; |
| 966 | 966 | if ($nl == 1) { |
| 967 | 967 | $this->x = $this->lMargin; |
| 968 | - $w = $this->w-$this->rMargin-$this->x; |
|
| 969 | - $wmax = ($w-2*$this->cMargin)*1000/$this->fontSize; |
|
| 968 | + $w = $this->w - $this->rMargin - $this->x; |
|
| 969 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->fontSize; |
|
| 970 | 970 | } |
| 971 | 971 | $nl++; |
| 972 | 972 | } else { |
@@ -975,7 +975,7 @@ discard block |
||
| 975 | 975 | } |
| 976 | 976 | //Last chunk |
| 977 | 977 | if ($i != $j) { |
| 978 | - $this->cell($l/1000*$this->fontSize, $h, substr($s, $j), 0, 0, '', 0, $link); |
|
| 978 | + $this->cell($l / 1000 * $this->fontSize, $h, substr($s, $j), 0, 0, '', 0, $link); |
|
| 979 | 979 | } |
| 980 | 980 | } |
| 981 | 981 | |
@@ -998,20 +998,20 @@ discard block |
||
| 998 | 998 | if ($type == '') { |
| 999 | 999 | $pos = strrpos($file, '.'); |
| 1000 | 1000 | if (!$pos) { |
| 1001 | - $this->error('Image file has no extension and no type was specified: '.$file); |
|
| 1001 | + $this->error('Image file has no extension and no type was specified: ' . $file); |
|
| 1002 | 1002 | } |
| 1003 | - $type = substr($file, $pos+1); |
|
| 1003 | + $type = substr($file, $pos + 1); |
|
| 1004 | 1004 | } |
| 1005 | 1005 | $type = strtolower($type); |
| 1006 | 1006 | if ($type == 'jpeg') { |
| 1007 | 1007 | $type = 'jpg'; |
| 1008 | 1008 | } |
| 1009 | - $mtd = 'parse'.strtoupper($type); |
|
| 1009 | + $mtd = 'parse' . strtoupper($type); |
|
| 1010 | 1010 | if (!method_exists($this, $mtd)) { |
| 1011 | - $this->error('Unsupported image type: '.$type); |
|
| 1011 | + $this->error('Unsupported image type: ' . $type); |
|
| 1012 | 1012 | } |
| 1013 | 1013 | $info = $this->$mtd($file); |
| 1014 | - $info['i'] = count($this->images)+1; |
|
| 1014 | + $info['i'] = count($this->images) + 1; |
|
| 1015 | 1015 | $this->images[$file] = $info; |
| 1016 | 1016 | } else { |
| 1017 | 1017 | $info = $this->images[$file]; |
@@ -1019,16 +1019,16 @@ discard block |
||
| 1019 | 1019 | //Automatic width and height calculation if needed |
| 1020 | 1020 | if ($w == 0 && $h == 0) { |
| 1021 | 1021 | //Put image at 72 dpi |
| 1022 | - $w = $info['w']/$this->k; |
|
| 1023 | - $h = $info['h']/$this->k; |
|
| 1022 | + $w = $info['w'] / $this->k; |
|
| 1023 | + $h = $info['h'] / $this->k; |
|
| 1024 | 1024 | } elseif ($w == 0) { |
| 1025 | - $w = $h*$info['w']/$info['h']; |
|
| 1025 | + $w = $h * $info['w'] / $info['h']; |
|
| 1026 | 1026 | } elseif ($h == 0) { |
| 1027 | - $h = $w*$info['h']/$info['w']; |
|
| 1027 | + $h = $w * $info['h'] / $info['w']; |
|
| 1028 | 1028 | } |
| 1029 | 1029 | //Flowing mode |
| 1030 | 1030 | if ($y === null) { |
| 1031 | - if ($this->y+$h > $this->pageBreakTrigger |
|
| 1031 | + if ($this->y + $h > $this->pageBreakTrigger |
|
| 1032 | 1032 | && !$this->inHeader |
| 1033 | 1033 | && !$this->inFooter |
| 1034 | 1034 | && $this->acceptPageBreak() |
@@ -1047,10 +1047,10 @@ discard block |
||
| 1047 | 1047 | $this->out( |
| 1048 | 1048 | sprintf( |
| 1049 | 1049 | 'q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q', |
| 1050 | - $w*$this->k, |
|
| 1051 | - $h*$this->k, |
|
| 1052 | - $x*$this->k, |
|
| 1053 | - ($this->h-($y+$h))*$this->k, |
|
| 1050 | + $w * $this->k, |
|
| 1051 | + $h * $this->k, |
|
| 1052 | + $x * $this->k, |
|
| 1053 | + ($this->h - ($y + $h)) * $this->k, |
|
| 1054 | 1054 | $info['i'] |
| 1055 | 1055 | ) |
| 1056 | 1056 | ); |
@@ -1073,7 +1073,7 @@ discard block |
||
| 1073 | 1073 | if ($x >= 0) { |
| 1074 | 1074 | $this->x = $x; |
| 1075 | 1075 | } else { |
| 1076 | - $this->x = $this->w+$x; |
|
| 1076 | + $this->x = $this->w + $x; |
|
| 1077 | 1077 | } |
| 1078 | 1078 | } |
| 1079 | 1079 | |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | if ($y >= 0) { |
| 1093 | 1093 | $this->y = $y; |
| 1094 | 1094 | } else { |
| 1095 | - $this->y = $this->h+$y; |
|
| 1095 | + $this->y = $this->h + $y; |
|
| 1096 | 1096 | } |
| 1097 | 1097 | } |
| 1098 | 1098 | |
@@ -1139,8 +1139,8 @@ discard block |
||
| 1139 | 1139 | if (headers_sent()) { |
| 1140 | 1140 | $this->error('Some data has already been output, can\'t send PDF file'); |
| 1141 | 1141 | } |
| 1142 | - header('Content-Length: '.strlen($this->buffer)); |
|
| 1143 | - header('Content-Disposition: inline; filename="'.$name.'"'); |
|
| 1142 | + header('Content-Length: ' . strlen($this->buffer)); |
|
| 1143 | + header('Content-Disposition: inline; filename="' . $name . '"'); |
|
| 1144 | 1144 | header('Cache-Control: private, max-age=0, must-revalidate'); |
| 1145 | 1145 | header('Pragma: public'); |
| 1146 | 1146 | ini_set('zlib.output_compression', '0'); |
@@ -1156,8 +1156,8 @@ discard block |
||
| 1156 | 1156 | if (headers_sent()) { |
| 1157 | 1157 | $this->error('Some data has already been output, can\'t send PDF file'); |
| 1158 | 1158 | } |
| 1159 | - header('Content-Length: '.strlen($this->buffer)); |
|
| 1160 | - header('Content-Disposition: attachment; filename="'.$name.'"'); |
|
| 1159 | + header('Content-Length: ' . strlen($this->buffer)); |
|
| 1160 | + header('Content-Disposition: attachment; filename="' . $name . '"'); |
|
| 1161 | 1161 | header('Cache-Control: private, max-age=0, must-revalidate'); |
| 1162 | 1162 | header('Pragma: public'); |
| 1163 | 1163 | ini_set('zlib.output_compression', '0'); |
@@ -1165,9 +1165,9 @@ discard block |
||
| 1165 | 1165 | break; |
| 1166 | 1166 | case 'F': |
| 1167 | 1167 | //Save to local file |
| 1168 | - $f=fopen($name, 'wb'); |
|
| 1168 | + $f = fopen($name, 'wb'); |
|
| 1169 | 1169 | if (!$f) { |
| 1170 | - $this->error('Unable to create output file: '.$name); |
|
| 1170 | + $this->error('Unable to create output file: ' . $name); |
|
| 1171 | 1171 | } |
| 1172 | 1172 | fwrite($f, $this->buffer, strlen($this->buffer)); |
| 1173 | 1173 | fclose($f); |
@@ -1176,7 +1176,7 @@ discard block |
||
| 1176 | 1176 | //Return as a string |
| 1177 | 1177 | return $this->buffer; |
| 1178 | 1178 | default: |
| 1179 | - $this->error('Incorrect output destination: '.$dest); |
|
| 1179 | + $this->error('Incorrect output destination: ' . $dest); |
|
| 1180 | 1180 | } |
| 1181 | 1181 | return ''; |
| 1182 | 1182 | } |
@@ -1185,7 +1185,7 @@ discard block |
||
| 1185 | 1185 | protected function dochecks() |
| 1186 | 1186 | { |
| 1187 | 1187 | //Check availability of %F |
| 1188 | - if (sprintf('%.1F', 1.0)!='1.0') { |
|
| 1188 | + if (sprintf('%.1F', 1.0) != '1.0') { |
|
| 1189 | 1189 | $this->error('This version of PHP is not supported'); |
| 1190 | 1190 | } |
| 1191 | 1191 | //Check mbstring overloading |
@@ -1197,19 +1197,19 @@ discard block |
||
| 1197 | 1197 | |
| 1198 | 1198 | protected function getpageformat($format) |
| 1199 | 1199 | { |
| 1200 | - $format=strtolower($format); |
|
| 1200 | + $format = strtolower($format); |
|
| 1201 | 1201 | if (!isset($this->pageFormats[$format])) { |
| 1202 | - $this->error('Unknown page format: '.$format); |
|
| 1202 | + $this->error('Unknown page format: ' . $format); |
|
| 1203 | 1203 | } |
| 1204 | - $a=$this->pageFormats[$format]; |
|
| 1205 | - return [$a[0]/$this->k, $a[1]/$this->k]; |
|
| 1204 | + $a = $this->pageFormats[$format]; |
|
| 1205 | + return [$a[0] / $this->k, $a[1] / $this->k]; |
|
| 1206 | 1206 | } |
| 1207 | 1207 | |
| 1208 | 1208 | |
| 1209 | 1209 | protected function getFontPath() |
| 1210 | 1210 | { |
| 1211 | - if (!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font')) { |
|
| 1212 | - define('FPDF_FONTPATH', dirname(__FILE__).'/font/'); |
|
| 1211 | + if (!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__) . '/font')) { |
|
| 1212 | + define('FPDF_FONTPATH', dirname(__FILE__) . '/font/'); |
|
| 1213 | 1213 | } |
| 1214 | 1214 | return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : ''; |
| 1215 | 1215 | } |
@@ -1233,12 +1233,12 @@ discard block |
||
| 1233 | 1233 | $format = $this->defPageFormat; |
| 1234 | 1234 | } else { |
| 1235 | 1235 | if (is_string($format)) { |
| 1236 | - $format=$this->getpageformat($format); |
|
| 1236 | + $format = $this->getpageformat($format); |
|
| 1237 | 1237 | } |
| 1238 | 1238 | } |
| 1239 | 1239 | if ($orientation != $this->curOrientation |
| 1240 | - || $format[0]!=$this->curPageFormat[0] |
|
| 1241 | - || $format[1]!=$this->curPageFormat[1] |
|
| 1240 | + || $format[0] != $this->curPageFormat[0] |
|
| 1241 | + || $format[1] != $this->curPageFormat[1] |
|
| 1242 | 1242 | ) { |
| 1243 | 1243 | //New size |
| 1244 | 1244 | if ($orientation == 'P') { |
@@ -1248,9 +1248,9 @@ discard block |
||
| 1248 | 1248 | $this->w = $format[1]; |
| 1249 | 1249 | $this->h = $format[0]; |
| 1250 | 1250 | } |
| 1251 | - $this->wPt = $this->w*$this->k; |
|
| 1252 | - $this->hPt = $this->h*$this->k; |
|
| 1253 | - $this->pageBreakTrigger = $this->h-$this->bMargin; |
|
| 1251 | + $this->wPt = $this->w * $this->k; |
|
| 1252 | + $this->hPt = $this->h * $this->k; |
|
| 1253 | + $this->pageBreakTrigger = $this->h - $this->bMargin; |
|
| 1254 | 1254 | $this->curOrientation = $orientation; |
| 1255 | 1255 | $this->curPageFormat = $format; |
| 1256 | 1256 | } |
@@ -1283,7 +1283,7 @@ discard block |
||
| 1283 | 1283 | protected function textString($s) |
| 1284 | 1284 | { |
| 1285 | 1285 | //Format a text string |
| 1286 | - return '('.$this->escape($s).')'; |
|
| 1286 | + return '(' . $this->escape($s) . ')'; |
|
| 1287 | 1287 | } |
| 1288 | 1288 | |
| 1289 | 1289 | |
@@ -1299,16 +1299,16 @@ discard block |
||
| 1299 | 1299 | //3-byte character |
| 1300 | 1300 | $c2 = ord($s[$i++]); |
| 1301 | 1301 | $c3 = ord($s[$i++]); |
| 1302 | - $res .= chr((($c1 & 0x0F)<<4) + (($c2 & 0x3C)>>2)); |
|
| 1303 | - $res .= chr((($c2 & 0x03)<<6) + ($c3 & 0x3F)); |
|
| 1302 | + $res .= chr((($c1 & 0x0F) << 4) + (($c2 & 0x3C) >> 2)); |
|
| 1303 | + $res .= chr((($c2 & 0x03) << 6) + ($c3 & 0x3F)); |
|
| 1304 | 1304 | } elseif ($c1 >= 192) { |
| 1305 | 1305 | //2-byte character |
| 1306 | 1306 | $c2 = ord($s[$i++]); |
| 1307 | - $res .= chr(($c1 & 0x1C)>>2); |
|
| 1308 | - $res .= chr((($c1 & 0x03)<<6) + ($c2 & 0x3F)); |
|
| 1307 | + $res .= chr(($c1 & 0x1C) >> 2); |
|
| 1308 | + $res .= chr((($c1 & 0x03) << 6) + ($c2 & 0x3F)); |
|
| 1309 | 1309 | } else { |
| 1310 | 1310 | //Single-byte character |
| 1311 | - $res .= "\0".chr($c1); |
|
| 1311 | + $res .= "\0" . chr($c1); |
|
| 1312 | 1312 | } |
| 1313 | 1313 | } |
| 1314 | 1314 | return $res; |
@@ -1320,13 +1320,13 @@ discard block |
||
| 1320 | 1320 | //Underline text |
| 1321 | 1321 | $up = $this->currentFont['up']; |
| 1322 | 1322 | $ut = $this->currentFont['ut']; |
| 1323 | - $w = $this->getStringWidth($txt)+$this->ws*substr_count($txt, ' '); |
|
| 1323 | + $w = $this->getStringWidth($txt) + $this->ws * substr_count($txt, ' '); |
|
| 1324 | 1324 | return sprintf( |
| 1325 | 1325 | '%.2F %.2F %.2F %.2F re f', |
| 1326 | - $x*$this->k, |
|
| 1327 | - ($this->h-($y-$up/1000*$this->fontSize))*$this->k, |
|
| 1328 | - $w*$this->k, |
|
| 1329 | - -$ut/1000*$this->fontSizePt |
|
| 1326 | + $x * $this->k, |
|
| 1327 | + ($this->h - ($y - $up / 1000 * $this->fontSize)) * $this->k, |
|
| 1328 | + $w * $this->k, |
|
| 1329 | + -$ut / 1000 * $this->fontSizePt |
|
| 1330 | 1330 | ); |
| 1331 | 1331 | } |
| 1332 | 1332 | |
@@ -1336,17 +1336,17 @@ discard block |
||
| 1336 | 1336 | //Extract info from a JPEG file |
| 1337 | 1337 | $a = getImageSize($file); |
| 1338 | 1338 | if (!$a) { |
| 1339 | - $this->error('Missing or incorrect image file: '.$file); |
|
| 1339 | + $this->error('Missing or incorrect image file: ' . $file); |
|
| 1340 | 1340 | } |
| 1341 | - if ($a[2]!=2) { |
|
| 1342 | - $this->error('Not a JPEG file: '.$file); |
|
| 1341 | + if ($a[2] != 2) { |
|
| 1342 | + $this->error('Not a JPEG file: ' . $file); |
|
| 1343 | 1343 | } |
| 1344 | 1344 | if (!isset($a['channels']) || $a['channels'] == 3) { |
| 1345 | 1345 | $colspace = 'DeviceRGB'; |
| 1346 | 1346 | } elseif ($a['channels'] == 4) { |
| 1347 | 1347 | $colspace = 'DeviceCMYK'; |
| 1348 | 1348 | } else { |
| 1349 | - $colspace='DeviceGray'; |
|
| 1349 | + $colspace = 'DeviceGray'; |
|
| 1350 | 1350 | } |
| 1351 | 1351 | $bpc = isset($a['bits']) ? $a['bits'] : 8; |
| 1352 | 1352 | //Read whole file |
@@ -1365,22 +1365,22 @@ discard block |
||
| 1365 | 1365 | //Extract info from a PNG file |
| 1366 | 1366 | $f = fopen($file, 'rb'); |
| 1367 | 1367 | if (!$f) { |
| 1368 | - $this->error('Can\'t open image file: '.$file); |
|
| 1368 | + $this->error('Can\'t open image file: ' . $file); |
|
| 1369 | 1369 | } |
| 1370 | 1370 | //Check signature |
| 1371 | - if ($this->readstream($f, 8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) { |
|
| 1372 | - $this->error('Not a PNG file: '.$file); |
|
| 1371 | + if ($this->readstream($f, 8) != chr(137) . 'PNG' . chr(13) . chr(10) . chr(26) . chr(10)) { |
|
| 1372 | + $this->error('Not a PNG file: ' . $file); |
|
| 1373 | 1373 | } |
| 1374 | 1374 | //Read header chunk |
| 1375 | 1375 | $this->readstream($f, 4); |
| 1376 | - if ($this->readstream($f, 4)!='IHDR') { |
|
| 1377 | - $this->error('Incorrect PNG file: '.$file); |
|
| 1376 | + if ($this->readstream($f, 4) != 'IHDR') { |
|
| 1377 | + $this->error('Incorrect PNG file: ' . $file); |
|
| 1378 | 1378 | } |
| 1379 | 1379 | $w = $this->readint($f); |
| 1380 | 1380 | $h = $this->readint($f); |
| 1381 | 1381 | $bpc = ord($this->readstream($f, 1)); |
| 1382 | - if ($bpc>8) { |
|
| 1383 | - $this->error('16-bit depth not supported: '.$file); |
|
| 1382 | + if ($bpc > 8) { |
|
| 1383 | + $this->error('16-bit depth not supported: ' . $file); |
|
| 1384 | 1384 | } |
| 1385 | 1385 | $ct = ord($this->readstream($f, 1)); |
| 1386 | 1386 | if ($ct == 0) { |
@@ -1390,20 +1390,20 @@ discard block |
||
| 1390 | 1390 | } elseif ($ct == 3) { |
| 1391 | 1391 | $colspace = 'Indexed'; |
| 1392 | 1392 | } else { |
| 1393 | - $this->error('Alpha channel not supported: '.$file); |
|
| 1393 | + $this->error('Alpha channel not supported: ' . $file); |
|
| 1394 | 1394 | } |
| 1395 | 1395 | if (ord($this->readstream($f, 1)) != 0) { |
| 1396 | - $this->error('Unknown compression method: '.$file); |
|
| 1396 | + $this->error('Unknown compression method: ' . $file); |
|
| 1397 | 1397 | } |
| 1398 | 1398 | if (ord($this->readstream($f, 1)) != 0) { |
| 1399 | - $this->error('Unknown filter method: '.$file); |
|
| 1399 | + $this->error('Unknown filter method: ' . $file); |
|
| 1400 | 1400 | } |
| 1401 | 1401 | if (ord($this->readstream($f, 1)) != 0) { |
| 1402 | - $this->error('Interlacing not supported: '.$file); |
|
| 1402 | + $this->error('Interlacing not supported: ' . $file); |
|
| 1403 | 1403 | } |
| 1404 | 1404 | $this->readstream($f, 4); |
| 1405 | 1405 | $parms = '/DecodeParms <</Predictor 15 /Colors ' |
| 1406 | - . ($ct==2 ? 3 : 1) |
|
| 1406 | + . ($ct == 2 ? 3 : 1) |
|
| 1407 | 1407 | . ' /BitsPerComponent ' |
| 1408 | 1408 | . $bpc |
| 1409 | 1409 | . ' /Columns ' |
@@ -1441,11 +1441,11 @@ discard block |
||
| 1441 | 1441 | } elseif ($type == 'IEND') { |
| 1442 | 1442 | break; |
| 1443 | 1443 | } else { |
| 1444 | - $this->readstream($f, $n+4); |
|
| 1444 | + $this->readstream($f, $n + 4); |
|
| 1445 | 1445 | } |
| 1446 | 1446 | } while ($n); |
| 1447 | 1447 | if ($colspace == 'Indexed' && empty($pal)) { |
| 1448 | - $this->error('Missing palette in '.$file); |
|
| 1448 | + $this->error('Missing palette in ' . $file); |
|
| 1449 | 1449 | } |
| 1450 | 1450 | fclose($f); |
| 1451 | 1451 | return [ |
@@ -1465,9 +1465,9 @@ discard block |
||
| 1465 | 1465 | protected function readstream($f, $n) |
| 1466 | 1466 | { |
| 1467 | 1467 | //Read n bytes from stream |
| 1468 | - $res=''; |
|
| 1468 | + $res = ''; |
|
| 1469 | 1469 | while ($n > 0 && !feof($f)) { |
| 1470 | - $s=fread($f, $n); |
|
| 1470 | + $s = fread($f, $n); |
|
| 1471 | 1471 | if ($s === false) { |
| 1472 | 1472 | $this->error('Error while reading stream'); |
| 1473 | 1473 | } |
@@ -1500,7 +1500,7 @@ discard block |
||
| 1500 | 1500 | } |
| 1501 | 1501 | $im = imagecreatefromgif($file); |
| 1502 | 1502 | if (!$im) { |
| 1503 | - $this->error('Missing or incorrect image file: '.$file); |
|
| 1503 | + $this->error('Missing or incorrect image file: ' . $file); |
|
| 1504 | 1504 | } |
| 1505 | 1505 | imageinterlace($im, 0); |
| 1506 | 1506 | $tmp = tempnam('.', 'gif'); |
@@ -1511,7 +1511,7 @@ discard block |
||
| 1511 | 1511 | $this->error('Error while saving to temporary file'); |
| 1512 | 1512 | } |
| 1513 | 1513 | imagedestroy($im); |
| 1514 | - $info=$this->parsePNG($tmp); |
|
| 1514 | + $info = $this->parsePNG($tmp); |
|
| 1515 | 1515 | unlink($tmp); |
| 1516 | 1516 | return $info; |
| 1517 | 1517 | } |
@@ -1522,7 +1522,7 @@ discard block |
||
| 1522 | 1522 | //Begin a new object |
| 1523 | 1523 | $this->n++; |
| 1524 | 1524 | $this->offsets[$this->n] = strlen($this->buffer); |
| 1525 | - $this->out($this->n.' 0 obj'); |
|
| 1525 | + $this->out($this->n . ' 0 obj'); |
|
| 1526 | 1526 | } |
| 1527 | 1527 | |
| 1528 | 1528 | |
@@ -1538,9 +1538,9 @@ discard block |
||
| 1538 | 1538 | { |
| 1539 | 1539 | //Add a line to the document |
| 1540 | 1540 | if ($this->state == 2) { |
| 1541 | - $this->pages[$this->page].=$s."\n"; |
|
| 1541 | + $this->pages[$this->page] .= $s . "\n"; |
|
| 1542 | 1542 | } else { |
| 1543 | - $this->buffer .= $s."\n"; |
|
| 1543 | + $this->buffer .= $s . "\n"; |
|
| 1544 | 1544 | } |
| 1545 | 1545 | } |
| 1546 | 1546 | |
@@ -1550,19 +1550,19 @@ discard block |
||
| 1550 | 1550 | $nb = $this->page; |
| 1551 | 1551 | if (!empty($this->aliasNbPages)) { |
| 1552 | 1552 | //Replace number of pages |
| 1553 | - for ($n=1; $n<=$nb; $n++) { |
|
| 1553 | + for ($n = 1; $n <= $nb; $n++) { |
|
| 1554 | 1554 | $this->pages[$n] = str_replace($this->aliasNbPages, $nb, $this->pages[$n]); |
| 1555 | 1555 | } |
| 1556 | 1556 | } |
| 1557 | 1557 | if ($this->defOrientation == 'P') { |
| 1558 | - $wPt = $this->defPageFormat[0]*$this->k; |
|
| 1559 | - $hPt = $this->defPageFormat[1]*$this->k; |
|
| 1558 | + $wPt = $this->defPageFormat[0] * $this->k; |
|
| 1559 | + $hPt = $this->defPageFormat[1] * $this->k; |
|
| 1560 | 1560 | } else { |
| 1561 | - $wPt = $this->defPageFormat[1]*$this->k; |
|
| 1562 | - $hPt = $this->defPageFormat[0]*$this->k; |
|
| 1561 | + $wPt = $this->defPageFormat[1] * $this->k; |
|
| 1562 | + $hPt = $this->defPageFormat[0] * $this->k; |
|
| 1563 | 1563 | } |
| 1564 | 1564 | $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; |
| 1565 | - for ($n=1; $n<=$nb; $n++) { |
|
| 1565 | + for ($n = 1; $n <= $nb; $n++) { |
|
| 1566 | 1566 | //Page |
| 1567 | 1567 | $this->newObj(); |
| 1568 | 1568 | $this->out('<</Type /Page'); |
@@ -1575,37 +1575,37 @@ discard block |
||
| 1575 | 1575 | //Links |
| 1576 | 1576 | $annots = '/Annots ['; |
| 1577 | 1577 | foreach ($this->PageLinks[$n] as $pl) { |
| 1578 | - $rect = sprintf('%.2F %.2F %.2F %.2F', $pl[0], $pl[1], $pl[0]+$pl[2], $pl[1]-$pl[3]); |
|
| 1579 | - $annots .= '<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] '; |
|
| 1578 | + $rect = sprintf('%.2F %.2F %.2F %.2F', $pl[0], $pl[1], $pl[0] + $pl[2], $pl[1] - $pl[3]); |
|
| 1579 | + $annots .= '<</Type /Annot /Subtype /Link /Rect [' . $rect . '] /Border [0 0 0] '; |
|
| 1580 | 1580 | if (is_string($pl[4])) { |
| 1581 | - $annots .= '/A <</S /URI /URI '.$this->textString($pl[4]).'>>>>'; |
|
| 1581 | + $annots .= '/A <</S /URI /URI ' . $this->textString($pl[4]) . '>>>>'; |
|
| 1582 | 1582 | } else { |
| 1583 | 1583 | $l = $this->links[$pl[4]]; |
| 1584 | 1584 | $h = isset($this->PageSizes[$l[0]]) ? $this->PageSizes[$l[0]][1] : $hPt; |
| 1585 | - $annots .= sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>', 1+2*$l[0], $h-$l[1]*$this->k); |
|
| 1585 | + $annots .= sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>', 1 + 2 * $l[0], $h - $l[1] * $this->k); |
|
| 1586 | 1586 | } |
| 1587 | 1587 | } |
| 1588 | - $this->out($annots.']'); |
|
| 1588 | + $this->out($annots . ']'); |
|
| 1589 | 1589 | } |
| 1590 | - $this->out('/Contents '.($this->n+1).' 0 R>>'); |
|
| 1590 | + $this->out('/Contents ' . ($this->n + 1) . ' 0 R>>'); |
|
| 1591 | 1591 | $this->out('endobj'); |
| 1592 | 1592 | //Page content |
| 1593 | - $p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n]; |
|
| 1593 | + $p = ($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n]; |
|
| 1594 | 1594 | $this->newObj(); |
| 1595 | - $this->out('<<'.$filter.'/Length '.strlen($p).'>>'); |
|
| 1595 | + $this->out('<<' . $filter . '/Length ' . strlen($p) . '>>'); |
|
| 1596 | 1596 | $this->putStream($p); |
| 1597 | 1597 | $this->out('endobj'); |
| 1598 | 1598 | } |
| 1599 | 1599 | //Pages root |
| 1600 | - $this->offsets[1]=strlen($this->buffer); |
|
| 1600 | + $this->offsets[1] = strlen($this->buffer); |
|
| 1601 | 1601 | $this->out('1 0 obj'); |
| 1602 | 1602 | $this->out('<</Type /Pages'); |
| 1603 | 1603 | $kids = '/Kids ['; |
| 1604 | - for ($i=0; $i<$nb; $i++) { |
|
| 1605 | - $kids .= (3+2*$i).' 0 R '; |
|
| 1604 | + for ($i = 0; $i < $nb; $i++) { |
|
| 1605 | + $kids .= (3 + 2 * $i) . ' 0 R '; |
|
| 1606 | 1606 | } |
| 1607 | - $this->out($kids.']'); |
|
| 1608 | - $this->out('/Count '.$nb); |
|
| 1607 | + $this->out($kids . ']'); |
|
| 1608 | + $this->out('/Count ' . $nb); |
|
| 1609 | 1609 | $this->out(sprintf('/MediaBox [0 0 %.2F %.2F]', $wPt, $hPt)); |
| 1610 | 1610 | $this->out('>>'); |
| 1611 | 1611 | $this->out('endobj'); |
@@ -1618,41 +1618,41 @@ discard block |
||
| 1618 | 1618 | foreach ($this->diffs as $diff) { |
| 1619 | 1619 | //Encodings |
| 1620 | 1620 | $this->newObj(); |
| 1621 | - $this->out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>'); |
|
| 1621 | + $this->out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences [' . $diff . ']>>'); |
|
| 1622 | 1622 | $this->out('endobj'); |
| 1623 | 1623 | } |
| 1624 | 1624 | foreach ($this->fontFiles as $file => $info) { |
| 1625 | 1625 | //Font file embedding |
| 1626 | 1626 | $this->newObj(); |
| 1627 | - $this->fontFiles[$file]['n']=$this->n; |
|
| 1628 | - $font=''; |
|
| 1629 | - $f = fopen($this->getFontPath().$file, 'rb', 1); |
|
| 1627 | + $this->fontFiles[$file]['n'] = $this->n; |
|
| 1628 | + $font = ''; |
|
| 1629 | + $f = fopen($this->getFontPath() . $file, 'rb', 1); |
|
| 1630 | 1630 | if (!$f) { |
| 1631 | 1631 | $this->error('Font file not found'); |
| 1632 | 1632 | } |
| 1633 | 1633 | while (!feof($f)) { |
| 1634 | - $font.=fread($f, 8192); |
|
| 1634 | + $font .= fread($f, 8192); |
|
| 1635 | 1635 | } |
| 1636 | 1636 | fclose($f); |
| 1637 | - $compressed = (substr($file, -2)=='.z'); |
|
| 1637 | + $compressed = (substr($file, -2) == '.z'); |
|
| 1638 | 1638 | if (!$compressed && isset($info['length2'])) { |
| 1639 | - $header = (ord($font[0])==128); |
|
| 1639 | + $header = (ord($font[0]) == 128); |
|
| 1640 | 1640 | if ($header) { |
| 1641 | 1641 | //Strip first binary header |
| 1642 | 1642 | $font = substr($font, 6); |
| 1643 | 1643 | } |
| 1644 | 1644 | if ($header && ord($font[$info['length1']]) == 128) { |
| 1645 | 1645 | //Strip second binary header |
| 1646 | - $font = substr($font, 0, $info['length1']).substr($font, $info['length1']+6); |
|
| 1646 | + $font = substr($font, 0, $info['length1']) . substr($font, $info['length1'] + 6); |
|
| 1647 | 1647 | } |
| 1648 | 1648 | } |
| 1649 | - $this->out('<</Length '.strlen($font)); |
|
| 1649 | + $this->out('<</Length ' . strlen($font)); |
|
| 1650 | 1650 | if ($compressed) { |
| 1651 | 1651 | $this->out('/Filter /FlateDecode'); |
| 1652 | 1652 | } |
| 1653 | - $this->out('/Length1 '.$info['length1']); |
|
| 1653 | + $this->out('/Length1 ' . $info['length1']); |
|
| 1654 | 1654 | if (isset($info['length2'])) { |
| 1655 | - $this->out('/Length2 '.$info['length2'].' /Length3 0'); |
|
| 1655 | + $this->out('/Length2 ' . $info['length2'] . ' /Length3 0'); |
|
| 1656 | 1656 | } |
| 1657 | 1657 | $this->out('>>'); |
| 1658 | 1658 | $this->putStream($font); |
@@ -1660,32 +1660,32 @@ discard block |
||
| 1660 | 1660 | } |
| 1661 | 1661 | foreach ($this->fonts as $k => $font) { |
| 1662 | 1662 | //Font objects |
| 1663 | - $this->fonts[$k]['n']=$this->n+1; |
|
| 1663 | + $this->fonts[$k]['n'] = $this->n + 1; |
|
| 1664 | 1664 | $type = $font['type']; |
| 1665 | 1665 | $name = $font['name']; |
| 1666 | 1666 | if ($type == 'core') { |
| 1667 | 1667 | //Standard font |
| 1668 | 1668 | $this->newObj(); |
| 1669 | 1669 | $this->out('<</Type /Font'); |
| 1670 | - $this->out('/BaseFont /'.$name); |
|
| 1670 | + $this->out('/BaseFont /' . $name); |
|
| 1671 | 1671 | $this->out('/Subtype /Type1'); |
| 1672 | 1672 | if ($name != 'Symbol' && $name != 'ZapfDingbats') { |
| 1673 | 1673 | $this->out('/Encoding /WinAnsiEncoding'); |
| 1674 | 1674 | } |
| 1675 | 1675 | $this->out('>>'); |
| 1676 | 1676 | $this->out('endobj'); |
| 1677 | - } elseif ($type=='Type1' || $type=='TrueType') { |
|
| 1677 | + } elseif ($type == 'Type1' || $type == 'TrueType') { |
|
| 1678 | 1678 | //Additional Type1 or TrueType font |
| 1679 | 1679 | $this->newObj(); |
| 1680 | 1680 | $this->out('<</Type /Font'); |
| 1681 | - $this->out('/BaseFont /'.$name); |
|
| 1682 | - $this->out('/Subtype /'.$type); |
|
| 1681 | + $this->out('/BaseFont /' . $name); |
|
| 1682 | + $this->out('/Subtype /' . $type); |
|
| 1683 | 1683 | $this->out('/FirstChar 32 /LastChar 255'); |
| 1684 | - $this->out('/Widths '.($this->n+1).' 0 R'); |
|
| 1685 | - $this->out('/FontDescriptor '.($this->n+2).' 0 R'); |
|
| 1684 | + $this->out('/Widths ' . ($this->n + 1) . ' 0 R'); |
|
| 1685 | + $this->out('/FontDescriptor ' . ($this->n + 2) . ' 0 R'); |
|
| 1686 | 1686 | if ($font['enc']) { |
| 1687 | 1687 | if (isset($font['diff'])) { |
| 1688 | - $this->out('/Encoding '.($nf+$font['diff']).' 0 R'); |
|
| 1688 | + $this->out('/Encoding ' . ($nf + $font['diff']) . ' 0 R'); |
|
| 1689 | 1689 | } else { |
| 1690 | 1690 | $this->out('/Encoding /WinAnsiEncoding'); |
| 1691 | 1691 | } |
@@ -1694,30 +1694,30 @@ discard block |
||
| 1694 | 1694 | $this->out('endobj'); |
| 1695 | 1695 | //Widths |
| 1696 | 1696 | $this->newObj(); |
| 1697 | - $cw =& $font['cw']; |
|
| 1697 | + $cw = & $font['cw']; |
|
| 1698 | 1698 | $s = '['; |
| 1699 | - for ($i=32; $i<=255; $i++) { |
|
| 1700 | - $s .= $cw[chr($i)].' '; |
|
| 1699 | + for ($i = 32; $i <= 255; $i++) { |
|
| 1700 | + $s .= $cw[chr($i)] . ' '; |
|
| 1701 | 1701 | } |
| 1702 | - $this->out($s.']'); |
|
| 1702 | + $this->out($s . ']'); |
|
| 1703 | 1703 | $this->out('endobj'); |
| 1704 | 1704 | //Descriptor |
| 1705 | 1705 | $this->newObj(); |
| 1706 | - $s='<</Type /FontDescriptor /FontName /'.$name; |
|
| 1706 | + $s = '<</Type /FontDescriptor /FontName /' . $name; |
|
| 1707 | 1707 | foreach ($font['desc'] as $k => $v) { |
| 1708 | - $s .= ' /'.$k.' '.$v; |
|
| 1708 | + $s .= ' /' . $k . ' ' . $v; |
|
| 1709 | 1709 | } |
| 1710 | - $file=$font['file']; |
|
| 1710 | + $file = $font['file']; |
|
| 1711 | 1711 | if ($file) { |
| 1712 | - $s .= ' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->fontFiles[$file]['n'].' 0 R'; |
|
| 1712 | + $s .= ' /FontFile' . ($type == 'Type1' ? '' : '2') . ' ' . $this->fontFiles[$file]['n'] . ' 0 R'; |
|
| 1713 | 1713 | } |
| 1714 | - $this->out($s.'>>'); |
|
| 1714 | + $this->out($s . '>>'); |
|
| 1715 | 1715 | $this->out('endobj'); |
| 1716 | 1716 | } else { |
| 1717 | 1717 | //Allow for additional types |
| 1718 | - $mtd='_put'.strtolower($type); |
|
| 1718 | + $mtd = '_put' . strtolower($type); |
|
| 1719 | 1719 | if (!method_exists($this, $mtd)) { |
| 1720 | - $this->error('Unsupported font type: '.$type); |
|
| 1720 | + $this->error('Unsupported font type: ' . $type); |
|
| 1721 | 1721 | } |
| 1722 | 1722 | $this->$mtd($font); |
| 1723 | 1723 | } |
@@ -1735,39 +1735,39 @@ discard block |
||
| 1735 | 1735 | $this->images[$file]['n'] = $this->n; |
| 1736 | 1736 | $this->out('<</Type /XObject'); |
| 1737 | 1737 | $this->out('/Subtype /Image'); |
| 1738 | - $this->out('/Width '.$info['w']); |
|
| 1739 | - $this->out('/Height '.$info['h']); |
|
| 1740 | - if ($info['cs']=='Indexed') { |
|
| 1741 | - $this->out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]'); |
|
| 1738 | + $this->out('/Width ' . $info['w']); |
|
| 1739 | + $this->out('/Height ' . $info['h']); |
|
| 1740 | + if ($info['cs'] == 'Indexed') { |
|
| 1741 | + $this->out('/ColorSpace [/Indexed /DeviceRGB ' . (strlen($info['pal']) / 3 - 1) . ' ' . ($this->n + 1) . ' 0 R]'); |
|
| 1742 | 1742 | } else { |
| 1743 | - $this->out('/ColorSpace /'.$info['cs']); |
|
| 1744 | - if ($info['cs']=='DeviceCMYK') { |
|
| 1743 | + $this->out('/ColorSpace /' . $info['cs']); |
|
| 1744 | + if ($info['cs'] == 'DeviceCMYK') { |
|
| 1745 | 1745 | $this->out('/Decode [1 0 1 0 1 0 1 0]'); |
| 1746 | 1746 | } |
| 1747 | 1747 | } |
| 1748 | - $this->out('/BitsPerComponent '.$info['bpc']); |
|
| 1748 | + $this->out('/BitsPerComponent ' . $info['bpc']); |
|
| 1749 | 1749 | if (isset($info['f'])) { |
| 1750 | - $this->out('/Filter /'.$info['f']); |
|
| 1750 | + $this->out('/Filter /' . $info['f']); |
|
| 1751 | 1751 | } |
| 1752 | 1752 | if (isset($info['parms'])) { |
| 1753 | 1753 | $this->out($info['parms']); |
| 1754 | 1754 | } |
| 1755 | 1755 | if (isset($info['trns']) && is_array($info['trns'])) { |
| 1756 | 1756 | $trns = ''; |
| 1757 | - for ($i=0; $i<count($info['trns']); $i++) { |
|
| 1758 | - $trns.=$info['trns'][$i].' '.$info['trns'][$i].' '; |
|
| 1757 | + for ($i = 0; $i < count($info['trns']); $i++) { |
|
| 1758 | + $trns .= $info['trns'][$i] . ' ' . $info['trns'][$i] . ' '; |
|
| 1759 | 1759 | } |
| 1760 | - $this->out('/Mask ['.$trns.']'); |
|
| 1760 | + $this->out('/Mask [' . $trns . ']'); |
|
| 1761 | 1761 | } |
| 1762 | - $this->out('/Length '.strlen($info['data']).'>>'); |
|
| 1762 | + $this->out('/Length ' . strlen($info['data']) . '>>'); |
|
| 1763 | 1763 | $this->putStream($info['data']); |
| 1764 | 1764 | unset($this->images[$file]['data']); |
| 1765 | 1765 | $this->out('endobj'); |
| 1766 | 1766 | //Palette |
| 1767 | 1767 | if ($info['cs'] == 'Indexed') { |
| 1768 | 1768 | $this->newObj(); |
| 1769 | - $pal=($this->compress) ? gzcompress($info['pal']) : $info['pal']; |
|
| 1770 | - $this->out('<<'.$filter.'/Length '.strlen($pal).'>>'); |
|
| 1769 | + $pal = ($this->compress) ? gzcompress($info['pal']) : $info['pal']; |
|
| 1770 | + $this->out('<<' . $filter . '/Length ' . strlen($pal) . '>>'); |
|
| 1771 | 1771 | $this->putStream($pal); |
| 1772 | 1772 | $this->out('endobj'); |
| 1773 | 1773 | } |
@@ -1777,7 +1777,7 @@ discard block |
||
| 1777 | 1777 | protected function putXobjectDict() |
| 1778 | 1778 | { |
| 1779 | 1779 | foreach ($this->images as $image) { |
| 1780 | - $this->out('/I'.$image['i'].' '.$image['n'].' 0 R'); |
|
| 1780 | + $this->out('/I' . $image['i'] . ' ' . $image['n'] . ' 0 R'); |
|
| 1781 | 1781 | } |
| 1782 | 1782 | } |
| 1783 | 1783 | |
@@ -1786,7 +1786,7 @@ discard block |
||
| 1786 | 1786 | $this->out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); |
| 1787 | 1787 | $this->out('/Font <<'); |
| 1788 | 1788 | foreach ($this->fonts as $font) { |
| 1789 | - $this->out('/F'.$font['i'].' '.$font['n'].' 0 R'); |
|
| 1789 | + $this->out('/F' . $font['i'] . ' ' . $font['n'] . ' 0 R'); |
|
| 1790 | 1790 | } |
| 1791 | 1791 | $this->out('>>'); |
| 1792 | 1792 | $this->out('/XObject <<'); |
@@ -1809,57 +1809,57 @@ discard block |
||
| 1809 | 1809 | |
| 1810 | 1810 | protected function putInfo() |
| 1811 | 1811 | { |
| 1812 | - $this->out('/Producer '.$this->textString('FPDF '. self::FPDF_VERSION)); |
|
| 1812 | + $this->out('/Producer ' . $this->textString('FPDF ' . self::FPDF_VERSION)); |
|
| 1813 | 1813 | if (!empty($this->title)) { |
| 1814 | - $this->out('/Title '.$this->textString($this->title)); |
|
| 1814 | + $this->out('/Title ' . $this->textString($this->title)); |
|
| 1815 | 1815 | } |
| 1816 | 1816 | if (!empty($this->subject)) { |
| 1817 | - $this->out('/Subject '.$this->textString($this->subject)); |
|
| 1817 | + $this->out('/Subject ' . $this->textString($this->subject)); |
|
| 1818 | 1818 | } |
| 1819 | 1819 | if (!empty($this->author)) { |
| 1820 | - $this->out('/Author '.$this->textString($this->author)); |
|
| 1820 | + $this->out('/Author ' . $this->textString($this->author)); |
|
| 1821 | 1821 | } |
| 1822 | 1822 | if (!empty($this->keywords)) { |
| 1823 | - $this->out('/Keywords '.$this->textString($this->keywords)); |
|
| 1823 | + $this->out('/Keywords ' . $this->textString($this->keywords)); |
|
| 1824 | 1824 | } |
| 1825 | 1825 | if (!empty($this->creator)) { |
| 1826 | - $this->out('/Creator '.$this->textString($this->creator)); |
|
| 1826 | + $this->out('/Creator ' . $this->textString($this->creator)); |
|
| 1827 | 1827 | } |
| 1828 | - $this->out('/CreationDate '.$this->textString('D:'.@date('YmdHis'))); |
|
| 1828 | + $this->out('/CreationDate ' . $this->textString('D:' . @date('YmdHis'))); |
|
| 1829 | 1829 | } |
| 1830 | 1830 | |
| 1831 | 1831 | protected function putCatalog() |
| 1832 | 1832 | { |
| 1833 | 1833 | $this->out('/Type /Catalog'); |
| 1834 | 1834 | $this->out('/Pages 1 0 R'); |
| 1835 | - if ($this->zoomMode=='fullpage') { |
|
| 1835 | + if ($this->zoomMode == 'fullpage') { |
|
| 1836 | 1836 | $this->out('/OpenAction [3 0 R /Fit]'); |
| 1837 | - } elseif ($this->zoomMode=='fullwidth') { |
|
| 1837 | + } elseif ($this->zoomMode == 'fullwidth') { |
|
| 1838 | 1838 | $this->out('/OpenAction [3 0 R /FitH null]'); |
| 1839 | - } elseif ($this->zoomMode=='real') { |
|
| 1839 | + } elseif ($this->zoomMode == 'real') { |
|
| 1840 | 1840 | $this->out('/OpenAction [3 0 R /XYZ null null 1]'); |
| 1841 | 1841 | } elseif (!is_string($this->zoomMode)) { |
| 1842 | - $this->out('/OpenAction [3 0 R /XYZ null null '.($this->zoomMode/100).']'); |
|
| 1842 | + $this->out('/OpenAction [3 0 R /XYZ null null ' . ($this->zoomMode / 100) . ']'); |
|
| 1843 | 1843 | } |
| 1844 | - if ($this->layoutMode=='single') { |
|
| 1844 | + if ($this->layoutMode == 'single') { |
|
| 1845 | 1845 | $this->out('/PageLayout /SinglePage'); |
| 1846 | - } elseif ($this->layoutMode=='continuous') { |
|
| 1846 | + } elseif ($this->layoutMode == 'continuous') { |
|
| 1847 | 1847 | $this->out('/PageLayout /OneColumn'); |
| 1848 | - } elseif ($this->layoutMode=='two') { |
|
| 1848 | + } elseif ($this->layoutMode == 'two') { |
|
| 1849 | 1849 | $this->out('/PageLayout /TwoColumnLeft'); |
| 1850 | 1850 | } |
| 1851 | 1851 | } |
| 1852 | 1852 | |
| 1853 | 1853 | protected function putHeader() |
| 1854 | 1854 | { |
| 1855 | - $this->out('%PDF-'.$this->pdfVersion); |
|
| 1855 | + $this->out('%PDF-' . $this->pdfVersion); |
|
| 1856 | 1856 | } |
| 1857 | 1857 | |
| 1858 | 1858 | protected function putTrailer() |
| 1859 | 1859 | { |
| 1860 | - $this->out('/Size '.($this->n+1)); |
|
| 1861 | - $this->out('/Root '.$this->n.' 0 R'); |
|
| 1862 | - $this->out('/Info '.($this->n-1).' 0 R'); |
|
| 1860 | + $this->out('/Size ' . ($this->n + 1)); |
|
| 1861 | + $this->out('/Root ' . $this->n . ' 0 R'); |
|
| 1862 | + $this->out('/Info ' . ($this->n - 1) . ' 0 R'); |
|
| 1863 | 1863 | } |
| 1864 | 1864 | |
| 1865 | 1865 | protected function endDoc() |
@@ -1880,11 +1880,11 @@ discard block |
||
| 1880 | 1880 | $this->out('>>'); |
| 1881 | 1881 | $this->out('endobj'); |
| 1882 | 1882 | //Cross-ref |
| 1883 | - $o=strlen($this->buffer); |
|
| 1883 | + $o = strlen($this->buffer); |
|
| 1884 | 1884 | $this->out('xref'); |
| 1885 | - $this->out('0 '.($this->n+1)); |
|
| 1885 | + $this->out('0 ' . ($this->n + 1)); |
|
| 1886 | 1886 | $this->out('0000000000 65535 f '); |
| 1887 | - for ($i=1; $i<=$this->n; $i++) { |
|
| 1887 | + for ($i = 1; $i <= $this->n; $i++) { |
|
| 1888 | 1888 | $this->out(sprintf('%010d 00000 n ', $this->offsets[$i])); |
| 1889 | 1889 | } |
| 1890 | 1890 | //Trailer |
@@ -1895,6 +1895,6 @@ discard block |
||
| 1895 | 1895 | $this->out('startxref'); |
| 1896 | 1896 | $this->out($o); |
| 1897 | 1897 | $this->out('%%EOF'); |
| 1898 | - $this->state=3; |
|
| 1898 | + $this->state = 3; |
|
| 1899 | 1899 | } |
| 1900 | 1900 | } |
@@ -170,6 +170,9 @@ discard block |
||
| 170 | 170 | $this->pdfVersion='1.3'; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | + /** |
|
| 174 | + * @param integer $right |
|
| 175 | + */ |
|
| 173 | 176 | public function setMargins($left, $top, $right = null) |
| 174 | 177 | { |
| 175 | 178 | //Set left, top and right margins |
@@ -202,6 +205,9 @@ discard block |
||
| 202 | 205 | $this->rMargin = $margin; |
| 203 | 206 | } |
| 204 | 207 | |
| 208 | + /** |
|
| 209 | + * @param boolean $auto |
|
| 210 | + */ |
|
| 205 | 211 | public function setAutoPageBreak($auto, $margin = 0) |
| 206 | 212 | { |
| 207 | 213 | //Set auto page break mode and triggering margin |
@@ -210,6 +216,9 @@ discard block |
||
| 210 | 216 | $this->pageBreakTrigger = $this->h-$margin; |
| 211 | 217 | } |
| 212 | 218 | |
| 219 | + /** |
|
| 220 | + * @param string $zoom |
|
| 221 | + */ |
|
| 213 | 222 | public function setDisplayMode($zoom, $layout = 'continuous') |
| 214 | 223 | { |
| 215 | 224 | //Set display mode in viewer |
@@ -225,6 +234,9 @@ discard block |
||
| 225 | 234 | } |
| 226 | 235 | } |
| 227 | 236 | |
| 237 | + /** |
|
| 238 | + * @param boolean $compress |
|
| 239 | + */ |
|
| 228 | 240 | public function setCompression($compress) |
| 229 | 241 | { |
| 230 | 242 | //Set page compression |
@@ -286,6 +298,9 @@ discard block |
||
| 286 | 298 | $this->aliasNbPages=$alias; |
| 287 | 299 | } |
| 288 | 300 | |
| 301 | + /** |
|
| 302 | + * @param string $msg |
|
| 303 | + */ |
|
| 289 | 304 | public function error($msg) |
| 290 | 305 | { |
| 291 | 306 | throw new Exception($msg); |
@@ -401,6 +416,11 @@ discard block |
||
| 401 | 416 | return $this->page; |
| 402 | 417 | } |
| 403 | 418 | |
| 419 | + /** |
|
| 420 | + * @param integer $r |
|
| 421 | + * @param integer $g |
|
| 422 | + * @param integer $b |
|
| 423 | + */ |
|
| 404 | 424 | public function setDrawColor($r, $g = null, $b = null) |
| 405 | 425 | { |
| 406 | 426 | //Set color for all stroking operations |
@@ -414,6 +434,11 @@ discard block |
||
| 414 | 434 | } |
| 415 | 435 | } |
| 416 | 436 | |
| 437 | + /** |
|
| 438 | + * @param integer $r |
|
| 439 | + * @param integer $g |
|
| 440 | + * @param integer $b |
|
| 441 | + */ |
|
| 417 | 442 | public function setFillColor($r, $g = null, $b = null) |
| 418 | 443 | { |
| 419 | 444 | //Set color for all filling operations |
@@ -428,6 +453,11 @@ discard block |
||
| 428 | 453 | } |
| 429 | 454 | } |
| 430 | 455 | |
| 456 | + /** |
|
| 457 | + * @param integer $r |
|
| 458 | + * @param integer $g |
|
| 459 | + * @param integer $b |
|
| 460 | + */ |
|
| 431 | 461 | public function settextColor($r, $g = null, $b = null) |
| 432 | 462 | { |
| 433 | 463 | //Set color for text |
@@ -497,6 +527,9 @@ discard block |
||
| 497 | 527 | ); |
| 498 | 528 | } |
| 499 | 529 | |
| 530 | + /** |
|
| 531 | + * @param string $family |
|
| 532 | + */ |
|
| 500 | 533 | public function addFont($family, $style = '', $file = '') |
| 501 | 534 | { |
| 502 | 535 | //Add a TrueType or Type1 font |
@@ -654,6 +687,10 @@ discard block |
||
| 654 | 687 | $this->links[$link] = [$page, $y]; |
| 655 | 688 | } |
| 656 | 689 | |
| 690 | + /** |
|
| 691 | + * @param double $y |
|
| 692 | + * @param string $link |
|
| 693 | + */ |
|
| 657 | 694 | public function link($x, $y, $w, $h, $link) |
| 658 | 695 | { |
| 659 | 696 | //Put a link on the page |
@@ -666,6 +703,11 @@ discard block |
||
| 666 | 703 | ]; |
| 667 | 704 | } |
| 668 | 705 | |
| 706 | + /** |
|
| 707 | + * @param double $x |
|
| 708 | + * @param double $y |
|
| 709 | + * @param string $txt |
|
| 710 | + */ |
|
| 669 | 711 | public function text($x, $y, $txt) |
| 670 | 712 | { |
| 671 | 713 | //Output a string |
@@ -990,6 +1032,9 @@ discard block |
||
| 990 | 1032 | } |
| 991 | 1033 | } |
| 992 | 1034 | |
| 1035 | + /** |
|
| 1036 | + * @param string $file |
|
| 1037 | + */ |
|
| 993 | 1038 | public function image($file, $x = null, $y = null, $w = 0, $h = 0, $type = '', $link = '') |
| 994 | 1039 | { |
| 995 | 1040 | //Put an image on the page |
@@ -1195,6 +1240,9 @@ discard block |
||
| 1195 | 1240 | } |
| 1196 | 1241 | |
| 1197 | 1242 | |
| 1243 | + /** |
|
| 1244 | + * @param string $format |
|
| 1245 | + */ |
|
| 1198 | 1246 | protected function getpageformat($format) |
| 1199 | 1247 | { |
| 1200 | 1248 | $format=strtolower($format); |
@@ -1215,6 +1263,10 @@ discard block |
||
| 1215 | 1263 | } |
| 1216 | 1264 | |
| 1217 | 1265 | |
| 1266 | + /** |
|
| 1267 | + * @param string $orientation |
|
| 1268 | + * @param string $format |
|
| 1269 | + */ |
|
| 1218 | 1270 | protected function beginPage($orientation, $format) |
| 1219 | 1271 | { |
| 1220 | 1272 | $this->page++; |
@@ -1360,6 +1412,9 @@ discard block |
||
| 1360 | 1412 | } |
| 1361 | 1413 | |
| 1362 | 1414 | |
| 1415 | + /** |
|
| 1416 | + * @param string $file |
|
| 1417 | + */ |
|
| 1363 | 1418 | protected function parsePNG($file) |
| 1364 | 1419 | { |
| 1365 | 1420 | //Extract info from a PNG file |
@@ -172,6 +172,9 @@ discard block |
||
| 172 | 172 | $this->pdfVersion = '1.3'; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | + /** |
|
| 176 | + * @param integer $right |
|
| 177 | + */ |
|
| 175 | 178 | public function setMargins($left, $top, $right = null) |
| 176 | 179 | { |
| 177 | 180 | // Set left, top and right margins |
@@ -204,6 +207,9 @@ discard block |
||
| 204 | 207 | $this->rMargin = $margin; |
| 205 | 208 | } |
| 206 | 209 | |
| 210 | + /** |
|
| 211 | + * @param boolean $auto |
|
| 212 | + */ |
|
| 207 | 213 | public function setautoPageBreak($auto, $margin = 0) |
| 208 | 214 | { |
| 209 | 215 | // Set auto page break mode and triggering margin |
@@ -211,6 +217,10 @@ discard block |
||
| 211 | 217 | $this->bMargin = $margin; |
| 212 | 218 | $this->pageBreakTrigger = $this->h - $margin; |
| 213 | 219 | } |
| 220 | + |
|
| 221 | + /** |
|
| 222 | + * @param string $zoom |
|
| 223 | + */ |
|
| 214 | 224 | public function setDisplayMode($zoom, $layout = 'default') |
| 215 | 225 | { |
| 216 | 226 | // Set display mode in viewer |
@@ -226,6 +236,9 @@ discard block |
||
| 226 | 236 | } |
| 227 | 237 | } |
| 228 | 238 | |
| 239 | + /** |
|
| 240 | + * @param boolean $compress |
|
| 241 | + */ |
|
| 229 | 242 | public function setCompression($compress) |
| 230 | 243 | { |
| 231 | 244 | // Set page compression |
@@ -272,6 +285,9 @@ discard block |
||
| 272 | 285 | $this->aliasNbPages = $alias; |
| 273 | 286 | } |
| 274 | 287 | |
| 288 | + /** |
|
| 289 | + * @param string $msg |
|
| 290 | + */ |
|
| 275 | 291 | public function error($msg) |
| 276 | 292 | { |
| 277 | 293 | // Fatal error |
@@ -382,6 +398,12 @@ discard block |
||
| 382 | 398 | // Get current page number |
| 383 | 399 | return $this->page; |
| 384 | 400 | } |
| 401 | + |
|
| 402 | + /** |
|
| 403 | + * @param integer $r |
|
| 404 | + * @param integer $g |
|
| 405 | + * @param integer $b |
|
| 406 | + */ |
|
| 385 | 407 | public function setdrawColor($r, $g = null, $b = null) |
| 386 | 408 | { |
| 387 | 409 | // Set color for all stroking operations |
@@ -395,6 +417,11 @@ discard block |
||
| 395 | 417 | } |
| 396 | 418 | } |
| 397 | 419 | |
| 420 | + /** |
|
| 421 | + * @param integer $r |
|
| 422 | + * @param integer $g |
|
| 423 | + * @param integer $b |
|
| 424 | + */ |
|
| 398 | 425 | public function setfillColor($r, $g = null, $b = null) |
| 399 | 426 | { |
| 400 | 427 | // Set color for all filling operations |
@@ -409,6 +436,11 @@ discard block |
||
| 409 | 436 | } |
| 410 | 437 | } |
| 411 | 438 | |
| 439 | + /** |
|
| 440 | + * @param integer $r |
|
| 441 | + * @param integer $g |
|
| 442 | + * @param integer $b |
|
| 443 | + */ |
|
| 412 | 444 | public function settextColor($r, $g = null, $b = null) |
| 413 | 445 | { |
| 414 | 446 | // Set color for text |
@@ -478,6 +510,9 @@ discard block |
||
| 478 | 510 | ); |
| 479 | 511 | } |
| 480 | 512 | |
| 513 | + /** |
|
| 514 | + * @param string $family |
|
| 515 | + */ |
|
| 481 | 516 | public function addFont($family, $style = '', $file = '') |
| 482 | 517 | { |
| 483 | 518 | // Add a TrueType, OpenType or Type1 font |
@@ -594,6 +629,10 @@ discard block |
||
| 594 | 629 | $this->links[$link] = [$page, $y]; |
| 595 | 630 | } |
| 596 | 631 | |
| 632 | + /** |
|
| 633 | + * @param double $y |
|
| 634 | + * @param string $link |
|
| 635 | + */ |
|
| 597 | 636 | public function link($x, $y, $w, $h, $link) |
| 598 | 637 | { |
| 599 | 638 | // Put a link on the page |
@@ -606,6 +645,11 @@ discard block |
||
| 606 | 645 | ]; |
| 607 | 646 | } |
| 608 | 647 | |
| 648 | + /** |
|
| 649 | + * @param double $x |
|
| 650 | + * @param double $y |
|
| 651 | + * @param string $txt |
|
| 652 | + */ |
|
| 609 | 653 | public function text($x, $y, $txt) |
| 610 | 654 | { |
| 611 | 655 | // output a string |
@@ -970,6 +1014,9 @@ discard block |
||
| 970 | 1014 | } |
| 971 | 1015 | } |
| 972 | 1016 | |
| 1017 | + /** |
|
| 1018 | + * @param string $file |
|
| 1019 | + */ |
|
| 973 | 1020 | public function image($file, $x = null, $y = null, $w = 0, $h = 0, $type = '', $link = '') |
| 974 | 1021 | { |
| 975 | 1022 | // Put an image on the page |
@@ -1214,6 +1261,10 @@ discard block |
||
| 1214 | 1261 | } |
| 1215 | 1262 | } |
| 1216 | 1263 | |
| 1264 | + /** |
|
| 1265 | + * @param string $orientation |
|
| 1266 | + * @param string $size |
|
| 1267 | + */ |
|
| 1217 | 1268 | protected function beginPage($orientation, $size, $rotation) |
| 1218 | 1269 | { |
| 1219 | 1270 | $this->page++; |
@@ -1416,6 +1467,9 @@ discard block |
||
| 1416 | 1467 | ]; |
| 1417 | 1468 | } |
| 1418 | 1469 | |
| 1470 | + /** |
|
| 1471 | + * @param string $file |
|
| 1472 | + */ |
|
| 1419 | 1473 | protected function parsePng($file) |
| 1420 | 1474 | { |
| 1421 | 1475 | // Extract info from a PNG file |
@@ -7,64 +7,64 @@ discard block |
||
| 7 | 7 | const FPDF_VERSION = '1.81'; |
| 8 | 8 | const FPDF_FONTPATH = 'font/'; |
| 9 | 9 | |
| 10 | - protected $page; // current page number |
|
| 11 | - protected $n; // current object number |
|
| 12 | - protected $offsets; // array of object offsets |
|
| 13 | - protected $buffer; // buffer holding in-memory PDF |
|
| 14 | - protected $pages; // array containing pages |
|
| 15 | - protected $state; // current document state |
|
| 16 | - protected $compress; // compression flag |
|
| 17 | - protected $k; // scale factor (number of points in user unit) |
|
| 18 | - protected $defOrientation; // default orientation |
|
| 19 | - protected $curOrientation; // current orientation |
|
| 20 | - protected $stdPageSizes; // standard page sizes |
|
| 21 | - protected $defPageSize; // default page size |
|
| 22 | - protected $curPageSize; // current page size |
|
| 23 | - protected $curRotation; // current page rotation |
|
| 24 | - protected $pageInfo; // page-related data |
|
| 10 | + protected $page; // current page number |
|
| 11 | + protected $n; // current object number |
|
| 12 | + protected $offsets; // array of object offsets |
|
| 13 | + protected $buffer; // buffer holding in-memory PDF |
|
| 14 | + protected $pages; // array containing pages |
|
| 15 | + protected $state; // current document state |
|
| 16 | + protected $compress; // compression flag |
|
| 17 | + protected $k; // scale factor (number of points in user unit) |
|
| 18 | + protected $defOrientation; // default orientation |
|
| 19 | + protected $curOrientation; // current orientation |
|
| 20 | + protected $stdPageSizes; // standard page sizes |
|
| 21 | + protected $defPageSize; // default page size |
|
| 22 | + protected $curPageSize; // current page size |
|
| 23 | + protected $curRotation; // current page rotation |
|
| 24 | + protected $pageInfo; // page-related data |
|
| 25 | 25 | protected $wPt; |
| 26 | - protected $hPt; // dimensions of current page in points |
|
| 26 | + protected $hPt; // dimensions of current page in points |
|
| 27 | 27 | protected $w; |
| 28 | - protected $h; // dimensions of current page in user unit |
|
| 29 | - protected $lMargin; // left margin |
|
| 30 | - protected $tMargin; // top margin |
|
| 31 | - protected $rMargin; // right margin |
|
| 32 | - protected $bMargin; // page break margin |
|
| 33 | - protected $cMargin; // cell margin |
|
| 28 | + protected $h; // dimensions of current page in user unit |
|
| 29 | + protected $lMargin; // left margin |
|
| 30 | + protected $tMargin; // top margin |
|
| 31 | + protected $rMargin; // right margin |
|
| 32 | + protected $bMargin; // page break margin |
|
| 33 | + protected $cMargin; // cell margin |
|
| 34 | 34 | protected $x; |
| 35 | - protected $y; // current position in user unit |
|
| 36 | - protected $lasth; // height of last printed cell |
|
| 37 | - protected $lineWidth; // line width in user unit |
|
| 38 | - protected $fontpath; // path containing fonts |
|
| 39 | - protected $coreFonts; // array of core font names |
|
| 40 | - protected $fonts; // array of used fonts |
|
| 41 | - protected $fontFiles; // array of font files |
|
| 42 | - protected $encodings; // array of encodings |
|
| 43 | - protected $cmaps; // array of ToUnicode CMaps |
|
| 44 | - protected $fontFamily; // current font family |
|
| 45 | - protected $fontStyle; // current font style |
|
| 46 | - protected $underline; // underlining flag |
|
| 47 | - protected $currentFont; // current font info |
|
| 48 | - protected $fontSizePt; // current font size in points |
|
| 49 | - protected $fontSize; // current font size in user unit |
|
| 50 | - protected $drawColor; // commands for drawing color |
|
| 51 | - protected $fillColor; // commands for filling color |
|
| 52 | - protected $textColor; // commands for text color |
|
| 53 | - protected $colorFlag; // indicates whether fill and text colors are different |
|
| 54 | - protected $withAlpha; // indicates whether alpha channel is used |
|
| 55 | - protected $ws; // word spacing |
|
| 56 | - protected $images; // array of used images |
|
| 57 | - protected $pageLinks; // array of links in pages |
|
| 58 | - protected $links; // array of internal links |
|
| 59 | - protected $autoPageBreak; // automatic page breaking |
|
| 60 | - protected $pageBreakTrigger; // threshold used to trigger page breaks |
|
| 61 | - protected $inHeader; // flag set when processing header |
|
| 62 | - protected $infooter; // flag set when processing footer |
|
| 63 | - protected $aliasNbPages; // alias for total number of pages |
|
| 64 | - protected $zoomMode; // zoom display mode |
|
| 65 | - protected $layoutMode; // layout display mode |
|
| 66 | - protected $metadata; // document properties |
|
| 67 | - protected $pdfVersion; // PDF version number |
|
| 35 | + protected $y; // current position in user unit |
|
| 36 | + protected $lasth; // height of last printed cell |
|
| 37 | + protected $lineWidth; // line width in user unit |
|
| 38 | + protected $fontpath; // path containing fonts |
|
| 39 | + protected $coreFonts; // array of core font names |
|
| 40 | + protected $fonts; // array of used fonts |
|
| 41 | + protected $fontFiles; // array of font files |
|
| 42 | + protected $encodings; // array of encodings |
|
| 43 | + protected $cmaps; // array of ToUnicode CMaps |
|
| 44 | + protected $fontFamily; // current font family |
|
| 45 | + protected $fontStyle; // current font style |
|
| 46 | + protected $underline; // underlining flag |
|
| 47 | + protected $currentFont; // current font info |
|
| 48 | + protected $fontSizePt; // current font size in points |
|
| 49 | + protected $fontSize; // current font size in user unit |
|
| 50 | + protected $drawColor; // commands for drawing color |
|
| 51 | + protected $fillColor; // commands for filling color |
|
| 52 | + protected $textColor; // commands for text color |
|
| 53 | + protected $colorFlag; // indicates whether fill and text colors are different |
|
| 54 | + protected $withAlpha; // indicates whether alpha channel is used |
|
| 55 | + protected $ws; // word spacing |
|
| 56 | + protected $images; // array of used images |
|
| 57 | + protected $pageLinks; // array of links in pages |
|
| 58 | + protected $links; // array of internal links |
|
| 59 | + protected $autoPageBreak; // automatic page breaking |
|
| 60 | + protected $pageBreakTrigger; // threshold used to trigger page breaks |
|
| 61 | + protected $inHeader; // flag set when processing header |
|
| 62 | + protected $infooter; // flag set when processing footer |
|
| 63 | + protected $aliasNbPages; // alias for total number of pages |
|
| 64 | + protected $zoomMode; // zoom display mode |
|
| 65 | + protected $layoutMode; // layout display mode |
|
| 66 | + protected $metadata; // document properties |
|
| 67 | + protected $pdfVersion; // PDF version number |
|
| 68 | 68 | |
| 69 | 69 | public function __construct($orientation = 'P', $unit = 'mm', $size = 'A4') |
| 70 | 70 | { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $this->withAlpha = false; |
| 98 | 98 | $this->ws = 0; |
| 99 | 99 | |
| 100 | - $this->fontpath = __DIR__. FPDF_FONTPATH; |
|
| 100 | + $this->fontpath = __DIR__ . FPDF_FONTPATH; |
|
| 101 | 101 | |
| 102 | 102 | // Core fonts |
| 103 | 103 | $this->coreFonts = [ |
@@ -1027,8 +1027,8 @@ discard block |
||
| 1027 | 1027 | *cabecalhoDANFE |
| 1028 | 1028 | * Monta o cabelhalho da DANFE (retrato e paisagem) |
| 1029 | 1029 | * |
| 1030 | - * @param number $x Posição horizontal inicial, canto esquerdo |
|
| 1031 | - * @param number $y Posição vertical inicial, canto superior |
|
| 1030 | + * @param integer $x Posição horizontal inicial, canto esquerdo |
|
| 1031 | + * @param integer $y Posição vertical inicial, canto superior |
|
| 1032 | 1032 | * @param number $pag Número da Página |
| 1033 | 1033 | * @param number $totPag Total de páginas |
| 1034 | 1034 | * @return number Posição vertical final |
@@ -1494,8 +1494,8 @@ discard block |
||
| 1494 | 1494 | * Monta o campo com os dados do destinatário na DANFE. (retrato e paisagem) |
| 1495 | 1495 | * |
| 1496 | 1496 | * @name destinatarioDANFE |
| 1497 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1498 | - * @param number $y Posição vertical canto superior |
|
| 1497 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1498 | + * @param integer $y Posição vertical canto superior |
|
| 1499 | 1499 | * @return number Posição vertical final |
| 1500 | 1500 | */ |
| 1501 | 1501 | protected function destinatarioDANFE($x = 0, $y = 0) |
@@ -1695,7 +1695,7 @@ discard block |
||
| 1695 | 1695 | * Gera a String do Texto da Fatura |
| 1696 | 1696 | * |
| 1697 | 1697 | * @name getTextoFatura |
| 1698 | - * @return uma String com o texto ou ""; |
|
| 1698 | + * @return string String com o texto ou ""; |
|
| 1699 | 1699 | */ |
| 1700 | 1700 | protected function getTextoFatura() |
| 1701 | 1701 | { |
@@ -1749,8 +1749,8 @@ discard block |
||
| 1749 | 1749 | * Monta o campo de duplicatas da DANFE (retrato e paisagem) |
| 1750 | 1750 | * |
| 1751 | 1751 | * @name faturaDANFE |
| 1752 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1753 | - * @param number $y Posição vertical canto superior |
|
| 1752 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1753 | + * @param double $y Posição vertical canto superior |
|
| 1754 | 1754 | * @return number Posição vertical final |
| 1755 | 1755 | */ |
| 1756 | 1756 | protected function faturaDANFE($x, $y) |
@@ -1857,8 +1857,8 @@ discard block |
||
| 1857 | 1857 | * Monta o campo de pagamentos da DANFE (retrato e paisagem) (foi baseada na faturaDANFE) |
| 1858 | 1858 | * |
| 1859 | 1859 | * @name pagamentoDANFE |
| 1860 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1861 | - * @param number $y Posição vertical canto superior |
|
| 1860 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1861 | + * @param double $y Posição vertical canto superior |
|
| 1862 | 1862 | * @return number Posição vertical final |
| 1863 | 1863 | */ |
| 1864 | 1864 | protected function pagamentoDANFE($x, $y) |
@@ -1964,6 +1964,8 @@ discard block |
||
| 1964 | 1964 | * @param float $h Altura do campo |
| 1965 | 1965 | * @param float $h Título do campo |
| 1966 | 1966 | * @param float $h Valor do imposto |
| 1967 | + * @param string $titulo |
|
| 1968 | + * @param string $campoImposto |
|
| 1967 | 1969 | * @return float Sugestão do $x do próximo imposto |
| 1968 | 1970 | */ |
| 1969 | 1971 | protected function impostoDanfeHelper($x, $y, $w, $h, $titulo, $campoImposto) |
@@ -1990,9 +1992,9 @@ discard block |
||
| 1990 | 1992 | * impostoDANFE |
| 1991 | 1993 | * Monta o campo de impostos e totais da DANFE (retrato e paisagem) |
| 1992 | 1994 | * |
| 1993 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1994 | - * @param number $y Posição vertical canto superior |
|
| 1995 | - * @return number Posição vertical final |
|
| 1995 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1996 | + * @param double $y Posição vertical canto superior |
|
| 1997 | + * @return double Posição vertical final |
|
| 1996 | 1998 | */ |
| 1997 | 1999 | protected function impostoDANFE($x, $y) |
| 1998 | 2000 | { |
@@ -2374,6 +2376,10 @@ discard block |
||
| 2374 | 2376 | |
| 2375 | 2377 | |
| 2376 | 2378 | |
| 2379 | + /** |
|
| 2380 | + * @param string $campo |
|
| 2381 | + * @param string $formato |
|
| 2382 | + */ |
|
| 2377 | 2383 | protected function descricaoProdutoHelper($origem, $campo, $formato) |
| 2378 | 2384 | { |
| 2379 | 2385 | $valor_original = $origem->getElementsByTagName($campo)->item(0); |
@@ -2479,7 +2485,6 @@ discard block |
||
| 2479 | 2485 | * @param float $x Posição horizontal canto esquerdo |
| 2480 | 2486 | * @param float $y Posição vertical canto superior |
| 2481 | 2487 | * @param float $nInicio Número do item inicial |
| 2482 | - * @param float $max Número do item final |
|
| 2483 | 2488 | * @param float $hmax Altura máxima do campo de itens em mm |
| 2484 | 2489 | * @return float Posição vertical final |
| 2485 | 2490 | */ |
@@ -3122,8 +3127,7 @@ discard block |
||
| 3122 | 3127 | * sobre a API NfePHP |
| 3123 | 3128 | * |
| 3124 | 3129 | * @name rodape |
| 3125 | - * @param float $xInic Posição horizontal canto esquerdo |
|
| 3126 | - * @param float $yFinal Posição vertical final para impressão |
|
| 3130 | + * @param integer $x |
|
| 3127 | 3131 | * @return void |
| 3128 | 3132 | */ |
| 3129 | 3133 | protected function rodape($x, $y) |
@@ -3146,7 +3150,7 @@ discard block |
||
| 3146 | 3150 | * Monta o canhoto da DANFE (retrato e paisagem) |
| 3147 | 3151 | * |
| 3148 | 3152 | * @name canhotoDANFE |
| 3149 | - * @param number $x Posição horizontal canto esquerdo |
|
| 3153 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 3150 | 3154 | * @param number $y Posição vertical canto superior |
| 3151 | 3155 | * @return number Posição vertical final |
| 3152 | 3156 | * |
@@ -3440,6 +3444,9 @@ discard block |
||
| 3440 | 3444 | return $saida; |
| 3441 | 3445 | } |
| 3442 | 3446 | |
| 3447 | + /** |
|
| 3448 | + * @param string $original |
|
| 3449 | + */ |
|
| 3443 | 3450 | private function imagePNGtoJPG($original) |
| 3444 | 3451 | { |
| 3445 | 3452 | $image = imagecreatefrompng($original); |
@@ -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->geraInformacoesDasNotasReferenciadas(); |
@@ -1038,7 +1038,7 @@ discard block |
||
| 1038 | 1038 | $oldX = $x; |
| 1039 | 1039 | $oldY = $y; |
| 1040 | 1040 | if ($this->orientacao == 'P') { |
| 1041 | - $maxW = $this->wPrint; |
|
| 1041 | + $maxW = $this->wPrint; |
|
| 1042 | 1042 | } else { |
| 1043 | 1043 | if ($pag == 1) { // primeira página |
| 1044 | 1044 | $maxW = $this->wPrint - $this->wCanhoto; |
@@ -1396,8 +1396,8 @@ discard block |
||
| 1396 | 1396 | $w = $maxW-(2*$x); |
| 1397 | 1397 | $this->pdf->SetTextColor(200, 200, 200); |
| 1398 | 1398 | $texto = "DANFE impresso em contingência -\n". |
| 1399 | - "DPEC regularmente recebido pela Receita\n". |
|
| 1400 | - "Federal do Brasil"; |
|
| 1399 | + "DPEC regularmente recebido pela Receita\n". |
|
| 1400 | + "Federal do Brasil"; |
|
| 1401 | 1401 | $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B']; |
| 1402 | 1402 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1403 | 1403 | $this->pdf->SetTextColor(0, 0, 0); |
@@ -1690,13 +1690,13 @@ discard block |
||
| 1690 | 1690 | return ($y + $h); |
| 1691 | 1691 | } //fim da função destinatarioDANFE |
| 1692 | 1692 | |
| 1693 | - /** |
|
| 1694 | - * getTextoFatura |
|
| 1695 | - * Gera a String do Texto da Fatura |
|
| 1696 | - * |
|
| 1697 | - * @name getTextoFatura |
|
| 1698 | - * @return uma String com o texto ou ""; |
|
| 1699 | - */ |
|
| 1693 | + /** |
|
| 1694 | + * getTextoFatura |
|
| 1695 | + * Gera a String do Texto da Fatura |
|
| 1696 | + * |
|
| 1697 | + * @name getTextoFatura |
|
| 1698 | + * @return uma String com o texto ou ""; |
|
| 1699 | + */ |
|
| 1700 | 1700 | protected function getTextoFatura() |
| 1701 | 1701 | { |
| 1702 | 1702 | if (isset($this->cobr)) { |
@@ -1727,13 +1727,13 @@ discard block |
||
| 1727 | 1727 | return ""; |
| 1728 | 1728 | } |
| 1729 | 1729 | |
| 1730 | - /** |
|
| 1731 | - * sizeExtraTextoFatura |
|
| 1732 | - * Calcula o espaço ocupado pelo texto da fatura. Este espaço só é utilizado quando não houver duplicata. |
|
| 1733 | - * |
|
| 1734 | - * @name sizeExtraTextoFatura |
|
| 1735 | - * @return integer |
|
| 1736 | - */ |
|
| 1730 | + /** |
|
| 1731 | + * sizeExtraTextoFatura |
|
| 1732 | + * Calcula o espaço ocupado pelo texto da fatura. Este espaço só é utilizado quando não houver duplicata. |
|
| 1733 | + * |
|
| 1734 | + * @name sizeExtraTextoFatura |
|
| 1735 | + * @return integer |
|
| 1736 | + */ |
|
| 1737 | 1737 | protected function sizeExtraTextoFatura() |
| 1738 | 1738 | { |
| 1739 | 1739 | $textoFatura = $this->getTextoFatura(); |
@@ -1898,7 +1898,7 @@ discard block |
||
| 1898 | 1898 | '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível', |
| 1899 | 1899 | '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros']; |
| 1900 | 1900 | $bandeira = ['01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners', |
| 1901 | - '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros']; |
|
| 1901 | + '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros']; |
|
| 1902 | 1902 | foreach ($this->detPag as $k => $d) { |
| 1903 | 1903 | $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
| 1904 | 1904 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue : '0'; |
@@ -2534,7 +2534,7 @@ discard block |
||
| 2534 | 2534 | $w4 = round($w*0.05, 0); |
| 2535 | 2535 | $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2 |
| 2536 | 2536 | if ($this->getTagValue($this->emit, 'CRT') == '3') { |
| 2537 | - $texto = 'O/CST';//Regime Normal |
|
| 2537 | + $texto = 'O/CST';//Regime Normal |
|
| 2538 | 2538 | } |
| 2539 | 2539 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2540 | 2540 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
@@ -2909,7 +2909,7 @@ discard block |
||
| 2909 | 2909 | $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2910 | 2910 | $yVeic += $h; |
| 2911 | 2911 | $texto = 'Tipo.................: ' . ($renavamTiposVeiculos[intval($veiculoTipo)] ?? $veiculoTipo); |
| 2912 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2912 | + $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2913 | 2913 | $yVeic = $y + $h; |
| 2914 | 2914 | $xVeic = $x + 65; |
| 2915 | 2915 | $texto = 'Nº Motor: .........: ' . $veiculoMotor; |
@@ -3043,9 +3043,9 @@ discard block |
||
| 3043 | 3043 | //DADOS ADICIONAIS |
| 3044 | 3044 | $texto = "DADOS ADICIONAIS"; |
| 3045 | 3045 | if ($this->orientacao == 'P') { |
| 3046 | - $w = $this->wPrint; |
|
| 3046 | + $w = $this->wPrint; |
|
| 3047 | 3047 | } else { |
| 3048 | - $w = $this->wPrint-$this->wCanhoto; |
|
| 3048 | + $w = $this->wPrint-$this->wCanhoto; |
|
| 3049 | 3049 | } |
| 3050 | 3050 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 3051 | 3051 | $this->pdf->textBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -3125,10 +3125,10 @@ discard block |
||
| 3125 | 3125 | protected function rodape($x, $y) |
| 3126 | 3126 | { |
| 3127 | 3127 | if ($this->orientacao == 'P') { |
| 3128 | - $w = $this->wPrint; |
|
| 3128 | + $w = $this->wPrint; |
|
| 3129 | 3129 | } else { |
| 3130 | - $w = $this->wPrint-$this->wCanhoto; |
|
| 3131 | - $x = $this->wCanhoto; |
|
| 3130 | + $w = $this->wPrint-$this->wCanhoto; |
|
| 3131 | + $x = $this->wCanhoto; |
|
| 3132 | 3132 | } |
| 3133 | 3133 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I']; |
| 3134 | 3134 | $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 = ['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->geraInformacoesDasNotasReferenciadas(); |
@@ -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->anfaveaDANFE($this->getTagValue($this->infAdic, "infCpl")) : ''; |
| 610 | 610 | $infPedido = $this->geraInformacoesDaTagCompra(); |
@@ -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,37 +647,37 @@ discard block |
||
| 647 | 647 | foreach ($alinhas as $linha) { |
| 648 | 648 | $numlinhasdados += $this->pdf->getNumLines($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->sizeExtraTextoFatura()); |
| 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 = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 678 | 678 | $numlinhas = 0; |
| 679 | 679 | $hUsado = $hCabecItens; |
| 680 | - $w2 = round($w*0.28, 0); |
|
| 680 | + $w2 = round($w * 0.28, 0); |
|
| 681 | 681 | $hDispo = $hDispo1; |
| 682 | 682 | $totPag = 1; |
| 683 | 683 | $i = 0; |
@@ -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->cabecalhoDANFE($x, $y, $pag, $totPag); |
| 716 | 716 | //coloca os dados do destinatário |
| 717 | - $y = $this->destinatarioDANFE($x, $y+1); |
|
| 717 | + $y = $this->destinatarioDANFE($x, $y + 1); |
|
| 718 | 718 | |
| 719 | 719 | |
| 720 | 720 | //Verifica as formas de pagamento da nota fiscal |
@@ -728,29 +728,29 @@ discard block |
||
| 728 | 728 | } |
| 729 | 729 | //caso tenha boleto imprimir fatura |
| 730 | 730 | if ($this->dup->length > 0) { |
| 731 | - $y = $this->faturaDANFE($x, $y+1); |
|
| 731 | + $y = $this->faturaDANFE($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->impostoDANFE($x, $y+1); |
|
| 743 | + $y = $this->impostoDANFE($x, $y + 1); |
|
| 744 | 744 | //coloca os dados do trasnporte |
| 745 | - $y = $this->transporteDANFE($x, $y+1); |
|
| 745 | + $y = $this->transporteDANFE($x, $y + 1); |
|
| 746 | 746 | //itens da DANFE |
| 747 | 747 | $nInicial = 0; |
| 748 | 748 | |
| 749 | - $y = $this->itensDANFE($x, $y+1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens); |
|
| 749 | + $y = $this->itensDANFE($x, $y + 1, $nInicial, $hDispo1, $pag, $totPag, $hCabecItens); |
|
| 750 | 750 | |
| 751 | 751 | //coloca os dados do ISSQN |
| 752 | 752 | if ($linhaISSQN == 1) { |
| 753 | - $y = $this->issqnDANFE($x, $y+4); |
|
| 753 | + $y = $this->issqnDANFE($x, $y + 4); |
|
| 754 | 754 | } else { |
| 755 | 755 | $y += 4; |
| 756 | 756 | } |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | $y = $this->dadosAdicionaisDANFE($x, $y, $hdadosadic); |
| 759 | 759 | //coloca o rodapé da página |
| 760 | 760 | if ($this->orientacao == 'P') { |
| 761 | - $this->rodape($xInic, $y-1); |
|
| 761 | + $this->rodape($xInic, $y - 1); |
|
| 762 | 762 | } else { |
| 763 | 763 | $this->rodape($xInic, $this->hPrint + 1); |
| 764 | 764 | } |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | //coloca o cabeçalho na página adicional |
| 780 | 780 | $y = $this->cabecalhoDANFE($x, $y, $n, $totPag); |
| 781 | 781 | //coloca os itens na página adicional |
| 782 | - $y = $this->itensDANFE($x, $y+1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens); |
|
| 782 | + $y = $this->itensDANFE($x, $y + 1, $nInicial, $hDispo2, $n, $totPag, $hCabecItens); |
|
| 783 | 783 | //coloca o rodapé da página |
| 784 | 784 | if ($this->orientacao == 'P') { |
| 785 | 785 | $this->rodape($xInic, $y + 4); |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | } |
| 793 | 793 | } |
| 794 | 794 | //retorna o ID na NFe |
| 795 | - if ($classPdf!==false) { |
|
| 795 | + if ($classPdf !== false) { |
|
| 796 | 796 | $aR = [ |
| 797 | 797 | 'id'=>str_replace('NFe', '', $this->infNFe->getAttribute("Id")), |
| 798 | 798 | 'classe_PDF'=>$this->pdf |
@@ -826,7 +826,7 @@ discard block |
||
| 826 | 826 | if ($startPos === false) { |
| 827 | 827 | return $cdata; |
| 828 | 828 | } |
| 829 | - for ($x=$len; $x>0; $x--) { |
|
| 829 | + for ($x = $len; $x > 0; $x--) { |
|
| 830 | 830 | if (substr($cdata, $x, 1) == '>') { |
| 831 | 831 | $endPos = $x; |
| 832 | 832 | break; |
@@ -837,15 +837,15 @@ discard block |
||
| 837 | 837 | } else { |
| 838 | 838 | $parte1 = ''; |
| 839 | 839 | } |
| 840 | - $parte2 = substr($cdata, $startPos, $endPos-$startPos+1); |
|
| 840 | + $parte2 = substr($cdata, $startPos, $endPos - $startPos + 1); |
|
| 841 | 841 | if ($endPos < $len) { |
| 842 | 842 | $parte3 = substr($cdata, $endPos + 1, $len - $endPos - 1); |
| 843 | 843 | } else { |
| 844 | 844 | $parte3 = ''; |
| 845 | 845 | } |
| 846 | - $texto = trim($parte1).' '.trim($parte3); |
|
| 846 | + $texto = trim($parte1) . ' ' . trim($parte3); |
|
| 847 | 847 | if (strpos($parte2, '<CDATA>') === false) { |
| 848 | - $cdata = '<CDATA>'.$parte2.'</CDATA>'; |
|
| 848 | + $cdata = '<CDATA>' . $parte2 . '</CDATA>'; |
|
| 849 | 849 | } else { |
| 850 | 850 | $cdata = $parte2; |
| 851 | 851 | } |
@@ -919,15 +919,15 @@ discard block |
||
| 919 | 919 | //grupo CADATA infCpl |
| 920 | 920 | $t = $dom->getElementsByTagName('transmissor')->item(0); |
| 921 | 921 | $r = $dom->getElementsByTagName('receptor')->item(0); |
| 922 | - $versao = ! empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 923 | - 'Versao:'.$dom->getElementsByTagName('versao')->item(0)->nodeValue.' ' : ''; |
|
| 924 | - $especieNF = ! empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 925 | - 'Especie:'.$dom->getElementsByTagName('especieNF')->item(0)->nodeValue.' ' : ''; |
|
| 926 | - $fabEntrega = ! empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 927 | - 'Entrega:'.$dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue.' ' : ''; |
|
| 928 | - $dca = ! empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 929 | - 'dca:'.$dom->getElementsByTagName('dca')->item(0)->nodeValue.' ' : ''; |
|
| 930 | - $texto .= "".$versao.$especieNF.$fabEntrega.$dca; |
|
| 922 | + $versao = !empty($dom->getElementsByTagName('versao')->item(0)->nodeValue) ? |
|
| 923 | + 'Versao:' . $dom->getElementsByTagName('versao')->item(0)->nodeValue . ' ' : ''; |
|
| 924 | + $especieNF = !empty($dom->getElementsByTagName('especieNF')->item(0)->nodeValue) ? |
|
| 925 | + 'Especie:' . $dom->getElementsByTagName('especieNF')->item(0)->nodeValue . ' ' : ''; |
|
| 926 | + $fabEntrega = !empty($dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue) ? |
|
| 927 | + 'Entrega:' . $dom->getElementsByTagName('fabEntrega')->item(0)->nodeValue . ' ' : ''; |
|
| 928 | + $dca = !empty($dom->getElementsByTagName('dca')->item(0)->nodeValue) ? |
|
| 929 | + 'dca:' . $dom->getElementsByTagName('dca')->item(0)->nodeValue . ' ' : ''; |
|
| 930 | + $texto .= "" . $versao . $especieNF . $fabEntrega . $dca; |
|
| 931 | 931 | if (isset($t)) { |
| 932 | 932 | if ($t->hasAttributes()) { |
| 933 | 933 | $texto .= " Transmissor "; |
@@ -1048,14 +1048,14 @@ discard block |
||
| 1048 | 1048 | } |
| 1049 | 1049 | //#################################################################################### |
| 1050 | 1050 | //coluna esquerda identificação do emitente |
| 1051 | - $w = round($maxW*0.41, 0); |
|
| 1051 | + $w = round($maxW * 0.41, 0); |
|
| 1052 | 1052 | if ($this->orientacao == 'P') { |
| 1053 | 1053 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I']; |
| 1054 | 1054 | } else { |
| 1055 | 1055 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B']; |
| 1056 | 1056 | } |
| 1057 | 1057 | $w1 = $w; |
| 1058 | - $h=32; |
|
| 1058 | + $h = 32; |
|
| 1059 | 1059 | $oldY += $h; |
| 1060 | 1060 | $this->pdf->textBox($x, $y, $w, $h); |
| 1061 | 1061 | $texto = 'IDENTIFICAÇÃO DO EMITENTE'; |
@@ -1076,39 +1076,39 @@ discard block |
||
| 1076 | 1076 | $type == 'jpg'; |
| 1077 | 1077 | } |
| 1078 | 1078 | //largura da imagem em mm |
| 1079 | - $logoWmm = ($logoInfo[0]/72)*25.4; |
|
| 1079 | + $logoWmm = ($logoInfo[0] / 72) * 25.4; |
|
| 1080 | 1080 | //altura da imagem em mm |
| 1081 | - $logoHmm = ($logoInfo[1]/72)*25.4; |
|
| 1082 | - if ($this->logoAlign=='L') { |
|
| 1083 | - $nImgW = round($w/3, 0); |
|
| 1084 | - $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
|
| 1085 | - $xImg = $x+1; |
|
| 1086 | - $yImg = round(($h-$nImgH)/2, 0)+$y; |
|
| 1081 | + $logoHmm = ($logoInfo[1] / 72) * 25.4; |
|
| 1082 | + if ($this->logoAlign == 'L') { |
|
| 1083 | + $nImgW = round($w / 3, 0); |
|
| 1084 | + $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
|
| 1085 | + $xImg = $x + 1; |
|
| 1086 | + $yImg = round(($h - $nImgH) / 2, 0) + $y; |
|
| 1087 | 1087 | //estabelecer posições do texto |
| 1088 | - $x1 = round($xImg + $nImgW +1, 0); |
|
| 1089 | - $y1 = round($h/3+$y, 0); |
|
| 1090 | - $tw = round(2*$w/3, 0); |
|
| 1091 | - } elseif ($this->logoAlign=='C') { |
|
| 1092 | - $nImgH = round($h/3, 0); |
|
| 1093 | - $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
|
| 1094 | - $xImg = round(($w-$nImgW)/2+$x, 0); |
|
| 1095 | - $yImg = $y+3; |
|
| 1088 | + $x1 = round($xImg + $nImgW + 1, 0); |
|
| 1089 | + $y1 = round($h / 3 + $y, 0); |
|
| 1090 | + $tw = round(2 * $w / 3, 0); |
|
| 1091 | + } elseif ($this->logoAlign == 'C') { |
|
| 1092 | + $nImgH = round($h / 3, 0); |
|
| 1093 | + $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0); |
|
| 1094 | + $xImg = round(($w - $nImgW) / 2 + $x, 0); |
|
| 1095 | + $yImg = $y + 3; |
|
| 1096 | 1096 | $x1 = $x; |
| 1097 | 1097 | $y1 = round($yImg + $nImgH + 1, 0); |
| 1098 | 1098 | $tw = $w; |
| 1099 | - } elseif ($this->logoAlign=='R') { |
|
| 1100 | - $nImgW = round($w/3, 0); |
|
| 1101 | - $nImgH = round($logoHmm * ($nImgW/$logoWmm), 0); |
|
| 1102 | - $xImg = round($x+($w-(1+$nImgW)), 0); |
|
| 1103 | - $yImg = round(($h-$nImgH)/2, 0)+$y; |
|
| 1099 | + } elseif ($this->logoAlign == 'R') { |
|
| 1100 | + $nImgW = round($w / 3, 0); |
|
| 1101 | + $nImgH = round($logoHmm * ($nImgW / $logoWmm), 0); |
|
| 1102 | + $xImg = round($x + ($w - (1 + $nImgW)), 0); |
|
| 1103 | + $yImg = round(($h - $nImgH) / 2, 0) + $y; |
|
| 1104 | 1104 | $x1 = $x; |
| 1105 | - $y1 = round($h/3+$y, 0); |
|
| 1106 | - $tw = round(2*$w/3, 0); |
|
| 1107 | - } elseif ($this->logoAlign=='F') { |
|
| 1108 | - $nImgH = round($h-5, 0); |
|
| 1109 | - $nImgW = round($logoWmm * ($nImgH/$logoHmm), 0); |
|
| 1110 | - $xImg = round(($w-$nImgW)/2+$x, 0); |
|
| 1111 | - $yImg = $y+3; |
|
| 1105 | + $y1 = round($h / 3 + $y, 0); |
|
| 1106 | + $tw = round(2 * $w / 3, 0); |
|
| 1107 | + } elseif ($this->logoAlign == 'F') { |
|
| 1108 | + $nImgH = round($h - 5, 0); |
|
| 1109 | + $nImgW = round($logoWmm * ($nImgH / $logoHmm), 0); |
|
| 1110 | + $xImg = round(($w - $nImgW) / 2 + $x, 0); |
|
| 1111 | + $yImg = $y + 3; |
|
| 1112 | 1112 | $x1 = $x; |
| 1113 | 1113 | $y1 = round($yImg + $nImgH + 1, 0); |
| 1114 | 1114 | $tw = $w; |
@@ -1117,7 +1117,7 @@ discard block |
||
| 1117 | 1117 | $this->pdf->Image($this->logomarca, $xImg, $yImg, $nImgW, $nImgH, $type); |
| 1118 | 1118 | } else { |
| 1119 | 1119 | $x1 = $x; |
| 1120 | - $y1 = round($h/3+$y, 0); |
|
| 1120 | + $y1 = round($h / 3 + $y, 0); |
|
| 1121 | 1121 | $tw = $w; |
| 1122 | 1122 | } |
| 1123 | 1123 | // monta as informações apenas se diferente de full logo |
@@ -1127,9 +1127,9 @@ discard block |
||
| 1127 | 1127 | $texto = $this->emit->getElementsByTagName("xNome")->item(0)->nodeValue; |
| 1128 | 1128 | $this->pdf->textBox($x1, $y1, $tw, 8, $texto, $aFont, 'T', 'C', 0, ''); |
| 1129 | 1129 | //endereço |
| 1130 | - $y1 = $y1+5; |
|
| 1130 | + $y1 = $y1 + 5; |
|
| 1131 | 1131 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 1132 | - $fone = ! empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 1132 | + $fone = !empty($this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue) |
|
| 1133 | 1133 | ? $this->enderEmit->getElementsByTagName("fone")->item(0)->nodeValue |
| 1134 | 1134 | : ''; |
| 1135 | 1135 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
@@ -1149,34 +1149,34 @@ discard block |
||
| 1149 | 1149 | //#################################################################################### |
| 1150 | 1150 | //coluna central Danfe |
| 1151 | 1151 | $x += $w; |
| 1152 | - $w=round($maxW * 0.17, 0);//35; |
|
| 1152 | + $w = round($maxW * 0.17, 0); //35; |
|
| 1153 | 1153 | $w2 = $w; |
| 1154 | 1154 | $h = 32; |
| 1155 | 1155 | $this->pdf->textBox($x, $y, $w, $h); |
| 1156 | 1156 | |
| 1157 | 1157 | $texto = "DANFE"; |
| 1158 | 1158 | $aFont = ['font'=>$this->fontePadrao, 'size'=>14, 'style'=>'B']; |
| 1159 | - $this->pdf->textBox($x, $y+1, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1159 | + $this->pdf->textBox($x, $y + 1, $w, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1160 | 1160 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 1161 | 1161 | $texto = 'Documento Auxiliar da Nota Fiscal Eletrônica'; |
| 1162 | 1162 | $h = 20; |
| 1163 | - $this->pdf->textBox($x, $y+6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false); |
|
| 1163 | + $this->pdf->textBox($x, $y + 6, $w, $h, $texto, $aFont, 'T', 'C', 0, '', false); |
|
| 1164 | 1164 | |
| 1165 | 1165 | |
| 1166 | 1166 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 1167 | 1167 | $texto = '0 - ENTRADA'; |
| 1168 | 1168 | $y1 = $y + 14; |
| 1169 | 1169 | $h = 8; |
| 1170 | - $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1170 | + $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1171 | 1171 | $texto = '1 - SAÍDA'; |
| 1172 | 1172 | $y1 = $y + 17; |
| 1173 | - $this->pdf->textBox($x+2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1173 | + $this->pdf->textBox($x + 2, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1174 | 1174 | //tipo de nF |
| 1175 | 1175 | $aFont = ['font'=>$this->fontePadrao, 'size'=>12, 'style'=>'B']; |
| 1176 | 1176 | $y1 = $y + 13; |
| 1177 | 1177 | $h = 7; |
| 1178 | 1178 | $texto = $this->ide->getElementsByTagName('tpNF')->item(0)->nodeValue; |
| 1179 | - $this->pdf->textBox($x+27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, ''); |
|
| 1179 | + $this->pdf->textBox($x + 27, $y1, 5, $h, $texto, $aFont, 'C', 'C', 1, ''); |
|
| 1180 | 1180 | //numero da NF |
| 1181 | 1181 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 1182 | 1182 | $y1 = $y + 20; |
@@ -1198,7 +1198,7 @@ discard block |
||
| 1198 | 1198 | //#################################################################################### |
| 1199 | 1199 | //coluna codigo de barras |
| 1200 | 1200 | $x += $w; |
| 1201 | - $w = ($maxW-$w1-$w2);//85; |
|
| 1201 | + $w = ($maxW - $w1 - $w2); //85; |
|
| 1202 | 1202 | $w3 = $w; |
| 1203 | 1203 | $h = 32; |
| 1204 | 1204 | $this->pdf->textBox($x, $y, $w, $h); |
@@ -1207,22 +1207,22 @@ discard block |
||
| 1207 | 1207 | $bW = 75; |
| 1208 | 1208 | $bH = 12; |
| 1209 | 1209 | //codigo de barras |
| 1210 | - $this->pdf->Code128($x+(($w-$bW)/2), $y+2, $chave_acesso, $bW, $bH); |
|
| 1210 | + $this->pdf->Code128($x + (($w - $bW) / 2), $y + 2, $chave_acesso, $bW, $bH); |
|
| 1211 | 1211 | //linhas divisorias |
| 1212 | - $this->pdf->line($x, $y+4+$bH, $x+$w, $y+4+$bH); |
|
| 1213 | - $this->pdf->line($x, $y+12+$bH, $x+$w, $y+12+$bH); |
|
| 1212 | + $this->pdf->line($x, $y + 4 + $bH, $x + $w, $y + 4 + $bH); |
|
| 1213 | + $this->pdf->line($x, $y + 12 + $bH, $x + $w, $y + 12 + $bH); |
|
| 1214 | 1214 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1215 | - $y1 = $y+4+$bH; |
|
| 1215 | + $y1 = $y + 4 + $bH; |
|
| 1216 | 1216 | $h = 7; |
| 1217 | 1217 | $texto = 'CHAVE DE ACESSO'; |
| 1218 | 1218 | $this->pdf->textBox($x, $y1, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1219 | 1219 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'B']; |
| 1220 | - $y1 = $y+8+$bH; |
|
| 1220 | + $y1 = $y + 8 + $bH; |
|
| 1221 | 1221 | $texto = $this->formatField($chave_acesso, $this->formatoChave); |
| 1222 | - $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1223 | - $y1 = $y+12+$bH; |
|
| 1222 | + $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1223 | + $y1 = $y + 12 + $bH; |
|
| 1224 | 1224 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 1225 | - $chaveContingencia=""; |
|
| 1225 | + $chaveContingencia = ""; |
|
| 1226 | 1226 | if ($this->pNotaDPEC()) { |
| 1227 | 1227 | $cabecalhoProtoAutorizacao = 'NÚMERO DE REGISTRO DPEC'; |
| 1228 | 1228 | } else { |
@@ -1233,16 +1233,16 @@ discard block |
||
| 1233 | 1233 | $chaveContingencia = $this->pGeraChaveAdicionalDeContingencia(); |
| 1234 | 1234 | $this->pdf->setFillColor(0, 0, 0); |
| 1235 | 1235 | //codigo de barras |
| 1236 | - $this->pdf->code128($x+11, $y1+1, $chaveContingencia, $bW*.9, $bH/2); |
|
| 1236 | + $this->pdf->code128($x + 11, $y1 + 1, $chaveContingencia, $bW * .9, $bH / 2); |
|
| 1237 | 1237 | } else { |
| 1238 | 1238 | $texto = 'Consulta de autenticidade no portal nacional da NF-e'; |
| 1239 | - $this->pdf->textBox($x+2, $y1, $w-2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1240 | - $y1 = $y+16+$bH; |
|
| 1239 | + $this->pdf->textBox($x + 2, $y1, $w - 2, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 1240 | + $y1 = $y + 16 + $bH; |
|
| 1241 | 1241 | $texto = 'www.nfe.fazenda.gov.br/portal ou no site da Sefaz Autorizadora'; |
| 1242 | 1242 | $this->pdf->textBox( |
| 1243 | - $x+2, |
|
| 1243 | + $x + 2, |
|
| 1244 | 1244 | $y1, |
| 1245 | - $w-2, |
|
| 1245 | + $w - 2, |
|
| 1246 | 1246 | $h, |
| 1247 | 1247 | $texto, |
| 1248 | 1248 | $aFont, |
@@ -1258,7 +1258,7 @@ discard block |
||
| 1258 | 1258 | //natureza da operação |
| 1259 | 1259 | $texto = 'NATUREZA DA OPERAÇÃO'; |
| 1260 | 1260 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1261 | - $w = $w1+$w2; |
|
| 1261 | + $w = $w1 + $w2; |
|
| 1262 | 1262 | $y = $oldY; |
| 1263 | 1263 | $oldY += $h; |
| 1264 | 1264 | $x = $oldX; |
@@ -1288,7 +1288,7 @@ discard block |
||
| 1288 | 1288 | $cStat = ''; |
| 1289 | 1289 | } else { |
| 1290 | 1290 | if (isset($this->nfeProc)) { |
| 1291 | - $texto = ! empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) ? |
|
| 1291 | + $texto = !empty($this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue) ? |
|
| 1292 | 1292 | $this->nfeProc->getElementsByTagName("nProt")->item(0)->nodeValue : ''; |
| 1293 | 1293 | $tsHora = $this->convertTime($this->nfeProc->getElementsByTagName("dhRecbto")->item(0)->nodeValue); |
| 1294 | 1294 | if ($texto != '') { |
@@ -1319,25 +1319,25 @@ discard block |
||
| 1319 | 1319 | $texto = 'INSCRIÇÃO ESTADUAL DO SUBST. TRIBUT.'; |
| 1320 | 1320 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1321 | 1321 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1322 | - $texto = ! empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
| 1322 | + $texto = !empty($this->emit->getElementsByTagName("IEST")->item(0)->nodeValue) |
|
| 1323 | 1323 | ? $this->emit->getElementsByTagName("IEST")->item(0)->nodeValue |
| 1324 | 1324 | : ''; |
| 1325 | 1325 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 1326 | 1326 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1327 | 1327 | //CNPJ |
| 1328 | 1328 | $x += $w; |
| 1329 | - $w = ($maxW-(2*$w)); |
|
| 1329 | + $w = ($maxW - (2 * $w)); |
|
| 1330 | 1330 | $texto = 'CNPJ / CPF'; |
| 1331 | 1331 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1332 | 1332 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1333 | 1333 | //Pegando valor do CPF/CNPJ |
| 1334 | - if (! empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1334 | + if (!empty($this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1335 | 1335 | $texto = $this->formatField( |
| 1336 | 1336 | $this->emit->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1337 | 1337 | "###.###.###/####-##" |
| 1338 | 1338 | ); |
| 1339 | 1339 | } else { |
| 1340 | - $texto = ! empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1340 | + $texto = !empty($this->emit->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1341 | 1341 | $this->formatField( |
| 1342 | 1342 | $this->emit->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1343 | 1343 | "###.###.###-##" |
@@ -1353,22 +1353,22 @@ discard block |
||
| 1353 | 1353 | $resp = $this->statusNFe(); |
| 1354 | 1354 | if (!$resp['status']) { |
| 1355 | 1355 | $x = 10; |
| 1356 | - $y = $this->hPrint-130; |
|
| 1356 | + $y = $this->hPrint - 130; |
|
| 1357 | 1357 | $h = 25; |
| 1358 | - $w = $maxW-(2*$x); |
|
| 1358 | + $w = $maxW - (2 * $x); |
|
| 1359 | 1359 | $this->pdf->setTextColor(90, 90, 90); |
| 1360 | 1360 | $texto = $resp['message']; |
| 1361 | 1361 | $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B']; |
| 1362 | 1362 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1363 | 1363 | $y += $h; |
| 1364 | 1364 | $h = 5; |
| 1365 | - $w = $maxW-(2*$x); |
|
| 1365 | + $w = $maxW - (2 * $x); |
|
| 1366 | 1366 | if (isset($this->infProt) && $resp['status']) { |
| 1367 | 1367 | $xMotivo = $this->infProt->getElementsByTagName("xMotivo")->item(0)->nodeValue; |
| 1368 | 1368 | } else { |
| 1369 | 1369 | $xMotivo = ''; |
| 1370 | 1370 | } |
| 1371 | - $texto = "SEM VALOR FISCAL\n".$xMotivo; |
|
| 1371 | + $texto = "SEM VALOR FISCAL\n" . $xMotivo; |
|
| 1372 | 1372 | $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B']; |
| 1373 | 1373 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1374 | 1374 | $this->pdf->setTextColor(0, 0, 0); |
@@ -1391,12 +1391,12 @@ discard block |
||
| 1391 | 1391 | if ($this->pNotaDPEC() || $this->tpEmis == 4) { |
| 1392 | 1392 | //DPEC |
| 1393 | 1393 | $x = 10; |
| 1394 | - $y = $this->hPrint-130; |
|
| 1394 | + $y = $this->hPrint - 130; |
|
| 1395 | 1395 | $h = 25; |
| 1396 | - $w = $maxW-(2*$x); |
|
| 1396 | + $w = $maxW - (2 * $x); |
|
| 1397 | 1397 | $this->pdf->SetTextColor(200, 200, 200); |
| 1398 | - $texto = "DANFE impresso em contingência -\n". |
|
| 1399 | - "DPEC regularmente recebido pela Receita\n". |
|
| 1398 | + $texto = "DANFE impresso em contingência -\n" . |
|
| 1399 | + "DPEC regularmente recebido pela Receita\n" . |
|
| 1400 | 1400 | "Federal do Brasil"; |
| 1401 | 1401 | $aFont = ['font'=>$this->fontePadrao, 'size'=>48, 'style'=>'B']; |
| 1402 | 1402 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
@@ -1515,7 +1515,7 @@ discard block |
||
| 1515 | 1515 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 1516 | 1516 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1517 | 1517 | //NOME / RAZÃO SOCIAL |
| 1518 | - $w = round($maxW*0.61, 0); |
|
| 1518 | + $w = round($maxW * 0.61, 0); |
|
| 1519 | 1519 | $w1 = $w; |
| 1520 | 1520 | $y += 3; |
| 1521 | 1521 | $texto = 'NOME / RAZÃO SOCIAL'; |
@@ -1530,19 +1530,19 @@ discard block |
||
| 1530 | 1530 | } |
| 1531 | 1531 | //CNPJ / CPF |
| 1532 | 1532 | $x += $w; |
| 1533 | - $w = round($maxW*0.23, 0); |
|
| 1533 | + $w = round($maxW * 0.23, 0); |
|
| 1534 | 1534 | $w2 = $w; |
| 1535 | 1535 | $texto = 'CNPJ / CPF'; |
| 1536 | 1536 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1537 | 1537 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1538 | 1538 | //Pegando valor do CPF/CNPJ |
| 1539 | - if (! empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1539 | + if (!empty($this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue)) { |
|
| 1540 | 1540 | $texto = $this->formatField( |
| 1541 | 1541 | $this->dest->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 1542 | 1542 | "###.###.###/####-##" |
| 1543 | 1543 | ); |
| 1544 | 1544 | } else { |
| 1545 | - $texto = ! empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1545 | + $texto = !empty($this->dest->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 1546 | 1546 | $this->formatField( |
| 1547 | 1547 | $this->dest->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 1548 | 1548 | "###.###.###-##" |
@@ -1552,15 +1552,15 @@ discard block |
||
| 1552 | 1552 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1553 | 1553 | //DATA DA EMISSÃO |
| 1554 | 1554 | $x += $w; |
| 1555 | - $w = $maxW-($w1+$w2); |
|
| 1555 | + $w = $maxW - ($w1 + $w2); |
|
| 1556 | 1556 | $wx = $w; |
| 1557 | 1557 | $texto = 'DATA DA EMISSÃO'; |
| 1558 | 1558 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1559 | 1559 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1560 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 1560 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 1561 | 1561 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 1562 | 1562 | if ($dEmi == '') { |
| 1563 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 1563 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 1564 | 1564 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 1565 | 1565 | $aDemi = explode('T', $dEmi); |
| 1566 | 1566 | $dEmi = $aDemi[0]; |
@@ -1573,7 +1573,7 @@ discard block |
||
| 1573 | 1573 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 1, ''); |
| 1574 | 1574 | } |
| 1575 | 1575 | //ENDEREÇO |
| 1576 | - $w = round($maxW*0.47, 0); |
|
| 1576 | + $w = round($maxW * 0.47, 0); |
|
| 1577 | 1577 | $w1 = $w; |
| 1578 | 1578 | $y += $h; |
| 1579 | 1579 | $x = $oldX; |
@@ -1588,7 +1588,7 @@ discard block |
||
| 1588 | 1588 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, '', true); |
| 1589 | 1589 | //BAIRRO / DISTRITO |
| 1590 | 1590 | $x += $w; |
| 1591 | - $w = round($maxW*0.21, 0); |
|
| 1591 | + $w = round($maxW * 0.21, 0); |
|
| 1592 | 1592 | $w2 = $w; |
| 1593 | 1593 | $texto = 'BAIRRO / DISTRITO'; |
| 1594 | 1594 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
@@ -1598,12 +1598,12 @@ discard block |
||
| 1598 | 1598 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1599 | 1599 | //CEP |
| 1600 | 1600 | $x += $w; |
| 1601 | - $w = $maxW-$w1-$w2-$wx; |
|
| 1601 | + $w = $maxW - $w1 - $w2 - $wx; |
|
| 1602 | 1602 | $w2 = $w; |
| 1603 | 1603 | $texto = 'CEP'; |
| 1604 | 1604 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1605 | 1605 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1606 | - $texto = ! empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1606 | + $texto = !empty($this->dest->getElementsByTagName("CEP")->item(0)->nodeValue) ? |
|
| 1607 | 1607 | $this->dest->getElementsByTagName("CEP")->item(0)->nodeValue : ''; |
| 1608 | 1608 | $texto = $this->formatField($texto, "#####-###"); |
| 1609 | 1609 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
@@ -1614,10 +1614,10 @@ discard block |
||
| 1614 | 1614 | $texto = 'DATA DA SAÍDA/ENTRADA'; |
| 1615 | 1615 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1616 | 1616 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1617 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) ? |
|
| 1617 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue) ? |
|
| 1618 | 1618 | $this->ide->getElementsByTagName("dSaiEnt")->item(0)->nodeValue : ''; |
| 1619 | 1619 | if ($dSaiEnt == '') { |
| 1620 | - $dSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
| 1620 | + $dSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
| 1621 | 1621 | $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue : ''; |
| 1622 | 1622 | $aDsaient = explode('T', $dSaiEnt); |
| 1623 | 1623 | $dSaiEnt = $aDsaient[0]; |
@@ -1634,7 +1634,7 @@ discard block |
||
| 1634 | 1634 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1635 | 1635 | $texto = $this->dest->getElementsByTagName("xMun")->item(0)->nodeValue; |
| 1636 | 1636 | if (strtoupper(trim($texto)) == "EXTERIOR" && $this->dest->getElementsByTagName("xPais")->length > 0) { |
| 1637 | - $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
| 1637 | + $texto .= " - " . $this->dest->getElementsByTagName("xPais")->item(0)->nodeValue; |
|
| 1638 | 1638 | } |
| 1639 | 1639 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 1640 | 1640 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -1649,18 +1649,18 @@ discard block |
||
| 1649 | 1649 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1650 | 1650 | //FONE / FAX |
| 1651 | 1651 | $x += $w; |
| 1652 | - $w = round(($maxW -$w1-$wx-8)/2, 0); |
|
| 1652 | + $w = round(($maxW - $w1 - $wx - 8) / 2, 0); |
|
| 1653 | 1653 | $w3 = $w; |
| 1654 | 1654 | $texto = 'FONE / FAX'; |
| 1655 | 1655 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1656 | 1656 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1657 | - $texto = ! empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1657 | + $texto = !empty($this->dest->getElementsByTagName("fone")->item(0)->nodeValue) ? |
|
| 1658 | 1658 | $this->dest->getElementsByTagName("fone")->item(0)->nodeValue : ''; |
| 1659 | 1659 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 1660 | 1660 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 1661 | 1661 | //INSCRIÇÃO ESTADUAL |
| 1662 | 1662 | $x += $w; |
| 1663 | - $w = $maxW -$w1-$wx-8-$w3; |
|
| 1663 | + $w = $maxW - $w1 - $wx - 8 - $w3; |
|
| 1664 | 1664 | $texto = 'INSCRIÇÃO ESTADUAL'; |
| 1665 | 1665 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1666 | 1666 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -1674,10 +1674,10 @@ discard block |
||
| 1674 | 1674 | $texto = 'HORA DA SAÍDA/ENTRADA'; |
| 1675 | 1675 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1676 | 1676 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 1677 | - $hSaiEnt = ! empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) ? |
|
| 1677 | + $hSaiEnt = !empty($this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue) ? |
|
| 1678 | 1678 | $this->ide->getElementsByTagName("hSaiEnt")->item(0)->nodeValue : ''; |
| 1679 | 1679 | if ($hSaiEnt == '') { |
| 1680 | - $dhSaiEnt = ! empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
| 1680 | + $dhSaiEnt = !empty($this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue) ? |
|
| 1681 | 1681 | $this->ide->getElementsByTagName("dhSaiEnt")->item(0)->nodeValue : ''; |
| 1682 | 1682 | $tsDhSaiEnt = $this->convertTime($dhSaiEnt); |
| 1683 | 1683 | if ($tsDhSaiEnt != '') { |
@@ -1756,7 +1756,7 @@ discard block |
||
| 1756 | 1756 | protected function faturaDANFE($x, $y) |
| 1757 | 1757 | { |
| 1758 | 1758 | $linha = 1; |
| 1759 | - $h = 8+3; |
|
| 1759 | + $h = 8 + 3; |
|
| 1760 | 1760 | $oldx = $x; |
| 1761 | 1761 | $textoFatura = $this->getTextoFatura(); |
| 1762 | 1762 | //verificar se existem duplicatas |
@@ -1777,27 +1777,27 @@ discard block |
||
| 1777 | 1777 | $dupcont = 0; |
| 1778 | 1778 | $nFat = $this->dup->length; |
| 1779 | 1779 | if ($textoFatura !== "" && $this->exibirTextoFatura) { |
| 1780 | - $myH=6; |
|
| 1780 | + $myH = 6; |
|
| 1781 | 1781 | $myW = $this->wPrint; |
| 1782 | 1782 | if ($this->orientacao == 'L') { |
| 1783 | 1783 | $myW -= $this->wCanhoto; |
| 1784 | 1784 | } |
| 1785 | 1785 | $aFont = ['font'=>$this->fontePadrao, 'size'=>8, 'style'=>'']; |
| 1786 | 1786 | $this->pdf->textBox($x, $y, $myW, $myH, $textoFatura, $aFont, 'C', 'L', 1, ''); |
| 1787 | - $y+=$myH+1; |
|
| 1787 | + $y += $myH + 1; |
|
| 1788 | 1788 | } |
| 1789 | 1789 | if ($this->orientacao == 'P') { |
| 1790 | - $w = round($this->wPrint/7.018, 0)-1; |
|
| 1790 | + $w = round($this->wPrint / 7.018, 0) - 1; |
|
| 1791 | 1791 | } else { |
| 1792 | 1792 | $w = 28; |
| 1793 | 1793 | } |
| 1794 | 1794 | $increm = 1; |
| 1795 | 1795 | foreach ($this->dup as $k => $d) { |
| 1796 | - $nDup = ! empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) ? |
|
| 1796 | + $nDup = !empty($this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue) ? |
|
| 1797 | 1797 | $this->dup->item($k)->getElementsByTagName('nDup')->item(0)->nodeValue : ''; |
| 1798 | - $dDup = ! empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) ? |
|
| 1798 | + $dDup = !empty($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) ? |
|
| 1799 | 1799 | $this->ymdTodmy($this->dup->item($k)->getElementsByTagName('dVenc')->item(0)->nodeValue) : ''; |
| 1800 | - $vDup = ! empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) ? |
|
| 1800 | + $vDup = !empty($this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue) ? |
|
| 1801 | 1801 | 'R$ ' . number_format( |
| 1802 | 1802 | $this->dup->item($k)->getElementsByTagName('vDup')->item(0)->nodeValue, |
| 1803 | 1803 | 2, |
@@ -1806,14 +1806,14 @@ discard block |
||
| 1806 | 1806 | ) : ''; |
| 1807 | 1807 | $h = 8; |
| 1808 | 1808 | $texto = ''; |
| 1809 | - if ($nDup!='0' && $nDup!='') { |
|
| 1809 | + if ($nDup != '0' && $nDup != '') { |
|
| 1810 | 1810 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1811 | 1811 | $this->pdf->textBox($x, $y, $w, $h, 'Num.', $aFont, 'T', 'L', 1, ''); |
| 1812 | 1812 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 1813 | 1813 | $this->pdf->textBox($x, $y, $w, $h, $nDup, $aFont, 'T', 'R', 0, ''); |
| 1814 | 1814 | } else { |
| 1815 | 1815 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1816 | - $this->pdf->textBox($x, $y, $w, $h, ($dupcont+1)."", $aFont, 'T', 'L', 1, ''); |
|
| 1816 | + $this->pdf->textBox($x, $y, $w, $h, ($dupcont + 1) . "", $aFont, 'T', 'L', 1, ''); |
|
| 1817 | 1817 | } |
| 1818 | 1818 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1819 | 1819 | $this->pdf->textBox($x, $y, $w, $h, 'Venc.', $aFont, 'C', 'L', 0, ''); |
@@ -1823,7 +1823,7 @@ discard block |
||
| 1823 | 1823 | $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, ''); |
| 1824 | 1824 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 1825 | 1825 | $this->pdf->textBox($x, $y, $w, $h, $vDup, $aFont, 'B', 'R', 0, ''); |
| 1826 | - $x += $w+$increm; |
|
| 1826 | + $x += $w + $increm; |
|
| 1827 | 1827 | $dupcont += 1; |
| 1828 | 1828 | if ($this->orientacao == 'P') { |
| 1829 | 1829 | $maxDupCont = 6; |
@@ -1845,10 +1845,10 @@ discard block |
||
| 1845 | 1845 | $y -= 9; |
| 1846 | 1846 | $linha--; |
| 1847 | 1847 | } |
| 1848 | - return ($y+$h); |
|
| 1848 | + return ($y + $h); |
|
| 1849 | 1849 | } else { |
| 1850 | 1850 | $linha = 0; |
| 1851 | - return ($y-2); |
|
| 1851 | + return ($y - 2); |
|
| 1852 | 1852 | } |
| 1853 | 1853 | } //fim da função faturaDANFE |
| 1854 | 1854 | |
@@ -1864,7 +1864,7 @@ discard block |
||
| 1864 | 1864 | protected function pagamentoDANFE($x, $y) |
| 1865 | 1865 | { |
| 1866 | 1866 | $linha = 1; |
| 1867 | - $h = 8+3; |
|
| 1867 | + $h = 8 + 3; |
|
| 1868 | 1868 | $oldx = $x; |
| 1869 | 1869 | //verificar se existem cobranças definidas |
| 1870 | 1870 | if (isset($this->detPag) && $this->detPag->length > 0) { |
@@ -1883,7 +1883,7 @@ discard block |
||
| 1883 | 1883 | $dups = ""; |
| 1884 | 1884 | $dupcont = 0; |
| 1885 | 1885 | if ($this->orientacao == 'P') { |
| 1886 | - $w = round($this->wPrint/7.018, 0)-1; |
|
| 1886 | + $w = round($this->wPrint / 7.018, 0) - 1; |
|
| 1887 | 1887 | } else { |
| 1888 | 1888 | $w = 28; |
| 1889 | 1889 | } |
@@ -1893,16 +1893,16 @@ discard block |
||
| 1893 | 1893 | $maxDupCont = 8; |
| 1894 | 1894 | } |
| 1895 | 1895 | $increm = 1; |
| 1896 | - $formaPagamento = ['01'=>'Dinheiro','02'=>'Cheque','03'=>'Cartão de Crédito', |
|
| 1897 | - '04'=>'Cartão de Débito','05'=>'Crédito Loja','10'=>'Vale Alimentação', |
|
| 1898 | - '11'=>'Vale Refeição','12'=>'Vale Presente','13'=>'Vale Combustível', |
|
| 1899 | - '14'=>'Duplicata Mercantil','15'=>'Boleto','90'=>'Sem pagamento','99'=>'Outros']; |
|
| 1900 | - $bandeira = ['01'=>'Visa','02'=>'Mastercard','03'=>'American','04'=>'Sorocred','05'=>'Diners', |
|
| 1901 | - '06'=>'Elo','07'=>'Hipercard','08'=>'Aura','09'=>'Cabal','99'=>'Outros']; |
|
| 1896 | + $formaPagamento = ['01'=>'Dinheiro', '02'=>'Cheque', '03'=>'Cartão de Crédito', |
|
| 1897 | + '04'=>'Cartão de Débito', '05'=>'Crédito Loja', '10'=>'Vale Alimentação', |
|
| 1898 | + '11'=>'Vale Refeição', '12'=>'Vale Presente', '13'=>'Vale Combustível', |
|
| 1899 | + '14'=>'Duplicata Mercantil', '15'=>'Boleto', '90'=>'Sem pagamento', '99'=>'Outros']; |
|
| 1900 | + $bandeira = ['01'=>'Visa', '02'=>'Mastercard', '03'=>'American', '04'=>'Sorocred', '05'=>'Diners', |
|
| 1901 | + '06'=>'Elo', '07'=>'Hipercard', '08'=>'Aura', '09'=>'Cabal', '99'=>'Outros']; |
|
| 1902 | 1902 | foreach ($this->detPag as $k => $d) { |
| 1903 | 1903 | $fPag = !empty($this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue) |
| 1904 | 1904 | ? $this->detPag->item($k)->getElementsByTagName('tPag')->item(0)->nodeValue : '0'; |
| 1905 | - $vPag = ! empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
| 1905 | + $vPag = !empty($this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue) |
|
| 1906 | 1906 | ? 'R$ ' . number_format( |
| 1907 | 1907 | $this->detPag->item($k)->getElementsByTagName('vPag')->item(0)->nodeValue, |
| 1908 | 1908 | 2, |
@@ -1913,7 +1913,7 @@ discard block |
||
| 1913 | 1913 | $texto = ''; |
| 1914 | 1914 | if (isset($formaPagamento[$fPag])) { |
| 1915 | 1915 | /*Exibir Item sem pagamento ou outros?*/ |
| 1916 | - if ($fPag=='90' || $fPag=='99') { |
|
| 1916 | + if ($fPag == '90' || $fPag == '99') { |
|
| 1917 | 1917 | continue; |
| 1918 | 1918 | } |
| 1919 | 1919 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
@@ -1922,16 +1922,16 @@ discard block |
||
| 1922 | 1922 | $this->pdf->textBox($x, $y, $w, $h, $formaPagamento[$fPag], $aFont, 'T', 'R', 0, ''); |
| 1923 | 1923 | } else { |
| 1924 | 1924 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 1925 | - $this->pdf->textBox($x, $y, $w, $h, "Forma ".$fPag." não encontrado", $aFont, 'T', 'L', 1, ''); |
|
| 1925 | + $this->pdf->textBox($x, $y, $w, $h, "Forma " . $fPag . " não encontrado", $aFont, 'T', 'L', 1, ''); |
|
| 1926 | 1926 | } |
| 1927 | 1927 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 1928 | 1928 | $this->pdf->textBox($x, $y, $w, $h, 'Valor', $aFont, 'B', 'L', 0, ''); |
| 1929 | 1929 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 1930 | 1930 | $this->pdf->textBox($x, $y, $w, $h, $vPag, $aFont, 'B', 'R', 0, ''); |
| 1931 | - $x += $w+$increm; |
|
| 1931 | + $x += $w + $increm; |
|
| 1932 | 1932 | $dupcont += 1; |
| 1933 | 1933 | |
| 1934 | - if ($dupcont>$maxDupCont) { |
|
| 1934 | + if ($dupcont > $maxDupCont) { |
|
| 1935 | 1935 | $y += 9; |
| 1936 | 1936 | $x = $oldx; |
| 1937 | 1937 | $dupcont = 0; |
@@ -1946,10 +1946,10 @@ discard block |
||
| 1946 | 1946 | $y -= 9; |
| 1947 | 1947 | $linha--; |
| 1948 | 1948 | } |
| 1949 | - return ($y+$h); |
|
| 1949 | + return ($y + $h); |
|
| 1950 | 1950 | } else { |
| 1951 | 1951 | $linha = 0; |
| 1952 | - return ($y-2); |
|
| 1952 | + return ($y - 2); |
|
| 1953 | 1953 | } |
| 1954 | 1954 | } //fim da função pagamentoDANFE |
| 1955 | 1955 | |
@@ -2061,7 +2061,7 @@ discard block |
||
| 2061 | 2061 | } |
| 2062 | 2062 | $x = $this->impostoDanfeHelper($x, $y, $w, $h, "V. TOTAL DA NOTA", "vNF"); |
| 2063 | 2063 | |
| 2064 | - return ($y+$h); |
|
| 2064 | + return ($y + $h); |
|
| 2065 | 2065 | } //fim impostoDANFE |
| 2066 | 2066 | |
| 2067 | 2067 | /** |
@@ -2089,13 +2089,13 @@ discard block |
||
| 2089 | 2089 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 2090 | 2090 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2091 | 2091 | //NOME / RAZÃO SOCIAL |
| 2092 | - $w1 = $maxW*0.29; |
|
| 2092 | + $w1 = $maxW * 0.29; |
|
| 2093 | 2093 | $y += 3; |
| 2094 | 2094 | $texto = 'NOME / RAZÃO SOCIAL'; |
| 2095 | 2095 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2096 | 2096 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2097 | 2097 | if (isset($this->transporta)) { |
| 2098 | - $texto = ! empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) ? |
|
| 2098 | + $texto = !empty($this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue) ? |
|
| 2099 | 2099 | $this->transporta->getElementsByTagName("xNome")->item(0)->nodeValue : ''; |
| 2100 | 2100 | } else { |
| 2101 | 2101 | $texto = ''; |
@@ -2104,11 +2104,11 @@ discard block |
||
| 2104 | 2104 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 2105 | 2105 | //FRETE POR CONTA |
| 2106 | 2106 | $x += $w1; |
| 2107 | - $w2 = $maxW*0.15; |
|
| 2107 | + $w2 = $maxW * 0.15; |
|
| 2108 | 2108 | $texto = 'FRETE'; |
| 2109 | 2109 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2110 | 2110 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2111 | - $tipoFrete = ! empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) ? |
|
| 2111 | + $tipoFrete = !empty($this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue) ? |
|
| 2112 | 2112 | $this->transp->getElementsByTagName("modFrete")->item(0)->nodeValue : '0'; |
| 2113 | 2113 | switch ($tipoFrete) { |
| 2114 | 2114 | case 0: |
@@ -2138,7 +2138,7 @@ discard block |
||
| 2138 | 2138 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2139 | 2139 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2140 | 2140 | if (isset($this->veicTransp)) { |
| 2141 | - $texto = ! empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) ? |
|
| 2141 | + $texto = !empty($this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue) ? |
|
| 2142 | 2142 | $this->veicTransp->getElementsByTagName("RNTC")->item(0)->nodeValue : ''; |
| 2143 | 2143 | } else { |
| 2144 | 2144 | $texto = ''; |
@@ -2151,10 +2151,10 @@ discard block |
||
| 2151 | 2151 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2152 | 2152 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2153 | 2153 | if (isset($this->veicTransp)) { |
| 2154 | - $texto = ! empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
| 2154 | + $texto = !empty($this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
| 2155 | 2155 | $this->veicTransp->getElementsByTagName("placa")->item(0)->nodeValue : ''; |
| 2156 | 2156 | } elseif (isset($this->reboque)) { |
| 2157 | - $texto = ! empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
| 2157 | + $texto = !empty($this->reboque->getElementsByTagName("placa")->item(0)->nodeValue) ? |
|
| 2158 | 2158 | $this->reboque->getElementsByTagName("placa")->item(0)->nodeValue : ''; |
| 2159 | 2159 | } else { |
| 2160 | 2160 | $texto = ''; |
@@ -2163,15 +2163,15 @@ discard block |
||
| 2163 | 2163 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2164 | 2164 | //UF |
| 2165 | 2165 | $x += $w2; |
| 2166 | - $w3 = round($maxW*0.04, 0); |
|
| 2166 | + $w3 = round($maxW * 0.04, 0); |
|
| 2167 | 2167 | $texto = 'UF'; |
| 2168 | 2168 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2169 | 2169 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2170 | 2170 | if (isset($this->veicTransp)) { |
| 2171 | - $texto = ! empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2171 | + $texto = !empty($this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2172 | 2172 | $this->veicTransp->getElementsByTagName("UF")->item(0)->nodeValue : ''; |
| 2173 | 2173 | } elseif (isset($this->reboque)) { |
| 2174 | - $texto = ! empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2174 | + $texto = !empty($this->reboque->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2175 | 2175 | $this->reboque->getElementsByTagName("UF")->item(0)->nodeValue : ''; |
| 2176 | 2176 | } else { |
| 2177 | 2177 | $texto = ''; |
@@ -2180,18 +2180,18 @@ discard block |
||
| 2180 | 2180 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2181 | 2181 | //CNPJ / CPF |
| 2182 | 2182 | $x += $w3; |
| 2183 | - $w = $maxW-($w1+3*$w2+$w3); |
|
| 2183 | + $w = $maxW - ($w1 + 3 * $w2 + $w3); |
|
| 2184 | 2184 | $texto = 'CNPJ / CPF'; |
| 2185 | 2185 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2186 | 2186 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2187 | 2187 | if (isset($this->transporta)) { |
| 2188 | - $texto = ! empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) ? |
|
| 2188 | + $texto = !empty($this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue) ? |
|
| 2189 | 2189 | $this->formatField( |
| 2190 | 2190 | $this->transporta->getElementsByTagName("CNPJ")->item(0)->nodeValue, |
| 2191 | 2191 | "##.###.###/####-##" |
| 2192 | 2192 | ) : ''; |
| 2193 | 2193 | if ($texto == '') { |
| 2194 | - $texto = ! empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 2194 | + $texto = !empty($this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue) ? |
|
| 2195 | 2195 | $this->formatField( |
| 2196 | 2196 | $this->transporta->getElementsByTagName("CPF")->item(0)->nodeValue, |
| 2197 | 2197 | "###.###.###-##" |
@@ -2207,12 +2207,12 @@ discard block |
||
| 2207 | 2207 | $y += $h; |
| 2208 | 2208 | $x = $oldX; |
| 2209 | 2209 | $h = 7; |
| 2210 | - $w1 = $maxW*0.44; |
|
| 2210 | + $w1 = $maxW * 0.44; |
|
| 2211 | 2211 | $texto = 'ENDEREÇO'; |
| 2212 | 2212 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2213 | 2213 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2214 | 2214 | if (isset($this->transporta)) { |
| 2215 | - $texto = ! empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) ? |
|
| 2215 | + $texto = !empty($this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue) ? |
|
| 2216 | 2216 | $this->transporta->getElementsByTagName("xEnder")->item(0)->nodeValue : ''; |
| 2217 | 2217 | } else { |
| 2218 | 2218 | $texto = ''; |
@@ -2221,12 +2221,12 @@ discard block |
||
| 2221 | 2221 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'B', 'L', 0, ''); |
| 2222 | 2222 | //MUNICÍPIO |
| 2223 | 2223 | $x += $w1; |
| 2224 | - $w2 = round($maxW*0.30, 0); |
|
| 2224 | + $w2 = round($maxW * 0.30, 0); |
|
| 2225 | 2225 | $texto = 'MUNICÍPIO'; |
| 2226 | 2226 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2227 | 2227 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2228 | 2228 | if (isset($this->transporta)) { |
| 2229 | - $texto = ! empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) ? |
|
| 2229 | + $texto = !empty($this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue) ? |
|
| 2230 | 2230 | $this->transporta->getElementsByTagName("xMun")->item(0)->nodeValue : ''; |
| 2231 | 2231 | } else { |
| 2232 | 2232 | $texto = ''; |
@@ -2235,12 +2235,12 @@ discard block |
||
| 2235 | 2235 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2236 | 2236 | //UF |
| 2237 | 2237 | $x += $w2; |
| 2238 | - $w3 = round($maxW*0.04, 0); |
|
| 2238 | + $w3 = round($maxW * 0.04, 0); |
|
| 2239 | 2239 | $texto = 'UF'; |
| 2240 | 2240 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2241 | 2241 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2242 | 2242 | if (isset($this->transporta)) { |
| 2243 | - $texto = ! empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2243 | + $texto = !empty($this->transporta->getElementsByTagName("UF")->item(0)->nodeValue) ? |
|
| 2244 | 2244 | $this->transporta->getElementsByTagName("UF")->item(0)->nodeValue : ''; |
| 2245 | 2245 | } else { |
| 2246 | 2246 | $texto = ''; |
@@ -2249,13 +2249,13 @@ discard block |
||
| 2249 | 2249 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2250 | 2250 | //INSCRIÇÃO ESTADUAL |
| 2251 | 2251 | $x += $w3; |
| 2252 | - $w = $maxW-($w1+$w2+$w3); |
|
| 2252 | + $w = $maxW - ($w1 + $w2 + $w3); |
|
| 2253 | 2253 | $texto = 'INSCRIÇÃO ESTADUAL'; |
| 2254 | 2254 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2255 | 2255 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2256 | 2256 | $texto = ''; |
| 2257 | 2257 | if (isset($this->transporta)) { |
| 2258 | - if (! empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
| 2258 | + if (!empty($this->transporta->getElementsByTagName("IE")->item(0)->nodeValue)) { |
|
| 2259 | 2259 | $texto = $this->transporta->getElementsByTagName("IE")->item(0)->nodeValue; |
| 2260 | 2260 | } |
| 2261 | 2261 | } |
@@ -2268,16 +2268,16 @@ discard block |
||
| 2268 | 2268 | $marca = ''; |
| 2269 | 2269 | $numero = ''; |
| 2270 | 2270 | $texto = ''; |
| 2271 | - $pesoBruto=0; |
|
| 2272 | - $pesoLiquido=0; |
|
| 2271 | + $pesoBruto = 0; |
|
| 2272 | + $pesoLiquido = 0; |
|
| 2273 | 2273 | foreach ($volumes as $volume) { |
| 2274 | - $quantidade += ! empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
| 2274 | + $quantidade += !empty($volume->getElementsByTagName("qVol")->item(0)->nodeValue) ? |
|
| 2275 | 2275 | $volume->getElementsByTagName("qVol")->item(0)->nodeValue : 0; |
| 2276 | - $pesoBruto += ! empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
| 2276 | + $pesoBruto += !empty($volume->getElementsByTagName("pesoB")->item(0)->nodeValue) ? |
|
| 2277 | 2277 | $volume->getElementsByTagName("pesoB")->item(0)->nodeValue : 0; |
| 2278 | - $pesoLiquido += ! empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
| 2278 | + $pesoLiquido += !empty($volume->getElementsByTagName("pesoL")->item(0)->nodeValue) ? |
|
| 2279 | 2279 | $volume->getElementsByTagName("pesoL")->item(0)->nodeValue : 0; |
| 2280 | - $texto = ! empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
| 2280 | + $texto = !empty($this->transp->getElementsByTagName("esp")->item(0)->nodeValue) ? |
|
| 2281 | 2281 | $this->transp->getElementsByTagName("esp")->item(0)->nodeValue : ''; |
| 2282 | 2282 | if ($texto != $especie && $especie != '') { |
| 2283 | 2283 | //tem várias especies |
@@ -2285,7 +2285,7 @@ discard block |
||
| 2285 | 2285 | } else { |
| 2286 | 2286 | $especie = $texto; |
| 2287 | 2287 | } |
| 2288 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2288 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2289 | 2289 | $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : ''; |
| 2290 | 2290 | if ($texto != $marca && $marca != '') { |
| 2291 | 2291 | //tem várias especies |
@@ -2293,7 +2293,7 @@ discard block |
||
| 2293 | 2293 | } else { |
| 2294 | 2294 | $marca = $texto; |
| 2295 | 2295 | } |
| 2296 | - $texto = ! empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) ? |
|
| 2296 | + $texto = !empty($this->transp->getElementsByTagName("nVol")->item(0)->nodeValue) ? |
|
| 2297 | 2297 | $this->transp->getElementsByTagName("nVol")->item(0)->nodeValue : ''; |
| 2298 | 2298 | if ($texto != $numero && $numero != '') { |
| 2299 | 2299 | //tem várias especies |
@@ -2308,7 +2308,7 @@ discard block |
||
| 2308 | 2308 | $y += $h; |
| 2309 | 2309 | $x = $oldX; |
| 2310 | 2310 | $h = 7; |
| 2311 | - $w1 = round($maxW*0.10, 0); |
|
| 2311 | + $w1 = round($maxW * 0.10, 0); |
|
| 2312 | 2312 | $texto = 'QUANTIDADE'; |
| 2313 | 2313 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2314 | 2314 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2319,7 +2319,7 @@ discard block |
||
| 2319 | 2319 | } |
| 2320 | 2320 | //ESPÉCIE |
| 2321 | 2321 | $x += $w1; |
| 2322 | - $w2 = round($maxW*0.17, 0); |
|
| 2322 | + $w2 = round($maxW * 0.17, 0); |
|
| 2323 | 2323 | $texto = 'ESPÉCIE'; |
| 2324 | 2324 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2325 | 2325 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2331,7 +2331,7 @@ discard block |
||
| 2331 | 2331 | $texto = 'MARCA'; |
| 2332 | 2332 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2333 | 2333 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2334 | - $texto = ! empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2334 | + $texto = !empty($this->transp->getElementsByTagName("marca")->item(0)->nodeValue) ? |
|
| 2335 | 2335 | $this->transp->getElementsByTagName("marca")->item(0)->nodeValue : ''; |
| 2336 | 2336 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 2337 | 2337 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
@@ -2345,7 +2345,7 @@ discard block |
||
| 2345 | 2345 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'B', 'C', 0, ''); |
| 2346 | 2346 | //PESO BRUTO |
| 2347 | 2347 | $x += $w2; |
| 2348 | - $w3 = round($maxW*0.20, 0); |
|
| 2348 | + $w3 = round($maxW * 0.20, 0); |
|
| 2349 | 2349 | $texto = 'PESO BRUTO'; |
| 2350 | 2350 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2351 | 2351 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2358,7 +2358,7 @@ discard block |
||
| 2358 | 2358 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 2359 | 2359 | //PESO LÍQUIDO |
| 2360 | 2360 | $x += $w3; |
| 2361 | - $w = $maxW -($w1+3*$w2+$w3); |
|
| 2361 | + $w = $maxW - ($w1 + 3 * $w2 + $w3); |
|
| 2362 | 2362 | $texto = 'PESO LÍQUIDO'; |
| 2363 | 2363 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2364 | 2364 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -2369,7 +2369,7 @@ discard block |
||
| 2369 | 2369 | } |
| 2370 | 2370 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 2371 | 2371 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 2372 | - return ($y+$h); |
|
| 2372 | + return ($y + $h); |
|
| 2373 | 2373 | } //fim transporteDANFE |
| 2374 | 2374 | |
| 2375 | 2375 | |
@@ -2381,7 +2381,7 @@ discard block |
||
| 2381 | 2381 | return ""; |
| 2382 | 2382 | } |
| 2383 | 2383 | $valor_original = $valor_original->nodeValue; |
| 2384 | - $valor = ! empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
| 2384 | + $valor = !empty($valor_original) ? number_format($valor_original, 2, ",", ".") : ''; |
|
| 2385 | 2385 | |
| 2386 | 2386 | if ($valor != "") { |
| 2387 | 2387 | return sprintf($formato, $valor); |
@@ -2428,18 +2428,18 @@ discard block |
||
| 2428 | 2428 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFDest", " vICMSUFDest=%s"); |
| 2429 | 2429 | $impostos .= $this->descricaoProdutoHelper($ICMSUFDest, "vICMSUFRemet", " vICMSUFRemet=%s"); |
| 2430 | 2430 | } |
| 2431 | - $infAdProd = ! empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
| 2431 | + $infAdProd = !empty($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue) |
|
| 2432 | 2432 | ? substr( |
| 2433 | 2433 | $this->anfaveaDANFE($itemProd->getElementsByTagName('infAdProd')->item(0)->nodeValue), |
| 2434 | 2434 | 0, |
| 2435 | 2435 | 500 |
| 2436 | 2436 | ) |
| 2437 | 2437 | : ''; |
| 2438 | - if (! empty($infAdProd)) { |
|
| 2438 | + if (!empty($infAdProd)) { |
|
| 2439 | 2439 | $infAdProd = trim($infAdProd); |
| 2440 | 2440 | $infAdProd .= ' '; |
| 2441 | 2441 | } |
| 2442 | - $loteTxt =''; |
|
| 2442 | + $loteTxt = ''; |
|
| 2443 | 2443 | $rastro = $prod->getElementsByTagName("med"); |
| 2444 | 2444 | if (!empty($prod->getElementsByTagName("rastro"))) { |
| 2445 | 2445 | $rastro = $prod->getElementsByTagName("rastro"); |
@@ -2453,14 +2453,14 @@ discard block |
||
| 2453 | 2453 | $i++; |
| 2454 | 2454 | } |
| 2455 | 2455 | if ($loteTxt != '') { |
| 2456 | - $loteTxt.= ' '; |
|
| 2456 | + $loteTxt .= ' '; |
|
| 2457 | 2457 | } |
| 2458 | 2458 | } |
| 2459 | 2459 | //NT2013.006 FCI |
| 2460 | - $nFCI = (! empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
| 2461 | - ' FCI:'.$itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
|
| 2462 | - $tmp_ad=$infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
|
| 2463 | - $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue . (strlen($tmp_ad)!=0?"\n ".$tmp_ad:''); |
|
| 2460 | + $nFCI = (!empty($itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue)) ? |
|
| 2461 | + ' FCI:' . $itemProd->getElementsByTagName('nFCI')->item(0)->nodeValue : ''; |
|
| 2462 | + $tmp_ad = $infAdProd . ($this->descProdInfoComplemento ? $loteTxt . $impostos . $nFCI : ''); |
|
| 2463 | + $texto = $prod->getElementsByTagName("xProd")->item(0)->nodeValue . (strlen($tmp_ad) != 0 ? "\n " . $tmp_ad : ''); |
|
| 2464 | 2464 | //decodifica os caracteres html no xml |
| 2465 | 2465 | $texto = html_entity_decode($texto); |
| 2466 | 2466 | if ($this->descProdQuebraLinha) { |
@@ -2510,104 +2510,104 @@ discard block |
||
| 2510 | 2510 | // cabecalho LOOP COM OS DADOS DOS PRODUTOS |
| 2511 | 2511 | //CÓDIGO PRODUTO |
| 2512 | 2512 | $texto = "CÓDIGO PRODUTO"; |
| 2513 | - $w1 = round($w*0.09, 0); |
|
| 2513 | + $w1 = round($w * 0.09, 0); |
|
| 2514 | 2514 | $h = 4; |
| 2515 | 2515 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2516 | 2516 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2517 | - $this->pdf->line($x+$w1, $y, $x+$w1, $y+$hmax); |
|
| 2517 | + $this->pdf->line($x + $w1, $y, $x + $w1, $y + $hmax); |
|
| 2518 | 2518 | //DESCRIÇÃO DO PRODUTO / SERVIÇO |
| 2519 | 2519 | $x += $w1; |
| 2520 | - $w2 = round($w*0.28, 0); |
|
| 2520 | + $w2 = round($w * 0.28, 0); |
|
| 2521 | 2521 | $texto = 'DESCRIÇÃO DO PRODUTO / SERVIÇO'; |
| 2522 | 2522 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2523 | 2523 | $this->pdf->textBox($x, $y, $w2, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2524 | - $this->pdf->line($x+$w2, $y, $x+$w2, $y+$hmax); |
|
| 2524 | + $this->pdf->line($x + $w2, $y, $x + $w2, $y + $hmax); |
|
| 2525 | 2525 | //NCM/SH |
| 2526 | 2526 | $x += $w2; |
| 2527 | - $w3 = round($w*0.06, 0); |
|
| 2527 | + $w3 = round($w * 0.06, 0); |
|
| 2528 | 2528 | $texto = 'NCM/SH'; |
| 2529 | 2529 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2530 | 2530 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2531 | - $this->pdf->line($x+$w3, $y, $x+$w3, $y+$hmax); |
|
| 2531 | + $this->pdf->line($x + $w3, $y, $x + $w3, $y + $hmax); |
|
| 2532 | 2532 | //O/CST ou O/CSOSN |
| 2533 | 2533 | $x += $w3; |
| 2534 | - $w4 = round($w*0.05, 0); |
|
| 2535 | - $texto = 'O/CSOSN';//Regime do Simples CRT = 1 ou CRT = 2 |
|
| 2534 | + $w4 = round($w * 0.05, 0); |
|
| 2535 | + $texto = 'O/CSOSN'; //Regime do Simples CRT = 1 ou CRT = 2 |
|
| 2536 | 2536 | if ($this->getTagValue($this->emit, 'CRT') == '3') { |
| 2537 | - $texto = 'O/CST';//Regime Normal |
|
| 2537 | + $texto = 'O/CST'; //Regime Normal |
|
| 2538 | 2538 | } |
| 2539 | 2539 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2540 | 2540 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2541 | - $this->pdf->line($x+$w4, $y, $x+$w4, $y+$hmax); |
|
| 2541 | + $this->pdf->line($x + $w4, $y, $x + $w4, $y + $hmax); |
|
| 2542 | 2542 | //CFOP |
| 2543 | 2543 | $x += $w4; |
| 2544 | - $w5 = round($w*0.04, 0); |
|
| 2544 | + $w5 = round($w * 0.04, 0); |
|
| 2545 | 2545 | $texto = 'CFOP'; |
| 2546 | 2546 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2547 | 2547 | $this->pdf->textBox($x, $y, $w5, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2548 | - $this->pdf->line($x+$w5, $y, $x+$w5, $y+$hmax); |
|
| 2548 | + $this->pdf->line($x + $w5, $y, $x + $w5, $y + $hmax); |
|
| 2549 | 2549 | //UN |
| 2550 | 2550 | $x += $w5; |
| 2551 | - $w6 = round($w*0.03, 0); |
|
| 2551 | + $w6 = round($w * 0.03, 0); |
|
| 2552 | 2552 | $texto = 'UN'; |
| 2553 | 2553 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2554 | 2554 | $this->pdf->textBox($x, $y, $w6, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2555 | - $this->pdf->line($x+$w6, $y, $x+$w6, $y+$hmax); |
|
| 2555 | + $this->pdf->line($x + $w6, $y, $x + $w6, $y + $hmax); |
|
| 2556 | 2556 | //QUANT |
| 2557 | 2557 | $x += $w6; |
| 2558 | - $w7 = round($w*0.07, 0); |
|
| 2558 | + $w7 = round($w * 0.07, 0); |
|
| 2559 | 2559 | $texto = 'QUANT'; |
| 2560 | 2560 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2561 | 2561 | $this->pdf->textBox($x, $y, $w7, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2562 | - $this->pdf->line($x+$w7, $y, $x+$w7, $y+$hmax); |
|
| 2562 | + $this->pdf->line($x + $w7, $y, $x + $w7, $y + $hmax); |
|
| 2563 | 2563 | //VALOR UNIT |
| 2564 | 2564 | $x += $w7; |
| 2565 | - $w8 = round($w*0.06, 0); |
|
| 2565 | + $w8 = round($w * 0.06, 0); |
|
| 2566 | 2566 | $texto = 'VALOR UNIT'; |
| 2567 | 2567 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2568 | 2568 | $this->pdf->textBox($x, $y, $w8, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2569 | - $this->pdf->line($x+$w8, $y, $x+$w8, $y+$hmax); |
|
| 2569 | + $this->pdf->line($x + $w8, $y, $x + $w8, $y + $hmax); |
|
| 2570 | 2570 | //VALOR TOTAL |
| 2571 | 2571 | $x += $w8; |
| 2572 | - $w9 = round($w*0.06, 0); |
|
| 2572 | + $w9 = round($w * 0.06, 0); |
|
| 2573 | 2573 | $texto = 'VALOR TOTAL'; |
| 2574 | 2574 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2575 | 2575 | $this->pdf->textBox($x, $y, $w9, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2576 | - $this->pdf->line($x+$w9, $y, $x+$w9, $y+$hmax); |
|
| 2576 | + $this->pdf->line($x + $w9, $y, $x + $w9, $y + $hmax); |
|
| 2577 | 2577 | //B.CÁLC ICMS |
| 2578 | 2578 | $x += $w9; |
| 2579 | - $w10 = round($w*0.06, 0); |
|
| 2579 | + $w10 = round($w * 0.06, 0); |
|
| 2580 | 2580 | $texto = 'B.CÁLC ICMS'; |
| 2581 | 2581 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2582 | 2582 | $this->pdf->textBox($x, $y, $w10, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2583 | - $this->pdf->line($x+$w10, $y, $x+$w10, $y+$hmax); |
|
| 2583 | + $this->pdf->line($x + $w10, $y, $x + $w10, $y + $hmax); |
|
| 2584 | 2584 | //VALOR ICMS |
| 2585 | 2585 | $x += $w10; |
| 2586 | - $w11 = round($w*0.06, 0); |
|
| 2586 | + $w11 = round($w * 0.06, 0); |
|
| 2587 | 2587 | $texto = 'VALOR ICMS'; |
| 2588 | 2588 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2589 | 2589 | $this->pdf->textBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2590 | - $this->pdf->line($x+$w11, $y, $x+$w11, $y+$hmax); |
|
| 2590 | + $this->pdf->line($x + $w11, $y, $x + $w11, $y + $hmax); |
|
| 2591 | 2591 | //VALOR IPI |
| 2592 | 2592 | $x += $w11; |
| 2593 | - $w12 = round($w*0.05, 0); |
|
| 2593 | + $w12 = round($w * 0.05, 0); |
|
| 2594 | 2594 | $texto = 'VALOR IPI'; |
| 2595 | 2595 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2596 | 2596 | $this->pdf->textBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2597 | - $this->pdf->line($x+$w12, $y, $x+$w12, $y+$hmax); |
|
| 2597 | + $this->pdf->line($x + $w12, $y, $x + $w12, $y + $hmax); |
|
| 2598 | 2598 | //ALÍQ. ICMS |
| 2599 | 2599 | $x += $w12; |
| 2600 | - $w13 = round($w*0.035, 0); |
|
| 2600 | + $w13 = round($w * 0.035, 0); |
|
| 2601 | 2601 | $texto = 'ALÍQ. ICMS'; |
| 2602 | 2602 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2603 | 2603 | $this->pdf->textBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2604 | - $this->pdf->line($x+$w13, $y, $x+$w13, $y+$hmax); |
|
| 2604 | + $this->pdf->line($x + $w13, $y, $x + $w13, $y + $hmax); |
|
| 2605 | 2605 | //ALÍQ. IPI |
| 2606 | 2606 | $x += $w13; |
| 2607 | - $w14 = $w-($w1+$w2+$w3+$w4+$w5+$w6+$w7+$w8+$w9+$w10+$w11+$w12+$w13); |
|
| 2607 | + $w14 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13); |
|
| 2608 | 2608 | $texto = 'ALÍQ. IPI'; |
| 2609 | 2609 | $this->pdf->textBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false); |
| 2610 | - $this->pdf->line($oldX, $y+$h+1, $oldX + $w, $y+$h+1); |
|
| 2610 | + $this->pdf->line($oldX, $y + $h + 1, $oldX + $w, $y + $h + 1); |
|
| 2611 | 2611 | $y += 5; |
| 2612 | 2612 | //################################################################################## |
| 2613 | 2613 | // LOOP COM OS DADOS DOS PRODUTOS |
@@ -2625,7 +2625,7 @@ discard block |
||
| 2625 | 2625 | $textoProduto = trim($this->descricaoProduto($thisItem)); |
| 2626 | 2626 | |
| 2627 | 2627 | $linhaDescr = $this->pdf->getNumLines($textoProduto, $w2, $aFont); |
| 2628 | - $h = round(($linhaDescr * $this->pdf->fontSize)+ ($linhaDescr * 0.5), 2); |
|
| 2628 | + $h = round(($linhaDescr * $this->pdf->fontSize) + ($linhaDescr * 0.5), 2); |
|
| 2629 | 2629 | $hUsado += $h; |
| 2630 | 2630 | |
| 2631 | 2631 | $diffH = $hmax - $hUsado; |
@@ -2638,11 +2638,11 @@ discard block |
||
| 2638 | 2638 | break; |
| 2639 | 2639 | } |
| 2640 | 2640 | } |
| 2641 | - $y_linha=$y+$h; |
|
| 2641 | + $y_linha = $y + $h; |
|
| 2642 | 2642 | // linha entre itens |
| 2643 | 2643 | $this->pdf->dashedHLine($oldX, $y_linha, $w, 0.1, 120); |
| 2644 | 2644 | //corrige o x |
| 2645 | - $x=$oldX; |
|
| 2645 | + $x = $oldX; |
|
| 2646 | 2646 | //codigo do produto |
| 2647 | 2647 | $texto = $prod->getElementsByTagName("cProd")->item(0)->nodeValue; |
| 2648 | 2648 | $this->pdf->textBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'C', 0, ''); |
@@ -2655,16 +2655,16 @@ discard block |
||
| 2655 | 2655 | } |
| 2656 | 2656 | $x += $w2; |
| 2657 | 2657 | //NCM |
| 2658 | - $texto = ! empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
| 2658 | + $texto = !empty($prod->getElementsByTagName("NCM")->item(0)->nodeValue) ? |
|
| 2659 | 2659 | $prod->getElementsByTagName("NCM")->item(0)->nodeValue : ''; |
| 2660 | 2660 | $this->pdf->textBox($x, $y, $w3, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2661 | 2661 | $x += $w3; |
| 2662 | 2662 | //CST |
| 2663 | 2663 | if (isset($ICMS)) { |
| 2664 | - $origem = $this->getTagValue($ICMS, "orig"); |
|
| 2665 | - $cst = $this->getTagValue($ICMS, "CST"); |
|
| 2666 | - $csosn = $this->getTagValue($ICMS, "CSOSN"); |
|
| 2667 | - $texto = $origem.$cst.$csosn; |
|
| 2664 | + $origem = $this->getTagValue($ICMS, "orig"); |
|
| 2665 | + $cst = $this->getTagValue($ICMS, "CST"); |
|
| 2666 | + $csosn = $this->getTagValue($ICMS, "CSOSN"); |
|
| 2667 | + $texto = $origem . $cst . $csosn; |
|
| 2668 | 2668 | $this->pdf->textBox($x, $y, $w4, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 2669 | 2669 | } |
| 2670 | 2670 | //CFOP |
@@ -2698,7 +2698,7 @@ discard block |
||
| 2698 | 2698 | //Valor da Base de calculo |
| 2699 | 2699 | $x += $w9; |
| 2700 | 2700 | if (isset($ICMS)) { |
| 2701 | - $texto = ! empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 2701 | + $texto = !empty($ICMS->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 2702 | 2702 | number_format( |
| 2703 | 2703 | $ICMS->getElementsByTagName("vBC")->item(0)->nodeValue, |
| 2704 | 2704 | 2, |
@@ -2710,7 +2710,7 @@ discard block |
||
| 2710 | 2710 | //Valor do ICMS |
| 2711 | 2711 | $x += $w10; |
| 2712 | 2712 | if (isset($ICMS)) { |
| 2713 | - $texto = ! empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ? |
|
| 2713 | + $texto = !empty($ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue) ? |
|
| 2714 | 2714 | number_format( |
| 2715 | 2715 | $ICMS->getElementsByTagName("vICMS")->item(0)->nodeValue, |
| 2716 | 2716 | 2, |
@@ -2722,8 +2722,8 @@ discard block |
||
| 2722 | 2722 | //Valor do IPI |
| 2723 | 2723 | $x += $w11; |
| 2724 | 2724 | if (isset($IPI)) { |
| 2725 | - $texto = ! empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) ? |
|
| 2726 | - number_format($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, 2, ",", ".") :''; |
|
| 2725 | + $texto = !empty($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue) ? |
|
| 2726 | + number_format($IPI->getElementsByTagName("vIPI")->item(0)->nodeValue, 2, ",", ".") : ''; |
|
| 2727 | 2727 | } else { |
| 2728 | 2728 | $texto = ''; |
| 2729 | 2729 | } |
@@ -2731,7 +2731,7 @@ discard block |
||
| 2731 | 2731 | // %ICMS |
| 2732 | 2732 | $x += $w12; |
| 2733 | 2733 | if (isset($ICMS)) { |
| 2734 | - $texto = ! empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ? |
|
| 2734 | + $texto = !empty($ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue) ? |
|
| 2735 | 2735 | number_format( |
| 2736 | 2736 | $ICMS->getElementsByTagName("pICMS")->item(0)->nodeValue, |
| 2737 | 2737 | 2, |
@@ -2743,7 +2743,7 @@ discard block |
||
| 2743 | 2743 | //%IPI |
| 2744 | 2744 | $x += $w13; |
| 2745 | 2745 | if (isset($IPI)) { |
| 2746 | - $texto = ! empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) ? |
|
| 2746 | + $texto = !empty($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue) ? |
|
| 2747 | 2747 | number_format($IPI->getElementsByTagName("pIPI")->item(0)->nodeValue, 2, ",", ".") : ''; |
| 2748 | 2748 | } else { |
| 2749 | 2749 | $texto = ''; |
@@ -2768,7 +2768,7 @@ discard block |
||
| 2768 | 2768 | $i++; |
| 2769 | 2769 | } |
| 2770 | 2770 | } |
| 2771 | - return $oldY+$hmax; |
|
| 2771 | + return $oldY + $hmax; |
|
| 2772 | 2772 | } |
| 2773 | 2773 | |
| 2774 | 2774 | |
@@ -2802,7 +2802,7 @@ discard block |
||
| 2802 | 2802 | |
| 2803 | 2803 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 2804 | 2804 | |
| 2805 | - $w1 = round($w*0.09, 0); |
|
| 2805 | + $w1 = round($w * 0.09, 0); |
|
| 2806 | 2806 | |
| 2807 | 2807 | // Tabela Renavam Combustivel |
| 2808 | 2808 | $renavamCombustivel = [ |
@@ -2897,54 +2897,54 @@ discard block |
||
| 2897 | 2897 | |
| 2898 | 2898 | $yVeic = $y + $h; |
| 2899 | 2899 | $texto = 'Chassi: ............: ' . $veiculoChassi; |
| 2900 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2900 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2901 | 2901 | $yVeic += $h; |
| 2902 | 2902 | $texto = 'Cor...................: ' . $veiculoCor; |
| 2903 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2903 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2904 | 2904 | $yVeic += $h; |
| 2905 | 2905 | $texto = 'Cilindrada........: ' . $veiculoCilindrada; |
| 2906 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2906 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2907 | 2907 | $yVeic += $h; |
| 2908 | 2908 | $texto = 'Cmkg...............: ' . $veiculoCmkg; |
| 2909 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2909 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2910 | 2910 | $yVeic += $h; |
| 2911 | 2911 | $texto = 'Tipo.................: ' . ($renavamTiposVeiculos[intval($veiculoTipo)] ?? $veiculoTipo); |
| 2912 | - $this->pdf->textBox($x, $yVeic, $w1+40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2912 | + $this->pdf->textBox($x, $yVeic, $w1 + 40, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2913 | 2913 | $yVeic = $y + $h; |
| 2914 | 2914 | $xVeic = $x + 65; |
| 2915 | 2915 | $texto = 'Nº Motor: .........: ' . $veiculoMotor; |
| 2916 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2916 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2917 | 2917 | $yVeic += $h; |
| 2918 | 2918 | $texto = 'Renavam...........: ' . $veiculoRenavam; |
| 2919 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2919 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2920 | 2920 | $yVeic += $h; |
| 2921 | 2921 | $texto = 'HP.....................: ' . $veiculoHp; |
| 2922 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2922 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2923 | 2923 | $yVeic += $h; |
| 2924 | 2924 | $texto = 'Placa.................: ' . $veiculoPlaca; |
| 2925 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2925 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2926 | 2926 | $yVeic += $h; |
| 2927 | 2927 | $texto = 'Tipo Pintura......: ' . ($renavamEspecie[intval($veiculoTipoPintura)] ?? $veiculoTipoPintura); |
| 2928 | - $this->pTextBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2928 | + $this->pTextBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2929 | 2929 | $yVeic = $y + $h; |
| 2930 | 2930 | $xVeic = $xVeic + 55; |
| 2931 | 2931 | $texto = 'Marca / Modelo.....: ' . $veiculoMarcaModelo; |
| 2932 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2932 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2933 | 2933 | $yVeic += $h; |
| 2934 | 2934 | $texto = 'Especie..................: ' . ($renavamEspecie[intval($veiculoEspecie)] ?? $veiculoEspecie); |
| 2935 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2935 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2936 | 2936 | $yVeic += $h; |
| 2937 | 2937 | $texto = 'Combustivel..........: ' . ($renavamCombustivel[intval($veiculoCombustivel)] ?? $veiculoCombustivel); |
| 2938 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2938 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2939 | 2939 | $yVeic += $h; |
| 2940 | 2940 | $texto = 'Serial.....................: ' . $veiculoSerial; |
| 2941 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2941 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2942 | 2942 | $yVeic += $h; |
| 2943 | - $texto = 'Ano Fab/Mod........: '. $veiculoFabricacao . '/' . $veiculoModelo; |
|
| 2944 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2943 | + $texto = 'Ano Fab/Mod........: ' . $veiculoFabricacao . '/' . $veiculoModelo; |
|
| 2944 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2945 | 2945 | $yVeic += $h; |
| 2946 | - $texto = 'Distancia Entre Eixos(mm)..: '. $veiculoDistancia; |
|
| 2947 | - $this->pdf->textBox($xVeic, $yVeic, $w1+50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2946 | + $texto = 'Distancia Entre Eixos(mm)..: ' . $veiculoDistancia; |
|
| 2947 | + $this->pdf->textBox($xVeic, $yVeic, $w1 + 50, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2948 | 2948 | } |
| 2949 | 2949 | |
| 2950 | 2950 | /** |
@@ -2968,12 +2968,12 @@ discard block |
||
| 2968 | 2968 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2969 | 2969 | //INSCRIÇÃO MUNICIPAL |
| 2970 | 2970 | $y += 3; |
| 2971 | - $w = round($this->wPrint*0.23, 0); |
|
| 2971 | + $w = round($this->wPrint * 0.23, 0); |
|
| 2972 | 2972 | $texto = 'INSCRIÇÃO MUNICIPAL'; |
| 2973 | 2973 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2974 | 2974 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2975 | 2975 | //inscrição municipal |
| 2976 | - $texto = ! empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
| 2976 | + $texto = !empty($this->emit->getElementsByTagName("IM")->item(0)->nodeValue) ? |
|
| 2977 | 2977 | $this->emit->getElementsByTagName("IM")->item(0)->nodeValue : ''; |
| 2978 | 2978 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 2979 | 2979 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'L', 0, ''); |
@@ -2983,7 +2983,7 @@ discard block |
||
| 2983 | 2983 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2984 | 2984 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2985 | 2985 | if (isset($this->ISSQNtot)) { |
| 2986 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
| 2986 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue) ? |
|
| 2987 | 2987 | $this->ISSQNtot->getElementsByTagName("vServ")->item(0)->nodeValue : ''; |
| 2988 | 2988 | $texto = number_format($texto, 2, ",", "."); |
| 2989 | 2989 | } else { |
@@ -2997,9 +2997,9 @@ discard block |
||
| 2997 | 2997 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 2998 | 2998 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 2999 | 2999 | if (isset($this->ISSQNtot)) { |
| 3000 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 3000 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue) ? |
|
| 3001 | 3001 | $this->ISSQNtot->getElementsByTagName("vBC")->item(0)->nodeValue : ''; |
| 3002 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3002 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3003 | 3003 | } else { |
| 3004 | 3004 | $texto = ''; |
| 3005 | 3005 | } |
@@ -3010,21 +3010,21 @@ discard block |
||
| 3010 | 3010 | if ($this->orientacao == 'P') { |
| 3011 | 3011 | $w = $this->wPrint - (3 * $w); |
| 3012 | 3012 | } else { |
| 3013 | - $w = $this->wPrint - (3 * $w)-$this->wCanhoto; |
|
| 3013 | + $w = $this->wPrint - (3 * $w) - $this->wCanhoto; |
|
| 3014 | 3014 | } |
| 3015 | 3015 | $texto = 'VALOR TOTAL DO ISSQN'; |
| 3016 | 3016 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 3017 | 3017 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
| 3018 | 3018 | if (isset($this->ISSQNtot)) { |
| 3019 | - $texto = ! empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
| 3019 | + $texto = !empty($this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue) ? |
|
| 3020 | 3020 | $this->ISSQNtot->getElementsByTagName("vISS")->item(0)->nodeValue : ''; |
| 3021 | - $texto = ! empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3021 | + $texto = !empty($texto) ? number_format($texto, 2, ",", ".") : ''; |
|
| 3022 | 3022 | } else { |
| 3023 | 3023 | $texto = ''; |
| 3024 | 3024 | } |
| 3025 | 3025 | $aFont = ['font'=>$this->fontePadrao, 'size'=>10, 'style'=>'B']; |
| 3026 | 3026 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'B', 'R', 0, ''); |
| 3027 | - return ($y+$h+1); |
|
| 3027 | + return ($y + $h + 1); |
|
| 3028 | 3028 | } |
| 3029 | 3029 | |
| 3030 | 3030 | /** |
@@ -3045,7 +3045,7 @@ discard block |
||
| 3045 | 3045 | if ($this->orientacao == 'P') { |
| 3046 | 3046 | $w = $this->wPrint; |
| 3047 | 3047 | } else { |
| 3048 | - $w = $this->wPrint-$this->wCanhoto; |
|
| 3048 | + $w = $this->wPrint - $this->wCanhoto; |
|
| 3049 | 3049 | } |
| 3050 | 3050 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'B']; |
| 3051 | 3051 | $this->pdf->textBox($x, $y, $w, 8, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -3061,15 +3061,15 @@ discard block |
||
| 3061 | 3061 | //$this->textoAdic com o texto completo do campo |
| 3062 | 3062 | $y += 1; |
| 3063 | 3063 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 3064 | - $this->pdf->textBox($x, $y+2, $w-2, $h-3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
|
| 3064 | + $this->pdf->textBox($x, $y + 2, $w - 2, $h - 3, $this->textoAdic, $aFont, 'T', 'L', 0, '', false); |
|
| 3065 | 3065 | //RESERVADO AO FISCO |
| 3066 | 3066 | $texto = "RESERVADO AO FISCO"; |
| 3067 | 3067 | $x += $w; |
| 3068 | 3068 | $y -= 1; |
| 3069 | 3069 | if ($this->orientacao == 'P') { |
| 3070 | - $w = $this->wPrint-$w; |
|
| 3070 | + $w = $this->wPrint - $w; |
|
| 3071 | 3071 | } else { |
| 3072 | - $w = $this->wPrint-$w-$this->wCanhoto; |
|
| 3072 | + $w = $this->wPrint - $w - $this->wCanhoto; |
|
| 3073 | 3073 | } |
| 3074 | 3074 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'B']; |
| 3075 | 3075 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 1, ''); |
@@ -3108,8 +3108,8 @@ discard block |
||
| 3108 | 3108 | } |
| 3109 | 3109 | $y += 2; |
| 3110 | 3110 | $aFont = ['font'=>$this->fontePadrao, 'size'=>7, 'style'=>'']; |
| 3111 | - $this->pdf->textBox($x, $y, $w-2, $h-3, $texto, $aFont, 'T', 'L', 0, '', false); |
|
| 3112 | - return $y+$h; |
|
| 3111 | + $this->pdf->textBox($x, $y, $w - 2, $h - 3, $texto, $aFont, 'T', 'L', 0, '', false); |
|
| 3112 | + return $y + $h; |
|
| 3113 | 3113 | } |
| 3114 | 3114 | |
| 3115 | 3115 | /** |
@@ -3127,13 +3127,13 @@ discard block |
||
| 3127 | 3127 | if ($this->orientacao == 'P') { |
| 3128 | 3128 | $w = $this->wPrint; |
| 3129 | 3129 | } else { |
| 3130 | - $w = $this->wPrint-$this->wCanhoto; |
|
| 3130 | + $w = $this->wPrint - $this->wCanhoto; |
|
| 3131 | 3131 | $x = $this->wCanhoto; |
| 3132 | 3132 | } |
| 3133 | 3133 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'I']; |
| 3134 | - $texto = "Impresso em ". date('d/m/Y') . " as " . date('H:i:s'); |
|
| 3134 | + $texto = "Impresso em " . date('d/m/Y') . " as " . date('H:i:s'); |
|
| 3135 | 3135 | $this->pdf->textBox($x, $y, $w, 0, $texto, $aFont, 'T', 'L', false); |
| 3136 | - $texto = $this->creditos . " Powered by NFePHP"; |
|
| 3136 | + $texto = $this->creditos . " Powered by NFePHP"; |
|
| 3137 | 3137 | $this->pdf->textBox($x, $y, $w, 0, $texto, $aFont, 'T', 'R', false, ''); |
| 3138 | 3138 | } |
| 3139 | 3139 | |
@@ -3186,9 +3186,9 @@ discard block |
||
| 3186 | 3186 | } else { |
| 3187 | 3187 | //linha separadora do canhoto - 238 |
| 3188 | 3188 | //posicao altura |
| 3189 | - $y = $this->wPrint-85; |
|
| 3189 | + $y = $this->wPrint - 85; |
|
| 3190 | 3190 | //altura |
| 3191 | - $w = $this->wPrint-85-24; |
|
| 3191 | + $w = $this->wPrint - 85 - 24; |
|
| 3192 | 3192 | } |
| 3193 | 3193 | $h = 10; |
| 3194 | 3194 | //desenha caixa |
@@ -3211,21 +3211,21 @@ discard block |
||
| 3211 | 3211 | $texto .= "AO LADO"; |
| 3212 | 3212 | } |
| 3213 | 3213 | $texto .= ". EMISSÃO: "; |
| 3214 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3214 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3215 | 3215 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 3216 | 3216 | if ($dEmi == '') { |
| 3217 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3217 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3218 | 3218 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 3219 | 3219 | $aDemi = explode('T', $dEmi); |
| 3220 | 3220 | $dEmi = $aDemi[0]; |
| 3221 | 3221 | } |
| 3222 | - $texto .= $this->ymdTodmy($dEmi) ." "; |
|
| 3222 | + $texto .= $this->ymdTodmy($dEmi) . " "; |
|
| 3223 | 3223 | $texto .= "VALOR TOTAL: R$ "; |
| 3224 | 3224 | $texto .= number_format($this->ICMSTot->getElementsByTagName("vNF")->item(0)->nodeValue, 2, ",", ".") . " "; |
| 3225 | 3225 | $texto .= "DESTINATÁRIO: "; |
| 3226 | 3226 | $texto .= $destinatario; |
| 3227 | 3227 | if ($this->orientacao == 'P') { |
| 3228 | - $this->pdf->textBox($x, $y, $w-1, $h, $texto, $aFont, 'C', 'L', 0, '', false); |
|
| 3228 | + $this->pdf->textBox($x, $y, $w - 1, $h, $texto, $aFont, 'C', 'L', 0, '', false); |
|
| 3229 | 3229 | $x1 = $x + $w; |
| 3230 | 3230 | $w1 = $this->wPrint - $w; |
| 3231 | 3231 | $texto = "NF-e"; |
@@ -3238,12 +3238,12 @@ discard block |
||
| 3238 | 3238 | //DATA DE RECEBIMENTO |
| 3239 | 3239 | $texto = "DATA DE RECEBIMENTO"; |
| 3240 | 3240 | $y += $h; |
| 3241 | - $w2 = round($this->wPrint*0.17, 0); //35; |
|
| 3241 | + $w2 = round($this->wPrint * 0.17, 0); //35; |
|
| 3242 | 3242 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 3243 | 3243 | $this->pdf->textBox($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3244 | 3244 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
| 3245 | 3245 | $x += $w2; |
| 3246 | - $w3 = $w-$w2; |
|
| 3246 | + $w3 = $w - $w2; |
|
| 3247 | 3247 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
| 3248 | 3248 | $this->pdf->textBox($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3249 | 3249 | $x = $oldX; |
@@ -3253,7 +3253,7 @@ discard block |
||
| 3253 | 3253 | return $y; |
| 3254 | 3254 | } else { |
| 3255 | 3255 | $x--; |
| 3256 | - $x = $this->pdf->textBox90($x, $y, $w-1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
|
| 3256 | + $x = $this->pdf->textBox90($x, $y, $w - 1, $h, $texto, $aFontSmall, 'C', 'L', 0, '', false); |
|
| 3257 | 3257 | //NUMERO DA NOTA FISCAL LOGO NFE |
| 3258 | 3258 | $w1 = 18; |
| 3259 | 3259 | $x1 = $oldX; |
@@ -3267,18 +3267,18 @@ discard block |
||
| 3267 | 3267 | $this->pdf->textBox($x1, $y, $w1, 18, $texto, $aFont, 'C', 'C', 1, ''); |
| 3268 | 3268 | //DATA DO RECEBIMENTO |
| 3269 | 3269 | $texto = "DATA DO RECEBIMENTO"; |
| 3270 | - $y = $this->wPrint-85; |
|
| 3270 | + $y = $this->wPrint - 85; |
|
| 3271 | 3271 | $x = 12; |
| 3272 | - $w2 = round($this->wPrint*0.17, 0); //35; |
|
| 3272 | + $w2 = round($this->wPrint * 0.17, 0); //35; |
|
| 3273 | 3273 | $aFont = ['font'=>$this->fontePadrao, 'size'=>6, 'style'=>'']; |
| 3274 | 3274 | $this->pdf->textBox90($x, $y, $w2, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3275 | 3275 | //IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR |
| 3276 | 3276 | $y -= $w2; |
| 3277 | - $w3 = $w-$w2; |
|
| 3277 | + $w3 = $w - $w2; |
|
| 3278 | 3278 | $texto = "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR"; |
| 3279 | 3279 | $aFont = ['font'=>$this->fontePadrao, 'size'=>5.7, 'style'=>'']; |
| 3280 | 3280 | $x = $this->pdf->textBox90($x, $y, $w3, 8, $texto, $aFont, 'T', 'L', 1, ''); |
| 3281 | - $this->pdf->DashedVLine(23, $oldY, 0.1, $this->wPrint-20, 67); |
|
| 3281 | + $this->pdf->DashedVLine(23, $oldY, 0.1, $this->wPrint - 20, 67); |
|
| 3282 | 3282 | return $x; |
| 3283 | 3283 | } |
| 3284 | 3284 | } |
@@ -3295,13 +3295,13 @@ discard block |
||
| 3295 | 3295 | { |
| 3296 | 3296 | $saida = ""; |
| 3297 | 3297 | if (isset($this->compra)) { |
| 3298 | - if (! empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
| 3298 | + if (!empty($this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue)) { |
|
| 3299 | 3299 | $saida .= " Nota de Empenho: " . $this->compra->getElementsByTagName("xNEmp")->item(0)->nodeValue; |
| 3300 | 3300 | } |
| 3301 | - if (! empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
| 3301 | + if (!empty($this->compra->getElementsByTagName("xPed")->item(0)->nodeValue)) { |
|
| 3302 | 3302 | $saida .= " Pedido: " . $this->compra->getElementsByTagName("xPed")->item(0)->nodeValue; |
| 3303 | 3303 | } |
| 3304 | - if (! empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
| 3304 | + if (!empty($this->compra->getElementsByTagName("xCont")->item(0)->nodeValue)) { |
|
| 3305 | 3305 | $saida .= " Contrato: " . $this->compra->getElementsByTagName("xCont")->item(0)->nodeValue; |
| 3306 | 3306 | } |
| 3307 | 3307 | } |
@@ -3327,21 +3327,21 @@ discard block |
||
| 3327 | 3327 | if ($vICMS > 0) { |
| 3328 | 3328 | $vICMS = 1; |
| 3329 | 3329 | } |
| 3330 | - $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue; |
|
| 3330 | + $icmss = $this->ICMSTot->getElementsByTagName("vBC")->item(0)->nodeValue; |
|
| 3331 | 3331 | if ($icmss > 0) { |
| 3332 | 3332 | $icmss = 1; |
| 3333 | 3333 | } |
| 3334 | - $dEmi = ! empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3334 | + $dEmi = !empty($this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue) ? |
|
| 3335 | 3335 | $this->ide->getElementsByTagName("dEmi")->item(0)->nodeValue : ''; |
| 3336 | 3336 | if ($dEmi == '') { |
| 3337 | - $dEmi = ! empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3337 | + $dEmi = !empty($this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue) ? |
|
| 3338 | 3338 | $this->ide->getElementsByTagName("dhEmi")->item(0)->nodeValue : ''; |
| 3339 | 3339 | $aDemi = explode('T', $dEmi); |
| 3340 | 3340 | $dEmi = $aDemi[0]; |
| 3341 | 3341 | } |
| 3342 | 3342 | $dd = $dEmi; |
| 3343 | 3343 | $rpos = strrpos($dd, '-'); |
| 3344 | - $dd = substr($dd, $rpos +1); |
|
| 3344 | + $dd = substr($dd, $rpos + 1); |
|
| 3345 | 3345 | $chave = sprintf($forma, $cUF, $this->tpEmis, $CNPJ, $vNF, $vICMS, $icmss, $dd); |
| 3346 | 3346 | $chave = $chave . $this->modulo11($chave); |
| 3347 | 3347 | return $chave; |
@@ -3362,7 +3362,7 @@ discard block |
||
| 3362 | 3362 | $formaNfRef = "\r\nNF Ref.: série:%d numero:%d emit:%s em %s modelo: %d"; |
| 3363 | 3363 | $formaECFRef = "\r\nECF Ref.: modelo: %s ECF:%d COO:%d"; |
| 3364 | 3364 | $formaNfpRef = "\r\nNFP Ref.: série:%d número:%d emit:%s em %s modelo: %d IE:%s"; |
| 3365 | - $saida=''; |
|
| 3365 | + $saida = ''; |
|
| 3366 | 3366 | $nfRefs = $this->ide->getElementsByTagName('NFref'); |
| 3367 | 3367 | if (0 === $nfRefs->length) { |
| 3368 | 3368 | return $saida; |
@@ -3378,7 +3378,7 @@ discard block |
||
| 3378 | 3378 | foreach ($refNFe as $chave_acessoRef) { |
| 3379 | 3379 | $chave_acesso = $chave_acessoRef->nodeValue; |
| 3380 | 3380 | $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave); |
| 3381 | - $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2); |
|
| 3381 | + $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2); |
|
| 3382 | 3382 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
| 3383 | 3383 | $serie = substr($chave_acesso, 22, 3); |
| 3384 | 3384 | $numero = substr($chave_acesso, 25, 9); |
@@ -3399,7 +3399,7 @@ discard block |
||
| 3399 | 3399 | foreach ($refCTe as $chave_acessoRef) { |
| 3400 | 3400 | $chave_acesso = $chave_acessoRef->nodeValue; |
| 3401 | 3401 | $chave_acessoF = $this->formatField($chave_acesso, $this->formatoChave); |
| 3402 | - $data = substr($chave_acesso, 4, 2)."/20".substr($chave_acesso, 2, 2); |
|
| 3402 | + $data = substr($chave_acesso, 4, 2) . "/20" . substr($chave_acesso, 2, 2); |
|
| 3403 | 3403 | $cnpj = $this->formatField(substr($chave_acesso, 6, 14), "##.###.###/####-##"); |
| 3404 | 3404 | $serie = substr($chave_acesso, 22, 3); |
| 3405 | 3405 | $numero = substr($chave_acesso, 25, 9); |
@@ -3415,10 +3415,9 @@ discard block |
||
| 3415 | 3415 | $refNFP = $nfRef->getElementsByTagName('refNFP'); |
| 3416 | 3416 | foreach ($refNFP as $umaRefNFe) { |
| 3417 | 3417 | $data = $umaRefNFe->getElementsByTagName('AAMM')->item(0)->nodeValue; |
| 3418 | - $cnpj = ! empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
| 3419 | - $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : |
|
| 3420 | - ''; |
|
| 3421 | - $cpf = ! empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
| 3418 | + $cnpj = !empty($umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue) ? |
|
| 3419 | + $umaRefNFe->getElementsByTagName('CNPJ')->item(0)->nodeValue : ''; |
|
| 3420 | + $cpf = !empty($umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue) ? |
|
| 3422 | 3421 | $umaRefNFe->getElementsByTagName('CPF')->item(0)->nodeValue : ''; |
| 3423 | 3422 | $mod = $umaRefNFe->getElementsByTagName('mod')->item(0)->nodeValue; |
| 3424 | 3423 | $serie = $umaRefNFe->getElementsByTagName('serie')->item(0)->nodeValue; |
@@ -3444,6 +3443,6 @@ discard block |
||
| 3444 | 3443 | imagedestroy($image); |
| 3445 | 3444 | $stringdata = ob_get_contents(); // read from buffer |
| 3446 | 3445 | ob_end_clean(); |
| 3447 | - return 'data://text/plain;base64,'.base64_encode($stringdata); |
|
| 3446 | + return 'data://text/plain;base64,' . base64_encode($stringdata); |
|
| 3448 | 3447 | } |
| 3449 | 3448 | } |
@@ -70,8 +70,8 @@ discard block |
||
| 70 | 70 | * @param string $sDestino Destino do PDF I-browser D-download S-string F-salva |
| 71 | 71 | * @param array $aEnd array com o endereço do emitente |
| 72 | 72 | * @param string $sDirPDF Caminho para o diretorio de armazenamento dos arquivos PDF |
| 73 | - * @param string $fonteDANFE Nome da fonte alternativa do DAnfe |
|
| 74 | - * @param number $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
| 73 | + * @param string $fontePDF Nome da fonte alternativa do DAnfe |
|
| 74 | + * @param integer $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
| 75 | 75 | */ |
| 76 | 76 | public function __construct( |
| 77 | 77 | $docXML = '', |
@@ -231,9 +231,9 @@ discard block |
||
| 231 | 231 | |
| 232 | 232 | /** |
| 233 | 233 | * Monta o cabeçalho |
| 234 | - * @param number $x |
|
| 235 | - * @param number $y |
|
| 236 | - * @param number $pag |
|
| 234 | + * @param integer $x |
|
| 235 | + * @param integer $y |
|
| 236 | + * @param integer $pag |
|
| 237 | 237 | * @return number |
| 238 | 238 | */ |
| 239 | 239 | private function header($x, $y, $pag) |
@@ -427,8 +427,8 @@ discard block |
||
| 427 | 427 | |
| 428 | 428 | /** |
| 429 | 429 | * Monta o corpo da pagina |
| 430 | - * @param number $x |
|
| 431 | - * @param number $y |
|
| 430 | + * @param integer $x |
|
| 431 | + * @param double $y |
|
| 432 | 432 | */ |
| 433 | 433 | private function body($x, $y) |
| 434 | 434 | { |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | |
| 480 | 480 | /** |
| 481 | 481 | * Monta o rodapé |
| 482 | - * @param number $x |
|
| 482 | + * @param integer $x |
|
| 483 | 483 | * @param number $y |
| 484 | 484 | */ |
| 485 | 485 | protected function footer($x, $y) |
@@ -539,6 +539,9 @@ discard block |
||
| 539 | 539 | return $this->pdf->Output($nome, $destino); |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | + /** |
|
| 543 | + * @param string $original |
|
| 544 | + */ |
|
| 542 | 545 | private function imagePNGtoJPG($original) |
| 543 | 546 | { |
| 544 | 547 | $image = imagecreatefrompng($original); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * @param string $sDestino Estabelece a direção do envio do documento PDF |
| 103 | 103 | * @param string $sDirPDF Caminho para o diretorio de armaz. dos PDF |
| 104 | 104 | * @param string $fonteDACTE Nome da fonte a ser utilizada |
| 105 | - * @param number $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
| 105 | + * @param integer $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
| 106 | 106 | * @param string $preVisualizar 0-Não 1-Sim |
| 107 | 107 | */ |
| 108 | 108 | public function __construct( |
@@ -498,8 +498,8 @@ discard block |
||
| 498 | 498 | * cabecalho |
| 499 | 499 | * Monta o cabelhalho da DACTE ( retrato e paisagem ) |
| 500 | 500 | * |
| 501 | - * @param number $x Posição horizontal inicial, canto esquerdo |
|
| 502 | - * @param number $y Posição vertical inicial, canto superior |
|
| 501 | + * @param integer $x Posição horizontal inicial, canto esquerdo |
|
| 502 | + * @param integer $y Posição vertical inicial, canto superior |
|
| 503 | 503 | * @param number $pag Número da Página |
| 504 | 504 | * @param number $totPag Total de páginas |
| 505 | 505 | * @return number Posição vertical final |
@@ -1108,8 +1108,7 @@ discard block |
||
| 1108 | 1108 | * rodapeDACTE |
| 1109 | 1109 | * Monta o rodape no final da DACTE ( retrato e paisagem ) |
| 1110 | 1110 | * |
| 1111 | - * @param number $xInic Posição horizontal canto esquerdo |
|
| 1112 | - * @param number $yFinal Posição vertical final para impressão |
|
| 1111 | + * @param integer $x |
|
| 1113 | 1112 | */ |
| 1114 | 1113 | protected function rodape($x, $y) |
| 1115 | 1114 | { |
@@ -1132,8 +1131,8 @@ discard block |
||
| 1132 | 1131 | * tomador |
| 1133 | 1132 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1134 | 1133 | * |
| 1135 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1136 | - * @param number $y Posição vertical canto superior |
|
| 1134 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1135 | + * @param integer $y Posição vertical canto superior |
|
| 1137 | 1136 | * @return number Posição vertical final |
| 1138 | 1137 | */ |
| 1139 | 1138 | protected function tomador($x = 0, $y = 0) |
@@ -1221,8 +1220,8 @@ discard block |
||
| 1221 | 1220 | * compValorServ |
| 1222 | 1221 | * Monta o campo com os componentes da prestação de serviços. |
| 1223 | 1222 | * |
| 1224 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1225 | - * @param number $y Posição vertical canto superior |
|
| 1223 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1224 | + * @param integer $y Posição vertical canto superior |
|
| 1226 | 1225 | * @return number Posição vertical final |
| 1227 | 1226 | */ |
| 1228 | 1227 | protected function compValorServ($x = 0, $y = 0) |
@@ -1321,8 +1320,8 @@ discard block |
||
| 1321 | 1320 | * impostos |
| 1322 | 1321 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1323 | 1322 | * |
| 1324 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1325 | - * @param number $y Posição vertical canto superior |
|
| 1323 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1324 | + * @param integer $y Posição vertical canto superior |
|
| 1326 | 1325 | * @return number Posição vertical final |
| 1327 | 1326 | */ |
| 1328 | 1327 | protected function impostos($x = 0, $y = 0) |
@@ -1483,8 +1482,8 @@ discard block |
||
| 1483 | 1482 | * infPrestacaoServico |
| 1484 | 1483 | * Monta o campo com das informações da prestação do serviço |
| 1485 | 1484 | * |
| 1486 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1487 | - * @param number $y Posição vertical canto superior |
|
| 1485 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1486 | + * @param integer $y Posição vertical canto superior |
|
| 1488 | 1487 | * @return number Posição vertical final |
| 1489 | 1488 | */ |
| 1490 | 1489 | protected function infPrestacaoServico($x = 0, $y = 0) |
@@ -1564,8 +1563,8 @@ discard block |
||
| 1564 | 1563 | * docCompl |
| 1565 | 1564 | * Monta o campo com os dados do remetente na DACTE. |
| 1566 | 1565 | * |
| 1567 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1568 | - * @param number $y Posição vertical canto superior |
|
| 1566 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1567 | + * @param integer $y Posição vertical canto superior |
|
| 1569 | 1568 | * @return number Posição vertical final |
| 1570 | 1569 | */ |
| 1571 | 1570 | protected function docCompl($x = 0, $y = 0) |
@@ -1627,8 +1626,8 @@ discard block |
||
| 1627 | 1626 | * observacoes |
| 1628 | 1627 | * Monta o campo com os dados do remetente na DACTE. |
| 1629 | 1628 | * |
| 1630 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1631 | - * @param number $y Posição vertical canto superior |
|
| 1629 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1630 | + * @param integer $y Posição vertical canto superior |
|
| 1632 | 1631 | * @return number Posição vertical final |
| 1633 | 1632 | */ |
| 1634 | 1633 | protected function observacoes($x = 0, $y = 0) |
@@ -1670,8 +1669,8 @@ discard block |
||
| 1670 | 1669 | * seguro |
| 1671 | 1670 | * Monta o campo com os dados de seguro do CT-e OS. |
| 1672 | 1671 | * |
| 1673 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1674 | - * @param number $y Posição vertical canto superior |
|
| 1672 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1673 | + * @param integer $y Posição vertical canto superior |
|
| 1675 | 1674 | * @return number Posição vertical final |
| 1676 | 1675 | */ |
| 1677 | 1676 | protected function seguro($x = 0, $y = 0) |
@@ -1730,8 +1729,8 @@ discard block |
||
| 1730 | 1729 | * modalRod |
| 1731 | 1730 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1732 | 1731 | * |
| 1733 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1734 | - * @param number $y Posição vertical canto superior |
|
| 1732 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1733 | + * @param integer $y Posição vertical canto superior |
|
| 1735 | 1734 | * @return number Posição vertical final |
| 1736 | 1735 | */ |
| 1737 | 1736 | protected function modalRod($x = 0, $y = 0) |
@@ -1819,8 +1818,8 @@ discard block |
||
| 1819 | 1818 | * modalAquaviario |
| 1820 | 1819 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1821 | 1820 | * |
| 1822 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1823 | - * @param number $y Posição vertical canto superior |
|
| 1821 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1822 | + * @param integer $y Posição vertical canto superior |
|
| 1824 | 1823 | * @return number Posição vertical final |
| 1825 | 1824 | */ |
| 1826 | 1825 | protected function modalAquaviario($x = 0, $y = 0) |
@@ -1989,8 +1988,8 @@ discard block |
||
| 1989 | 1988 | * modalFerr |
| 1990 | 1989 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1991 | 1990 | * |
| 1992 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1993 | - * @param number $y Posição vertical canto superior |
|
| 1991 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1992 | + * @param integer $y Posição vertical canto superior |
|
| 1994 | 1993 | * @return number Posição vertical final |
| 1995 | 1994 | */ |
| 1996 | 1995 | protected function modalFerr($x = 0, $y = 0) |
@@ -2267,8 +2266,8 @@ discard block |
||
| 2267 | 2266 | * canhoto |
| 2268 | 2267 | * Monta o campo com os dados do remetente na DACTE. |
| 2269 | 2268 | * |
| 2270 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2271 | - * @param number $y Posição vertical canto superior |
|
| 2269 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2270 | + * @param integer $y Posição vertical canto superior |
|
| 2272 | 2271 | * @return number Posição vertical final |
| 2273 | 2272 | */ |
| 2274 | 2273 | protected function canhoto($x = 0, $y = 0) |
@@ -2351,9 +2350,10 @@ discard block |
||
| 2351 | 2350 | * dadosAdic |
| 2352 | 2351 | * Coloca o grupo de dados adicionais da DACTE. |
| 2353 | 2352 | * |
| 2354 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2355 | - * @param number $y Posição vertical canto superior |
|
| 2356 | - * @param number $h altura do campo |
|
| 2353 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2354 | + * @param double $y Posição vertical canto superior |
|
| 2355 | + * @param integer $h altura do campo |
|
| 2356 | + * @param integer $pag |
|
| 2357 | 2357 | * @return number Posição vertical final |
| 2358 | 2358 | */ |
| 2359 | 2359 | protected function dadosAdic($x, $y, $pag, $h) |
@@ -2546,7 +2546,7 @@ discard block |
||
| 2546 | 2546 | * Fornece a imformação multiplicação de peso contida na CTe |
| 2547 | 2547 | * |
| 2548 | 2548 | * @param interger $U Informação de peso extraida da CTe |
| 2549 | - * @return interger |
|
| 2549 | + * @return integer |
|
| 2550 | 2550 | */ |
| 2551 | 2551 | protected function multiUniPeso($U = '') |
| 2552 | 2552 | { |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | $y += 19; |
| 383 | 383 | $x = $xInic; |
| 384 | 384 | $r = $this->seguro($x, $y); |
| 385 | - $y = $y-12; |
|
| 385 | + $y = $y - 12; |
|
| 386 | 386 | |
| 387 | 387 | |
| 388 | 388 | switch ($this->modal) { |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | 'font' => $this->fontePadrao, |
| 588 | 588 | 'size' => 7, |
| 589 | 589 | 'style' => ''); |
| 590 | - $fone = $this->getTagValue($this->enderEmit, "fone")!=""? $this->formatFone($this->enderEmit):''; |
|
| 590 | + $fone = $this->getTagValue($this->enderEmit, "fone") != "" ? $this->formatFone($this->enderEmit) : ''; |
|
| 591 | 591 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
| 592 | 592 | $nro = $this->getTagValue($this->enderEmit, "nro"); |
| 593 | 593 | $cpl = $this->getTagValue($this->enderEmit, "xCpl"); |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | $this->pdf->textBox($x, $y + 12, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 861 | 861 | |
| 862 | 862 | if ($this->qrCodMDFe !== null) { |
| 863 | - $this->qrCodeDacteOs($y-25); |
|
| 863 | + $this->qrCodeDacteOs($y - 25); |
|
| 864 | 864 | $w = 38; |
| 865 | 865 | $x += 79; |
| 866 | 866 | $this->pdf->textBox($x, $y - 34, $w + 0.5, $h + 41.5); |
@@ -985,7 +985,7 @@ discard block |
||
| 985 | 985 | $this->pdf->setTextColor(0, 0, 0); |
| 986 | 986 | } |
| 987 | 987 | //indicar sem valor |
| 988 | - if ($tpAmb != 1 && $this->preVisualizar=='0') { // caso não seja uma DA de produção |
|
| 988 | + if ($tpAmb != 1 && $this->preVisualizar == '0') { // caso não seja uma DA de produção |
|
| 989 | 989 | $x = 10; |
| 990 | 990 | if ($this->orientacao == 'P') { |
| 991 | 991 | $y = round($this->hPrint / 2, 0); |
@@ -1008,7 +1008,7 @@ discard block |
||
| 1008 | 1008 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
| 1009 | 1009 | $this->pdf->textBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1010 | 1010 | $this->pdf->setTextColor(0, 0, 0); |
| 1011 | - } elseif ($this->preVisualizar=='1') { // caso seja uma DA de Pré-Visualização |
|
| 1011 | + } elseif ($this->preVisualizar == '1') { // caso seja uma DA de Pré-Visualização |
|
| 1012 | 1012 | $h = 5; |
| 1013 | 1013 | $w = $maxW - (2 * 10); |
| 1014 | 1014 | $x = 55; |
@@ -1026,14 +1026,14 @@ discard block |
||
| 1026 | 1026 | 'size' => 41, |
| 1027 | 1027 | 'style' => 'B'); |
| 1028 | 1028 | $texto = "Sem Validade Jurídica"; |
| 1029 | - $this->pdf->textBox90($x+20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1029 | + $this->pdf->textBox90($x + 20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1030 | 1030 | $this->pdf->setTextColor(90, 90, 90); |
| 1031 | 1031 | $texto = "SEM VALOR FISCAL"; |
| 1032 | 1032 | $aFont = array( |
| 1033 | 1033 | 'font' => $this->fontePadrao, |
| 1034 | 1034 | 'size' => 48, |
| 1035 | 1035 | 'style' => 'B'); |
| 1036 | - $this->pdf->textBox90($x+40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1036 | + $this->pdf->textBox90($x + 40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1037 | 1037 | $this->pdf->setTextColor(0, 0, 0); // voltar a cor default |
| 1038 | 1038 | } else { |
| 1039 | 1039 | $x = 10; |
@@ -1119,13 +1119,13 @@ discard block |
||
| 1119 | 1119 | 'font' => $this->fontePadrao, |
| 1120 | 1120 | 'size' => 6, |
| 1121 | 1121 | 'style' => ''); |
| 1122 | - $this->pdf->textBox($x-1, $y+2, $w, 4, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1123 | - $texto = $this->nomeDesenvolvedor . ' - '. $this->siteDesenvolvedor; |
|
| 1122 | + $this->pdf->textBox($x - 1, $y + 2, $w, 4, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1123 | + $texto = $this->nomeDesenvolvedor . ' - ' . $this->siteDesenvolvedor; |
|
| 1124 | 1124 | $aFont = array( |
| 1125 | 1125 | 'font' => $this->fontePadrao, |
| 1126 | 1126 | 'size' => 6, |
| 1127 | 1127 | 'style' => ''); |
| 1128 | - $this->pdf->textBox($x-50, $y+2, $w, 4, $texto, $aFont, 'T', 'R', 0, $this->siteDesenvolvedor); |
|
| 1128 | + $this->pdf->textBox($x - 50, $y + 2, $w, 4, $texto, $aFont, 'T', 'R', 0, $this->siteDesenvolvedor); |
|
| 1129 | 1129 | } |
| 1130 | 1130 | |
| 1131 | 1131 | /** |
@@ -1212,7 +1212,7 @@ discard block |
||
| 1212 | 1212 | $texto = 'FONE'; |
| 1213 | 1213 | $aFont = $this->formatPadrao; |
| 1214 | 1214 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1215 | - $texto = $this->getTagValue($this->toma, "fone")!=""? $this->formatFone($this->toma):''; |
|
| 1215 | + $texto = $this->getTagValue($this->toma, "fone") != "" ? $this->formatFone($this->toma) : ''; |
|
| 1216 | 1216 | $aFont = $this->formatNegrito; |
| 1217 | 1217 | $this->pdf->textBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1218 | 1218 | } |
@@ -1352,7 +1352,7 @@ discard block |
||
| 1352 | 1352 | $aFont = $this->formatPadrao; |
| 1353 | 1353 | $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1354 | 1354 | |
| 1355 | - $wCol02=0.18; |
|
| 1355 | + $wCol02 = 0.18; |
|
| 1356 | 1356 | $x += $w * $wCol02; |
| 1357 | 1357 | $this->pdf->line($x, $y, $x, $y + 9.5); |
| 1358 | 1358 | $texto = 'ALÍQ ICMS'; |
@@ -1428,7 +1428,7 @@ discard block |
||
| 1428 | 1428 | $x += $w * $wCol02; |
| 1429 | 1429 | |
| 1430 | 1430 | $texto = !empty($this->ICMS->getElementsByTagName("pRedBC")->item(0)->nodeValue) ? |
| 1431 | - number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".").'%' :''; |
|
| 1431 | + number_format($this->getTagValue($this->ICMS, "pRedBC"), 2, ",", ".") . '%' : ''; |
|
| 1432 | 1432 | $aFont = $this->formatNegrito; |
| 1433 | 1433 | $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1434 | 1434 | |
@@ -1656,14 +1656,14 @@ discard block |
||
| 1656 | 1656 | $texto .= $xObs; |
| 1657 | 1657 | } |
| 1658 | 1658 | $textoObs = explode("Motorista:", $texto); |
| 1659 | - $textoObs[1] = isset($textoObs[1]) ? "Motorista: ".$textoObs[1]: ''; |
|
| 1659 | + $textoObs[1] = isset($textoObs[1]) ? "Motorista: " . $textoObs[1] : ''; |
|
| 1660 | 1660 | $texto .= $this->getTagValue($this->imp, "infAdFisco", "\r\n"); |
| 1661 | 1661 | $aFont = array( |
| 1662 | 1662 | 'font' => $this->fontePadrao, |
| 1663 | 1663 | 'size' => 7.5, |
| 1664 | 1664 | 'style' => ''); |
| 1665 | 1665 | $this->pdf->textBox($x, $y, $w, $h, $textoObs[0], $aFont, 'T', 'L', 0, '', false); |
| 1666 | - $this->pdf->textBox($x, $y+11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
| 1666 | + $this->pdf->textBox($x, $y + 11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
| 1667 | 1667 | } |
| 1668 | 1668 | |
| 1669 | 1669 | /** |
@@ -1701,7 +1701,7 @@ discard block |
||
| 1701 | 1701 | $aFont = $this->formatPadrao; |
| 1702 | 1702 | $this->pdf->textBox($x, $y, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1703 | 1703 | |
| 1704 | - $wCol02=0.33; |
|
| 1704 | + $wCol02 = 0.33; |
|
| 1705 | 1705 | $x += $w * $wCol02; |
| 1706 | 1706 | $this->pdf->line($x, $y, $x, $y + 9.5); |
| 1707 | 1707 | $texto = 'NÚMERO DA APÓLICE'; |
@@ -1761,7 +1761,7 @@ discard block |
||
| 1761 | 1761 | $aFont = $this->formatPadrao; |
| 1762 | 1762 | $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1763 | 1763 | |
| 1764 | - $wCol02=0.18; |
|
| 1764 | + $wCol02 = 0.18; |
|
| 1765 | 1765 | $x += $w * $wCol02; |
| 1766 | 1766 | $this->pdf->line($x, $y, $x, $y + 9.5); |
| 1767 | 1767 | $texto = 'PLACA DO VEÍCULO'; |
@@ -1803,8 +1803,7 @@ discard block |
||
| 1803 | 1803 | $x += $w * $wCol02; |
| 1804 | 1804 | |
| 1805 | 1805 | $texto = !empty($this->getTagValue($this->veic->item(0), "CPF")) ? |
| 1806 | - $this->getTagValue($this->veic->item(0), "CPF") : |
|
| 1807 | - (!empty($this->getTagValue($this->veic->item(0), "CNPJ")) ? |
|
| 1806 | + $this->getTagValue($this->veic->item(0), "CPF") : (!empty($this->getTagValue($this->veic->item(0), "CNPJ")) ? |
|
| 1808 | 1807 | $this->getTagValue($this->veic->item(0), "CNPJ") : ''); |
| 1809 | 1808 | $aFont = $this->formatNegrito; |
| 1810 | 1809 | $this->pdf->textBox($x, $y, $w * $wCol02, $h, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -2273,7 +2272,7 @@ discard block |
||
| 2273 | 2272 | */ |
| 2274 | 2273 | protected function canhoto($x = 0, $y = 0) |
| 2275 | 2274 | { |
| 2276 | - $this->pdf->dashedHLine($x, $y+2, $this->wPrint, 0.1, 80); |
|
| 2275 | + $this->pdf->dashedHLine($x, $y + 2, $this->wPrint, 0.1, 80); |
|
| 2277 | 2276 | $y = $y + 2; |
| 2278 | 2277 | $oldX = $x; |
| 2279 | 2278 | $oldY = $y; |
@@ -2312,7 +2311,7 @@ discard block |
||
| 2312 | 2311 | |
| 2313 | 2312 | $this->pdf->line($x, $y, $x, $y + 16.5); |
| 2314 | 2313 | |
| 2315 | - $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n". "\r\n"; |
|
| 2314 | + $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n" . "\r\n"; |
|
| 2316 | 2315 | $texto .= ' INÍCIO DA PRESTAÇÃO - DATA/HORA'; |
| 2317 | 2316 | $aFont = array( |
| 2318 | 2317 | 'font' => $this->fontePadrao, |
@@ -2322,14 +2321,14 @@ discard block |
||
| 2322 | 2321 | $x = $oldX; |
| 2323 | 2322 | $y = $y + 5; |
| 2324 | 2323 | |
| 2325 | - $this->pdf->line($x, $y+3, $w * 0.255, $y+3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
| 2324 | + $this->pdf->line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
| 2326 | 2325 | |
| 2327 | 2326 | $texto = 'RG'; |
| 2328 | 2327 | $aFont = array( |
| 2329 | 2328 | 'font' => $this->fontePadrao, |
| 2330 | 2329 | 'size' => 6, |
| 2331 | 2330 | 'style' => ''); |
| 2332 | - $this->pdf->textBox($x, $y+3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2331 | + $this->pdf->textBox($x, $y + 3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2333 | 2332 | $x += $w * 0.85; |
| 2334 | 2333 | |
| 2335 | 2334 | $this->pdf->line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | * @param string $sDestino Destino do PDF I-browser D-download S-string F-salva |
| 72 | 72 | * @param array $aEnd array com o endereço do emitente |
| 73 | 73 | * @param string $sDirPDF Caminho para o diretorio de armazenamento dos arquivos PDF |
| 74 | - * @param string $fonteDANFE Nome da fonte alternativa do DAnfe |
|
| 75 | - * @param number $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
| 74 | + * @param string $fontePDF Nome da fonte alternativa do DAnfe |
|
| 75 | + * @param integer $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
| 76 | 76 | */ |
| 77 | 77 | public function __construct( |
| 78 | 78 | $docXML = '', |
@@ -233,9 +233,9 @@ discard block |
||
| 233 | 233 | /** |
| 234 | 234 | * header |
| 235 | 235 | * |
| 236 | - * @param number $x |
|
| 237 | - * @param number $y |
|
| 238 | - * @param number $pag |
|
| 236 | + * @param integer $x |
|
| 237 | + * @param integer $y |
|
| 238 | + * @param integer $pag |
|
| 239 | 239 | * @return number |
| 240 | 240 | */ |
| 241 | 241 | private function header($x, $y, $pag) |
@@ -415,8 +415,8 @@ discard block |
||
| 415 | 415 | /** |
| 416 | 416 | * body |
| 417 | 417 | * |
| 418 | - * @param number $x |
|
| 419 | - * @param number $y |
|
| 418 | + * @param integer $x |
|
| 419 | + * @param double $y |
|
| 420 | 420 | */ |
| 421 | 421 | private function body($x, $y) |
| 422 | 422 | { |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | /** |
| 511 | 511 | * footer |
| 512 | 512 | * |
| 513 | - * @param number $x |
|
| 513 | + * @param integer $x |
|
| 514 | 514 | * @param number $y |
| 515 | 515 | */ |
| 516 | 516 | protected function footer($x, $y) |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | * @param string $sDestino Estabelece a direção do envio do documento PDF |
| 108 | 108 | * @param string $sDirPDF Caminho para o diretorio de armaz. dos PDF |
| 109 | 109 | * @param string $fonteDACTE Nome da fonte a ser utilizada |
| 110 | - * @param number $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
| 110 | + * @param integer $mododebug 0-Não 1-Sim e 2-nada (2 default) |
|
| 111 | 111 | * @param string $preVisualizar 0-Não 1-Sim |
| 112 | 112 | * @param string $nomeDesenvolvedor Nome do desenvolvedor |
| 113 | 113 | * @param string $siteDesenvolvedor Site do desenvolvedor |
@@ -542,8 +542,8 @@ discard block |
||
| 542 | 542 | * cabecalho |
| 543 | 543 | * Monta o cabelhalho da DACTE ( retrato e paisagem ) |
| 544 | 544 | * |
| 545 | - * @param number $x Posição horizontal inicial, canto esquerdo |
|
| 546 | - * @param number $y Posição vertical inicial, canto superior |
|
| 545 | + * @param integer $x Posição horizontal inicial, canto esquerdo |
|
| 546 | + * @param integer $y Posição vertical inicial, canto superior |
|
| 547 | 547 | * @param number $pag Número da Página |
| 548 | 548 | * @param number $totPag Total de páginas |
| 549 | 549 | * @return number Posição vertical final |
@@ -1195,8 +1195,7 @@ discard block |
||
| 1195 | 1195 | * rodapeDACTE |
| 1196 | 1196 | * Monta o rodape no final da DACTE ( retrato e paisagem ) |
| 1197 | 1197 | * |
| 1198 | - * @param number $xInic Posição horizontal canto esquerdo |
|
| 1199 | - * @param number $yFinal Posição vertical final para impressão |
|
| 1198 | + * @param integer $x |
|
| 1200 | 1199 | */ |
| 1201 | 1200 | protected function rodape($x, $y) |
| 1202 | 1201 | { |
@@ -1219,8 +1218,8 @@ discard block |
||
| 1219 | 1218 | * remetente |
| 1220 | 1219 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1221 | 1220 | * |
| 1222 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1223 | - * @param number $y Posição vertical canto superior |
|
| 1221 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1222 | + * @param integer $y Posição vertical canto superior |
|
| 1224 | 1223 | * @return number Posição vertical final |
| 1225 | 1224 | */ |
| 1226 | 1225 | protected function remetente($x = 0, $y = 0) |
@@ -1307,8 +1306,8 @@ discard block |
||
| 1307 | 1306 | * destinatario |
| 1308 | 1307 | * Monta o campo com os dados do destinatário na DACTE. |
| 1309 | 1308 | * |
| 1310 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1311 | - * @param number $y Posição vertical canto superior |
|
| 1309 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1310 | + * @param integer $y Posição vertical canto superior |
|
| 1312 | 1311 | * @return number Posição vertical final |
| 1313 | 1312 | */ |
| 1314 | 1313 | protected function destinatario($x = 0, $y = 0) |
@@ -1394,8 +1393,8 @@ discard block |
||
| 1394 | 1393 | * expedidor |
| 1395 | 1394 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1396 | 1395 | * |
| 1397 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1398 | - * @param number $y Posição vertical canto superior |
|
| 1396 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1397 | + * @param integer $y Posição vertical canto superior |
|
| 1399 | 1398 | * @return number Posição vertical final |
| 1400 | 1399 | */ |
| 1401 | 1400 | protected function expedidor($x = 0, $y = 0) |
@@ -1491,8 +1490,8 @@ discard block |
||
| 1491 | 1490 | * recebedor |
| 1492 | 1491 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1493 | 1492 | * |
| 1494 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1495 | - * @param number $y Posição vertical canto superior |
|
| 1493 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1494 | + * @param integer $y Posição vertical canto superior |
|
| 1496 | 1495 | * @return number Posição vertical final |
| 1497 | 1496 | */ |
| 1498 | 1497 | protected function recebedor($x = 0, $y = 0) |
@@ -1588,8 +1587,8 @@ discard block |
||
| 1588 | 1587 | * tomador |
| 1589 | 1588 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1590 | 1589 | * |
| 1591 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1592 | - * @param number $y Posição vertical canto superior |
|
| 1590 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1591 | + * @param integer $y Posição vertical canto superior |
|
| 1593 | 1592 | * @return number Posição vertical final |
| 1594 | 1593 | */ |
| 1595 | 1594 | protected function tomador($x = 0, $y = 0) |
@@ -1677,8 +1676,8 @@ discard block |
||
| 1677 | 1676 | * descricaoCarga |
| 1678 | 1677 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1679 | 1678 | * |
| 1680 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1681 | - * @param number $y Posição vertical canto superior |
|
| 1679 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1680 | + * @param integer $y Posição vertical canto superior |
|
| 1682 | 1681 | * @return number Posição vertical final |
| 1683 | 1682 | */ |
| 1684 | 1683 | protected function descricaoCarga($x = 0, $y = 0) |
@@ -1854,8 +1853,8 @@ discard block |
||
| 1854 | 1853 | * compValorServ |
| 1855 | 1854 | * Monta o campo com os componentes da prestação de serviços. |
| 1856 | 1855 | * |
| 1857 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1858 | - * @param number $y Posição vertical canto superior |
|
| 1856 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1857 | + * @param integer $y Posição vertical canto superior |
|
| 1859 | 1858 | * @return number Posição vertical final |
| 1860 | 1859 | */ |
| 1861 | 1860 | protected function compValorServ($x = 0, $y = 0) |
@@ -1953,8 +1952,8 @@ discard block |
||
| 1953 | 1952 | * impostos |
| 1954 | 1953 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 1955 | 1954 | * |
| 1956 | - * @param number $x Posição horizontal canto esquerdo |
|
| 1957 | - * @param number $y Posição vertical canto superior |
|
| 1955 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 1956 | + * @param integer $y Posição vertical canto superior |
|
| 1958 | 1957 | * @return number Posição vertical final |
| 1959 | 1958 | */ |
| 1960 | 1959 | protected function impostos($x = 0, $y = 0) |
@@ -2171,8 +2170,8 @@ discard block |
||
| 2171 | 2170 | * docOrig |
| 2172 | 2171 | * Monta o campo com os documentos originarios. |
| 2173 | 2172 | * |
| 2174 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2175 | - * @param number $y Posição vertical canto superior |
|
| 2173 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2174 | + * @param integer $y Posição vertical canto superior |
|
| 2176 | 2175 | * @return number Posição vertical final |
| 2177 | 2176 | */ |
| 2178 | 2177 | protected function docOrig($x = 0, $y = 0) |
@@ -2435,8 +2434,8 @@ discard block |
||
| 2435 | 2434 | * docOrigContinuacao |
| 2436 | 2435 | * Monta o campo com os documentos originarios. |
| 2437 | 2436 | * |
| 2438 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2439 | - * @param number $y Posição vertical canto superior |
|
| 2437 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2438 | + * @param integer $y Posição vertical canto superior |
|
| 2440 | 2439 | * @return number Posição vertical final |
| 2441 | 2440 | */ |
| 2442 | 2441 | protected function docOrigContinuacao($x = 0, $y = 0) |
@@ -2556,8 +2555,8 @@ discard block |
||
| 2556 | 2555 | * docCompl |
| 2557 | 2556 | * Monta o campo com os dados do remetente na DACTE. |
| 2558 | 2557 | * |
| 2559 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2560 | - * @param number $y Posição vertical canto superior |
|
| 2558 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2559 | + * @param integer $y Posição vertical canto superior |
|
| 2561 | 2560 | * @return number Posição vertical final |
| 2562 | 2561 | */ |
| 2563 | 2562 | protected function docCompl($x = 0, $y = 0) |
@@ -2625,8 +2624,8 @@ discard block |
||
| 2625 | 2624 | * observacao |
| 2626 | 2625 | * Monta o campo com os dados do remetente na DACTE. |
| 2627 | 2626 | * |
| 2628 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2629 | - * @param number $y Posição vertical canto superior |
|
| 2627 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2628 | + * @param integer $y Posição vertical canto superior |
|
| 2630 | 2629 | * @return number Posição vertical final |
| 2631 | 2630 | */ |
| 2632 | 2631 | protected function observacao($x = 0, $y = 0) |
@@ -2668,8 +2667,8 @@ discard block |
||
| 2668 | 2667 | * modalRod |
| 2669 | 2668 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 2670 | 2669 | * |
| 2671 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2672 | - * @param number $y Posição vertical canto superior |
|
| 2670 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2671 | + * @param integer $y Posição vertical canto superior |
|
| 2673 | 2672 | * @return number Posição vertical final |
| 2674 | 2673 | */ |
| 2675 | 2674 | protected function modalRod($x = 0, $y = 0) |
@@ -2709,8 +2708,8 @@ discard block |
||
| 2709 | 2708 | * modalAereo |
| 2710 | 2709 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 2711 | 2710 | * |
| 2712 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2713 | - * @param number $y Posição vertical canto superior |
|
| 2711 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2712 | + * @param integer $y Posição vertical canto superior |
|
| 2714 | 2713 | * @return number Posição vertical final |
| 2715 | 2714 | */ |
| 2716 | 2715 | protected function modalAereo($x = 0, $y = 0) |
@@ -2766,8 +2765,8 @@ discard block |
||
| 2766 | 2765 | * modalAquaviario |
| 2767 | 2766 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 2768 | 2767 | * |
| 2769 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2770 | - * @param number $y Posição vertical canto superior |
|
| 2768 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2769 | + * @param integer $y Posição vertical canto superior |
|
| 2771 | 2770 | * @return number Posição vertical final |
| 2772 | 2771 | */ |
| 2773 | 2772 | protected function modalAquaviario($x = 0, $y = 0) |
@@ -2936,8 +2935,8 @@ discard block |
||
| 2936 | 2935 | * modalFerr |
| 2937 | 2936 | * Monta o campo com os dados do remetente na DACTE. ( retrato e paisagem ) |
| 2938 | 2937 | * |
| 2939 | - * @param number $x Posição horizontal canto esquerdo |
|
| 2940 | - * @param number $y Posição vertical canto superior |
|
| 2938 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 2939 | + * @param integer $y Posição vertical canto superior |
|
| 2941 | 2940 | * @return number Posição vertical final |
| 2942 | 2941 | */ |
| 2943 | 2942 | protected function modalFerr($x = 0, $y = 0) |
@@ -3214,8 +3213,8 @@ discard block |
||
| 3214 | 3213 | * canhoto |
| 3215 | 3214 | * Monta o campo com os dados do remetente na DACTE. |
| 3216 | 3215 | * |
| 3217 | - * @param number $x Posição horizontal canto esquerdo |
|
| 3218 | - * @param number $y Posição vertical canto superior |
|
| 3216 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 3217 | + * @param integer $y Posição vertical canto superior |
|
| 3219 | 3218 | * @return number Posição vertical final |
| 3220 | 3219 | */ |
| 3221 | 3220 | protected function canhoto($x = 0, $y = 0) |
@@ -3288,9 +3287,10 @@ discard block |
||
| 3288 | 3287 | * dadosAdic |
| 3289 | 3288 | * Coloca o grupo de dados adicionais da DACTE. |
| 3290 | 3289 | * |
| 3291 | - * @param number $x Posição horizontal canto esquerdo |
|
| 3292 | - * @param number $y Posição vertical canto superior |
|
| 3293 | - * @param number $h altura do campo |
|
| 3290 | + * @param integer $x Posição horizontal canto esquerdo |
|
| 3291 | + * @param double $y Posição vertical canto superior |
|
| 3292 | + * @param integer $h altura do campo |
|
| 3293 | + * @param integer $pag |
|
| 3294 | 3294 | * @return number Posição vertical final |
| 3295 | 3295 | */ |
| 3296 | 3296 | protected function dadosAdic($x, $y, $pag, $h) |
@@ -3483,7 +3483,7 @@ discard block |
||
| 3483 | 3483 | * Fornece a imformação multiplicação de peso contida na CTe |
| 3484 | 3484 | * |
| 3485 | 3485 | * @param interger $U Informação de peso extraida da CTe |
| 3486 | - * @return interger |
|
| 3486 | + * @return integer |
|
| 3487 | 3487 | */ |
| 3488 | 3488 | protected function multiUniPeso($U = '') |
| 3489 | 3489 | { |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $this->toma4 = $this->dom->getElementsByTagName("toma4")->item(0); |
| 213 | 213 | $this->toma03 = $this->dom->getElementsByTagName("toma3")->item(0); |
| 214 | 214 | //Tag tomador é identificado por toma03 na versão 2.00 |
| 215 | - if ($this->infCte->getAttribute("versao")=="2.00") { |
|
| 215 | + if ($this->infCte->getAttribute("versao") == "2.00") { |
|
| 216 | 216 | $this->toma03 = $this->dom->getElementsByTagName("toma03")->item(0); |
| 217 | 217 | } |
| 218 | 218 | //modal aquaviário |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | } |
| 431 | 431 | $x = $xInic; |
| 432 | 432 | $r = $this->observacao($x, $y); |
| 433 | - $y = $y-6; |
|
| 433 | + $y = $y - 6; |
|
| 434 | 434 | switch ($this->modal) { |
| 435 | 435 | case '1': |
| 436 | 436 | $y += 25.9; |
@@ -632,7 +632,7 @@ discard block |
||
| 632 | 632 | 'font' => $this->fontePadrao, |
| 633 | 633 | 'size' => 7, |
| 634 | 634 | 'style' => ''); |
| 635 | - $fone = $this->getTagValue($this->enderEmit, "fone")!=""? $this->formatFone($this->enderEmit):''; |
|
| 635 | + $fone = $this->getTagValue($this->enderEmit, "fone") != "" ? $this->formatFone($this->enderEmit) : ''; |
|
| 636 | 636 | $lgr = $this->getTagValue($this->enderEmit, "xLgr"); |
| 637 | 637 | $nro = $this->getTagValue($this->enderEmit, "nro"); |
| 638 | 638 | $cpl = $this->getTagValue($this->enderEmit, "xCpl"); |
@@ -726,30 +726,30 @@ discard block |
||
| 726 | 726 | $this->pdf->line($x, $y1 + 8, $w + 3, $y1 + 8); |
| 727 | 727 | $toma = $this->getTagValue($this->ide, "indGlobalizado"); |
| 728 | 728 | //0-Remetente;1-Expedidor;2-Recebedor;3-Destinatário;4 - Outros |
| 729 | - if ($toma==1) { |
|
| 729 | + if ($toma == 1) { |
|
| 730 | 730 | $aFont = array( |
| 731 | 731 | 'font' => $this->fontePadrao, |
| 732 | 732 | 'size' => 11, |
| 733 | 733 | 'style' => ''); |
| 734 | - $this->pdf->textBox($x-14.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
| 734 | + $this->pdf->textBox($x - 14.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
| 735 | 735 | } else { |
| 736 | 736 | $aFont = array( |
| 737 | 737 | 'font' => $this->fontePadrao, |
| 738 | 738 | 'size' => 11, |
| 739 | 739 | 'style' => ''); |
| 740 | - $this->pdf->textBox($x+3.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
| 741 | - } |
|
| 742 | - $aFont = $this->formatNegrito; |
|
| 743 | - $this->pdf->line($x+3, $x+71, $x+3, $x+75); |
|
| 744 | - $this->pdf->line($x+8, $x+71, $x+8, $x+75); |
|
| 745 | - $this->pdf->line($x+3, $x+71, $x+8, $x+71); |
|
| 746 | - $this->pdf->line($x+3, $x+75, $x+8, $x+75); |
|
| 747 | - $this->pdf->textBox($x-6, $y2+1.4 + 3, $w * 0.5, $h1, 'SIM', $aFont, 'T', 'C', 0, '', false); |
|
| 748 | - $this->pdf->line($x+18, $x+71, $x+18, $x+75); |
|
| 749 | - $this->pdf->line($x+23, $x+71, $x+23, $x+75); |
|
| 750 | - $this->pdf->line($x+18, $x+71, $x+23, $x+71); |
|
| 751 | - $this->pdf->line($x+18, $x+75, $x+23, $x+75); |
|
| 752 | - $this->pdf->textBox($x+9.8, $y2+1.4 + 3, $w * 0.5, $h1, 'NÃO', $aFont, 'T', 'C', 0, '', false); |
|
| 740 | + $this->pdf->textBox($x + 3.5, $y2 + 3.5, $w * 0.5, $h1, 'X', $aFont, 'T', 'C', 0, '', false); |
|
| 741 | + } |
|
| 742 | + $aFont = $this->formatNegrito; |
|
| 743 | + $this->pdf->line($x + 3, $x + 71, $x + 3, $x + 75); |
|
| 744 | + $this->pdf->line($x + 8, $x + 71, $x + 8, $x + 75); |
|
| 745 | + $this->pdf->line($x + 3, $x + 71, $x + 8, $x + 71); |
|
| 746 | + $this->pdf->line($x + 3, $x + 75, $x + 8, $x + 75); |
|
| 747 | + $this->pdf->textBox($x - 6, $y2 + 1.4 + 3, $w * 0.5, $h1, 'SIM', $aFont, 'T', 'C', 0, '', false); |
|
| 748 | + $this->pdf->line($x + 18, $x + 71, $x + 18, $x + 75); |
|
| 749 | + $this->pdf->line($x + 23, $x + 71, $x + 23, $x + 75); |
|
| 750 | + $this->pdf->line($x + 18, $x + 71, $x + 23, $x + 71); |
|
| 751 | + $this->pdf->line($x + 18, $x + 75, $x + 23, $x + 75); |
|
| 752 | + $this->pdf->textBox($x + 9.8, $y2 + 1.4 + 3, $w * 0.5, $h1, 'NÃO', $aFont, 'T', 'C', 0, '', false); |
|
| 753 | 753 | //FORMA DE PAGAMENTO |
| 754 | 754 | $texto = 'INF.DO CT-E GLOBALIZADO'; |
| 755 | 755 | $wd = 36; |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | 'font' => $this->fontePadrao, |
| 758 | 758 | 'size' => 8, |
| 759 | 759 | 'style' => ''); |
| 760 | - $this->pdf->textBox($x + $wa, $y2-0.5, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 760 | + $this->pdf->textBox($x + $wa, $y2 - 0.5, $w * 0.5, $h1, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 761 | 761 | $forma = $this->getTagValue($this->ide, "forPag"); |
| 762 | 762 | //################################################################## |
| 763 | 763 | //coluna direita |
@@ -866,7 +866,7 @@ discard block |
||
| 866 | 866 | 'style' => ''); |
| 867 | 867 | $this->pdf->textBox($xa, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 868 | 868 | //$texto = '1/1'; |
| 869 | - $texto = $pag."/".$totPag; |
|
| 869 | + $texto = $pag . "/" . $totPag; |
|
| 870 | 870 | $aFont = $this->formatNegrito; |
| 871 | 871 | $this->pdf->textBox($xa, $y + 5, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 872 | 872 | $this->pdf->line($xa + $wa, $y, $xa + $wa, $y + $h + 1); |
@@ -889,7 +889,7 @@ discard block |
||
| 889 | 889 | $wa = 30; |
| 890 | 890 | $texto = 'INSC.SUF.DO DEST'; |
| 891 | 891 | $aFont = $this->formatPadrao; |
| 892 | - $this->pdf->textBox($xa-5, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 892 | + $this->pdf->textBox($xa - 5, $y + 1, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 893 | 893 | $texto = $this->getTagValue($this->dest, "ISUF"); |
| 894 | 894 | $aFont = array( |
| 895 | 895 | 'font' => $this->fontePadrao, |
@@ -973,7 +973,7 @@ discard block |
||
| 973 | 973 | $aFont = $this->formatNegrito; |
| 974 | 974 | $this->pdf->textBox($x, $y + 12, $wa, $h, $texto, $aFont, 'T', 'C', 0, ''); |
| 975 | 975 | if ($this->qrCodCTe !== null) { |
| 976 | - $this->qrCodeDacte($y-27); |
|
| 976 | + $this->qrCodeDacte($y - 27); |
|
| 977 | 977 | $w = 45; |
| 978 | 978 | $x += 92.5; |
| 979 | 979 | $this->pdf->textBox($x, $y - 34, $w + 0.5, $h + 41.5); |
@@ -1072,7 +1072,7 @@ discard block |
||
| 1072 | 1072 | $this->pdf->setTextColor(0, 0, 0); |
| 1073 | 1073 | } |
| 1074 | 1074 | //indicar sem valor |
| 1075 | - if ($tpAmb != 1 && $this->preVisualizar=='0') { // caso não seja uma DA de produção |
|
| 1075 | + if ($tpAmb != 1 && $this->preVisualizar == '0') { // caso não seja uma DA de produção |
|
| 1076 | 1076 | $x = 10; |
| 1077 | 1077 | if ($this->orientacao == 'P') { |
| 1078 | 1078 | $y = round($this->hPrint * 2 / 3, 0); |
@@ -1095,7 +1095,7 @@ discard block |
||
| 1095 | 1095 | $texto = "AMBIENTE DE HOMOLOGAÇÃO"; |
| 1096 | 1096 | $this->pdf->textBox($x, $y + 14, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
| 1097 | 1097 | $this->pdf->setTextColor(0, 0, 0); |
| 1098 | - } elseif ($this->preVisualizar=='1') { // caso seja uma DA de Pré-Visualização |
|
| 1098 | + } elseif ($this->preVisualizar == '1') { // caso seja uma DA de Pré-Visualização |
|
| 1099 | 1099 | $h = 5; |
| 1100 | 1100 | $w = $maxW - (2 * 10); |
| 1101 | 1101 | $x = 55; |
@@ -1113,14 +1113,14 @@ discard block |
||
| 1113 | 1113 | 'size' => 41, |
| 1114 | 1114 | 'style' => 'B'); |
| 1115 | 1115 | $texto = "Sem Validade Jurídica"; |
| 1116 | - $this->pTextBox90($x+20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1116 | + $this->pTextBox90($x + 20, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1117 | 1117 | $this->pdf->setTextColor(90, 90, 90); |
| 1118 | 1118 | $texto = "SEM VALOR FISCAL"; |
| 1119 | 1119 | $aFont = array( |
| 1120 | 1120 | 'font' => $this->fontePadrao, |
| 1121 | 1121 | 'size' => 48, |
| 1122 | 1122 | 'style' => 'B'); |
| 1123 | - $this->pTextBox90($x+40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1123 | + $this->pTextBox90($x + 40, $y, $w, $h, $texto, $aFont, 'C', 'C', 0, ''); |
|
| 1124 | 1124 | $this->pdf->setTextColor(0, 0, 0); // voltar a cor default |
| 1125 | 1125 | } else { |
| 1126 | 1126 | $x = 10; |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | 'size' => 6, |
| 1208 | 1208 | 'style' => ''); |
| 1209 | 1209 | $this->pdf->textBox($x, $y, $w, 4, $texto, $aFont, 'T', 'L', 0, ''); |
| 1210 | - $texto = 'Desenvolvido por '.$this->nomeDesenvolvedor . ' - '. $this->siteDesenvolvedor; |
|
| 1210 | + $texto = 'Desenvolvido por ' . $this->nomeDesenvolvedor . ' - ' . $this->siteDesenvolvedor; |
|
| 1211 | 1211 | $aFont = array( |
| 1212 | 1212 | 'font' => $this->fontePadrao, |
| 1213 | 1213 | 'size' => 6, |
@@ -1298,7 +1298,7 @@ discard block |
||
| 1298 | 1298 | $aFont = $this->formatPadrao; |
| 1299 | 1299 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1300 | 1300 | //$texto = $this->formatFone($this->rem); |
| 1301 | - $texto = $this->getTagValue($this->rem, "fone")!=""? $this->formatFone($this->rem):''; |
|
| 1301 | + $texto = $this->getTagValue($this->rem, "fone") != "" ? $this->formatFone($this->rem) : ''; |
|
| 1302 | 1302 | $aFont = $this->formatNegrito; |
| 1303 | 1303 | $this->pdf->textBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1304 | 1304 | } |
@@ -1385,7 +1385,7 @@ discard block |
||
| 1385 | 1385 | $aFont = $this->formatPadrao; |
| 1386 | 1386 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1387 | 1387 | //$texto = $this->formatFone($this->dest); |
| 1388 | - $texto = $this->getTagValue($this->dest, "fone")!=""? $this->formatFone($this->dest):''; |
|
| 1388 | + $texto = $this->getTagValue($this->dest, "fone") != "" ? $this->formatFone($this->dest) : ''; |
|
| 1389 | 1389 | $aFont = $this->formatNegrito; |
| 1390 | 1390 | $this->pdf->textBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1391 | 1391 | } |
@@ -1425,8 +1425,7 @@ discard block |
||
| 1425 | 1425 | $texto = $this->getTagValue($this->enderExped, "xLgr") . ', '; |
| 1426 | 1426 | $texto .= $this->getTagValue($this->enderExped, "nro"); |
| 1427 | 1427 | $texto .= $this->getTagValue($this->enderExped, "xCpl") != "" ? |
| 1428 | - ' - ' . $this->getTagValue($this->enderExped, "xCpl") : |
|
| 1429 | - ''; |
|
| 1428 | + ' - ' . $this->getTagValue($this->enderExped, "xCpl") : ''; |
|
| 1430 | 1429 | } else { |
| 1431 | 1430 | $texto = ''; |
| 1432 | 1431 | } |
@@ -1481,7 +1480,7 @@ discard block |
||
| 1481 | 1480 | $aFont = $this->formatPadrao; |
| 1482 | 1481 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1483 | 1482 | if (isset($this->exped)) { |
| 1484 | - $texto = $this->getTagValue($this->exped, "fone")!=""? $this->formatFone($this->exped):''; |
|
| 1483 | + $texto = $this->getTagValue($this->exped, "fone") != "" ? $this->formatFone($this->exped) : ''; |
|
| 1485 | 1484 | $aFont = $this->formatNegrito; |
| 1486 | 1485 | $this->pdf->textBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1487 | 1486 | } |
@@ -1522,8 +1521,7 @@ discard block |
||
| 1522 | 1521 | $texto = $this->getTagValue($this->enderReceb, "xLgr") . ', '; |
| 1523 | 1522 | $texto .= $this->getTagValue($this->enderReceb, "nro"); |
| 1524 | 1523 | $texto .= ($this->getTagValue($this->enderReceb, "xCpl") != "") ? |
| 1525 | - ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : |
|
| 1526 | - ''; |
|
| 1524 | + ' - ' . $this->getTagValue($this->enderReceb, "xCpl") : ''; |
|
| 1527 | 1525 | } else { |
| 1528 | 1526 | $texto = ''; |
| 1529 | 1527 | } |
@@ -1578,7 +1576,7 @@ discard block |
||
| 1578 | 1576 | $aFont = $this->formatPadrao; |
| 1579 | 1577 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1580 | 1578 | if (isset($this->receb)) { |
| 1581 | - $texto = $this->getTagValue($this->receb, "fone")!=""? $this->formatFone($this->receb):''; |
|
| 1579 | + $texto = $this->getTagValue($this->receb, "fone") != "" ? $this->formatFone($this->receb) : ''; |
|
| 1582 | 1580 | $aFont = $this->formatNegrito; |
| 1583 | 1581 | $this->pdf->textBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1584 | 1582 | } |
@@ -1668,7 +1666,7 @@ discard block |
||
| 1668 | 1666 | $texto = 'FONE'; |
| 1669 | 1667 | $aFont = $this->formatPadrao; |
| 1670 | 1668 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1671 | - $texto = $this->getTagValue($this->toma, "fone")!=""? $this->formatFone($this->toma):''; |
|
| 1669 | + $texto = $this->getTagValue($this->toma, "fone") != "" ? $this->formatFone($this->toma) : ''; |
|
| 1672 | 1670 | $aFont = $this->formatNegrito; |
| 1673 | 1671 | $this->pdf->textBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1674 | 1672 | } |
@@ -1735,46 +1733,46 @@ discard block |
||
| 1735 | 1733 | 'font' => $this->fontePadrao, |
| 1736 | 1734 | 'size' => 5, |
| 1737 | 1735 | 'style' => ''); |
| 1738 | - $this->pdf->textBox($x+8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1736 | + $this->pdf->textBox($x + 8, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1739 | 1737 | $texto = number_format($qCarga, 3, ",", "."); |
| 1740 | 1738 | $aFont = array( |
| 1741 | 1739 | 'font' => $this->fontePadrao, |
| 1742 | 1740 | 'size' => 7, |
| 1743 | 1741 | 'style' => 'B'); |
| 1744 | - $this->pdf->textBox($x+2, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1742 | + $this->pdf->textBox($x + 2, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1745 | 1743 | $x = $w * 0.12; |
| 1746 | - $this->pdf->line($x+13.5, $y, $x+13.5, $y + 9); |
|
| 1744 | + $this->pdf->line($x + 13.5, $y, $x + 13.5, $y + 9); |
|
| 1747 | 1745 | $texto = 'PESO BASE CÁLCULO (KG)'; |
| 1748 | 1746 | $aFont = array( |
| 1749 | 1747 | 'font' => $this->fontePadrao, |
| 1750 | 1748 | 'size' => 5, |
| 1751 | 1749 | 'style' => ''); |
| 1752 | - $this->pdf->textBox($x+20, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1750 | + $this->pdf->textBox($x + 20, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1753 | 1751 | $texto = number_format($qCarga, 3, ",", "."); |
| 1754 | 1752 | $aFont = array( |
| 1755 | 1753 | 'font' => $this->fontePadrao, |
| 1756 | 1754 | 'size' => 7, |
| 1757 | 1755 | 'style' => 'B'); |
| 1758 | - $this->pdf->textBox($x+17, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1756 | + $this->pdf->textBox($x + 17, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1759 | 1757 | $x = $w * 0.24; |
| 1760 | - $this->pdf->line($x+25, $y, $x+25, $y + 9); |
|
| 1758 | + $this->pdf->line($x + 25, $y, $x + 25, $y + 9); |
|
| 1761 | 1759 | $texto = 'PESO AFERIDO (KG)'; |
| 1762 | 1760 | $aFont = array( |
| 1763 | 1761 | 'font' => $this->fontePadrao, |
| 1764 | 1762 | 'size' => 5, |
| 1765 | 1763 | 'style' => ''); |
| 1766 | - $this->pdf->textBox($x+35, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1764 | + $this->pdf->textBox($x + 35, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1767 | 1765 | $texto = number_format($qCarga, 3, ",", "."); |
| 1768 | 1766 | $aFont = array( |
| 1769 | 1767 | 'font' => $this->fontePadrao, |
| 1770 | 1768 | 'size' => 7, |
| 1771 | 1769 | 'style' => 'B'); |
| 1772 | - $this->pdf->textBox($x+28, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1770 | + $this->pdf->textBox($x + 28, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1773 | 1771 | $x = $w * 0.36; |
| 1774 | - $this->pdf->line($x+41.3, $y, $x+41.3, $y + 9); |
|
| 1772 | + $this->pdf->line($x + 41.3, $y, $x + 41.3, $y + 9); |
|
| 1775 | 1773 | $texto = 'CUBAGEM(M3)'; |
| 1776 | 1774 | $aFont = $this->formatPadrao; |
| 1777 | - $this->pdf->textBox($x+60, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1775 | + $this->pdf->textBox($x + 60, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1778 | 1776 | $qCarga = 0; |
| 1779 | 1777 | foreach ($this->infQ as $infQ) { |
| 1780 | 1778 | if ($this->getTagValue($infQ, "cUnid") == '00') { |
@@ -1786,12 +1784,12 @@ discard block |
||
| 1786 | 1784 | 'font' => $this->fontePadrao, |
| 1787 | 1785 | 'size' => 7, |
| 1788 | 1786 | 'style' => 'B'); |
| 1789 | - $this->pdf->textBox($x+50, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1787 | + $this->pdf->textBox($x + 50, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1790 | 1788 | $x = $w * 0.45; |
| 1791 | 1789 | //$this->pdf->line($x+37, $y, $x+37, $y + 9); |
| 1792 | 1790 | $texto = 'QTDE(VOL)'; |
| 1793 | 1791 | $aFont = $this->formatPadrao; |
| 1794 | - $this->pdf->textBox($x+85, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1792 | + $this->pdf->textBox($x + 85, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1795 | 1793 | $qCarga = 0; |
| 1796 | 1794 | foreach ($this->infQ as $infQ) { |
| 1797 | 1795 | if ($this->getTagValue($infQ, "cUnid") == '03') { |
@@ -1803,9 +1801,9 @@ discard block |
||
| 1803 | 1801 | 'font' => $this->fontePadrao, |
| 1804 | 1802 | 'size' => 7, |
| 1805 | 1803 | 'style' => 'B'); |
| 1806 | - $this->pdf->textBox($x+85, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1804 | + $this->pdf->textBox($x + 85, $y + 3, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 1807 | 1805 | $x = $w * 0.53; |
| 1808 | - $this->pdf->line($x+56, $y, $x+56, $y + 9); |
|
| 1806 | + $this->pdf->line($x + 56, $y, $x + 56, $y + 9); |
|
| 1809 | 1807 | /*$texto = 'NOME DA SEGURADORA'; |
| 1810 | 1808 | $aFont = $this->formatPadrao; |
| 1811 | 1809 | $this->pdf->textBox($x, $y, $w, $h, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -1981,7 +1979,7 @@ discard block |
||
| 1981 | 1979 | $texto = 'BASE DE CALCULO'; |
| 1982 | 1980 | $aFont = $this->formatPadrao; |
| 1983 | 1981 | $this->pdf->textBox($x, $y, $w * 0.14, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 1984 | - $wCol02=0.15; |
|
| 1982 | + $wCol02 = 0.15; |
|
| 1985 | 1983 | $x += $w * $wCol02; |
| 1986 | 1984 | $this->pdf->line($x, $y, $x, $y + 9.5); |
| 1987 | 1985 | $texto = 'ALÍQ ICMS'; |
@@ -2283,7 +2281,7 @@ discard block |
||
| 2283 | 2281 | $this->arrayNFe[] = $chaveNFe; |
| 2284 | 2282 | } |
| 2285 | 2283 | $qtdeNFe = 1; |
| 2286 | - if (count($this->arrayNFe) >15) { |
|
| 2284 | + if (count($this->arrayNFe) > 15) { |
|
| 2287 | 2285 | $this->flagDocOrigContinuacao = 1; |
| 2288 | 2286 | $qtdeNFe = count($this->arrayNFe); |
| 2289 | 2287 | } |
@@ -2461,9 +2459,9 @@ discard block |
||
| 2461 | 2459 | //$h = 6 + 3; // de altura do texto (primeira linha |
| 2462 | 2460 | //$h = 9 + 3.5 ;// segunda linha |
| 2463 | 2461 | //$h = 9 + 3.5+ 3.5 ;// segunda linha |
| 2464 | - $h = (( ( count($this->arrayNFe)/2 ) - 9) * 3.5)+9; |
|
| 2465 | - if (count($this->arrayNFe)%2 !=0) { |
|
| 2466 | - $h = $h+3.5; |
|
| 2462 | + $h = (((count($this->arrayNFe) / 2) - 9) * 3.5) + 9; |
|
| 2463 | + if (count($this->arrayNFe) % 2 != 0) { |
|
| 2464 | + $h = $h + 3.5; |
|
| 2467 | 2465 | } // Caso tenha apenas 1 registro na ultima linha |
| 2468 | 2466 | $texto = 'DOCUMENTOS ORIGINÁRIOS - CONTINUACÃO'; |
| 2469 | 2467 | $aFont = $this->formatPadrao; |
@@ -2513,7 +2511,7 @@ discard block |
||
| 2513 | 2511 | $auxX = $oldX; |
| 2514 | 2512 | $yIniDados += 3; |
| 2515 | 2513 | while ($contador < (count($this->arrayNFe))) { |
| 2516 | - if ($contador%(116*($i-1)) == 0) { |
|
| 2514 | + if ($contador % (116 * ($i - 1)) == 0) { |
|
| 2517 | 2515 | // $contador++; |
| 2518 | 2516 | break; |
| 2519 | 2517 | } |
@@ -2654,14 +2652,14 @@ discard block |
||
| 2654 | 2652 | $texto .= $xObs; |
| 2655 | 2653 | } |
| 2656 | 2654 | $textoObs = explode("Motorista:", $texto); |
| 2657 | - $textoObs[1] = isset($textoObs[1]) ? "Motorista: ".$textoObs[1]: ''; |
|
| 2655 | + $textoObs[1] = isset($textoObs[1]) ? "Motorista: " . $textoObs[1] : ''; |
|
| 2658 | 2656 | $texto .= $this->getTagValue($this->imp, "infAdFisco", "\r\n"); |
| 2659 | 2657 | $aFont = array( |
| 2660 | 2658 | 'font' => $this->fontePadrao, |
| 2661 | 2659 | 'size' => 7.5, |
| 2662 | 2660 | 'style' => ''); |
| 2663 | 2661 | $this->pdf->textBox($x, $y, $w, $h, $textoObs[0], $aFont, 'T', 'L', 0, '', false); |
| 2664 | - $this->pdf->textBox($x, $y+11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
| 2662 | + $this->pdf->textBox($x, $y + 11.5, $w, $h, $textoObs[1], $aFont, 'T', 'L', 0, '', false); |
|
| 2665 | 2663 | } |
| 2666 | 2664 | |
| 2667 | 2665 | /** |
@@ -2699,10 +2697,10 @@ discard block |
||
| 2699 | 2697 | $aFont = $this->formatNegrito; |
| 2700 | 2698 | $this->pdf->textBox($x, $y + 3, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2701 | 2699 | $x += $w * 0.23; |
| 2702 | - $this->pdf->line($x-20, $y, $x-20, $y + 6); // LINHA A FRENTE DA RNTRC DA EMPRESA |
|
| 2700 | + $this->pdf->line($x - 20, $y, $x - 20, $y + 6); // LINHA A FRENTE DA RNTRC DA EMPRESA |
|
| 2703 | 2701 | $texto = 'ESTE CONHECIMENTO DE TRANSPORTE ATENDE À LEGISLAÇÃO DE TRANSPORTE RODOVIÁRIO EM VIGOR'; |
| 2704 | 2702 | $aFont = $this->formatPadrao; |
| 2705 | - $this->pdf->textBox($x-20, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 2703 | + $this->pdf->textBox($x - 20, $y + 3, $w * 0.50, $h, $texto, $aFont, 'T', 'C', 0, ''); |
|
| 2706 | 2704 | } |
| 2707 | 2705 | |
| 2708 | 2706 | /** |
@@ -2735,13 +2733,13 @@ discard block |
||
| 2735 | 2733 | $this->pdf->textBox($x, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
| 2736 | 2734 | $texto = 'CLASSE DA TARIFA'; |
| 2737 | 2735 | $aFont = $this->formatPadrao; |
| 2738 | - $this->pdf->textBox($x+50, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2736 | + $this->pdf->textBox($x + 50, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2739 | 2737 | $texto = 'CÓDIGO DA TARIFA'; |
| 2740 | 2738 | $aFont = $this->formatPadrao; |
| 2741 | - $this->pdf->textBox($x+80, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2739 | + $this->pdf->textBox($x + 80, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2742 | 2740 | $texto = 'VALOR DA TARIFA'; |
| 2743 | 2741 | $aFont = $this->formatPadrao; |
| 2744 | - $this->pdf->textBox($x+110, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2742 | + $this->pdf->textBox($x + 110, $y, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 2745 | 2743 | $texto = $this->getTagValue($this->aereo, "nOCA"); |
| 2746 | 2744 | $aFont = $this->formatNegrito; |
| 2747 | 2745 | $this->pdf->textBox($x, $y + 3, $w * 0.23, $h, $texto, $aFont, 'T', 'L', 0, ''); |
@@ -3252,7 +3250,7 @@ discard block |
||
| 3252 | 3250 | $this->pdf->textBox($x, $y, $w * 0.25, $h - 3.4, $texto, $aFont, 'B', 'C', 0, ''); |
| 3253 | 3251 | $x += $w * 0.25; |
| 3254 | 3252 | $this->pdf->line($x, $y, $x, $y + 16.5); |
| 3255 | - $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n". "\r\n"; |
|
| 3253 | + $texto = 'TÉRMINO DA PRESTAÇÃO - DATA/HORA' . "\r\n" . "\r\n" . "\r\n" . "\r\n"; |
|
| 3256 | 3254 | $texto .= ' INÍCIO DA PRESTAÇÃO - DATA/HORA'; |
| 3257 | 3255 | $aFont = array( |
| 3258 | 3256 | 'font' => $this->fontePadrao, |
@@ -3261,13 +3259,13 @@ discard block |
||
| 3261 | 3259 | $this->pdf->textBox($x + 10, $y, $w * 0.25, $h - 3.4, $texto, $aFont, 'T', 'C', 0, ''); |
| 3262 | 3260 | $x = $oldX; |
| 3263 | 3261 | $y = $y + 5; |
| 3264 | - $this->pdf->line($x, $y+3, $w * 0.255, $y+3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
| 3262 | + $this->pdf->line($x, $y + 3, $w * 0.255, $y + 3); // LINHA HORIZONTAL ACIMA DO RG ABAIXO DO NOME |
|
| 3265 | 3263 | $texto = 'RG'; |
| 3266 | 3264 | $aFont = array( |
| 3267 | 3265 | 'font' => $this->fontePadrao, |
| 3268 | 3266 | 'size' => 6, |
| 3269 | 3267 | 'style' => ''); |
| 3270 | - $this->pdf->textBox($x, $y+3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3268 | + $this->pdf->textBox($x, $y + 3, $w * 0.33, $h, $texto, $aFont, 'T', 'L', 0, ''); |
|
| 3271 | 3269 | $x += $w * 0.85; |
| 3272 | 3270 | $this->pdf->line($x, $y + 11.5, $x, $y - 5); // LINHA VERTICAL PROXIMO AO CT-E |
| 3273 | 3271 | $texto = "CT-E"; |