<!doctype html><html lang="fr"><head><meta charset="utf-8"><title><?=htmlspecialchars($invoice['document_number']?:'Facture')?></title><style>body{font:14px Arial;color:#172033;max-width:900px;margin:40px auto}.toolbar{display:flex;gap:10px;margin-bottom:18px}.toolbar button,.toolbar a{border:0;border-radius:8px;padding:10px 14px;background:#315bea;color:#fff;text-decoration:none;cursor:pointer}header{display:flex;justify-content:space-between;border-bottom:3px solid #325f9d;padding-bottom:20px}.brand{font-size:25px;font-weight:bold;color:#325f9d}.box{border:1px solid #ccd5e2;padding:16px;margin:25px 0}table{width:100%;border-collapse:collapse}th,td{padding:10px;border-bottom:1px solid #ddd;text-align:left}.num{text-align:right}.total{font-size:20px}.legal{margin-top:45px;border-top:1px solid #ccc;padding-top:15px;font-size:12px}@media print{.no-print{display:none}body{margin:0}}</style></head><body><div class="toolbar no-print"><button onclick="window.print()">Imprimer / enregistrer en PDF</button><a href="/public/mon-espace/factures">Retour à mes factures</a></div><header><div><img src="/public/assets/images/logo-carrefour-des-arts.jpg" alt="Carrefour des Arts" style="display:block;width:150px;height:auto;margin-bottom:8px"><div class="brand"><?=htmlspecialchars($settings['legal_name'])?></div><div><?=htmlspecialchars($settings['address_line1'])?><br><?=htmlspecialchars($settings['postal_code'].' '.$settings['city'])?><br>SIRET <?=htmlspecialchars($settings['siret'])?></div></div><div><h1><?=strtoupper($invoice['document_type']==='credit'?'AVOIR':($invoice['document_type']==='proforma'?'FACTURE PRO FORMA':'FACTURE'))?></h1><strong><?=htmlspecialchars($invoice['document_number']?:'NON NUMÉROTÉE')?></strong><br>Date : <?=htmlspecialchars($invoice['issue_date']??date('Y-m-d'))?></div></header><div class="box"><strong>Destinataire</strong><br><?=htmlspecialchars($invoice['prenom'].' '.$invoice['nom'])?><br>Compte client / adhérent : <?=htmlspecialchars($invoice['client_account'])?><br><?=htmlspecialchars($invoice['adresse_ligne1']??'')?><br><?=htmlspecialchars(trim(($invoice['code_postal']??'').' '.($invoice['ville']??'')))?></div><table><thead><tr><th>Désignation</th><th>Compte</th><th class="num">Montant</th></tr></thead><tbody><?php foreach($invoice['lines'] as $l):?><tr><td><?=htmlspecialchars($l['description'])?><br><small><?=htmlspecialchars(($l['service_start']?:'').' '.($l['service_end']?'au '.$l['service_end']:''))?></small></td><td><?=htmlspecialchars($l['revenue_account'])?></td><td class="num"><?=number_format((float)$l['net_amount'],2,',',' ')?> €</td></tr><?php endforeach?></tbody><tfoot><tr class="total"><th colspan="2">Total net à payer</th><th class="num"><?=number_format((float)$invoice['total_amount'],2,',',' ')?> €</th></tr></tfoot></table><?php if($invoice['document_type']==='proforma'):?><p><strong>Document pro forma sans valeur comptable.</strong></p><?php endif?><div class="legal"><?=htmlspecialchars($settings['vat_mention'])?><br>Carrefour des Arts · 96, rue Auguste Coolen · 59123 BRAY-DUNES · SIRET 945 373 116 00017</div></body></html>
