Penambahn P1 Dev
This commit is contained in:
@@ -192,13 +192,17 @@ class PaguController extends Controller
|
||||
return '?';
|
||||
}
|
||||
|
||||
return 'Rp '.number_format($row->pagu, 0, ',', '.');
|
||||
return 'Rp. '.number_format($row->pagu, 0, ',', '.');
|
||||
})
|
||||
->editColumn('pagu_smt1', function ($row) {
|
||||
return 'Rp '.number_format($row->pagu_smt1 ?? 0, 0, ',', '.');
|
||||
->editColumn('pagu_smt1', function ($row) use ($showQuestionMark) {
|
||||
if ($showQuestionMark) {
|
||||
return '?';
|
||||
}
|
||||
|
||||
return 'Rp. '.number_format($row->pagu_smt1 ?? 0, 0, ',', '.');
|
||||
})
|
||||
->editColumn('pagu_smt2', function ($row) {
|
||||
return 'Rp '.number_format($row->pagu_smt2 ?? 0, 0, ',', '.');
|
||||
return 'Rp. '.number_format($row->pagu_smt2 ?? 0, 0, ',', '.');
|
||||
})
|
||||
->rawColumns(['action'])
|
||||
->make(true);
|
||||
|
||||
@@ -192,15 +192,17 @@ class P1Controller extends Controller
|
||||
$previousYear = $bulan === 1 ? $tahun - 1 : $tahun;
|
||||
$jenisPegawai = $request->input('jenis_pegawai');
|
||||
$arah = $request->input('arah', '');
|
||||
$includePppk2025 = $request->boolean('include_pppk_2025');
|
||||
$monthNames = [
|
||||
1 => 'Januari', 2 => 'Februari', 3 => 'Maret', 4 => 'April', 5 => 'Mei', 6 => 'Juni',
|
||||
7 => 'Juli', 8 => 'Agustus', 9 => 'September', 10 => 'Oktober', 11 => 'November', 12 => 'Desember',
|
||||
];
|
||||
|
||||
$baseQuery = function (int $queryYear, int $queryMonth) use ($unit, $jenisPegawai) {
|
||||
$baseQuery = function (int $queryYear, int $queryMonth) use ($unit, $jenisPegawai, $includePppk2025) {
|
||||
return P1::query()
|
||||
->where('tahun', $queryYear)
|
||||
->where('bulan', $queryMonth)
|
||||
->when(! $includePppk2025, fn ($query) => $query->where('nip', 'not like', '%202521%'))
|
||||
->when($unit !== null && $unit !== '', fn ($query) => $query->where('id_unit_kerja', $unit))
|
||||
->when($jenisPegawai === 'dosen' || $jenisPegawai === 'tendik', fn ($query) => $query->whereRaw('LOWER(jenis_pegawai) = ?', [$jenisPegawai]))
|
||||
->get()
|
||||
@@ -522,6 +524,7 @@ class P1Controller extends Controller
|
||||
$tahun = (int) ($request->tahun ?? $tahunNow);
|
||||
$bulan = $request->bulan ?? null;
|
||||
$arah = $request->arah ?? '';
|
||||
$includePppk2025 = $request->boolean('include_pppk_2025');
|
||||
|
||||
$unitIdForModel = ($unit == 99) ? 0 : $unit;
|
||||
|
||||
@@ -544,13 +547,13 @@ class P1Controller extends Controller
|
||||
$namaBulanSekarang = $bulanNames[(int) $bulanNow];
|
||||
$filename = "P1_Perbandingan_Januari_sampai_{$namaBulanSekarang}_{$tahun}{$unitName}.xlsx";
|
||||
|
||||
return Excel::download(new P1PerbandinganExport($jenisPegawai, $tahun, null, $unitIdForModel, $arah), $filename);
|
||||
return Excel::download(new P1PerbandinganExport($jenisPegawai, $tahun, null, $unitIdForModel, $arah, $includePppk2025), $filename);
|
||||
}
|
||||
|
||||
$bulanName = $bulanNames[(int) $bulan];
|
||||
$filename = "P1_Perbandingan_{$bulanName}_{$tahun}{$unitName}.xlsx";
|
||||
|
||||
return Excel::download(new P1PerbandinganExport($jenisPegawai, $tahun, (int) $bulan, $unitIdForModel, $arah), $filename);
|
||||
return Excel::download(new P1PerbandinganExport($jenisPegawai, $tahun, (int) $bulan, $unitIdForModel, $arah, $includePppk2025), $filename);
|
||||
}
|
||||
|
||||
public function logs(Request $request): JsonResponse
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@ use App\Models\Verifikator\Periode;
|
||||
use App\Models\Verifikator\Team;
|
||||
use App\Models\Verifikator\UnitKerjaPegawai;
|
||||
use App\Services\DawaiService;
|
||||
use App\Services\WebPresensiDocumentService;
|
||||
use App\Services\VerifikatorWebhookService;
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
@@ -28,6 +29,8 @@ class HonorerController extends Controller
|
||||
|
||||
protected $periodeAktif;
|
||||
|
||||
private ?string $verificationError = null;
|
||||
|
||||
public function __construct(DawaiService $dawaiService)
|
||||
{
|
||||
$this->dawaiService = $dawaiService;
|
||||
@@ -424,7 +427,7 @@ class HonorerController extends Controller
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Gagal melakukan verifikasi presensi',
|
||||
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -452,7 +455,7 @@ class HonorerController extends Controller
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Gagal melakukan verifikasi presensi',
|
||||
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -601,7 +604,7 @@ class HonorerController extends Controller
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Gagal melakukan verifikasi presensi',
|
||||
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -641,7 +644,7 @@ class HonorerController extends Controller
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Gagal melakukan verifikasi presensi',
|
||||
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -680,14 +683,27 @@ class HonorerController extends Controller
|
||||
'message' => $catatan,
|
||||
]);
|
||||
}
|
||||
// Verifikasi web memakai PDF asli, tanpa proses tanda tangan elektronik.
|
||||
$linkDrive = $status === 'Diterima'
|
||||
? app(WebPresensiDocumentService::class)->upload($pengajuan)
|
||||
: null;
|
||||
if ($status === 'Diterima' && ! $linkDrive) {
|
||||
$this->verificationError = 'Gagal mengunggah PDF ke Google Drive. Periksa file pengajuan dan konfigurasi Drive, lalu coba kembali.';
|
||||
DB::rollBack();
|
||||
|
||||
return null;
|
||||
}
|
||||
$dawai = $this->dawaiService->verifikasiUsulanPresensi($pengajuan->nip, [$pengajuan->tanggal_mulai], $this->status($status), $pengajuan->getRawOriginal('kategori'));
|
||||
if (! $dawai) {
|
||||
Log::error("Presensi DAWAI: $pengajuan->nip ($status)");
|
||||
throw new Exception('Presensi: DAWAI ERROR');
|
||||
}
|
||||
if ($status !== 'Diajukan' && ! $this->dawaiService->kirimVerifikasiPresensi($pengajuan, $status, $catatan, Auth::user()->nip)) {
|
||||
if ($status !== 'Diajukan' && ! $this->dawaiService->kirimVerifikasiPresensi($pengajuan, $status, $catatan, Auth::user()->nip, $linkDrive)) {
|
||||
throw new Exception('Presensi: DAWAI ERROR (siskaPengajuanPresensi)');
|
||||
}
|
||||
if ($linkDrive) {
|
||||
$pengajuan->update(['file' => $linkDrive]);
|
||||
}
|
||||
DB::commit();
|
||||
|
||||
if ($status !== 'Diajukan') {
|
||||
|
||||
@@ -11,6 +11,7 @@ use App\Models\Verifikator\Team;
|
||||
use App\Models\Verifikator\Tendik;
|
||||
use App\Models\Verifikator\UnitKerjaPegawai;
|
||||
use App\Services\DawaiService;
|
||||
use App\Services\WebPresensiDocumentService;
|
||||
use App\Services\VerifikatorWebhookService;
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
@@ -28,6 +29,8 @@ class TendikController extends Controller
|
||||
|
||||
protected $periodeAktif;
|
||||
|
||||
private ?string $verificationError = null;
|
||||
|
||||
public function __construct(DawaiService $dawaiService)
|
||||
{
|
||||
$this->dawaiService = $dawaiService;
|
||||
@@ -401,7 +404,7 @@ class TendikController extends Controller
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Gagal melakukan verifikasi presensi',
|
||||
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -424,7 +427,7 @@ class TendikController extends Controller
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Gagal melakukan verifikasi presensi',
|
||||
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -568,7 +571,7 @@ class TendikController extends Controller
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Gagal melakukan verifikasi presensi',
|
||||
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -603,7 +606,7 @@ class TendikController extends Controller
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Gagal melakukan verifikasi presensi',
|
||||
'message' => $this->verificationError ?? $this->dawaiService->getPresensiError(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -645,14 +648,27 @@ class TendikController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
// Verifikasi web memakai PDF asli, tanpa proses tanda tangan elektronik.
|
||||
$linkDrive = $status === 'Diterima'
|
||||
? app(WebPresensiDocumentService::class)->upload($pengajuan)
|
||||
: null;
|
||||
if ($status === 'Diterima' && ! $linkDrive) {
|
||||
$this->verificationError = 'Gagal mengunggah PDF ke Google Drive. Periksa file pengajuan dan konfigurasi Drive, lalu coba kembali.';
|
||||
DB::rollBack();
|
||||
|
||||
return null;
|
||||
}
|
||||
$dawai = $this->dawaiService->verifikasiUsulanPresensi($pengajuan->nip, [$pengajuan->tanggal_mulai], $this->status($status), $pengajuan->getRawOriginal('kategori'));
|
||||
if (! $dawai) {
|
||||
Log::error("Presensi DAWAI: $pengajuan->nip ($status)");
|
||||
throw new Exception('Presensi: DAWAI ERROR');
|
||||
}
|
||||
if ($status !== 'Diajukan' && ! $this->dawaiService->kirimVerifikasiPresensi($pengajuan, $status, $catatan, Auth::user()->nip)) {
|
||||
if ($status !== 'Diajukan' && ! $this->dawaiService->kirimVerifikasiPresensi($pengajuan, $status, $catatan, Auth::user()->nip, $linkDrive)) {
|
||||
throw new Exception('Presensi: DAWAI ERROR (siskaPengajuanPresensi)');
|
||||
}
|
||||
if ($linkDrive) {
|
||||
$pengajuan->update(['file' => $linkDrive]);
|
||||
}
|
||||
DB::commit();
|
||||
|
||||
if ($status !== 'Diajukan') {
|
||||
|
||||
Reference in New Issue
Block a user