buat history and notifikasi
This commit is contained in:
@@ -159,4 +159,58 @@ class GadaianController extends Controller
|
||||
|
||||
return view('print.sag',compact('gadai_detail','customer_detail','marhun_detail','cawangan_detail','api_url','pembayaran_segera'));
|
||||
}
|
||||
|
||||
public function resit($id)
|
||||
{
|
||||
|
||||
$transaction = Http::get(config('api.url') . '/api/transaction/id/'. $id)->json();
|
||||
|
||||
if(sizeof($transaction) != 0)
|
||||
$transaction = $transaction[0];
|
||||
|
||||
$gadai = Http::get(config('api.url') . '/api/gadai/norujukan/'. $transaction['norujukan'])->json();
|
||||
|
||||
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];
|
||||
|
||||
return view('print.resitansuran',compact('transaction','gadai','customers_info'));
|
||||
}
|
||||
|
||||
public function history(Request $request)
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$gadai = Http::get(config('api.url') . '/api/gadai/norujukan/'. $request->norujukan)->json();
|
||||
|
||||
if(sizeof($gadai) > 0)
|
||||
$history = $gadai[0][0]['historygadaian'];
|
||||
|
||||
$count = 0;
|
||||
$arrayhist = [];
|
||||
|
||||
while($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" => $tebus[0]['jenistebus'],"jbg" => $tebus[0]['jbg'],"t_tebus" => $tebus[0]['t_tebus']]);
|
||||
|
||||
if(sizeof($gadai) > 0)
|
||||
$history = $gadai[0][0]['historygadaian'];
|
||||
|
||||
$count++;
|
||||
}
|
||||
|
||||
return response()->json($arrayhist,200);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user