feat: add suffix to invoice number
closes #8699qe4ep
This commit is contained in:
@@ -37,7 +37,9 @@ class InvoiceRenderer extends AbstractPdfRenderer
|
||||
|
||||
// Invoice number
|
||||
$pdf->SetFont('Arial', '', 12);
|
||||
$number = $assignment->getEffectivePeriod()->start->format('d/m/Y');
|
||||
$date = $assignment->getEffectivePeriod()->start->format('d/m/Y');
|
||||
$suffix = $assignment->getId();
|
||||
$number = sprintf('%s-%05d', $date, $suffix);
|
||||
$pdf->Text(85, 116, $number);
|
||||
|
||||
$pdf->SetFont('Arial', '', 10);
|
||||
|
||||
@@ -16,6 +16,7 @@ use App\Entity\User;
|
||||
use App\Service\Pdf\InvoiceApprover;
|
||||
use App\Service\Pdf\InvoiceRenderer;
|
||||
use App\Service\Pdf\Pdf;
|
||||
use Carbon\CarbonPeriod;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
@@ -81,12 +82,12 @@ class InvoiceRendererTest extends WebTestCase
|
||||
->setEmail('[email protected]')
|
||||
;
|
||||
|
||||
$assignment = new Assignment();
|
||||
$assignment
|
||||
->setDestination($destination)
|
||||
->setJobProfile($jobProfile)
|
||||
->setContact($contact)
|
||||
;
|
||||
$assignment = $this->createMock(Assignment::class);
|
||||
$assignment->method('getEffectivePeriod')->willReturn(CarbonPeriod::create('2025-02-01', '2025-02-08'));
|
||||
$assignment->method('getId')->willReturn(1234);
|
||||
$assignment->method('getDestination')->willReturn($destination);
|
||||
$assignment->method('getJobProfile')->willReturn($jobProfile);
|
||||
$assignment->method('getContact')->willReturn($contact);
|
||||
|
||||
$application = new Application($assignment, $teamer);
|
||||
$disposition = new Disposition($application);
|
||||
|
||||
Reference in New Issue
Block a user