Module UltimateInvoice FR: Difference between revisions

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
Tag: 2017 source edit
No edit summary
Tags: Reverted 2017 source edit
Line 1: Line 1:
=Sommaire=
=Summary=
[[Category:Modules complémentaires]]
[[Category:Add-on modules]]
[[Category:Ultimateinvoice]]
[[Category:Ultimateinvoice]]
{{TemplateDocDev}}
{{TemplateDocDev}}
Line 10: Line 10:
|webbuy={{LinkToPluginDownloadDoliStore|keyword=ultimateinvoice}}
|webbuy={{LinkToPluginDownloadDoliStore|keyword=ultimateinvoice}}
|status=stable
|status=stable
|prerequisites=Module ''Factures'' activé - PHP 7.4 minimum
|prerequisites=''Invoices'' module enabled - PHP 7.4 minimum
|minversion=23.0.x - 24.0.x
|minversion=23.0.x - 24.0.x
|note=
|note=
''[[#Sommaire|⬆ Retour au sommaire]]''
''[[#Summary|⬆ Back to summary]]''
}}
}}


=Fonctionnalités=
=Features=
UltimateInvoice remplace le modèle PDF natif de Dolibarr pour les '''factures''' par un modèle entièrement personnalisable, nommé '''<code>ultimate_invoice</code>'''. Véritable couteau suisse de la facture PDF, il permet de définir votre charte graphique (logo, couleurs, marges, fond de page, largeurs de colonnes), de choisir précisément ce qui s'affiche sur le document, d'y joindre vos CGV ou des PDF annexes, d'y ajouter des codes-barres et QR-codes, et de '''signer numériquement''' le fichier généré.
UltimateInvoice replaces the native Dolibarr PDF template for '''invoices''' with a fully customisable template named '''<code>ultimate_invoice</code>'''. A true Swiss army knife for PDF invoices, it lets you define your own graphic identity (logo, colours, margins, page background, column widths), choose exactly what is printed on the document, append your GSC or additional PDF files, add barcodes and QR codes, and '''digitally sign''' the generated file.


'''UltimateInvoice est la version allégée du module [[Module_Ultimatepdf_FR|UltimatePDF]]''' : elle couvre uniquement les factures. Pour les devis, commandes, contrats, expéditions, notes de frais, interventions, projets, produits/nomenclatures ou documents fournisseurs, la version complète UltimatePDF est nécessaire.
'''UltimateInvoice is the lightweight edition of the [[Module_Ultimatepdf_EN|UltimatePDF]] module''': it covers invoices only. For proposals, orders, contracts, shipments, expense reports, interventions, projects, products/BOMs or supplier documents, the full UltimatePDF edition is required.


===Deux niveaux de configuration===
===Two levels of configuration===


Le module s'articule autour de deux notions à ne pas confondre<span> </span>:
The module is built around two notions that should not be confused<span> </span>:


*Le '''Design''' (onglet ''Modèles'') définit '''à quoi ressemble''' le document<span> </span>: couleurs, marges, logo, alias société, fond de page, largeur des colonnes. Plusieurs Designs peuvent coexister, un seul est actif par défaut (constante <code>ULTIMATE_DESIGN</code>), et un sélecteur en haut à droite de l'application permet d'en changer instantanément.
*The '''Design''' (''Models'' tab) defines '''what the document looks like'''<span> </span>: colours, margins, logo, company alias, page background, column widths. Several Designs can coexist, only one is active by default (<code>ULTIMATE_DESIGN</code> constant), and a selector at the top right of the application lets you switch instantly.
*Les pages '''Options''' et '''Factures''' décident '''ce qui s'affiche''' sur le document<span> </span>: colonnes visibles, blocs d'adresses, mentions légales, signatures imprimées, etc. Elles ne touchent pas à l'habillage graphique.
*The '''Options''' and '''Invoices''' pages decide '''what is shown''' on the document<span> </span>: visible columns, address blocks, legal mentions, printed signatures, and so on. They do not affect the graphic design.


===Personnalisation graphique (Designs)===
===Graphic customisation (Designs)===


*'''Fond de page'''<span> </span>: image de fond ou PDF de fond (papier à en-tête déjà maquetté), avec transparence et positionnement X/Y.
*'''Page background'''<span> </span>: background image or background PDF (pre-designed letterhead), with transparency and X/Y positioning.
*'''En-tête'''<span> </span>: hauteur et largeur du logo, second logo (partenaire, certification), largeur du bloc expéditeur avec aperçu glisser-déposer et préréglage '''enveloppe à fenêtre norme postale française'''.
*'''Header'''<span> </span>: logo height and width, second logo (partner, certification), sender block width with drag-and-drop preview and a '''French postal standard window envelope''' preset.
*'''Alias société'''<span> </span>: permet d'afficher sur le document une raison sociale, une adresse, un capital ou un n° de TVA différents de l'entité juridique réelle — utile pour une marque commerciale ou une filiale.
*'''Company alias'''<span> </span>: prints a company name, address, share capital or VAT number different from the actual legal entity — useful for a trade name or a subsidiary.
*'''Marges et colonnes'''<span> </span>: marges du PDF et largeur de chaque colonne du tableau de lignes (référence, image, date, type, projet, TVA, PU, quantité, unité, remise), chacune redimensionnable à la souris sur un aperçu graphique.
*'''Margins and columns'''<span> </span>: PDF margins and the width of each column of the lines table (reference, image, date, type, project, VAT, unit price, quantity, unit, discount), each one resizable with the mouse on a graphic preview.
*'''Pied de page'''<span> </span>: taille de police, hauteur réservée au texte libre, couleurs du texte et du fond.
*'''Footer'''<span> </span>: font size, height reserved for free text, text and background colours.
*'''Police'''<span> </span>: choix de la police du document (DejaVuSans pour les jeux de caractères étendus ou cyrilliques).
*'''Font'''<span> </span>: document font selection (DejaVuSans for extended or Cyrillic character sets).


