Merged in afiqhamzah/fix/redirect-penebusan-view-to-correct-version (pull request #72)

Update khazanah penebusan controller so that it will redirect to correct view of the designated version
This commit is contained in:
Afiq Hamzah
2024-01-07 02:52:39 +00:00
+9 -8
View File
@@ -104,12 +104,12 @@ class PenebusanController extends Controller
$serahan=$getTunai2['kurang'];
$totalmasuk = 0;
$bakiakhir = 0;
$totalmasuk = $request->bayaran + $masuk;
// $bakiakhir = $bakiawal-$keluar+$totalmasuk+$pendahuluan-$serahan;
$bakiakhir = $baki + $request->bayaran;
// // Add on 20210411
// $gadaidetail = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/norujukan/'. $request->kodcaw.'/'.$request->norujukan)->json();
// $tempohGadai=$gadaidetail[0]['tempoh'];
@@ -119,7 +119,7 @@ class PenebusanController extends Controller
// $upah6bulan= $upah12bulan/2; //add on 202104011
// $tempoh_bayar=$gadaidetail[0]['tempohbayar']; //add on 202104011
// $tarikhgadai=$gadaidetail[0]['t_gadai'];//Add on 20210411
//masuk dalam tunai aliran
$updateTunai=Http::withOptions(['verify' => config('app.api_verify')])->put( config('api.url').'/api/updateTunaiGT/'.$request->kodcaw, [
'kodlaluan' => $request->teller,
@@ -127,15 +127,15 @@ class PenebusanController extends Controller
'masuk' => $totalmasuk,
'bakiakhir' => $bakiakhir
])->json();
event(new KeuntunganNotify('lulus',Auth::user()->cawangan));
return response()->json($updategadai,200);
}else{
return response('error');
}
}
public function bayaransurans(Request $request)
@@ -793,7 +793,8 @@ class PenebusanController extends Controller
$nilaihargasemasa = $this->tukaranhargaemas($norujukan);
return view('penebusan.index-khazanah',compact('cawangan_info','api_url','gadai','marhun','nama','nilaihargasemasa'));
$view = sprintf('penebusan.%s.index-khazanah', $cawangan_info->version);
return view($view, compact('cawangan_info','api_url','gadai','marhun','nama','nilaihargasemasa'));
}
}