pick certain commits
This commit is contained in:
@@ -129,16 +129,8 @@ class AliranTunaiController extends Controller
|
|||||||
$getTunai2=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/GetCurrentTunai/'.$auth_user['cawangan'],['kodlaluan' => $teller])->json();
|
$getTunai2=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/GetCurrentTunai/'.$auth_user['cawangan'],['kodlaluan' => $teller])->json();
|
||||||
|
|
||||||
$keluar = $getTunai2['keluar'];
|
$keluar = $getTunai2['keluar'];
|
||||||
$baki = $getTunai2['baki'];
|
$bakiakhir = $getTunai2['baki'];
|
||||||
$masuk = $getTunai2['masuk'];
|
$masuk = $getTunai2['masuk'];
|
||||||
$bakiawal = $getTunai2['bakiawal'];
|
|
||||||
$pendahuluan = $getTunai2['tambah'];
|
|
||||||
$serahan = $getTunai2['kurang'];
|
|
||||||
|
|
||||||
$totalkeluar = 0;
|
|
||||||
$bakiakhir = $baki;
|
|
||||||
|
|
||||||
// $totalkeluar = $request->pinjaman + $keluar;
|
|
||||||
|
|
||||||
$bakiakhir -= $request->pinjaman;
|
$bakiakhir -= $request->pinjaman;
|
||||||
|
|
||||||
@@ -170,12 +162,7 @@ class AliranTunaiController extends Controller
|
|||||||
$keluar=$getTunai2['keluar'];
|
$keluar=$getTunai2['keluar'];
|
||||||
$baki=$getTunai2['baki'];
|
$baki=$getTunai2['baki'];
|
||||||
$masuk=$getTunai2['masuk'];
|
$masuk=$getTunai2['masuk'];
|
||||||
$bakiawal=$getTunai2['bakiawal'];
|
|
||||||
$pendahuluan=$getTunai2['tambah'];
|
|
||||||
$serahan=$getTunai2['kurang'];
|
|
||||||
$totalmasuk = 0;
|
|
||||||
$bakiakhir = $baki;
|
$bakiakhir = $baki;
|
||||||
$totalkeluar = 0;
|
|
||||||
|
|
||||||
if($tebus_detail['jenistebus'] == 'P')
|
if($tebus_detail['jenistebus'] == 'P')
|
||||||
{
|
{
|
||||||
@@ -198,17 +185,13 @@ class AliranTunaiController extends Controller
|
|||||||
|
|
||||||
if($tebus_detail['jenistebus'] == 'S')
|
if($tebus_detail['jenistebus'] == 'S')
|
||||||
{
|
{
|
||||||
$totalmasuk = $tebus_detail['pinjaman'] + $tebus_detail['bakiupah'] + $masuk;
|
$totalmasuk = ($tebus_detail['bakipjm'] - $request['pinjaman']) + $masuk;
|
||||||
$bakiakhir = $bakiakhir + $tebus_detail['bakipjm'];
|
$bakiakhir = $bakiakhir + ($tebus_detail['bakipjm'] - $request['pinjaman']);
|
||||||
}else{
|
}else{
|
||||||
$totalmasuk = $tebus_detail['bakipjm'] + $masuk;
|
$totalmasuk = $tebus_detail['bakipjm'] + $masuk;
|
||||||
$bakiakhir = $bakiakhir + $tebus_detail['bakipjm'];
|
$bakiakhir = $bakiakhir + $tebus_detail['bakipjm'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// $totalmasuk = $tebus_detail['bakipjm'] + $masuk;
|
|
||||||
// $bakiakhir = $bakiawal-$keluar+$totalmasuk+$pendahuluan-$serahan;
|
|
||||||
|
|
||||||
|
|
||||||
$updateTunai=Http::withOptions(['verify' => config('app.api_verify')])->put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [
|
$updateTunai=Http::withOptions(['verify' => config('app.api_verify')])->put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [
|
||||||
'kodlaluan' => $tebus_detail['teller'],
|
'kodlaluan' => $tebus_detail['teller'],
|
||||||
'keluar'=>$keluar,
|
'keluar'=>$keluar,
|
||||||
@@ -234,12 +217,7 @@ class AliranTunaiController extends Controller
|
|||||||
$keluar=$getTunai2['keluar'];
|
$keluar=$getTunai2['keluar'];
|
||||||
$baki=$getTunai2['baki'];
|
$baki=$getTunai2['baki'];
|
||||||
$masuk=$getTunai2['masuk'];
|
$masuk=$getTunai2['masuk'];
|
||||||
$bakiawal=$getTunai2['bakiawal'];
|
|
||||||
$pendahuluan=$getTunai2['tambah'];
|
|
||||||
$serahan=$getTunai2['kurang'];
|
|
||||||
$totalmasuk = 0;
|
|
||||||
$bakiakhir = $baki;
|
$bakiakhir = $baki;
|
||||||
$totalkeluar = 0;
|
|
||||||
|
|
||||||
$bakiakhir = $bakiakhir + $request->totalbayaran;
|
$bakiakhir = $bakiakhir + $request->totalbayaran;
|
||||||
|
|
||||||
|
|||||||
@@ -742,7 +742,7 @@ class GadaianController extends Controller
|
|||||||
if($history == $gadai[0][0]['historygadaian'])
|
if($history == $gadai[0][0]['historygadaian'])
|
||||||
$history = 0;
|
$history = 0;
|
||||||
else{
|
else{
|
||||||
array_push($arrayhist,["tagbaru" => ((isset($gadai[0][0]['tagbaru'])) ? $gadai[0][0]['tagbaru'] : 0),"hargajualan" => ((isset($gadai[0][0]['hargajualan'])) ? $gadai[0][0]['hargajualan'] : ''), "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)]);
|
array_push($arrayhist,["historygadaian" => ((isset($gadai[0][0]['historygadaian'])) ? $gadai[0][0]['historygadaian'] : 0),"tagbaru" => ((isset($gadai[0][0]['tagbaru'])) ? $gadai[0][0]['tagbaru'] : 0),"hargajualan" => ((isset($gadai[0][0]['hargajualan'])) ? $gadai[0][0]['hargajualan'] : ''), "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)]);
|
||||||
$history = $gadai[0][0]['historygadaian'];
|
$history = $gadai[0][0]['historygadaian'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -757,7 +757,7 @@ class GadaianController extends Controller
|
|||||||
])->json();
|
])->json();
|
||||||
|
|
||||||
|
|
||||||
array_push($arrayhist,["tagbaru" => ((isset($gadai[0][0]['tagbaru'])) ? $gadai[0][0]['tagbaru'] : 0), "hargajualan" => ((isset($gadai[0][0]['hargajualan'])) ? $gadai[0][0]['hargajualan'] : ''),"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)]);
|
array_push($arrayhist,["historygadaian" => ((isset($gadai[0][0]['historygadaian'])) ? $gadai[0][0]['historygadaian'] : 0),"tagbaru" => ((isset($gadai[0][0]['tagbaru'])) ? $gadai[0][0]['tagbaru'] : 0), "hargajualan" => ((isset($gadai[0][0]['hargajualan'])) ? $gadai[0][0]['hargajualan'] : ''),"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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,11 +32,11 @@ class HomeController extends Controller
|
|||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
$current = $current->toDateString();
|
$current = $current->toDateString();
|
||||||
|
|
||||||
$auth_user = Auth::user();
|
$auth_user = Auth::user();
|
||||||
$api_url = config('api.url');
|
$api_url = config('api.url');
|
||||||
|
|
||||||
$check_nokp = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/checknokp/' . $auth_user['cawangan'] . '/' . $auth_user['no_kp'] . '/' . $current) ->json();
|
$check_nokp = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/checknokp/' . $auth_user['cawangan'] . '/' . $auth_user['no_kp'] . '/' . $current) ->json();
|
||||||
// dd($check_nokp, $auth_user['no_kp']);
|
|
||||||
if($check_nokp == $auth_user['no_kp']){
|
if($check_nokp == $auth_user['no_kp']){
|
||||||
|
|
||||||
|
|
||||||
@@ -87,10 +87,13 @@ class HomeController extends Controller
|
|||||||
else{
|
else{
|
||||||
|
|
||||||
$session = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url') . '/api/logsession/' . $auth_user['cawangan'], [
|
$session = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url') . '/api/logsession/' . $auth_user['cawangan'], [
|
||||||
|
'id' => $auth_user['id'],
|
||||||
'nama' => $auth_user['name'],
|
'nama' => $auth_user['name'],
|
||||||
'nokp' => $auth_user['no_kp'],
|
'nokp' => $auth_user['no_kp'],
|
||||||
'email' => $auth_user['email'],
|
'email' => $auth_user['email'],
|
||||||
'taraf' => $auth_user['role_harian'],
|
'taraf' => $auth_user['role_harian'],
|
||||||
|
'tarikh' => $current,
|
||||||
|
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ use Carbon\Carbon;
|
|||||||
|
|
||||||
class PenebusanController extends Controller
|
class PenebusanController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
protected $AliranTunaiController;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->middleware('auth');
|
$this->middleware('auth');
|
||||||
@@ -41,7 +44,8 @@ class PenebusanController extends Controller
|
|||||||
|
|
||||||
$nilaihargasemasa = $this->tukaranhargaemas($norujukan);
|
$nilaihargasemasa = $this->tukaranhargaemas($norujukan);
|
||||||
|
|
||||||
return view('penebusan.' . $cawangan_info['version'] . '.index',compact('cawangan_info','api_url','gadai','marhun','nama','nilaihargasemasa'));
|
$pertambahpinjaman = 0.80;
|
||||||
|
return view('penebusan.' . $cawangan_info['version'] . '.index',compact('cawangan_info','api_url','gadai','marhun','nama','nilaihargasemasa','pertambahpinjaman'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tebuspenuh(Request $request)
|
public function tebuspenuh(Request $request)
|
||||||
@@ -315,53 +319,6 @@ class PenebusanController extends Controller
|
|||||||
'sirig' => $new_sirig
|
'sirig' => $new_sirig
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
//////////////////////
|
|
||||||
////Update SAG BARU///
|
|
||||||
/////////////////////
|
|
||||||
|
|
||||||
$keuntungan_sebln = $request->keuntungan_sebulan;
|
|
||||||
$keuntungan_sebln = str_replace(',','',$keuntungan_sebln);
|
|
||||||
|
|
||||||
$total_nilai_marhun = $request->nilai_marhun;
|
|
||||||
$margin_pinjaman = $request->pinjaman / $total_nilai_marhun;
|
|
||||||
$kadarupah = $request->kadarkeuntungan * 100;
|
|
||||||
$keuntungan6bulan = $keuntungan_sebln * 6;
|
|
||||||
$keuntungan12bulan = $keuntungan_sebln * 12;
|
|
||||||
$hargajualan = $request->pinjaman + $keuntungan12bulan;
|
|
||||||
|
|
||||||
|
|
||||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
|
||||||
'kodcaw' => $auth_user['cawangan'],
|
|
||||||
'nilaimarhun' => round($total_nilai_marhun, 2),
|
|
||||||
'berat' => round($request->total_berat, 2),
|
|
||||||
'pinjaman' => round($request->pinjaman, 2),
|
|
||||||
'kadarupah' => round($kadarupah, 2),
|
|
||||||
'marhun' => $request->marhun,
|
|
||||||
'percentpinj' => $margin_pinjaman,
|
|
||||||
'teller'=> $auth_user['name'],
|
|
||||||
'upah6' => $keuntungan6bulan,
|
|
||||||
'upah12' => $keuntungan12bulan,
|
|
||||||
'hargajualan' => $hargajualan,
|
|
||||||
'kuantiti_marhun' => $request->kuantiti_marhun
|
|
||||||
])->json();
|
|
||||||
|
|
||||||
$komuditi = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/komuditi/transaksi',[
|
|
||||||
'unit_komuditi' => round($request->pinjaman, 2),
|
|
||||||
'norujukan' => $norujukanbaru,
|
|
||||||
'kodcaw' => $auth_user['cawangan'],
|
|
||||||
'teller' => $auth_user['name']
|
|
||||||
]);
|
|
||||||
|
|
||||||
////////////////////////////
|
|
||||||
////Update History Gadaian///
|
|
||||||
////////////////////////////
|
|
||||||
|
|
||||||
$updatehistorygadaian = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
|
||||||
'historygadaian' => $request->norujukan
|
|
||||||
])->json();
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
/// MARHUN UPDATE TABLE////
|
/// MARHUN UPDATE TABLE////
|
||||||
//////////////////////////
|
//////////////////////////
|
||||||
@@ -394,6 +351,65 @@ class PenebusanController extends Controller
|
|||||||
])->json();
|
])->json();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////
|
||||||
|
////Update SAG BARU///
|
||||||
|
/////////////////////
|
||||||
|
|
||||||
|
$total_nilai_marhun = $request->nilai_marhun;
|
||||||
|
$margin_pinjaman = $request->pinjaman / $total_nilai_marhun;
|
||||||
|
$kadarupah = $request->kadarkeuntungan * 100;
|
||||||
|
|
||||||
|
$onepercent = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/onepercent',[
|
||||||
|
'pembiayaan' => $request->pinjaman,
|
||||||
|
'nilaimarhun' => $total_nilai_marhun,
|
||||||
|
'kadarujrah' => $request->kadarkeuntungan,
|
||||||
|
'margin' => ($margin_pinjaman*100),
|
||||||
|
'kodcaw' => Auth::user()->cawangan
|
||||||
|
])->json();
|
||||||
|
|
||||||
|
$keuntungan_sebln = $onepercent['keuntungan'];
|
||||||
|
$keuntungan_sebln = str_replace(',','',$keuntungan_sebln);
|
||||||
|
$keuntungan6bulan = $keuntungan_sebln * 6;
|
||||||
|
$keuntungan12bulan = $keuntungan_sebln * 12;
|
||||||
|
$hargajualan = $request->pinjaman + $keuntungan12bulan;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||||
|
'kodcaw' => $auth_user['cawangan'],
|
||||||
|
'nilaimarhun' => round($total_nilai_marhun, 2),
|
||||||
|
'berat' => round($request->total_berat, 2),
|
||||||
|
'pinjaman' => round($request->pinjaman, 2),
|
||||||
|
'kadarupah' => round($kadarupah, 2),
|
||||||
|
'marhun' => $request->marhun,
|
||||||
|
'percentpinj' => $margin_pinjaman,
|
||||||
|
'teller'=> $auth_user['name'],
|
||||||
|
'upah6' => $keuntungan6bulan,
|
||||||
|
'upah12' => $keuntungan12bulan,
|
||||||
|
'hargajualan' => $hargajualan,
|
||||||
|
'kuantiti_marhun' => $request->kuantiti_marhun
|
||||||
|
])->json();
|
||||||
|
|
||||||
|
$komuditi = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/komuditi/transaksi',[
|
||||||
|
'unit_komuditi' => round($request->pinjaman, 2),
|
||||||
|
'norujukan' => $norujukanbaru,
|
||||||
|
'kodcaw' => $auth_user['cawangan'],
|
||||||
|
'teller' => $auth_user['name']
|
||||||
|
]);
|
||||||
|
|
||||||
|
////////////////////////////
|
||||||
|
////Update History Gadaian///
|
||||||
|
////////////////////////////
|
||||||
|
|
||||||
|
$updatehistorygadaian = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||||
|
'historygadaian' => $request->norujukan,
|
||||||
|
'jenistebus' => $request->jenistebus,
|
||||||
|
])->json();
|
||||||
|
|
||||||
|
|
||||||
event(new TebusNotify('lulus',Auth::user()->cawangan));
|
event(new TebusNotify('lulus',Auth::user()->cawangan));
|
||||||
event(new GadaiNotify('lulus',Auth::user()->cawangan));
|
event(new GadaiNotify('lulus',Auth::user()->cawangan));
|
||||||
$this->AliranTunaiController->alirantunaiTebus($request);
|
$this->AliranTunaiController->alirantunaiTebus($request);
|
||||||
@@ -544,7 +560,8 @@ class PenebusanController extends Controller
|
|||||||
////////////////////////////
|
////////////////////////////
|
||||||
|
|
||||||
$updatehistorygadaian = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
$updatehistorygadaian = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||||
'historygadaian' => $request->norujukan
|
'historygadaian' => $request->norujukan,
|
||||||
|
'jenistebus' => $request->jenistebus,
|
||||||
])->json();
|
])->json();
|
||||||
|
|
||||||
|
|
||||||
@@ -611,51 +628,6 @@ class PenebusanController extends Controller
|
|||||||
'sirig' => $new_sirig
|
'sirig' => $new_sirig
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
//////////////////////
|
|
||||||
////Update SAG BARU///
|
|
||||||
/////////////////////
|
|
||||||
$keuntungan_sebln = $request->keuntungan_sebulan;
|
|
||||||
$keuntungan_sebln = str_replace(',','',$keuntungan_sebln);
|
|
||||||
|
|
||||||
$total_nilai_marhun = $request->total_nilai_marhun;
|
|
||||||
$margin_pinjaman = $request->pinjaman / $total_nilai_marhun;
|
|
||||||
$kadarupah = $request->kadarkeuntungan * 100;
|
|
||||||
$keuntungan6bulan = $keuntungan_sebln * 6;
|
|
||||||
$keuntungan12bulan = $keuntungan_sebln * 12;
|
|
||||||
$hargajualan = $request->pinjaman + $keuntungan12bulan;
|
|
||||||
|
|
||||||
|
|
||||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
|
||||||
'kodcaw' => $auth_user['cawangan'],
|
|
||||||
'nilaimarhun' => round($total_nilai_marhun, 2),
|
|
||||||
'berat' => round($request->total_berat, 2),
|
|
||||||
'pinjaman' => round($request->pinjaman, 2),
|
|
||||||
'kadarupah' => round($kadarupah, 2),
|
|
||||||
'marhun' => $request->marhun_detail,
|
|
||||||
'percentpinj' => $margin_pinjaman,
|
|
||||||
'teller'=> $auth_user['name'],
|
|
||||||
'upah6' => $keuntungan6bulan,
|
|
||||||
'upah12' => $keuntungan12bulan,
|
|
||||||
'hargajualan' => $hargajualan,
|
|
||||||
'kuantiti_marhun' => $request->kuantiti_marhun
|
|
||||||
])->json();
|
|
||||||
|
|
||||||
$komuditi = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/komuditi/transaksi',[
|
|
||||||
'unit_komuditi' => round($request->pinjaman, 2),
|
|
||||||
'norujukan' => $norujukanbaru,
|
|
||||||
'kodcaw' => $auth_user['cawangan'],
|
|
||||||
'teller' => $auth_user['name']
|
|
||||||
]);
|
|
||||||
|
|
||||||
////////////////////////////
|
|
||||||
////Update History Gadaian///
|
|
||||||
////////////////////////////
|
|
||||||
|
|
||||||
$updatehistorygadaian = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
|
||||||
'historygadaian' => $request->norujukan
|
|
||||||
])->json();
|
|
||||||
|
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
/// MARHUN UPDATE TABLE////
|
/// MARHUN UPDATE TABLE////
|
||||||
//////////////////////////
|
//////////////////////////
|
||||||
@@ -695,10 +667,70 @@ class PenebusanController extends Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////
|
||||||
|
////Update SAG BARU///
|
||||||
|
/////////////////////
|
||||||
|
|
||||||
|
$total_nilai_marhun = $request->total_nilai_marhun;
|
||||||
|
$margin_pinjaman = $request->pinjaman / $total_nilai_marhun;
|
||||||
|
$kadarupah = $request->kadarkeuntungan * 100;
|
||||||
|
|
||||||
|
$total_nilai_marhun = $request->total_nilai_marhun;
|
||||||
|
$margin_pinjaman = ($request->pinjaman / $total_nilai_marhun);
|
||||||
|
|
||||||
|
$onepercent = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/onepercent',[
|
||||||
|
'pembiayaan' => $request->pinjaman,
|
||||||
|
'nilaimarhun' => $total_nilai_marhun,
|
||||||
|
'kadarujrah' => $request->kadarkeuntungan,
|
||||||
|
'margin' => ($margin_pinjaman*100),
|
||||||
|
'kodcaw' => Auth::user()->cawangan
|
||||||
|
])->json();
|
||||||
|
|
||||||
|
$keuntungan_sebln = $onepercent['keuntungan'];
|
||||||
|
$keuntungan_sebln = str_replace(',','',$keuntungan_sebln);
|
||||||
|
$keuntungan6bulan = $keuntungan_sebln * 6;
|
||||||
|
$keuntungan12bulan = $keuntungan_sebln * 12;
|
||||||
|
$hargajualan = $request->pinjaman + $keuntungan12bulan;
|
||||||
|
|
||||||
|
|
||||||
|
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/norujukan/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||||
|
'kodcaw' => $auth_user['cawangan'],
|
||||||
|
'nilaimarhun' => round($total_nilai_marhun, 2),
|
||||||
|
'berat' => round($request->total_berat, 2),
|
||||||
|
'pinjaman' => round($request->pinjaman, 2),
|
||||||
|
'kadarupah' => round($kadarupah, 2),
|
||||||
|
'marhun' => $request->marhun_detail,
|
||||||
|
'percentpinj' => $margin_pinjaman,
|
||||||
|
'teller'=> $auth_user['name'],
|
||||||
|
'upah6' => $keuntungan6bulan,
|
||||||
|
'upah12' => $keuntungan12bulan,
|
||||||
|
'hargajualan' => $hargajualan,
|
||||||
|
'kuantiti_marhun' => $request->kuantiti_marhun
|
||||||
|
])->json();
|
||||||
|
|
||||||
|
$komuditi = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/komuditi/transaksi',[
|
||||||
|
'unit_komuditi' => round($request->pinjaman, 2),
|
||||||
|
'norujukan' => $norujukanbaru,
|
||||||
|
'kodcaw' => $auth_user['cawangan'],
|
||||||
|
'teller' => $auth_user['name']
|
||||||
|
]);
|
||||||
|
|
||||||
|
////////////////////////////
|
||||||
|
////Update History Gadaian///
|
||||||
|
////////////////////////////
|
||||||
|
|
||||||
|
$updatehistorygadaian = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
|
||||||
|
'historygadaian' => $request->norujukan,
|
||||||
|
'jenistebus' => $request->jenistebus,
|
||||||
|
])->json();
|
||||||
|
|
||||||
|
|
||||||
|
$alirantunai = new AliranTunaiController();
|
||||||
event(new TebusNotify('lulus',Auth::user()->cawangan));
|
event(new TebusNotify('lulus',Auth::user()->cawangan));
|
||||||
event(new GadaiNotify('lulus',Auth::user()->cawangan));
|
event(new GadaiNotify('lulus',Auth::user()->cawangan));
|
||||||
|
|
||||||
$this->AliranTunaiController->alirantunaiTebus($request);
|
$alirantunai->alirantunaiTebus($request);
|
||||||
|
|
||||||
|
|
||||||
return response()->json($updatemarhun,200);
|
return response()->json($updatemarhun,200);
|
||||||
|
|||||||
@@ -306,4 +306,118 @@ class ImbangdugaServices
|
|||||||
return strcmp($a['glcode'], $b['glcode']);
|
return strcmp($a['glcode'], $b['glcode']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function OperationImbangDugaByDate($kodcaw,$tarikh){
|
||||||
|
$current = new Carbon($tarikh);
|
||||||
|
|
||||||
|
$tarikh = $current->toDateString();
|
||||||
|
|
||||||
|
$imbangdugadata = ImbangDuga::orderBy('glcode')->get();
|
||||||
|
$array_harta = [];
|
||||||
|
$array_tanggungan = [];
|
||||||
|
$summation_harta = 0;
|
||||||
|
$summation_tanggungan = 0;
|
||||||
|
|
||||||
|
$penyelarasan = CawanganAR::select('penyelarasan')->where('kodcaw',$kodcaw)->get()->toArray();
|
||||||
|
$penyelarasan = $penyelarasan[0];
|
||||||
|
|
||||||
|
foreach($imbangdugadata as $index => $imbangdugaiteration){
|
||||||
|
if($imbangdugaiteration->api_redirect != null){
|
||||||
|
if($imbangdugaiteration['variable'] == 'untungrugiterkumpul' || $imbangdugaiteration['variable'] == 'keun_sebenar' || $imbangdugaiteration['variable'] == 'pend_terakru' || $imbangdugaiteration['variable'] == 'keun_penggadai'){
|
||||||
|
|
||||||
|
${$imbangdugaiteration['variable']} = Http::get(config('api.url'). '/admin/laporan/akrual/getImbangDugaBackupData',['tarikh' => $tarikh,'kodcaw' => $kodcaw,'data_name' => $imbangdugaiteration['variable']])->json();
|
||||||
|
}elseif($imbangdugaiteration['variable'] == 'onepercent' || $imbangdugaiteration['variable'] == 'ujrah'){
|
||||||
|
${$imbangdugaiteration['variable']} = 0;
|
||||||
|
}else{
|
||||||
|
${$imbangdugaiteration['variable']} = Http::get(config('api.url'). $imbangdugaiteration['api_redirect'] . $kodcaw,['tarikh' => $tarikh])->json();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(is_object($imbangdugaiteration)) $data = ($imbangdugaiteration->is_array == 1) ? ${$imbangdugaiteration['variable']}[$imbangdugaiteration['single_var']] : ${$imbangdugaiteration['variable']};
|
||||||
|
$data = ($imbangdugaiteration->neg_values == 1) ? $data = -1 * abs($data) : $data;
|
||||||
|
$data = ($imbangdugaiteration['variable'] == 'untungrugiterkumpul') ? $data : $data;
|
||||||
|
}else $data = 0;
|
||||||
|
|
||||||
|
$data = $this->SwitchFuncImbangDuga($data,$imbangdugaiteration['variable'],$tarikh,$kodcaw);
|
||||||
|
|
||||||
|
/* declare for protected above */
|
||||||
|
if($imbangdugaiteration->is_array == 1){
|
||||||
|
$nama = $imbangdugaiteration['single_var'];
|
||||||
|
if($imbangdugaiteration['variable'] == 'bakilelongxtra'){
|
||||||
|
$nama = $imbangdugaiteration['variable'];
|
||||||
|
}else if($imbangdugaiteration['variable'] == 'utgterkumpulxtra'){
|
||||||
|
$nama = $imbangdugaiteration['variable'];
|
||||||
|
}
|
||||||
|
$this->$nama = $data;
|
||||||
|
}else $this->{$imbangdugaiteration['variable']} = $data;
|
||||||
|
|
||||||
|
|
||||||
|
if($imbangdugaiteration->jenis == 'harta'){
|
||||||
|
$summation_harta += $data;
|
||||||
|
array_push($array_harta,['variable' => ($imbangdugaiteration->is_array == 1) ? $imbangdugaiteration->single_var : $imbangdugaiteration->variable,'glcode' => $imbangdugaiteration->glcode, 'descpt' => $imbangdugaiteration->descpt,'amaun' => ($data) ? $data : 0]);
|
||||||
|
}else{
|
||||||
|
$summation_tanggungan += $data;
|
||||||
|
array_push($array_tanggungan,['variable' => ($imbangdugaiteration->is_array == 1) ? $imbangdugaiteration->single_var : $imbangdugaiteration->variable,'glcode' => $imbangdugaiteration->glcode, 'descpt' => $imbangdugaiteration->descpt,'amaun' => ($data) ? $data : 0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$tagtally = (number_format($summation_harta,2) == number_format($summation_tanggungan,2)) ? 1 : 0;
|
||||||
|
// dd($summation_harta,$summation_tanggungan,$array_harta,$array_tanggungan,$tagtally,$kodcaw);
|
||||||
|
$response = $this->UpdateImbangDugaBackupByDate($tarikh,$kodcaw,$summation_harta,$summation_tanggungan,$tagtally);
|
||||||
|
|
||||||
|
if($response == 'successful'){
|
||||||
|
return response('succesful');
|
||||||
|
}else{
|
||||||
|
return response('error');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function UpdateImbangDugaBackupByDate($tarikh,$kodcaw,$sum_harta = 0.0,$sum_tanggungan = 0.0,$tagtally = 0) : String{
|
||||||
|
|
||||||
|
$update_imbangduga_backup = Http::get(config('api.url'). '/admin/laporan/akrual/updateImbangDugaRefined',[
|
||||||
|
'tarikh' => $tarikh,
|
||||||
|
'kodcaw' => $kodcaw,
|
||||||
|
'tunaiditangan' => ($this->tunaiditangan) ? $this->tunaiditangan : 0,
|
||||||
|
'pembiayaantawarruq' => ($this->pembiayaantawarruq) ? $this->pembiayaantawarruq : 0,
|
||||||
|
'bayaranpendahuluan' => ($this->bayaranpendahuluan) ? $this->bayaranpendahuluan : 0,
|
||||||
|
'pinjamankoop' => ($this->pinjamankoop) ? $this->pinjamankoop : 0,
|
||||||
|
'emaspalsu' => ($this->emaspalsu) ? $this->emaspalsu : 0,
|
||||||
|
'serahan' => ($this->serahan) ? $this->serahan : 0,
|
||||||
|
'bds' => ($this->bds) ? $this->bds : 0,
|
||||||
|
'perubatan' => ($this->perubatan) ? $this->perubatan : 0,
|
||||||
|
'keraian' => ($this->keraian) ? $this->keraian : 0,
|
||||||
|
'rugilelong' => ($this->rugilelong) ? $this->rugilelong : 0,
|
||||||
|
'bakilelong' => ($this->bakilelong) ? $this->bakilelong: 0,
|
||||||
|
'wtd' => ($this->wtd) ? $this->wtd : 0,
|
||||||
|
'untungrugiterkumpul' => ($this->untungrugiterkumpul) ? $this->untungrugiterkumpul : 0,
|
||||||
|
'keun_sebenar' => ($this->keun_sebenar) ? $this->keun_sebenar : 0,
|
||||||
|
'pendahuluan' => ($this->pendahuluan) ? $this->pendahuluan : 0,
|
||||||
|
'cajlelong' => ($this->cajlelong) ? $this->cajlelong : 0,
|
||||||
|
'pindahkekpkb' => ($this->pindahkekpkb) ? $this->pindahkekpkb : 0,
|
||||||
|
'penghutangkaki' => ($this->penghutangkaki) ? $this->penghutangkaki : 0,
|
||||||
|
'phapuskira' => ($this->phapuskira) ? $this->phapuskira : 0,
|
||||||
|
'belian1stop' => ($this->belian1stop) ? $this->belian1stop : 0,
|
||||||
|
'keun_penggadai' => ($this->keun_penggadai) ? $this->keun_penggadai : 0,
|
||||||
|
'pend_terakru' => ($this->pend_terakru) ? $this->pend_terakru : 0,
|
||||||
|
'cajperkhidmatan' => ($this->cajperkhidmatan) ? $this->cajperkhidmatan : 0,
|
||||||
|
'cajlelongxtra' => ($this->cajlelongxtra) ? $this->cajlelongxtra : 0,
|
||||||
|
'upahsimpanxtra' => ($this->upahsimpan) ? $this->upahsimpan : 0,
|
||||||
|
'bakilelongxtra' => ($this->bakilelongxtra) ? $this->bakilelongxtra : 0,
|
||||||
|
'rugilelongxtra' => ($this->kerugianlelong) ? $this->kerugianlelong : 0,
|
||||||
|
'utgterkumpulxtra' => ($this->utgterkumpulxtra) ? $this->utgterkumpulxtra : 0,
|
||||||
|
'jualan1stop' => ($this->jualan1stop) ? $this->jualan1stop : 0,
|
||||||
|
'hapuskira' => ($this->hapuskira) ? $this->hapuskira : 0,
|
||||||
|
'ujrah' => ($this->ujrah) ? $this->ujrah : 0,
|
||||||
|
'onepercent' => ($this->onepercent) ? $this->onepercent : 0,
|
||||||
|
'totalharta' => $sum_harta,
|
||||||
|
'totaltanggungan' => $sum_tanggungan,
|
||||||
|
'tagtally' => $tagtally,
|
||||||
|
])->json();
|
||||||
|
|
||||||
|
if($update_imbangduga_backup == 'success')
|
||||||
|
return 'successful';
|
||||||
|
else
|
||||||
|
return 'error';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,6 +246,7 @@
|
|||||||
<button class="btn btn-primary" onclick="ubahfunc(this)" id="button-edit-gadaian">Ubah</button>
|
<button class="btn btn-primary" onclick="ubahfunc(this)" id="button-edit-gadaian">Ubah</button>
|
||||||
<button class="btn btn-primary" onclick="hapusfunc()">Hapus</button>
|
<button class="btn btn-primary" onclick="hapusfunc()">Hapus</button>
|
||||||
<button class="btn btn-primary" onclick="histfunc()">Rekod Gadaian</button>
|
<button class="btn btn-primary" onclick="histfunc()">Rekod Gadaian</button>
|
||||||
|
<button class="btn btn-primary" onclick="removeansuran(this)" id="button-remove-ansuran">Hapus Ansuran</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -540,25 +541,13 @@
|
|||||||
minimumFractionDigits: 2
|
minimumFractionDigits: 2
|
||||||
});
|
});
|
||||||
|
|
||||||
function checkCanChangeGadaianDetail(norujukan){
|
function getGadaiByNorujukan(norujukan){
|
||||||
|
console.log(norujukan);
|
||||||
let gadai_tawarruq = fetch(api_url + '/api/gadai/norujukan/' + norujukan );
|
let gadai_tawarruq = fetch(api_url + '/api/gadai/norujukan/' + norujukan );
|
||||||
|
|
||||||
gadai_tawarruq
|
return gadai_tawarruq
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(response => response[0][0])
|
.then(response => response[0][0]);
|
||||||
.then(gadaian => {
|
|
||||||
return gadaian.historygadaian;
|
|
||||||
})
|
|
||||||
.then(historygadaian => {
|
|
||||||
let button_edit_gadaian = document.querySelector('#button-edit-gadaian');
|
|
||||||
|
|
||||||
if(historygadaian === '0' || historygadaian === null || historygadaian.length === 0) {
|
|
||||||
button_edit_gadaian.disabled = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
button_edit_gadaian.disabled = true;
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function checkPS(norujukan){
|
async function checkPS(norujukan){
|
||||||
@@ -569,12 +558,17 @@
|
|||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(response => response[0][0])
|
.then(response => response[0][0])
|
||||||
.then(gadaian => {
|
.then(gadaian => {
|
||||||
return gadaian.historygadaian;
|
return { historygadaian: gadaian.historygadaian, tag_tebus: gadaian.tag_tebus };
|
||||||
})
|
})
|
||||||
.then(historygadaian => {
|
.then(data => {
|
||||||
|
if(data.historygadaian == '0' || data.historygadaian === null || data.historygadaian.length === 0) {
|
||||||
if(historygadaian == '0' || historygadaian === null || historygadaian.length === 0) {
|
|
||||||
return false;
|
return false;
|
||||||
|
}else{
|
||||||
|
if(data.tag_tebus == 'AT'){
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -1459,13 +1453,15 @@
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case 'A':
|
case 'A':
|
||||||
if(tebusaz['tagbaru'] == 1){
|
// if(tebusaz['tagbaru'] == 1){
|
||||||
var urlroute = '{{ route("resit.ansuran", ":id") }}';
|
// var urlroute = '{{ route("resit.ansuran", ":id") }}';
|
||||||
urlroute = urlroute.replace(':id', tebusaz['norujukan']);
|
// urlroute = urlroute.replace(':id', tebusaz['norujukan']);
|
||||||
}else{
|
// }else{
|
||||||
var urlroute = '{{ route("resit.belumansurans", ":id") }}';
|
// var urlroute = '{{ route("resit.belumansurans", ":id") }}';
|
||||||
urlroute = urlroute.replace(':id', tebusaz['norujukan']);
|
// urlroute = urlroute.replace(':id', tebusaz['norujukan']);
|
||||||
}
|
// }
|
||||||
|
var urlroute = '{{ route("resit.autotawarruq", ":id") }}';
|
||||||
|
urlroute = urlroute.replace(':id', tebusaz['norujukan']);
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
var urlroute = '{{ route("resit.tebusseparuh", ":id") }}';
|
var urlroute = '{{ route("resit.tebusseparuh", ":id") }}';
|
||||||
@@ -1476,7 +1472,7 @@
|
|||||||
historytebusbayaran.row.add([
|
historytebusbayaran.row.add([
|
||||||
counter,
|
counter,
|
||||||
tebusaz['norujukan'],
|
tebusaz['norujukan'],
|
||||||
(checkps) ? 'PS' : tebusaz['jenistebus'],
|
(checkps && tebusaz['jenistebus'] == 'A') ? 'PS' : (tebusaz['jenistebus'] == 'A') ? 'PS' : tebusaz['jenistebus'],
|
||||||
tebusaz['pinjaman'],
|
tebusaz['pinjaman'],
|
||||||
tebusaz['jbg'],
|
tebusaz['jbg'],
|
||||||
tebusaz['t_tebus'],
|
tebusaz['t_tebus'],
|
||||||
@@ -2653,5 +2649,244 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
async function removeansuran(event){
|
||||||
|
|
||||||
|
let ansid = $('input[name="belum"]:checked').val();
|
||||||
|
let harini = new Date();harini.setHours(0, 0, 0, 0);
|
||||||
|
|
||||||
|
if($("input[name='options']:checked").val() != 'belum_tebus'){
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Amaran',
|
||||||
|
text: 'Ansuran untuk Belum Tebus Sahaja!'
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ansid == null && $("input[name='options']:checked").val() == 'belum_tebus'){
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Amaran',
|
||||||
|
text: 'Sila pilih salah satu SAG!'
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const jsonData = {
|
||||||
|
norujukan: ansid,
|
||||||
|
kodcaw: 'KB2',
|
||||||
|
};
|
||||||
|
|
||||||
|
const queryString = new URLSearchParams(jsonData).toString();
|
||||||
|
|
||||||
|
let ansuranlatest = await fetch(api_url + '/admin/ansuran/getLatest?' + queryString)
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(response => {return response});
|
||||||
|
|
||||||
|
if(Object.keys(ansuranlatest).length == 0){
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Amaran',
|
||||||
|
text: 'Tiada Ansuran Hari Ini'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
try{
|
||||||
|
let response = await getKelulusanKhazanahOperasi('Hapus Ansuran',ansid);
|
||||||
|
let pusherresponse = await PusherResponse(ansid,response,ansuranlatest['created_at'],ansuranlatest['id']);
|
||||||
|
|
||||||
|
}catch(error){
|
||||||
|
console.error("Error:", error);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getGadaiByNorujukan(norujukan){
|
||||||
|
let gadai_tawarruq = fetch(api_url + '/api/gadai/norujukan/' + norujukan );
|
||||||
|
|
||||||
|
return gadai_tawarruq
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(response => response[0][0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getKelulusanKhazanahOperasi(textstatus = 'none',norujukan){
|
||||||
|
|
||||||
|
const swalWithBootstrapButtons = Swal.mixin({
|
||||||
|
customClass: {
|
||||||
|
confirmButton: 'btn btn-success',
|
||||||
|
cancelButton: 'btn btn-danger'
|
||||||
|
},
|
||||||
|
buttonsStyling: false
|
||||||
|
});
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
let gadai = await getGadaiByNorujukan(norujukan);
|
||||||
|
let response = await swalWithBootstrapButtons.fire({
|
||||||
|
title: 'Dapatkan Pengesahan Operasi',
|
||||||
|
text: textstatus,
|
||||||
|
icon: 'info',
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: 'Hantar',
|
||||||
|
cancelButtonText: 'Batal',
|
||||||
|
reverseButtons: true
|
||||||
|
}).then(async (result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
let norujukan = gadai.norujukan;
|
||||||
|
let nm = gadai.nilaimarhun;
|
||||||
|
let ber = gadai.berat;
|
||||||
|
let marg = gadai.percentpinj;
|
||||||
|
let status = textstatus;
|
||||||
|
let jumpinjam = gadai.pinjaman;
|
||||||
|
let teller = "{{ Auth::user()->name }}";
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: 'Tunggu Pengesahan Daripada Khazanah-Operasi.',
|
||||||
|
icon: 'info',
|
||||||
|
width: 600,
|
||||||
|
padding: '3em',
|
||||||
|
background: '#fffff',
|
||||||
|
showCancelButton: false,
|
||||||
|
showConfirmButton: false,
|
||||||
|
allowOutsideClick: false,
|
||||||
|
allowEscapeKey: false,
|
||||||
|
allowEnterKey: false
|
||||||
|
});
|
||||||
|
|
||||||
|
let siricreated = 0;
|
||||||
|
|
||||||
|
let requestdata = {
|
||||||
|
"_token": "{{ csrf_token() }}",
|
||||||
|
"norujukan" : norujukan,
|
||||||
|
"komen" : '',
|
||||||
|
"margin" : marg,
|
||||||
|
"berat" : ber,
|
||||||
|
"nilaimarhun" : nm,
|
||||||
|
"status" : status,
|
||||||
|
"jumpinjam" : jumpinjam,
|
||||||
|
"teller" : teller
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
siricreated = await fetch("{{ route('operasi.createkelulusan') }}",{
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
body: JSON.stringify(requestdata)
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(response => {return response});
|
||||||
|
|
||||||
|
return siricreated;
|
||||||
|
|
||||||
|
}else if (result.dismiss === Swal.DismissReason.cancel){
|
||||||
|
console.log('gagal');
|
||||||
|
swalWithBootstrapButtons.fire(
|
||||||
|
'Batal',
|
||||||
|
'Maklumat Ansuran Tidak Berjaya',
|
||||||
|
'error'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
// return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}catch(error){
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function PusherResponse(norujukan,siricreated,tarikh,tg_id){
|
||||||
|
var pusher = new Pusher("{{ env('PUSHER_APP_KEY') }}", {
|
||||||
|
cluster: 'ap1',
|
||||||
|
encrypted: true
|
||||||
|
});
|
||||||
|
|
||||||
|
let teller = "{{ Auth::user()->name }}";
|
||||||
|
let kodcaw = "{{ Auth::user()->cawangan }}";
|
||||||
|
var channel = pusher.subscribe('notice-kelulusan');
|
||||||
|
channel.bind('my-kelulusan', function(data) {
|
||||||
|
|
||||||
|
if(data.norujukan == norujukan && data.siri == siricreated && data.teller == teller)
|
||||||
|
{
|
||||||
|
if(data.kelulusan == 'lulus')
|
||||||
|
{
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Telah Disahkan',
|
||||||
|
text: `Komen : ${data.komen}`
|
||||||
|
}).then(function(){
|
||||||
|
deleteFuncAnsuran(tarikh,kodcaw,norujukan,tg_id);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(data.kelulusan == 'batal')
|
||||||
|
{
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'warning',
|
||||||
|
title: 'Telah Dibatalkan',
|
||||||
|
text: `Komen : ${data.komen}`
|
||||||
|
}).then(function(){
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Amaran',
|
||||||
|
text: 'Kelulusan Dibatalkan'
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function deleteFuncAnsuran(tarikh,kodcaw,norujukan,tg_id){
|
||||||
|
let jsondata = {
|
||||||
|
tarikh: tarikh,
|
||||||
|
kodcaw: kodcaw,
|
||||||
|
norujukan: norujukan,
|
||||||
|
tg_id: tg_id,
|
||||||
|
teller: "{{ Auth::user()->name }}"
|
||||||
|
};
|
||||||
|
|
||||||
|
try{
|
||||||
|
let updated = fetch(api_url + '/admin/ansuran/delete',{
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
body: JSON.stringify(jsondata)
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(response => {
|
||||||
|
return response
|
||||||
|
});
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Berjaya!',
|
||||||
|
text: `Hapus Ansuran Berjaya`
|
||||||
|
}).then(()=>{
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}catch(error){
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Amaran!',
|
||||||
|
text: `Hapus Ansuran `
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -234,7 +234,7 @@
|
|||||||
.main-kaki-sag {
|
.main-kaki-sag {
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
width: 260px;
|
width: 245px;
|
||||||
transform: rotate(-90deg);
|
transform: rotate(-90deg);
|
||||||
font-size: 9px;
|
font-size: 9px;
|
||||||
}
|
}
|
||||||
@@ -317,9 +317,9 @@
|
|||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
window.print();
|
window.print();
|
||||||
window.onfocus = function() {
|
// window.onfocus = function() {
|
||||||
window.close();
|
// window.close();
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
@@ -628,7 +628,8 @@
|
|||||||
KoPKB
|
KoPKB
|
||||||
untuk menjual komoditi kepada pihak ketiga secara tunai yang bersamaan dengan
|
untuk menjual komoditi kepada pihak ketiga secara tunai yang bersamaan dengan
|
||||||
jumlah
|
jumlah
|
||||||
pembiayaan diberikan kepada saya. Saya dengan ini mengaku janji untuk
|
pembiayaan diberikan kepada saya. Saya dengan ini mengaku janji untuk membayar ganti
|
||||||
|
rugi kepada KoPKB
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -637,8 +638,7 @@
|
|||||||
<td style="vertical-align: top">
|
<td style="vertical-align: top">
|
||||||
<table class="akad-table">
|
<table class="akad-table">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4">membayar ganti
|
<td colspan="4"> atas segala kerugian, kos, perbelanjaan atau kerosakan yang
|
||||||
rugi kepada KoPKB atas segala kerugian, kos, perbelanjaan atau kerosakan yang
|
|
||||||
mungkin
|
mungkin
|
||||||
dialami atau ditanggung oleh KoPKB akibat memenuhi keperluan sebagai wakil saya;
|
dialami atau ditanggung oleh KoPKB akibat memenuhi keperluan sebagai wakil saya;
|
||||||
Atau,
|
Atau,
|
||||||
|
|||||||
Reference in New Issue
Block a user