← Bibliothèque / Commerce
Facturation & encaissement
Assemblage des pièces facturation existantes en un module standard : liste/fiche/envoi/relances/reçu imprimable + rails d'encaissement PF (Lyra/SystemPay-PayZen, virement, acomptes).
Construit à partir de :
Studio Bellezabookflowcommunity-saas Bonfirekoko-engine
Dans le back office
Section Commercial : Factures (liste+fiche), Revenus (stats), Encaissements ; Public : /facture/[id] imprimable.
Pages & écrans
| Page / zone | Rôle |
|---|---|
admin/invoices | Liste + filtres statuts, fiche lignes/TVA/totaux, actions envoyer/relancer |
/facture/[id] | Facture/reçu imprimable publique tokenisée (BoutonImprimer) |
admin/revenue | CA période, tendances, par prestation/canal |
payments/reminders | Encaisser/rembourser RPC IDEMPOTENTES, relances cadencées |
Patterns UI/UX
- Facture HTML/A4 print CSS propre (déjà fait Belleza/invoice-pdf Pahono PAH-YYYY-XXXX échéance +30 j)
Composants clés
- community-saas invoice-generator (manifest BonfireModule : migrations + route + sidebar slot + widget + settingsSchema — plug-and-play référence)
- bookflow lib/invoice-pdf.ts
- Belleza FactureRecu + BoutonImprimer
Automatisations
- Relance paiement via liens wa.me/sms/mailto (lib/outbound)
- n8n invoice-processor (KB, Planned) + payment-reconciliation
- Encaissement carte = adaptateur Lyra (module e-commerce) ; à défaut virement XPF avec RIB
Intelligence artificielle
- Rôle IA
- L'agent peut PRÉPARER une facture/proposition (geste whitelisté) — validation humaine avant envoi.
- Modèles
- —
- Garde-fous
- jamais de montant inventé : montants viennent des lignes/produits réels
Données
- invoices (invoice_number YYYY-NNNN, devises XPF/EUR, pdf_url)
- payments (RPC idempotentes)
- payment_reminders
- credit_transactions (Pulse)
Invariants & pièges
- Stripe indisponible PF : facture réel = SystemPay/PayZen/virement, jamais fake paid
- WICK leçon : aucun certificat/payout fictif — une ligne status='paid' exige un vrai encaissement
- TVA PF 5%/16% paramétrable (catalogue Aqua nullable = « à configurer », rien d'inventé)