feat: insert additional information when approving invoice
This commit is contained in:
@@ -11,6 +11,7 @@ class InvoiceApprover extends AbstractPdfRenderer
|
|||||||
public function render(Disposition $disposition): Pdf
|
public function render(Disposition $disposition): Pdf
|
||||||
{
|
{
|
||||||
$teamer = $disposition->getTeamer();
|
$teamer = $disposition->getTeamer();
|
||||||
|
$assignment = $disposition->getAssignment();
|
||||||
$invoice = $disposition->getDocumentByType(Upload::TYPE_INVOICE);
|
$invoice = $disposition->getDocumentByType(Upload::TYPE_INVOICE);
|
||||||
$originalPdfFilename = $invoice->getFilename();
|
$originalPdfFilename = $invoice->getFilename();
|
||||||
|
|
||||||
@@ -24,6 +25,19 @@ class InvoiceApprover extends AbstractPdfRenderer
|
|||||||
$pdf->appendPdf($filepath);
|
$pdf->appendPdf($filepath);
|
||||||
$pdf->setPage(1);
|
$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->SetFont('Arial', '', 11);
|
||||||
$pdf->SetTextColor(0, 128, 0);
|
$pdf->SetTextColor(0, 128, 0);
|
||||||
$pdf->Text(20,30, utf8_decode('geprüft: '.$invoice->getApprovedBy()));
|
$pdf->Text(20,30, utf8_decode('geprüft: '.$invoice->getApprovedBy()));
|
||||||
|
|||||||
@@ -36,18 +36,6 @@ class InvoiceRenderer extends AbstractPdfRenderer
|
|||||||
// Tax ID
|
// Tax ID
|
||||||
$pdf->Text(144,62, utf8_decode($teamer->getTaxId()));
|
$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
|
// Invoice number
|
||||||
$pdf->SetFont('Arial', '', 12);
|
$pdf->SetFont('Arial', '', 12);
|
||||||
$number = $assignment->getEffectivePeriod()->start->format('d/m/Y');
|
$number = $assignment->getEffectivePeriod()->start->format('d/m/Y');
|
||||||
|
|||||||
Reference in New Issue
Block a user