123 lines
5.6 KiB
PHP
123 lines
5.6 KiB
PHP
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Material Requisition - {{ $requisition->document_number }}</title>
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body { font-family: 'DejaVu Sans', sans-serif; font-size: 11px; color: #1a1a1a; padding: 30px; }
|
|
.header { border-bottom: 2px solid #2d3748; padding-bottom: 12px; margin-bottom: 16px; }
|
|
.header h1 { font-size: 18px; font-weight: bold; color: #2d3748; }
|
|
.header .doc-number { font-size: 13px; color: #4a5568; margin-top: 2px; }
|
|
.meta-grid { display: table; width: 100%; margin-bottom: 16px; }
|
|
.meta-row { display: table-row; }
|
|
.meta-label { display: table-cell; width: 120px; font-weight: bold; padding: 3px 0; color: #4a5568; }
|
|
.meta-value { display: table-cell; padding: 3px 0; }
|
|
table.items { width: 100%; border-collapse: collapse; margin-top: 12px; }
|
|
table.items th { background: #edf2f7; padding: 8px 6px; text-align: left; font-size: 10px; text-transform: uppercase; color: #4a5568; border-bottom: 1px solid #cbd5e0; }
|
|
table.items td { padding: 7px 6px; border-bottom: 1px solid #e2e8f0; }
|
|
table.items .num { text-align: right; }
|
|
.total-row td { font-weight: bold; border-top: 2px solid #2d3748; background: #f7fafc; }
|
|
.footer { margin-top: 30px; page-break-inside: avoid; }
|
|
.sig-grid { width: 100%; border-collapse: collapse; }
|
|
.sig-grid td { width: 50%; padding: 10px; vertical-align: top; }
|
|
.sig-box { border: 1px solid #e2e8f0; padding: 12px; border-radius: 4px; min-height: 70px; }
|
|
.sig-box .label { font-size: 9px; text-transform: uppercase; color: #a0aec0; margin-bottom: 6px; }
|
|
.sig-box .name { font-weight: bold; font-size: 12px; }
|
|
.sig-box .role { font-size: 10px; color: #4a5568; }
|
|
.sig-box .date { font-size: 9px; color: #a0aec0; margin-top: 4px; }
|
|
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 10px; font-weight: bold; text-transform: uppercase; }
|
|
.status-approved { background: #c6f6d5; color: #276749; }
|
|
.status-draft { background: #e2e8f0; color: #4a5568; }
|
|
.status-submitted { background: #bee3f8; color: #2a4365; }
|
|
.status-rejected { background: #fed7d7; color: #9b2c2c; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="header">
|
|
<h1>MATERIAL REQUISITION</h1>
|
|
<div class="doc-number">{{ $requisition->document_number }}
|
|
<span class="status-badge status-{{ $requisition->status }}">{{ strtoupper($requisition->status) }}</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="meta-grid">
|
|
|
|
<div class="meta-row">
|
|
<span class="meta-label">Date:</span>
|
|
<span class="meta-value">{{ $requisition->created_at->format('F d, Y') }}</span>
|
|
</div>
|
|
<div class="meta-row">
|
|
<span class="meta-label">Requested By:</span>
|
|
<span class="meta-value">{{ $requisition->requester->name }}</span>
|
|
</div>
|
|
</div>
|
|
|
|
@if($requisition->notes)
|
|
<div style="margin-bottom: 12px;">
|
|
<strong>Notes:</strong> {{ $requisition->notes }}
|
|
</div>
|
|
@endif
|
|
|
|
<table class="items">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 30px;">#</th>
|
|
<th>Material</th>
|
|
<th>Unit</th>
|
|
<th class="num">Quantity</th>
|
|
<th class="num">Unit Cost</th>
|
|
<th class="num">Total</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($requisition->items as $index => $item)
|
|
<tr>
|
|
<td>{{ $index + 1 }}</td>
|
|
<td>{{ $item->material->name }}</td>
|
|
<td>{{ $item->material->unit }}</td>
|
|
<td class="num">{{ number_format($item->quantity, 2) }}</td>
|
|
<td class="num">{{ number_format($item->unit_cost, 2) }}</td>
|
|
<td class="num">{{ number_format($item->line_total, 2) }}</td>
|
|
</tr>
|
|
@endforeach
|
|
<tr class="total-row">
|
|
<td colspan="5" style="text-align: right;">GRAND TOTAL</td>
|
|
<td class="num">{{ number_format($requisition->total_cost, 2) }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<div class="footer">
|
|
<table class="sig-grid">
|
|
<tr>
|
|
<td>
|
|
<div class="sig-box">
|
|
<div class="label">Requested By</div>
|
|
<div class="name">{{ $requisition->requester->name }}</div>
|
|
<div class="date">{{ $requisition->created_at->format('M d, Y') }}</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
@if(!empty($approverDetails))
|
|
@foreach($approverDetails as $approver)
|
|
<div class="sig-box" @if(!$loop->first)style="margin-top: 8px;"@endif>
|
|
<div class="label">Approved By</div>
|
|
<div class="name">{{ $approver['name'] }}</div>
|
|
<div class="role">{{ $approver['role'] }}</div>
|
|
<div class="date">{{ $approver['date'] }}</div>
|
|
</div>
|
|
@endforeach
|
|
@else
|
|
<div class="sig-box">
|
|
<div class="label">Approved By</div>
|
|
<div style="color: #a0aec0; font-style: italic; margin-top: 10px;">Pending Approval</div>
|
|
</div>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</body>
|
|
</html>
|