Viewing file: order_details_print.blade.php (2.65 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Print Order #{{ $order->order_number }}</title> <style> body { font-family: 'Courier New', Courier, monospace; font-size: 14px; width: 400px; margin: 20px; } .text-center { text-align: center; } .text-right { text-align: right; } table { width: 100%; margin-top: 10px; } th, td { padding: 4px 0; } .bold { font-weight: bold; } .border-top { border-top: 1px dashed #000; margin-top: 10px; } </style> </head> <body onload="window.print();">
<div class="text-center"> <h2>{{ucfirst($order->restaurant->name ?? '')}}</h2> <p>{{ucfirst($order->restaurant->location ?? '')}}</p> <p>Phone: {{ucfirst($order->restaurant->phone_number ?? '')}}</p> <p>Email: {{ucfirst($order->restaurant->email ?? '')}}</p> </div>
<div class="border-top"></div>
<p><strong>Order #{{ $order->id }}</strong></p> <p>{{ \Carbon\Carbon::parse($order->created_at)->format('d M Y h:i A') }}</p>
<table> <thead> <tr class="bold"> <td>Item Name</td> <td>QTY</td> <td class="text-right">Price</td> <td class="text-right">Amount</td> </tr> </thead> <tbody> @foreach($order->details as $detail) <tr> <td>{{ $detail->item->name ?? 'N/A' }}</td> <td>{{ $detail->quantity }}</td> <td class="text-right">${{ number_format($detail->price, 2) }}</td> <td class="text-right">${{ number_format($detail->total, 2) }}</td> </tr> @endforeach </tbody> </table>
<div class="border-top"></div>
<h3 class="text-right">Total: ${{ number_format($order->total_price, 2) }}</h3>
<div class="border-top"></div>
<p class="text-center">Thank you for your visit!</p>
<table> <thead> <tr class="bold"> <td>Amount</td> <td>Payment Method</td> <td>Payment Status</td> <td>Date & Time</td> </tr> </thead> <tbody> <tr> <td>${{ number_format($order->total_price, 2) }}</td> <td>{{ ucfirst($order->payment_method ?? 'N/A') }}</td> <td>{{ ucfirst($order->payment_status ?? 'N/A') }}</td> <td>{{ \Carbon\Carbon::parse($order->created_at)->format('d M, Y h:i A') }}</td> </tr> </tbody> </table>
</body> </html>
|