vernova/resources/views/reports/financial-pdf.blade.php
2026-07-26 19:58:27 +03:30

296 lines
8.8 KiB
PHP

<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ __('reports.financial') }} - Vernova</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
direction: rtl;
color: #1f2937;
font-size: 12px;
line-height: 1.6;
background: #ffffff;
}
.page {
padding: 30px 40px;
max-width: 1100px;
margin: 0 auto;
}
.header {
text-align: center;
margin-bottom: 24px;
padding-bottom: 16px;
border-bottom: 2px solid #0d9488;
}
.header h1 {
font-size: 20px;
font-weight: 700;
color: #0d9488;
margin-bottom: 4px;
}
.header .subtitle {
font-size: 11px;
color: #6b7280;
}
.meta {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
font-size: 11px;
color: #6b7280;
}
.meta-item {
display: flex;
align-items: center;
gap: 4px;
}
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
}
thead th {
background-color: #f3f4f6;
color: #374151;
font-weight: 600;
font-size: 11px;
padding: 8px 10px;
text-align: right;
border: 1px solid #d1d5db;
}
thead th.text-left {
text-align: left;
}
thead th.text-center {
text-align: center;
}
tbody td {
padding: 7px 10px;
border: 1px solid #e5e7eb;
font-size: 11px;
}
tbody tr:nth-child(even) {
background-color: #f9fafb;
}
.text-left {
text-align: left;
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
.number {
text-align: left;
font-variant-numeric: tabular-nums;
direction: ltr;
unicode-bidi: embed;
}
.font-mono {
font-family: 'Courier New', monospace;
font-size: 10px;
}
.text-red {
color: #dc2626;
}
.text-amber {
color: #d97706;
}
.text-green {
color: #059669;
}
.text-bold {
font-weight: 700;
}
tfoot td {
background-color: #f3f4f6;
font-weight: 700;
padding: 8px 10px;
border: 1px solid #d1d5db;
font-size: 11px;
}
.utilization-bar-container {
display: flex;
align-items: center;
gap: 6px;
}
.utilization-bar {
width: 60px;
height: 6px;
background-color: #e5e7eb;
border-radius: 3px;
overflow: hidden;
}
.utilization-fill {
height: 100%;
border-radius: 3px;
}
.utilization-fill.green {
background-color: #059669;
}
.utilization-fill.amber {
background-color: #d97706;
}
.utilization-fill.red {
background-color: #dc2626;
}
.footer {
margin-top: 30px;
padding-top: 12px;
border-top: 1px solid #e5e7eb;
font-size: 10px;
color: #9ca3af;
text-align: center;
}
.no-data {
text-align: center;
padding: 40px 0;
color: #9ca3af;
font-size: 14px;
}
</style>
</head>
<body>
<div class="page">
<!-- Header -->
<div class="header">
<h1>{{ __('reports.financial') }}</h1>
<div class="subtitle">{{ __('reports.financial_description') }}</div>
</div>
<!-- Meta Info -->
<div class="meta">
<div class="meta-item">
<span>{{ __('reports.date_range') }}:</span>
<span>
@isset($dateFrom)
{{ calendar_date($dateFrom) }}
@else
@endisset
&nbsp;{{ __('reports.to') }}&nbsp;
@isset($dateTo)
{{ calendar_date($dateTo) }}
@else
@endisset
</span>
</div>
<div class="meta-item">
<span>{{ __('reports.generated_at') }}:</span>
<span>{{ calendar_date(now()) }} - {{ persian_num(now()->format('H:i')) }}</span>
</div>
</div>
<!-- Data Table -->
@if(count($reportData ?? []) > 0)
<table>
<thead>
<tr>
<th class="text-center" style="width: 30px;">#</th>
<th>{{ __('project.code') }}</th>
<th>{{ __('project.name') }}</th>
<th class="number">{{ __('project.budget') }}</th>
<th class="number">{{ __('reports.total_expenses') }}</th>
<th class="number">{{ __('reports.total_petty_cash') }}</th>
<th class="number">{{ __('reports.remaining') }}</th>
<th class="text-center">{{ __('reports.utilization') }}</th>
<th>{{ __('project.manager') }}</th>
</tr>
</thead>
<tbody>
@foreach($reportData as $index => $row)
<tr>
<td class="text-center">{{ persian_num($loop->iteration) }}</td>
<td class="font-mono">{{ $row['code'] ?? '-' }}</td>
<td>{{ $row['name'] ?? '-' }}</td>
<td class="number">{{ format_currency((float)($row['budget'] ?? 0)) }}</td>
<td class="number text-red">{{ format_currency((float)($row['total_expenses'] ?? 0)) }}</td>
<td class="number text-amber">{{ format_currency((float)($row['total_petty_cash'] ?? 0)) }}</td>
<td class="number {{ ($row['remaining'] ?? 0) >= 0 ? 'text-green' : 'text-red' }}">
{{ format_currency((float)($row['remaining'] ?? 0)) }}
</td>
<td class="text-center">
<div class="utilization-bar-container" style="justify-content: center;">
<div class="utilization-bar">
<div class="utilization-fill
{{ ($row['utilization'] ?? 0) > 90 ? 'red' : (($row['utilization'] ?? 0) > 70 ? 'amber' : 'green') }}"
style="width: {{ min($row['utilization'] ?? 0, 100) }}%;"></div>
</div>
<span>{{ persian_num(round($row['utilization'] ?? 0)) }}%</span>
</div>
</td>
<td>{{ $row['manager'] ?? '-' }}</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<td colspan="2"></td>
<td class="text-bold">{{ __('reports.total') }}</td>
<td class="number">{{ format_currency((float)($summary['total_budget'] ?? 0)) }}</td>
<td class="number text-red">{{ format_currency((float)($summary['total_expenses'] ?? 0)) }}</td>
<td class="number text-amber">{{ format_currency((float)($summary['total_petty_cash'] ?? 0)) }}</td>
<td class="number {{ ($summary['total_remaining'] ?? 0) >= 0 ? 'text-green' : 'text-red' }}">
{{ format_currency((float)($summary['total_remaining'] ?? 0)) }}
</td>
<td class="text-center">
{{ persian_num(round($summary['avg_utilization'] ?? 0)) }}%
</td>
<td></td>
</tr>
</tfoot>
</table>
@else
<div class="no-data">
{{ __('reports.no_financial_data') }}
</div>
@endif
<!-- Footer -->
<div class="footer">
Vernova {{ __('reports.financial') }} {{ __('reports.generated_at') }}: {{ calendar_date(now()) }} {{ persian_num(now()->format('H:i')) }}
</div>
</div>
</body>
</html>