added invoice archive & configurable invoice numbers (#1541)
This commit is contained in:
@@ -10,10 +10,10 @@
|
||||
namespace App\Invoice\Renderer;
|
||||
|
||||
use App\Entity\InvoiceDocument;
|
||||
use App\Invoice\InvoiceFilename;
|
||||
use App\Invoice\InvoiceModel;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
|
||||
use Symfony\Component\String\UnicodeString;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -47,19 +47,7 @@ abstract class AbstractRenderer
|
||||
|
||||
protected function buildFilename(InvoiceModel $model): string
|
||||
{
|
||||
$filename = $model->getNumberGenerator()->getInvoiceNumber();
|
||||
|
||||
$company = $model->getCustomer()->getCompany();
|
||||
if (empty($company)) {
|
||||
$company = $model->getCustomer()->getName();
|
||||
}
|
||||
|
||||
if (!empty($company)) {
|
||||
$company = new UnicodeString($company);
|
||||
$filename .= '-' . $company->snake();
|
||||
}
|
||||
|
||||
return $filename;
|
||||
return (string) new InvoiceFilename($model);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user