fix skit2
This commit is contained in:
@@ -105,4 +105,93 @@ class AliranTunaiController extends Controller
|
||||
|
||||
return view('aliran_tunai.index',compact('cawangan_info','alirantunai','api_url','GT','denominasi','gadai_tebus'));
|
||||
}
|
||||
|
||||
public function alirantunaiGadai(Request $request){
|
||||
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$gadai = Http::get(config('api.url') . '/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' .$request->norujukan)->json();
|
||||
$gadai_detail = $gadai[0];
|
||||
|
||||
$getTunai2=Http::get(config('api.url').'/api/GetCurrentTunai/'.$auth_user['cawangan'],['kodlaluan' => $request->teller])->json();
|
||||
|
||||
$keluar = $getTunai2['keluar'];
|
||||
$baki = $getTunai2['baki'];
|
||||
$masuk = $getTunai2['masuk'];
|
||||
$bakiawal = $getTunai2['bakiawal'];
|
||||
$pendahuluan = $getTunai2['tambah'];
|
||||
$serahan = $getTunai2['kurang'];
|
||||
|
||||
$totalkeluar = 0;
|
||||
$bakiakhir = 0;
|
||||
|
||||
$totalkeluar = $request->pinjaman + $keluar;
|
||||
|
||||
$bakiakhir = $bakiawal-$totalkeluar+$masuk+$pendahuluan-$serahan;
|
||||
|
||||
|
||||
//masuk dalam tunai aliran
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [
|
||||
'kodlaluan' => $request->teller,
|
||||
'keluar' => $keluar,
|
||||
'masuk' => $masuk,
|
||||
'bakiakhir' => $bakiakhir
|
||||
]);
|
||||
|
||||
return response()->json($updateTunai,201);
|
||||
|
||||
}
|
||||
|
||||
public function alirantunaiTebus(Request $request){
|
||||
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$gadai = Http::get(config('api.url') . '/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' .$request->norujukan)->json();
|
||||
$gadai_detail = $gadai[0];
|
||||
|
||||
$tebus = Http::get(config('api.url') . '/api/listpenebusanhistory/'. $auth_user['cawangan'],['norujukan' => $request->norujukan])->json();
|
||||
$tebus_detail = $tebus[0];
|
||||
|
||||
$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 = 0;
|
||||
$totalkeluar = 0;
|
||||
|
||||
if($tebus_detail['jenistebus'] == 'P')
|
||||
{
|
||||
|
||||
$totalkeluar = $tebus_detail['addpinjaman'] + $keluar;
|
||||
$totalmasuk = $tebus_detail['bakiupah'] + $masuk;
|
||||
|
||||
$bakiakhir = $bakiawal-$totalkeluar+$totalmasuk+$pendahuluan-$serahan;
|
||||
|
||||
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [
|
||||
'kodlaluan' => $tebus_detail['teller'],
|
||||
'keluar'=>$keluar,
|
||||
'masuk'=>$masuk,
|
||||
'bakiakhir'=>$bakiakhir
|
||||
]);
|
||||
|
||||
}else{
|
||||
|
||||
$totalmasuk = $tebus_detail['bakipjm'] + $masuk;
|
||||
$bakiakhir = $bakiawal-$keluar+$totalmasuk+$pendahuluan-$serahan;
|
||||
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [
|
||||
'kodlaluan' => $tebus_detail['teller'],
|
||||
'keluar'=>$keluar,
|
||||
'masuk'=>$masuk,
|
||||
'bakiakhir'=>$bakiakhir
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -565,7 +565,7 @@ class GadaianController extends Controller
|
||||
"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,["pinjaman" => ((isset($tebus[0])) ? $tebus[0]['pinjaman'] : 0),"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)
|
||||
$history = $gadai[0][0]['historygadaian'];
|
||||
@@ -580,7 +580,7 @@ class GadaianController extends Controller
|
||||
])->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)]);
|
||||
array_push($arrayhist,["pinjaman" => ((isset($tebus[0])) ? $tebus[0]['pinjaman'] : 0),"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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ class KhazanahController extends Controller
|
||||
$pendahuluan=$getTunai2['tambah'];
|
||||
$serahan=$getTunai2['kurang'];
|
||||
$totalmasuk = 0;
|
||||
$bakiakhir = 0;
|
||||
$bakiakhir = $getTunai2['baki'];
|
||||
$totalkeluar = 0;
|
||||
|
||||
if($tebus_detail['jenistebus'] == 'P')
|
||||
@@ -242,8 +242,6 @@ class KhazanahController extends Controller
|
||||
'bakiakhir'=>$bakiakhir
|
||||
]);
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
$totalmasuk = $tebus_detail['bakipjm'] + $masuk;
|
||||
@@ -688,6 +686,7 @@ class KhazanahController extends Controller
|
||||
}
|
||||
|
||||
public function barcodescanned(Request $request){
|
||||
|
||||
$auth_user = Auth::user();
|
||||
$gadai = Http::put(config('api.url').'/api/gadai/serah_marhun/khazanah/'. $auth_user['cawangan'] .'/' . $request->norujukan_barcode)->json();
|
||||
|
||||
@@ -699,17 +698,15 @@ class KhazanahController extends Controller
|
||||
$keluar=$getTunai2['keluar'];
|
||||
$baki=$getTunai2['baki'];
|
||||
$masuk=$getTunai2['masuk'];
|
||||
$bakiawal=$getTunai2['bakiawal'];
|
||||
$bakiawal = $getTunai2['bakiawal'];
|
||||
$pendahuluan=$getTunai2['tambah'];
|
||||
$serahan=$getTunai2['kurang'];
|
||||
|
||||
$totalmasuk = 0;
|
||||
$bakiakhir = $getTunai2['baki'];
|
||||
$totalkeluar = 0;
|
||||
$bakiakhir = 0;
|
||||
|
||||
$totalkeluar = $gadai_detail['pinjaman'] + $keluar;
|
||||
|
||||
$bakiakhir = $bakiawal-$totalkeluar+$masuk+$pendahuluan-$serahan;
|
||||
|
||||
//masuk dalam tunai aliran
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [
|
||||
'kodlaluan' => $gadai_detail['teller'],
|
||||
|
||||
Vendored
-2
@@ -405,8 +405,6 @@ async function openuptambahdanserah(e)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -155,8 +155,9 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
@if(is_object($gadai_tebus) && is_array($gadai_tebus))
|
||||
@foreach($gadai_tebus as $gt)
|
||||
<tr>
|
||||
<td> {{ $loop->iteration }} </td>
|
||||
<td> {{ $gt['norujukan'] }} </td>
|
||||
<td> {{ $gt['pinjaman'] }} </td>
|
||||
@@ -169,6 +170,7 @@
|
||||
@endphp </td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -611,6 +611,8 @@
|
||||
var counter = 1;
|
||||
historytebusbayaran.clear().draw();
|
||||
|
||||
console.table(data);
|
||||
|
||||
$.each(data,function(index,tebusaz){
|
||||
|
||||
switch(tebusaz['jenistebus']) {
|
||||
@@ -637,6 +639,7 @@
|
||||
counter,
|
||||
tebusaz['norujukan'],
|
||||
tebusaz['jenistebus'],
|
||||
tebusaz['pinjaman'],
|
||||
tebusaz['jbg'],
|
||||
tebusaz['t_tebus'],
|
||||
'<a class="btn btn-info" target="_blank" href='+ urlroute +'>Cetak</a>'
|
||||
|
||||
@@ -802,6 +802,25 @@
|
||||
title: 'Telah Disahkan',
|
||||
text: `Komen : ${data.komen}`
|
||||
}).then(function(){
|
||||
|
||||
$.ajax({
|
||||
method: 'put',
|
||||
url: "{{ route('alirantunai.gadai') }}",
|
||||
async:false,
|
||||
data:{
|
||||
'norujukan' : norujukan,
|
||||
'teller' : teller,
|
||||
'pinjaman' : pinjaman,
|
||||
"_token": "{{ csrf_token() }}"
|
||||
},
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
}, error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
$(func).attr("onSubmit","return true;");
|
||||
$(func).submit();
|
||||
return true;
|
||||
@@ -918,6 +937,24 @@
|
||||
icon: 'success',
|
||||
title: 'Telah Disahkan'
|
||||
}).then(function(){
|
||||
|
||||
$.ajax({
|
||||
method: 'put',
|
||||
url: "{{ route('alirantunai.gadai') }}",
|
||||
async:false,
|
||||
data:{
|
||||
'norujukan' : norujukan,
|
||||
'teller' : teller,
|
||||
'pinjaman' : pinjaman,
|
||||
"_token": "{{ csrf_token() }}"
|
||||
},
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
}, error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
$(func).attr("onSubmit","return true;");
|
||||
$(func).submit();
|
||||
@@ -961,6 +998,25 @@
|
||||
title: 'Berjaya!',
|
||||
text: 'Gadaian Berjaya Disimpan'
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
method: 'put',
|
||||
url: "{{ route('alirantunai.gadai') }}",
|
||||
async:false,
|
||||
data:{
|
||||
'norujukan' : norujukan,
|
||||
'teller' : teller,
|
||||
'pinjaman' : pinjaman,
|
||||
"_token": "{{ csrf_token() }}"
|
||||
},
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
}, error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
$(func).attr("onSubmit","return true;");
|
||||
$(func).submit();
|
||||
return true;
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
<th>Bil</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Jenis Tebus</th>
|
||||
<th>Pembiayaan Asal</th>
|
||||
<th>JBG</th>
|
||||
<th>Tarikh Tebus</th>
|
||||
<th>Action</th>
|
||||
|
||||
@@ -803,11 +803,26 @@
|
||||
},
|
||||
success:function(success_data){
|
||||
|
||||
$.ajax({
|
||||
method: 'put',
|
||||
url: "{{ route('alirantunai.tebus') }}",
|
||||
async:false,
|
||||
data:{
|
||||
'norujukan' : norujukan,
|
||||
"_token": "{{ csrf_token() }}"
|
||||
},
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
}, error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Berjaya!',
|
||||
text: 'Penebusan Berjaya',
|
||||
|
||||
}).then(function() {
|
||||
window.open(urlroute, '_blank');
|
||||
window.location.replace("{{ url()->previous() }}");
|
||||
@@ -1118,6 +1133,23 @@
|
||||
|
||||
},
|
||||
success:function(success_data){
|
||||
|
||||
$.ajax({
|
||||
method: 'put',
|
||||
url: "{{ route('alirantunai.tebus') }}",
|
||||
async:false,
|
||||
data:{
|
||||
'norujukan' : norujukan,
|
||||
"_token": "{{ csrf_token() }}"
|
||||
},
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
}, error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
var urlroute = '{{ route("resit.tebusseparuh", ":id") }}';
|
||||
urlroute = urlroute.replace(':id', norujukan);
|
||||
Swal.fire(
|
||||
@@ -1227,9 +1259,9 @@
|
||||
if(data.kelulusan == 'lulus')
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Telah Disahkan',
|
||||
text: `Komen : ${data.komen}`
|
||||
icon: 'success',
|
||||
title: 'Telah Disahkan',
|
||||
text: `Komen : ${data.komen}`
|
||||
}).then(function(){
|
||||
tambahpinjamanfunc();
|
||||
});
|
||||
@@ -1386,6 +1418,7 @@
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
tambahpinjamanfunc();
|
||||
}
|
||||
}
|
||||
@@ -1460,6 +1493,22 @@
|
||||
var urlroute = '{{ route("resit.tambahpinjam", ":id") }}';
|
||||
urlroute = urlroute.replace(':id', norujukan);
|
||||
|
||||
$.ajax({
|
||||
method: 'put',
|
||||
url: "{{ route('alirantunai.tebus') }}",
|
||||
async:false,
|
||||
data:{
|
||||
'norujukan' : norujukan,
|
||||
"_token": "{{ csrf_token() }}"
|
||||
},
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
}, error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
Swal.fire(
|
||||
'Berjaya!',
|
||||
'Tambah Pinjaman Berjaya!',
|
||||
|
||||
@@ -69,6 +69,8 @@ Route::get('/gadaian',['as'=>'gadaian','uses'=>'GadaianController@index'])->midd
|
||||
Route::get('/daftar_marhun',['as'=>'daftar_marhun','uses'=>'MarhunController@index'])->middleware('auth','teller');
|
||||
Route::get('/penebusan/{norujukan}',['as'=>'penebusan','uses' => 'PenebusanController@index'])->middleware('auth','teller');
|
||||
Route::get('/aliran_tunai','AliranTunaiController@index')->middleware('auth','teller');
|
||||
Route::put('/aliran_tunai/Gadaian',['as'=>'alirantunai.gadai','uses' => 'AliranTunaiController@alirantunaiGadai'])->middleware('auth','teller');
|
||||
Route::put('/aliran_tunai/Tebusan',['as'=>'alirantunai.tebus','uses' => 'AliranTunaiController@alirantunaiTebus'])->middleware('auth','teller');
|
||||
Route::get('/harga_emas','HargaEmasController@index')->middleware('auth','teller');
|
||||
Route::get('/profile',['as'=>'profile','uses'=>'UserController@index'])->middleware('auth');
|
||||
Route::get('/customer/search',['as'=>'customer.search','uses'=>'CustomersController@search'])->middleware('auth','teller');
|
||||
|
||||
Reference in New Issue
Block a user