|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | + <title>Payslip - {{ $payrollRun->period_label ?? 'Payroll Run' }}</title> |
| 7 | + <style> |
| 8 | + * { margin: 0; padding: 0; box-sizing: border-box; } |
| 9 | + body { font-family: DejaVu Sans, Arial, sans-serif; font-size: 13px; color: #333; background: #fff; } |
| 10 | + .page { padding: 40px; } |
| 11 | + .header { display: table; width: 100%; margin-bottom: 30px; } |
| 12 | + .header-left { display: table-cell; vertical-align: top; width: 60%; } |
| 13 | + .header-right { display: table-cell; vertical-align: top; text-align: right; } |
| 14 | + .company-name { font-size: 22px; font-weight: bold; color: #1e3a5f; margin-bottom: 4px; } |
| 15 | + .payslip-title { font-size: 26px; font-weight: bold; color: #1e3a5f; letter-spacing: 2px; } |
| 16 | + .period-label { margin-top: 6px; font-size: 14px; color: #555; } |
| 17 | + .divider { border: none; border-top: 2px solid #1e3a5f; margin: 20px 0; } |
| 18 | + .info-section { display: table; width: 100%; margin-bottom: 24px; } |
| 19 | + .info-left { display: table-cell; width: 50%; vertical-align: top; } |
| 20 | + .info-right { display: table-cell; width: 50%; vertical-align: top; } |
| 21 | + .info-label { font-size: 11px; font-weight: bold; text-transform: uppercase; color: #888; letter-spacing: 1px; margin-bottom: 4px; } |
| 22 | + .info-value { font-size: 13px; color: #333; font-weight: bold; } |
| 23 | + .info-detail { font-size: 12px; color: #666; } |
| 24 | + table { width: 100%; border-collapse: collapse; margin-bottom: 16px; } |
| 25 | + .section-header { background-color: #1e3a5f; } |
| 26 | + .section-header th { color: #fff; padding: 8px 12px; font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; } |
| 27 | + .section-header th.text-right { text-align: right; } |
| 28 | + tbody tr { border-bottom: 1px solid #e8e8e8; } |
| 29 | + tbody td { padding: 9px 12px; font-size: 12px; } |
| 30 | + tbody td.text-right { text-align: right; } |
| 31 | + .earnings-row { background-color: #f0f9f4; } |
| 32 | + .deductions-row { background-color: #fff5f5; } |
| 33 | + .summary-section { display: table; width: 100%; margin-top: 16px; } |
| 34 | + .summary-spacer { display: table-cell; width: 40%; } |
| 35 | + .summary-table-cell { display: table-cell; width: 60%; vertical-align: top; } |
| 36 | + .summary-table { width: 100%; border-collapse: collapse; } |
| 37 | + .summary-table td { padding: 9px 12px; font-size: 13px; border-bottom: 1px solid #e8e8e8; } |
| 38 | + .summary-table td:last-child { text-align: right; font-weight: bold; } |
| 39 | + .summary-table tr.gross-row td { background-color: #f0f9f4; color: #065f46; } |
| 40 | + .summary-table tr.deduction-row td { background-color: #fff5f5; color: #991b1b; } |
| 41 | + .summary-table tr.net-row { background: #1e3a5f; } |
| 42 | + .summary-table tr.net-row td { color: #fff; font-size: 16px; font-weight: bold; padding: 12px; border-bottom: none; } |
| 43 | + .status-section { margin-top: 20px; } |
| 44 | + .status-badge { display: inline-block; padding: 3px 12px; border-radius: 12px; font-size: 11px; font-weight: bold; text-transform: uppercase; } |
| 45 | + .status-draft { background-color: #f0f0f0; color: #666; } |
| 46 | + .status-processed { background-color: #dbeafe; color: #1d4ed8; } |
| 47 | + .status-approved { background-color: #d1fae5; color: #065f46; } |
| 48 | + .status-paid { background-color: #ede9fe; color: #5b21b6; } |
| 49 | + .footer { margin-top: 40px; text-align: center; font-size: 11px; color: #888; padding-top: 16px; border-top: 1px solid #e8e8e8; } |
| 50 | + </style> |
| 51 | +</head> |
| 52 | +<body> |
| 53 | +<div class="page"> |
| 54 | + |
| 55 | + {{-- Header --}} |
| 56 | + <div class="header"> |
| 57 | + <div class="header-left"> |
| 58 | + <div class="company-name">Demo Company</div> |
| 59 | + </div> |
| 60 | + <div class="header-right"> |
| 61 | + <div class="payslip-title">PAYSLIP</div> |
| 62 | + <div class="period-label">{{ $payrollRun->period_label ?? 'N/A' }}</div> |
| 63 | + </div> |
| 64 | + </div> |
| 65 | + |
| 66 | + <hr class="divider"> |
| 67 | + |
| 68 | + {{-- Run Info --}} |
| 69 | + <div class="info-section"> |
| 70 | + <div class="info-left"> |
| 71 | + <div class="info-label">Pay Period</div> |
| 72 | + <div class="info-value"> |
| 73 | + {{ $payrollRun->period_start ? $payrollRun->period_start->format('d M Y') : 'N/A' }} |
| 74 | + — |
| 75 | + {{ $payrollRun->period_end ? $payrollRun->period_end->format('d M Y') : 'N/A' }} |
| 76 | + </div> |
| 77 | + </div> |
| 78 | + <div class="info-right"> |
| 79 | + <div class="info-label">Run Date</div> |
| 80 | + <div class="info-value">{{ $payrollRun->run_date ? $payrollRun->run_date->format('d M Y') : 'N/A' }}</div> |
| 81 | + <div class="info-label" style="margin-top: 10px;">Status</div> |
| 82 | + <div> |
| 83 | + <span class="status-badge status-{{ $payrollRun->status ?? 'draft' }}"> |
| 84 | + {{ ucfirst($payrollRun->status ?? 'draft') }} |
| 85 | + </span> |
| 86 | + </div> |
| 87 | + </div> |
| 88 | + </div> |
| 89 | + |
| 90 | + <hr class="divider"> |
| 91 | + |
| 92 | + {{-- Earnings Section --}} |
| 93 | + <table> |
| 94 | + <thead> |
| 95 | + <tr class="section-header"> |
| 96 | + <th>Earnings</th> |
| 97 | + <th class="text-right">Amount</th> |
| 98 | + </tr> |
| 99 | + </thead> |
| 100 | + <tbody> |
| 101 | + <tr class="earnings-row"> |
| 102 | + <td>Gross Pay</td> |
| 103 | + <td class="text-right">{{ number_format((float)($payrollRun->attributes['total_gross'] ?? $payrollRun->total_gross), 2) }}</td> |
| 104 | + </tr> |
| 105 | + </tbody> |
| 106 | + </table> |
| 107 | + |
| 108 | + {{-- Deductions Section --}} |
| 109 | + <table> |
| 110 | + <thead> |
| 111 | + <tr class="section-header"> |
| 112 | + <th>Deductions</th> |
| 113 | + <th class="text-right">Amount</th> |
| 114 | + </tr> |
| 115 | + </thead> |
| 116 | + <tbody> |
| 117 | + <tr class="deductions-row"> |
| 118 | + <td>Total Deductions</td> |
| 119 | + <td class="text-right">{{ number_format((float)($payrollRun->attributes['total_deductions'] ?? 0), 2) }}</td> |
| 120 | + </tr> |
| 121 | + </tbody> |
| 122 | + </table> |
| 123 | + |
| 124 | + {{-- Summary --}} |
| 125 | + <div class="summary-section"> |
| 126 | + <div class="summary-spacer"></div> |
| 127 | + <div class="summary-table-cell"> |
| 128 | + @php |
| 129 | + $gross = (float)($payrollRun->attributes['total_gross'] ?? 0); |
| 130 | + $deductions = (float)($payrollRun->attributes['total_deductions'] ?? 0); |
| 131 | + $net = (float)($payrollRun->attributes['total_net'] ?? ($gross - $deductions)); |
| 132 | + @endphp |
| 133 | + <table class="summary-table"> |
| 134 | + <tr class="gross-row"> |
| 135 | + <td>Gross Pay</td> |
| 136 | + <td>{{ number_format($gross, 2) }}</td> |
| 137 | + </tr> |
| 138 | + <tr class="deduction-row"> |
| 139 | + <td>Total Deductions</td> |
| 140 | + <td>− {{ number_format($deductions, 2) }}</td> |
| 141 | + </tr> |
| 142 | + <tr class="net-row"> |
| 143 | + <td>Net Pay</td> |
| 144 | + <td>{{ number_format($net, 2) }}</td> |
| 145 | + </tr> |
| 146 | + </table> |
| 147 | + </div> |
| 148 | + </div> |
| 149 | + |
| 150 | + {{-- Employee Count --}} |
| 151 | + @if($payrollRun->employee_count) |
| 152 | + <div style="margin-top: 20px; font-size: 12px; color: #666;"> |
| 153 | + <strong>Employees Included:</strong> {{ $payrollRun->employee_count }} |
| 154 | + </div> |
| 155 | + @endif |
| 156 | + |
| 157 | + {{-- Notes --}} |
| 158 | + @if($payrollRun->notes) |
| 159 | + <div style="margin-top: 16px; padding: 12px; background: #f5f5f5; border-left: 3px solid #1e3a5f; font-size: 12px; color: #555;"> |
| 160 | + <strong>Notes:</strong><br> |
| 161 | + {{ $payrollRun->notes }} |
| 162 | + </div> |
| 163 | + @endif |
| 164 | + |
| 165 | + {{-- Footer --}} |
| 166 | + <div class="footer"> |
| 167 | + Demo Company — Confidential Payslip — {{ $payrollRun->period_label ?? '' }} |
| 168 | + </div> |
| 169 | + |
| 170 | +</div> |
| 171 | +</body> |
| 172 | +</html> |
0 commit comments