Updated HTML invoice templates (#560)

This commit is contained in:
Kevin Papst
2019-02-12 15:35:33 +01:00
committed by GitHub
parent 742e6eb3a3
commit fd60d5bb17
10 changed files with 75 additions and 36 deletions

View File

@@ -31,11 +31,13 @@ If you want to adjust a setting from any of these files, use `local.yaml` (see b
- [Email configuration](emails.md) - in `swiftmailer.yaml`
- [Dashboard widgets](dashboard.md) - in `kimai.yaml`
- [Calendar](calendar.md) - in `kimai.yaml`
- [Invoices](invoices.md) - in `kimai.yaml`
## Overwriting local configs (local.yaml)
You can create the file `config/packages/local.yaml` and store your own settings inside. This file will NEVER be shipped with Kimai.
So having your custom settings in this file allows you to easily update Kimai. This is the same concept which is used for the `.env` file.
You should NOT edit the file `config/packages/kimai.yaml` directly, as it contains default settings and will be overwritten during an update.
Instead create the file `config/packages/local.yaml` and store your own settings in there. This file will NEVER be shipped with Kimai.
Having your custom settings in `local.yaml` allows you to easily update Kimai. This is the same concept which is used for the `.env` file.
An example `config/packages/local.yaml` file might look like this:

View File

@@ -55,6 +55,8 @@ Be aware of the following rules:
### Twig templates
If you are looking for a way to set the advanced contact data, see below in _Configure contact data_.
Generally speaking, you should use only the variable `model` in your template which is an instance of `App\Model\InvoiceModel`.
Please see the [default templates](https://github.com/kevinpapst/kimai2/tree/master/templates/invoice/renderer) at
@@ -193,4 +195,29 @@ kimai:
- 'var/invoices/'
```
This would disable the default documents, as Kimai will onl look in the directory `var/invoices/` for files.
This would disable the default documents, as Kimai will onl look in the directory `var/invoices/` for files.
## Configure contact data
Some HTML invoice templates need additional data, that can't be edited through the UI.
These values should be added to your `local.yaml`:
```yaml
twig:
globals:
company:
name: 'Kimai Inc.',
homepage: 'www.kimai.org',
email: 'kimai@example.com',
phone: '0123-4567890',
tax_number: 'YourTaxNumber',
signature: '/build/images/signature.png',
address: 'Kimai Inc.
Example road 42
D 12345 City
',
bank_account: '
Kimai Inc.
IBAN: DE00 0000 0000 0000 0000 00
BIC: XXXXXXXX (a bank name)
'
```