diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index 891ce28..2ec148f 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -1587,7 +1587,7 @@ class KhazanahController extends Controller } public function cetaklaporanLelongan(Request $request){ - // dd($request); + // dd($request->all()); $api_url = config('api.url'); $auth_user = Auth::user(); $current = Carbon::now(); @@ -1596,7 +1596,15 @@ class KhazanahController extends Controller if($request->jeniscetakan === 'cetak') { - $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'],['batchno' => $request->batchno])->json(); + if($request->fasa == 1) + { + $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'] . '/' . 'fasa1',['batchno' => $request->batchno])->json(); + }else{ + $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'] . '/' . 'fasa2',['batchno' => $request->batchno])->json(); + } + + // $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'],['batchno' => $request->batchno])->json(); + $cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); $cawangan_detail=$cawangan[0]; @@ -1605,7 +1613,12 @@ class KhazanahController extends Controller }else if($request->jeniscetakan === 'excel') { - $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'],['batchno' => $request->batchno])->json(); + if($request->fasa == 1) + { + $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'] . '/' . 'fasa1',['batchno' => $request->batchno])->json(); + }else{ + $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'] . '/' . 'fasa2',['batchno' => $request->batchno])->json(); + } $cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); $cawangan_detail=$cawangan[0]; @@ -1613,7 +1626,14 @@ class KhazanahController extends Controller }else if($request->jeniscetakan === 'pdf'){ - $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'],['batchno' => $request->batchno])->json(); + if($request->fasa == 1) + { + $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'] . '/' . 'fasa1',['batchno' => $request->batchno])->json(); + $fasa = 'fasa1'; + }else{ + $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'] . '/' . 'fasa2',['batchno' => $request->batchno])->json(); + $fasa = 'fasa2'; + } $notislelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/details/notislelong/'. $auth_user['cawangan'])->json(); $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); $cawangan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); @@ -1621,8 +1641,8 @@ class KhazanahController extends Controller // return view('print.notislelong', compact('cawangan_info','notislelong','api_url','cawangan_detail','lelong','tarikh_cetak')); - $pdf=PDF::loadView('print.notislelong', compact('cawangan_info','notislelong','api_url','cawangan_detail','lelong','tarikh_cetak'))->setPaper('A4','potrait'); - return $pdf->download('notislelong_'.$tarikh_cetak.'.pdf'); + $pdf=PDF::loadView('print.notislelong', compact('cawangan_info','notislelong','api_url','cawangan_detail','lelong','fasa','tarikh_cetak'))->setPaper('A4','potrait'); + return $pdf->download('notislelong_'.$tarikh_cetak.'_'.$fasa.'.pdf'); // return $pdf->stream('notislelong_'.$tarikh_cetak.'.pdf'); // return view('print.notislelong', compact('cawangan_info','api_url','cawangan_detail','lelong','tarikh_cetak')); @@ -3558,30 +3578,5 @@ class KhazanahController extends Controller return view('khazanah.status', compact('cawangan_info','api_url','permohonan','getdescription')); } - - public function TriggerBakiPetiBesi(Request $request) - { - $auth_user = Auth::user(); - $api_url = config('api.url'); - - $current = Carbon::now(); - $tarikhsemasa = $current->toDateString(); - - $cawangan = CawanganAR::where('kodcaw','KB2')->get()->toArray(); - $getVault = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/TunaiDiTangan/' . 'KB2',['tarikh' => $tarikhsemasa])->json(); - - if(floatval($getVault) > $cawangan[0]['max']) - { - session(['status' => 'max']); - event(new NotifikasiPetiBesi('KB2','max',$getVault)); - - }else if(floatval($getVault) < $cawangan[0]['min']) - { - session(['status' => 'min']); - event(new NotifikasiPetiBesi('KB2','min',$getVault)); - }else{ - echo 'tiada'; - } - } } diff --git a/app/Http/Controllers/LelongController.php b/app/Http/Controllers/LelongController.php index c988d21..d3cc344 100644 --- a/app/Http/Controllers/LelongController.php +++ b/app/Http/Controllers/LelongController.php @@ -41,9 +41,10 @@ class LelongController extends Controller $auth_user = Auth::user(); $api_url = config('api.url'); $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); - $senaraibatch = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/aktif/'. $auth_user['cawangan'])->json(); + $senaraibatchfasa1 = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/aktif/'. $auth_user['cawangan'] . '/' . 'fasa1')->json(); + $senaraibatchfasa2 = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/aktif/'. $auth_user['cawangan'] . '/' . 'fasa2')->json(); - return view('khazanah.lelong',compact('cawangan_info','api_url','senaraibatch')); + return view('khazanah.lelong',compact('cawangan_info','api_url','senaraibatchfasa1','senaraibatchfasa2')); } public function resittuntutbaki($norujukan){ diff --git a/resources/views/khazanah/lelong.blade.php b/resources/views/khazanah/lelong.blade.php index 0d88dda..34f7d14 100644 --- a/resources/views/khazanah/lelong.blade.php +++ b/resources/views/khazanah/lelong.blade.php @@ -22,31 +22,47 @@
| No. | Batch No. | +Fasa | Bilangan Aktif | Tarikh Lelong | Action |
|---|---|---|---|---|---|
| {{ $loop->iteration }} | {{ $sb['batchno'] }} | +Fasa 1 | {{ $sb['total'] }} | {{ $sb['t_lelong'] }} | - Cetak - Excel - PDF + Cetak + Excel + PDF |
| {{ $loop->iteration }} | +{{ $sb['batchno'] }} | +Fasa 2 | +{{ $sb['total'] }} | +{{ $sb['t_lelong'] }} | ++ Cetak + Excel + PDF + | +
1. Tebus sepenuhnya
2. Tebus gadai semula
2. Bayar upah sepenuhnya dan tempoh akan dilanjutkan sehingga 12 bulan bagi tempoh gadaian.
--}}