fix report penagihan

This commit is contained in:
daengdeni 2024-04-04 15:48:15 +07:00
parent 9f3b4f634c
commit db990b3964

View File

@ -94,9 +94,9 @@
$date = Carbon::create($row->tanggal_hapus_buku); $date = Carbon::create($row->tanggal_hapus_buku);
return $date->locale('id')->translatedFormat('d F Y'); return $date->locale('id')->translatedFormat('d F Y');
})->editColumn('branch', function ($row) { })->editColumn('branch', function ($row) {
if(isset($row->branch->kode) && isset($row->branch->name)){ if (isset($row->branch->kode) && isset($row->branch->name)) {
return $row->branch->kode . ' - ' . $row->branch->name; return $row->branch->kode . ' - ' . $row->branch->name;
}else{ } else {
return '-'; return '-';
} }
})->editColumn('debitur', function ($row) { })->editColumn('debitur', function ($row) {
@ -230,6 +230,10 @@
->whereMonth('tanggal_hapus_buku', '<=', request()->get('bulan')) ->whereMonth('tanggal_hapus_buku', '<=', request()->get('bulan'))
->whereYear('tanggal_hapus_buku', '<=', request()->get('tahun')) ->whereYear('tanggal_hapus_buku', '<=', request()->get('tahun'))
->whereRelation('debitur', 'name', 'like', '%' . request()->get('debitur') . '%') ->whereRelation('debitur', 'name', 'like', '%' . request()->get('debitur') . '%')
->where('detail_penagihan.deleted_at', null)
->where('detail_pembayaran.deleted_at', null)
->where('detail_jaminan.deleted_at', null)
->groupBy('detail_penagihan.pic_penagihan', 'detail_penagihan.tanggal_penagihan')
->get(); ->get();
} else { } else {
$data = HapusBuku::with([ $data = HapusBuku::with([
@ -247,6 +251,10 @@
->whereYear('tanggal_hapus_buku', '<=', request()->get('tahun')) ->whereYear('tanggal_hapus_buku', '<=', request()->get('tahun'))
->where('kode_cabang', request()->get('kode_cabang')) ->where('kode_cabang', request()->get('kode_cabang'))
->whereRelation('debitur', 'name', 'like', '%' . request()->get('debitur') . '%') ->whereRelation('debitur', 'name', 'like', '%' . request()->get('debitur') . '%')
->where('detail_penagihan.deleted_at', null)
->where('detail_pembayaran.deleted_at', null)
->where('detail_jaminan.deleted_at', null)
->groupBy('detail_penagihan.pic_penagihan', 'detail_penagihan.tanggal_penagihan')
->get(); ->get();
} }
@ -256,9 +264,9 @@
$date = Carbon::create($row->tanggal_hapus_buku); $date = Carbon::create($row->tanggal_hapus_buku);
return $date->locale('id')->translatedFormat('d F Y'); return $date->locale('id')->translatedFormat('d F Y');
})->editColumn('branch', function ($row) { })->editColumn('branch', function ($row) {
if(isset($row->branch->kode) && isset($row->branch->name)){ if (isset($row->branch->kode) && isset($row->branch->name)) {
return $row->branch->kode . ' - ' . $row->branch->name; return $row->branch->kode . ' - ' . $row->branch->name;
}else{ } else {
return '-'; return '-';
} }
})->editColumn('debitur', function ($row) { })->editColumn('debitur', function ($row) {