block sag
This commit is contained in:
@@ -27,12 +27,12 @@ class PenebusanController extends Controller
|
||||
public function index($norujukan){
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
$gadaidetail = Http::get(config('api.url') . '/api/gadai/norujukan/'. $norujukan)->json();
|
||||
$gadaidetail = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/norujukan/'. $norujukan)->json();
|
||||
$noic = $gadaidetail[0][0]['nokp'];
|
||||
$customerdetail = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
|
||||
$marhundetail = Http::get(config('api.url') . '/api/marhun/'. $norujukan)->json();
|
||||
$customerdetail = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customers/'. $noic)->json();
|
||||
$marhundetail = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/marhun/'. $norujukan)->json();
|
||||
|
||||
$marhun = $marhundetail[0];
|
||||
$nama = $customerdetail['nama'];
|
||||
@@ -48,7 +48,7 @@ class PenebusanController extends Controller
|
||||
{
|
||||
$api_url = config('api.url');
|
||||
|
||||
$updatetebus = Http::put(config('api.url').'/api/updatetebus/'. $request->kodcaw .'/' . $request->norujukan,[
|
||||
$updatetebus = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/updatetebus/'. $request->kodcaw .'/' . $request->norujukan,[
|
||||
"nopelanggan" => $request->nopelanggan,
|
||||
"jenistebus" => $request->jenistebus,
|
||||
"jbg" => $request->jbg,
|
||||
@@ -80,12 +80,12 @@ class PenebusanController extends Controller
|
||||
{
|
||||
$api_url = config('api.url');
|
||||
|
||||
$updategadai = Http::put(config('api.url').'/api/gadaikaunter/'. $request->kodcaw .'/norujukan/' . $request->norujukan,[
|
||||
$updategadai = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadaikaunter/'. $request->kodcaw .'/norujukan/' . $request->norujukan,[
|
||||
'bayaran' => $request->bayaran,
|
||||
'teller' => $request->teller
|
||||
])->json();
|
||||
|
||||
$getTunai2=Http::get(config('api.url').'/api/GetCurrentTunai/'.$request->kodcaw,['kodlaluan' => $request->teller])->json();
|
||||
$getTunai2=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/GetCurrentTunai/'.$request->kodcaw,['kodlaluan' => $request->teller])->json();
|
||||
|
||||
$keluar=$getTunai2['keluar'];
|
||||
$baki=$getTunai2['baki'];
|
||||
@@ -95,14 +95,14 @@ 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::get(config('api.url') . '/api/gadai/norujukan/'. $request->kodcaw.'/'.$request->norujukan)->json();
|
||||
// $gadaidetail = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/norujukan/'. $request->kodcaw.'/'.$request->norujukan)->json();
|
||||
// $tempohGadai=$gadaidetail[0]['tempoh'];
|
||||
// $upah12bulan=$gadaidetail[0]['upah12'];
|
||||
// $bakiPinjaman=$gadaidetail[0]['bakipjm'];
|
||||
@@ -112,7 +112,7 @@ class PenebusanController extends Controller
|
||||
// $tarikhgadai=$gadaidetail[0]['t_gadai'];//Add on 20210411
|
||||
|
||||
//masuk dalam tunai aliran
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$request->kodcaw, [
|
||||
$updateTunai=Http::withOptions(['verify' => config('app.api_verify')])->put( config('api.url').'/api/updateTunaiGT/'.$request->kodcaw, [
|
||||
'kodlaluan' => $request->teller,
|
||||
'keluar' => $keluar,
|
||||
'masuk' => $totalmasuk,
|
||||
@@ -138,7 +138,7 @@ class PenebusanController extends Controller
|
||||
////////////////////////
|
||||
/// UPDATE TEBUS API////
|
||||
///////////////////////
|
||||
$updatetebus = Http::put(config('api.url').'/api/updatetebus/'. $auth_user['cawangan'] .'/' . $request->norujukan,[
|
||||
$updatetebus = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/updatetebus/'. $auth_user['cawangan'] .'/' . $request->norujukan,[
|
||||
'nopelanggan' => $request->nopelanggan,
|
||||
'jenistebus' => $request->jenistebus,
|
||||
'jbg' => $request->jbg,
|
||||
@@ -159,10 +159,10 @@ class PenebusanController extends Controller
|
||||
//////////////////////
|
||||
/// MAKING NEW SAG////
|
||||
/////////////////////
|
||||
$gadai_transaction = Http::get(config('api.url') . '/api/gadai/'. $auth_user['cawangan'] . '/' . $current->toDateString())->json();
|
||||
$gadai_transaction = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/'. $auth_user['cawangan'] . '/' . $current->toDateString())->json();
|
||||
if($gadai_transaction){
|
||||
$new_sirig = $gadai_transaction['sirig'] + 1;
|
||||
|
||||
|
||||
}else{
|
||||
$new_sirig = 1;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ class PenebusanController extends Controller
|
||||
$norujukanbaru = strtoupper($auth_user['cawangan']) . $curent_year . $curent_month . $current_day . '-' .$new_transaction;
|
||||
|
||||
// dd($norujukan);
|
||||
$gadai = Http::post(config('api.url').'/api/gadai/'.$auth_user['cawangan'],[
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/gadai/'.$auth_user['cawangan'],[
|
||||
'norujukan' => $norujukanbaru,
|
||||
'nopelanggan' => $request->nopelanggan,
|
||||
'nokp' => $request->noic,
|
||||
@@ -190,7 +190,7 @@ class PenebusanController extends Controller
|
||||
$hargajualan = $request->pinjaman + $keuntungan12bulan;
|
||||
|
||||
|
||||
$gadai = Http::put(config('api.url').'/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
'kodcaw' => $auth_user['cawangan'],
|
||||
'nilaimarhun' => round($total_nilai_marhun, 2),
|
||||
'berat' => round($request->total_berat, 2),
|
||||
@@ -210,7 +210,7 @@ class PenebusanController extends Controller
|
||||
////Update History Gadaian///
|
||||
////////////////////////////
|
||||
|
||||
$updatehistorygadaian = Http::put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
$updatehistorygadaian = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
'historygadaian' => $request->norujukan
|
||||
])->json();
|
||||
|
||||
@@ -222,7 +222,7 @@ class PenebusanController extends Controller
|
||||
|
||||
$arraymarhunbaru = [];
|
||||
|
||||
$marhunsediada = Http::get(config('api.url') . '/api/marhun/'. $request->norujukan)->json();
|
||||
$marhunsediada = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/marhun/'. $request->norujukan)->json();
|
||||
|
||||
$marhunyangdiambil = $marhunsediada[0];
|
||||
foreach($marhunyangdiambil as $index=>$marhunloop)
|
||||
@@ -232,7 +232,7 @@ class PenebusanController extends Controller
|
||||
|
||||
foreach($arraymarhunbaru as $array1)
|
||||
{
|
||||
$updatemarhun = Http::post(config('api.url').'/api/marhun/'. $auth_user['cawangan'],[
|
||||
$updatemarhun = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/marhun/'. $auth_user['cawangan'],[
|
||||
'norujukan' => $norujukanbaru,
|
||||
'marhun' => $array1['marhun'],
|
||||
'nota' => $array1['nota'],
|
||||
@@ -241,7 +241,7 @@ class PenebusanController extends Controller
|
||||
'harga' => $array1['harga'],
|
||||
'nilai_marhun' => $array1['n_marhun']
|
||||
])->json();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -261,7 +261,7 @@ class PenebusanController extends Controller
|
||||
////////////////////////
|
||||
/// UPDATE TEBUS API////
|
||||
///////////////////////
|
||||
$updatetebus = Http::put(config('api.url').'/api/updatetebus/'. $auth_user['cawangan'] .'/' . $request->norujukan,[
|
||||
$updatetebus = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/updatetebus/'. $auth_user['cawangan'] .'/' . $request->norujukan,[
|
||||
'nopelanggan' => $request->nopelanggan,
|
||||
'jenistebus' => $request->jenistebus,
|
||||
'jbg' => $request->jbg,
|
||||
@@ -283,10 +283,10 @@ class PenebusanController extends Controller
|
||||
/// MAKING NEW SAG////
|
||||
/////////////////////
|
||||
|
||||
$gadai_transaction = Http::get(config('api.url') . '/api/gadai/'. $auth_user['cawangan'] . '/' . $current->toDateString())->json();
|
||||
$gadai_transaction = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/'. $auth_user['cawangan'] . '/' . $current->toDateString())->json();
|
||||
if($gadai_transaction){
|
||||
$new_sirig = $gadai_transaction['sirig'] + 1;
|
||||
|
||||
|
||||
}else{
|
||||
$new_sirig = 1;
|
||||
}
|
||||
@@ -294,14 +294,14 @@ class PenebusanController extends Controller
|
||||
$new_transaction = sprintf("%04d",$new_sirig);
|
||||
$norujukanbaru = strtoupper($auth_user['cawangan']) . $curent_year . $curent_month . $current_day . '-' .$new_transaction;
|
||||
|
||||
$gadai = Http::post(config('api.url').'/api/gadai/'.$auth_user['cawangan'],[
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/gadai/'.$auth_user['cawangan'],[
|
||||
'norujukan' => $norujukanbaru,
|
||||
'nopelanggan' => $request->nopelanggan,
|
||||
'nokp' => $request->noic,
|
||||
'sirig' => $new_sirig
|
||||
]);
|
||||
|
||||
|
||||
|
||||
//////////////////////
|
||||
////Update SAG BARU///
|
||||
/////////////////////
|
||||
@@ -317,7 +317,7 @@ class PenebusanController extends Controller
|
||||
$hargajualan = $request->pinjaman + $keuntungan12bulan;
|
||||
|
||||
|
||||
$gadai = Http::put(config('api.url').'/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
'kodcaw' => $auth_user['cawangan'],
|
||||
'nilaimarhun' => round($total_nilai_marhun, 2),
|
||||
'berat' => round($request->total_berat, 2),
|
||||
@@ -332,7 +332,7 @@ class PenebusanController extends Controller
|
||||
'kuantiti_marhun' => $request->kuantiti_marhun
|
||||
])->json();
|
||||
|
||||
$komuditi = Http::put(config('api.url').'/api/komuditi/transaksi',[
|
||||
$komuditi = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/komuditi/transaksi',[
|
||||
'unit_komuditi' => round($request->pinjaman, 2),
|
||||
'norujukan' => $norujukanbaru,
|
||||
'kodcaw' => $auth_user['cawangan'],
|
||||
@@ -343,7 +343,7 @@ class PenebusanController extends Controller
|
||||
////Update History Gadaian///
|
||||
////////////////////////////
|
||||
|
||||
$updatehistorygadaian = Http::put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
$updatehistorygadaian = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
'historygadaian' => $request->norujukan
|
||||
])->json();
|
||||
|
||||
@@ -355,21 +355,21 @@ class PenebusanController extends Controller
|
||||
|
||||
$arraymarhunbaru = [];
|
||||
|
||||
$marhunsediada = Http::get(config('api.url') . '/api/marhun/'. $request->norujukan)->json();
|
||||
$marhunsediada = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/marhun/'. $request->norujukan)->json();
|
||||
|
||||
$marhunyangdiambil = $marhunsediada[0];
|
||||
foreach($marhunyangdiambil as $index=>$marhunloop)
|
||||
{
|
||||
$karatbaru = str_replace('.','-',$marhunloop['karat']);
|
||||
$hargabaru = Http::get(config('api.url') . '/api/harga_emas/'. $karatbaru)->json();
|
||||
|
||||
$hargabaru = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/harga_emas/'. $karatbaru)->json();
|
||||
|
||||
$nilaimarhun = (floatval($hargabaru['harga']) * floatval($marhunloop['berat']));
|
||||
|
||||
array_push($arraymarhunbaru, ["bil" => $marhunloop['bil'],"marhun" => $marhunloop['marhun'],"nota" => $marhunloop['nota'],"karat" => $marhunloop['karat'], "berat" => $marhunloop['berat'], "harga" => $hargabaru['harga'], "n_marhun" => $nilaimarhun]);
|
||||
}
|
||||
|
||||
foreach($arraymarhunbaru as $array1){
|
||||
$updatemarhun = Http::post(config('api.url').'/api/marhun/'. $auth_user['cawangan'],[
|
||||
$updatemarhun = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/marhun/'. $auth_user['cawangan'],[
|
||||
'norujukan' => $norujukanbaru,
|
||||
'marhun' => $array1['marhun'],
|
||||
'nota' => $array1['nota'],
|
||||
@@ -400,7 +400,7 @@ class PenebusanController extends Controller
|
||||
////////////////////////
|
||||
/// UPDATE TEBUS API////
|
||||
///////////////////////
|
||||
$updatetebus = Http::put(config('api.url').'/api/updateautotawarruq/'. $auth_user['cawangan'] .'/' . $request->norujukan,[
|
||||
$updatetebus = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/updateautotawarruq/'. $auth_user['cawangan'] .'/' . $request->norujukan,[
|
||||
'nopelanggan' => $request->nopelanggan,
|
||||
'jenistebus' => $request->jenistebus,
|
||||
'jbg' => $request->jbg,
|
||||
@@ -424,10 +424,10 @@ class PenebusanController extends Controller
|
||||
//////////////////////
|
||||
/// MAKING NEW SAG////
|
||||
/////////////////////
|
||||
$gadai_transaction = Http::get(config('api.url') . '/api/gadai/'. $auth_user['cawangan'] . '/' . $current->toDateString())->json();
|
||||
$gadai_transaction = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/'. $auth_user['cawangan'] . '/' . $current->toDateString())->json();
|
||||
if($gadai_transaction){
|
||||
$new_sirig = $gadai_transaction['sirig'] + 1;
|
||||
|
||||
|
||||
}else{
|
||||
$new_sirig = 1;
|
||||
}
|
||||
@@ -435,14 +435,14 @@ class PenebusanController extends Controller
|
||||
$new_transaction = sprintf("%04d",$new_sirig);
|
||||
$norujukanbaru = strtoupper($auth_user['cawangan']) . $curent_year . $curent_month . $current_day . '-' .$new_transaction;
|
||||
|
||||
$gadai = Http::post(config('api.url').'/api/gadai/'.$auth_user['cawangan'],[
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/gadai/'.$auth_user['cawangan'],[
|
||||
'norujukan' => $norujukanbaru,
|
||||
'nopelanggan' => $request->nopelanggan,
|
||||
'nokp' => $request->noic,
|
||||
'sirig' => $new_sirig
|
||||
]);
|
||||
|
||||
|
||||
|
||||
//////////////////////
|
||||
////Update SAG BARU///
|
||||
/////////////////////
|
||||
@@ -457,7 +457,7 @@ class PenebusanController extends Controller
|
||||
$hargajualan = $request->pinjaman + $keuntungan12bulan;
|
||||
|
||||
|
||||
$gadai = Http::put(config('api.url').'/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
'kodcaw' => $auth_user['cawangan'],
|
||||
'nilaimarhun' => round($total_nilai_marhun, 2),
|
||||
'berat' => round($request->total_berat, 2),
|
||||
@@ -472,7 +472,7 @@ class PenebusanController extends Controller
|
||||
'kuantiti_marhun' => $request->kuantiti_marhun
|
||||
])->json();
|
||||
|
||||
$komuditi = Http::put(config('api.url').'/api/komuditi/transaksi',[
|
||||
$komuditi = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/komuditi/transaksi',[
|
||||
'unit_komuditi' => round($request->pinjaman, 2),
|
||||
'norujukan' => $norujukanbaru,
|
||||
'kodcaw' => $auth_user['cawangan'],
|
||||
@@ -483,10 +483,10 @@ class PenebusanController extends Controller
|
||||
////Update History Gadaian///
|
||||
////////////////////////////
|
||||
|
||||
$updatehistorygadaian = Http::put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
$updatehistorygadaian = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
'historygadaian' => $request->norujukan
|
||||
])->json();
|
||||
|
||||
|
||||
///////////////////////////
|
||||
/// MARHUN UPDATE TABLE////
|
||||
//////////////////////////
|
||||
@@ -494,21 +494,21 @@ class PenebusanController extends Controller
|
||||
|
||||
$arraymarhunbaru = [];
|
||||
|
||||
$marhunsediada = Http::get(config('api.url') . '/api/marhun/'. $request->norujukan)->json();
|
||||
$marhunsediada = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/marhun/'. $request->norujukan)->json();
|
||||
|
||||
$marhunyangdiambil = $marhunsediada[0];
|
||||
foreach($marhunyangdiambil as $index=>$marhunloop)
|
||||
{
|
||||
$karatbaru = str_replace('.','-',$marhunloop['karat']);
|
||||
$hargabaru = Http::get(config('api.url') . '/api/harga_emas/'. $karatbaru)->json();
|
||||
|
||||
$hargabaru = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/harga_emas/'. $karatbaru)->json();
|
||||
|
||||
$nilaimarhun = (floatval($hargabaru['harga']) * floatval($marhunloop['berat']));
|
||||
|
||||
array_push($arraymarhunbaru, ["bil" => $marhunloop['bil'],"marhun" => $marhunloop['marhun'],"nota" => $marhunloop['nota'],"karat" => $marhunloop['karat'], "berat" => $marhunloop['berat'], "harga" => $hargabaru['harga'], "n_marhun" => $nilaimarhun]);
|
||||
}
|
||||
|
||||
foreach($arraymarhunbaru as $array1){
|
||||
$updatemarhun = Http::post(config('api.url').'/api/marhun/'. $auth_user['cawangan'],[
|
||||
$updatemarhun = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/marhun/'. $auth_user['cawangan'],[
|
||||
'norujukan' => $norujukanbaru,
|
||||
'marhun' => $array1['marhun'],
|
||||
'nota' => $array1['nota'],
|
||||
@@ -542,7 +542,7 @@ class PenebusanController extends Controller
|
||||
////////////////////////
|
||||
/// UPDATE TEBUS API////
|
||||
///////////////////////
|
||||
$updatetebus = Http::put(config('api.url').'/api/updatetebus/'. $auth_user['cawangan'] .'/' . $request->norujukan,[
|
||||
$updatetebus = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/updatetebus/'. $auth_user['cawangan'] .'/' . $request->norujukan,[
|
||||
'nopelanggan' => $request->nopelanggan,
|
||||
'jenistebus' => $request->jenistebus,
|
||||
'jbg' => $request->jbg,
|
||||
@@ -564,10 +564,10 @@ class PenebusanController extends Controller
|
||||
//////////////////////
|
||||
/// MAKING NEW SAG////
|
||||
/////////////////////
|
||||
$gadai_transaction = Http::get(config('api.url') . '/api/gadai/'. $auth_user['cawangan'] . '/' . $current->toDateString())->json();
|
||||
$gadai_transaction = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/'. $auth_user['cawangan'] . '/' . $current->toDateString())->json();
|
||||
if($gadai_transaction){
|
||||
$new_sirig = $gadai_transaction['sirig'] + 1;
|
||||
|
||||
|
||||
}else{
|
||||
$new_sirig = 1;
|
||||
}
|
||||
@@ -575,14 +575,14 @@ class PenebusanController extends Controller
|
||||
$new_transaction = sprintf("%04d",$new_sirig);
|
||||
$norujukanbaru = strtoupper($auth_user['cawangan']) . $curent_year . $curent_month . $current_day . '-' .$new_transaction;
|
||||
|
||||
$gadai = Http::post(config('api.url').'/api/gadai/'.$auth_user['cawangan'],[
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/gadai/'.$auth_user['cawangan'],[
|
||||
'norujukan' => $norujukanbaru,
|
||||
'nopelanggan' => $request->nopelanggan,
|
||||
'nokp' => $request->noic,
|
||||
'sirig' => $new_sirig
|
||||
]);
|
||||
|
||||
|
||||
|
||||
//////////////////////
|
||||
////Update SAG BARU///
|
||||
/////////////////////
|
||||
@@ -597,7 +597,7 @@ class PenebusanController extends Controller
|
||||
$hargajualan = $request->pinjaman + $keuntungan12bulan;
|
||||
|
||||
|
||||
$gadai = Http::put(config('api.url').'/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
'kodcaw' => $auth_user['cawangan'],
|
||||
'nilaimarhun' => round($total_nilai_marhun, 2),
|
||||
'berat' => round($request->total_berat, 2),
|
||||
@@ -612,7 +612,7 @@ class PenebusanController extends Controller
|
||||
'kuantiti_marhun' => $request->kuantiti_marhun
|
||||
])->json();
|
||||
|
||||
$komuditi = Http::put(config('api.url').'/api/komuditi/transaksi',[
|
||||
$komuditi = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/komuditi/transaksi',[
|
||||
'unit_komuditi' => round($request->pinjaman, 2),
|
||||
'norujukan' => $norujukanbaru,
|
||||
'kodcaw' => $auth_user['cawangan'],
|
||||
@@ -623,10 +623,10 @@ class PenebusanController extends Controller
|
||||
////Update History Gadaian///
|
||||
////////////////////////////
|
||||
|
||||
$updatehistorygadaian = Http::put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
$updatehistorygadaian = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
'historygadaian' => $request->norujukan
|
||||
])->json();
|
||||
|
||||
|
||||
///////////////////////////
|
||||
/// MARHUN UPDATE TABLE////
|
||||
//////////////////////////
|
||||
@@ -636,7 +636,7 @@ class PenebusanController extends Controller
|
||||
|
||||
$arraydiola = $request->arrayrecno;
|
||||
|
||||
$marhunsediada = Http::get(config('api.url') . '/api/marhun/'. $request->norujukan)->json();
|
||||
$marhunsediada = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/marhun/'. $request->norujukan)->json();
|
||||
|
||||
$marhunyangdiambil = $marhunsediada[0];
|
||||
foreach($marhunyangdiambil as $index=>$marhunloop)
|
||||
@@ -644,7 +644,7 @@ class PenebusanController extends Controller
|
||||
if(!in_array($marhunloop['recno'], $arraydiola))
|
||||
{
|
||||
$karatbaru = str_replace('.','-',$marhunloop['karat']);
|
||||
$hargabaru = Http::get(config('api.url') . '/api/harga_emas/'. $karatbaru)->json();
|
||||
$hargabaru = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/harga_emas/'. $karatbaru)->json();
|
||||
|
||||
$nilaimarhun = (floatval($hargabaru['harga']) * floatval($marhunloop['berat']));
|
||||
|
||||
@@ -654,7 +654,7 @@ class PenebusanController extends Controller
|
||||
|
||||
foreach($arraymarhunbaru as $array1)
|
||||
{
|
||||
$updatemarhun = Http::post(config('api.url').'/api/marhun/'. $auth_user['cawangan'],[
|
||||
$updatemarhun = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/marhun/'. $auth_user['cawangan'],[
|
||||
'norujukan' => $norujukanbaru,
|
||||
'marhun' => $array1['marhun'],
|
||||
'nota' => $array1['nota'],
|
||||
@@ -663,7 +663,7 @@ class PenebusanController extends Controller
|
||||
'harga' => $array1['harga'],
|
||||
'nilai_marhun' => $array1['n_marhun']
|
||||
])->json();
|
||||
|
||||
|
||||
}
|
||||
|
||||
event(new TebusNotify('lulus',Auth::user()->cawangan));
|
||||
@@ -683,7 +683,7 @@ class PenebusanController extends Controller
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$getfirstwakil = Http::get(config('api.url') . '/api/getwakil/'. $auth_user['cawangan'])->json();
|
||||
$getfirstwakil = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/getwakil/'. $auth_user['cawangan'])->json();
|
||||
|
||||
if(sizeof($getfirstwakil) != 0)
|
||||
return $getfirstwakil[0]['nowakil'];
|
||||
@@ -696,7 +696,7 @@ class PenebusanController extends Controller
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$getwakil = Http::get(config('api.url') . '/api/getwakil/'. $auth_user['cawangan'] . '/' . $request->wakil)->json();
|
||||
$getwakil = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/getwakil/'. $auth_user['cawangan'] . '/' . $request->wakil)->json();
|
||||
|
||||
if(sizeof($getwakil) > 0)
|
||||
return $getwakil[0];
|
||||
@@ -708,8 +708,8 @@ class PenebusanController extends Controller
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$createwakil = Http::post(config('api.url') . '/api/createwakil/'. $auth_user['cawangan'] . '/' . $request->icno,[
|
||||
|
||||
$createwakil = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url') . '/api/createwakil/'. $auth_user['cawangan'] . '/' . $request->icno,[
|
||||
|
||||
'nopelanggan' => $request->nopelanggan,
|
||||
'nowakil' => $request->nowakil,
|
||||
'nama' => $request->nama,
|
||||
@@ -729,7 +729,7 @@ class PenebusanController extends Controller
|
||||
public function tukaranhargaemas($norujukan)
|
||||
{
|
||||
|
||||
$marhunsaglama = Http::get(config('api.url') . '/api/marhun/'. $norujukan)->json();
|
||||
$marhunsaglama = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/marhun/'. $norujukan)->json();
|
||||
|
||||
$marhunsaglama = $marhunsaglama[0];
|
||||
$totalnilaimarhun = 0;
|
||||
@@ -737,7 +737,7 @@ class PenebusanController extends Controller
|
||||
foreach($marhunsaglama as $index=>$marhunloop)
|
||||
{
|
||||
$karatbaru = str_replace('.','-',$marhunloop['karat']);
|
||||
$hargabaru = Http::get(config('api.url') . '/api/harga_emas/'. $karatbaru)->json();
|
||||
$hargabaru = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/harga_emas/'. $karatbaru)->json();
|
||||
|
||||
$nilaimarhun = (floatval($hargabaru['harga']) * floatval($marhunloop['berat']));
|
||||
|
||||
@@ -750,12 +750,12 @@ class PenebusanController extends Controller
|
||||
public function PenebusanKhazanah($norujukan){
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
$gadaidetail = Http::get(config('api.url') . '/api/gadai/norujukan/'. $norujukan)->json();
|
||||
$gadaidetail = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/norujukan/'. $norujukan)->json();
|
||||
$noic = $gadaidetail[0][0]['nokp'];
|
||||
$customerdetail = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
|
||||
$marhundetail = Http::get(config('api.url') . '/api/marhun/'. $norujukan)->json();
|
||||
$customerdetail = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customers/'. $noic)->json();
|
||||
$marhundetail = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/marhun/'. $norujukan)->json();
|
||||
|
||||
$marhun = $marhundetail[0];
|
||||
$nama = $customerdetail['nama'];
|
||||
|
||||
Reference in New Issue
Block a user