@php $d_kcp = collect(\DB::select("SELECT definition FROM user_unit_kerja where id = ".Auth::user()->unit_kerja))->first(); $penugasan = $persiapan; if ($penugasan == "semua") { $t_mulai = date('Y-m-d',strtotime($t_mulai)); $t_selesai = date('Y-m-d',strtotime($t_selesai)); $filter_penugasan = ""; }else{ $date_penugasan = collect(\DB::select("SELECT audit_tittle, ma.start_date, ma.end_date FROM master_audit_job maj join master_audit_plan ma on ma.id = maj.audit_plan_id where maj.id = ".$penugasan))->first(); $t_mulai = $date_penugasan->start_date; $t_selesai = $date_penugasan->end_date; $filter_penugasan = " and audit_job_id = ".$penugasan; } @endphp
Penilaian Pengendalian Intern Unit Kerja
{{$d_kcp->definition}}
Unit Kerja : {{$d_kcp->definition}}
Wilayah :
Tanggal Audit : {{date('d-m-Y',strtotime($t_mulai))}} s.d. {{date('d-m-Y',strtotime($t_selesai))}}

@for ($i = 1; $i <= 13; $i++) @endfor @php $d_sebab = \DB::select("SELECT * FROM reff_aspek order by code"); foreach ($d_sebab as $key => $ds) { $count_sebab[$ds->code] = 0; } @endphp @php $t_mulai = date('Y-m-d',strtotime($t_mulai)); $t_selesai = date('Y-m-d',strtotime($t_selesai)); $d_bidang = \DB::select("SELECT DISTINCT ON (rsca.definition ) rsca.definition as bidang,rsca.id as kode_bidang,ri.bidang_ics FROM master_audit_finding maf join reff_sub_class_audit rsca on rsca.id = maf.id_program join reff_ics ri on ri.id = maf.ics where finding_date >= '".$t_mulai."' and finding_date <= '".$t_selesai."'".$filter_penugasan); $d_jum_p_loss = collect(\DB::select("SELECT sum(value_loss::int) as jum FROM master_audit_finding maf join reff_sub_class_audit rsca on rsca.id = maf.id_program join reff_ics ri on ri.id = maf.ics join reff_aspek ra on ra.id = maf.jenis_sebab where loss = 'p' and finding_date >= '".$t_mulai."' and finding_date <= '".$t_selesai."'".$filter_penugasan))->first(); $d_jum_r_loss = collect(\DB::select("SELECT sum(value_loss::int) as jum FROM master_audit_finding maf join reff_sub_class_audit rsca on rsca.id = maf.id_program join reff_ics ri on ri.id = maf.ics join reff_aspek ra on ra.id = maf.jenis_sebab where loss = 'r' and finding_date >= '".$t_mulai."' and finding_date <= '".$t_selesai."'".$filter_penugasan))->first(); $d_init_bobot = \DB::select("SELECT DISTINCT ON (bobot.nama) rsca.definition as bidang,rsca.id as kode_bidang,ri.bidang_ics,bobot.* FROM master_audit_finding maf join reff_sub_class_audit rsca on rsca.id = maf.id_program join reff_ics ri on ri.id = maf.ics join bobot on bobot.id = rsca.id_bobot where finding_date >= '".$t_mulai."' and finding_date <= '".$t_selesai."'".$filter_penugasan); $kc1 = 10;$kc2 = 2;$kc3 = 15;$kc4 = 13; $kc5 = 3;$kc6 = 8;$kc7 = 6;$kc8 = 4; @endphp @if (count($d_bidang) != 0 ) {{-- BOBOT BIDANG --}} @foreach ($d_init_bobot as $dib) @endforeach @php $tr1=0;$tr2=0;$tr3=0;$tr4=0; $tr5=0;$tr6=0;$tr7=0;$tr8=0; $t_sk=0;$t_s=0; $no = 1; @endphp @foreach($d_bidang as $db) @php $r1 = 0;$r2 = 0;$r3 = 0;$r4 = 0; $r5 = 0;$r6 = 0;$r7 = 0;$r8 = 0; @endphp {{-- DATA BIDANG ISC --}} @php $d_isc = \DB::select("SELECT DISTINCT ON(bidang_ics) rsca.definition as bidang,ri.id as id_bidang_ics FROM master_audit_finding maf join reff_sub_class_audit rsca on rsca.id = maf.id_program join reff_ics ri on ri.id = maf.ics where rsca.id = '".$db->kode_bidang."' and finding_date >= '".$t_mulai."' and finding_date <= '".$t_selesai."' ".$filter_penugasan); @endphp @foreach ($d_isc as $di) {{-- DATA --}} @php $data = \DB::select("SELECT maf.* ,rsca.id as kode_bidang,rsca.definition as bidang,ri.bidang_ics, ra.code as sebab_code FROM master_audit_finding maf join reff_sub_class_audit rsca on rsca.id = maf.id_program join reff_ics ri on ri.id = maf.ics join reff_aspek ra on ra.id = maf.jenis_sebab where ri.id = '".$di->id_bidang_ics."' and finding_date >= '".$t_mulai."' and finding_date <= '".$t_selesai."'".$filter_penugasan); @endphp @foreach ($data as $d) @php $data_bobot = collect(\DB::select("select * from reff_sub_class_audit rsca join bobot on bobot.id = rsca.id_bobot where rsca.id = ".$d->kode_bidang))->first(); ($d->index_scoring_id == 1) ? $r1++:$r1; ($d->index_scoring_id == 2) ? $r2++:$r2; ($d->index_scoring_id == 3) ? $r3++:$r3; ($d->index_scoring_id == 4) ? $r4++:$r4; ($d->index_scoring_id == 5) ? $r5++:$r5; ($d->index_scoring_id == 6) ? $r6++:$r6; ($d->index_scoring_id == 7) ? $r7++:$r7; ($d->index_scoring_id == 8) ? $r8++:$r8; $count_sebab[$d->sebab_code]++; // $tr1 += $r1; // $tr2 += $r2; $total_per_row_stt = ($r1*$data_bobot->r01)+($r2*$data_bobot->r02)+($r3*$data_bobot->r03)+($r4*$data_bobot->r04)+ ($r5*$data_bobot->r11)+($r6*$data_bobot->r12)+($r7*$data_bobot->r13)+($r8*$data_bobot->r14); $total_per_row_skor = (1 / (count($data)+1) )*$total_per_row_stt; @endphp @endforeach {{-- END DATA --}} @endforeach {{-- END BIDANG ISC --}} @php $tr1 += $r1; $tr2 += $r2; $tr3 += $r3; $tr4 += $r4; $tr5 += $r5; $tr6 += $r6; $tr7 += $r7; $tr8 += $r8; $t_sk += $total_per_row_stt; $t_s += $total_per_row_skor; @endphp {{-- SKOR TIDAK TAAT --}} {{-- SKOR --}} @php $no++; @endphp @endforeach {{-- SKOR TIDAK TAAT --}} {{-- SKOR --}}
NO FAKTOR PENILAIAN 1=Diaudit, 0= Tidak diaudit BOBOT RISIKO SKOR KETIDAKTAAN SKOR
R0-1 R0-2 R0-3 R0-4 R1-1 R1-2 R1-3 R1-4
({{$i}})
{{ $dib->nama }} {{$dib->r01}} {{$dib->r02}} {{$dib->r03}} {{$dib->r04}} {{$dib->r11}} {{$dib->r12}} {{$dib->r13}} {{$dib->r14}}
JUMLAH TEMUAN
{{$no}} {{ $db->bidang }} 1 {{$r1}} {{$r2}} {{$r3}} {{$r4}} {{$r5}} {{$r6}} {{$r7}} {{$r8}} {{$total_per_row_stt}}{{$total_per_row_skor}}
Total {{$no-1}} {{$tr1}} {{$tr2}} {{$tr3}} {{$tr4}} {{$tr5}} {{$tr6}} {{$tr7}} {{$tr8}} {{$t_sk}}{{$t_s}}
@php $spredikat = round((-8*log($t_s+1)+100),2); if ( $spredikat<=50) { $pred = "Tidak Baik"; } elseif ($spredikat<=60) { $pred = "Hampir Baik"; } elseif ($spredikat<=70) { $pred = "Baik -"; } elseif ($spredikat<=80) { $pred = "Baik +"; } elseif ($spredikat<=90) { $pred = "Lebih Baik"; } elseif ($spredikat>90) { $pred = "Sangat Baik"; } @endphp @php $max_sebab = max($count_sebab); $c_sebab = 0; @endphp @foreach ($d_sebab as $ds_count) @if ($count_sebab[$ds_count->code] == $max_sebab) @php $c_sebab++; @endphp @endif @endforeach @php // dd($c_sebab); if ($c_sebab == 1) { $cc = 1; }else { $cc = 0; } @endphp @foreach ($d_sebab as $k_sebab => $ds_table) @if ($count_sebab[$ds_table->code] == $max_sebab) @if ($k_sebab == $cc) @endif @if ($k_sebab == $cc) @endif @endif @endforeach
SKOR PREDIKAT {{ $spredikat }}
PREDIKAT {{$pred}}
Penyebab Kesalahan Terbesar {{$ds_table->definition}} Dengan Jumlah {{$max_sebab}} Temuan
JUMLAH POTENSIAL LOSS {{$d_jum_p_loss->jum}}
% probability of loss event* 0
JUMLAH RIIL LOSS {{$d_jum_r_loss->jum}}
PENGURANG NILAI:
1. KASUS/PELANGGARAN BERAT/FRAUD DGN NILAI KERUGIAN:
- T1. Fraud/Realized Loss Rp1,- sampai dengan 0,03% dari modal disetor (setara Rp1,- s.d Rp100 juta) - -
- T2. Fraud/Realized Loss lebih besar dari 0.03% sampai dengan 0.06% modal disetor (setara >Rp100 juta s.d Rp200 juta) - -
- T3. Fraud/Realized Loss lebih besar dari 0.05% sampai dengan 0.14% modal disetor (setara >Rp200 juta s.d Rp500 juta) - -
- T4. Fraud/Realized Loss lebih besar dari 0.14% modal disetor sampai dengan seterusnya (>Rp500 juta). - -
2. TEMUAN BERULANG DPI (JUMLAH TEMUAN BERULANG X 0.25). - -
3. TEMUAN TIDAK DITINDAKLANJUTI - -
SKOR AKHIR {{$spredikat}}
PREDIKAT {{$pred}}
@endif