Chaque bloc du formulaire possède son propre bouton '''Enregistrer'''<span> </span>: vous validez bloc par bloc sans perdre votre saisie sur les autres.
Every block of the form has its own '''Save''' button<span> </span>: you validate block by block without losing your input in the others.


===Contenu de la facture===
===Invoice content===


*Colonnes de lignes<span> </span>: numérotation, photo produit, PU HT, remise, PU après remise, quantité, poids et poids total, unité.
*Line columns<span> </span>: numbering, product photo, unit price excl. tax, discount, unit price after discount, quantity, weight and total weight, unit.
*Blocs d'adresses<span> </span>: coordonnées destinataire, client, commercial suiveur, identifiants professionnels (SIRET...), n° de TVA intracommunautaire, empilement vertical des blocs de contacts.
*Address blocks<span> </span>: recipient, customer and sales representative details, professional IDs (company registration numbers...), intra-community VAT number, vertical stacking of contact blocks.
*Mise en page<span> </span>: en-tête non répété sur chaque page, repère de pliage, texte associé à la date, format de papier.
*Layout<span> </span>: header not repeated on every page, folding mark, text next to the date, paper format.
*Spécifique factures<span> </span>: expéditions liées, conditions de paiement, facture de situation, lien de paiement en ligne, encours client, montant en toutes lettres, ligne de total TTC, génération sans colonne TVA.
*Invoice specific<span> </span>: linked shipments, payment terms, situation invoice, online payment link, customer outstanding amount, amount in words, total incl. tax line, generation without the VAT column.
*Signatures '''imprimées'''<span> </span>: signature du responsable sur le document et signature du commercial suiveur dans la note. Ce sont des '''images''' ajoutées au PDF, à ne pas confondre avec la signature cryptographique décrite plus bas.
*'''Printed''' signatures<span> </span>: manager signature on the document and sales representative signature in the note. These are '''images''' added to the PDF, not to be confused with the cryptographic signature described below.


===Fusion de PDF et CGV===
===PDF merging and GSC===


*'''CGV'''<span> </span>: un fichier de conditions générales de vente est téléversé depuis la page ''Options'' puis ajouté à la suite de la facture, avec présélection par défaut possible.
*'''GSC'''<span> </span>: a general sales conditions PDF file is uploaded from the ''Options'' page and appended to the invoice, with an optional default preselection.
*'''Fichiers additionnels'''<span> </span>: après activation de l'option correspondante sur la page ''Factures'', un ou plusieurs PDF quelconques peuvent être fusionnés au document depuis la fiche de la facture.
*'''Additional files'''<span> </span>: once the matching option is enabled on the ''Invoices'' page, one or several arbitrary PDF files can be merged into the document straight from the invoice card.


===Signature électronique des factures (PAdES)===
===Electronic signature of invoices (PAdES)===


