Files
crm_ecosplay/templates/admin/services/ndd.html.twig
Serreau Jovann 95d33a9a6d feat: gestion complete Devis + Avis de paiement + DocuSeal signature + mails
Devis :
- Entity DevisLine (pos, title, description, priceHt) liee a Devis (OneToMany cascade/orphanRemoval)
- Champs ajoutes sur Devis : customer (ManyToOne), submissionId, state machine (created/send/accepted/refused/cancel), raisonMessage, totaux HT/TVA/TTC, updatedAt, setUpdatedAt public
- Relation Devis <-> Advert changee de ManyToOne a OneToOne nullable
- Vich Attribute (migration Annotation -> Attribute) pour unsignedPdf/signedPdf/auditPdf
- DevisController CRUD complet : create (form repeater lignes + boutons rapides TarificationService), edit, cancel (libere OrderNumber), generate-pdf, send, resend, create-advert, events
- DevisPdf (FPDF/FPDI) : header legacy (logo, num, date, client), body lignes, summary totaux, footer SITECONSEIL + pagination, champ signature DocuSeal sur page devis + derniere page CGV
- OrderNumberService : preview() et generate() reutilisent les OrderNumber non utilises (isUsed=false) en priorite
- OrderNumber::markAsUnused() ajoute

DocuSeal integration devis :
- DocuSealService : sendDevisForSignature (avec completed_redirect_url), resendDevisSignature (archive ancienne submission), getSubmitterSlug, downloadSignedDevis (sauvegarde via Vich UploadedFile test=true)
- WebhookDocuSealController : dispatch par doc_type devis/attestation, handleDevisEvent (form.completed -> STATE_ACCEPTED + download PDF signe/audit, form.declined -> STATE_REFUSED + raison)
- DocusealEvent entity pour tracer form.viewed/started/completed/declined en temps reel
- Page evenements admin /admin/devis/{id}/events avec badges et payload JSON

Signature client :
- DevisProcessController : page publique /devis/process/{id}/{hmac} securisee par HMAC, boutons Signer (redirect DocuSeal) / Refuser (motif optionnel)
- Pages confirmation : signed.html.twig (merci + recap) et refused.html.twig (confirmation refus + motif)
- Nelmio whitelist : signature.esy-web.dev + signature.siteconseil.fr

Avis de paiement :
- Entity AdvertLine (pos, title, description, priceHt) liee a Advert
- Advert refactorise : customer, state, totaux, raisonMessage, submissionId, advertFile (Vich mapping advert_pdf), lines collection, updatedAt
- AdvertController : generate-pdf, send (mail + PJ + lien paiement), resend (rappel), cancel (delie devis, libere OrderNumber), search Meilisearch
- AdvertPdf (FPDF/FPDI) : QR code Endroid pointant vers /order/{numOrder}, texte "Scannez pour payer"
- OrderPaymentController : page publique /order/{numOrder} avec detail prestations, totaux, options paiement (placeholder)
- Creation auto depuis devis signe : copie client, totaux, lignes, meme OrderNumber

Meilisearch :
- Index customer_devis et customer_advert avec searchable (numOrder, customerName, customerEmail, state) et filterable (customerId, state)
- CRUD indexation sur chaque action (create, edit, send, cancel, create-advert)
- Recherche AJAX dans tabs Devis et Avis avec debounce + dropdown glassmorphism
- Sync admin : boutons syncDevis / syncAdverts + compteurs dans /admin/sync

Emails :
- MailerService : VCF auto (fiche contact SARL SITECONSEIL) en PJ sur tous les mails, bloc HTML pieces jointes injecte automatiquement (exclut .asc/.p7z/smime) avec icone trombone + taille fichier
- Templates : devis_to_sign, devis_signed_client/admin (PJ signed+audit), devis_refused_client/admin, advert_send (PJ + bouton paiement), ndd_expiration
- TestMailCommand : option --force-dsn pour envoyer via un DSN SMTP specifique (test prod depuis dev)

Commande NDD :
- app:ndd:check : verifie expiration domaines <= 30j, envoie mail groupe a monitor@siteconseil.fr
- Cron quotidien 8h (docker + ansible)

