Facturation client
📊 Analyse factures ← Sociétés

Factures clients

Créez et gérez vos factures clients

Total factures
0
Montant HT
0,00 MAD
TVA totale
0,00 MAD
Montant TTC
0,00 MAD
N° FactureDateClient Montant HTTVAMontant TTC StatutActions
Aucune facture créée

Clients

Gérez votre portefeuille clients

Raison socialeICEVilleTéléphoneActions
Aucun client enregistré

Paramètres société

Informations obligatoires pour la facturation

Logo de la société

Aparaît en haut de chaque facture

Logo
📷 Cliquez pour ajouter votre logo
PNG, JPG — max 2MB

Signature (optionnel)

PNG transparent — apparaît en bas à droite de chaque facture

Signature
✍ Ajouter votre signature
PNG transparent — max 1MB

Modèle de facture par défaut

Choisissez le style de vos factures PDF

CLASSIQUE PROFESSIONNEL
Classique Professionnel
Blanc & bleu — Standard
MODERNE ÉPURÉ
Moderne Épuré
Design minimaliste
PREMIUM LUXE
Premium
Noir & or — Luxe
STANDARD ADMIN
Standard Administratif
Simple & conforme
'; } // ── CONFIRM ── var _confirmCb=null; function showConfirm(msg,cb){_confirmCb=cb;document.getElementById('confirmMsg').textContent=msg;document.getElementById('confirmModal').style.display='flex';} function closeConfirm(){document.getElementById('confirmModal').style.display='none';_confirmCb=null;} function doConfirm(){var cb=_confirmCb;closeConfirm();if(cb)cb();} // ── TEMPLATE PICKER + DOWNLOAD PDF ── var _pendingInvId = null, _pendingInvDirect = null; function printInvoice(id, directInv) { _pendingInvId = id; _pendingInvDirect = directInv || null; // Show template picker document.getElementById('tplModal').style.display = 'flex'; // Pre-select current template var cur = (_setup && _setup.template) || 1; document.querySelectorAll('.tpl-opt').forEach(function(el) { el.classList.toggle('tpl-selected', parseInt(el.dataset.tpl) === cur); }); } function selectTplAndDownload(tpl) { document.getElementById('tplModal').style.display = 'none'; var inv = _pendingInvDirect || _invoices.find(function(i){return i.id===_pendingInvId;}); var billingPdfLoaderShown=false; function finishBillingPdfLoader(){ if(billingPdfLoaderShown&&window.GlobalSimplaiLoader){ billingPdfLoaderShown=false; GlobalSimplaiLoader.hide(); } } if (!inv || !_setup) { showToast('Données manquantes.'); return; } if(window.GlobalSimplaiLoader){ GlobalSimplaiLoader.show('Generation PDF en cours...'); billingPdfLoaderShown=true; } var client = inv._clientObj || _clients.find(function(c){return c.id===inv.clientId;}) || {name:inv.clientName||'',ice:'',address:'',ville:''}; var html = generatePDF(inv, client, _setup, tpl); // Download as PDF via hidden iframe + print var blob = new Blob([html], {type:'text/html;charset=utf-8'}); var url = URL.createObjectURL(blob); var win = window.open(url, '_blank'); if (win) { win.onload = function() { setTimeout(function() { win.print(); finishBillingPdfLoader(); }, 500); }; setTimeout(finishBillingPdfLoader, 2200); } else { // Fallback: iframe var iframe = document.createElement('iframe'); iframe.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100%;z-index:9999;border:none'; document.body.appendChild(iframe); iframe.src = url; iframe.onerror = finishBillingPdfLoader; iframe.onload = function() { setTimeout(function() { iframe.contentWindow.print(); setTimeout(function() { document.body.removeChild(iframe); URL.revokeObjectURL(url); finishBillingPdfLoader(); }, 3000); }, 500); }; } // Save as default template if (_setup) { _setup.template = tpl; } } // ── TOAST ── function showToast(msg){document.getElementById('toastMsg').textContent=msg;var t=document.getElementById('toast');t.classList.add('show');setTimeout(function(){t.classList.remove('show');},3000);} // ── KEYBOARD ── document.addEventListener('keydown',function(e){if(e.key==='Escape'){closeInvoiceModal();closeClientModal();closeConfirm();}}); // ── INIT ── async function init(){ var bc = document.getElementById('barCompany'); if(bc && _company) bc.textContent = _company.name; await loadSetup(); await loadClients(); await loadInvoices(); } init();