Penambahan Placeholder Verifikasi Absen
This commit is contained in:
@@ -560,21 +560,19 @@ class HonorerController extends Controller
|
||||
|
||||
// Cek apakah ada pengajuan yang sudah diverifikasi atau ditolak
|
||||
$nonDiajukanCount = PengajuanPresensi::whereIn('id', $request->ids)
|
||||
->where('status', '!=', 'Diajukan')
|
||||
->whereNotIn('status', ['Diajukan', 'Diterima'])
|
||||
->count();
|
||||
|
||||
if ($nonDiajukanCount > 0) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Tidak dapat menghapus pengajuan yang sudah diverifikasi atau ditolak',
|
||||
'message' => 'Tidak dapat menghapus pengajuan yang sudah ditolak',
|
||||
], 422);
|
||||
}
|
||||
|
||||
// Soft delete multiple records (hanya yang status "Diajukan")
|
||||
$dihapus = PengajuanPresensi::whereIn('id', $request->ids)->where('status', 'Diajukan')->get();
|
||||
$deletedCount = PengajuanPresensi::whereIn('id', $request->ids)
|
||||
->where('status', 'Diajukan')
|
||||
->delete();
|
||||
// Soft delete multiple records (status "Diajukan" atau "Diterima")
|
||||
$dihapus = PengajuanPresensi::whereIn('id', $request->ids)->get();
|
||||
$deletedCount = PengajuanPresensi::whereIn('id', $request->ids)->delete();
|
||||
|
||||
foreach ($dihapus as $item) {
|
||||
(new VerifikatorWebhookService)->kirimIzin($item, VerifikatorWebhookService::STATUS_DELETED);
|
||||
|
||||
@@ -527,21 +527,19 @@ class TendikController extends Controller
|
||||
|
||||
// Cek apakah ada pengajuan yang sudah diverifikasi atau ditolak
|
||||
$nonDiajukanCount = PengajuanPresensi::whereIn('id', $request->ids)
|
||||
->where('status', '!=', 'Diajukan')
|
||||
->whereNotIn('status', ['Diajukan', 'Diterima'])
|
||||
->count();
|
||||
|
||||
if ($nonDiajukanCount > 0) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Tidak dapat menghapus pengajuan yang sudah diverifikasi atau ditolak',
|
||||
'message' => 'Tidak dapat menghapus pengajuan yang sudah ditolak',
|
||||
], 422);
|
||||
}
|
||||
|
||||
// Soft delete multiple records (hanya yang status "Diajukan")
|
||||
$dihapus = PengajuanPresensi::whereIn('id', $request->ids)->where('status', 'Diajukan')->get();
|
||||
$deletedCount = PengajuanPresensi::whereIn('id', $request->ids)
|
||||
->where('status', 'Diajukan')
|
||||
->delete();
|
||||
// Soft delete multiple records (status "Diajukan" atau "Diterima")
|
||||
$dihapus = PengajuanPresensi::whereIn('id', $request->ids)->get();
|
||||
$deletedCount = PengajuanPresensi::whereIn('id', $request->ids)->delete();
|
||||
|
||||
foreach ($dihapus as $item) {
|
||||
(new VerifikatorWebhookService)->kirimIzin($item, VerifikatorWebhookService::STATUS_DELETED);
|
||||
|
||||
@@ -213,12 +213,12 @@
|
||||
<h6>Setujui & Tanda Tangani Dokumen</h6>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">NIK</label>
|
||||
<input type="text" class="form-control" name="nik" required>
|
||||
<input type="text" class="form-control" name="nik" placeholder="Masukkan NIK" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Passphrase</label>
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control" name="passphrase" required>
|
||||
<input type="password" class="form-control" name="passphrase" placeholder="Masukkan Passphrase" required>
|
||||
<button type="button" class="btn btn-outline-secondary" id="togglePassphrase" aria-label="Tampilkan passphrase">
|
||||
<i class="fas fa-eye"></i>
|
||||
</button>
|
||||
@@ -234,7 +234,7 @@
|
||||
<h6>Tolak Pengajuan</h6>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Catatan Penolakan</label>
|
||||
<textarea class="form-control" name="catatan" rows="3" maxlength="500" required></textarea>
|
||||
<textarea class="form-control" name="catatan" rows="3" maxlength="500" placeholder="Masukkan Keterangan" required></textarea>
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-tolak text-white flex-fill">Kirim Penolakan</button>
|
||||
|
||||
@@ -571,6 +571,7 @@
|
||||
}
|
||||
var ids = getSelectedIds();
|
||||
if (ids.length === 0) { showWarning('Peringatan', 'Pilih minimal satu item'); return; }
|
||||
if (hasSelectedDiterima()) { showInfo('Informasi', 'Pengajuan sudah diterima'); return; }
|
||||
$('#modal-terima-msg').text('Apakah Anda yakin akan menerima ' + ids.length + ' pengajuan yang dipilih?');
|
||||
$('#modalTerimaSelected').modal('show');
|
||||
});
|
||||
@@ -604,6 +605,7 @@
|
||||
}
|
||||
var ids = getSelectedIds();
|
||||
if (ids.length === 0) { showWarning('Peringatan', 'Pilih minimal satu item'); return; }
|
||||
if (hasSelectedDiterima()) { showInfo('Informasi', 'Pengajuan sudah diterima'); return; }
|
||||
$('#modal-tolak-msg').text('Anda akan menolak ' + ids.length + ' pengajuan yang dipilih.');
|
||||
$('#modal-tolak-catatan').val('');
|
||||
$('#modal-tolak-error').hide();
|
||||
@@ -869,7 +871,6 @@
|
||||
$('#btn-hapus-selected').on('click', function() {
|
||||
var ids = getSelectedIds();
|
||||
if (ids.length === 0) { showWarning('Peringatan', 'Pilih minimal satu item untuk dihapus'); return; }
|
||||
if (hasSelectedDiterima()) { showWarning('Peringatan', 'Pengajuan yang sudah diterima tidak dapat dihapus'); return; }
|
||||
$('#modal-hapus-msg').text('Anda akan menghapus ' + ids.length + ' pengajuan secara permanen.');
|
||||
$('#modalHapusSelected').modal('show');
|
||||
});
|
||||
|
||||
@@ -532,6 +532,7 @@
|
||||
$('#btn-terima-selected').on('click', function() {
|
||||
var ids = getSelectedIds();
|
||||
if (ids.length === 0) { showWarning('Peringatan', 'Pilih minimal satu item'); return; }
|
||||
if (hasSelectedDiterima()) { showInfo('Informasi', 'Pengajuan sudah diterima'); return; }
|
||||
$('#modal-terima-msg').text('Apakah Anda yakin akan menerima ' + ids.length + ' pengajuan yang dipilih?');
|
||||
$('#modalTerimaSelected').modal('show');
|
||||
});
|
||||
@@ -561,6 +562,7 @@
|
||||
$('#btn-tolak-selected').on('click', function() {
|
||||
var ids = getSelectedIds();
|
||||
if (ids.length === 0) { showWarning('Peringatan', 'Pilih minimal satu item'); return; }
|
||||
if (hasSelectedDiterima()) { showInfo('Informasi', 'Pengajuan sudah diterima'); return; }
|
||||
$('#modal-tolak-msg').text('Anda akan menolak ' + ids.length + ' pengajuan yang dipilih.');
|
||||
$('#modal-tolak-catatan').val('');
|
||||
$('#modal-tolak-error').hide();
|
||||
@@ -602,7 +604,6 @@
|
||||
$('#btn-hapus-selected').on('click', function() {
|
||||
var ids = getSelectedIds();
|
||||
if (ids.length === 0) { showWarning('Peringatan', 'Pilih minimal satu item'); return; }
|
||||
if (hasSelectedDiterima()) { showWarning('Peringatan', 'Pengajuan yang sudah diterima tidak dapat dihapus'); return; }
|
||||
$('#modal-hapus-msg').text('Anda akan menghapus ' + ids.length + ' pengajuan yang dipilih.');
|
||||
$('#modalHapusSelected').modal('show');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user