bug fixes, leave managment refactoring, report points

This commit is contained in:
Kwesi Banson
2026-11-03 12:05:59 +00:00
parent 965892ac62
commit b393dcdf0e
14 changed files with 144 additions and 117 deletions

View File

@@ -20,9 +20,7 @@
<i class="bi bi-border-center me-2"></i> Management Hub
</a>
@endif
<a href="{{ url('management') }}" class="sidebar-nav-item {{ request()->is('management') ? 'active' : '' }}">
<i class="bi bi-border-center me-2"></i> Management Hub
</a>
<div class="sidebar-heading mt-2">Core Entities</div>
<a href="{{ url('/clients') }}" class="sidebar-nav-item {{ request()->is('clients*') ? 'active' : '' }}">
<i class="bi bi-people me-2"></i> Clients

View File

@@ -137,13 +137,11 @@
@push('scripts')
<script>
$(document).ready(function() {
// Initialize tooltips
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl)
});
// Handle Approve / Reject actions
$('.btn-action-leave').on('click', function() {
const requestId = $(this).data('id');
const action = $(this).data('action');

View File

@@ -40,7 +40,7 @@
<div class="content-card p-4 h-100 border-start border-4 border-0" style="border-left-color: #10b981 !important;">
<h6 class="text-secondary text-uppercase fw-bold mb-3" style="letter-spacing: 1px; font-size: 0.8rem;">Leave Policy Quick Guide</h6>
<ul class="text-secondary mb-0 small" style="line-height: 1.8;">
<li><strong>Pending Requests:</strong> Can be canceled before HR approval. Once approved, contact HR to amend.</li>
<li><strong>Pending Requests:</strong> Can be canceled before approval.</li>
<li><strong>Policy 2</strong></li>
<li><strong>Policy 3</strong></li>
<li><strong>Policy 4</strong></li>

View File

@@ -99,6 +99,7 @@
<th class="ps-3">Staff Member</th>
<th>Designation</th>
<th>Reports Submitted</th>
<th>Report Points</th>
<th class="text-end pe-3">Performance (Approx)</th>
</tr>
</thead>
@@ -124,6 +125,11 @@
<span class="badge bg-primary rounded-pill px-3">{{ $staff->daily_reports_count }}</span>
<span class="text-muted small ms-1">/ ~{{ $workDays }} expected</span>
</td>
<td>
<span class="badge bg-warning bg-opacity-10 text-dark border border-warning-subtle">
<i class="bi bi-star-fill text-warning me-1"></i>{{ number_format($staff->report_points ?? 0) }}
</span>
</td>
<td class="text-end pe-3" style="width: 25%;">
<div class="d-flex align-items-center justify-content-end">
<span class="fw-bold me-2" style="font-size: 0.8rem;">{{ $completionPercentage }}%</span>

View File

@@ -117,7 +117,7 @@
</div>
</div>
<h6 class="fw-bold mb-3 text-secondary text-uppercase" style="font-size: 0.75rem;">Multi-Entry & Services Configuration</h6>
<h6 class="fw-bold mb-3 text-secondary text-uppercase" style="font-size: 0.75rem;">Services | Support & Finance Emails</h6>
<div class="row g-3 mb-4">
<div class="col-md-4">
<label class="form-label text-secondary fw-semibold" style="font-size: 0.85rem;">Services</label>

View File

@@ -49,9 +49,14 @@
<h5 class="fw-bold mb-1 text-dark">{{ $staff->name }}</h5>
<p class="text-secondary small mb-3">{{ $staff->designation ?? 'Staff Member' }}</p>
<span class="badge {{ $staff->status == 'ACTIVE' ? 'bg-success' : 'bg-warning' }} bg-opacity-10 text-{{ $staff->status == 'ACTIVE' ? 'success' : 'warning' }} px-3 py-2 rounded-pill mb-4">
{{ $staff->status }}
</span>
<div class="d-flex justify-content-center gap-2 mb-4">
<span class="badge {{ $staff->status == 'ACTIVE' ? 'bg-success' : 'bg-warning' }} bg-opacity-10 text-{{ $staff->status == 'ACTIVE' ? 'success' : 'warning' }} px-3 py-2 rounded-pill">
{{ $staff->status }}
</span>
<span class="badge bg-warning bg-opacity-10 text-dark border border-warning-subtle px-3 py-2 rounded-pill">
<i class="bi bi-star-fill text-warning me-1"></i> {{ number_format($staff->report_points ?? 0) }} Points
</span>
</div>
<div class="border-top pt-4 text-start">
<h6 class="fw-bold text-secondary mb-3 text-uppercase" style="font-size: 0.75rem; letter-spacing: 1px;">Work Information</h6>
@@ -79,7 +84,13 @@
<div class="fw-medium text-dark small">{{ $staff->hire_date ? date('M d, Y', strtotime($staff->hire_date)) : 'N/A' }}</div>
</div>
</div>
<div class="d-flex align-items-center mb-4">
<div class="bg-warning bg-opacity-10 p-2 rounded me-3 text-warning"><i class="bi bi-star-fill"></i></div>
<div>
<div class="small text-secondary fw-semibold" style="font-size: 0.7rem;">REPORT POINTS</div>
<div class="fw-medium text-dark small"><strong class="text-dark">{{ number_format($staff->report_points ?? 0) }}</strong> Points</div>
</div>
</div>
<a href="{{ route('leave.my_leave') }}" class="btn w-100 fw-bold border text-primary d-flex justify-content-between align-items-center" style="background-color: #f8f9fc;">
<span><i class="bi bi-airplane me-2"></i> Leave Management</span>
<span class="badge bg-primary rounded-pill">{{ $staff->annual_leave_balance }} Days</span>

View File

@@ -129,8 +129,11 @@
<span class="text-secondary text-truncate" style="max-width: 180px;"><i class="bi bi-envelope me-2"></i>{{ $staff->email }}</span>
<a href="mailto:{{ $staff->email }}" class="text-secondary"><i class="bi bi-box-arrow-up-right" style="font-size: 0.7rem;"></i></a>
</div>
<div class="contact-row d-flex align-items-center">
<span class="text-secondary"><i class="bi bi-geo-alt me-2"></i>{{ $staff->location_country ?? 'Not Specified' }}</span>
<div class="contact-row d-flex justify-content-between align-items-center">
<span class="text-secondary text-truncate" style="max-width: 140px;"><i class="bi bi-geo-alt me-2"></i>{{ $staff->location_country ?? 'Not Specified' }}</span>
<span class="badge bg-warning bg-opacity-10 text-dark border border-warning-subtle" title="Accumulated Report Points" style="font-size: 0.65rem;">
<i class="bi bi-star-fill text-warning me-1"></i>{{ number_format($staff->report_points ?? 0) }}
</span>
</div>
</div>
@@ -330,8 +333,16 @@
<div class="fw-medium text-dark small"><span id="viewStaffLeaveBalance">0</span> Days</div>
</div>
<div class="col-md-4">
<div class="text-secondary small fw-semibold">ANNUAL LEAVE BALANCE</div>
<div class="fw-medium text-dark small"><span id="viewStaffLeaveBalance">0</span> Days</div>
<div class="text-secondary small fw-semibold">REWARD POINTS</div>
<div class="fw-medium text-dark small">
<i class="bi bi-star-fill text-warning me-1"></i><span id="viewStaffPoints">0</span>
</div>
</div>
<div class="col-md-4">
<div class="text-secondary small fw-semibold">Date of Birth</div>
<div class="fw-medium text-dark small">
<i class="bi bi-person-bounding-box text-danger me-1"></i><span id="viewStaffDoB">N/A</span>
</div>
</div>
<!-- NEW ROLES SECTION -->
@@ -589,6 +600,8 @@
$('#viewStaffPersonalEmail').text('');
$('#viewStaffLocation').text('');
$('#viewStaffLeaveBalance').text('');
$('#viewStaffPoints').text('...');
$('#viewStaffDoB').text('...');
$('#viewStaffDependentsList').html('<tr><td colspan="4" class="text-center text-secondary py-3">Loading...</td></tr>');
$('#viewStaffRoles').html('<span class="text-muted small">Loading...</span>');
viewModal.show();
@@ -609,6 +622,8 @@
$('#viewStaffPersonalEmail').text(staff.personal_email || 'N/A');
$('#viewStaffLocation').text(staff.location_country || 'N/A');
$('#viewStaffLeaveBalance').text(staff.annual_leave_balance ?? 0);
$('#viewStaffPoints').text(staff.report_points ?? 0);
$('#viewStaffDoB').text(staff.dob ?? 'N/A');
// Status Badge
let badgeClass = staff.status === 'ACTIVE' ? 'bg-success bg-opacity-10 text-success' : 'bg-warning bg-opacity-10 text-warning';