Files
pds/resources/views/mail/invoice_data_report.blade.php

112 lines
3.5 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Invoice Data Report</title>
<style>
body {
font-family: 'Segoe UI', Arial, sans-serif;
background-color: #f9fafb;
color: #333;
margin: 0;
padding: 0;
}
h2 {
color: #215c98;
text-align: center;
margin-bottom: 20px;
}
table {
border-collapse: collapse;
width: 100%;
font-size: 14px;
white-space: nowrap !important;
}
th, td {
border: 1px solid #020813da;
padding: 8px 10px;
text-align: center;
white-space: nowrap !important;
text-overflow: ellipsis;
}
th {
background-color: #215c98;
color: #fff;
white-space: nowrap !important;
}
tr:nth-child(even) {
background-color: #f3f4f6;
}
.status-wentout {
color: #10b981;
font-weight: bold;
}
.status-pending {
color: #ef4444;
font-weight: bold;
}
.footer {
text-align: center;
font-size: 13px;
color: #6b7280;
margin-top: 30px;
}
</style>
</head>
<body>
<div style="text-align: center; font-weight: bold;">
{{ $company }}
</div>
<br>
<p>{!! $greeting !!}</p>
<div class="container">
@if(empty($tableData))
<p style="text-align:center;">No invoice data available for this schedule.</p>
@else
<table>
<thead>
<tr>
<th>No</th>
<th>Plant</th>
<th>Distribution Type</th>
<th>Customer Code</th>
<th>Document Number</th>
<th>Document Date</th>
<th>Customer TradeName</th>
<th>Customer Location</th>
<th>Status</th>
</tr>
</thead>
<tbody>
@foreach ($tableData as $row)
<tr>
<td>{{ $row['no'] }}</td>
<td>{{ $row['plant'] }}</td>
<td>{{ $row['distribution_type'] }}</td>
<td>{{ $row['customer_code'] }}</td>
<td>{{ $row['document_number'] }}</td>
{{-- Safe Carbon parse --}}
<td>
@if(!empty($row['document_date']) && $row['document_date'] != '-')
{{ \Carbon\Carbon::parse($row['document_date'])->format('d-M-Y') }}
@else
-
@endif
</td>
<td>{{ $row['customer_trade_name'] }}</td>
<td>{{ $row['customer_location'] }}</td>
<td class="{{ $row['status'] == 'Went Out' ? 'status-wentout' : ($row['status'] == 'Pending' ? 'status-pending' : '') }}">
{{ $row['status'] }}
</td>
</tr>
@endforeach
</tbody>
</table>
@endif
<p>{!! $wishes !!}</p>
</div>
</body>
</html>