Expense reports

Receipts in expense reports

dolixjustif · version 1.0.0

The expense report PDF also contains its receipts, photos and PDFs, page by page: one single document to hand over.

Price
€49 excl. VAT
Dolibarr
19.0 minimum
Version
1.0.0
Licence
GPL v3+
Languages
French, English, German

€49 excl. VAT.

Ordering, payment, invoicing and download are handled by the DoliStore.

Buy on the DoliStore — €49 excl. VAT
The expense report PDF ER2610-0001, followed by its three receipts in line order: train ticket and hotel invoice as PDFs, photo of the restaurant receipt. Each page carries its marker, here in French: “Justificatif — ER2610-0001 — ligne 1 · 07/10/2026 · 68,00 € — billet_train.pdf” (Receipt — report — line, date, amount — file name).
The expense report PDF ER2610-0001, followed by its three receipts in line order: train ticket and hotel invoice as PDFs, photo of the restaurant receipt. Each page carries its marker, here in French: “Justificatif — ER2610-0001 — ligne 1 · 07/10/2026 · 68,00 € — billet_train.pdf” (Receipt — report — line, date, amount — file name). Screenshot of the French-language interface.
01

What the module does

  • Fixed order: first the receipts attached to the lines, in line order. A file attached to several lines appears only once.
  • As an option, enabled by default: the other files in the report's “Linked files” tab, except documents produced by Dolibarr.
  • JPG, PNG and GIF photos: straightened according to the EXIF orientation, read directly from the file, without the PHP “exif” extension; transparency replaced with white; image centred and fitted to the page, in portrait or landscape depending on its shape.
  • PDFs: added page by page, each page in its original format, portrait or landscape.
  • Marker at the top of each receipt page, can be switched off: “Receipt — report reference — line, date, amount incl. tax — file name”. A file not attached to a line carries the mention “not attached to a line”.
  • Check before reading: empty file, maximum size (20 MB by default, adjustable from 1 to 200 MB), format, complete PDF, non-encrypted PDF. A rejected file is listed on a last page, “Receipts not included in this document”, with the reason, and reported on screen.
  • Merging is written to a separate file. Dolibarr's PDF is only replaced if it succeeds.
  • On Dolibarr 19 to 23, the core PDF library can stop PHP on some damaged PDFs. The module then sets the file aside and displays an explanation page with a link back to the expense report, instead of a blank page. On the next generation, the file is listed as not included. The list of files set aside can be viewed and cleared in the setup page.
  • No table, no permission, no menu. The three settings are specific to each entity in multi-company.
02

Who it is for

In Dolibarr, each expense report line can be linked to a receipt, but the report PDF only contains the table of expenses. Receipts stay apart and have to be downloaded one by one.

In Dolibarr, each expense report line can be linked to a receipt. But the report PDF only contains the table of expenses. Till receipts, hotel invoices and tickets stay apart, in the “Linked files” tab, to be downloaded one by one.

To hand a complete report over to the accountant or to whoever reimburses it, you have to send the PDF, then each file, and hope nobody mixes up the order.

Who it is for: Organisations that hand their expense reports over to an accountant or a reimbursement department, and employees who photograph their receipts with their phone.

03

What the module does not do

This section appears on all 12 module pages, without exception.

  • Accepted formats: PDF, JPG, PNG and GIF. iPhone HEIC photos, Word documents and other formats are not converted: they are listed as not included.
  • A protected (encrypted) PDF is left out, even if it opens without a password. It has to be uploaded without protection.
  • Without the PHP GD extension, only JPEGs are included, without straightening.
  • In the PDF, photos are re-saved as JPEG and limited to 2,400 pixels on the longest side. An image of more than 60 million pixels is left out. The uploaded file is not changed.
  • The module does not check that each line has a receipt: a line with no attached file is not reported.
  • Only the expense report PDF is completed. The module acts at the end of generation, through the afterPDFCreation hook; it has only been tried with the core expense report template.
  • If PDF merging is disabled in Dolibarr (MAIN_DISABLE_TCPDI constant), the PDF is left as it is, with no receipt and no message.
  • A file set aside is recognised by its content: it stays left out until the list has been cleared in the setup page.
04

How it works

When Dolibarr produces an expense report PDF, the module appends the receipts after it, in a fixed order:

  1. the files attached to the lines, in line order. A file attached to several lines appears only once;
  2. as an option, enabled by default, the other files in the “Linked files” tab, except documents produced by Dolibarr.

Photos and PDFs

