160 lines
4.6 KiB
PHP
160 lines
4.6 KiB
PHP
<?php
|
|
/**
|
|
* @var string $ressourcePathPrefix
|
|
* @var WarehouseShippingNoteModel $shippingNote
|
|
* @var Array $positions
|
|
* @var Array $textElements
|
|
* @var bool $showPrices
|
|
*/
|
|
|
|
$this->setReturnValue(['filename' => $shippingNote->id . ".pdf"]);
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Lieferschein</title>
|
|
<meta charset="utf-8" />
|
|
<!-- <link href="-->
|
|
<?php //= self::getResourcePath() ?><!--assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />-->
|
|
|
|
<style>
|
|
body {
|
|
margin-top: 0;
|
|
/*padding-top: 20pt;*/
|
|
font-family: "Open Sans", sans-serif, Verdana;
|
|
font-size: 12px;
|
|
}
|
|
|
|
tr {
|
|
page-break-inside: avoid;
|
|
}
|
|
|
|
.uneven {
|
|
background-color: #ebebeb;
|
|
}
|
|
|
|
|
|
table tr td:last-child {
|
|
text-align: right;
|
|
}
|
|
|
|
.additionalRow td:first-child {
|
|
text-align: left;
|
|
padding-left: 20pt;
|
|
}
|
|
|
|
th {
|
|
height: 28px;
|
|
}
|
|
|
|
#invoiceTable tr *:nth-child(5),
|
|
#invoiceTable tr *:nth-child(4),
|
|
#invoiceTable tr *:nth-child(3) {
|
|
text-align: right;
|
|
}
|
|
|
|
#invoiceTable tr *:not(:first-child) {
|
|
padding: 4px 0;
|
|
}
|
|
|
|
#invoiceTable tr td {
|
|
font-size: 11px;
|
|
}
|
|
|
|
tr.position td {
|
|
vertical-align: top;
|
|
}
|
|
|
|
tr.position td:first-child {
|
|
vertical-align: middle !important;
|
|
padding-left: 4pt;
|
|
}
|
|
|
|
#invoiceTable tr td:first-child {
|
|
max-width: 200pt;
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
</head>
|
|
<body>
|
|
<div>
|
|
<!--
|
|
TODO: enable option for showing prices
|
|
vertauschen
|
|
Die gelieferte Ware bleibt bis zur vollständigen Bezahlung in unserem Eigentum.
|
|
-->
|
|
<h2 style="text-align: center;color: #005384">Ihr XINON Lieferschein vom <?=date("d.m.Y", $shippingNote->create)?></h2>
|
|
|
|
<p>
|
|
<?= $shippingNote->note ?>
|
|
</p>
|
|
|
|
<?php if($shippingNote->status === 'cancelled'): ?>
|
|
<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(255, 0, 0, 0.5); text-align: center; font-size: 40pt; color: white; line-height: 60pt;">STORNIERT</div>
|
|
<?php endif; ?>
|
|
|
|
<table style="border-collapse: collapse; width: 100%;" id="invoiceTable">
|
|
<tr style="font-weight: bold; border-bottom: 1px solid black;" class="uneven">
|
|
<th style="text-align: center;padding-right: 6pt">Position</th>
|
|
<th style="text-align: right;padding-right: 6pt">Menge</th>
|
|
<th style="text-align: left;padding-right: 6pt">Einheit</th>
|
|
<th style="text-align: left">Artikel</th>
|
|
<?php if($showPrices): ?>
|
|
<th style="text-align: right;padding-right: 4pt">Preis</th>
|
|
<?php endif; ?>
|
|
</tr>
|
|
<?php $i = 0; foreach($positions as $p):?>
|
|
|
|
<tr class="position <?=($i%2 == 0) ? "even" : "uneven" ?>">
|
|
<td style="text-align: center;"><?= $i + 1 ?></td>
|
|
<td style="text-align: right;padding-right: 8pt"><?=$p["amount"]?> </td>
|
|
<td style="text-align: left;padding-right: 8pt"><?=$p["articleUnit"]?> </td>
|
|
<td style="text-align: left;"><b><?=$p["articleTitle"]?></b></td>
|
|
<?php if($showPrices): ?>
|
|
<td style="text-align: right;padding-right: 8pt"><?=number_format(
|
|
$p["price"] * $p["amount"], 2, ",", ".")?> €</td>
|
|
<?php endif; ?>
|
|
</tr>
|
|
<tr class="<?=($i%2 == 0) ? "even" : "uneven" ?>">
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
|
|
<td style="text-align: left;"><?= $p["articleDescription"] ?></td>
|
|
<?php if($showPrices): ?>
|
|
<td></td>
|
|
<?php endif; ?>
|
|
</tr>
|
|
<?php $i++; endforeach;?>
|
|
</table>
|
|
|
|
<?php if($textElements !== null): ?>
|
|
<div style="margin-top: 20pt;">
|
|
<?php foreach($textElements as $textElement): ?>
|
|
<p><?=$textElement?></p>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
|
|
<?php if(isset($shippingNote->signature) && $shippingNote->signature !== ''): ?>
|
|
<div style="margin-top: 20pt;">
|
|
<img src="<?=$shippingNote->signature?>" style="width: 200pt;" alt="Unterschrift konnte nicht geladen werden"/>
|
|
<div>Unterschrieben am: <?=date("d.m.Y", strtotime($shippingNote->signatureDate))?></div>
|
|
<div>Unterschrieben von: <?=$shippingNote->signatureName?></div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div style="padding-top: 16pt">
|
|
Die Ware bleibt bis zur vollständigen Bezahlung Eigentum der XINON GmbH.
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|