| {{ $company['name'] }} | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $company['department'] }} | ||||||||||||||||||||||
| {{ $selected_date }} | ||||||||||||||||||||||
| No | Nama Karyawan | Status | Tanggungan | Jabatan | Departemen | Perusahaan | Penghasilan | PPH | BPJS Kesehatan | BPJS Ketenagakerjaan | Utang | Statutory Deduction |
Absensi | Gaji Bersih | Status Pembayaran | |||||||
| Gaji Pokok | Tunjangan | Komisi | Lembur | Other Payment |
BPJS Pensiun | BPJS JHT | BPJS JKK | BPJS JKM | ||||||||||||||
| {{ $no }} | {{ $employee->first_name }} {{ $employee->last_name }} | {{ $employee->marital_status }} | {{ $employee->dependent }} | {{ $employee->designation->designation_name }} | {{ $employee->department->department_name }} | {{ $employee->company->company_name }} | @php foreach ($employee->salaryBasic as $salaryBasic) { if ($salaryBasic->first_date <= $first_date) { $basicsalary = $salaryBasic->basic_salary; //basic salary $basicsalary = $basicsalary; } } @endphp {{ $basicsalary }} | @php $prev_month = \Carbon\Carbon::createFromFormat('Y-m-d', $first_date)->subMonth(); $cut_off_start = $prev_month->day(16); $cut_off_end = \Carbon\Carbon::createFromFormat('Y-m-d', $first_date)->day(15); $attendances = $employee->reportAttendances->where('attendance_date', '>=', $cut_off_start)->where('attendance_date', '<=', $cut_off_end); $work_days = $attendances->count(); $number_cut = $employee->reportAttendances->where('attendance_date', '>=', $cut_off_start)->where('attendance_date', '<=', $cut_off_end)->whereIn('status', ['TA1', 'TA2', 'TA3'])->where('is_checked', 0)->count(); if($work_days == 0) { $salary_cut_amount = 0; } else { $salary_cut_amount = $basicsalary/$work_days*$number_cut; } $type = "getAmount"; $allowance_amount = 0; if (!$employee->allowances->isEmpty()) { foreach ($employee->allowances as $item) { if ($item->first_date <= $first_date) { foreach ($employee->allowances as $value) { if ($value->first_date <= $first_date) { $allowance_amount += $value->allowance_amount*$work_days; } } } } } @endphp {{ $allowance_amount }} | {{ $employee->commissions->sum('commission_amount') }} | {{ $employee->overtimes->sum('overtime_amount') }} | {{ $employee->otherPayments->sum('other_payment_amount') }} | @php $jht = App\BPJSTK::where('company_id', $employee->company_id)->where('type', 'jht')->first(); $pensiun = App\BPJSTK::where('company_id', $employee->company_id)->where('type', 'pensiun')->first(); $jkk = App\BPJSTK::where('company_id', $employee->company_id)->where('type', 'jkk')->first(); $jkm = App\BPJSTK::where('company_id', $employee->company_id)->where('type', 'jkm')->first(); $nilai_jht = $basicsalary*$jht->employee/100; $nilai_jkk = $basicsalary*$jkk->employee/100; $nilai_jkm = $basicsalary*$jkm->employee/100; $nilai_pensiun = $basicsalary*$pensiun->employee/100; $pension_amount = $nilai_jht+$nilai_pensiun; $biaya_jabatan = $basicsalary*5/100; $net_salary_year = ($basicsalary-$biaya_jabatan-$pension_amount)*12; if($net_salary_year > $employee->ptkp) { $pkp_yearly = $net_salary_year-$employee->ptkp; $tax = App\Tax::where('min_salary', '<=', $pkp_yearly)->where('max_Salary', '>=', $pkp_yearly)->first(); $pph_percentage = $tax->percentage; } else { $pkp_yearly = $net_salary_year; $pph_percentage = 0; } $pph_yearly = $pph_percentage*$pkp_yearly/100; $pph_monthly = $pph_yearly/12; @endphp {{$pph_monthly}} | @php $bpjskes = App\BPJSKes::where('company_id', $employee->company_id)->where('name', 'Kesehatan')->first(); $nilai_kes = $basicsalary*$bpjskes->employee/100; @endphp {{ $nilai_kes }} | {{ $basicsalary*$pensiun->employee/100 }} | {{ $nilai_jht }} | {{ $nilai_jkk }} | {{ $nilai_jkm }} | @if($employee->loans->isEmpty()) 0 @else $employee->loans->monthly_payable @endif | @php $deduction_amount = 0; if (!$employee->deductions->isEmpty()) { foreach ($employee->deductions as $item) { if ($item->first_date <= $first_date) { $deduction_amount = 0; foreach ($employee->deductions as $value) { if ($value->first_date <= $first_date) { if ($item->first_date == $value->first_date) { $deduction_amount += $value->deduction_amount; } } } } } } @endphp {{ $deduction_amount }} | @php $number_cut = $employee->reportAttendances->where('attendance_date', '>=', $cut_off_start)->where('attendance_date', '<=', $cut_off_end)->whereIn('status', ['TA1', 'TA2', 'TA3'])->where('is_checked', 0)->count(); if($work_days == 0) { $salary_cut_amount = 0; } else { $salary_cut_amount = $basicsalary/$work_days*$number_cut; } @endphp {{ number_format($salary_cut_amount, '0', ',', '') }} | {{ number_format($basicsalary - $pph_monthly + $allowance_amount + $employee->commissions->sum('commission_amount') - $employee->loans->sum('monthly_payable') - $deduction_amount - $pension_amount - $nilai_jkk - $nilai_jkm - $nilai_kes - $salary_cut_amount + $employee->otherPayments->sum('other_payment_amount') + $employee->overtimes->sum('overtime_amount'), '0', ',', '') }} | @if(!$employee->payslips->isEmpty()) Paid @else Unpaid @endif |