Merged release/staging into hotfix/tunai-add-timestamp

This commit is contained in:
Muhd hafifie
2024-12-22 13:20:16 +00:00
14 changed files with 258 additions and 390 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ class DailyImbangDuga extends Command
foreach($array_cawangan as $caw) foreach($array_cawangan as $caw)
{ {
if($caw['zone'] == $zone) if($caw['version'] == 'v2')
{ {
$response = $this->imbangduga->OperationImbangDuga($caw['kodcaw']); $response = $this->imbangduga->OperationImbangDuga($caw['kodcaw']);
} }
+1 -1
View File
@@ -63,7 +63,7 @@ class generateAkruProblem extends Command
$updateIG = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/admin/laporan/akrual/updateImbangDuga',[ $updateIG = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/admin/laporan/akrual/updateImbangDuga',[
'zone' => $zone, 'zone' => $zone,
'tarikh' => $previousmonth, 'tarikh' => $previousmonth->toDateString(),
])->json(); ])->json();
$this->info('sucess'); $this->info('sucess');
+46 -257
View File
@@ -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;
@@ -257,7 +258,8 @@ class PenebusanController extends Controller
'karat' => $array1['karat'], 'karat' => $array1['karat'],
'berat_emas' => $array1['berat'], 'berat_emas' => $array1['berat'],
'harga' => $array1['harga'], 'harga' => $array1['harga'],
'nilai_marhun' => $array1['n_marhun'] 'nilai_marhun' => $array1['n_marhun'],
'kuantiti' => $array1['bil']
])->json(); ])->json();
} }
@@ -279,155 +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
//////////////////////
/// 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'],"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'],
'nilai_marhun' => $array1['n_marhun']
])->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();
//////////////////////// ////////////////////////
@@ -440,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,
@@ -453,128 +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'){
//////////////////////
/// 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'],"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'],
'jenisAT' => $request->jenisAT
])->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)
@@ -612,6 +395,9 @@ class PenebusanController extends Controller
"bakipelanggan" => $request->bakipelanggan, "bakipelanggan" => $request->bakipelanggan,
])->json(); ])->json();
if($updatetebus == 'duplicate'){
return response()->json('duplicate');
}
////////////////////// //////////////////////
/// MAKING NEW SAG//// /// MAKING NEW SAG////
@@ -655,7 +441,7 @@ class PenebusanController extends Controller
$nilaimarhun = (floatval($hargabaru['harga']) * floatval($marhunloop['berat'])); $nilaimarhun = (floatval($hargabaru['harga']) * floatval($marhunloop['berat']));
array_push($arraymarhunbaru, ["bil" => $marhunloop['bil'],"marhun" => $marhunloop['marhun'],"nota" => $marhunloop['nota'],"karat" => $marhunloop['karat'], "berat" => $marhunloop['berat'], "harga" => $hargabaru['harga'], "n_marhun" => $nilaimarhun]); 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]);
} }
} }
@@ -668,7 +454,10 @@ class PenebusanController extends Controller
'karat' => $array1['karat'], 'karat' => $array1['karat'],
'berat_emas' => $array1['berat'], 'berat_emas' => $array1['berat'],
'harga' => $array1['harga'], 'harga' => $array1['harga'],
'nilai_marhun' => $array1['n_marhun'] 'tag_permata' => $array1['tag_permata'],
'berat_batu_permata' => $array1['berat_batu_permata'],
'nilai_marhun' => $array1['n_marhun'],
'kuantiti' => $array1['bil']
])->json(); ])->json();
} }
+7 -2
View File
@@ -56,7 +56,7 @@ class ImbangdugaServices
if($kodcaw == '010219') if($kodcaw == '010219')
if($tarikh >= '2022-11-24') if($tarikh >= '2022-11-24')
$data = $value - 78379.9; $data = $value;
else $data = $value; else $data = $value;
else $data = $value; else $data = $value;
break; break;
@@ -64,7 +64,12 @@ class ImbangdugaServices
if($kodcaw == '010219') if($kodcaw == '010219')
if($tarikh < '2022-11-24') if($tarikh < '2022-11-24')
$data = $value - 78379.9; $data = $value - 78379.9;
else $data = $value; else if($tarikh >= '2023-02-16'){
$hutang = Http::get(config('api.url').'/admin/ig/penghutang' ,['kodcaw' => $kodcaw, 'tarikh' => $tarikh])->json();
$bayaran_hutang = Http::get(config('api.url').'/admin/ig/bayaran_penghutang' ,['kodcaw' => $kodcaw, 'tarikh' => $tarikh])->json();
$data = $hutang['bakihutang'] - $bayaran_hutang;
}else $data = $value;
//else $data = $value;
else $data = $value; else $data = $value;
break; break;
case 'jualan1stop': case 'jualan1stop':
+2 -2
View File
@@ -1,7 +1,7 @@
<?php <?php
return [ return [
'enable_tambahpinjam' => env('ENABLE_TAMBAHPINJAM',1), 'enable_tambahpinjam' => env('ENABLE_TAMBAHPINJAM',1),
'enable_separuh' => env('ENABLE_SEPARUH',1), 'enable_separuh' => env('ENABLE_SEPARUH',0),
'enable_pembiayaansemula' => env('ENABLE_AUTOTAWARRUQ',1) 'enable_pembiayaansemula' => env('ENABLE_AUTOTAWARRUQ',0)
]; ];
?> ?>
+23 -16
View File
@@ -9,7 +9,7 @@
@section('content') @section('content')
@include('modal.historytebus') @include('modal.historytebus')
@include('modal.wakil') @include('modal.wakil')
<div class="container"> <div class="container-fluid">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-12 col-lg-12"> <div class="col-md-12 col-lg-12">
@@ -118,26 +118,25 @@
<input type="text" class="form-control" name="rugilelong" id="rugilelong" readonly value="{{ number_format($rugilelong,2) }}"> <input type="text" class="form-control" name="rugilelong" id="rugilelong" readonly value="{{ number_format($rugilelong,2) }}">
</div> </div>
</div> </div>
<div class="col-md-12 d-flex justify-content-end mt-3">
<button class="btn btn-primary" data-toggle="modal" data-target="#customer_detail">Maklumat Pelanggan</button>
</div> </div>
</div>
<div class="col-md-12 mt-md-3 justify-content-between form-group row"> <div class="col-md-12 mt-md-3 justify-content-between form-group row">
<div class="btn-group btn-group-toggle col-md-6" data-toggle="buttons"> <div class="btn-group btn-group-toggle col-md-6" data-toggle="buttons">
<label class="btn btn-primary"> <label class="btn btn-primary">
<input type="radio" name="options" id="option1" value="belum_tebus" autocomplete="off" checked>Pembiayaan Belum Selesai. <input type="radio" name="options" id="option1" value="belum_tebus" autocomplete="off" checked>Pembiayaan Belum Selesai
</label> </label>
<label class="btn btn-primary"> <label class="btn btn-secondary">
<input type="radio" name="options" id="option2" value="sudah_tebus" autocomplete="off">Pembiayaan Sudah Selesai <input type="radio" name="options" id="option2" value="sudah_tebus" autocomplete="off">Pembiayaan Sudah Selesai
</label> </label>
<label class="btn btn-primary"> <label class="btn btn-secondary">
<input type="radio" name="options" id="option3" value="lelong" autocomplete="off">Lelong <input type="radio" name="options" id="option3" value="lelong" autocomplete="off">Lelong
</label> </label>
</div> </div>
<div class='col-md-3'>
{{-- <button class='btn btn-primary' data-toggle="modal" data-target="#customer_detail">Maklumat Pelanggan</button> --}}
</div>
<div class="col-md-3 text-right">
<button class='btn btn-primary' data-toggle="modal" data-target="#customer_detail">Maklumat Pelanggan</button>
</div>
</div> </div>
</div> </div>
<div class="card"> <div class="card">
@@ -175,6 +174,7 @@
<th>Tempoh</th> <th>Tempoh</th>
<th>Keuntungan</th> <th>Keuntungan</th>
<th>Lelong</th> <th>Lelong</th>
<th>Pembayaran Terakhir</th>
</tr> </tr>
</thead> </thead>
</table> </table>
@@ -203,6 +203,7 @@
<th>Tempoh</th> <th>Tempoh</th>
<th>Keuntungan</th> <th>Keuntungan</th>
<th>Lelong</th> <th>Lelong</th>
<th>Pembayaran Terakhir</th>
</tr> </tr>
</thead> </thead>
</table> </table>
@@ -758,6 +759,7 @@
if(gadai_detail["tagbaru"] == 0){ if(gadai_detail["tagbaru"] == 0){
$('#textnavsag').addClass('text-danger'); $('#textnavsag').addClass('text-danger');
var taglel = ''; var taglel = '';
var lastbayar = '';
if(gadai_detail['taglel'] == 1){ if(gadai_detail['taglel'] == 1){
if(tagarrahnbid == 1){ if(tagarrahnbid == 1){
$.ajax({ $.ajax({
@@ -767,6 +769,7 @@
success: function(data){ success: function(data){
taglel = data.lelong.t_lelong; taglel = data.lelong.t_lelong;
lastbayar = data.lelong.lastbayar;
} }
}); });
} else { } else {
@@ -794,15 +797,17 @@
'<a data-pinjaman='+ gadai_detail['pinjaman'] +' data-hargajualan='+ gadai_detail['hargajualan'] +' data-norujukan='+ gadai_detail['norujukan'] +' data-url=' + urlroute +'>' + gadai_detail['norujukan'] + '</a>', '<a data-pinjaman='+ gadai_detail['pinjaman'] +' data-hargajualan='+ gadai_detail['hargajualan'] +' data-norujukan='+ gadai_detail['norujukan'] +' data-url=' + urlroute +'>' + gadai_detail['norujukan'] + '</a>',
gadai_detail['t_gadai'], gadai_detail['t_gadai'],
tarikh_matang, tarikh_matang,
'RM '+ formatter.format(gadai_detail['bakihargajualan']), 'RM'+ formatter.format(gadai_detail['bakihargajualan']),
'RM '+formatter.format(gadai_detail['bakipjm']), 'RM'+formatter.format(gadai_detail['bakipjm']),
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%', (((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
gadai_detail['tempoh'], gadai_detail['tempoh'],
'RM '+ upahsemasa, 'RM'+ upahsemasa,
'<div style="white-space: nowrap; color:red; font-weight: bolder">' + taglel + '</div>', '<div style="white-space: nowrap; color:red; font-weight: bolder">' + taglel + '</div>',
'<div style="white-space: nowrap; color:red; font-weight: bolder">' + lastbayar + '</div>',
]).draw(); ]).draw();
}else{ }else{
var taglel = ''; var taglel = '';
var lastbayar = '';
if(gadai_detail['taglel'] == 1){ if(gadai_detail['taglel'] == 1){
if(tagarrahnbid == 1){ if(tagarrahnbid == 1){
$.ajax({ $.ajax({
@@ -812,6 +817,7 @@
success: function(data){ success: function(data){
taglel = data.lelong.t_lelong; taglel = data.lelong.t_lelong;
lastbayar = data.lelong.lastbayar;
} }
}); });
} else { } else {
@@ -837,12 +843,13 @@
'<a href="#" onclick="checkserah(this)" data-pinjaman='+ gadai_detail['pinjaman'] +' data-hargajualan='+ gadai_detail['hargajualan'] +' data-norujukan='+ gadai_detail['norujukan'] +' data-url=' + urlroute +'>' + gadai_detail['norujukan'] + '</a>', '<a href="#" onclick="checkserah(this)" data-pinjaman='+ gadai_detail['pinjaman'] +' data-hargajualan='+ gadai_detail['hargajualan'] +' data-norujukan='+ gadai_detail['norujukan'] +' data-url=' + urlroute +'>' + gadai_detail['norujukan'] + '</a>',
gadai_detail['t_gadai'], gadai_detail['t_gadai'],
tarikh_matang, tarikh_matang,
'RM '+ formatter.format(gadai_detail['bakihargajualan']), 'RM'+ formatter.format(gadai_detail['bakihargajualan']),
'RM '+formatter.format(gadai_detail['bakipjm']), 'RM'+formatter.format(gadai_detail['bakipjm']),
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%', (((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
gadai_detail['tempoh'], gadai_detail['tempoh'],
'RM '+ formatter.format(upahsemasa['pendapatan']), 'RM'+ formatter.format(upahsemasa['pendapatan']),
'<div style="white-space: nowrap; color:red; font-weight: bolder">' + taglel + '</div>', '<div style="white-space: nowrap; color:red; font-weight: bolder">' + taglel + '</div>',
'<div style="white-space: nowrap; color:red; font-weight: bolder">' + lastbayar + '</div>',
]).draw(); ]).draw();
} }
}else if(jenistebus == "sudah_tebus"){ }else if(jenistebus == "sudah_tebus"){
+40 -23
View File
@@ -12,7 +12,7 @@
<div class="container"> <div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-12 col-lg-12"> <div class="col-md-12 col-lg-12">
<div class="card">
<nav aria-label="breadcrumb"> <nav aria-label="breadcrumb">
<ol class="breadcrumb pb-3"> <ol class="breadcrumb pb-3">
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li> <li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
@@ -89,9 +89,7 @@
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group row"> <div class="form-group row">
<div class="col-md-4"> <div class="col-md-4">
<b>No Telefon</b> <b>No Telefon</b>
@@ -119,30 +117,48 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="col-md-12 mt-md-3 justify-content-between form-group row"> <!-- footer card -->
<div class="btn-group btn-group-toggle col-md-6" data-toggle="buttons"> <div class="mr-4 form-group d-flex justify-content-end">
<label class="btn btn-primary"> <button class="btn btn-primary button-spacing" data-toggle="modal" data-target="#customer_detail">Maklumat Pelanggan</button>
<input type="radio" name="options" id="option1" value="belum_tebus" autocomplete="off" checked>Pembiayaan Belum Selesai </div>
</div>
</div>
<!-- button -->
<div class="col-md-10 mt-md-2 justify-content-between form-group row">
<div class="btn-group btn-group-toggle d-flex flex-fill" data-toggle="buttons">
<label class="btn btn-secondary flex-fill">
<input type="radio" name="options" id="option1" value="belum_tebus" autocomplete="off" checked>
Pembiayaan Belum Selesai
</label> </label>
<label class="btn btn-primary"> <label class="btn btn-secondary flex-fill">
<input type="radio" name="options" id="option2" value="sudah_tebus" autocomplete="off">Pembiayaan Sudah Selesai <input type="radio" name="options" id="option2" value="sudah_tebus" autocomplete="off">
Pembiayaan Sudah Selesai
</label> </label>
<label class="btn btn-primary"> <label class="btn btn-secondary flex-fill">
<input type="radio" name="options" id="option3" value="lelong" autocomplete="off">Lelong <input type="radio" name="options" id="option3" value="lelong" autocomplete="off">
Lelong
</label> </label>
</div> </div>
<div class='col-md-3'>
<button class='btn btn-primary' data-toggle="modal" data-target="#customer_detail">Maklumat Pelanggan</button> </div>
</div>
<div class="col-md-3 text-right">
<a class="btn btn-primary" style="margin-right:-50px" id="daftar_gadai">Daftar Pembiayaan</a> <!-- card -->
</div>
</div> <div class="col-md-12 col-lg-12">
</div>
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<nav class="mb-3"> <nav class="mb-3">
<!-- button -->
<div class="mr-2 form-group d-flex justify-content-end">
<a class="btn btn-primary button-spacing" id="daftar_gadai">Daftar Pembiayaan</a>
</div>
<div class="nav nav-tabs" id="nav-tab" role="tablist"> <div class="nav nav-tabs" id="nav-tab" role="tablist">
@php @php
$activate_tab = request()->session()->pull('activate_tab', 'SAG_lama'); $activate_tab = request()->session()->pull('activate_tab', 'SAG_lama');
@@ -254,6 +270,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Modal --> <!-- Modal -->
<div class="modal fade" id="customer_detail" tabindex="-1" aria-labelledby="customer_detailLabel" aria-hidden="true"> <div class="modal fade" id="customer_detail" tabindex="-1" aria-labelledby="customer_detailLabel" aria-hidden="true">
@@ -1617,7 +1634,7 @@
}); });
} }
function ubahPembiayaanSemulaErrorHandling() async function ubahPembiayaanSemulaErrorHandling()
{ {
let selected = document.querySelector('#navtawarruqdannottawarruq input[type="radio"][name="belum"]:checked') let selected = document.querySelector('#navtawarruqdannottawarruq input[type="radio"][name="belum"]:checked')
@@ -1638,7 +1655,7 @@
return true; return true;
} }
let isPS = checkPS(selected.value) let isPS = await checkPS(selected.value)
if(isPS === true){ if(isPS === true){
Swal.fire({ Swal.fire({
@@ -1653,9 +1670,9 @@
return false; return false;
} }
function ubahfunc(e){ async function ubahfunc(e){
let isError = ubahPembiayaanSemulaErrorHandling() let isError = await ubahPembiayaanSemulaErrorHandling()
if(isError){ if(isError){
return; return;
} }
+28 -12
View File
@@ -1,5 +1,11 @@
@extends('layouts.app') @extends('layouts.app')
<style>
#daftar_gadai{
color:#fff !important;
}
</style>
@section('content') @section('content')
@include('modal.historytebus') @include('modal.historytebus')
@@ -10,7 +16,7 @@
<div class="container"> <div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-12 col-lg-12"> <div class="col-md-12 col-lg-12">
<div class="card">
<nav aria-label="breadcrumb"> <nav aria-label="breadcrumb">
<ol class="breadcrumb pb-3"> <ol class="breadcrumb pb-3">
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li> <li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
@@ -112,27 +118,37 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="col-md-12 mt-md-3 justify-content-between form-group row"> <!-- footer card -->
<div class="btn-group btn-group-toggle col-md-6" data-toggle="buttons"> <div class="mr-4 form-group d-flex justify-content-end">
<label class="btn btn-primary"> <button class="btn btn-primary button-spacing" data-toggle="modal" data-target="#customer_detail">Maklumat Pelanggan</button>
</div>
</div>
</div>
<!-- button -->
<div class="col-md-10 mt-md-2 justify-content-between form-group row">
<div class="btn-group btn-group-toggle d-flex flex-fill" data-toggle="buttons">
<label class="btn btn-secondary flex-fill">
<input type="radio" name="options" id="option1" value="belum_tebus" autocomplete="off" checked>Pembiayaan Belum Selesai <input type="radio" name="options" id="option1" value="belum_tebus" autocomplete="off" checked>Pembiayaan Belum Selesai
</label> </label>
<label class="btn btn-primary"> <label class="btn btn-secondary flex-fill">
<input type="radio" name="options" id="option2" value="sudah_tebus" autocomplete="off">Pembiayaan Sudah Selesai <input type="radio" name="options" id="option2" value="sudah_tebus" autocomplete="off">Pembiayaan Sudah Selesai
</label> </label>
<label class="btn btn-primary"> <label class="btn btn-secondary flex-fill">
<input type="radio" name="options" id="option3" value="lelong" autocomplete="off">Lelong <input type="radio" name="options" id="option3" value="lelong" autocomplete="off">Lelong
</label> </label>
</div> </div>
<div class='col-md-3 text-right'>
</div> </div>
<div class="col-md-3 text-right"> </div>
<button class='btn btn-primary' data-toggle="modal" style="margin-right:-50px" data-target="#customer_detail">Maklumat Pelanggan</button>
</div>
</div>
</div>
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<nav class="mb-3"> <nav class="mb-3">
@@ -124,12 +124,12 @@
<td>{{ $staff->name }}</td> <td>{{ $staff->name }}</td>
<td>{{ strtoupper($staff->roles) }}</td> <td>{{ strtoupper($staff->roles) }}</td>
<td> <td>
@if($staff->cawangan == 'operasi') @if($staff->cawangan == 'operasi' || $staff->cawangan == 'callcenter' || $staff->cawangan == 'admin')
{{ ucwords($staff->cawangan) }} {{ ucwords($staff->cawangan) }}
@else @else
@php @php
$cawangan_staff = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $staff->cawangan)->json(); $cawangan_staff = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $staff->cawangan)->json();
echo ($cawangan_staff) ? ucwords($cawangan_staff['details_caw']) : 'test'; echo (isset($cawangan_staff['details_caw'])) ? ucwords($cawangan_staff['details_caw']) : 'test';
@endphp @endphp
@endif @endif
</td> </td>
+11 -1
View File
@@ -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);
} }
+23 -1
View File
@@ -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){
+3 -3
View File
@@ -231,13 +231,13 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-top: -140px; margin-top: -135px;
} }
.main-kaki-sag { .main-kaki-sag {
border: 1px solid black; border: 1px solid black;
padding: 10px; padding: 10px;
width: 200px; width: 245px;
transform: rotate(-90deg); transform: rotate(-90deg);
font-size: 9px; font-size: 9px;
} }
@@ -1644,7 +1644,7 @@
'" alt="barcode" />'; '" alt="barcode" />';
@endphp @endphp
</div> </div>
<div class="percent-text">{{ $gadai_detail['percentpinj'] }}%</div> {{-- <div class="percent-text">{{ $gadai_detail['percentpinj'] }}%</div> --}}
</div> </div>
<div class="detail-kaki-sag"> <div class="detail-kaki-sag">
<div class="ps-positioning {{ $is_pembiayaan_semula == false ? 'hidden' : '' }}"> <div class="ps-positioning {{ $is_pembiayaan_semula == false ? 'hidden' : '' }}">
+7 -13
View File
@@ -152,21 +152,18 @@
<table id="details" style="margin-top:20px;"> <table id="details" style="margin-top:20px;">
<tr> <tr>
<td colspan="2">Saya seperti nama di atas, ingin memaklumkan kepada Ar-Rahn Koperasi Permodalan Kelantan Berhad <td colspan="2">
Saya seperti nama di atas, ingin memaklumkan kepada Ar-Rahn Koperasi Permodalan Kelantan Berhad
bagi Cawangan {{ $cawangan_detail['namacaw'] }}, bahawa saya tidak dapat hadir untuk melakukan transaksi: bagi Cawangan {{ $cawangan_detail['namacaw'] }}, bahawa saya tidak dapat hadir untuk melakukan transaksi:
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
Penyelesaian Penuh <input type="checkbox"><strong>Penyelesaian Penuh</strong>
</td> </td>
</tr> </tr>
<tr> </table>
<td>
Penyelesaian Penuh dan Permohonan Pembiayaan Baru
</td>
</tr>
</table>
<table id="details" style="margin-top:20px;"> <table id="details" style="margin-top:20px;">
<tr> <tr>
@@ -200,11 +197,8 @@
</tr> </tr>
</table> </table>
<table id="details" style="margin-top:20px;"> <br>
<tr> <br>
<td colspan="2">2. Saya mengaku tidak akan membuat apa-apa <b>TUNTUTAN @ GANTI RUGI</b> atas kebarangkalian @
kerugian yang berlaku disebabkan perlantikan wakil bagi menyelesaikan pembiayaan saya.</td>
</tr>
</table> </table>