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)
|
||||
|
||||
@@ -211,7 +211,7 @@ class KhazanahController extends Controller
|
||||
$tebus = Http::get(config('api.url') . '/api/listpenebusanhistory/'. $auth_user['cawangan'],['norujukan' => $request->norujukan_barcode])->json();
|
||||
//dd($tebus);
|
||||
$tebus_detail = $tebus[0];
|
||||
//dd($tebus_detail);
|
||||
|
||||
|
||||
$getTunai2=Http::get(config('api.url').'/api/GetCurrentTunai/'.$auth_user['cawangan'],['kodlaluan' => $tebus_detail['teller']])->json();
|
||||
|
||||
@@ -227,18 +227,22 @@ class KhazanahController extends Controller
|
||||
|
||||
if($tebus_detail['jenistebus'] == 'P')
|
||||
{
|
||||
|
||||
$totalkeluar = $tebus_detail['addpinjaman'] + $keluar;
|
||||
$totalmasuk = $tebus_detail['bakiupah'] + $masuk;
|
||||
|
||||
// dd($tebus_detail['addpinjaman'],$keluar,$totalkeluar);
|
||||
$bakiakhir = $bakiawal-$totalkeluar+$masuk+$pendahuluan-$serahan;
|
||||
$bakiakhir = $bakiawal-$totalkeluar+$totalmasuk+$pendahuluan-$serahan;
|
||||
|
||||
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [
|
||||
'kodlaluan' => $tebus_detail['teller'],
|
||||
'keluar'=>$totalkeluar,
|
||||
'masuk'=>$masuk,
|
||||
'masuk'=>$totalmasuk,
|
||||
'bakiakhir'=>$bakiakhir
|
||||
]);
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
$totalmasuk = $tebus_detail['bakipjm'] + $masuk;
|
||||
@@ -532,10 +536,9 @@ class KhazanahController extends Controller
|
||||
|
||||
if($request->pembatalan == null)
|
||||
{
|
||||
|
||||
$updatelulus = Http::put(config('api.url') . '/api/UpdateKelulusan/' . $auth_user['cawangan'] . '/' . $norujukan,[
|
||||
"pengesahan" => "operasi",
|
||||
'siri' => $request->siri
|
||||
'siri' => $request->siri,
|
||||
])->json();
|
||||
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user