update invoice template
This commit is contained in:
parent
9ac724b207
commit
7db5a8b9ef
1 changed files with 240 additions and 237 deletions
|
|
@ -3,257 +3,260 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title><?php _trans('invoice'); ?></title>
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/default/css/style.css">
|
||||
<style>
|
||||
body {
|
||||
color: #555;
|
||||
font-size: 1em;
|
||||
font-family: Arial, Verdana, sans-serif;
|
||||
}
|
||||
table {
|
||||
width:100%;
|
||||
border-spacing:0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.text-right {
|
||||
text-align: right;
|
||||
}
|
||||
.text-left {
|
||||
text-align: left;
|
||||
}
|
||||
.color-l { color: #aaa; }
|
||||
.color-n { color: #888; }
|
||||
.color-d { color: #555; }
|
||||
.border-bottom-l {
|
||||
border-bottom-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #aaa;
|
||||
}
|
||||
.border-bottom-n {
|
||||
border-bottom-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #888;
|
||||
}
|
||||
.border-bottom-d {
|
||||
border-bottom-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #555;
|
||||
}
|
||||
.border-top-l {
|
||||
border-top-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #aaa;
|
||||
}
|
||||
.border-top-n {
|
||||
border-top-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #888;
|
||||
}
|
||||
.border-top-d {
|
||||
border-top-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #555;
|
||||
}
|
||||
.background-l { background-color: #eee; }
|
||||
header table {
|
||||
width:100%;
|
||||
padding: 0;
|
||||
}
|
||||
.company-details,
|
||||
.company-details h3,
|
||||
.company-details p,
|
||||
.invoice-details {
|
||||
text-align: right;
|
||||
}
|
||||
.company-name,
|
||||
.invoice-id {
|
||||
color: #333 !important;
|
||||
}
|
||||
.invoice-details td {
|
||||
padding: 0.2em 0.3em;
|
||||
}
|
||||
.invoice-items td,
|
||||
.invoice-items th {
|
||||
padding: 0.2em 0.4em 0.4em;
|
||||
}
|
||||
.seperator {
|
||||
height: 25px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.amount-summary {
|
||||
margin-right: -5px;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet"
|
||||
href="<?php echo base_url(); ?>assets/<?php echo get_setting('system_theme', 'invoiceplane'); ?>/css/templates.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/core/css/custom-pdf.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:70%">
|
||||
<div style="display: block; height: 2cm"></div>
|
||||
<div class="invoice-to">
|
||||
<p><b><?php echo lang('bill_to'); ?>:</b></p>
|
||||
<p><?php echo $custom_fields['client']['anrede'] ?><br/>
|
||||
<?php echo $invoice->client_name; ?><br/>
|
||||
<?php if ($invoice->client_address_1) {
|
||||
echo $invoice->client_address_1 . '<br/>';
|
||||
} ?>
|
||||
<?php if ($invoice->client_address_2) {
|
||||
echo $invoice->client_address_2 . '<br/>';
|
||||
} ?>
|
||||
<?php if ($invoice->client_zip) {
|
||||
echo $invoice->client_zip . ' ';
|
||||
} ?>
|
||||
<?php if ($invoice->client_city) {
|
||||
echo $invoice->client_city . '<br/><br/>';
|
||||
} ?>
|
||||
<?php if ($invoice->client_phone) { ?>
|
||||
<abbr>Tel: </abbr><?php echo $invoice->client_phone; ?><br/>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right" style="width:30%;">
|
||||
<div class="company-details">
|
||||
<?php echo invoice_logo_pdf(); ?>
|
||||
<?php echo $invoice->user_name; ?>
|
||||
<p class="text-right">
|
||||
<?php if ($invoice->user_address_1) {
|
||||
echo $invoice->user_address_1 . '<br/>';
|
||||
}?>
|
||||
<?php if ($invoice->user_address_2) {
|
||||
echo $invoice->user_address_2 . '<br/>';
|
||||
} ?>
|
||||
<?php if ($invoice->user_zip) {
|
||||
echo $invoice->user_zip . ' ';
|
||||
} ?>
|
||||
<header class="clearfix">
|
||||
|
||||
<?php if ($invoice->user_city) {
|
||||
echo $invoice->user_city . '<br/><br/>';
|
||||
} ?>
|
||||
<div id="logo">
|
||||
<?php echo invoice_logo_pdf(); ?>
|
||||
</div>
|
||||
|
||||
<?php if ($invoice->user_tax_code) {
|
||||
echo '<div>' . trans('tax_code_short') . ': ' . $invoice->user_tax_code . '</div>';
|
||||
<div id="client">
|
||||
<b><?php echo lang('bill_to'); ?></b>:
|
||||
<?php if ($custom_fields['client']['anrede']) {
|
||||
echo '<div>' . $custom_fields['client']['anrede'] . '</div>';
|
||||
} ?>
|
||||
<div>
|
||||
<?php _htmlsc(format_client($invoice)); ?>
|
||||
</div>
|
||||
<?php if ($invoice->client_vat_id) {
|
||||
echo '<div>' . trans('vat_id_short') . ': ' . $invoice->client_vat_id . '</div>';
|
||||
}
|
||||
if ($invoice->client_tax_code) {
|
||||
echo '<div>' . trans('tax_code_short') . ': ' . $invoice->client_tax_code . '</div>';
|
||||
}
|
||||
if ($invoice->client_address_1) {
|
||||
echo '<div>' . htmlsc($invoice->client_address_1) . '</div>';
|
||||
}
|
||||
if ($invoice->client_address_2) {
|
||||
echo '<div>' . htmlsc($invoice->client_address_2) . '</div>';
|
||||
}
|
||||
if ($invoice->client_city || $invoice->client_state || $invoice->client_zip) {
|
||||
echo '<div>';
|
||||
if ($invoice->client_city) {
|
||||
echo htmlsc($invoice->client_city) . ' ';
|
||||
}
|
||||
if ($invoice->client_state) {
|
||||
echo htmlsc($invoice->client_state) . ' ';
|
||||
}
|
||||
if ($invoice->client_zip) {
|
||||
echo htmlsc($invoice->client_zip);
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
if ($invoice->client_country) {
|
||||
echo '<div>' . get_country_name(trans('cldr'), $invoice->client_country) . '</div>';
|
||||
}
|
||||
|
||||
echo '<br/>';
|
||||
|
||||
if ($invoice->client_phone) {
|
||||
echo '<div>' . trans('phone_abbr') . ': ' . htmlsc($invoice->client_phone) . '</div>';
|
||||
} ?>
|
||||
|
||||
<?php if ($invoice->user_phone) {
|
||||
?><abbr>Tel: </abbr><?php echo $invoice->user_phone; ?><br><?php
|
||||
} ?>
|
||||
</p>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="invoice-details">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-right color-n">
|
||||
<?php echo lang('invoice_date'); ?>:
|
||||
</td>
|
||||
<td class="text-right color-n">
|
||||
<?php echo date_from_mysql($invoice->invoice_date_created, TRUE); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-right color-n">
|
||||
<?php echo lang('due_date'); ?>:
|
||||
</td>
|
||||
<td class="text-right color-n">
|
||||
<?php echo date_from_mysql($invoice->invoice_date_due, TRUE); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-right color-n">
|
||||
<?php echo lang('amount_due'); ?>:
|
||||
</td>
|
||||
<td class="text-right color-n">
|
||||
<?php echo format_currency($invoice->invoice_balance); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id="company">
|
||||
<div><?php _htmlsc($invoice->user_name); ?></div>
|
||||
<?php if ($invoice->user_address_1) {
|
||||
echo '<div>' . htmlsc($invoice->user_address_1) . '</div>';
|
||||
}
|
||||
if ($invoice->user_address_2) {
|
||||
echo '<div>' . htmlsc($invoice->user_address_2) . '</div>';
|
||||
}
|
||||
if ($invoice->user_city || $invoice->user_state || $invoice->user_zip) {
|
||||
echo '<div>';
|
||||
if ($invoice->user_city) {
|
||||
echo htmlsc($invoice->user_city) . ' ';
|
||||
}
|
||||
if ($invoice->user_state) {
|
||||
echo htmlsc($invoice->user_state) . ' ';
|
||||
}
|
||||
if ($invoice->user_zip) {
|
||||
echo htmlsc($invoice->user_zip);
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
if ($invoice->user_country) {
|
||||
echo '<div>' . get_country_name(trans('cldr'), $invoice->user_country) . '</div>';
|
||||
}
|
||||
|
||||
echo '<br/>';
|
||||
|
||||
if ($invoice->user_vat_id) {
|
||||
echo '<div>' . trans('vat_id_short') . ': ' . $invoice->user_vat_id . '</div>';
|
||||
}
|
||||
if ($invoice->user_tax_code) {
|
||||
echo '<div>' . trans('tax_code_short') . ': ' . $invoice->user_tax_code . '</div>';
|
||||
}
|
||||
|
||||
echo '<br/>';
|
||||
|
||||
if ($invoice->user_phone) {
|
||||
echo '<div>' . trans('phone_abbr') . ': ' . htmlsc($invoice->user_phone) . '</div>';
|
||||
}
|
||||
if ($invoice->user_fax) {
|
||||
echo '<div>' . trans('fax_abbr') . ': ' . htmlsc($invoice->user_fax) . '</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
|
||||
<br/>
|
||||
<h2 class="invoice-id"><?php echo lang('invoice'); ?> Nr. <?php echo $invoice->invoice_number; ?></h2>
|
||||
Leistungszeitraum: <?php echo $custom_fields['invoice']['leistung_von'] ?> bis <?php echo $custom_fields['invoice']['leistung_bis'] ?><br/>
|
||||
Leistungsort: <?php echo $custom_fields['invoice']['leistung_ort'] ?><br/>
|
||||
<br/>
|
||||
|
||||
<div class="invoice-items">
|
||||
<table class="table table-striped" style="width: 100%;">
|
||||
<thead>
|
||||
<tr class="border-bottom-d">
|
||||
<th class="color-d"><?php echo lang('item'); ?></th>
|
||||
<th class="color-d text-left"><?php echo lang('description'); ?></th>
|
||||
<th class="text-right color-d">Menge</th>
|
||||
<th class="text-right color-d">EP</th>
|
||||
<th class="text-right color-d">Gesamt</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$linecounter = 0;
|
||||
foreach ($items as $item) { ?>
|
||||
<tr class="<?php echo ($linecounter % 2 ? 'background-l' : '')?>">
|
||||
<td><?php echo $item->item_name; ?></td>
|
||||
<td><?php echo nl2br($item->item_description); ?></td>
|
||||
<td class="text-right">
|
||||
<?php echo format_amount($item->item_quantity); ?>
|
||||
<?php if ($item->item_product_unit) : ?>
|
||||
<small><?php _htmlsc($item->item_product_unit); ?></small>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?php echo format_currency($item->item_price); ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?php echo format_currency($item->item_subtotal); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $linecounter++; ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br/>
|
||||
<div class="invoice-details clearfix">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="text-right">
|
||||
<table class="amount-summary" style="width: 40%;">
|
||||
<tr>
|
||||
<td class="text-right color-n">
|
||||
Nettosumme:
|
||||
</td>
|
||||
<td class="text-right color-n">
|
||||
<?php echo format_currency($invoice->invoice_item_subtotal); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-right color-n">
|
||||
0% MwSt:
|
||||
</td>
|
||||
<td class="text-right color-n">
|
||||
0,00 €
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="border-bottom-width: 1px; border-style: solid;">
|
||||
<td class="text-right color-d">
|
||||
<b>Gesamtbetrag:</b>
|
||||
</td>
|
||||
<td class="text-right color-d">
|
||||
<b><?php echo format_currency($invoice->invoice_balance) ?></b>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td><?php echo trans('invoice_date') . ':'; ?></td>
|
||||
<td><?php echo date_from_mysql($invoice->invoice_date_created, true); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo trans('due_date') . ': '; ?></td>
|
||||
<td><?php echo date_from_mysql($invoice->invoice_date_due, true); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo trans('amount_due') . ': '; ?></td>
|
||||
<td><?php echo format_currency($invoice->invoice_balance); ?></td>
|
||||
</tr>
|
||||
<?php if ($payment_method): ?>
|
||||
<tr>
|
||||
<td><?php echo trans('payment_method') . ': '; ?></td>
|
||||
<td><?php _htmlsc($payment_method->payment_method_name); ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h1 class="invoice-title"><?php echo trans('invoice') . ' ' . $invoice->invoice_number; ?></h1>
|
||||
|
||||
<?php
|
||||
$leistungsort = $custom_fields['invoice']['leistung_ort'];
|
||||
$leistung_von = $custom_fields['invoice']['leistung_von'];
|
||||
$leistung_bis = $custom_fields['invoice']['leistung_bis'];
|
||||
if ($leistung_von && $leistung_bis) {
|
||||
echo '<div>Leistungszeitraum: ' . $leistung_von . ' bis ' . $leistung_bis . '</div>';
|
||||
}
|
||||
if ($leistungsort) {
|
||||
echo '<div>Leistungsort: ' . $leistungsort . '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<table class="item-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item-name"><?php _trans('item'); ?></th>
|
||||
<th class="item-desc"><?php _trans('description'); ?></th>
|
||||
<th class="item-amount text-right"><?php _trans('qty'); ?></th>
|
||||
<th class="item-price text-right"><?php _trans('price'); ?></th>
|
||||
<?php if ($show_item_discounts) : ?>
|
||||
<th class="item-discount text-right"><?php _trans('discount'); ?></th>
|
||||
<?php endif; ?>
|
||||
<th class="item-total text-right"><?php _trans('total'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
foreach ($items as $item) { ?>
|
||||
<tr>
|
||||
<td><?php _htmlsc($item->item_name); ?></td>
|
||||
<td><?php echo nl2br(htmlsc($item->item_description)); ?></td>
|
||||
<td class="text-right">
|
||||
<?php echo format_amount($item->item_quantity); ?>
|
||||
<?php if ($item->item_product_unit) : ?>
|
||||
<br>
|
||||
<small><?php _htmlsc($item->item_product_unit); ?></small>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?php echo format_currency($item->item_price); ?>
|
||||
</td>
|
||||
<?php if ($show_item_discounts) : ?>
|
||||
<td class="text-right">
|
||||
<?php echo format_currency($item->item_discount); ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="text-right">
|
||||
<?php echo format_currency($item->item_total); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
<tbody class="invoice-sums">
|
||||
|
||||
<tr>
|
||||
<td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
|
||||
Nettosumme
|
||||
</td>
|
||||
<td class="text-right"><?php echo format_currency($invoice->invoice_item_subtotal); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php if ($invoice->invoice_item_tax_total > 0) { ?>
|
||||
<tr>
|
||||
<td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
|
||||
<?php _trans('item_tax'); ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?php echo format_currency($invoice->invoice_item_tax_total); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<?php foreach ($invoice_tax_rates as $invoice_tax_rate) : ?>
|
||||
<tr>
|
||||
<td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
|
||||
<?php echo htmlsc($invoice_tax_rate->invoice_tax_rate_name) . ' (' . format_amount($invoice_tax_rate->invoice_tax_rate_percent) . '%)'; ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?php echo format_currency($invoice_tax_rate->invoice_tax_rate_amount); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
|
||||
<?php if ($invoice->invoice_discount_percent != '0.00') : ?>
|
||||
<tr>
|
||||
<td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
|
||||
<?php _trans('discount'); ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?php echo format_amount($invoice->invoice_discount_percent); ?>%
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if ($invoice->invoice_discount_amount != '0.00') : ?>
|
||||
<tr>
|
||||
<td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
|
||||
<?php _trans('discount'); ?>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<?php echo format_currency($invoice->invoice_discount_amount); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<tr>
|
||||
<td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
|
||||
0% MwSt
|
||||
</td>
|
||||
<td class="text-right">
|
||||
0,00€
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
|
||||
<b>Gesamtbetrag</b>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<b><?php echo format_currency($invoice->invoice_balance); ?></b>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue