@extends('templates.dashboard') @section('isi')
@csrf
@error('pegawai')
{{ $message }}
@enderror
@php $bulan = array( [ "id" => "1", "bulan" => "Januari" ], [ "id" => "2", "bulan" => "Februari" ], [ "id" => "3", "bulan" => "Maret" ], [ "id" => "4", "bulan" => "April" ], [ "id" => "5", "bulan" => "Mei" ], [ "id" => "6", "bulan" => "Juni" ], [ "id" => "7", "bulan" => "Juli" ], [ "id" => "8", "bulan" => "Agustus" ], [ "id" => "9", "bulan" => "September" ], [ "id" => "10", "bulan" => "Oktober" ], [ "id" => "11", "bulan" => "November" ], [ "id" => "12", "bulan" => "Desember" ]); @endphp
@php $pecah_tanggal = explode("-", $tanggal_mulai); $tahun_filter = $pecah_tanggal[0]; $bulan_filter = $pecah_tanggal[1]; @endphp @error('bulan')
{{ $message }}
@enderror
@php $last = date('Y')-10; $now = date('Y'); @endphp
@error('tahun')
{{ $message }}
@enderror
@php $jumlah_hadir = $user->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', '=', 'Masuk')->count(); $jumlah_izin_telat = $user->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', 'Izin Telat')->count(); $jumlah_izin_pulang_cepat = $user->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', 'Izin Pulang Cepat')->count(); $libur = $user->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', 'Libur')->count(); $timestamp_mulai = strtotime($tanggal_mulai); $timestamp_akhir = strtotime($tanggal_akhir); $selisih_timestamp = $timestamp_akhir - $timestamp_mulai; $jumlah_hari = (floor($selisih_timestamp / (60 * 60 * 24)))+1; $persentase_kehadiran = (($jumlah_hadir + $jumlah_izin_telat + $jumlah_izin_pulang_cepat + $libur) / $jumlah_hari) * 100; @endphp @error('persentase_kehadiran')
{{ $message }}
@enderror
@error('jabatan')
{{ $message }}
@enderror
@error('no_gaji')
{{ $message }}
@enderror
@error('tanggal_mulai')
{{ $message }}
@enderror
@error('tanggal_akhir')
{{ $message }}
@enderror
@error('gaji_pokok')
{{ $message }}
@enderror
@error('uang_transport')
{{ $message }}
@enderror
@php $sisa_reimbursement = $user->reimbursement->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status', 'Approved')->sum('sisa'); $fee_reimbursement = App\Models\ReimbursementsItem::whereHas('reimbursement', function ($query) use ($tanggal_mulai, $tanggal_akhir) { $query->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status', 'Approved'); })->where('user_id', $user->id)->sum('fee'); $total_reimbursement = $sisa_reimbursement + $fee_reimbursement; @endphp
Total Reimbursement
@error('total_reimbursement')
{{ $message }}
@enderror
@php $cuti = $user->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', 'Cuti')->count(); $izin_masuk = $user->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('status_absen', 'Izin Masuk')->count(); $mulai = new \DateTime($tanggal_mulai); $akhir = new \DateTime($tanggal_akhir); $interval = $mulai->diff($akhir); $total_alfa = $interval->days + 1 - $jumlah_hadir - $cuti - $izin_masuk - $libur; @endphp
/ Kali
@error('jumlah_mangkir')
{{ $message }}
@enderror
Uang Mangkir
@error('uang_mangkir')
{{ $message }}
@enderror
@php $total_lembur = $user->Lembur->where('status', 'Approved')->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->sum('total_lembur'); $jam = floor($total_lembur / (60 * 60)); @endphp
/ Jam
@error('jumlah_lembur')
{{ $message }}
@enderror
Uang Lembur
@error('uang_lembur')
{{ $message }}
@enderror
@php $jumlah_izin = $user->Cuti->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('nama_cuti', 'Izin Masuk')->where('status_cuti', 'Diterima')->count(); @endphp
/ Kali
@error('jumlah_izin')
{{ $message }}
@enderror
Uang Izin
@error('izin')
{{ $message }}
@enderror
/ Kali
@error('jumlah_bonus')
{{ $message }}
@enderror
Uang Bonus
@error('uang_bonus')
{{ $message }}
@enderror
@php $jumlah_terlambat = $user->MappingShift->whereBetween('tanggal', [$tanggal_mulai, $tanggal_akhir])->where('telat', '>', 0)->count(); @endphp
/ Kali
@error('jumlah_terlambat')
{{ $message }}
@enderror
Uang Terlambat
@error('uang_terlambat')
{{ $message }}
@enderror
@php if ($persentase_kehadiran == 100) { $jumlah_kehadiran = 1; } else { $jumlah_kehadiran = 0; } @endphp
/ Kali
@error('jumlah_kehadiran')
{{ $message }}
@enderror
Uang 100% Kehadiran
@error('uang_kehadiran')
{{ $message }}
@enderror
Total Kasbon
@error('saldo_kasbon')
{{ $message }}
@enderror
Bayar Kasbon
@error('bayar_kasbon')
{{ $message }}
@enderror
/ Kali
@error('jumlah_thr')
{{ $message }}
@enderror
Uang THR
@error('uang_thr')
{{ $message }}
@enderror
@error('loss')
{{ $message }}
@enderror
@push('script') @endpush @endsection