fix: stampa ddt e preventivi

This commit is contained in:
valentina 2024-11-05 17:48:17 +01:00
parent 0a11357667
commit de832e498b
3 changed files with 7 additions and 11 deletions

View File

@ -41,8 +41,7 @@ class Autofill
public function setRows($rows, $additional = null, $first_page = null) public function setRows($rows, $additional = null, $first_page = null)
{ {
$this->max_rows = $rows; $this->max_rows = $rows;
$this->max_additional = isset($additional) ? $additional: $this->max_rows;
$this->max_additional = $additional ?: $this->max_rows;
$this->max_rows_first_page = $first_page ?? $this->max_rows_first_page; $this->max_rows_first_page = $first_page ?? $this->max_rows_first_page;
} }
@ -88,12 +87,12 @@ class Autofill
if ($page > 1) { if ($page > 1) {
$rows = $this->space - $this->max_rows_first_page * ($page - 1); $rows = $this->space - $this->max_rows_first_page * ($page - 1);
} else { } 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() public function generate()

View File

@ -23,11 +23,8 @@ $prezzi_ivati = setting('Utilizza prezzi di vendita comprensivi di IVA');
// Creazione righe fantasma // Creazione righe fantasma
$autofill = new Util\Autofill($options['pricing'] ? 6 : 3); $autofill = new Util\Autofill($options['pricing'] ? 6 : 3);
$rows_per_page = $rows_per_page ?: 18; $rows_per_page = $options['pricing'] ? 21 : 20;
if (!empty($options['last-page-footer'])) { $autofill->setRows($rows_per_page, 0, $options['pricing'] ? 21 : 20);
$rows_per_page += 10;
}
$autofill->setRows($rows_per_page);
// Intestazione tabella per righe // Intestazione tabella per righe
echo " echo "

View File

@ -65,7 +65,7 @@ if ($has_image) {
// Creazione righe fantasma // Creazione righe fantasma
$autofill = new Util\Autofill($columns); $autofill = new Util\Autofill($columns);
$autofill->setRows(20, 10); $autofill->setRows(26, 0);
echo ' echo '
<div class="col-xs-5"> <div class="col-xs-5">