fix kelulusan
This commit is contained in:
@@ -381,6 +381,45 @@ class GadaianController extends Controller
|
||||
return view('print.resitansuransebelum',compact('gadai','customers_info','wakil','penebusan'));
|
||||
}
|
||||
|
||||
public function resittebusseparuh($id)
|
||||
{
|
||||
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$gadai = Http::get(config('api.url') . '/api/gadai/norujukan/'. $id)->json();
|
||||
|
||||
$totaltransaction = 0;
|
||||
|
||||
$transaction = Http::get(config('api.url') . '/api/transaction/'. $id)->json();
|
||||
|
||||
foreach($transaction as $trans)
|
||||
{
|
||||
$totaltransaction += $trans['duit_masuk'];
|
||||
}
|
||||
|
||||
if(sizeof($gadai) != 0)
|
||||
$gadai = $gadai[0][0];
|
||||
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json();
|
||||
|
||||
if(sizeof($customers_info) != 0)
|
||||
$customers_info = $customers_info[0];
|
||||
|
||||
|
||||
$penebusan = Http::get(config('api.url') . '/api/listpenebusanhistory/' . $auth_user['cawangan'],[ "norujukan" => $id])->json();
|
||||
|
||||
if(sizeof($penebusan) != 0)
|
||||
$penebusan = $penebusan[0];
|
||||
|
||||
$wakil = Http::get(config('api.url') . '/api/getwakil/' . $auth_user['cawangan'] . '/code/' . $penebusan['nowakil'])->json();
|
||||
|
||||
// dd($wakil);
|
||||
if(sizeof($wakil) != 0)
|
||||
$wakil = $wakil[0];
|
||||
|
||||
return view('print.resittebusseparuh',compact('transaction','gadai','customers_info','penebusan','wakil','totaltransaction'));
|
||||
}
|
||||
|
||||
public function resittebus($id)
|
||||
{
|
||||
|
||||
@@ -506,34 +545,48 @@ class GadaianController extends Controller
|
||||
$gadai = Http::get(config('api.url') . '/api/gadai/norujukan/'. $request->norujukan)->json();
|
||||
|
||||
if(sizeof($gadai) > 0)
|
||||
{
|
||||
$history = $gadai[0][0]['historygadaian'];
|
||||
$dahtebus = $gadai[0][0]['sttebus'];
|
||||
$norujukan = $gadai[0][0]['norujukan'];
|
||||
|
||||
}
|
||||
|
||||
|
||||
$count = 0;
|
||||
$arrayhist = [];
|
||||
|
||||
while($history != "0" && $history != '')
|
||||
while($history != "0" && $history != '' || $dahtebus == 'T')
|
||||
{
|
||||
$gadai = Http::get(config('api.url') . '/api/gadai/norujukan/'. $history)->json();
|
||||
|
||||
$tebus = Http::get(config('api.url') . '/api/listpenebusanhistory/'. $auth_user['cawangan'],[
|
||||
"norujukan" => $history
|
||||
])->json();
|
||||
if($history != "0" && $history != '')
|
||||
{
|
||||
$gadai = Http::get(config('api.url') . '/api/gadai/norujukan/'. $history)->json();
|
||||
$tebus = Http::get(config('api.url') . '/api/listpenebusanhistory/'. $auth_user['cawangan'],[
|
||||
"norujukan" => $history
|
||||
])->json();
|
||||
|
||||
array_push($arrayhist,["norujukan" => $history,"jenistebus" => ((isset($tebus[0])) ? $tebus[0]['jenistebus'] : 0),"jbg" => ((isset($tebus[0])) ? $tebus[0]['jbg'] : 0),"t_tebus" => ((isset($tebus[0])) ? $tebus[0]['t_tebus'] : 0)]);
|
||||
array_push($arrayhist,["norujukan" => $history,"jenistebus" => ((isset($tebus[0])) ? $tebus[0]['jenistebus'] : 0),"jbg" => ((isset($tebus[0])) ? $tebus[0]['jbg'] : 0),"t_tebus" => ((isset($tebus[0])) ? $tebus[0]['t_tebus'] : 0)]);
|
||||
|
||||
if(sizeof($gadai) > 0)
|
||||
if(sizeof($gadai) > 0)
|
||||
$history = $gadai[0][0]['historygadaian'];
|
||||
|
||||
$count++;
|
||||
|
||||
}
|
||||
else{
|
||||
$gadai = Http::get(config('api.url') . '/api/gadai/norujukan/'. $norujukan)->json();
|
||||
$tebus = Http::get(config('api.url') . '/api/listpenebusanhistory/'. $auth_user['cawangan'],[
|
||||
"norujukan" => $norujukan
|
||||
])->json();
|
||||
|
||||
|
||||
array_push($arrayhist,["norujukan" => $norujukan,"jenistebus" => ((isset($tebus[0])) ? $tebus[0]['jenistebus'] : 0),"jbg" => ((isset($tebus[0])) ? $tebus[0]['jbg'] : 0),"t_tebus" => ((isset($tebus[0])) ? $tebus[0]['t_tebus'] : 0)]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return response()->json($arrayhist,200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// KELULUSAN///
|
||||
|
||||
public function getkelulusan(Request $request)
|
||||
|
||||
Reference in New Issue
Block a user