diff --git a/app/Http/Controllers/CustomersController.php b/app/Http/Controllers/CustomersController.php index 7b8f14c..a3c4aac 100644 --- a/app/Http/Controllers/CustomersController.php +++ b/app/Http/Controllers/CustomersController.php @@ -40,7 +40,8 @@ class CustomersController extends Controller $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); $bank = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/bank')->json(); $blacklist_search = false; - return view('customers.index',compact('search','blacklist_search','cawangan_info','bank','api_url','idtype')); + + return view('customers.' . $cawangan_info['version'] . '.index',compact('search','blacklist_search','cawangan_info','bank','api_url','idtype')); } public function info(Request $request){ @@ -58,7 +59,10 @@ class CustomersController extends Controller $request->session()->forget('page_reload'); $request->session()->forget('norujukan'); - return view('customers.info',compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','min_komoditi')); + + $customer_page = ($cawangan_info['version'] == 'v1') ? 'customers.v1.info' : 'customers.v2.info'; + + return view($customer_page,compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','min_komoditi')); } public function search(Request $request){ diff --git a/app/Http/Controllers/GadaianController.php b/app/Http/Controllers/GadaianController.php index f2981e6..5bc53c5 100644 --- a/app/Http/Controllers/GadaianController.php +++ b/app/Http/Controllers/GadaianController.php @@ -92,7 +92,7 @@ class GadaianController extends Controller $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); - return view('gadaian.index',compact('customer_info','limit_pinjaman_semasa','cawangan_info','norujukan','api_url','current')); + return view('gadaian.' . $cawangan_info['version'] . '.index',compact('customer_info','limit_pinjaman_semasa','cawangan_info','norujukan','api_url','current')); } public function edit(Request $request,$norujukan){ @@ -344,7 +344,13 @@ class GadaianController extends Controller $pembayaran_segera = "https://spare.arrahn.com.my/pembayaransegera"; // return view('print.sag',compact('gadai_detail','customer_detail','marhun_detail','cawangan_detail','api_url','pembayaran_segera','auth_username','mutu')); - return view('print.sag_ujrah',compact('gadai_detail','customer_detail','marhun_detail','cawangan_detail','api_url','pembayaran_segera','auth_username','mutu')); + + if($gadai_detail['tagbaru'] == 1) + { + return view('print.sag_ujrah',compact('gadai_detail','customer_detail','marhun_detail','cawangan_detail','api_url','pembayaran_segera','auth_username','mutu')); + }else{ + return view('print.sag',compact('gadai_detail','customer_detail','marhun_detail','cawangan_detail','api_url','pembayaran_segera','auth_username','mutu')); + } } public function resit($id) @@ -393,6 +399,8 @@ class GadaianController extends Controller // if(sizeof($customers_info) != 0) // $customers_info = $customers_info[0]; + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + $wakil = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/getwakil/' . $auth_user['cawangan'] . '/code/' . $transaction['nowakil'])->json(); if(sizeof($wakil) != 0) @@ -401,7 +409,8 @@ class GadaianController extends Controller if($gadai['tagbaru'] == 1) { return view('print.resitansuran_ujrah',compact('transaction','gadai','customers_info','wakil')); } else { - return view('print.resittebus',compact('transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran')); + return view('print.resitansuran',compact('transaction','gadai','customers_info','wakil')); + // return view('print.resittebus',compact('transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran')); } } diff --git a/app/Http/Controllers/PenebusanController.php b/app/Http/Controllers/PenebusanController.php index 48ce374..bd5fca0 100644 --- a/app/Http/Controllers/PenebusanController.php +++ b/app/Http/Controllers/PenebusanController.php @@ -41,7 +41,7 @@ class PenebusanController extends Controller $nilaihargasemasa = $this->tukaranhargaemas($norujukan); - return view('penebusan.index',compact('cawangan_info','api_url','gadai','marhun','nama','nilaihargasemasa')); + return view('penebusan.' . $cawangan_info['version'] . '.index',compact('cawangan_info','api_url','gadai','marhun','nama','nilaihargasemasa')); } public function tebuspenuh(Request $request) @@ -429,7 +429,7 @@ class PenebusanController extends Controller 'marhun' => $request->marhun, 'jenisbayarantebus' => $request->jenisbayarantebus, 'teller' => $request->teller, - 'jeniskeuntungan' => 'asal', + 'jeniskeuntungan' => $request->jeniskeuntungan, 'totalbayaran' => $request->totalbayaran, "bayaranpelanggan" => $request->bayaran, "bakipelanggan" => $request->bakipelanggan, @@ -502,7 +502,8 @@ class PenebusanController extends Controller 'pembiayaan' => $request->pinjaman, 'nilaimarhun' => $total_nilai_marhun, 'kadarujrah' => $request->kadarkeuntungan, - 'margin' => ($margin_pinjaman*100) + 'margin' => ($margin_pinjaman*100), + 'kodcaw' => Auth::user()->cawangan ])->json(); $keuntungan_sebln = $onepercent['keuntungan']; diff --git a/resources/views/customers/v1/index.blade.php b/resources/views/customers/v1/index.blade.php new file mode 100644 index 0000000..8189e5b --- /dev/null +++ b/resources/views/customers/v1/index.blade.php @@ -0,0 +1,1285 @@ +@extends('layouts.app') + +@section('content') + +
+
+
+ + + +
+
+
+
masukkan nombor kad pengenalan
+
+
+
+
+ +
+ +
+
+ +
+
+ @php + $user_cawangan = strtolower(auth()->user()->cawangan_kerja->details_caw); + $enabled_cawangan = array_map(fn($x) => strtolower($x), config('mykad-reader.enabled_cawangan')); + + $is_in_pelanggan_main_page = request()->path() === 'pelanggan'; + + $is_enabled_to_use_mykad_reader = function () use($user_cawangan, $enabled_cawangan){ + + if(sizeof($enabled_cawangan) == 0){ + return true; + } + + if(sizeof($enabled_cawangan) == 1 && $enabled_cawangan[0] === ''){ + return true; + } + + return in_array($user_cawangan, $enabled_cawangan); + + }; + @endphp + + + @if( $is_in_pelanggan_main_page && $is_enabled_to_use_mykad_reader() ) + Baca MyKad + @endif +
+
+
+
+ @if($search == true && $blacklist_search == false) +
+ +
+ @endif +
+
+ + + + + + +
+
+
+ + +@push('additional_scripts') + + + + +@endpush + +@endsection \ No newline at end of file diff --git a/resources/views/customers/v1/info.blade.php b/resources/views/customers/v1/info.blade.php new file mode 100644 index 0000000..39c7d22 --- /dev/null +++ b/resources/views/customers/v1/info.blade.php @@ -0,0 +1,2484 @@ +@extends('layouts.app') + + + +@section('content') +@include('modal.historytebus') +@include('modal.wakil') +
+
+
+ + + +
+
+
+
+ Nama +
+
+ +
+
+
+
+
+
+ No Kad Pengenalan +
+
+ @php + if($customer_info['kpbaru'] != null){ + $noic = $customer_info['kpbaru']; + }else{ + $noic = $customer_info['kplama']; + } + @endphp + +
+
+
+
+
+
+ Pembiayaan +
+
+ @php + if($customer_info['kpbaru'] != null){ + $noic = $customer_info['kpbaru']; + }else{ + $noic = $customer_info['kplama']; + } + $outstanding_semasa = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/gadai/customers/'. $noic .'/outstandingsemasa/'.$cawangan_info['kodcaw'])->json(); + @endphp + +
+
+ +
+
+ Baki Limit Pembiayaan +
+
+ @php + $limit_pinjaman_semasa = 300000 - $outstanding_semasa; + @endphp + +
+
+ +
+
+ Baki Lelong +
+
+ +
+
+ +
+ +
+ +
+
+ No Telefon +
+
+ +
+
+ +
+
+ Nota +
+
+ +
+
+ +
+
+ Rugi Lelong +
+
+ +
+
+
+ +
+
+ + + +
+
+ +
+ +
+
+
+
+ + + + {{-- Sudah Tebus --}} + + + + + + + + + + + + +
BilNo RujukanTarikh TebusBaki PembiayaanMarginTempoh
+ + + + + + + + + + + + + + + + + +
BilNo RujukanTarikh LelongTarikh TuntutPembiayaanHarga JualJum Tuntut/BayarKeuntunganCaj LelongStatus TuntutanCetak
+ +
+ + + +
+ +
+
+
+
+
+ + + + + + + +@endsection \ No newline at end of file diff --git a/resources/views/customers/index.blade.php b/resources/views/customers/v2/index.blade.php similarity index 100% rename from resources/views/customers/index.blade.php rename to resources/views/customers/v2/index.blade.php diff --git a/resources/views/customers/info.blade.php b/resources/views/customers/v2/info.blade.php similarity index 99% rename from resources/views/customers/info.blade.php rename to resources/views/customers/v2/info.blade.php index a4ca07a..a8ff3f0 100644 --- a/resources/views/customers/info.blade.php +++ b/resources/views/customers/v2/info.blade.php @@ -792,7 +792,10 @@ let jeniskeuntungan = (gadai_detail['tagbaru'] == 1) ? 'onepercent' : 'asal'; $.ajax({ method:'get', - url:api_url + '/api/upahtawarruq/'+ gadai_detail['kodcaw'] +'/' + gadai_detail['norujukan'] + '/' + jeniskeuntungan, + url:api_url + '/api/upahtawarruq/'+ gadai_detail['kodcaw'] +'/' + gadai_detail['norujukan'], + data: { + 'jeniskeuntungan' : jeniskeuntungan + }, success:function(upahsemasa){ if(jenistebus == "belum_tebus"){ var urlroute = '{{ route("penebusan", ":id") }}'; @@ -858,7 +861,6 @@ let table_norujukan = gadai_detail["norujukan"]; let radio_action = "onclick=checkCanChangeGadaianDetail(" + "'" + table_norujukan + "'" + ")"; - tablegadai.row.add([ '', '' + gadai_detail['norujukan'] + '', @@ -868,7 +870,7 @@ 'RM '+formatter.format(gadai_detail['bakipjm']), (((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%', gadai_detail['tempoh'], - 'RM '+ upahsemasa, + 'RM '+ upahsemasa['pendapatan'], '
' + taglel + '
', ]).draw(); } diff --git a/resources/views/gadaian/v1/edit.blade.php b/resources/views/gadaian/v1/edit.blade.php new file mode 100644 index 0000000..bb81ab8 --- /dev/null +++ b/resources/views/gadaian/v1/edit.blade.php @@ -0,0 +1,1106 @@ +@extends('layouts.app') + + + +@section('content') +@include('modal.editmarhun') +
+
+
+

gadaian

+
+ + +
+
+
+ No Rujukan +
+
+ +
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
BilRecnoMarhunNilai MarhunKaratBeratNotaHargaAction
Jumlah
+
+
+
+
+
+ {{-- --}} + @csrf +
+
+
+
+ Pembiayaan Max +
+
+ +
+ +
+
+
+
+ @php + if($gadaiannorujukan['nilaimarhun'] > 0 && $gadaiannorujukan['nilaimarhun'] < 401){ + $kadarupah = 1.2/100; + }else if($gadaiannorujukan['nilaimarhun'] >= 401 && $gadaiannorujukan['nilaimarhun'] < 2001){ + $kadarupah = 1.5/100; + }else if($gadaiannorujukan['nilaimarhun'] >= 2001 ){ + $kadarupah = 1.7/100; + } + + $keuntungan_sebulan = $gadaiannorujukan['pinjaman'] * $kadarupah; + $keuntungan_6bln = $keuntungan_sebulan * 6; + + @endphp +
+
+
+ Keuntungan Sebulan +
+
+ +
+
+
+
+
+
+
+
+
+
+ Pembiayaan +
+
+ +
+ +
+
+
+
+
+
+
+ Keuntungan 6 Bulan +
+
+ +
+
+
+
+
+
+ Pembiayaan Max Pelulus +
+
+ +
+ +
+
+
+
+
+ + + + + + + Batal + {{-- Batal --}} + +
+
+
+
+
+ + +
+
+ +@endsection \ No newline at end of file diff --git a/resources/views/gadaian/v1/index.blade.php b/resources/views/gadaian/v1/index.blade.php new file mode 100644 index 0000000..814a7dc --- /dev/null +++ b/resources/views/gadaian/v1/index.blade.php @@ -0,0 +1,1188 @@ +@extends('layouts.app') +@section('content') +@include('modal.editmarhun') + + +@php + if($customer_info['kpbaru'] != null){ + $noic = $customer_info['kpbaru']; + }else{ + $noic = $customer_info['kplama']; + } + $gadai_session = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/check/sag',['kodcaw'=>$cawangan_info['kodcaw'],'norujukan'=>$norujukan,'nokp'=>$noic])->json(); + $outstanding_semasa = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/gadai/customers/'. $noic .'/outstandingsemasa/'.$cawangan_info['kodcaw'])->json(); +@endphp + +@if($gadai_session != null) +
+
+
+ + + +
+ + + +
+
+
+
+
+
+ No Rujukan +
+
+ +
+
+
+
+
+
+ Baki Limit Pembiayaan +
+
+ @php + $limit_pinjaman_semasa = 300000 - $outstanding_semasa; + @endphp + +
+
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + +
BilRecnoMarhunNilai MarhunKaratBeratNotaHargaTindakan
Jumlah
+
+
+
+
+
+ + @csrf +
+
+
+
+ Pembiayaan Max +
+
+ +
+ +
+
+
+
+
+
+
+ Keuntungan Sebulan +
+
+ +
+
+
+
+
+
+
+
+
+
+ Pembiayaan +
+
+ +
+ 0 % +
+
+
+
+
+
+
+ Keuntungan 6 Bulan +
+
+ +
+
+
+
+
+
+ Pembiayaan Max Pelulus +
+
+ +
+ +
+
+
+
+
+ + + + + + + Batal + +
+
+
+
+
+ + +
+
+@else + @php + header("Refresh:0"); + @endphp +@endif + +@endsection \ No newline at end of file diff --git a/resources/views/gadaian/edit.blade.php b/resources/views/gadaian/v2/edit.blade.php similarity index 99% rename from resources/views/gadaian/edit.blade.php rename to resources/views/gadaian/v2/edit.blade.php index 209de72..91305b4 100644 --- a/resources/views/gadaian/edit.blade.php +++ b/resources/views/gadaian/v2/edit.blade.php @@ -460,6 +460,7 @@ 'pembiayaan' : parseFloat($('#pinjaman').val()), 'kadarujrah' : kadarupah, 'margin' : perpinjam, + 'kodcaw' : "{{ $cawangan_info['kodcaw'] }}" }, success:function(data){ array_keuntungan = data; @@ -637,6 +638,7 @@ 'pembiayaan' : parseFloat($('#pinjaman').val()), 'kadarujrah' : kadarupah, 'margin' : perpinjam, + 'kodcaw' : "{{ $cawangan_info['kodcaw'] }}" }, success:function(data){ array_keuntungan = data; diff --git a/resources/views/gadaian/index.blade.php b/resources/views/gadaian/v2/index.blade.php similarity index 99% rename from resources/views/gadaian/index.blade.php rename to resources/views/gadaian/v2/index.blade.php index 4901b21..4d3daa6 100644 --- a/resources/views/gadaian/index.blade.php +++ b/resources/views/gadaian/v2/index.blade.php @@ -109,14 +109,14 @@
- Keuntungan Sebulan + Pendapatan Sebulan
-
+
Ujrah @@ -126,10 +126,10 @@
-
+ {{--
-
+
--}}
@@ -146,17 +146,17 @@
- Keuntungan 6 Bulan + Pendapatan 6 Bulan
-
+
- One Percent + Keuntungan
@@ -484,6 +484,7 @@ 'pembiayaan' : pinjaman, 'kadarujrah' : kadarupah, 'margin' : percent_pinjaman, + 'kodcaw' : "{{ Auth::user()->cawangan }}" }, success:function(data){ array_keuntungan = data; diff --git a/resources/views/penebusan/index-khazanah.blade.php b/resources/views/penebusan/v1/index-khazanah.blade.php similarity index 99% rename from resources/views/penebusan/index-khazanah.blade.php rename to resources/views/penebusan/v1/index-khazanah.blade.php index 9044c0c..abceba5 100644 --- a/resources/views/penebusan/index-khazanah.blade.php +++ b/resources/views/penebusan/v1/index-khazanah.blade.php @@ -1077,4 +1077,4 @@ function ubahwakil(e) -@endsection +@endsection \ No newline at end of file diff --git a/resources/views/penebusan/v1/index.blade.php b/resources/views/penebusan/v1/index.blade.php new file mode 100644 index 0000000..3182922 --- /dev/null +++ b/resources/views/penebusan/v1/index.blade.php @@ -0,0 +1,3033 @@ +@extends('layouts.app') +@section('content') +@include('modal.historybayaran') +@include('modal.wakil') + + +
+
+
+ + + +
+ +
+
+
+ NAMA +
+
+ +
+
+
+
+
+
+ NO PELANGGGAN +
+
+ +
+
+
+
+
+
+ NO RUJUKAN +
+
+ +
+
+
+
+
+
+ NO KAD PENGENALAN +
+
+ +
+
+
+
+
+
+ JENIS TEBUS +
+
+ +
+
+
+
+
+
+ WAKIL +
+
+ +
+
+ +
+
+
+ +
+
+
+ TEMPOH +
+
+ +
+
+
+ +
+ +
+
+ + + + + + + + + + + + + + + @php $count = 0; @endphp + @foreach ($marhun as $index=>$m) + + @php + $karatbaru = str_replace('.','-',$m['karat']); + $hargabaru = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/harga_emas/'. $karatbaru)->json(); + + $hargaemassemasa = floatval($hargabaru['harga']) * floatval($m['berat']); + @endphp + + @php + $marhunperibadi = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/jemas/nama_marhun/',["marhun" => $m['marhun']])->json(); + @endphp + + + + + + + + + @php $count++; @endphp + @endforeach + + + + + + + + + +
BilMarhunN. MarhunN. Marhun SemasaBerat/gramKaratHargaHarga Semasa
{{ $index+1 }}{{ $marhunperibadi['descpt'] }}RM {{ number_format($m['n_marhun'],2) }}@php + echo "RM " . number_format($hargaemassemasa,2); + @endphp{{ $m['berat'] }}{{ $m['karat'] }}RM {{ $m['harga'] }}RM {{ number_format(floatval($hargabaru['harga']),2) }} @php if($m['harga'] > $hargabaru['harga']) echo ''; if($m['harga'] < $hargabaru['harga']) echo ''; + if($m['harga'] === $hargabaru['harga']) echo ''; + + @endphp
JUMLAHRM {{ number_format($gadai['nilaimarhun'],2) }}RM {{ number_format($nilaihargasemasa,2) }}{{ number_format($gadai['berat'],2) }}
+
+
+
+
+
+
+
+
+
+ BAKI HARGA JUALAN(RM) +
+
+ +
+
+
+
+ BAKI PEMBIAYAAN(RM) +
+
+ +
+
+
+ +
+
+
+ PEMBIAYAAN ASAL(RM) +
+
+ +
+
+
+
+ BAYARAN PEMBIAYAAN(RM) +
+
+ +
+
+
+ +
+
+
+ JUMLAH KEUNTUNGAN +
+
+ +
+
+ +
+
+ PEMBIAYAAN H. ASAL (RM) +
+ @php + if($gadai['bakipjm'] != 0){ + $bakipjm = $gadai['bakipjm']; + }else{ + $bakipjm = $gadai['pinjaman']; + } + $percent_asal = ($bakipjm / $gadai['nilaimarhun']) * 100; + @endphp +
+ +
+ {{ number_format($percent_asal,2) }} +
+
+
+ +
+
+ TELAH DIBAYAR(RM) +
+
+ +
+
+
+ +
+
+
+ BAYARAN PELANGGAN(RM) +
+
+ +
+
+
+
+ TAMBAH PEMBIAYAAN(RM) +
+
+ +
+
+ +
+
+
+
+ PERLU DIBAYAR(RM) +
+
+ +
+
+
+
+ BAYARAN MINIMA +
+
+ +
+
+
+ +
+
+
+ PEMBIAYAAN BARU(RM) +
+
+ +
+ +
+
+
+
+ +
+
+
+ PERLU DIBAYAR(RM) +
+
+ +
+
+
+ + +
+ +
+
+ PEMBIAYAAN BARU(RM) +
+ @php + if($gadai['bakipjm'] != 0){ + $bakipjm = $gadai['bakipjm']; + }else{ + $bakipjm = $gadai['pinjaman']; + } + $percent_hargaemassemasa = ($bakipjm / $nilaihargasemasa) * 100; + @endphp +
+ +
+ {{ number_format($percent_hargaemassemasa,2) }} +
+
+
+
+
+
+
+ BAYARAN DITERIMA(RM) +
+
+ +
+
+
+ + +
+ + +
+
+
+
+
+
+
+
+ + +@endsection \ No newline at end of file diff --git a/resources/views/penebusan/v2/index-khazanah.blade.php b/resources/views/penebusan/v2/index-khazanah.blade.php new file mode 100644 index 0000000..ec8b2db --- /dev/null +++ b/resources/views/penebusan/v2/index-khazanah.blade.php @@ -0,0 +1,1080 @@ +@extends('layouts.app') +@section('content') +@include('modal.historybayaran') +@include('modal.wakil') + + +
+
+
+ + + +
+ +
+
+
+ NAMA +
+
+ +
+
+
+
+
+
+ NO PELANGGGAN +
+
+ +
+
+
+
+
+
+ NO RUJUKAN +
+
+ +
+
+
+
+
+
+ NO KAD PENGENALAN +
+
+ +
+
+
+
+
+
+ JENIS TEBUS +
+
+ +
+
+
+ {{--
+
+
+ NO SIRI TEBUS +
+
+ +
+
+
--}} +
+ {{--
+
+ WAKIL +
+
+ +
+
+ +
+
--}} +
+
+ +
+
+ + + + + + + + + + + + + + + @php $count = 0; @endphp + @foreach ($marhun as $index=>$m) + + @php + $karatbaru = str_replace('.','-',$m['karat']); + $hargabaru = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/harga_emas/'. $karatbaru)->json(); + + $hargaemassemasa = floatval($hargabaru['harga']) * floatval($m['berat']); + @endphp + + @php + $marhunperibadi = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/jemas/nama_marhun/',["marhun" => $m['marhun']])->json(); + @endphp + + + + + + + + + @php $count++; @endphp + @endforeach + + + + + + + + + +
BilMarhunN. MarhunN. Marhun SemasaBerat/gramKaratHargaHarga Semasa
{{ $index+1 }}{{ $marhunperibadi['descpt'] }}RM {{ number_format($m['n_marhun'],2) }}@php + echo "RM " . number_format($hargaemassemasa,2); + @endphp{{ $m['berat'] }}{{ $m['karat'] }}RM {{ $m['harga'] }}RM {{ number_format(floatval($hargabaru['harga']),2) }} @php if($m['harga'] > $hargabaru['harga']) echo ''; if($m['harga'] < $hargabaru['harga']) echo ''; + if($m['harga'] === $hargabaru['harga']) echo ''; + + @endphp
JUMLAHRM {{ number_format($gadai['nilaimarhun'],2) }}RM {{ number_format($nilaihargasemasa,2) }}{{ number_format($gadai['berat'],2) }}
+
+
+ {{-- {{dd($gadai)}} --}} +
+
+
+
+ {{--
--}} +
+ +
+
+ BAKI HARGA JUALAN(RM) +
+
+ +
+
+ +
+
+ BAKI PEMBIAYAAN(RM) +
+
+ +
+
+
+ +
+ +
+
+ PEMBIAYAAN ASAL(RM) +
+
+ +
+
+
+ +
+
+
+ JUMLAH KEUNTUNGAN +
+
+ +
+
+ +
+
+ PEMBIAYAAN H. ASAL (RM) +
+ @php + $percent_asal = ($gadai['bakipjm'] / $gadai['nilaimarhun']) * 100; + @endphp +
+ +
+ {{ number_format($percent_asal,2) }} +
+
+
+ +
+
+ TELAH DIBAYAR(RM) +
+
+ +
+
+
+
+
+
+ BAYARAN PEMBIAYAAN(RM) +
+
+ +
+
+
+
+ TAMBAH PEMBIAYAAN(RM) +
+
+ +
+
+ +
+
+ +
+ +
+
+
+ PEMBIAYAAN BARU(RM) +
+
+ +
+ +
+
+
+
+ +
+
+
+ PERLU DIBAYAR(RM) +
+
+ +
+
+
+ + +
+ +
+
+ PEMBIAYAAN BARU(RM) +
+ @php + $percent_hargaemassemasa = ($gadai['bakipjm'] / $nilaihargasemasa) * 100; + @endphp +
+ +
+ {{ number_format($percent_hargaemassemasa,2) }} +
+
+
+
+
+
+
+ BAYARAN DITERIMA(RM) +
+
+ +
+
+
+ + +
+ +
+
+
+
+
+
+
+
+ + +@endsection diff --git a/resources/views/penebusan/index.blade.php b/resources/views/penebusan/v2/index.blade.php similarity index 97% rename from resources/views/penebusan/index.blade.php rename to resources/views/penebusan/v2/index.blade.php index fdeb0d9..592002e 100644 --- a/resources/views/penebusan/index.blade.php +++ b/resources/views/penebusan/v2/index.blade.php @@ -167,7 +167,7 @@
-
+
BAKI HARGA JUALAN(RM) @@ -206,9 +206,31 @@
+ @if($gadai['tagbaru'] == 1) +
+
+
+
+ UJRAH +
+
+ KEUNTUNGAN +
+ +
+
+ +
+ +
+
+ +
+
+ @endif
- JUMLAH KEUNTUNGAN + JUMLAH PENDAPATAN
@@ -564,16 +586,30 @@ let jeniskeuntungan = (tagbaru == 1) ? 'onepercent' : 'asal'; $.ajax({ method:'GET', - url: api + '/api/upahtawarruq/' + kodcaw + '/' + norujukan + '/' + jeniskeuntungan, + url: api + '/api/upahtawarruq/' + kodcaw + '/' + norujukan, + data: { + 'jeniskeuntungan' : jeniskeuntungan + }, dataType: 'json', success:function(data){ - $('#jumlahupah').val(data); + if(jeniskeuntungan == 'asal') + { + $('#jumlahupah').val(data); + }else{ + $('#jumlahupah').val(data['pendapatan']); + $('#jumujrah').val(data['ujrah']); + $('#jumonepercent').val(data['keuntungan']); + } + } }); $.ajax({ method:'GET', - url: api + '/api/upahrebettawarruq/' + kodcaw + '/' + norujukan + '/' + jeniskeuntungan, + url: api + '/api/upahrebettawarruq/' + kodcaw + '/' + norujukan, + data: { + 'jeniskeuntungan' : jeniskeuntungan + }, dataType: 'json', success:function(data){ $('#bayaranditerima').val(data); @@ -1176,6 +1212,7 @@ { $("#terima_transaksi").prop('disabled', true); var jumupah = parseFloat($('#jumlahupah').val().replace(/[^0-9.-]+/g,"")); + if($('#sltjenistebus').find(":selected").val() == 'T'){ var adadah = false; @@ -1257,7 +1294,16 @@ var nowakil = nw; var duitpelanggan = $('#duitPelanggan').val().replace(/[^0-9.-]+/g,""); var bakipelanggan = $('#bakiPelanggan').val().replace(/[^0-9.-]+/g,""); - console.log('test'); + + + if(duitpelanggan < bakipinjaman){ + Swal.fire('Amaran!','Duit Pelanggan haruslah diisi melebihi perlu dibayar!','error'); + $("#terima_transaksi").prop('disabled', false); + + event.preventDefault(); + return false; + } + $.ajax({ method:'get', datatype: 'json', @@ -1376,6 +1422,13 @@ var duitpelanggan = parseFloat($('#duitPelanggan').val().replace(/[^0-9.-]+/g,"")); var bakipelanggan = parseFloat($('#bakiPelanggan').val().replace(/[^0-9.-]+/g,"")); + if(duitpelanggan < bayar){ + Swal.fire('Amaran!','Duit Pelanggan haruslah diisi melebihi perlu dibayar!','error'); + $("#terima_transaksi").prop('disabled', false); + + event.preventDefault(); + return false; + } if(bayar < jumupah){ $("#terima_transaksi").prop('disabled', false); @@ -1411,7 +1464,7 @@ }, success:function(success_data){ - if(success_data != 'error'){ + if(success_data == 'success'){ var urlroute = '{{ route("resit.ansurans", ":id") }}'; urlroute = urlroute.replace(':id', norujukan); @@ -2177,20 +2230,31 @@ var pinjaman_baru = parseFloat($('#pinjamanbaru').val().replace(/[^0-9.-]+/g,"")); let lebihanmargin = parseFloat((nilaimargin) ? nilaimargin : 0); - total = keuntungan + lebihanmargin; + total = (jenisAT != 'hargalama') ? (keuntungan + lebihanmargin) : keuntungan; var marginsemasa = (jenisAT == 'hargalama') ? pinjaman_baru/nm * 100 : pinjaman_baru/nmsemasa * 100; + let texting = (jenisAT != 'hargalama') ? 'Bayaran harus melebihi keuntungan dan jumlah lebihan margin' : 'Bayaran harus melebihi keuntungan'; if(parseFloat($('#perludibayarAT').val()) < parseFloat(total.toFixed(2))){ Swal.fire({ icon: 'error', title: 'Ralat Bayaran!', - text: 'Bayaran harus melebihi keuntungan dan jumlah lebihan margin' + text: texting }); event.preventDefault(); return false; } + var duitpelanggan = parseFloat($('#duitPelanggan').val().replace(/[^0-9.-]+/g,"")); + + if(duitpelanggan < parseFloat($('#perludibayarAT').val())){ + Swal.fire('Amaran!','Duit Pelanggan haruslah diisi melebihi perlu dibayar!','error'); + $("#terima_transaksi").prop('disabled', false); + + event.preventDefault(); + return false; + } + $.ajax({ method:'get', url: api + '/api/komuditi/check', @@ -2501,6 +2565,7 @@ function gadaiautotawarruq() { + let jeniskeuntungan = (tagbaru == 1) ? 'onepercent' : 'asal'; var nopelanggan = "{{ $gadai['nopelanggan'] }}"; var jenistebus = 'T'; var jbg = "{{ $gadai['tempoh'] }}"; @@ -2575,7 +2640,7 @@ "nowakil" : nowakil, "jenisbayarantebus" : "nottawarruq", "teller" : teller, - + "jeniskeuntungan" : jeniskeuntungan, //yang baru "noic" : noic, @@ -3206,10 +3271,14 @@ function pembatalanbalik() function funcexcuse(toggle){ + + if(toggle){ let pembiayaan = parseFloat($('#hargapembiayaansemasa').val().replace(/[^0-9.-]+/g,"")); var jumupah = parseFloat($('#jumlahupah').val().replace(/[^0-9.-]+/g,"")); let percentasal = parseFloat('{{ number_format($percent_asal,2) }}'); + var nilai_marhun_lama = parseFloat("{{ $gadai['nilaimarhun'] }}"); + var bakipjm = parseFloat("{{ $gadai['bakipjm'] }}"); const swalWithBootstrapButtons = Swal.mixin({ customClass: { @@ -3262,9 +3331,9 @@ function funcexcuse(toggle){ "komen" : '', "margin" : marg, "berat" : ber, - "nilaimarhun" : nm, + "nilaimarhun" : nilai_marhun_lama, "status" : status, - "jumpinjam" : jumpinjam, + "jumpinjam" : bakipjm, "teller" : teller }, success:function(data){ @@ -3449,19 +3518,26 @@ function blockbayaranAT(event){ let value = $(event).val(); let upah = parseFloat($('#jumlahupah').val()); let pembiayaan = parseFloat("{{ $pembiayaanbaru }}"); + let pembiayaanlama = parseFloat("{{ $bakipjm }}"); let hargamarhun = parseFloat("{{ $nilaihargasemasa }}"); + let percentlama = parseFloat(" {{ $percent_asal }} "); totalpercent = (pembiayaan / hargamarhun) * 100; let nilaimargin = $('#txtlebihanmargin').val(); let lebihanmargin = parseFloat((nilaimargin) ? nilaimargin : 0); - total = upah + lebihanmargin; + total = (jenisAT != 'hargalama') ? (upah + lebihanmargin) : upah; if(value == '' || value <= 0 || value < total){ - $('#perludibayarAT').val(formatter.format(total)); - $('#pinjamanbaru').val(formatter.format(pembiayaan)); - $('#basic-addon2').text(formatter.format(totalpercent.toFixed(2))); - + if(jenisAT != 'hargalama'){ + $('#perludibayarAT').val(formatter.format(total)); + $('#pinjamanbaru').val(formatter.format(pembiayaan)); + $('#basic-addon2').text(formatter.format(totalpercent.toFixed(2))); + }else{ + $('#perludibayarAT').val(formatter.format(total)); + $('#pinjamanbaru').val(formatter.format(pembiayaanlama)); + $('#basic-addon2').text(formatter.format(percentlama.toFixed(2))); + } } }