Add initial Code
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" @class(['dark'=> ($appearance ?? 'system') == 'dark'])>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
{{-- Inline script to detect system dark mode preference and apply it immediately --}}
|
||||
<script>
|
||||
(function() {
|
||||
const appearance = '{{ $appearance ?? "system" }}';
|
||||
|
||||
if (appearance === 'system') {
|
||||
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
|
||||
if (prefersDark) {
|
||||
document.documentElement.classList.add('dark');
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
<title inertia>{{ config('app.name', 'Caramel CRM') }}</title>
|
||||
|
||||
<link rel="icon" href="/favicon.ico" sizes="any">
|
||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
||||
|
||||
@vite(['resources/js/app.ts', "resources/js/pages/{$page['component']}.vue"])
|
||||
@inertiaHead
|
||||
</head>
|
||||
|
||||
<body class="font-sans antialiased">
|
||||
@inertia
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,199 @@
|
||||
<!-- TODO: billing_data verwenden, nicht Kundendaten -->
|
||||
<!DOCTYPE html lang="de">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Rechnung {{ $invoice['nr'] }}</title>
|
||||
<!-- TODO: default stylesheet und überschreiben mit user settings -->
|
||||
@if($isPDF)
|
||||
<link rel="stylesheet" href="{{ public_path('/storage/css/invoice.css') }}">
|
||||
@else
|
||||
<link rel="stylesheet" href="/storage/css/invoice.css">
|
||||
@endif
|
||||
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Clear Sans';
|
||||
src: url('{{ $fontPath }}/ClearSans-Regular.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Clear Sans';
|
||||
src: url('{{ $fontPath }}/ClearSans-Bold.ttf') format('truetype');
|
||||
font-weight: bold;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Clear Sans';
|
||||
src: url('{{ $fontPath }}/ClearSans-Medium.ttf') format('truetype');
|
||||
font-weight: medium;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Clear Sans';
|
||||
src: url('{{ $fontPath }}/ClearSans-Light.ttf') format('truetype');
|
||||
font-weight: light;
|
||||
font-style: normal;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Fixed page elements need to bee direct descendents of body for Dompdf -->
|
||||
<!-- see https://github.com/dompdf/dompdf/issues/1190 -->
|
||||
<img id="logo"
|
||||
@if($isPDF)
|
||||
src="{{ public_path('storage/pdf/Logo.svg') }}"
|
||||
@else
|
||||
src="/storage/pdf/Logo.svg"
|
||||
@endif />
|
||||
|
||||
<address>
|
||||
<div class="sender">
|
||||
<!-- TODO: Firmenadresse aus Settings -->
|
||||
Tooloop Multimedia Daniel Stock, Rehmstraße 4, 86161 Augsburg
|
||||
</div>
|
||||
<div class="recipient">
|
||||
{{ $invoice['customer']['companyName'] }}<br />
|
||||
{{ $invoice['billingData']['contactFirstName'] }} {{ $invoice['billingData']['contactLastName'] }}<br />
|
||||
@if($invoice['billingData']['billingAddress']['lineOne'])
|
||||
{{ $invoice['billingData']['billingAddress']['lineOne'] }}<br />
|
||||
@endif
|
||||
@if($invoice['billingData']['billingAddress']['lineTwo'])
|
||||
{{ $invoice['billingData']['billingAddress']['lineTwo'] }}<br />
|
||||
@endif
|
||||
{{ $invoice['billingData']['billingAddress']['postalCode'] }} {{ $invoice['billingData']['billingAddress']['city'] }}
|
||||
</div>
|
||||
</address>
|
||||
|
||||
|
||||
<table id="meta">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Rechnungs-Nr.</th>
|
||||
<td>
|
||||
{{ $invoice['nr'] }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Datum</th>
|
||||
<td>
|
||||
@php
|
||||
$fmt = new \IntlDateFormatter('de_DE', NULL, NULL);
|
||||
$fmt->setPattern('d. MMMM yyyy');
|
||||
@endphp
|
||||
<date>{{ $fmt->format(strtotime($invoice['invoiceDate'])) }}</date>
|
||||
</td>
|
||||
</tr>
|
||||
@if( !$invoice['billingData']['paymentTerms']['isFixed'] )
|
||||
<tr>
|
||||
<th>Fälligkeitsdatum</th>
|
||||
<td>
|
||||
<date>{{ $fmt->format(strtotime($invoice['dueDate'])) }}</date>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if(false)
|
||||
<tr>
|
||||
<th>Leistungsdatum</th>
|
||||
<td>
|
||||
<date>{{ $fmt->format(strtotime($invoice['service_date'])) }}</date>
|
||||
</td>
|
||||
</tr>
|
||||
@else
|
||||
<tr>
|
||||
<th>Leistungszeitraum</th>
|
||||
<td>{{ $fmt->format(strtotime($invoice['serviceStartDate'])) }} –<br />{{ $fmt->format(strtotime($invoice['serviceEndDate'])) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h1>Rechnung</h1>
|
||||
<h2>{{ $invoice['title'] }}</h2>
|
||||
|
||||
@if($invoice['text'])
|
||||
<div class="text">
|
||||
<!-- TODO: Text aus DB -->
|
||||
<p>Sehr geehrte Frau Mustermann,</p>
|
||||
<p>lorem ipsum dolor sit amet consectetur adipisicing elit. Alias cumque dolorem, recusandae possimus optio id animi pariatur in nesciunt! Quos, at? A quidem voluptatum, soluta tenetur voluptate consequuntur dolor? Mollitia!</p>
|
||||
{{ $invoice['text'] }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<table id="line-items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Pos.</th>
|
||||
<th>Bezeichnung</th>
|
||||
<th>Menge</th>
|
||||
<th>Einheit</th>
|
||||
<th>Einzelpreis</th>
|
||||
<th>Gesamtpreis</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($invoice['items'] as $item)
|
||||
<tr>
|
||||
<td>{{ $item['position'] }}</td>
|
||||
<td>
|
||||
<strong>{{ $item['title'] }}</strong><br>
|
||||
{{ $item['description'] }}
|
||||
</td>
|
||||
<td>@toCommaFloat($item['quantity'])</td>
|
||||
<td>{{ $item['unit'] }}</td>
|
||||
<td>@toCurrency($item['price'])</td>
|
||||
<td>@toCurrency($item['quantity'] * $item['price'])</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="5">Nettobetrag</td>
|
||||
<td>@toCurrency($invoice['totalAmount'])</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5">19 % MwSt.</td>
|
||||
<td>@toCurrency(round($invoice['totalAmount'] * 0.19, 2))</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5">Gesamt brutto</td>
|
||||
<td>@toCurrency($invoice['totalAmount'] + round($invoice['totalAmount'] * 0.19, 2))</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<!-- TODO: Kleingedrucktes aus settings -->
|
||||
<div id="fine-print">
|
||||
@if($invoice['billingData']['paymentTerms']['isFixed'])
|
||||
<p>Zahlungsziel {{ $invoice['billingData']['paymentTerms']['description'] }}</p>
|
||||
@else
|
||||
<p>Zahlungsziel {{ $invoice['billingData']['paymentTerms']['days'] }} Tage</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div id="giro-code">
|
||||
<img src="data:image/svg+xml;base64,{{ $giroCode }}" />
|
||||
<p>
|
||||
<strong>GiroCode/EPC-QR-Code</strong><br />
|
||||
Der Code enthält alle relevanten Zahlungsdaten. Mit Ihrer Banking App können Sie den Code scannen und die Zahlung als Überweisung ausführen.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<!-- TODO: Footertext aus Settings -->
|
||||
Tooloop Multimedia Daniel Stock, Rehmstraße 4, 86161 Augsburg, Tel. +49 821 65079983, www.tooloop.de<br />
|
||||
Stadtsparkasse Augsburg, DE40 7205 0000 0251 5125 13, BIC AUGSDE77XXX, Ust-IdNr. DE309558315
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user