paparan sag mobile
This commit is contained in:
@@ -271,6 +271,44 @@ class CustomerController extends Controller
|
|||||||
return response()->json($customer_update, 200);
|
return response()->json($customer_update, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function listNorujukanMobile($nokp){
|
||||||
|
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||||
|
$array_norujukan = [];
|
||||||
|
foreach($cawangan_all as $index=>$cawangan){
|
||||||
|
$gadai = Gadai::on($cawangan['mysql'])->where([['nokp','=',$nokp],['sttebus','=','']])->get();
|
||||||
|
if(sizeof($gadai) != 0){
|
||||||
|
foreach($gadai as $index=>$gadai_detail){
|
||||||
|
array_push($array_norujukan,['norujukan'=>$gadai_detail['norujukan'],'kodcaw'=>$gadai_detail['kodcaw']]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json($array_norujukan);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getGadaiDetailMobile(Request $request){
|
||||||
|
// dd($request->all());
|
||||||
|
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||||
|
$array_norujukan = $request->norujukan;
|
||||||
|
$array_kodcaw = $request->kodcaw;
|
||||||
|
$array_gadai = [];
|
||||||
|
foreach($array_norujukan as $index=>$norujukan){
|
||||||
|
array_push($array_gadai,['norujukan'=>$norujukan,'kodcaw'=>$array_kodcaw[$index]]);
|
||||||
|
}
|
||||||
|
// dd($array_gadai);
|
||||||
|
$gadai_payment = [];
|
||||||
|
foreach($array_gadai as $index=>$gadai){
|
||||||
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$gadai['kodcaw'])->first();
|
||||||
|
$gadai_detail = Gadai::on($cawangan['mysql'])->where('norujukan','=',$gadai['norujukan'])->first();
|
||||||
|
|
||||||
|
$keuntungan_semasa = $gadai_detail['jbg'] * ($gadai_detail['pinjaman'] * ($gadai_detail['kadarupah']/100));
|
||||||
|
array_push($gadai_payment,['norujukan'=>$gadai['norujukan'],'cawangan'=>$cawangan['details_caw'],'pembiayaan'=>$gadai_detail['pinjaman'],'pembayaran_keuntungan'=>number_format($keuntungan_semasa,2)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json($gadai_payment);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function delete($kodcaw,$nokp)
|
public function delete($kodcaw,$nokp)
|
||||||
{
|
{
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
|
|||||||
@@ -542,8 +542,8 @@ class GadaiController extends Controller
|
|||||||
return response()->json($gadai);
|
return response()->json($gadai);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLaporanKawalanStok($kodcaw,$tarikh)
|
public function getLaporanKawalanStok($kodcaw,$tarikh){
|
||||||
{
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
|
|
||||||
$array_kawalanstok = [];
|
$array_kawalanstok = [];
|
||||||
@@ -795,8 +795,8 @@ class GadaiController extends Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showAllGadaiToday()
|
public function showAllGadaiToday(){
|
||||||
{
|
|
||||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
@@ -814,8 +814,9 @@ class GadaiController extends Controller
|
|||||||
return response()->json($gadaiToday);
|
return response()->json($gadaiToday);
|
||||||
|
|
||||||
}
|
}
|
||||||
public function showAllTebusToday()
|
|
||||||
{
|
public function showAllTebusToday(){
|
||||||
|
|
||||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
@@ -831,8 +832,9 @@ class GadaiController extends Controller
|
|||||||
}
|
}
|
||||||
return response()->json($tebusToday);
|
return response()->json($tebusToday);
|
||||||
}
|
}
|
||||||
public function showAllVariasiToday()
|
|
||||||
{
|
public function showAllVariasiToday(){
|
||||||
|
|
||||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
@@ -860,8 +862,8 @@ class GadaiController extends Controller
|
|||||||
$variasiToday = $gadaiToday - $tebusToday;
|
$variasiToday = $gadaiToday - $tebusToday;
|
||||||
return response()->json($variasiToday);
|
return response()->json($variasiToday);
|
||||||
}
|
}
|
||||||
public function showAllUpahToday()
|
public function showAllUpahToday(){
|
||||||
{
|
|
||||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|||||||
@@ -230,6 +230,10 @@ $router->group(['prefix'=>'mobile'], function () use ($router){
|
|||||||
$router->get('customers/{ic}/gadai/amaran/lelong',['uses'=>'CustomerController@show6BlnGadai']);
|
$router->get('customers/{ic}/gadai/amaran/lelong',['uses'=>'CustomerController@show6BlnGadai']);
|
||||||
|
|
||||||
$router->get('harga_emas',['uses'=>'HargaEmasController@showAllHargaEmasMobile']);
|
$router->get('harga_emas',['uses'=>'HargaEmasController@showAllHargaEmasMobile']);
|
||||||
|
|
||||||
|
$router->get('gadai/norujukan/{nokp}',['uses'=>'CustomerController@listNorujukanMobile']);
|
||||||
|
|
||||||
|
$router->post('gadai/detail/norujukan',['uses'=>'CustomerController@getGadaiDetailMobile']);
|
||||||
});
|
});
|
||||||
|
|
||||||
$router->group(['prefix'=>'dashboard'], function () use ($router){
|
$router->group(['prefix'=>'dashboard'], function () use ($router){
|
||||||
|
|||||||
Reference in New Issue
Block a user