Theresa - An Alternative Expense Report PDF Document Model
WARNING:
This information and code is presented to you in good faith. Using parts of this code or file is at your own risk. This feature has been tested on Dolibarr [tt] 7.0.4 [/tt] and [tt] 8.0.2 [/tt].
What this does
Upto Dolibarr [tt] 8.0 [/tt] the ‘standard’ expense report PDF model followed the typical invoice-style layout. With Dolibarr [tt] 9.0 [/tt] a new improved layout was created for the ‘standard’ model which tackled reducing the columns and blank pages.
The ‘theresa’ model is focussed on a business expense usage, as opposed to a user expense usage. Model ‘theresa’ is based on the improved ‘standard’ model but with the following changes:
- Added payment table to PDF
- Amount paid/claimed/unpaid is only shown when unpaid
- Add PDF Description and Author *
- Only show payments on PDF if there is a payment.
- Hidden config [tt] MAIN_GENERATE_NON_SALES_DOCUMENTS_WITHOUT_VAT [/tt] to make sales doc vat different from internal docs
- Page table titles in bold and aligned
- Changed the overall text color to black for paper printing
- Highlighted date (in bold) for easier reference
- Changed the status color to a paper-friendly green
- Changed the ‘Amount in’ to italics
- Aligned columns
* Requires new translation string
What the PDF looks like
Here’s the general look…
Here’s with the payment table…
Here’s the unpaid section…
Upload the document model
EXTRACT and upload to:
/core/modules/expensereport/doc/
This file:
[hide]
pdf_theresa.modules.zip (10.5 KB)[/hide]
Add the translation text
In file:
/langs/en_US/trips.lang
Add: (around line 39)
PDFTheresaExpenseReports=Advanced template to generate a PDF document for Expense Reports more suitable for business expenses. <br>Shows the payment table if payments have been made. Amount paid/claimed/unpaid is only shown when unpaid.<br>Set <b style="background-color: rgba(27,31,35,.09); border-radius: 3px; padding: .2em .4em;">MAIN_GENERATE_NON_SALES_DOCUMENTS_WITHOUT_VAT</b> to <b style="background-color: rgba(27,31,35,.09); border-radius: 3px; padding: .2em .4em;">1</b> in <b style="background-color: rgba(27,31,35,.09); border-radius: 3px; padding: .2em .4em;">Setup > Other</b> to hide VAT details on the generated PDF.
Activate the document model
Finally in Dolibarr, go to: Home ► Setup ► Modules ► Expense Reports