Skip to content

Conversation

@vgreb
Copy link
Collaborator

@vgreb vgreb commented Dec 31, 2025

Refonte du téléchargement d'un justificatif du journal avec Symfony et ajout de l'entité et du repository Ting pour la table compta.

fixes #2066

Comment on lines +43 to +51
$content = $this->filesystem->readFile($path);

$mimeTypes = $this->mimeTypes->getMimeTypes($path);

return new Response($content, Response::HTTP_OK, [
'Content-Type' => implode(', ', $mimeTypes),
'Content-Transfer-Encoding' => 'Binary',
'Content-disposition' => 'attachment; filename="' . basename($path) . '"',
]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

À vérifier mais je pense que tu devrais pouvoir remplacer tout ça par un return new BinaryFileResponse($path);

use CCMBenchmark\Ting\Entity\NotifyPropertyInterface;
use DateTime;

class Accounting implements NotifyPropertyInterface
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm je suis pas fan du nom (éternel sujet 😅 le naming).

Pourquoi pas Transaction ou Operation ? Ou même JournalEntry.

(Je sais qu'on a déjà une table et entité Operation mais vu son utilité on pourrait s'en passer).

Comment on lines +28 to +31
$id = $request->query->getInt('id');
if ($id === 0) {
throw $this->createNotFoundException('No id provided');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourquoi pas en profiter pour modifier l'url et avoir l'id direct dedans ?

Genre /journal/download/123

Comme ça tu récupère int $id dans la méthode et plus besoin de gérer la 404 à la main.

Then the response header "Content-disposition" should match '#filename="afup_justificatifs-(.*).zip"#'

@reloadDbWithTestData
Scenario: Compte journal afficher les entrées déjà pointées
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ça me paraitrait plus juste comme ça :

Suggested change
Scenario: Compte journal afficher les entrées déjà pointées
Scenario: Compte journal Télécharger un justificatif

(par contre tu peux tout à fait faire un autre scénario pour l'affichage des entrées pointées)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refonte - Trésorerie > Journal > Télécharger un justificatif

2 participants