fix delete changes
This commit is contained in:
@@ -52,4 +52,12 @@ class HomeController extends Controller
|
||||
return view('homepage.'.$auth_user['roles'].'.home',compact('cawangan_info','api_url'));
|
||||
}
|
||||
}
|
||||
|
||||
public function poskod(){
|
||||
$api_url = config('api.url');
|
||||
$auth_user = Auth::user();
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
return view('admin.poskod',compact('cawangan_info','api_url','auth_user'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,11 @@ class KhazanahController extends Controller
|
||||
$idtype = 'nokp';
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$bank = Http::get(config('api.url') . '/api/bank')->json();
|
||||
return view('khazanah.index',compact('search','cawangan_info','bank','api_url','idtype'));
|
||||
if($auth_user->roles == 'admin'){
|
||||
return view('admin.customer_index',compact('search','cawangan_info','bank','api_url','idtype','auth_user'));
|
||||
}else{
|
||||
return view('khazanah.index',compact('search','cawangan_info','bank','api_url','idtype','auth_user'));
|
||||
}
|
||||
}
|
||||
|
||||
public function search(Request $request){
|
||||
@@ -66,12 +70,66 @@ class KhazanahController extends Controller
|
||||
|
||||
if($customer_info){
|
||||
Session::put('customer_info_khazanah',$customer_info);
|
||||
return redirect()->route('khazanah.customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info,'api_url'=>$api_url]);
|
||||
if($auth_user->roles == 'admin'){
|
||||
return redirect()->route('admin.customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info,'api_url'=>$api_url]);
|
||||
}else{
|
||||
return redirect()->route('khazanah.customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info,'api_url'=>$api_url]);
|
||||
}
|
||||
}else{
|
||||
return view('khazanah.index',compact('search','noic','cawangan_info','bank','api_url','idtype'));
|
||||
if($auth_user->roles == 'admin'){
|
||||
return view('admin.customer_index',compact('search','noic','cawangan_info','bank','api_url','idtype'));
|
||||
}else{
|
||||
return view('khazanah.index',compact('search','noic','cawangan_info','bank','api_url','idtype'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function searchAdmin(Request $request){
|
||||
$noic = $request->noic;
|
||||
$idtype = $request->customerIDType;
|
||||
Session::put('noic', $noic);
|
||||
$api_url = config('api.url');
|
||||
$auth_user = Auth::user();
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$bank = Http::get(config('api.url') . '/api/bank')->json();
|
||||
$customer_info = Http::get(config('api.url') . '/api/admin/customers/nokp/search',[
|
||||
'ic' => $noic
|
||||
])->json();
|
||||
|
||||
$request->session()->forget('page_reload');
|
||||
$request->session()->forget('norujukan');
|
||||
|
||||
$search = true;
|
||||
|
||||
if($customer_info){
|
||||
Session::put('customer_info_khazanah',$customer_info);
|
||||
return redirect()->route('admin.customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info,'api_url'=>$api_url]);
|
||||
}else{
|
||||
return view('admin.customer_index',compact('search','noic','cawangan_info','bank','api_url','idtype'));
|
||||
}
|
||||
}
|
||||
|
||||
public function infoAdmin(Request $request){
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$customer_info = Http::get(config('api.url') . '/api/admin/customers/nokp/search',[
|
||||
'ic' => Session::get('noic')
|
||||
])->json();
|
||||
|
||||
$bakilelong = Http::get(config('api.url') . '/api/bakilelong/cawangan/' . $auth_user['cawangan'] . '/' . Session::get('noic') . '/baki')->json();
|
||||
$rugilelong = Http::get(config('api.url') . '/api/bakilelong/cawangan/' . $auth_user['cawangan'] . '/' . Session::get('noic') . '/rugi')->json();
|
||||
|
||||
$negeri = Http::get(config('api.url') . '/api/negeri/')->json();
|
||||
|
||||
|
||||
|
||||
$request->session()->forget('page_reload');
|
||||
$request->session()->forget('norujukan');
|
||||
|
||||
return view('admin.customer_info',compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','negeri'));
|
||||
}
|
||||
|
||||
public function info(Request $request){
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
@@ -92,7 +150,12 @@ class KhazanahController extends Controller
|
||||
|
||||
$request->session()->forget('page_reload');
|
||||
$request->session()->forget('norujukan');
|
||||
return view('khazanah.info',compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','negeri'));
|
||||
|
||||
if($auth_user->roles == 'admin'){
|
||||
return view('admin.customer_info',compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','negeri'));
|
||||
}else{
|
||||
return view('khazanah.info',compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','negeri'));
|
||||
}
|
||||
}
|
||||
|
||||
public function menu()
|
||||
@@ -312,91 +375,9 @@ class KhazanahController extends Controller
|
||||
|
||||
public function barcodescannedtebus(Request $request)
|
||||
{
|
||||
|
||||
|
||||
$auth_user = Auth::user();
|
||||
|
||||
|
||||
$gadai = Http::get(config('api.url') . '/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' .$request->norujukan_barcode)->json();
|
||||
$gadai_detail = $gadai[0];
|
||||
$hargajual=$gadai[0]['hargajualan'];
|
||||
$upah12=$gadai[0]['upah12'];
|
||||
$tarikh_gadai=$gadai[0]['t_gadai'];
|
||||
$tebus = Http::get(config('api.url') . '/api/listpenebusanhistory/'. $auth_user['cawangan'],['norujukan' => $request->norujukan_barcode])->json();
|
||||
//dd($tebus);
|
||||
$tebus_detail = $tebus[0];
|
||||
$pinjaman=$tebus[0]['pinjaman'];
|
||||
$jenis_tebus=$tebus[0]['jenistebus'];
|
||||
$bakipjm=$tebus[0]['bakipjm'];
|
||||
$bakiupah=$tebus[0]['bakiupah'];
|
||||
$rebet=$tebus[0]['rebate'];
|
||||
|
||||
|
||||
|
||||
$getTunai2=Http::get(config('api.url').'/api/GetCurrentTunai/'.$auth_user['cawangan'],['kodlaluan' => $tebus_detail['teller']])->json();
|
||||
|
||||
$keluar=$getTunai2['keluar'];
|
||||
$baki=$getTunai2['baki'];
|
||||
$masuk=$getTunai2['masuk'];
|
||||
$bakiawal=$getTunai2['bakiawal'];
|
||||
$pendahuluan=$getTunai2['tambah'];
|
||||
$serahan=$getTunai2['kurang'];
|
||||
$totalmasuk = 0;
|
||||
$bakiakhir = $getTunai2['baki'];
|
||||
$totalkeluar = 0;
|
||||
|
||||
$jum_bayaran=Http::get(config('api.url').'/api/transaction/one/'.$request->norujukan_barcode)->json();
|
||||
$jumlah_bayaran=$jum_bayaran['duit_masuk'];
|
||||
|
||||
$update=Http::put(config('api.url').'/api/updatetagterima/'.$auth_user['cawangan'].'/'.$request->norujukan_barcode)->json();
|
||||
|
||||
if($update == 'success'){
|
||||
if($tebus_detail['jenistebus'] == 'P')
|
||||
{
|
||||
$totalmasuk = $tebus_detail['pinjaman'] + $tebus_detail['bakiupah'] + $masuk;
|
||||
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [
|
||||
'kodlaluan' => $tebus_detail['teller'],
|
||||
'keluar'=>$keluar,
|
||||
'masuk'=>$totalmasuk,
|
||||
'bakiakhir'=>$bakiakhir
|
||||
]);
|
||||
|
||||
if(empty($updateTunai)){
|
||||
dd('x masuk aliran tunai');
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
if($tebus_detail['jenistebus'] == 'S')
|
||||
{
|
||||
$totalmasuk = $tebus_detail['pinjaman'] + $tebus_detail['bakiupah'] + $masuk;
|
||||
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [
|
||||
'kodlaluan' => $tebus_detail['teller'],
|
||||
'keluar'=>$keluar,
|
||||
'masuk'=>$totalmasuk,
|
||||
'bakiakhir'=>$bakiakhir
|
||||
]);
|
||||
if(empty($updateTunai)){
|
||||
dd('x masuk aliran tunai');
|
||||
}
|
||||
}else{
|
||||
$totalmasuk = $tebus_detail['bakipjm'] + $masuk;
|
||||
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [
|
||||
'kodlaluan' => $tebus_detail['teller'],
|
||||
'keluar'=>$keluar,
|
||||
'masuk'=>$totalmasuk,
|
||||
'bakiakhir'=>$bakiakhir
|
||||
]);
|
||||
|
||||
if(empty($updateTunai)){
|
||||
dd('x masuk aliran tunai');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return redirect()->route('khazanah.tebus');
|
||||
}
|
||||
@@ -1043,31 +1024,6 @@ class KhazanahController extends Controller
|
||||
|
||||
$auth_user = Auth::user();
|
||||
$scan_barcode = Http::put(config('api.url').'/api/gadai/serah_marhun/khazanah/'. $auth_user['cawangan'] .'/' . $request->norujukan_barcode)->json();
|
||||
|
||||
$gadai = Http::get(config('api.url') . '/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' .$request->norujukan_barcode)->json();
|
||||
$gadai_detail = $gadai[0];
|
||||
|
||||
$getTunai2=Http::get(config('api.url').'/api/GetCurrentTunai/'.$auth_user['cawangan'],['kodlaluan' => $gadai_detail['teller']])->json();
|
||||
|
||||
$keluar=$getTunai2['keluar'];
|
||||
$baki=$getTunai2['baki'];
|
||||
$masuk=$getTunai2['masuk'];
|
||||
$bakiawal = $getTunai2['bakiawal'];
|
||||
$pendahuluan=$getTunai2['tambah'];
|
||||
$serahan=$getTunai2['kurang'];
|
||||
$totalmasuk = 0;
|
||||
$bakiakhir = $getTunai2['baki'];
|
||||
$totalkeluar = 0;
|
||||
$upah12=$gadai[0]['upah12'];
|
||||
$totalkeluar = $gadai_detail['pinjaman'] + $keluar;
|
||||
|
||||
//masuk dalam tunai aliran
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [
|
||||
'kodlaluan' => $gadai_detail['teller'],
|
||||
'keluar' => $totalkeluar,
|
||||
'masuk' => $masuk,
|
||||
'bakiakhir' => $bakiakhir
|
||||
]);
|
||||
|
||||
event(new NotifikasiPembayaran('TellerkepadaKhazanah'));
|
||||
|
||||
|
||||
@@ -544,12 +544,8 @@ class PenebusanController extends Controller
|
||||
'marhun' => $request->marhun,
|
||||
'jenisbayarantebus' => $request->jenisbayarantebus,
|
||||
'teller' => $request->teller
|
||||
])->successful();
|
||||
])->json();
|
||||
|
||||
if(!$updatetebus)
|
||||
{
|
||||
return response('fail');
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
/// MAKING NEW SAG////
|
||||
@@ -570,12 +566,7 @@ class PenebusanController extends Controller
|
||||
'nopelanggan' => $request->nopelanggan,
|
||||
'nokp' => $request->noic,
|
||||
'sirig' => $new_sirig
|
||||
])->successful();
|
||||
|
||||
if(!$gadai)
|
||||
{
|
||||
return response('fail');
|
||||
}
|
||||
])->json();
|
||||
|
||||
|
||||
//////////////////////
|
||||
@@ -605,7 +596,7 @@ class PenebusanController extends Controller
|
||||
'upah12' => $keuntungan12bulan,
|
||||
'hargajualan' => $hargajualan,
|
||||
'kuantiti_marhun' => $request->kuantiti_marhun
|
||||
])->successful();
|
||||
])->$request->acceptsJson()();
|
||||
|
||||
$komuditi = Http::put(config('api.url').'/api/komuditi/transaksi',[
|
||||
'unit_komuditi' => round($request->pinjaman, 2),
|
||||
@@ -620,7 +611,7 @@ class PenebusanController extends Controller
|
||||
|
||||
$updatehistorygadaian = Http::put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||
'historygadaian' => $request->norujukan
|
||||
])->successful();
|
||||
])->json();
|
||||
|
||||
///////////////////////////
|
||||
/// MARHUN UPDATE TABLE////
|
||||
@@ -657,7 +648,7 @@ class PenebusanController extends Controller
|
||||
'berat_emas' => $array1['berat'],
|
||||
'harga' => $array1['harga'],
|
||||
'nilai_marhun' => $array1['n_marhun']
|
||||
])->successful();
|
||||
])->json();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user