download pdf and excel function created
This commit is contained in:
70
resources/views/admin/orders/pdf.blade.php
Normal file
70
resources/views/admin/orders/pdf.blade.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Orders Report</title>
|
||||
<style>
|
||||
body { font-family: DejaVu Sans, sans-serif; font-size:12px; }
|
||||
table { width:100%; border-collapse: collapse; }
|
||||
th, td { border: 1px solid #ddd; padding: 6px; text-align: left; }
|
||||
th { background: #f2f2f2; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h3>Orders Report</h3>
|
||||
|
||||
@if(!empty($filters))
|
||||
<p>
|
||||
@if($filters['search']) Search: <strong>{{ $filters['search'] }}</strong> @endif
|
||||
@if($filters['status']) | Status: <strong>{{ ucfirst($filters['status']) }}</strong> @endif
|
||||
@if($filters['shipment']) | Shipment: <strong>{{ ucfirst($filters['shipment']) }}</strong> @endif
|
||||
</p>
|
||||
@endif
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Order ID</th>
|
||||
<th>Shipment ID</th>
|
||||
<th>Customer ID</th>
|
||||
<th>Company</th>
|
||||
<th>Origin</th>
|
||||
<th>Destination</th>
|
||||
<th>Order Date</th>
|
||||
<th>Invoice No</th>
|
||||
<th>Invoice Date</th>
|
||||
<th>Amount</th>
|
||||
<th>Amount + GST</th>
|
||||
<th>Invoice Status</th>
|
||||
<th>Shipment Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($orders as $order)
|
||||
@php
|
||||
$mark = $order->markList ?? null;
|
||||
$invoice = $order->invoice ?? null;
|
||||
$shipment = $order->shipments->first() ?? null;
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $order->order_id }}</td>
|
||||
<td>{{ $shipment->shipment_id ?? '-' }}</td>
|
||||
<td>{{ $mark->customer_id ?? '-' }}</td>
|
||||
<td>{{ $mark->company_name ?? '-' }}</td>
|
||||
<td>{{ $mark->origin ?? $order->origin ?? '-' }}</td>
|
||||
<td>{{ $mark->destination ?? $order->destination ?? '-' }}</td>
|
||||
<td>{{ $order->created_at ? $order->created_at->format('d-m-Y') : '-' }}</td>
|
||||
<td>{{ $invoice->invoice_number ?? '-' }}</td>
|
||||
<td>{{ $invoice?->invoice_date ? \Carbon\Carbon::parse($invoice->invoice_date)->format('d-m-Y') : '-' }}</td>
|
||||
<td>{{ $invoice?->final_amount ? number_format($invoice->final_amount, 2) : '-' }}</td>
|
||||
<td>{{ $invoice?->final_amount_with_gst ? number_format($invoice->final_amount_with_gst, 2) : '-' }}</td>
|
||||
<td>{{ $invoice->status ? ucfirst($invoice->status) : 'Pending' }}</td>
|
||||
<td>{{ $shipment?->status ? ucfirst(str_replace('_',' ',$shipment->status)) : 'Pending' }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="13" style="text-align:center">No orders found</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user