Merge branch 'master' into feature/timeline

This commit is contained in:
Björn Fromme
2025-03-18 17:21:56 +01:00
12 changed files with 79 additions and 42 deletions
+12 -9
View File
@@ -22,26 +22,29 @@ class InvoiceApprover extends AbstractPdfRenderer
throw new \InvalidArgumentException('Expected PDF but got '.$invoice->getMimeType());
}
// Load template
$filepath = sprintf('%s/uploads/invoice/%s', $this->config['project_dir'], $originalFilename);
if (false === file_exists($filepath)) {
throw new \InvalidArgumentException('Uploaded document not found at '.$filepath);
}
$pdf = new Pdf();
$pdf->SetAuthor($teamer->getFullName(), true);
$pdf->SetCreator($teamer->getFullName(), true);
// Load template
$filepath = sprintf('%s/uploads/invoice/%s', $this->config['project_dir'], $originalFilename);
$pdf->appendPdf($filepath);
$pdf->setPage(1);
// Cost unit
if (null !== $costUnit = $assignment->getDestination()->getCostUnit()) {
// Cost unit job profile
if (null !== $costUnit = $assignment->getJobProfile()->getCostUnit()) {
$pdf->SetFont('Arial', '', 11);
$pdf->Text(20,20, utf8_decode('Kostenstelle: '.$costUnit));
$pdf->Text(20,20, utf8_decode('Kostenstelle 1: '.$costUnit));
}
// Cost center
if (null !== $costCenter = $assignment->getCostCenter()) {
// Cost unit destination/hotel
if (null !== $costUnit = $assignment->getDestination()->getCostUnit()) {
$pdf->SetFont('Arial', '', 11);
$pdf->Text(20,25, utf8_decode('Kostenträger: '.$costCenter));
$pdf->Text(20,25, utf8_decode('Kostenstelle 2: '.$costUnit));
}
// Approval