fix: resolve issues in laporan gadaian ujrah

This commit is contained in:
nurafrinaalimi16
2026-09-06 15:55:50 +08:00
parent d60dd8bf39
commit b5bffd0b34
2 changed files with 139 additions and 62 deletions
+13 -4
View File
@@ -3990,7 +3990,7 @@ class KhazanahController extends Controller
}
public function cetakLaporanGadaiUjrah(Request $request){
public function cetakLaporanGadaiUjrah(Request $request){
$api_url = config('api.url');
$auth_user = Auth::user();
@@ -4012,12 +4012,21 @@ class KhazanahController extends Controller
$hingga_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
}
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/gadailaporanRangeDate/'. $auth_user['cawangan'] ,['mula' => $mula_date,'akhir' => $hingga_date])->json();
$reportGadai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/gadailaporanRangeDate/'. $auth_user['cawangan'] ,['mula' => $mula_date,'akhir' => $hingga_date])->json();
$gadai = $reportGadai['gadai'];
$statistik =$reportGadai['statistik'];
$reportPembiayaan= $statistik['reportPembiayaan'];
$reportLoanAmount=$statistik['reportLoanAmount'];
$reportMarhunValue=$statistik['reportMarhunValue'];
$reportMarhunMargin=$statistik['reportMarhunMargin'];
$reportCustomerJob=$statistik['reportCustomerJob'];
$reportCustomerRace=$statistik['reportCustomerRace'];
// dd($reportCustomerRace);
$cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
$cawangan_detail=$cawangan[0];
return view('print.laporan_gadaian_ujrah', compact('gadai','cawangan_detail','tarikh_cetak','mula_date','api_url','hingga_date'));
return view('print.laporan_gadaian_ujrah', compact('gadai','cawangan_detail','tarikh_cetak','mula_date','api_url','hingga_date','statistik','reportPembiayaan','reportLoanAmount','reportMarhunValue','reportMarhunMargin','reportCustomerJob','reportCustomerRace','reportCustomerRace'));
}