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>
123 lines
6.7 KiB
Twig
123 lines
6.7 KiB
Twig
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Devis {{ devis.orderNumber.numOrder }} - SARL SITECONSEIL</title>
|
|
<style>
|
|
@page { margin: 0; size: A4; }
|
|
body { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #111827; margin: 0; padding: 0; }
|
|
.banner { background: #fabf04; padding: 16px 32px; border-bottom: 1px solid #111827; }
|
|
.banner img { height: 36px; }
|
|
.banner-title { font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: #111827; margin-top: 4px; opacity: 0.7; }
|
|
.container { padding: 24px 32px 16px; }
|
|
.doc-type { display: inline-block; padding: 4px 12px; background: #111827; color: #fff; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; }
|
|
h1 { font-size: 22px; font-weight: 700; text-transform: uppercase; letter-spacing: -0.5px; font-style: italic; margin: 0 0 4px 0; line-height: 1.1; }
|
|
.subtitle { font-size: 9px; color: #666; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
|
|
.info-grid { display: table; width: 100%; margin-bottom: 16px; }
|
|
.info-row { display: table-row; }
|
|
.info-cell { display: table-cell; padding: 8px 10px; vertical-align: top; border: 1px solid #e5e7eb; border-radius: 8px; }
|
|
.info-label { font-size: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: #999; display: block; margin-bottom: 2px; }
|
|
.info-value { font-size: 11px; font-weight: 700; color: #111827; }
|
|
table.lines { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 10px; }
|
|
table.lines th { background: #111827; color: #fff; padding: 8px 10px; text-align: left; text-transform: uppercase; font-size: 8px; font-weight: 700; letter-spacing: 0.5px; }
|
|
table.lines th.right { text-align: right; }
|
|
table.lines td { padding: 8px 10px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
|
|
table.lines td.right { text-align: right; font-family: monospace; }
|
|
table.lines .line-title { font-weight: 700; }
|
|
table.lines .line-desc { font-size: 9px; color: #6b7280; margin-top: 2px; white-space: pre-wrap; }
|
|
.totals { margin-top: 16px; width: 280px; margin-left: auto; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
|
|
.totals table { width: 100%; border-collapse: collapse; }
|
|
.totals td { padding: 6px 10px; font-size: 10px; }
|
|
.totals td.label { text-transform: uppercase; font-size: 8px; font-weight: 700; color: #6b7280; letter-spacing: 1px; }
|
|
.totals td.value { text-align: right; font-family: monospace; font-weight: 700; }
|
|
.totals tr.ttc { background: #fabf04; }
|
|
.totals tr.ttc td { font-size: 12px; font-weight: 700; }
|
|
.footer-legal { margin-top: 24px; padding-top: 8px; border-top: 1px solid #ddd; font-size: 7px; color: #999; line-height: 1.6; }
|
|
.hmac { font-size: 7px; color: #aaa; word-break: break-all; margin: 12px 0 4px; padding: 6px 8px; background: #f9fafb; border: 1px solid #e5e7eb; font-family: monospace; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="banner">
|
|
{% if logo %}<img src="{{ logo }}" alt="SARL SITECONSEIL">{% endif %}
|
|
<div class="banner-title">SARL SITECONSEIL</div>
|
|
</div>
|
|
<div class="container">
|
|
<span class="doc-type">Devis</span>
|
|
<h1>{{ devis.orderNumber.numOrder }}</h1>
|
|
<div class="subtitle">Date : {{ devis.createdAt|date('d/m/Y') }}</div>
|
|
|
|
<div class="info-grid">
|
|
<div class="info-row">
|
|
<div class="info-cell">
|
|
<span class="info-label">Emetteur</span>
|
|
<span class="info-value">SARL SITECONSEIL</span>
|
|
<div style="font-size: 9px; color: #6b7280; margin-top: 4px;">
|
|
27 rue Le Sérurier<br>
|
|
02100 Saint-Quentin, France<br>
|
|
SIREN 943121517<br>
|
|
contact@siteconseil.fr
|
|
</div>
|
|
</div>
|
|
<div class="info-cell">
|
|
<span class="info-label">Client</span>
|
|
<span class="info-value">{{ customer.fullName }}</span>
|
|
<div style="font-size: 9px; color: #6b7280; margin-top: 4px;">
|
|
{% if customer.raisonSociale %}{{ customer.raisonSociale }}<br>{% endif %}
|
|
{% if customer.address %}{{ customer.address }}<br>{% endif %}
|
|
{% if customer.zipCode or customer.city %}{{ customer.zipCode }} {{ customer.city }}<br>{% endif %}
|
|
{% if customer.email %}{{ customer.email }}{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<table class="lines">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 40px;">#</th>
|
|
<th>Prestation</th>
|
|
<th class="right" style="width: 120px;">Prix HT</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for line in devis.lines %}
|
|
<tr>
|
|
<td>{{ loop.index }}</td>
|
|
<td>
|
|
<div class="line-title">{{ line.title }}</div>
|
|
{% if line.description %}<div class="line-desc">{{ line.description }}</div>{% endif %}
|
|
</td>
|
|
<td class="right">{{ line.priceHt }} €</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
<div class="totals">
|
|
<table>
|
|
<tr>
|
|
<td class="label">Total HT</td>
|
|
<td class="value">{{ devis.totalHt }} €</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="label">TVA 20%</td>
|
|
<td class="value">{{ devis.totalTva }} €</td>
|
|
</tr>
|
|
<tr class="ttc">
|
|
<td class="label">Total TTC</td>
|
|
<td class="value">{{ devis.totalTtc }} €</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="hmac">HMAC-SHA256 : {{ devis.hmac }}</div>
|
|
|
|
<div class="footer-legal">
|
|
SARL SITECONSEIL — SIREN 943121517 — 27 rue Le Sérurier, 02100 Saint-Quentin, France<br>
|
|
contact@siteconseil.fr — 06 79 34 88 02 — <a href="https://www.siteconseil.fr" style="color: #999;">www.siteconseil.fr</a><br>
|
|
Devis non signe — Valable 30 jours a compter de la date d'emission
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|