feat: render additional info to teamer invoice
This commit is contained in:
@@ -11,7 +11,9 @@ use App\Entity\Embeddable\BankAccount;
|
||||
use App\Entity\Embeddable\Communication;
|
||||
use App\Entity\JobProfile;
|
||||
use App\Entity\Teamer;
|
||||
use App\Entity\Upload;
|
||||
use App\Entity\User;
|
||||
use App\Service\Pdf\InvoiceApprover;
|
||||
use App\Service\Pdf\InvoiceRenderer;
|
||||
use App\Service\Pdf\Pdf;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
@@ -64,6 +66,7 @@ class InvoiceRendererTest extends WebTestCase
|
||||
->setCode('ABC123')
|
||||
->setDateFrom(new \DateTimeImmutable('2023-12-01'))
|
||||
->setDateTo(new \DateTimeImmutable('2023-12-08'))
|
||||
->setCostUnit('FOO123')
|
||||
;
|
||||
|
||||
$jobProfile = new JobProfile();
|
||||
@@ -81,6 +84,7 @@ class InvoiceRendererTest extends WebTestCase
|
||||
->setDestination($destination)
|
||||
->setJobProfile($jobProfile)
|
||||
->setContact($contact)
|
||||
->setCostCenter('BAR456')
|
||||
;
|
||||
|
||||
$application = new Application($assignment, $teamer);
|
||||
@@ -89,6 +93,20 @@ class InvoiceRendererTest extends WebTestCase
|
||||
$pdf = $renderer->render($disposition);
|
||||
$this->assertInstanceOf(Pdf::class, $pdf);
|
||||
|
||||
$pdf->Output('F', $projectDir.'/temp/Honorarnote.pdf');
|
||||
$pdf->Output('F', $projectDir.'/uploads/invoice/Honorarnote.pdf');
|
||||
|
||||
$invoice = new Upload();
|
||||
$invoice
|
||||
->setType(Upload::TYPE_INVOICE)
|
||||
->setFilename('Honorarnote.pdf')
|
||||
->setApprovedBy('FOO')
|
||||
->setApprovedAt(new \DateTimeImmutable())
|
||||
->setStatus(Upload::STATUS_PAID)
|
||||
;
|
||||
$disposition->addDocument($invoice);
|
||||
|
||||
$approver = new InvoiceApprover($translator, ['project_dir' => $projectDir]);
|
||||
$pdf = $approver->render($disposition);
|
||||
$this->assertInstanceOf(Pdf::class, $pdf);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user