refactor: Yakıt fişi verileri temizlendi ve kullanıcı filtrelemesi iyileştirildi
- Geçici yakıt fişi verileri tamamen temizlendi - Dashboard'da sadece ilgili yakıt sorumlusunun fişleri gösterilir - Onaylı fiş özetinde kullanıcı filtresi eklendi - Bekleyen ve onaylanmış/reddedilmiş fişler kullanıcıya özel listeleniyor 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -148,9 +148,9 @@
|
||||
const data = await slipsResponse.json();
|
||||
const allSlips = data.fuelSlips || [];
|
||||
|
||||
// Sadece onaylı fişleri topla
|
||||
const approvedSlips = allSlips.filter(slip => slip.status === 'approved');
|
||||
fuelSummary = approvedSlips.reduce(
|
||||
// Sadece bu yakıt sorumlusunun onaylı fişlerini topla
|
||||
const myApprovedSlips = allSlips.filter(slip => slip.status === 'approved' && slip.fuel_manager_id === user.id);
|
||||
fuelSummary = myApprovedSlips.reduce(
|
||||
(summary, slip) => {
|
||||
if (slip.fuel_type === 'benzin') {
|
||||
summary.benzin += slip.liters || 0;
|
||||
@@ -162,8 +162,10 @@
|
||||
{ benzin: 0, motorin: 0 }
|
||||
);
|
||||
|
||||
pendingSlips = allSlips.filter(slip => slip.status === 'pending');
|
||||
approvedRejectedSlips = allSlips.filter(slip => slip.status !== 'pending');
|
||||
// Sadece bu yakıt sorumlusunun fişlerini göster
|
||||
const mySlips = allSlips.filter(slip => slip.fuel_manager_id === user.id);
|
||||
pendingSlips = mySlips.filter(slip => slip.status === 'pending');
|
||||
approvedRejectedSlips = mySlips.filter(slip => slip.status !== 'pending');
|
||||
}
|
||||
|
||||
// Form için gerekli veriler
|
||||
|
||||
Reference in New Issue
Block a user