feat: Add Aylık Yakıt Dökümü (Monthly Fuel Report) feature for goods managers

- Add new sidebar menu item "Aylık Yakıt Dökümü" with fa-list-ol icon
- Implement year selection dropdown with current year and 3 previous years
- Create collapsible accordion interface for monthly fuel data
- Display approved fuel slips grouped by month with expandable sections
- Show S.No, Araç Plakası, Tarih, Yakıt Cinsi, Miktar, Teslim Alan, Teslim Eden columns
- Filter data by selected year and goods manager ID
- Sort data chronologically within each month
- Hide future months from display
- Include year summary statistics and empty state handling
- Responsive design matching existing UI patterns
- Turkish month names and localization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-06 20:26:19 +03:00
parent 2a922c735e
commit b978902c7f
3 changed files with 808 additions and 2 deletions

View File

@@ -7,7 +7,9 @@
import PersonnelContent from '$lib/components/PersonnelContent.svelte';
import GoodsManagersContent from '$lib/components/GoodsManagersContent.svelte';
import GoodsManagerContent from '$lib/components/GoodsManagerContent.svelte';
import DevriçarkContent from '$lib/components/DevriçarkContent.svelte';
import MonthlyFuelReportContent from '$lib/components/MonthlyFuelReportContent.svelte';
let user = null;
let loading = true;
let currentTime = '';
@@ -18,6 +20,8 @@
let showUnits = false;
let showPersonnel = false;
let showGoodsManagers = false;
let showDevriçark = false;
let showMonthlyReport = false;
let socket = null;
// Admin state reset function
@@ -28,6 +32,8 @@
showGoodsManagers = false;
showFuelForm = false;
showGoodsManager = false;
showDevriçark = false;
showMonthlyReport = false;
}
@@ -350,6 +356,8 @@
if (page === '' && user?.role === 'goods_manager') {
showGoodsManager = false;
showDevriçark = false;
showMonthlyReport = false;
showMobileMenu = false;
return;
}
@@ -357,6 +365,26 @@
if (page === 'goods-manager' && user?.role === 'goods_manager') {
console.log('🎯 Navigating to goods-manager, user:', user);
showGoodsManager = true;
showDevriçark = false;
showMonthlyReport = false;
showMobileMenu = false;
return;
}
if (page === 'devriçark' && user?.role === 'goods_manager') {
console.log('🎯 Navigating to devriçark, user:', user);
showGoodsManager = false;
showDevriçark = true;
showMonthlyReport = false;
showMobileMenu = false;
return;
}
if (page === 'aylik-yakit-dokumu' && user?.role === 'goods_manager') {
console.log('🎯 Navigating to aylik-yakit-dokumu, user:', user);
showGoodsManager = false;
showDevriçark = false;
showMonthlyReport = true;
showMobileMenu = false;
return;
}
@@ -455,7 +483,7 @@
</div>
<ul class="nav-menu">
<li class="nav-item">
<button class="nav-btn" on:click={() => navigateTo('')} class:active={user.role === 'admin' ? !showVehicles && !showUnits && !showPersonnel && !showGoodsManagers : (user.role === 'goods_manager' ? !showGoodsManager : (user.role !== 'fuel_manager' ? !showFuelForm : true))}>
<button class="nav-btn" on:click={() => navigateTo('')} class:active={user.role === 'admin' ? !showVehicles && !showUnits && !showPersonnel && !showGoodsManagers : (user.role === 'goods_manager' ? !showGoodsManager && !showDevriçark && !showMonthlyReport : (user.role !== 'fuel_manager' ? !showFuelForm : true))}>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>
<polyline points="9 22 9 12 15 12 15 22"/>
@@ -541,6 +569,18 @@
Atanan Fişler
</button>
</li>
<li class="nav-item">
<button class="nav-btn" on:click={() => navigateTo('aylik-yakit-dokumu')} class:active={showMonthlyReport}>
<i class="fa-solid fa-list-ol"></i>
Aylık Yakıt Dökümü
</button>
</li>
<li class="nav-item">
<button class="nav-btn" on:click={() => navigateTo('devriçark')} class:active={showDevriçark}>
<i class="fa-regular fa-file-lines"></i>
Devriçark İşlemleri
</button>
</li>
{/if}
</ul>
</nav>
@@ -681,6 +721,12 @@
{:else if user.role === 'goods_manager' && showGoodsManager}
<!-- Goods Manager Content -->
<GoodsManagerContent {user} />
{:else if user.role === 'goods_manager' && showMonthlyReport}
<!-- Monthly Fuel Report Content -->
<MonthlyFuelReportContent {user} />
{:else if user.role === 'goods_manager' && showDevriçark}
<!-- Devriçark Content -->
<DevriçarkContent {user} />
{:else if user.role === 'admin'}
<!-- Admin Dynamic Content -->