added pdf template and other invoice improvements (#1693)
This commit is contained in:
@@ -75,7 +75,7 @@ class InvoiceItemDefaultHydrator implements InvoiceItemHydrator
|
||||
'entry.currency' => $currency,
|
||||
'entry.duration' => $item->getDuration(),
|
||||
'entry.duration_decimal' => $formatter->getFormattedDecimalDuration($item->getDuration()),
|
||||
'entry.duration_minutes' => number_format($item->getDuration() / 60),
|
||||
'entry.duration_minutes' => (int) ($item->getDuration() / 60),
|
||||
'entry.begin' => $formatter->getFormattedDateTime($begin),
|
||||
'entry.begin_time' => $formatter->getFormattedTime($begin),
|
||||
'entry.begin_timestamp' => $begin->getTimestamp(),
|
||||
|
||||
@@ -57,7 +57,7 @@ class InvoiceModelProjectHydrator implements InvoiceModelHydrator
|
||||
$prefix . 'budget_money_plain' => $project->getBudget(),
|
||||
$prefix . 'budget_time' => $project->getTimeBudget(),
|
||||
$prefix . 'budget_time_decimal' => $formatter->getFormattedDecimalDuration($project->getTimeBudget()),
|
||||
$prefix . 'budget_time_minutes' => number_format($project->getTimeBudget() / 60),
|
||||
$prefix . 'budget_time_minutes' => (int) ($project->getTimeBudget() / 60),
|
||||
];
|
||||
|
||||
foreach ($project->getVisibleMetaFields() as $metaField) {
|
||||
|
||||
@@ -45,7 +45,14 @@ final class PdfRenderer implements RendererInterface
|
||||
$content = $this->twig->render('@invoice/' . basename($document->getFilename()), [
|
||||
'model' => $model
|
||||
]);
|
||||
$content = $this->converter->convertToPdf($content);
|
||||
|
||||
$content = $this->converter->convertToPdf($content, [
|
||||
'setAutoTopMargin' => 'pad',
|
||||
'setAutoBottomMargin' => 'pad',
|
||||
'margin_top' => 12,
|
||||
'margin_bottom' => 8,
|
||||
]);
|
||||
|
||||
$filename = (string) new InvoiceFilename($model);
|
||||
|
||||
$response = new Response($content);
|
||||
|
||||
Reference in New Issue
Block a user