feat: additional receipts as attachments to teamer invoices
addresses #869dv97u9
This commit is contained in:
1 parent
16d847137d
commit
52926ec6cc
29 files changed
+682
-23
No files matched your search
@@ -23,7 +23,10 @@ class UploadHandler
|
||||
private readonly LoggerInterface $logger,
|
||||
private readonly string $projectDir,
|
||||
private readonly string $environment,
|
||||
private readonly string $uploadReplacementFile,
|
||||
// Bound from %env(default::UPLOAD_REPLACEMENT_FILE)%, whose empty fallback parameter
|
||||
// resolves to null when the variable is not set at all - so "unset", "set to empty" and
|
||||
// "absent" all have to mean the same thing here.
|
||||
private readonly ?string $uploadReplacementFile,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -65,6 +68,23 @@ class UploadHandler
|
||||
return $uploadSession;
|
||||
}
|
||||
|
||||
/**
|
||||
* Drops the uploads of one mapping from the session and writes the trimmed DTO back, so a
|
||||
* consumer clears only what it has just persisted. destroyUploadSession() below still exists
|
||||
* for a full reset, but a page with two dropzones must not use it: it would throw away the
|
||||
* files belonging to the other one.
|
||||
*/
|
||||
public function removeUploadSessionUploadsByType(string $type): UploadSessionDto
|
||||
{
|
||||
$uploadSession = $this->getUploadSession();
|
||||
$uploadSession->removeUploadsByType($type);
|
||||
|
||||
$session = $this->requestStack->getSession();
|
||||
$session->set(self::SESSION_KEY, $uploadSession);
|
||||
|
||||
return $uploadSession;
|
||||
}
|
||||
|
||||
public function removeUploadFromSession(string $filename): UploadSessionDto
|
||||
{
|
||||
$uploadSession = $this->getUploadSession();
|
||||
@@ -153,7 +173,9 @@ class UploadHandler
|
||||
{
|
||||
$originalPath = $this->getUploadFilepath($upload);
|
||||
|
||||
if ('' === $this->uploadReplacementFile || 'prod' === $this->environment) {
|
||||
if (null === $this->uploadReplacementFile
|
||||
|| '' === $this->uploadReplacementFile
|
||||
|| 'prod' === $this->environment) {
|
||||
return $originalPath;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user