docs: add docs for custom fields, rename template

This commit is contained in:
Benjamin Yule Bädorf 2024-08-12 11:31:37 +02:00 committed by teutat3s
parent df2785f62c
commit 289362cb84
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
2 changed files with 49 additions and 41 deletions

View file

@ -8,10 +8,18 @@ This Template is adopted from the original one with some minor changes:
- Altered spacing and fields due to DIN 5008 - Altered spacing and fields due to DIN 5008
- Moved zip-code in front of city - Moved zip-code in front of city
This Template has hardcoded German text.
## Installation ## Installation
Simply add the files into `application/views/invoice_templates/pdf` and select them in Invoiceplane's *System Settings -> Invoices* as PDF templates. Simply add the files into `application/views/invoice_templates/pdf` and select them in Invoiceplane's *System Settings -> Invoices* as PDF templates.
### Extra fields
You can add a "Leistungszeitraum" for any invoice by defining the two custom date fields: `Leistungszeitraum-Anfang` and `Leistungszeitraum-Ende`. These will not be shown on the invoice if either is not set.
You can also add a description text for the full invoice by adding a text custom field called `Beschreibung`.
## Example ## Example
![Screenshot](screenshot.png) ![Screenshot](screenshot.png)

View file

@ -103,49 +103,49 @@ footer .notes {
<div id="pm-3"><hr /></div> <div id="pm-3"><hr /></div>
<div id="client"> <div id="client">
<div id="sichtfenster-absender"> <div id="sichtfenster-absender">
<?php <?php
echo htmlsc($invoice->user_name) . ' - ' . htmlsc($invoice->user_address_1) . ' - ' . htmlsc($invoice->user_zip) . ' ' . htmlsc($invoice->user_city); echo htmlsc($invoice->user_name) . ' - ' . htmlsc($invoice->user_address_1) . ' - ' . htmlsc($invoice->user_zip) . ' ' . htmlsc($invoice->user_city);
?> ?>
<hr /> <hr />
</div> </div>
<div> <div>
<b><?php _htmlsc(format_client($invoice)); ?></b> <b><?php _htmlsc(format_client($invoice)); ?></b>
</div> </div>
<?php if ($invoice->client_vat_id) { <?php if ($invoice->client_vat_id) {
echo '<div>' . trans('vat_id_short') . ': ' . $invoice->client_vat_id . '</div>'; echo '<div>' . trans('vat_id_short') . ': ' . $invoice->client_vat_id . '</div>';
} }
if ($invoice->client_tax_code) { if ($invoice->client_tax_code) {
echo '<div>' . trans('tax_code_short') . ': ' . $invoice->client_tax_code . '</div>'; echo '<div>' . trans('tax_code_short') . ': ' . $invoice->client_tax_code . '</div>';
} }
if ($invoice->client_address_1) { if ($invoice->client_address_1) {
echo '<div>' . htmlsc($invoice->client_address_1) . '</div>'; echo '<div>' . htmlsc($invoice->client_address_1) . '</div>';
} }
if ($invoice->client_address_2) { if ($invoice->client_address_2) {
echo '<div>' . htmlsc($invoice->client_address_2) . '</div>'; echo '<div>' . htmlsc($invoice->client_address_2) . '</div>';
} }
if ($invoice->client_city || $invoice->client_state || $invoice->client_zip) { if ($invoice->client_city || $invoice->client_state || $invoice->client_zip) {
echo '<div>'; echo '<div>';
if ($invoice->client_zip) { if ($invoice->client_zip) {
echo htmlsc($invoice->client_zip) . ' '; echo htmlsc($invoice->client_zip) . ' ';
} }
if ($invoice->client_city) { if ($invoice->client_city) {
echo htmlsc($invoice->client_city) . ' '; echo htmlsc($invoice->client_city) . ' ';
} }
if ($invoice->client_state) { if ($invoice->client_state) {
echo htmlsc($invoice->client_state); echo htmlsc($invoice->client_state);
} }
echo '</div>'; echo '</div>';
} }
if ($invoice->client_country) { if ($invoice->client_country) {
echo '<div>' . get_country_name(trans('cldr'), $invoice->client_country) . '</div>'; echo '<div>' . get_country_name(trans('cldr'), $invoice->client_country) . '</div>';
} }
echo '<br/>'; echo '<br/>';
if ($invoice->client_phone) { if ($invoice->client_phone) {
echo '<div>' . trans('phone_abbr') . ': ' . htmlsc($invoice->client_phone) . '</div>'; echo '<div>' . trans('phone_abbr') . ': ' . htmlsc($invoice->client_phone) . '</div>';
} ?> } ?>
</div> </div>
<header class="clearfix"> <header class="clearfix">
@ -156,7 +156,7 @@ footer .notes {
<h1 class="invoice-title"><?php echo trans('invoice'); ?></h1> <h1 class="invoice-title"><?php echo trans('invoice'); ?></h1>
<!-- client is extracted due to absolute position --> <!-- client is extracted due to absolute position -->
<div id="company"> <div id="company">
<div><b><?php _htmlsc($invoice->user_name); ?></b></div> <div><b><?php _htmlsc($invoice->user_name); ?></b></div>