UltimateInvoice peut apposer une '''signature numérique''' sur le PDF au moment de sa génération. Elle garantit au destinataire l'authenticité (le document vient bien de vous) et l'intégrité (il n'a pas été modifié depuis). Adobe Acrobat Reader l'affiche dans son panneau ''Signatures'', et un '''cadre de signature visible''' est dessiné en bas à droite de la dernière page.
UltimateInvoice can apply a '''digital signature''' to the PDF as it is generated. It guarantees authenticity to the recipient (the document really comes from you) and integrity (it has not been modified since). Adobe Acrobat Reader shows it in its ''Signatures'' panel, and a '''visible signature box''' is drawn at the bottom right of the last page.


{| class="wikitable"
{| class="wikitable"
! Aspect !! Détail
! Aspect !! Detail
|-
|-
| Ce que la fonctionnalité fait || Signature cryptographique PKCS#7 détachée, équivalent '''PAdES-B-B''', intégrée nativement au PDF, avec cadre visible et cliquable
| What the feature does || Detached PKCS#7 cryptographic signature, equivalent to '''PAdES-B-B''', natively embedded in the PDF, with a visible and clickable box
|-
|-
| Ce qu'elle ne fait pas || Pas d'horodatage qualifié (RFC 3161), pas de LTV/archivage long terme, '''pas de valeur probante eIDAS qualifiée'''
| What it does not do || No qualified timestamp (RFC 3161), no LTV/long-term archiving, '''no qualified eIDAS legal value'''
|-
|-
| Ce qu'elle ne remplace pas || Ni la facturation électronique (Factur-X / PDF-A3), ni une signature qualifiée délivrée par un prestataire de confiance
| What it does not replace || Neither electronic invoicing (Factur-X / PDF-A3), nor a qualified signature issued by a trust service provider
|}
|}


Formats de certificat acceptés<span> </span>: '''<code>.pem</code>, <code>.crt</code>, <code>.p12</code>, <code>.pfx</code>'''. Le fichier doit contenir '''le certificat et la clé privée'''. Il est stocké dans le répertoire ''documents'' de Dolibarr, hors du dossier web du module<span> </span>: il n'est donc pas téléchargeable depuis un navigateur.
Accepted certificate formats<span> </span>: '''<code>.pem</code>, <code>.crt</code>, <code>.p12</code>, <code>.pfx</code>'''. The file must contain '''both the certificate and the private key'''. It is stored in the Dolibarr ''documents'' directory, outside the module web folder<span> </span>: it therefore cannot be downloaded from a browser.


'''Limite importante'''<span> </span>: la fusion de fichiers additionnels réécrit le PDF après sa génération et casserait la signature. Sur une facture où des fichiers sont fusionnés, la signature est donc '''automatiquement ignorée''' (un avertissement est écrit dans le journal Dolibarr) plutôt que produite invalide. La fusion des CGV, elle, reste compatible.
'''Important limitation'''<span> </span>: merging additional files rewrites the PDF after it has been generated, which would break the signature. On an invoice where files are merged, the signature is therefore '''automatically skipped''' (a warning is written to the Dolibarr log) rather than produced invalid. GSC merging, on the other hand, remains compatible.


===Codes-barres, QR-codes et QR-facture suisse===
===Barcodes, QR codes and Swiss QR-bill===


*'''Codes-barres''' produits (EAN13 avec clé de contrôle, CODE128, CODE39) et codes-barres tiers, en haut ou en bas de page.
*'''Barcodes''' for products (EAN13 with check digit, CODE128, CODE39) and for third parties, at the top or at the bottom of the page.
*'''QR-codes''' société (MyCompany), tiers, ou facture.
*'''QR codes''' for the company (MyCompany), the third party, or the invoice.
*'''QR-code de paiement SEPA''' (norme EPC069-12) et '''QR-facture suisse''' (Swiss QR-bill), y compris le bulletin de versement complet sur une page dédiée. Attention<span> </span>: ces deux réglages appartiennent au '''cœur de Dolibarr''' (''Accueil - Configuration - PDF - onglet Paramètres spécifiques'', section ''Factures'') et non au module, qui se contente de les respecter lors de la génération.
*'''SEPA payment QR code''' (EPC069-12 standard) and '''Swiss QR-bill''', including the full payment slip on a dedicated page. Please note<span> </span>: both settings belong to the '''Dolibarr core''' (''Home - Setup - PDF - Specific parameters tab'', ''Invoices'' section) and not to the module, which simply honours them when generating the document.


Pour le bulletin de versement suisse complet, le mode de règlement doit être le '''virement bancaire''', un compte bancaire doit être renseigné sur la facture, l'adresse de votre société doit être complète et l'IBAN valide (les QR-IBAN ne sont pas encore gérés). Le cadre de signature électronique est volontairement dessiné sur la dernière page de la facture, '''avant''' l'ajout du bulletin, dont la mise en page est normative.
For the full Swiss payment slip, the payment mode must be '''bank transfer''', a bank account must be set on the invoice, your company address must be complete and the IBAN valid (QR-IBANs are not supported yet). The electronic signature box is deliberately drawn on the last page of the invoice, '''before''' the slip is appended, since the slip layout is normative.


===Compatibilité avec le module Milestone===
===Compatibility with the Milestone module===


UltimateInvoice reconnaît les lignes jalons du module [[Module_Jalon_FR|Milestone]] (<code>product_type = 9</code>)<span> </span>: elles ne sont pas traitées comme des lignes produit classiques dans le calcul du poids de ligne et du prix unitaire après remise, et conservent leur mise en forme propre dans le PDF.
UltimateInvoice recognises the milestone lines of the [[Module_Milestone_EN|Milestone]] module (<code>product_type = 9</code>)<span> </span>: they are not handled as regular product lines when computing the line weight and the unit price after discount, and they keep their own formatting in the PDF.


===Guide d'utilisation intégré===
===Built-in user guide===


Un guide complet en français et en anglais est consultable directement depuis la configuration du module, onglet '''Guide d'utilisation'''. Il est mis à jour à chaque version et détaille chaque option.
A complete guide, in French and in English, can be read directly from the module setup, '''User guide''' tab. It is updated with every release and details every option.


''[[#Sommaire|⬆ Retour au sommaire]]''
''[[#Summary|⬆ Back to summary]]''


==Prérequis==
==Prerequisites==
'''Dolibarr<span> </span>:'''  Versions supportées<span> </span>:
'''Dolibarr<span> </span>:'''  Supported versions<span> </span>:


*'''23.x'''
*'''23.x'''
*'''24.x'''
*'''24.x'''


'''PHP<span> </span>:''' version 7.4 minimum. Le bulletin de versement suisse complet en page dédiée nécessite PHP 8.1 ou supérieur.
'''PHP<span> </span>:''' version 7.4 minimum. The full Swiss payment slip on a dedicated page requires PHP 8.1 or later.


'''Modules Dolibarr<span> </span>:''' le module '''Factures''' doit être activé.
'''Dolibarr modules<span> </span>:''' the '''Invoices''' module must be enabled.


=⚙️ Procédure d'installation=
=⚙️ Installation procedure=


===⚙️ Installation manuelle===
===⚙️ Manual installation===


#'''Télécharger''' le fichier archive du module (.zip).
#'''Download''' the module archive file (.zip).
#'''Placer''' le fichier dans le répertoire racine de Dolibarr.
#'''Put''' the file into the Dolibarr root directory.
#'''Décompresser''' le fichier zip avec la commande<span> </span>:
#'''Unzip''' the file with the command<span> </span>:


<code>unzip module_ultimateinvoice-X.0.0.zip</code>
<code>unzip module_ultimateinvoice-X.0.0.zip</code>


#'''Vérifier''' que l'emplacement correct du module est<span> </span>:
#'''Check''' that the correct module location is<span> </span>:


<code>htdocs/custom/ultimateinvoice</code>
<code>htdocs/custom/ultimateinvoice</code>


#'''Le module est maintenant disponible''' et peut être activé depuis Dolibarr.
#'''The module is now available''' and can be enabled from Dolibarr.


''[[#Sommaire|⬆ Retour au sommaire]]''
''[[#Summary|⬆ Back to summary]]''
=Configuration=
=Setup=
Pour utiliser ce module, il vous faut d'abord l'activer. Pour cela, après s'être connecté avec un compte administrateur,
To use this module, you must first enable it. To do so, once logged in with an administrator account,
allez sur la page "'''Accueil - Configuration - Modules'''".
go to the "'''Home - Setup - Modules'''" page.
Le module apparait dans l'onglet "'''Atoo-Net'''", cliquez sur "Activer".
The module appears in the "'''Atoo-Net'''" tab, click on "Enable".
Un pictogramme apparait à la fin de la ligne du module, cliquez dessus pour accéder aux pages de paramétrage spécifiques à ce module.
An icon appears at the end of the module line, click on it to reach the setup pages specific to this module.


Toutes les pages d'administration du module sont protégées par le droit <code>ultimateinvoice -> config</code><span> </span>: seuls les utilisateurs disposant de ce droit (généralement les administrateurs) peuvent y accéder. Les autres utilisateurs voient simplement le modèle <code>ultimate_invoice</code> apparaître dans la liste déroulante "Modèles" de la fiche facture.
All the administration pages of the module are protected by the <code>ultimateinvoice -> config</code> permission<span> </span>: only users holding this permission (usually administrators) can access them. Other users simply see the <code>ultimate_invoice</code> template appear in the "Models" dropdown list of the invoice card.


La configuration se compose de cinq onglets<span> </span>: '''Modèles''', '''Options''', '''Factures''', '''Guide d'utilisation''' et '''À propos'''.
The setup consists of five tabs<span> </span>: '''Models''', '''Options''', '''Invoices''', '''User guide''' and '''About'''.


==Onglet Modèles (Designs)==
==Models tab (Designs)==


C'est ici que se crée l'habillage graphique commun à tous vos documents.
This is where you build the graphic identity shared by all your documents.


[[File:slide_01_invoice.png|800px]]
[[File:slide_01_invoice.png|800px]]


  - La liste affiche tous les Designs existants<span> </span>: libellé, description, type de bordure, couleurs, statut et badge "Défaut" pour celui actuellement utilisé.
  - The list shows every existing Design<span> </span>: label, description, border type, colours, status and a "Default" badge for the one currently in use.


  - Cliquez sur '''Ajouter un design''' pour en créer un nouveau, ou sur le crayon pour modifier un design existant.
  - Click on '''Add a design''' to create a new one, or on the pencil to edit an existing design.


[[File:slide_02_invoice.png|800px]]
[[File:slide_02_invoice.png|800px]]


  - Renseignez bloc par bloc<span> </span>: informations du modèle et police, fond de page, en-tête et logos, alias société, bloc central, marges et largeurs de colonnes, pied de page. '''Chaque bloc dispose de son propre bouton Enregistrer.'''
  - Fill in block by block<span> </span>: template information and font, page background, header and logos, company alias, central block, margins and column widths, footer. '''Each block has its own Save button.'''


  - Un Design désactivé n'apparaît plus dans les listes de sélection. Le "Modèle maître" et le Design par défaut ne peuvent pas être supprimés, afin de ne jamais casser la génération de documents.
  - A disabled Design no longer appears in selection lists. The "Master template" and the default Design cannot be deleted, so that document generation can never be broken.


'''Important'''<span> </span>: après modification d'un Design, si le document généré ne semble pas avoir changé, vérifiez que c'est bien ce Design qui porte le badge "Défaut".
'''Important'''<span> </span>: after modifying a Design, if the generated document does not seem to have changed, check that this Design is the one carrying the "Default" badge.


==Onglet Options (réglages globaux)==
==Options tab (global settings)==


Ces réglages s'appliquent à tous les documents, indépendamment du Design choisi<span> </span>: logos, blocs d'adresses et identifiants professionnels, fond de page, contenu des lignes, CGV, coordonnées bancaires, certificat de signature, format de papier.
These settings apply to every document, whatever the chosen Design<span> </span>: logos, address blocks and professional IDs, page background, line content, GSC, bank details, signing certificate, paper format.


[[File:slide_03_invoice.png|800px]]
[[File:slide_03_invoice.png|800px]]


La plupart des réglages sont des interrupteurs on/off appliqués immédiatement<span> </span>; le format de papier et les identifiants professionnels se valident avec un bouton '''Enregistrer''' dédié.
Most settings are on/off switches applied immediately<span> </span>; the paper format and the professional IDs are validated with a dedicated '''Save''' button.


===Téléversement des CGV===
===Uploading the GSC===


Dans le bloc dédié, sélectionnez votre fichier PDF de conditions générales de vente et envoyez-le. Il apparaîtra ensuite dans une liste déroulante près du bouton '''Générer''' de la fiche facture, et peut être présélectionné par défaut.
In the dedicated block, select your general sales conditions PDF file and send it. It will then appear in a dropdown list next to the '''Generate''' button of the invoice card, and can be preselected by default.


===Mise en service de la signature électronique===
===Setting up the electronic signature===


Dans le bloc '''Certificat de signature''', en bas de la page Options<span> </span>:
In the '''Signing certificate''' block, at the bottom of the Options page<span> </span>:


#'''Téléversez''' votre fichier certificat (<code>.pem</code>, <code>.crt</code>, <code>.p12</code> ou <code>.pfx</code>) contenant le certificat et la clé privée.
#'''Upload''' your certificate file (<code>.pem</code>, <code>.crt</code>, <code>.p12</code> or <code>.pfx</code>) containing both the certificate and the private key.
#'''Renseignez le motif''' de la signature (texte libre visible dans les propriétés de signature du PDF, par exemple "Facture certifiée conforme").
#'''Enter the reason''' for the signature (free text shown in the PDF signature properties, for instance "Invoice certified true").
#'''Renseignez le mot de passe''' de la clé privée si elle est protégée, puis enregistrez.
#'''Enter the password''' of the private key if it is protected, then save.
#'''Activez''' l'interrupteur "Signer électroniquement le PDF de facture".
#'''Turn on''' the "Electronically sign the invoice PDF" switch.
#'''Générez une facture''' et ouvrez-la dans Acrobat Reader<span> </span>: le panneau ''Signatures'' doit afficher la signature et le cadre visible apparaît en bas à droite de la dernière page.
#'''Generate an invoice''' and open it in Acrobat Reader<span> </span>: the ''Signatures'' panel must show the signature and the visible box appears at the bottom right of the last page.


Un seul certificat à la fois est pris en compte<span> </span>: supprimez l'ancien avant d'en téléverser un nouveau.
Only one certificate at a time is taken into account<span> </span>: delete the old one before uploading a new one.


Pour '''tester''', un certificat auto-signé suffit<span> </span>:
For '''testing''', a self-signed certificate is enough<span> </span>:


<code>openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout signature.key -out signature.crt</code>
<code>openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout signature.key -out signature.crt</code>
Line 173: Line 173:
<code>cat signature.crt signature.key > signature.pem</code>
<code>cat signature.crt signature.key > signature.pem</code>


Acrobat affichera alors la signature comme "présente mais non fiable"<span> </span>: c'est normal, l'autorité n'étant pas reconnue. En production, utilisez un certificat délivré par une autorité de certification.
Acrobat will then display the signature as "present but not trusted"<span> </span>: this is expected, since the authority is not recognised. In production, use a certificate issued by a certification authority.


'''À savoir avant de déployer'''<span> </span>: le mot de passe de la clé privée est stocké en clair dans la table des constantes de Dolibarr, faute de coffre-fort de secrets natif. Restreignez l'accès à la base et aux sauvegardes en conséquence, et appliquez des droits fichiers stricts sur le répertoire de stockage du certificat.
'''To know before deploying'''<span> </span>: the private key password is stored in clear text in the Dolibarr constants table, as there is no native secret vault. Restrict access to the database and to backups accordingly, and apply strict file permissions on the certificate storage directory.


==Onglet Factures==
==Invoices tab==


Cette page regroupe les réglages propres au contenu de la facture<span> </span>: adresses, codes-barres et QR-codes, projet lié, en-tête et mise en page, colonnes de lignes, signatures imprimées, fusion de PDF et réglages spécifiques aux factures (expéditions liées, facture de situation, lien de paiement en ligne, encours client, montant en toutes lettres...).
This page gathers the settings specific to the invoice content<span> </span>: addresses, barcodes and QR codes, linked project, header and layout, line columns, printed signatures, PDF merging and invoice specific settings (linked shipments, situation invoice, online payment link, customer outstanding amount, amount in words...).


[[File:slide_04_invoice.png|800px]]
[[File:slide_04_invoice.png|800px]]


==Onglet Guide d'utilisation==
==User guide tab==


Affiche le guide complet du module dans la langue de l'interface (français ou anglais). C'est la documentation de référence, plus détaillée que cette page.
Displays the complete module guide in the language of the interface (French or English). It is the reference documentation, more detailed than this page.


[[File:slide_05_invoice.png|800px]]
[[File:slide_05_invoice.png|800px]]


''[[#Sommaire|⬆ Retour au sommaire]]''
''[[#Summary|⬆ Back to summary]]''


=Utilisation=
=Usage=


  - Ouvrez la fiche de la '''facture''', puis, dans le bloc '''Documents''' en bas de fiche, choisissez le modèle '''<code>ultimate_invoice</code>''' dans la liste déroulante "Modèles" et cliquez sur '''Générer'''.
  - Open the '''invoice''' card, then, in the '''Documents''' block at the bottom of the card, choose the '''<code>ultimate_invoice</code>''' template in the "Models" dropdown list and click on '''Generate'''.


  - Le PDF apparaît dans la liste des fichiers joints<span> </span>: il peut être téléchargé, prévisualisé ou envoyé par e-mail.
  - The PDF appears in the list of attached files<span> </span>: it can be downloaded, previewed or sent by e-mail.


  - '''Changer de Design rapidement'''<span> </span>: utilisez le sélecteur dédié dans le menu en haut à droite de l'application, sans repasser par la configuration complète.
  - '''Switch Design quickly'''<span> </span>: use the dedicated selector in the menu at the top right of the application, without going back to the full setup.


  - '''Ajouter les CGV'''<span> </span>: sélectionnez le fichier CGV dans la liste déroulante située près du bouton Générer.
  - '''Append the GSC'''<span> </span>: select the GSC file in the dropdown list next to the Generate button.


  - '''Fusionner un PDF annexe'''<span> </span>: après activation de l'option sur la page ''Factures'', sélectionnez le ou les fichiers à fusionner depuis la fiche de la facture. Sur ces factures, la signature électronique est automatiquement ignorée.
  - '''Merge an additional PDF'''<span> </span>: once the option is enabled on the ''Invoices'' page, select the file(s) to merge from the invoice card. On those invoices, the electronic signature is automatically skipped.


==Dépannage==
==Troubleshooting==


{| class="wikitable"
{| class="wikitable"
! Symptôme !! Cause probable
! Symptom !! Likely cause
|-
|-
| Le modèle <code>ultimate_invoice</code> n'apparaît pas dans la liste || Le module UltimateInvoice ou le module ''Factures'' n'est pas activé
| The <code>ultimate_invoice</code> template is missing from the list || The UltimateInvoice module or the ''Invoices'' module is not enabled
|-
|-
| Le document ne reflète pas les modifications d'un Design || Ce Design n'est pas celui qui porte le badge "Défaut"
| The document does not reflect the changes made to a Design || This Design is not the one carrying the "Default" badge
|-
|-
| Aucune signature ni cadre visible sur le PDF || Aucun certificat téléversé, ou extension non reconnue
| No signature and no visible box on the PDF || No certificate uploaded, or unrecognised extension
|-
|-
| Journal<span> </span>: ''skipped: additional files merging is active'' || Des fichiers additionnels sont fusionnés à cette facture, les deux fonctions s'excluent
| Log<span> </span>: ''skipped: additional files merging is active'' || Additional files are merged into this invoice, both features are mutually exclusive
|-
|-
| Acrobat affiche "signature non valide" || Certificat auto-signé<span> </span>: normal en test, utilisez un certificat d'une autorité reconnue en production
| Acrobat shows "signature not valid" || Self-signed certificate<span> </span>: expected while testing, use a certificate from a recognised authority in production
|-
|-
| Journal<span> </span>: ''Error getting private key'' || Mot de passe de la clé privée absent ou erroné, ou fichier sans clé privée
| Log<span> </span>: ''Error getting private key'' || Private key password missing or wrong, or file without the private key
|-
|-
| Le bulletin de versement suisse n'apparaît pas || Voir les messages <code>SwissQr*</code> dans le journal Dolibarr<span> </span>: mode de règlement autre que le virement, adresse ou IBAN non conformes, QR-IBAN non géré
| The Swiss payment slip does not show up || See the <code>SwissQr*</code> messages in the Dolibarr log<span> </span>: payment mode other than bank transfer, non compliant address or IBAN, QR-IBAN not supported
|}
|}


Le journal Dolibarr ('''Accueil - Configuration - Autres - Journaux''') trace chaque génération et chaque tentative de signature.
The Dolibarr log ('''Home - Setup - Other - Logs''') traces every generation and every signature attempt.


''[[#Sommaire|⬆ Retour au sommaire]]''
''[[#Summary|⬆ Back to summary]]''

Revision as of 12:47, 28 July 2026

Summary

Informations


Module name UltimateInvoice
Editor / Editeur Logo atoonet.jpg
Download or buy page / Page achat ou téléchargement External module - www.dolistore.com
Status / Statut / Estado Stable
Prerequisites / Prérequis Invoices module enabled - PHP 7.4 minimum

Dolibarr min version: See on Dolistore    Dolibarr max version: See on Dolistore

Last update date / Date mise à jour fiche / Fecha última actualización 2026-07-28
Note / Nota ⬆ Back to summary

Features

UltimateInvoice replaces the native Dolibarr PDF template for invoices with a fully customisable template named ultimate_invoice. A true Swiss army knife for PDF invoices, it lets you define your own graphic identity (logo, colours, margins, page background, column widths), choose exactly what is printed on the document, append your GSC or additional PDF files, add barcodes and QR codes, and digitally sign the generated file.

UltimateInvoice is the lightweight edition of the UltimatePDF module: it covers invoices only. For proposals, orders, contracts, shipments, expense reports, interventions, projects, products/BOMs or supplier documents, the full UltimatePDF edition is required.

Two levels of configuration

The module is built around two notions that should not be confused :

  • The Design (Models tab) defines what the document looks like : colours, margins, logo, company alias, page background, column widths. Several Designs can coexist, only one is active by default (ULTIMATE_DESIGN constant), and a selector at the top right of the application lets you switch instantly.
  • The Options and Invoices pages decide what is shown on the document : visible columns, address blocks, legal mentions, printed signatures, and so on. They do not affect the graphic design.

Graphic customisation (Designs)

  • Page background : background image or background PDF (pre-designed letterhead), with transparency and X/Y positioning.
  • Header : logo height and width, second logo (partner, certification), sender block width with drag-and-drop preview and a French postal standard window envelope preset.
  • Company alias : prints a company name, address, share capital or VAT number different from the actual legal entity — useful for a trade name or a subsidiary.
  • Margins and columns : PDF margins and the width of each column of the lines table (reference, image, date, type, project, VAT, unit price, quantity, unit, discount), each one resizable with the mouse on a graphic preview.
  • Footer : font size, height reserved for free text, text and background colours.
  • Font : document font selection (DejaVuSans for extended or Cyrillic character sets).

Every block of the form has its own Save button : you validate block by block without losing your input in the others.

Invoice content

  • Line columns : numbering, product photo, unit price excl. tax, discount, unit price after discount, quantity, weight and total weight, unit.
  • Address blocks : recipient, customer and sales representative details, professional IDs (company registration numbers...), intra-community VAT number, vertical stacking of contact blocks.
  • Layout : header not repeated on every page, folding mark, text next to the date, paper format.
  • Invoice specific : linked shipments, payment terms, situation invoice, online payment link, customer outstanding amount, amount in words, total incl. tax line, generation without the VAT column.
  • Printed signatures : manager signature on the document and sales representative signature in the note. These are images added to the PDF, not to be confused with the cryptographic signature described below.

PDF merging and GSC

  • GSC : a general sales conditions PDF file is uploaded from the Options page and appended to the invoice, with an optional default preselection.
  • Additional files : once the matching option is enabled on the Invoices page, one or several arbitrary PDF files can be merged into the document straight from the invoice card.

Electronic signature of invoices (PAdES)

UltimateInvoice can apply a digital signature to the PDF as it is generated. It guarantees authenticity to the recipient (the document really comes from you) and integrity (it has not been modified since). Adobe Acrobat Reader shows it in its Signatures panel, and a visible signature box is drawn at the bottom right of the last page.

Aspect Detail
What the feature does Detached PKCS#7 cryptographic signature, equivalent to PAdES-B-B, natively embedded in the PDF, with a visible and clickable box
What it does not do No qualified timestamp (RFC 3161), no LTV/long-term archiving, no qualified eIDAS legal value
What it does not replace Neither electronic invoicing (Factur-X / PDF-A3), nor a qualified signature issued by a trust service provider

Accepted certificate formats : .pem, .crt, .p12, .pfx. The file must contain both the certificate and the private key. It is stored in the Dolibarr documents directory, outside the module web folder : it therefore cannot be downloaded from a browser.

Important limitation : merging additional files rewrites the PDF after it has been generated, which would break the signature. On an invoice where files are merged, the signature is therefore automatically skipped (a warning is written to the Dolibarr log) rather than produced invalid. GSC merging, on the other hand, remains compatible.

Barcodes, QR codes and Swiss QR-bill

  • Barcodes for products (EAN13 with check digit, CODE128, CODE39) and for third parties, at the top or at the bottom of the page.
  • QR codes for the company (MyCompany), the third party, or the invoice.
  • SEPA payment QR code (EPC069-12 standard) and Swiss QR-bill, including the full payment slip on a dedicated page. Please note : both settings belong to the Dolibarr core (Home - Setup - PDF - Specific parameters tab, Invoices section) and not to the module, which simply honours them when generating the document.

For the full Swiss payment slip, the payment mode must be bank transfer, a bank account must be set on the invoice, your company address must be complete and the IBAN valid (QR-IBANs are not supported yet). The electronic signature box is deliberately drawn on the last page of the invoice, before the slip is appended, since the slip layout is normative.

Compatibility with the Milestone module

UltimateInvoice recognises the milestone lines of the Milestone module (product_type = 9) : they are not handled as regular product lines when computing the line weight and the unit price after discount, and they keep their own formatting in the PDF.

Built-in user guide

A complete guide, in French and in English, can be read directly from the module setup, User guide tab. It is updated with every release and details every option.

⬆ Back to summary

Prerequisites

Dolibarr : Supported versions :

  • 23.x
  • 24.x

PHP : version 7.4 minimum. The full Swiss payment slip on a dedicated page requires PHP 8.1 or later.

Dolibarr modules : the Invoices module must be enabled.

⚙️ Installation procedure

⚙️ Manual installation

  1. Download the module archive file (.zip).
  2. Put the file into the Dolibarr root directory.
  3. Unzip the file with the command :

unzip module_ultimateinvoice-X.0.0.zip

  1. Check that the correct module location is :

htdocs/custom/ultimateinvoice

  1. The module is now available and can be enabled from Dolibarr.

⬆ Back to summary

Setup

To use this module, you must first enable it. To do so, once logged in with an administrator account, go to the "Home - Setup - Modules" page. The module appears in the "Atoo-Net" tab, click on "Enable". An icon appears at the end of the module line, click on it to reach the setup pages specific to this module.

All the administration pages of the module are protected by the ultimateinvoice -> config permission : only users holding this permission (usually administrators) can access them. Other users simply see the ultimate_invoice template appear in the "Models" dropdown list of the invoice card.

The setup consists of five tabs : Models, Options, Invoices, User guide and About.

Models tab (Designs)

This is where you build the graphic identity shared by all your documents.

Slide 01 invoice.png

- The list shows every existing Design : label, description, border type, colours, status and a "Default" badge for the one currently in use.
- Click on Add a design to create a new one, or on the pencil to edit an existing design.

Slide 02 invoice.png

- Fill in block by block : template information and font, page background, header and logos, company alias, central block, margins and column widths, footer. Each block has its own Save button.
- A disabled Design no longer appears in selection lists. The "Master template" and the default Design cannot be deleted, so that document generation can never be broken.

Important : after modifying a Design, if the generated document does not seem to have changed, check that this Design is the one carrying the "Default" badge.

Options tab (global settings)

These settings apply to every document, whatever the chosen Design : logos, address blocks and professional IDs, page background, line content, GSC, bank details, signing certificate, paper format.

Slide 03 invoice.png

Most settings are on/off switches applied immediately ; the paper format and the professional IDs are validated with a dedicated Save button.

Uploading the GSC

In the dedicated block, select your general sales conditions PDF file and send it. It will then appear in a dropdown list next to the Generate button of the invoice card, and can be preselected by default.

Setting up the electronic signature

In the Signing certificate block, at the bottom of the Options page :

  1. Upload your certificate file (.pem, .crt, .p12 or .pfx) containing both the certificate and the private key.
  2. Enter the reason for the signature (free text shown in the PDF signature properties, for instance "Invoice certified true").
  3. Enter the password of the private key if it is protected, then save.
  4. Turn on the "Electronically sign the invoice PDF" switch.
  5. Generate an invoice and open it in Acrobat Reader : the Signatures panel must show the signature and the visible box appears at the bottom right of the last page.

Only one certificate at a time is taken into account : delete the old one before uploading a new one.

For testing, a self-signed certificate is enough :

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout signature.key -out signature.crt

cat signature.crt signature.key > signature.pem

Acrobat will then display the signature as "present but not trusted" : this is expected, since the authority is not recognised. In production, use a certificate issued by a certification authority.

To know before deploying : the private key password is stored in clear text in the Dolibarr constants table, as there is no native secret vault. Restrict access to the database and to backups accordingly, and apply strict file permissions on the certificate storage directory.

Invoices tab

This page gathers the settings specific to the invoice content : addresses, barcodes and QR codes, linked project, header and layout, line columns, printed signatures, PDF merging and invoice specific settings (linked shipments, situation invoice, online payment link, customer outstanding amount, amount in words...).

Slide 04 invoice.png

User guide tab

Displays the complete module guide in the language of the interface (French or English). It is the reference documentation, more detailed than this page.

Slide 05 invoice.png

⬆ Back to summary

Usage

- Open the invoice card, then, in the Documents block at the bottom of the card, choose the ultimate_invoice template in the "Models" dropdown list and click on Generate.
- The PDF appears in the list of attached files : it can be downloaded, previewed or sent by e-mail.
- Switch Design quickly : use the dedicated selector in the menu at the top right of the application, without going back to the full setup.
- Append the GSC : select the GSC file in the dropdown list next to the Generate button.
- Merge an additional PDF : once the option is enabled on the Invoices page, select the file(s) to merge from the invoice card. On those invoices, the electronic signature is automatically skipped.

Troubleshooting

Symptom Likely cause
The ultimate_invoice template is missing from the list The UltimateInvoice module or the Invoices module is not enabled
The document does not reflect the changes made to a Design This Design is not the one carrying the "Default" badge
No signature and no visible box on the PDF No certificate uploaded, or unrecognised extension
Log : skipped: additional files merging is active Additional files are merged into this invoice, both features are mutually exclusive
Acrobat shows "signature not valid" Self-signed certificate : expected while testing, use a certificate from a recognised authority in production
Log : Error getting private key Private key password missing or wrong, or file without the private key
The Swiss payment slip does not show up See the SwissQr* messages in the Dolibarr log : payment mode other than bank transfer, non compliant address or IBAN, QR-IBAN not supported

The Dolibarr log (Home - Setup - Other - Logs) traces every generation and every signature attempt.

⬆ Back to summary