feat(breadcrumbs): tambahkan breadcrumbs pada halaman laporan SLA, debiture, user, dan monitoring; perbarui route laporan SLA, debiture, user, dan monitoring
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
namespace Modules\Lpj\Services;
|
||||
|
||||
use Modules\Lpj\Models\Laporan;
|
||||
|
||||
use Modules\Lpj\Models\Noc;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
class DashboardService
|
||||
{
|
||||
public function getDashboardData($start_date, $end_date)
|
||||
@@ -11,11 +13,13 @@ class DashboardService
|
||||
$countLpjInternal = $this->getTotalLpjInternal($start_date, $end_date);
|
||||
$countLpjExternal = $this->getTotalLpjEksternal($start_date, $end_date);
|
||||
$countResume = $this->getResumeCabang($start_date, $end_date);
|
||||
$countPendapatan = $this->getPendapatanAppraisal($start_date, $end_date);
|
||||
|
||||
return [
|
||||
'count_lpj_internal' => $countLpjInternal,
|
||||
'count_lpj_eksternal' => $countLpjExternal,
|
||||
'count_resume' => $countResume
|
||||
'count_resume' => $countResume,
|
||||
'count_pendapatan' => $countPendapatan
|
||||
];
|
||||
|
||||
}
|
||||
@@ -43,12 +47,16 @@ class DashboardService
|
||||
|
||||
$totalLaporan = Laporan::whereBetween('created_at', [$start_date, $end_date])
|
||||
->count();
|
||||
$totalDebitur = Permohonan::whereBetween('created_at', [$start_date, $end_date])
|
||||
->where('status', 'done')
|
||||
->distinct()
|
||||
->count('debiture_id');
|
||||
|
||||
|
||||
|
||||
$data[$month][$region] = [
|
||||
'total_laporan' => $totalLaporan,
|
||||
'total_debiture' => 20,
|
||||
'total_debiture' => $totalDebitur,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -58,11 +66,37 @@ class DashboardService
|
||||
|
||||
|
||||
|
||||
public function getPendapatanAppraisal()
|
||||
{
|
||||
|
||||
public function getPendapatanAppraisal($start_date, $end_date)
|
||||
{
|
||||
$months = $this->getMonthly();
|
||||
$data = [];
|
||||
|
||||
foreach ($months as $index => $month) {
|
||||
$monthNumber = $index + 1;
|
||||
|
||||
if ($monthNumber > now()->month) {
|
||||
// Bulan belum terjadi
|
||||
$data[$month] = [
|
||||
'total_jumlah' => 0,
|
||||
'total_akumulasi' => 0,
|
||||
];
|
||||
} else {
|
||||
// Hitung jumlah nominal_bayar pada bulan ini
|
||||
$totalJumlah = Noc::whereYear('tanggal_pembayaran', now()->year)
|
||||
->whereMonth('tanggal_pembayaran', $monthNumber)
|
||||
->sum('nominal_bayar');
|
||||
|
||||
|
||||
$data[$month] = [
|
||||
'total_jumlah' => $totalJumlah,
|
||||
'total_akumulasi' => $totalJumlah,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getResumeCabang($start_date, $end_date)
|
||||
{
|
||||
$regions = $this->getRegion();
|
||||
@@ -72,7 +106,12 @@ class DashboardService
|
||||
foreach ($status as $item) {
|
||||
$data[$item] = [];
|
||||
foreach ($regions as $region) {
|
||||
$totalLaporan = Laporan::where('created_at', '>=', $start_date)->where('created_at', '<=', $end_date)->count();
|
||||
$totalLaporan = DB::table('laporan')
|
||||
->join('permohonan', 'laporan.permohonan_id', '=', 'permohonan.id')
|
||||
->where('permohonan.status', $item)
|
||||
->whereBetween('laporan.created_at', [$start_date, $end_date])
|
||||
->count();
|
||||
|
||||
$data[$item][$region] = [
|
||||
'count_report' => $totalLaporan,
|
||||
];
|
||||
@@ -95,9 +134,15 @@ class DashboardService
|
||||
];
|
||||
} else {
|
||||
$totalLaporan = Laporan::where('created_at', '>=', $start_date)->where('created_at', '<=', $end_date)->count();
|
||||
|
||||
$totalDebitur = Permohonan::whereBetween('created_at', [$start_date, $end_date])
|
||||
->where('status', 'done')
|
||||
->distinct()
|
||||
->count('debiture_id');
|
||||
|
||||
$data[$month] = [
|
||||
'total_laporan' => $totalLaporan,
|
||||
'total_debiture' => 20,
|
||||
'total_debiture' => $totalDebitur,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
54
module.json
54
module.json
@@ -129,7 +129,7 @@
|
||||
]
|
||||
}, {
|
||||
"title": "Laporan Biaya Lpj",
|
||||
"path": "",
|
||||
"path": "laporan-biaya",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
@@ -179,6 +179,58 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
},{
|
||||
"title": "Laporan Debitur",
|
||||
"path": "laporan-debiture",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"senior-officer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Laporan User",
|
||||
"path": "laporan-user",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"senior-officer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Laporan Monitoring so",
|
||||
"path": "laporan-monitoring",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"senior-officer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Laporan SLA Penilai",
|
||||
"path": "laporan-sla-penilai",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao",
|
||||
"pemohon-eo",
|
||||
"admin",
|
||||
"DD Appraisal",
|
||||
"EO Appraisal",
|
||||
"senior-officer"
|
||||
]
|
||||
}
|
||||
],
|
||||
"otorisator": [
|
||||
|
||||
@@ -18,7 +18,9 @@
|
||||
<input type="date" class="input" name="start_date" id="start_date">
|
||||
<input type="date" class="input" name="end_date" id="end_date">
|
||||
</div>
|
||||
<button class="btn btn-primary" id="filter" type="button" onclick="filterDashboard()">Filter</button>
|
||||
<button class="btn btn-primary" id="filter" type="button" onclick="filterDashboard()">
|
||||
<i class="ki-outline ki-filter fs-2 me-1"></i>
|
||||
Filter</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -100,7 +102,45 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="bg-white rounded-xl p-4 shadow-sm">
|
||||
<canvas id="bar-chart" class="w-full h-80"></canvas>
|
||||
<table class="table table-auto w-full">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th
|
||||
class="px-4 py-3 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||
Bulan
|
||||
</th>
|
||||
<th
|
||||
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||
Jumlah
|
||||
</th>
|
||||
<th
|
||||
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider">
|
||||
Akumulasi
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-200">
|
||||
@foreach ($dashboard['count_pendapatan'] as $month => $data)
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<!-- Kolom Nama month -->
|
||||
<td class="px-4 py-3 text-sm font-medium text-gray-900 border-r border-gray-200">
|
||||
{{ ucfirst($month) }}
|
||||
</td>
|
||||
|
||||
<!-- Kolom Total Laporan -->
|
||||
<td class="px-4 py-3 text-sm text-gray-700 text-center border-r border-gray-200">
|
||||
{{ $data['total_jumlah'] ?? '-' }}
|
||||
</td>
|
||||
|
||||
<!-- Kolom Total Debitur -->
|
||||
<td class="px-4 py-3 text-sm text-gray-700 text-center border-r border-gray-200">
|
||||
{{ $data['total_akumulasi'] ?? '-' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<!-- Add more rows as needed -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -249,121 +289,5 @@
|
||||
}
|
||||
</script>
|
||||
<!-- Chart initialization script -->
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Get the canvas element
|
||||
const ctx = document.getElementById('bar-chart').getContext('2d');
|
||||
|
||||
// Create the bar chart
|
||||
const barChart = new Chart(ctx, {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov',
|
||||
'Dec'
|
||||
],
|
||||
datasets: [{
|
||||
label: 'Jumlah',
|
||||
data: [1200000, 1900000, 3000000, 5000000, 2000000, 3000000, 4500000,
|
||||
3200000, 2800000, 4100000, 3600000, 4800000
|
||||
],
|
||||
backgroundColor: 'rgba(59, 130, 246, 0.8)', // Blue color
|
||||
borderColor: 'rgba(59, 130, 246, 1)',
|
||||
borderWidth: 1,
|
||||
borderRadius: 4,
|
||||
borderSkipped: false
|
||||
}, {
|
||||
label: 'Akumulasi',
|
||||
data: [800000, 1200000, 1800000, 2200000, 1500000, 2000000, 2800000,
|
||||
2100000, 1900000, 2500000, 2300000, 3100000
|
||||
],
|
||||
backgroundColor: 'rgba(16, 185, 129, 0.8)', // Green color
|
||||
borderColor: 'rgba(16, 185, 129, 1)',
|
||||
borderWidth: 1,
|
||||
borderRadius: 4,
|
||||
borderSkipped: false
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
plugins: {
|
||||
|
||||
legend: {
|
||||
display: true,
|
||||
position: 'top',
|
||||
labels: {
|
||||
font: {
|
||||
size: 12
|
||||
},
|
||||
color: '#374151',
|
||||
usePointStyle: true,
|
||||
padding: 20
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.8)',
|
||||
titleColor: '#ffffff',
|
||||
bodyColor: '#ffffff',
|
||||
borderColor: 'rgba(0, 0, 0, 0.8)',
|
||||
borderWidth: 1,
|
||||
cornerRadius: 6,
|
||||
displayColors: true,
|
||||
callbacks: {
|
||||
label: function(context) {
|
||||
let label = context.dataset.label || '';
|
||||
if (label) {
|
||||
label += ': ';
|
||||
}
|
||||
label += 'Rp ' + context.parsed.y.toLocaleString('id-ID');
|
||||
return label;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
grid: {
|
||||
display: false
|
||||
},
|
||||
ticks: {
|
||||
color: '#6b7280',
|
||||
font: {
|
||||
size: 11
|
||||
}
|
||||
}
|
||||
},
|
||||
y: {
|
||||
beginAtZero: true,
|
||||
grid: {
|
||||
color: 'rgba(229, 231, 235, 0.8)',
|
||||
borderDash: [2, 2]
|
||||
},
|
||||
ticks: {
|
||||
color: '#6b7280',
|
||||
font: {
|
||||
size: 11
|
||||
},
|
||||
callback: function(value) {
|
||||
if (value >= 1000000) {
|
||||
return 'Rp ' + (value / 1000000) + 'M';
|
||||
} else if (value >= 1000) {
|
||||
return 'Rp ' + (value / 1000) + 'K';
|
||||
}
|
||||
return 'Rp ' + value;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
interaction: {
|
||||
intersect: false,
|
||||
mode: 'index'
|
||||
},
|
||||
animation: {
|
||||
duration: 1000,
|
||||
easing: 'easeInOutQuart'
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render('laporan-hasil-penilaian-jaminan-internal-external') }} --}}
|
||||
{{ Breadcrumbs::render('laporan-debiture') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render('laporan-hasil-penilaian-jaminan-internal-external') }} --}}
|
||||
{{ Breadcrumbs::render('laporan-monitoring') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render('laporan-hasil-penilaian-jaminan-internal-external') }} --}}
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render('laporan-penilaian-jaminan') }} --}}
|
||||
{{ Breadcrumbs::render('laporan-sla-penilai') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render('laporan-hasil-penilaian-jaminan-internal-external') }} --}}
|
||||
{{ Breadcrumbs::render('laporan-user') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
@@ -761,5 +761,26 @@ Breadcrumbs::for('rekap-harian-so', function ($trail) {
|
||||
$trail->push('Rekap Harian');
|
||||
});
|
||||
|
||||
|
||||
Breadcrumbs::for('laporan-user', function ($trail) {
|
||||
$trail->push('Laporan User Pemohonan', route('laporan-user.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-monitoring', function ($trail) {
|
||||
$trail->push('Laporan Monitoring', route('laporan-monitoring.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-monitoring.show', function ($trail) {
|
||||
$trail->parent('laporan-monitoring');
|
||||
$trail->push('Detail');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-debiture', function ($trail) {
|
||||
$trail->push('Laporan Debiture', route('laporan-debiture.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-sla-penilai', function ($trail) {
|
||||
$trail->push('Laporan SLA Penilai', route('laporan-sla-penilai.index'));
|
||||
});
|
||||
// add andy
|
||||
require __DIR__ . '/breadcrumbs_registrasi.php';
|
||||
|
||||
@@ -46,6 +46,12 @@ use Modules\Lpj\Http\Controllers\TujuanPenilaianKJPPController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanPenilaiJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\RekapHarianSoController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanBiayaInternalExternalController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanMonitoringSoController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanDebitureController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanUserController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanSLAPenilaiController;
|
||||
|
||||
|
||||
|
||||
// use Modules\Lpj\Http\Controllers\ActivityController;
|
||||
|
||||
@@ -725,13 +731,40 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('/', [LaporanHasilPenilaianJaminanInternalExternalController::class, 'index'])->name('index');
|
||||
});
|
||||
|
||||
// rekap harian so
|
||||
Route::resource('rekap-harian-so', RekapHarianSoController::class);
|
||||
|
||||
// laporan biaya
|
||||
Route::prefix('laporan-biaya')->name('laporan-biaya.')->group(function () {
|
||||
Route::get('internal', [LaporanBiayaInternalExternalController::class, 'showLaporanBiayaInternal'])->name('internal.index');
|
||||
Route::get('external', [LaporanBiayaInternalExternalController::class, 'showLaporanBiayaExternal'])->name('external.index');
|
||||
});
|
||||
});
|
||||
|
||||
// laporan user
|
||||
Route::prefix('laporan-user')->name('laporan-user.')->group(function () {
|
||||
Route::get('/', [LaporanUserController::class, 'index'])->name('index');
|
||||
Route::get('api/user-pemohon', [LaporanUserController::class, 'searchUserPemohon'])->name('api.user-pemohon');
|
||||
Route::get('datatables', [LaporanUserController::class, 'dataTableForUserPemohon'])->name('datatables');
|
||||
});
|
||||
|
||||
// laporan monitoring
|
||||
Route::prefix('laporan-monitoring')->name('laporan-monitoring.')->group(function () {
|
||||
Route::get('/', [LaporanMonitoringSoController::class, 'index'])->name('index');
|
||||
Route::get('/{id}/detail', [LaporanMonitoringSoController::class, 'show'])->name('show');
|
||||
Route::get('datatables/{id}', [LaporanMonitoringSoController::class, 'dataForDatatablePenilai'])->name('datatables');
|
||||
});
|
||||
|
||||
// laporan debiture
|
||||
Route::prefix('laporan-debiture')->name('laporan-debiture.')->group(function () {
|
||||
Route::get('/', [LaporanDebitureController::class, 'index'])->name('index');
|
||||
Route::get('datatables', [LaporanDebitureController::class, 'dataTableForDebiture'])->name('datatables');
|
||||
});
|
||||
|
||||
// laporan sla
|
||||
Route::prefix('laporan-sla-penilai')->name('laporan-sla-penilai.')->group(function () {
|
||||
Route::get('/', [LaporanSLAPenilaiController::class, 'index'])->name('index');
|
||||
Route::get('datatables', [LaporanSLAPenilaiController::class, 'dataForDatatableSLaPenilai'])->name('datatables');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user