Divers :
- Titles templates : CRM SITECONSEIL -> SARL SITECONSEIL (52 fichiers)
- VAULT_URL dev = https://kms.esy-web.dev (comme prod)
- app.js : initDevisLines (repeater + drag & drop), initTabSearch, toggle refus devis
- app.scss : styles drag & drop
- setasign/fpdi-fpdf installe pour fusion PDF
- 5 migrations Doctrine

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 09:44:35 +02:00

68 lines
4.3 KiB
Twig

{% extends 'admin/_layout.html.twig' %}
{% block title %}Noms de domaine - Services - SARL SITECONSEIL{% endblock %}
{% block admin_content %}
<div class="page-container">
<h1 class="text-2xl font-bold heading-page mb-8">Noms de domaine</h1>
<div class="mb-6">
<div class="relative">
<input type="text" id="search-ndd" placeholder="Rechercher un domaine, client..."
class="w-full px-4 py-3 pl-10 input-glass text-sm font-medium" autocomplete="off">
<svg class="w-4 h-4 absolute left-3 top-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/></svg>
</div>
<div id="search-ndd-results" class="hidden glass border-t-0 bg-white max-h-64 overflow-y-auto"></div>
</div>
<div class="glass overflow-x-auto overflow-hidden">
<table class="w-full text-sm">
<thead>
<tr class="glass-dark text-white">
<th class="px-4 py-3 text-left font-bold uppercase text-xs tracking-widest">Domaine</th>
<th class="px-4 py-3 text-left font-bold uppercase text-xs tracking-widest">Client</th>
<th class="px-4 py-3 text-left font-bold uppercase text-xs tracking-widest">Registrar</th>
<th class="px-4 py-3 text-center font-bold uppercase text-xs tracking-widest">Cloudflare</th>
<th class="px-4 py-3 text-center font-bold uppercase text-xs tracking-widest">Gestion</th>
<th class="px-4 py-3 text-center font-bold uppercase text-xs tracking-widest">Facturation</th>
<th class="px-4 py-3 text-left font-bold uppercase text-xs tracking-widest">Expiration</th>
</tr>
</thead>
<tbody>
{% for domain in domains %}
<tr class="border-b border-white/20 hover:bg-white/50">
<td class="px-4 py-3 font-bold font-mono">{{ domain.fqdn }}</td>
<td class="px-4 py-3">
<a href="{{ path('app_admin_clients_show', {id: domain.customer.id}) }}" class="font-bold hover:text-[#fabf04] transition-colors">{{ domain.customer.fullName }}</a>
{% if domain.customer.raisonSociale %}
<span class="text-[10px] text-gray-400 block">{{ domain.customer.email }}</span>
{% endif %}
</td>
<td class="px-4 py-3 text-xs">{{ domain.registrar ?? '—' }}</td>
<td class="px-4 py-3 text-center">
{% if domain.zoneIdCloudflare %}
<span class="px-2 py-0.5 bg-orange-500/20 text-orange-700 font-bold uppercase text-[10px] rounded">{{ domain.zoneCloudflare ?? 'Lie' }}</span>
{% else %}
<span class="text-gray-300">—</span>
{% endif %}
</td>
<td class="px-4 py-3 text-center">{% if domain.isGestion %}<span class="text-green-600 font-bold">&#10003;</span>{% else %}<span class="text-gray-300">&#10007;</span>{% endif %}</td>
<td class="px-4 py-3 text-center">{% if domain.isBilling %}<span class="text-green-600 font-bold">&#10003;</span>{% else %}<span class="text-gray-300">&#10007;</span>{% endif %}</td>
<td class="px-4 py-3 text-xs">
{% if domain.expiredAt %}
<span class="{{ domain.isExpired ? 'text-red-600 font-bold' : (domain.isExpiringSoon ? 'text-yellow-600 font-bold' : 'text-gray-500') }}">{{ domain.expiredAt|date('d/m/Y') }}</span>
{% else %}
<span class="text-gray-300">—</span>
{% endif %}
</td>
</tr>
{% else %}
<tr><td colspan="7" class="px-4 py-8 text-center text-gray-400 font-bold">Aucun nom de domaine.</td></tr>
{% endfor %}
</tbody>
</table>
</div>
<p class="mt-3 text-xs text-gray-400">{{ domains|length }} domaine(s)</p>
</div>
{% endblock %}