mastercut/resources/views/pages/admin/manage/transaction/print.blade.php
2024-12-21 16:57:56 +07:00

204 lines
5.6 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: 58mm auto;
margin: 0;
}
@media print {
* {
print-color-adjust: exact;
-webkit-print-color-adjust: exact;
}
}
body {
margin: 0;
padding: 2mm;
width: 54mm;
font-family: Arial, sans-serif;
font-size: 9px;
line-height: 1.3;
}
.invoice-header {
text-align: left;
margin-bottom: 8px;
}
.invoice-header h1 {
font-size: 12px;
margin: 0;
padding: 3px 0;
font-weight: bold;
}
.invoice-header p {
margin: 1px 0;
}
.invoice-details table {
width: 100%;
border-collapse: collapse;
margin: 8px 0;
}
.invoice-details th,
.invoice-details td {
text-align: left;
padding: 2px 0;
}
.invoice-items {
margin: 8px 0;
}
.invoice-items table {
width: 100%;
border-collapse: collapse;
}
.invoice-items th,
.invoice-items td {
padding: 3px 0;
font-size: 9px;
}
.invoice-items td:first-child {
width: 60%;
word-wrap: break-word;
word-break: break-all;
display: inline-block;
}
.invoice-items td:last-child {
width: 40%;
text-align: left;
vertical-align: top;
}
.total-row {
font-weight: bold;
border-top: 1px dashed #000;
margin-top: 5px;
padding-top: 5px;
}
.divider {
border-top: 1px dashed #000;
margin: 8px 0;
}
.payment-method {
font-weight: bold;
margin: 5px 0;
font-size: 9px;
text-align: left;
}
.thank-you {
margin-top: 8px;
font-style: italic;
font-size: 9px;
text-align: left;
}
.invoice-items table {
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}
.invoice-items th,
.invoice-items td {
padding: 3px 0;
font-size: 9px;
overflow: hidden;
}
.invoice-items th:first-child,
.invoice-items td:first-child {
width: 29mm;
word-wrap: break-word;
word-break: break-all;
}
.invoice-items th:last-child,
.invoice-items td:last-child {
width: 29mm;
text-align: left;
vertical-align: top;
}
.invoice-items .empty-cell {
width: 29mm;
}
</style>
</head>
<body>
<div class="invoice-header">
<h1>Master cut Barbershop</h1>
<p>Jl.pabuaran-sadang</p>
<p>082200000000</p>
</div>
<div class="divider"></div>
<div class="invoice-details">
<table>
<tr>
<th style="width: 30%">Tanggal:</th>
<td>{{ date('Y-m-d H:i') }}</td>
</tr>
<tr>
<th>Invoice:</th>
<td>#INV{{ $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 style="text-align: left">Layanan</th>
<th style="text-align: left">Harga</th>
</tr>
<tr>
<td>{{ $transaction->service->name }}</td>
<td>{{ formatToRupiah($transaction->price) }}</td>
</tr>
@if ($transaction->discount > 0)
<tr>
<td class="empty-cell"></td>
<td>-{{ formatToRupiah($transaction->discount) }}</td>
</tr>
@endif
<tr class="total-row">
<td class="empty-cell"></td>
<td>{{ formatToRupiah($transaction->total) }}</td>
</tr>
</table>
</div>
<div class="divider"></div>
<div class="invoice-footer">
<p class="payment-method">Metode Pembayaran:
{{ $transaction->payment_method == '1' ? 'Cash' : ($transaction->payment_method == '2' ? 'Qris' : 'Other') }}
</p>
<p class="thank-you">Terima kasih atas kunjungan Anda!</p>
</div>
<script>
window.print();
</script>
</body>
</html>