Skip to content

Commit

Permalink
fix: stampa ddt e preventivi
Browse files Browse the repository at this point in the history
  • Loading branch information
Pek5892 committed Nov 5, 2024
1 parent 0a11357 commit de832e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
9 changes: 4 additions & 5 deletions src/Util/Autofill.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ public function __construct(protected $column_number, protected $char_number = 7
public function setRows($rows, $additional = null, $first_page = null)
{
$this->max_rows = $rows;

$this->max_additional = $additional ?: $this->max_rows;
$this->max_additional = isset($additional) ? $additional: $this->max_rows;
$this->max_rows_first_page = $first_page ?? $this->max_rows_first_page;
}

Expand Down Expand Up @@ -88,12 +87,12 @@ public function getAdditionalNumber()
if ($page > 1) {
$rows = $this->space - $this->max_rows_first_page * ($page - 1);
} else {
$rows = floor($this->space);
$rows = ceil($this->space);
}

$number = $this->max_additional - $rows;
$number = $this->max_rows - $rows;

return $number > 0 ? $number : 0;
return $number;
}

public function generate()
Expand Down
7 changes: 2 additions & 5 deletions templates/ddt/body.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@

// Creazione righe fantasma
$autofill = new Util\Autofill($options['pricing'] ? 6 : 3);
$rows_per_page = $rows_per_page ?: 18;
if (!empty($options['last-page-footer'])) {
$rows_per_page += 10;
}
$autofill->setRows($rows_per_page);
$rows_per_page = $options['pricing'] ? 21 : 20;
$autofill->setRows($rows_per_page, 0, $options['pricing'] ? 21 : 20);

// Intestazione tabella per righe
echo "
Expand Down
2 changes: 1 addition & 1 deletion templates/preventivi/body.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

// Creazione righe fantasma
$autofill = new Util\Autofill($columns);
$autofill->setRows(20, 10);
$autofill->setRows(26, 0);

echo '
<div class="col-xs-5">
Expand Down

0 comments on commit de832e4

Please sign in to comment.