File What the module does
JPG photo Straightened according to the EXIF orientation recorded by the phone, read directly from the file, without the PHP “exif” extension. Centred and fitted to the page.
PNG or GIF image Transparency replaced with white, image centred and fitted to the page.
PDF Added page by page, each page in its original format, portrait or landscape.

An image wider than it is tall is placed on a landscape page. In the PDF, photos are re-saved as JPEG and limited to 2,400 pixels on the longest side. The uploaded file itself is not changed.

Other formats — iPhone HEIC photos, Word documents… — are not converted: they are listed as not included. Straightening and support for PNG and GIF require the PHP GD extension; without it, only JPEGs are included, as they are.

The marker on each page

At the top of each receipt page, one line says where it comes from (here in French):

Justificatif — ER2610-0001 — ligne 1 · 07/10/2026 · 68,00 € — billet_train.pdf

Report reference, line number, date and amount including tax of the line, file name. In English, the line reads “Receipt — … — line 1 …”. A file not attached to any line carries the mention “not attached to a line”. The marker can be switched off in the setup page.

A receipt never blocks the expense report

Each file is checked before it is read: empty file, maximum size, format, complete PDF, non-encrypted PDF. A rejected file does not prevent the report from being produced. It is listed on a last page, “Receipts not included in this document”, with the reason, and a message reports it on screen.

On Dolibarr 19 to 23, the core PDF library can stop PHP on some damaged PDFs: the user gets a blank page. The module protects against this. The faulty file is set aside, and a page explains what happened and leads back to the expense report. On the next generation, the PDF is produced normally and the file appears in it as not included.

The module does not check that each line has a receipt: a line with no attached file is not reported.

The screenshot shows the result: four pages of the same PDF, side by side.

The first one is expense report ER2610-0001 as Dolibarr produces it: three lines — a train from Strasbourg to Paris at 68.00, one hotel night at 102.65, a client lunch at 40.50 — for a total of 211.15 including tax.

Then come the three receipts, in line order: the train ticket and the hotel invoice, two PDFs, then the photo of the restaurant receipt. Each page carries its marker, whose date and amount match the report line. There is no “Receipts not included in this document” page: all three files were included.

05

Settings

SetupModules/ApplicationsReceipts in expense reports:

Setting Default Effect
Also append files not attached to a line on All files in the “Linked files” tab, except documents produced by Dolibarr.
Marker at the top of each receipt page on Report reference, line number, date and amount, file name.
Maximum size of a receipt (MB) 20 From 1 to 200. Larger files are left out and listed.

Below the settings, the list of receipts set aside after a read error. A file set aside is recognised by its content: it stays left out until the list has been cleared with the “Clear the list” button.

Settings are specific to each entity in multi-company.

06

Security and safeguards

  • The original PDF is never damaged. Merging is written to a separate file; the PDF produced by Dolibarr is only replaced if it succeeds.
  • Check before reading each receipt: size, format, complete PDF, non-encrypted PDF. An image of more than 60 million pixels is left out.
  • Files confined to the expense report’s folder: a file attached to a line is only read if it really sits in that folder.
  • No new permission. Receipts are appended for anyone who can already generate the expense report PDF.
  • Setup page restricted to administrators, and its two actions — save, clear the list — require the session’s anti-CSRF token.
07

What you get

What the module writes to your installation
Database tables createdNo table. The module folder contains no sql/ directory. On activation, the module stores three settings in Dolibarr's constants. If a receipt is set aside, a record is kept in a small file, documents/dolixjustif/quarantaine_.json, not in the database.
PermissionsThe descriptor declares rights = array(): the module adds no permission. Receipts are appended for anyone who can generate the expense report PDF. The setup page is restricted to administrators.
Uninstalling
  • Disable the module in SetupModules/Applications. PDFs generated afterwards are Dolibarr's own again.
  • PDFs already generated keep their receipts until they are generated again.
  • The three settings stay in Dolibarr's constants, and the list of files set aside stays in documents/dolixjustif/. There is no table to delete.
  • The dolixjustif folder, in readable source, under GPL v3 or later: descriptor, two classes (the end-of-PDF-generation hook and the merge), setup page, icons.
  • The translations present in langs/: French (fr_FR), English (en_US) and German (de_DE).
  • A README.md and a ChangeLog.md.

