added box komen on teller and added audit trail and added endpoints for laporan

This commit is contained in:
Hafifie PKB
2025-06-30 12:40:19 +08:00
parent adf0226f2b
commit 448402061f
6 changed files with 289 additions and 25 deletions
@@ -26,6 +26,7 @@ use Carbon\Carbon;
use App\imbangdugalama;
use App\Services\Reports\ImbangDugaService;
use App\Services\Reports\Account\GeneralLedger;
use App\Mohonid;
use Illuminate\Support\Facades\Log;
@@ -1698,4 +1699,47 @@ $date = new Carbon($request->tarikh);
return response()->json($array_imbangduga,200);
}
public function getLaporanKelulusan(Request $request){
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
$laporan_kelulusan = Mohonid::on($cawangan['mysql'])
->whereBetween('tarikh', [$request->mula, $request->akhir])
->when($request->mohon, function($query, $mohon) {
return $query->where('mohon', $mohon);
})
->get();
if($laporan_kelulusan->isEmpty()){
return response()->json(['message' => 'No data found'], 404);
}
return response()->json([
'success' => true,
'message' => 'Laporan kelulusan retrieved successfully',
'data' => $laporan_kelulusan,
'count' => $laporan_kelulusan->count(),
'timestamp' => Carbon::now()->toISOString()
], 200);
}
public function getListofKelulusan(Request $request){
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
$laporan_kelulusan = Mohonid::on($cawangan['mysql'])
->groupBy('mohon')
->pluck('mohon');
if($laporan_kelulusan->isEmpty()){
return response()->json(['message' => 'No data found'], 404);
}
return response()->json([
'success' => true,
'message' => 'List of Type Kelulusan retrieved successfully',
'data' => $laporan_kelulusan,
'count' => $laporan_kelulusan->count(),
'timestamp' => Carbon::now()->toISOString()
], 200);
}
}