feat: insert additional information when approving invoice

This commit is contained in:
Björn Fromme
2025-03-04 11:39:40 +01:00
parent 591c6d5010
commit ab6d350045
2 changed files with 14 additions and 12 deletions
+14
View File
@@ -11,6 +11,7 @@ class InvoiceApprover extends AbstractPdfRenderer
public function render(Disposition $disposition): Pdf
{
$teamer = $disposition->getTeamer();
$assignment = $disposition->getAssignment();
$invoice = $disposition->getDocumentByType(Upload::TYPE_INVOICE);
$originalPdfFilename = $invoice->getFilename();
@@ -24,6 +25,19 @@ class InvoiceApprover extends AbstractPdfRenderer
$pdf->appendPdf($filepath);
$pdf->setPage(1);
// Cost unit
if (null !== $costUnit = $assignment->getDestination()->getCostUnit()) {
$pdf->SetFont('Arial', '', 11);
$pdf->Text(20,20, utf8_decode('Kostenstelle: '.$costUnit));
}
// Cost center
if (null !== $costCenter = $assignment->getCostCenter()) {
$pdf->SetFont('Arial', '', 11);
$pdf->Text(20,25, utf8_decode('Kostenträger: '.$costCenter));
}
// Approval
$pdf->SetFont('Arial', '', 11);
$pdf->SetTextColor(0, 128, 0);
$pdf->Text(20,30, utf8_decode('geprüft: '.$invoice->getApprovedBy()));
-12
View File
@@ -36,18 +36,6 @@ class InvoiceRenderer extends AbstractPdfRenderer
// Tax ID
$pdf->Text(144,62, utf8_decode($teamer->getTaxId()));
// Cost unit
if (null !== $costUnit = $assignment->getDestination()->getCostUnit()) {
$pdf->SetFont('Arial', '', 11);
$pdf->Text(20,20, utf8_decode('Kostenstelle: '.$costUnit));
}
// Cost center
if (null !== $costCenter = $assignment->getCostCenter()) {
$pdf->SetFont('Arial', '', 11);
$pdf->Text(20,25, utf8_decode('Kostenträger: '.$costCenter));
}
// Invoice number
$pdf->SetFont('Arial', '', 12);
$number = $assignment->getEffectivePeriod()->start->format('d/m/Y');