The module needs the Expense Reports module. The descriptor requires Dolibarr 19.0 and PHP 7.4 minimum; the test scenarios were run on 19.0.4, 20.0.4, 21, 22, 23.0.4 and 24.0.1.

  • No table created. The module contains no sql/ directory.
  • It changes neither the lines, nor the amounts, nor the uploaded files. It reads the list of files of the expense report; the only write is the produced PDF, completed.
  • On activation, three settings are stored in Dolibarr’s constants.
  • If a damaged PDF is set aside, a record is kept in a small file, documents/dolixjustif/quarantaine_<entity>.json, not in the database.
  • No outgoing connection: nothing is sent anywhere.
  • On deactivation, PDFs generated afterwards are Dolibarr’s own again. PDFs already generated keep their receipts until they are generated again. The three settings and the list of files set aside remain; you can delete them yourself.
08

Compatibility

The module descriptor only declares a minimum version. No upper bound is written in the code: the versions below are those on which the module has actually been run.

Compatibility of the Receipts in expense reports module
Dolibarr versionsDolibarr 19.0 minimum. Installed and run on 19.0.4, 20.0.4, 21, 22, 23.0.4 and 24.0.1.
Minimum PHP7.4
Dolibarr modules to enableExpense Reports
LicenceGPL v3 or later, full source code
LanguagesFrench, English, German
MenuNo menu entry. The module acts when the expense report PDF is generated; its settings are in SetupModules/Applications.
09

Installation

  1. Get the module from the DoliStore and download the zip file.
  2. In Dolibarr: HomeSetupModules/Applications“Deploy/install external app/module” tab, then upload the zip. Otherwise, unzip the dolixjustif folder into htdocs/custom/.
  3. Enable “Receipts in expense reports” in the list of modules. It relies on the Expense Reports module. The three settings are created with their default values.
  4. If needed, adjust in the module's setup page: files not attached to a line, marker, maximum size of a receipt.
  5. Generate the PDF of an expense report again: the receipts appear after it.

The details — permissions on the custom folder, shared hosting, upgrades, uninstalling — are on the page Installation and upgrades.

10

Frequently asked questions

Which Dolibarr versions does this module work on?

The descriptor requires Dolibarr 19.0 minimum and PHP 7.4 minimum. The test scenarios were run on 19.0.4, 20.0.4, 21, 22, 23.0.4 and 24.0.1, and installation from the zip on a fresh 24.0.1. If you have any doubt about your version, write before buying.

Does the module change my database or my files?

No. It creates no table and does not touch the lines, the amounts or the uploaded files. It reads the list of files of the expense report and only replaces the PDF produced by Dolibarr, and only if merging succeeded. The recorded tests were run on MariaDB; PostgreSQL has not been tried.

What happens if a receipt is unreadable?

It is left out, and the expense report is produced anyway. The PDF ends with a “Receipts not included in this document” page, which gives the file name and the reason: empty file, file too large, unsupported format, unreadable or damaged file, protected PDF. A message also reports it on screen.

Are photos taken with a phone the right way up?

Yes for JPEGs that carry the EXIF orientation: the module reads it directly from the file, without the PHP “exif” extension, and straightens the image. Straightening and support for PNG and GIF require the PHP GD extension. Without it, JPEGs are included as they are and PNGs and GIFs are listed as not included.

What if I uninstall?

PDFs generated afterwards are Dolibarr's own again. PDFs already generated keep their receipts until they are generated again. The three settings and the list of files set aside remain; you can delete them yourself.

Who handles support, and how do updates work?

Support is provided by the person who wrote the module, at support@dolix.fr. Ordering, payment, the invoice and the download are handled by the DoliStore, where new versions are published.

11

Version history

Taken from the module’s ChangeLog.md file: a single source.

1.0.09 October 2026

First version: the receipts attached to the lines, then, as an option, the other uploaded files, are appended to the expense report PDF. JPG, PNG and GIF photos straightened according to the EXIF orientation and fitted to the page; PDFs added page by page in their own format. Marker on each page. Check before reading; receipts left out are listed on a last page and reported on screen. Merging written separately: Dolibarr's PDF is only replaced if it succeeds. Protection against PHP being stopped by Dolibarr's PDF library (versions 19 to 23), with a list of files set aside in the setup page.

12

Support for this module

Write to support@dolix.fr. The person who wrote the module is the one who replies.

Reply within two working days. This is not an on-call service.

To include in your message

  • The exact Dolibarr version.
  • The module concerned and its version — here dolixjustif 1.0.0.
  • What you did, and what you expected.
  • The error message copied exactly, or a screenshot.
  • How Dolibarr is installed, if you know.

This module is on sale on the DoliStore.

Ordering, payment, invoicing and download are handled by the DoliStore.

Buy on the DoliStore — €49 excl. VAT
Also

The other modules