Merged in hotfix/new_transaction (pull request #214)
Hotfix/new transaction
This commit is contained in:
@@ -12,6 +12,7 @@ use Illuminate\Http\Request;
|
|||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use App\Http\Controllers\AliranTunaiController;
|
use App\Http\Controllers\AliranTunaiController;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
@@ -280,161 +281,47 @@ class PenebusanController extends Controller
|
|||||||
////////////////////////
|
////////////////////////
|
||||||
/// UPDATE TEBUS API////
|
/// UPDATE TEBUS API////
|
||||||
///////////////////////
|
///////////////////////
|
||||||
$updatetebus = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/updatetebus/'. $auth_user['cawangan'] .'/' . $request->norujukan,[
|
$updatetebus = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/updatetambahpinjaman/'. $auth_user['cawangan'] .'/' . $request->norujukan,[
|
||||||
'nopelanggan' => $request->nopelanggan,
|
"nopelanggan" => $request->nopelanggan,
|
||||||
'jenistebus' => $request->jenistebus,
|
"jenistebus" => $request->jenistebus,
|
||||||
'jbg' => $request->jbg,
|
"jbg" => $request->jbg,
|
||||||
'kadarupah' => $request->kadarupah,
|
"kadarupah" => $request->kadarupah,
|
||||||
'nilai_marhun' => $request->nilai_marhun,
|
"nilai_marhun" => $request->nilai_marhun,
|
||||||
'pinjaman' => $request->pinjaman_lama,
|
"pinjamanbaru" => $request->pinjaman,
|
||||||
'ansuran' => $request->ansuran,
|
"pinjaman" => $request->pinjaman_lama,
|
||||||
'nowakil' => $request->nowakil,
|
"ansuran" => $request->ansuran,
|
||||||
'addpinjaman'=> $request->addpinjaman,
|
"addpinjaman" => $request->addpinjaman,
|
||||||
'bakipinjaman' => $request->bakipinjaman,
|
"bakipinjaman" => $request->bakipinjaman,
|
||||||
'bakiupah' => $request->bakiupah,
|
"bakiupah" => $request->bakiupah,
|
||||||
'historygadaian' => $request->historygadaian,
|
"historygadaian" => $request->historygadaian,
|
||||||
'marhun' => $request->marhun,
|
"marhun" => $request->marhun,
|
||||||
'jenisbayarantebus' => $request->jenisbayarantebus,
|
"kuantiti_marhun" => $request->kuantiti_marhun,
|
||||||
'jeniskeuntungan' => $request->jeniskeuntungan,
|
"total_berat" => $request->total_berat,
|
||||||
'teller' => $request->teller,
|
"kadarkeuntungan" => $request->kadarkeuntungan,
|
||||||
"duitpelanggan" => $request->bayaran,
|
"keuntungan_6bln" => $request->keuntungan_6bln,
|
||||||
|
"keuntungan_sebulan" => $request->keuntungan_sebulan,
|
||||||
|
"noic" => $request->noic,
|
||||||
|
"norujukan" => $request->norujukan,
|
||||||
|
"jenisbayarantebus" => $request->jenisbayarantebus,
|
||||||
|
"jeniskeuntungan" => $request->jeniskeuntungan,
|
||||||
|
"teller" => $request->teller,
|
||||||
|
"bayaran" => $request->bayaran,
|
||||||
"bakipelanggan" => $request->bakipelanggan,
|
"bakipelanggan" => $request->bakipelanggan,
|
||||||
])->json();
|
"nowakil" => isset($request->nowakil) ? $request->nowakil : 0
|
||||||
|
|
||||||
if($updatetebus == 'duplicate'){
|
|
||||||
return response()->json('duplicate');
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////
|
|
||||||
/// MAKING NEW SAG////
|
|
||||||
/////////////////////
|
|
||||||
|
|
||||||
$gadai_transaction = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/'. $auth_user['cawangan'] . '/' . $current->toDateString())->json();
|
|
||||||
if($gadai_transaction){
|
|
||||||
$new_sirig = $gadai_transaction['sirig'] + 1;
|
|
||||||
|
|
||||||
}else{
|
|
||||||
$new_sirig = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$new_transaction = sprintf("%04d",$new_sirig);
|
|
||||||
$norujukanbaru = strtoupper($auth_user['cawangan']) . $curent_year . $curent_month . $current_day . '-' .$new_transaction;
|
|
||||||
|
|
||||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/gadai/'.$auth_user['cawangan'],[
|
|
||||||
'norujukan' => $norujukanbaru,
|
|
||||||
'nopelanggan' => $request->nopelanggan,
|
|
||||||
'nokp' => $request->noic,
|
|
||||||
'sirig' => $new_sirig
|
|
||||||
]);
|
|
||||||
|
|
||||||
///////////////////////////
|
|
||||||
/// MARHUN UPDATE TABLE////
|
|
||||||
//////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
$arraymarhunbaru = [];
|
|
||||||
|
|
||||||
$marhunsediada = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/marhun/'. $request->norujukan)->json();
|
|
||||||
|
|
||||||
$marhunyangdiambil = $marhunsediada[0];
|
|
||||||
foreach($marhunyangdiambil as $index=>$marhunloop)
|
|
||||||
{
|
|
||||||
$karatbaru = str_replace('.','-',$marhunloop['karat']);
|
|
||||||
$hargabaru = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/harga_emas/'. $karatbaru)->json();
|
|
||||||
|
|
||||||
$nilaimarhun = (floatval($hargabaru['harga']) * floatval($marhunloop['berat']));
|
|
||||||
|
|
||||||
array_push($arraymarhunbaru, ["bil" => $marhunloop['bil'],"tag_permata" => $marhunloop['tag_permata'],"berat_batu_permata" => $marhunloop['berat_batu_permata'],"marhun" => $marhunloop['marhun'],"nota" => $marhunloop['nota'],"karat" => $marhunloop['karat'], "berat" => $marhunloop['berat'], "harga" => $hargabaru['harga'], "n_marhun" => $nilaimarhun]);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($arraymarhunbaru as $array1){
|
|
||||||
$updatemarhun = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/marhun/'. $auth_user['cawangan'],[
|
|
||||||
'norujukan' => $norujukanbaru,
|
|
||||||
'marhun' => $array1['marhun'],
|
|
||||||
'nota' => $array1['nota'],
|
|
||||||
'karat' => $array1['karat'],
|
|
||||||
'berat_emas' => $array1['berat'],
|
|
||||||
'harga' => $array1['harga'],
|
|
||||||
'tag_permata' => $array1['tag_permata'],
|
|
||||||
'berat_batu_permata' => $array1['berat_batu_permata'],
|
|
||||||
'kuantiti' => $array1['bil']
|
|
||||||
])->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();
|
])->json();
|
||||||
|
|
||||||
|
|
||||||
|
if($updatetebus['result'] == 'success'){
|
||||||
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);
|
||||||
|
}
|
||||||
|
return response()->json($updatetebus['result'],200);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tebusautotawarruq(Request $request)
|
public function tebusautotawarruq(Request $request)
|
||||||
{
|
{
|
||||||
$api_url = config('api.url');
|
|
||||||
$current = Carbon::now();
|
|
||||||
$current = new Carbon();
|
|
||||||
$curent_year = substr($current->year,2,2);
|
|
||||||
$curent_month = sprintf("%02d", $current->month);
|
|
||||||
$current_day = sprintf("%02d", $current->day);
|
|
||||||
|
|
||||||
$auth_user = Auth::user();
|
$auth_user = Auth::user();
|
||||||
|
|
||||||
////////////////////////
|
////////////////////////
|
||||||
@@ -447,6 +334,7 @@ class PenebusanController extends Controller
|
|||||||
'kadarupah' => $request->kadarupah,
|
'kadarupah' => $request->kadarupah,
|
||||||
'nilai_marhun' => $request->nilai_marhun,
|
'nilai_marhun' => $request->nilai_marhun,
|
||||||
'pinjaman' => $request->pinjaman_lama,
|
'pinjaman' => $request->pinjaman_lama,
|
||||||
|
'pinjamanbaru' => $request->pinjaman,
|
||||||
'ansuran' => $request->ansuran,
|
'ansuran' => $request->ansuran,
|
||||||
'addpinjaman'=> $request->addpinjaman,
|
'addpinjaman'=> $request->addpinjaman,
|
||||||
'bakipinjaman' => $request->bakipinjaman,
|
'bakipinjaman' => $request->bakipinjaman,
|
||||||
@@ -460,134 +348,16 @@ class PenebusanController extends Controller
|
|||||||
'totalbayaran' => $request->totalbayaran,
|
'totalbayaran' => $request->totalbayaran,
|
||||||
"duitpelanggan" => $request->bayaran,
|
"duitpelanggan" => $request->bayaran,
|
||||||
"bakipelanggan" => $request->bakipelanggan,
|
"bakipelanggan" => $request->bakipelanggan,
|
||||||
|
"noic" => $request->noic,
|
||||||
|
"jenisAT" => $request->jenisAT,
|
||||||
])->json();
|
])->json();
|
||||||
|
if($updatetebus['result'] == 'success'){
|
||||||
if($updatetebus == 'duplicate'){
|
|
||||||
return response()->json('duplicate');
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////
|
|
||||||
/// MAKING NEW SAG////
|
|
||||||
/////////////////////
|
|
||||||
$gadai_transaction = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/'. $auth_user['cawangan'] . '/' . $current->toDateString())->json();
|
|
||||||
if($gadai_transaction){
|
|
||||||
$new_sirig = $gadai_transaction['sirig'] + 1;
|
|
||||||
|
|
||||||
}else{
|
|
||||||
$new_sirig = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$new_transaction = sprintf("%04d",$new_sirig);
|
|
||||||
$norujukanbaru = strtoupper($auth_user['cawangan']) . $curent_year . $curent_month . $current_day . '-' .$new_transaction;
|
|
||||||
|
|
||||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/gadai/'.$auth_user['cawangan'],[
|
|
||||||
'norujukan' => $norujukanbaru,
|
|
||||||
'nopelanggan' => $request->nopelanggan,
|
|
||||||
'nokp' => $request->noic,
|
|
||||||
'sirig' => $new_sirig
|
|
||||||
]);
|
|
||||||
|
|
||||||
///////////////////////////
|
|
||||||
/// MARHUN UPDATE TABLE////
|
|
||||||
//////////////////////////
|
|
||||||
|
|
||||||
$arraymarhunbaru = [];
|
|
||||||
|
|
||||||
$marhunsediada = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/marhun/'. $request->norujukan)->json();
|
|
||||||
|
|
||||||
$marhunyangdiambil = $marhunsediada[0];
|
|
||||||
foreach($marhunyangdiambil as $index=>$marhunloop)
|
|
||||||
{
|
|
||||||
$karatbaru = str_replace('.','-',$marhunloop['karat']);
|
|
||||||
$hargabaru = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/harga_emas/'. $karatbaru)->json();
|
|
||||||
|
|
||||||
$harga = ($request->jenisAT == 'hargalama') ? $marhunloop['harga'] : $hargabaru['harga'];
|
|
||||||
$nilaimarhun = (floatval($harga) * floatval($marhunloop['berat']));
|
|
||||||
|
|
||||||
array_push($arraymarhunbaru, ["bil" => $marhunloop['bil'],"tag_permata" => $marhunloop['tag_permata'],"berat_batu_permata" => $marhunloop['berat_batu_permata'],"marhun" => $marhunloop['marhun'],"nota" => $marhunloop['nota'],"karat" => $marhunloop['karat'], "berat" => $marhunloop['berat'], "harga" => $harga, "n_marhun" => $nilaimarhun]);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($arraymarhunbaru as $array1){
|
|
||||||
$updatemarhun = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/marhun/'. $auth_user['cawangan'],[
|
|
||||||
'norujukan' => $norujukanbaru,
|
|
||||||
'marhun' => $array1['marhun'],
|
|
||||||
'nota' => $array1['nota'],
|
|
||||||
'karat' => $array1['karat'],
|
|
||||||
'berat_emas' => $array1['berat'],
|
|
||||||
'harga' => $array1['harga'],
|
|
||||||
'nilai_marhun' => $array1['n_marhun'],
|
|
||||||
'tag_permata' => $array1['tag_permata'],
|
|
||||||
'berat_batu_permata' => $array1['berat_batu_permata'],
|
|
||||||
'jenisAT' => $request->jenisAT
|
|
||||||
'kuantiti' => $array1['bil']
|
|
||||||
])->json();
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////
|
|
||||||
////Update SAG BARU///
|
|
||||||
/////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
$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);
|
|
||||||
|
|
||||||
$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,
|
|
||||||
]);
|
|
||||||
|
|
||||||
|
|
||||||
$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();
|
$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));
|
||||||
$alirantunai->alirantunaiTebusAutoTawarruq($request);
|
$alirantunai->alirantunaiTebusAutoTawarruq($request);
|
||||||
|
}
|
||||||
return response()->json($updatemarhun,200);
|
return response()->json($updatetebus['result'],200);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tebusseparuh(Request $request)
|
public function tebusseparuh(Request $request)
|
||||||
@@ -686,7 +456,7 @@ class PenebusanController extends Controller
|
|||||||
'harga' => $array1['harga'],
|
'harga' => $array1['harga'],
|
||||||
'tag_permata' => $array1['tag_permata'],
|
'tag_permata' => $array1['tag_permata'],
|
||||||
'berat_batu_permata' => $array1['berat_batu_permata'],
|
'berat_batu_permata' => $array1['berat_batu_permata'],
|
||||||
'nilai_marhun' => $array1['n_marhun']
|
'nilai_marhun' => $array1['n_marhun'],
|
||||||
'kuantiti' => $array1['bil']
|
'kuantiti' => $array1['bil']
|
||||||
])->json();
|
])->json();
|
||||||
|
|
||||||
|
|||||||
@@ -2402,14 +2402,24 @@
|
|||||||
|
|
||||||
var urlroute = '{{ route("resit.autotawarruq", ":id") }}';
|
var urlroute = '{{ route("resit.autotawarruq", ":id") }}';
|
||||||
urlroute = urlroute.replace(':id', norujukan);
|
urlroute = urlroute.replace(':id', norujukan);
|
||||||
|
if(success_data == 'success'){
|
||||||
Swal.fire(
|
Swal.fire(
|
||||||
'Berjaya!',
|
'Berjaya!',
|
||||||
'Tebus Auto Tawarruq Berjaya',
|
'Penyelesaian Pembiayaan Semula Berjaya',
|
||||||
'success'
|
'success'
|
||||||
) .then(function() {
|
) .then(function() {
|
||||||
window.open(urlroute, '_blank');
|
window.open(urlroute, '_blank');
|
||||||
window.location.replace("{{ route('customer_info') }}");
|
window.location.replace("{{ route('customer_info') }}");
|
||||||
})
|
})
|
||||||
|
}else{
|
||||||
|
Swal.fire(
|
||||||
|
'Tidak Berjaya!',
|
||||||
|
'Penyelesaian Pembiayaan Semula Tidak Berjaya!',
|
||||||
|
'error'
|
||||||
|
).then(function(){
|
||||||
|
window.location.replace("{{ route('customer_info') }}");
|
||||||
|
});
|
||||||
|
}
|
||||||
},error: function (request, status, error) {
|
},error: function (request, status, error) {
|
||||||
console.log(request.responseText);
|
console.log(request.responseText);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2660,7 +2660,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
success:function(success_data){
|
success:function(success_data){
|
||||||
|
if(success_data == 'success'){
|
||||||
var urlroute = '{{ route("resit.autotawarruq", ":id") }}';
|
var urlroute = '{{ route("resit.autotawarruq", ":id") }}';
|
||||||
urlroute = urlroute.replace(':id', norujukan);
|
urlroute = urlroute.replace(':id', norujukan);
|
||||||
Swal.fire(
|
Swal.fire(
|
||||||
@@ -2671,6 +2671,14 @@
|
|||||||
window.open(urlroute, '_blank');
|
window.open(urlroute, '_blank');
|
||||||
window.location.replace("{{ route('customer_info') }}");
|
window.location.replace("{{ route('customer_info') }}");
|
||||||
})
|
})
|
||||||
|
}else{
|
||||||
|
Swal.fire(
|
||||||
|
'Tidak Berjaya!',
|
||||||
|
'Penyelesaian Pembiayaan Semula Tidak Berjaya!',
|
||||||
|
'error'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
},error: function (request, status, error) {
|
},error: function (request, status, error) {
|
||||||
console.log(request.responseText);
|
console.log(request.responseText);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3201,6 +3201,15 @@
|
|||||||
|
|
||||||
function gadaiautotawarruq()
|
function gadaiautotawarruq()
|
||||||
{
|
{
|
||||||
|
var jenisbayarantebus = '';
|
||||||
|
if(hargajualan == '')
|
||||||
|
{
|
||||||
|
jenisbayarantebus = "nottawarruq";
|
||||||
|
}
|
||||||
|
else if (hargajualan != ''){
|
||||||
|
jenisbayarantebus = "tawarruq";
|
||||||
|
}
|
||||||
|
|
||||||
let jeniskeuntungan = (tagbaru == 1) ? 'onepercent' : 'asal';
|
let jeniskeuntungan = (tagbaru == 1) ? 'onepercent' : 'asal';
|
||||||
var nopelanggan = "{{ $gadai['nopelanggan'] }}";
|
var nopelanggan = "{{ $gadai['nopelanggan'] }}";
|
||||||
var jenistebus = 'AT';
|
var jenistebus = 'AT';
|
||||||
@@ -3274,7 +3283,7 @@
|
|||||||
"historygadaian" : historygadaian,
|
"historygadaian" : historygadaian,
|
||||||
"marhun" : marhun,
|
"marhun" : marhun,
|
||||||
"nowakil" : nowakil,
|
"nowakil" : nowakil,
|
||||||
"jenisbayarantebus" : "nottawarruq",
|
"jenisbayarantebus" : jenisbayarantebus,
|
||||||
"teller" : teller,
|
"teller" : teller,
|
||||||
"jeniskeuntungan" : jeniskeuntungan,
|
"jeniskeuntungan" : jeniskeuntungan,
|
||||||
|
|
||||||
@@ -3298,6 +3307,7 @@
|
|||||||
|
|
||||||
var urlroute = '{{ route("resit.autotawarruq", ":id") }}';
|
var urlroute = '{{ route("resit.autotawarruq", ":id") }}';
|
||||||
urlroute = urlroute.replace(':id', norujukan);
|
urlroute = urlroute.replace(':id', norujukan);
|
||||||
|
if(success_data == 'success'){
|
||||||
Swal.fire(
|
Swal.fire(
|
||||||
'Berjaya!',
|
'Berjaya!',
|
||||||
'Penyelesaian Pembiayaan Semula Berjaya',
|
'Penyelesaian Pembiayaan Semula Berjaya',
|
||||||
@@ -3306,6 +3316,16 @@
|
|||||||
window.open(urlroute, '_blank');
|
window.open(urlroute, '_blank');
|
||||||
window.location.replace("{{ route('customer_info') }}");
|
window.location.replace("{{ route('customer_info') }}");
|
||||||
})
|
})
|
||||||
|
}else{
|
||||||
|
Swal.fire(
|
||||||
|
'Tidak Berjaya!',
|
||||||
|
'Penyelesaian Pembiayaan Semula Tidak Berjaya!',
|
||||||
|
'error'
|
||||||
|
).then(function(){
|
||||||
|
window.location.replace("{{ route('customer_info') }}");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
},error: function (request, status, error) {
|
},error: function (request, status, error) {
|
||||||
console.log(request.responseText);
|
console.log(request.responseText);
|
||||||
}
|
}
|
||||||
@@ -3506,6 +3526,7 @@
|
|||||||
var total_berat = parseFloat("{{ $gadai['berat'] }}");
|
var total_berat = parseFloat("{{ $gadai['berat'] }}");
|
||||||
var kuantiti_marhun = Number("{{sizeof($marhun)}}");
|
var kuantiti_marhun = Number("{{sizeof($marhun)}}");
|
||||||
var noic = "{{ $gadai['nokp'] }}";
|
var noic = "{{ $gadai['nokp'] }}";
|
||||||
|
var nowakil = nw;
|
||||||
|
|
||||||
var duitpelanggan = $('#duitPelanggan').val().replace(/[^0-9.-]+/g,"");
|
var duitpelanggan = $('#duitPelanggan').val().replace(/[^0-9.-]+/g,"");
|
||||||
var bakipelanggan = $('#bakiPelanggan').val().replace(/[^0-9.-]+/g,"");
|
var bakipelanggan = $('#bakiPelanggan').val().replace(/[^0-9.-]+/g,"");
|
||||||
@@ -3568,6 +3589,7 @@
|
|||||||
"teller" : teller,
|
"teller" : teller,
|
||||||
"bayaran" : duitpelanggan,
|
"bayaran" : duitpelanggan,
|
||||||
"bakipelanggan" : bakipelanggan,
|
"bakipelanggan" : bakipelanggan,
|
||||||
|
"nowakil" : nowakil,
|
||||||
|
|
||||||
},
|
},
|
||||||
success:function(success_data){
|
success:function(success_data){
|
||||||
|
|||||||
Reference in New Issue
Block a user