Files
e-ticket/templates/attestation/check.html.twig
Serreau Jovann ab52a8d02f Add payouts, PDF attestations, sub-accounts, and webhook improvements
Payout system:
- Create Payout entity (stripePayoutId, status, amount, currency, destination, arrivalDate)
- Webhook handles payout.created/updated/paid/failed/canceled with email notification
- Payout list in /mon-compte virements tab with status badges
- PDF attestation on paid payouts with email attachment

PDF attestation:
- dompdf with DejaVu Sans font, yellow-orange gradient background
- Orange centered title bar, E-Cosplay logo, emitter/beneficiary info blocks
- QR code linking to /attestation/check/{payoutId} for authenticity verification
- Public verification page: shows payout details if valid, error if altered
- Legal disclaimer and CGV reference
- Button visible only when status is paid, opens in new tab

Sub-accounts:
- Add parentOrganizer (self-referencing ManyToOne) and subAccountPermissions (JSON) to User
- Permissions: scanner (validate tickets), events (CRUD), tickets (free invitations)
- Create sub-account with random password, send email with credentials
- Edit page with name/email/permissions checkboxes
- Delete with confirmation
- hasPermission() helper method

Account improvements:
- Block entire page for unapproved organizers with validation pending message
- Display stripeStatus in Stripe Connect banners
- Remove test payout button

Webhook v2 Connect events:
- v2.core.account.created/updated/closed → update stripeStatus
- capability_status_updated → sync charges/payouts enabled from capabilities
- PayoutPdfService for reusable PDF generation

Migrations: stripeStatus, Payout table, sub-account fields, drop pdfPath

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 23:49:48 +01:00

61 lines
4.1 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}Verification attestation - E-Ticket{% endblock %}
{% block body %}
<div style="max-width:40rem;margin:0 auto;padding:3rem 1rem;">
<h1 class="text-3xl font-black uppercase tracking-tighter italic" style="border-bottom:4px solid #111827;display:inline-block;margin-bottom:0.5rem;">Verification attestation</h1>
<p class="font-bold text-gray-500 italic" style="margin-bottom:2rem;">Ce document a ete verifie par la plateforme E-Ticket.</p>
<div style="border:4px solid #111827;box-shadow:6px 6px 0 rgba(0,0,0,1);background:#d1fae5;padding:1.5rem;margin-bottom:2rem;">
<p class="font-black text-sm" style="margin-bottom:0.5rem;">Attestation authentique</p>
<p class="text-sm text-gray-700">Ce document correspond a un virement enregistre dans notre systeme.</p>
</div>
<div style="border:4px solid #111827;box-shadow:6px 6px 0 rgba(0,0,0,1);background:white;padding:1.5rem;">
<table style="width:100%;border-collapse:collapse;">
<thead>
<tr style="border-bottom:2px solid #e5e7eb;">
<th style="padding:0.5rem 0;text-align:left;" class="text-[10px] font-black uppercase tracking-widest text-gray-400">Detail</th>
<th style="padding:0.5rem 0;text-align:left;" class="text-[10px] font-black uppercase tracking-widest text-gray-400">Valeur</th>
</tr>
</thead>
<tbody>
<tr style="border-bottom:1px solid #e5e7eb;">
<td style="padding:0.5rem 0;" class="font-bold text-sm text-gray-400">Reference</td>
<td style="padding:0.5rem 0;" class="text-sm font-mono">{{ payout.stripePayoutId }}</td>
</tr>
<tr style="border-bottom:1px solid #e5e7eb;">
<td style="padding:0.5rem 0;" class="font-bold text-sm text-gray-400">Montant</td>
<td style="padding:0.5rem 0;" class="text-sm font-bold">{{ payout.amountDecimal|number_format(2, ',', ' ') }} {{ payout.currency|upper }}</td>
</tr>
<tr style="border-bottom:1px solid #e5e7eb;">
<td style="padding:0.5rem 0;" class="font-bold text-sm text-gray-400">Statut</td>
<td style="padding:0.5rem 0;">
{% if payout.status == 'paid' %}
<span style="background:#d1fae5;border:2px solid #111827;padding:0.15rem 0.5rem;" class="text-xs font-black uppercase">{{ payout.status }}</span>
{% elseif payout.status == 'failed' or payout.status == 'canceled' %}
<span style="background:#fee2e2;border:2px solid #111827;padding:0.15rem 0.5rem;" class="text-xs font-black uppercase">{{ payout.status }}</span>
{% else %}
<span style="background:#fef3c7;border:2px solid #111827;padding:0.15rem 0.5rem;" class="text-xs font-black uppercase">{{ payout.status }}</span>
{% endif %}
</td>
</tr>
<tr style="border-bottom:1px solid #e5e7eb;">
<td style="padding:0.5rem 0;" class="font-bold text-sm text-gray-400">Beneficiaire</td>
<td style="padding:0.5rem 0;" class="text-sm">{{ payout.organizer.companyName ?? payout.organizer.firstName ~ ' ' ~ payout.organizer.lastName }}</td>
</tr>
<tr style="border-bottom:1px solid #e5e7eb;">
<td style="padding:0.5rem 0;" class="font-bold text-sm text-gray-400">Date d'arrivee</td>
<td style="padding:0.5rem 0;" class="text-sm">{{ payout.arrivalDate ? payout.arrivalDate|date('d/m/Y') : '—' }}</td>
</tr>
<tr>
<td style="padding:0.5rem 0;" class="font-bold text-sm text-gray-400">Date de creation</td>
<td style="padding:0.5rem 0;" class="text-sm">{{ payout.createdAt|date('d/m/Y H:i') }}</td>
</tr>
</tbody>
</table>
</div>
</div>
{% endblock %}