135 lines
3.4 KiB
PHP
135 lines
3.4 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Invoice</title>
|
|
<style>
|
|
@page {
|
|
size: 80mm auto;
|
|
/* Sesuaikan dengan lebar printer thermal */
|
|
margin: 0;
|
|
}
|
|
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
width: 80mm;
|
|
font-family: Arial, sans-serif;
|
|
font-size: 12px;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.invoice-header {
|
|
text-align: center;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.invoice-header h1 {
|
|
font-size: 16px;
|
|
margin: 0;
|
|
}
|
|
|
|
.invoice-header p {
|
|
font-size: 12px;
|
|
margin: 0;
|
|
}
|
|
|
|
.invoice-details,
|
|
.invoice-footer {
|
|
margin: 10px 0;
|
|
}
|
|
|
|
.invoice-details table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
.invoice-details th,
|
|
.invoice-details td {
|
|
text-align: left;
|
|
padding: 5px;
|
|
}
|
|
|
|
.invoice-details th {
|
|
font-weight: bold;
|
|
}
|
|
|
|
.invoice-footer {
|
|
text-align: center;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.divider {
|
|
border-top: 1px dashed #000;
|
|
margin: 10px 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="invoice-header">
|
|
<h1>Barbershop Name</h1>
|
|
<p>Alamat Barbershop</p>
|
|
<p>Telepon: 123-456-789</p>
|
|
</div>
|
|
|
|
<div class="divider"></div>
|
|
|
|
<div class="invoice-details">
|
|
<table>
|
|
<tr>
|
|
<th>Tanggal:</th>
|
|
<td>{{ date('Y-m-d H:i') }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Invoice:</th>
|
|
<td>#{{ $transaction->id }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Pelanggan:</th>
|
|
<td>{{ $transaction->customer->name }}</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="divider"></div>
|
|
|
|
<div class="invoice-items">
|
|
<table>
|
|
<tr>
|
|
<th>Layanan</th>
|
|
<th>Harga</th>
|
|
</tr>
|
|
<tr>
|
|
<td>{{ $transaction->service->name }}</td>
|
|
<td>{{ number_format($transaction->price, 2) }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Diskon</td>
|
|
<td>{{ number_format($transaction->discount, 2) }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Total</td>
|
|
<td>{{ number_format($transaction->total, 2) }}</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="divider"></div>
|
|
|
|
<div class="invoice-footer">
|
|
<p>Metode Pembayaran:
|
|
{{ $transaction->payment_method == '1' ? 'Cash' : ($transaction->payment_method == '2' ? 'Qris' : 'Other') }}
|
|
</p>
|
|
<p>Terima kasih atas kunjungan Anda!</p>
|
|
</div>
|
|
|
|
<script>
|
|
window.print();
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|