fix invoice preview (#1129)

This commit is contained in:
Kevin Papst
2019-09-20 16:00:03 +02:00
committed by GitHub
parent 5aa422dde1
commit e45e782e7d
9 changed files with 39 additions and 31 deletions

View File

@@ -68,7 +68,6 @@ class InvoiceController extends AbstractController
}
$showPreview = false;
$maxItemsPreview = 500;
$entries = [];
$query = $this->getDefaultQuery();
@@ -88,7 +87,6 @@ class InvoiceController extends AbstractController
$previewButton = $form->get('preview');
if ($previewButton->isClicked()) {
$showPreview = true;
$query->setPageSize($maxItemsPreview);
$entries = $this->getPreviewEntries($query);
}
}
@@ -102,8 +100,7 @@ class InvoiceController extends AbstractController
return $this->render('invoice/index.html.twig', [
'model' => $model,
'form' => $form->createView(),
'preview_max' => $maxItemsPreview,
'preview_show' => $showPreview,
'preview' => $showPreview,
]);
}
@@ -209,7 +206,7 @@ class InvoiceController extends AbstractController
$entries = array_merge($entries, $items);
}
return array_slice($entries, 0, $query->getPageSize());
return $entries;
}
/**