Files
crm_ecosplay/src/Controller/EcheancierProcessController.php
Serreau Jovann 46ddb5786a feat: PDF echeancier + signature DocuSeal + email + page client
EcheancierPdf :
- PDF FPDF avec bloc legal, description, tableau echeances, conditions
- 2 champs signature DocuSeal : Company (auto-signe E-Cosplay) + First Party (client)

Controller :
- generate-pdf : genere le PDF via EcheancierPdf + Vich upload
- send-signature : envoie PDF a DocuSeal (2 parties), email avec bouton signer
- resend : renvoie email proposition
- DocuSealService.getLogoBase64 rendu public

EcheancierProcessController (public) :
- /echeancier/signed/{id} : callback post-signature, passe state a signed

Templates :
- echeancier/signed.html.twig : page confirmation signature client
- emails/echeancier_signature.html.twig : email avec bouton signer
- admin/echeancier/show : boutons generer PDF, voir PDF, envoyer proposition,
  envoyer signature, renvoyer, PDF signe, activer Stripe, annuler

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 19:53:10 +02:00

40 lines
1.2 KiB
PHP

<?php
namespace App\Controller;
use App\Entity\Echeancier;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class EcheancierProcessController extends AbstractController
{
public function __construct(
private EntityManagerInterface $em,
) {
}
/**
* Callback DocuSeal apres signature du client.
*/
#[Route('/echeancier/signed/{id}', name: 'app_echeancier_signed', requirements: ['id' => '\d+'])]
public function signed(int $id): Response
{
$echeancier = $this->em->getRepository(Echeancier::class)->find($id);
if (null === $echeancier) {
throw $this->createNotFoundException('Echeancier introuvable.');
}
if (Echeancier::STATE_SIGNED !== $echeancier->getState()) {
$echeancier->setState(Echeancier::STATE_SIGNED);
$this->em->flush();
}
return $this->render('echeancier/signed.html.twig', [
'echeancier' => $echeancier,
'customer' => $echeancier->getCustomer(),
]);
}
}