update pembayaran
This commit is contained in:
@@ -47,7 +47,8 @@ class BayaranController extends Controller
|
||||
}
|
||||
|
||||
|
||||
return view('pembayaran.senaraibayaran', compact('belum_tebus'));
|
||||
// return view('pembayaran.senaraibayaran', compact('belum_tebus'));
|
||||
return view('includes.bayaran.senaraibayaransag', compact('belum_tebus'));
|
||||
}
|
||||
|
||||
public function PembayaranAction(Request $request)
|
||||
@@ -68,7 +69,8 @@ class BayaranController extends Controller
|
||||
}
|
||||
|
||||
|
||||
return view('pembayaran.checkout',compact('arraybayar'));
|
||||
// return view('pembayaran.checkout',compact('arraybayar'));
|
||||
return view('includes.bayaran.pembayaransag',compact('arraybayar'));
|
||||
}
|
||||
|
||||
public function PembayaranEngine(Request $request)
|
||||
|
||||
Vendored
+1
-1
@@ -6089,7 +6089,7 @@ fieldset:disabled .btn {
|
||||
}
|
||||
|
||||
.alert-danger {
|
||||
color: #922820;
|
||||
color: #fff;
|
||||
background-color: #fdd9d7;
|
||||
border-color: #fcc7c2;
|
||||
}
|
||||
|
||||
@@ -4,225 +4,229 @@
|
||||
|
||||
<title>Bayar SAG | Customer Portal</title>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item text-dark opacity-5"><a href="portalhome">Home</a></li>
|
||||
<li class="breadcrumb-item text-dark opacity-5"><a href="senaraibayaransag">Pembayaran</a></li>
|
||||
<li class="breadcrumb-item text-dark active" aria-current="page">Bayar SAG Pilihan</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-9 mb-5 mb-xl-0">
|
||||
<div class="card shadow">
|
||||
<div class="card-header border-0">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h4 class="mb-0">Senarai Surat Gadaian</h4>
|
||||
</div>
|
||||
<form method="post" action="{{ route('payment.engine') }}">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item text-dark opacity-5"><a href="portalhome">Home</a></li>
|
||||
<li class="breadcrumb-item text-dark opacity-5"><a href="senaraibayaransag">Pembayaran</a></li>
|
||||
<li class="breadcrumb-item text-dark active" aria-current="page">Bayar SAG Pilihan</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-9 mb-5 mb-xl-0">
|
||||
<div class="card shadow">
|
||||
<div class="card-header border-0">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h4 class="mb-0">Senarai Surat Gadaian</h4>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row justify-space-between py-2">
|
||||
<div class="col-lg-6 mx-auto">
|
||||
<div class="nav-wrapper position-relative end-0">
|
||||
<ul class="nav nav-pills nav-fill p-1" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-0 px-0 py-1 d-flex align-items-center justify-content-center active" data-bs-toggle="tab" href="#tabs-icons-text-1" role="tab" aria-controls="preview" aria-selected="true">
|
||||
<i class="material-icons text-sm me-2">person</i> Ar-Rahn
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-0 px-0 py-1 d-flex align-items-center justify-content-center" data-bs-toggle="tab" href="#tabs-icons-text-2" role="tab" aria-controls="code" aria-selected="false">
|
||||
<i class="material-icons text-sm me-2">dashboard</i> Tawarruq
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="tabs-icons-text-1" role="tabpanel" aria-labelledby="tabs-icons-text-1-tab">
|
||||
|
||||
<div class="table-responsive table-striped text-center">
|
||||
<table class="table align-items-center table-flush" id="belum_tawarruq">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>No.</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Tempoh Simpan</th>
|
||||
<th>Upah telah bayar</th>
|
||||
<th>Upah semasa</th>
|
||||
<th width="20%">Bayaran</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="list">
|
||||
{{-- @php $counter = 1;$jenisbayaran = 'arrahn'; @endphp
|
||||
<div class="row justify-space-between py-2">
|
||||
<div class="col-lg-6 mx-auto">
|
||||
<div class="nav-wrapper position-relative end-0">
|
||||
<ul class="nav nav-pills nav-fill p-1" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-0 px-0 py-1 d-flex align-items-center justify-content-center active" data-bs-toggle="tab" href="#tabs-icons-text-1" role="tab" aria-controls="preview" aria-selected="true">
|
||||
<i class="material-icons text-sm me-2">person</i> Ar-Rahn
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-0 px-0 py-1 d-flex align-items-center justify-content-center" data-bs-toggle="tab" href="#tabs-icons-text-2" role="tab" aria-controls="code" aria-selected="false">
|
||||
<i class="material-icons text-sm me-2">dashboard</i> Tawarruq
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-content" id="myTabContent">
|
||||
|
||||
<div class="tab-pane fade show active" id="tabs-icons-text-1" role="tabpanel" aria-labelledby="tabs-icons-text-1-tab">
|
||||
|
||||
<div class="table-responsive table-striped text-center">
|
||||
<table class="table align-items-center table-flush" id="belum_tawarruq">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>No.</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Tempoh Simpan</th>
|
||||
<th>Upah telah bayar</th>
|
||||
<th>Upah semasa</th>
|
||||
<th width="20%">Bayaran</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="list">
|
||||
@php $counter = 1;$jenisbayaran = 'arrahn'; @endphp
|
||||
@foreach($arraybayar as $index=>$bayar)
|
||||
@if($bayar['hargajualan'] == '')
|
||||
@php
|
||||
$koskeuntungan = Http::get(config('api.url') . '/api/upahbukantawarruq/' . $bayar['kodcaw'] . '/' . $bayar['norujukan'])->json();
|
||||
@endphp
|
||||
<tr>
|
||||
<td>
|
||||
{{ $counter }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $bayar['norujukan'] }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['pinjaman'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['tempoh'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['telahbayar'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($koskeuntungan,2) }}
|
||||
</td>
|
||||
<td>
|
||||
<select name="sltbayaran" class="form-control mb-2" data-upah="{{ $koskeuntungan }}" data-jenis="arrahn">
|
||||
<option selected disabled>Pilih Bayaran</option>
|
||||
<option value="fixed">Amaun Semasa</option>
|
||||
{{-- <option value="otheramount">Amaun Lain</option> --}}
|
||||
</select>
|
||||
|
||||
<input type="text" data-pinjaman="{{ $bayar['pinjaman'] }}" data-taglel="{{ $bayar['taglel'] }}" data-upah="{{ $koskeuntungan }}" data-nm="{{ $bayar['nilaimarhun'] }}" data-jenis="arrahn" name="txtbayaranarrahn" readonly class="form-control txtbayaran" />
|
||||
|
||||
<input type="hidden" name="txtbayaranhidden[]" class="bayaran" />
|
||||
<input type="hidden" name="txtupahhidden[]" value="{{ $koskeuntungan }}" />
|
||||
<input type="hidden" name="txtjbghidden[]" value="{{ $bayar['tempoh'] }}" />
|
||||
<input type="hidden" name="txtjenisbayaran[]" value="{{ $jenisbayaran }}" />
|
||||
<input type="hidden" name="txtnorujukanhidden[]" value="{{ $bayar['norujukan'] }}" />
|
||||
<input type="hidden" name="txtkodcawhidden[]" value="{{ $bayar['kodcaw'] }}" />
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="tabs-icons-text-2" role="tabpanel" aria-labelledby="tabs-icons-text-2-tab">
|
||||
|
||||
<div class="table-responsive table-striped text-center">
|
||||
<table class="table align-items-center table-flush" id="selepas_tawarruq">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Pembiayaan Asal</th>
|
||||
<th>B. Pembiayaan</th>
|
||||
<th>Tempoh</th>
|
||||
<th>Keuntungan</th>
|
||||
<th width="20%">Bayaran</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@php $counter = 1;$jenisbayaran = 'tawarruq'; @endphp
|
||||
@foreach($arraybayar as $index=>$bayar)
|
||||
@if($bayar['hargajualan'] == '')
|
||||
@php
|
||||
$koskeuntungan = Http::get(config('api.url') . '/api/upahbukantawarruq/' . $bayar['kodcaw'] . '/' . $bayar['norujukan'])->json();
|
||||
@endphp
|
||||
<tr>
|
||||
<td>
|
||||
{{ $counter }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $bayar['norujukan'] }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['pinjaman'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['tempoh'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['telahbayar'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($koskeuntungan,2) }}
|
||||
</td>
|
||||
<td>
|
||||
<select name="sltbayaran" class="form-control mb-2" data-upah="{{ $koskeuntungan }}" data-jenis="arrahn">
|
||||
<option selected disabled>Pilih Bayaran</option>
|
||||
<option value="fixed">Amaun Semasa</option>
|
||||
{{-- <option value="otheramount">Amaun Lain</option> --}}
|
||||
</select>
|
||||
@if($bayar['hargajualan'] != '')
|
||||
<tbody class="list">
|
||||
<tr>
|
||||
<td>
|
||||
{{ $counter }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $bayar['norujukan'] }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['pinjaman'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['bakipjm'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $bayar['tempoh'] }}
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$upahtawarruq = Http::get(config('api.url') . '/api/upahtawarruq/'. $bayar['kodcaw'] . '/' . $bayar['norujukan'])->json();
|
||||
@endphp
|
||||
{{ $upahtawarruq }}
|
||||
</td>
|
||||
<td>
|
||||
|
||||
{{-- <input type="text" data-pinjaman="{{ $bayar['pinjaman'] }}" data-taglel="{{ $bayar['taglel'] }}" data-upah="{{ $koskeuntungan }}" data-nm="{{ $bayar['nilaimarhun'] }}" data-jenis="arrahn" name="txtbayaranarrahn" readonly class="form-control txtbayaran" />
|
||||
<select name="sltbayaran" class="form-control mb-2" data-upah="{{ $upahtawarruq }}" data-jenis="tawarruq">
|
||||
<option selected disabled>Pilih Bayaran</option>
|
||||
<option value="fixed">Amaun Semasa</option>
|
||||
<option value="otheramount">Amaun Lain</option>
|
||||
</select>
|
||||
|
||||
<input type="hidden" name="txtbayaranhidden[]" class="bayaran" />
|
||||
<input type="hidden" name="txtupahhidden[]" value="{{ $koskeuntungan }}" />
|
||||
<input type="hidden" name="txtjbghidden[]" value="{{ $bayar['tempoh'] }}" />
|
||||
<input type="hidden" name="txtjenisbayaran[]" value="{{ $jenisbayaran }}" />
|
||||
<input type="hidden" name="txtnorujukanhidden[]" value="{{ $bayar['norujukan'] }}" />
|
||||
<input type="hidden" name="txtkodcawhidden[]" value="{{ $bayar['kodcaw'] }}" /> --}}
|
||||
</td>
|
||||
</tr>
|
||||
{{-- @php $counter++; @endphp
|
||||
@endif --}}
|
||||
{{-- @endforeach --}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" data-bakipjm="{{ $bayar['bakipjm'] }}" data-taglel="{{ $bayar['taglel'] }}" data-upah="{{ $upahtawarruq }}" data-nm="{{ $bayar['nilaimarhun'] }}" data-jenis="tawarruq" name="txtbayarantawarruq" readonly class="form-control txtbayaran" />
|
||||
|
||||
<div class="tab-pane fade" id="tabs-icons-text-2" role="tabpanel" aria-labelledby="tabs-icons-text-2-tab">
|
||||
<input type="hidden" name="txtbayaranhidden[]" class="bayaran" />
|
||||
<input type="hidden" name="txtjenisbayaran[]" value="{{ $jenisbayaran }}" />
|
||||
<input type="hidden" name="txtnorujukanhidden[]" value="{{ $bayar['norujukan'] }}" />
|
||||
<input type="hidden" name="txtkodcawhidden[]" value="{{ $bayar['kodcaw'] }}" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@php $counter++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive table-striped text-center">
|
||||
<table class="table align-items-center table-flush" id="selepas_tawarruq">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Pembiayaan Asal</th>
|
||||
<th>B. Pembiayaan</th>
|
||||
<th>Tempoh</th>
|
||||
<th>Keuntungan</th>
|
||||
<th width="20%">Bayaran</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{-- @php $counter = 1;$jenisbayaran = 'tawarruq'; @endphp
|
||||
@foreach($arraybayar as $index=>$bayar)
|
||||
@if($bayar['hargajualan'] != '')
|
||||
<tbody class="list">
|
||||
<tr>
|
||||
<td>
|
||||
{{ $counter }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $bayar['norujukan'] }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['pinjaman'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['bakipjm'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $bayar['tempoh'] }}
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$upahtawarruq = Http::get(config('api.url') . '/api/upahtawarruq/'. $bayar['kodcaw'] . '/' . $bayar['norujukan'])->json();
|
||||
@endphp
|
||||
{{ $upahtawarruq }}
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<select name="sltbayaran" class="form-control mb-2" data-upah="{{ $upahtawarruq }}" data-jenis="tawarruq">
|
||||
<option selected disabled>Pilih Bayaran</option>
|
||||
<option value="fixed">Amaun Semasa</option>
|
||||
<option value="otheramount">Amaun Lain</option>
|
||||
</select>
|
||||
|
||||
<input type="text" data-bakipjm="{{ $bayar['bakipjm'] }}" data-taglel="{{ $bayar['taglel'] }}" data-upah="{{ $upahtawarruq }}" data-nm="{{ $bayar['nilaimarhun'] }}" data-jenis="tawarruq" name="txtbayarantawarruq" readonly class="form-control txtbayaran" />
|
||||
|
||||
<input type="hidden" name="txtbayaranhidden[]" class="bayaran" />
|
||||
<input type="hidden" name="txtjenisbayaran[]" value="{{ $jenisbayaran }}" />
|
||||
<input type="hidden" name="txtnorujukanhidden[]" value="{{ $bayar['norujukan'] }}" />
|
||||
<input type="hidden" name="txtkodcawhidden[]" value="{{ $bayar['kodcaw'] }}" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@php $counter++; @endphp
|
||||
@endif
|
||||
@endforeach --}}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card shadow">
|
||||
<div class="card-header border-0">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h4 class="mb-0">Ringkasan Pembayaran</h4>
|
||||
<div class="col-xl-3">
|
||||
<div class="card shadow">
|
||||
<div class="card-header border-0">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h4 class="mb-0">Ringkasan Pembayaran</h4>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<i class="fas fa-shopping-cart fa-2x"></i>
|
||||
</div>
|
||||
<hr />
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<i class="fas fa-shopping-cart fa-2x"></i>
|
||||
</div>
|
||||
|
||||
<div class="form" style="text-align: center;">
|
||||
|
||||
<div class="row mb-4 font-weight-light">
|
||||
<div class="col-7">
|
||||
<label class="text-dark ml-4 ">Bayaran Ar-Rahn</label>
|
||||
</div>
|
||||
|
||||
<div class="col-5 text-right pr-5">
|
||||
<span>RM <span id="spanbayaranarrahn">0.00</span></span>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form" style="text-align: center;">
|
||||
<div class="row mb--4 font-weight-light">
|
||||
<div class="col-7">
|
||||
<label class="text-dark ml-4 ">Bayaran Tawarruq</label>
|
||||
</div>
|
||||
|
||||
<div class="row mb-4 font-weight-light">
|
||||
<div class="col-7">
|
||||
<label class="text-dark ml-4 ">Bayaran Ar-Rahn</label>
|
||||
<div class="col-5 text-right pr-5">
|
||||
<span>RM <span id="spanbayarantawarruq">0.00</span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-5 text-right pr-5">
|
||||
<span>RM <span id="spanbayaranarrahn">0.00</span></span>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div class="row mb--4 font-weight-light">
|
||||
<div class="col-7">
|
||||
<label class="text-dark ml-4 ">Bayaran Tawarruq</label>
|
||||
</div>
|
||||
|
||||
<div class="col-5 text-right pr-5">
|
||||
<span>RM <span id="spanbayarantawarruq">0.00</span></span>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<hr />
|
||||
|
||||
|
||||
{{-- <div class="row mb--4 font-weight-light">
|
||||
{{-- <div class="row mb--4 font-weight-light">
|
||||
<div class="col-7">
|
||||
<label class="text-dark ml-4">Keuntungan</label>
|
||||
</div>
|
||||
@@ -234,27 +238,189 @@
|
||||
<hr/> --}}
|
||||
|
||||
|
||||
<div class="row pb-4 font-weight-light">
|
||||
<div class="col-7">
|
||||
<label class="text-dark ml-4">Jumlah Keseluruhan</label>
|
||||
</div>
|
||||
<div class="row pb-4 font-weight-light">
|
||||
<div class="col-7">
|
||||
<label class="text-dark ml-4">Jumlah Keseluruhan</label>
|
||||
</div>
|
||||
|
||||
<div class="col-5 text-right pr-5">
|
||||
<span>RM <span id="spanjumlah">0.00</span></span>
|
||||
<div class="col-5 text-right pr-5">
|
||||
<span>RM <span id="spanjumlah">0.00</span></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="d-flex justify-content-end col-12 mt-3 align-self-end">
|
||||
<button type="submit" id="bayarsbmt" class="btn btn-primary" disabled onclick="loadingbtn();">Bayar</button>
|
||||
<div class="d-flex justify-content-end col-12 mt-3 align-self-end">
|
||||
<button type="submit" id="bayarsbmt" class="btn btn-primary" disabled onclick="loadingbtn();">Bayar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const formatter = new Intl.NumberFormat('en-US', {
|
||||
minimumFractionDigits: 2
|
||||
});
|
||||
|
||||
var belumtawarruqtable = $('#belum_tawarruq').DataTable({
|
||||
"bLengthChange": false,
|
||||
"bFilter": false,
|
||||
"bInfo": false,
|
||||
language: {
|
||||
'paginate': {
|
||||
'previous': '<span class="fas fa-backward"></span>',
|
||||
'next': '<span class="fas fa-forward"></span>'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var selepastawarruqtable = $('#selepas_tawarruq').DataTable({
|
||||
"bLengthChange": false,
|
||||
"bFilter": false,
|
||||
"bInfo": false,
|
||||
language: {
|
||||
'paginate': {
|
||||
'previous': '<span class="fas fa-backward"></span>',
|
||||
'next': '<span class="fas fa-forward"></span>'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function validateform() {
|
||||
return false;
|
||||
}
|
||||
|
||||
let total = 0;
|
||||
|
||||
$("select[name=sltbayaran]").change(function(e) {
|
||||
let selected = $('option:selected', this).attr('value');
|
||||
let jenis = $(this).data('jenis');
|
||||
let upah = $(this).data('upah');
|
||||
let taglel = $(this).data('taglel');
|
||||
|
||||
if (selected === 'fixed') {
|
||||
$(this).closest('tr').find("input").attr('readonly', true);
|
||||
$(this).closest('tr').find(".txtbayaran").val(upah);
|
||||
$(this).closest('tr').find(".bayaran").val(upah);
|
||||
calculateall(jenis, taglel);
|
||||
|
||||
} else {
|
||||
// $(this).closest('tr').find("input").val();
|
||||
$(this).closest('tr').find("input").attr('readonly', false);
|
||||
calculateall(jenis, taglel);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name=txtbayaranarrahn]").change(function(e) {
|
||||
|
||||
let upah = $(this).data('upah');
|
||||
let pinjaman = $(this).data('pinjaman');
|
||||
let jenis = $(this).data('jenis');
|
||||
let nm = $(this).data('nm');
|
||||
let taglel = $(this).data('taglel');
|
||||
|
||||
let bayar = Number(this.value);
|
||||
|
||||
let errorlebih = nm - (nm * 0.1);
|
||||
|
||||
if (bayar > parseFloat(errorlebih)) {
|
||||
$("#bayarsbmt").prop('disabled', false);
|
||||
Swal.fire(
|
||||
'Amaran!',
|
||||
'Bayaran tidak boleh melebihi 10% nilai marhun!',
|
||||
'error'
|
||||
)
|
||||
$(this).val(upah);
|
||||
$(this).closest('tr').find('.bayaran').val(upah);
|
||||
calculateall(jenis, taglel);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$(this).closest('tr').find('.bayaran').val(this.value);
|
||||
calculateall(jenis, taglel);
|
||||
|
||||
});
|
||||
|
||||
$("input[name=txtbayarantawarruq]").change(function(e) {
|
||||
|
||||
let upah = $(this).data('upah');
|
||||
let bakipinjam = $(this).data('bakipjm');
|
||||
let jenis = $(this).data('jenis');
|
||||
let nm = $(this).data('nm');
|
||||
let taglel = $(this).data('taglel');
|
||||
|
||||
let bayar = Number(this.value);
|
||||
|
||||
let errorlebih = (bakipinjam - (nm * 0.1));
|
||||
|
||||
if (bayar > parseFloat(errorlebih)) {
|
||||
$("#bayarsbmt").prop('disabled', false);
|
||||
Swal.fire(
|
||||
'Amaran!',
|
||||
'Bayaran tidak boleh melebihi 10% nilai marhun!',
|
||||
'error'
|
||||
)
|
||||
$(this).val(upah);
|
||||
$(this).closest('tr').find('.bayaran').val(upah);
|
||||
calculateall(jenis, taglel);
|
||||
return false;
|
||||
}
|
||||
|
||||
$(this).closest('tr').find('.bayaran').val(this.value);
|
||||
calculateall(jenis, taglel);
|
||||
});
|
||||
|
||||
function calculateall(jenis, taglel) {
|
||||
var $row = $(this).closest('tr');
|
||||
var sumarrahn = 0;
|
||||
var sumtawarruq = 0;
|
||||
var sum = 0;
|
||||
var counterrorbayar = 0;
|
||||
|
||||
$('#belum_tawarruq').find('input[name=txtbayaranarrahn]').each(function() {
|
||||
sumarrahn += parseFloat(this.value) || 0;
|
||||
|
||||
if (this.value <= 0 || this.value == '') {
|
||||
counterrorbayar++;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#selepas_tawarruq').find('input[name=txtbayarantawarruq]').each(function() {
|
||||
sumtawarruq += parseFloat(this.value) || 0;
|
||||
|
||||
if (this.value <= 0 || this.value == '') {
|
||||
counterrorbayar++;
|
||||
}
|
||||
});
|
||||
|
||||
sum = sumarrahn + sumtawarruq;
|
||||
|
||||
if (counterrorbayar > 0) {
|
||||
$("#bayarsbmt").prop('disabled', true);
|
||||
} else {
|
||||
$("#bayarsbmt").prop('disabled', false);
|
||||
}
|
||||
|
||||
$("#spanbayaranarrahn").text(sumarrahn.toFixed(2));
|
||||
$("#spanbayarantawarruq").text(sumtawarruq.toFixed(2));
|
||||
$('#spanjumlah').text(formatter.format(sum));
|
||||
}
|
||||
|
||||
if (document.addEventListener) {
|
||||
window.addEventListener('pageshow', function(event) {
|
||||
if (event.persisted || window.performance && window.performance.navigation.type == 2) {
|
||||
$('#logout-form').submit();
|
||||
// location.reload();
|
||||
}
|
||||
},
|
||||
false);
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -3,6 +3,28 @@
|
||||
@section('content')
|
||||
@include('modal.marhun')
|
||||
|
||||
@error('chkboxsag')
|
||||
<script>
|
||||
$.notify({
|
||||
icon: 'fas fa-exclamation-triangle fa-2x',
|
||||
newest_on_top: true,
|
||||
message: "<strong style='font-size:15px;'>Sila pilih salah satu checkbox di atas terlebih dahulu!</strong>"
|
||||
}, {
|
||||
type: 'danger',
|
||||
allow_dismiss: false,
|
||||
placement: {
|
||||
align: 'center',
|
||||
from: 'bottom'
|
||||
},
|
||||
animate: {
|
||||
enter: 'animate__animated animate__bounce',
|
||||
|
||||
exit: 'animate__animated animate__bounceOutDown'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@enderror
|
||||
|
||||
<title>Pembayaran | Customer Portal</title>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
@@ -20,12 +42,12 @@
|
||||
<div class="nav-wrapper position-relative end-0">
|
||||
<ul class="nav nav-pills nav-fill p-1" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-0 px-0 py-1 d-flex align-items-center justify-content-center active" data-bs-toggle="tab" href="#arrahn" role="tab" aria-controls="preview" aria-selected="true">
|
||||
<a class="nav-link mb-0 px-0 py-1 d-flex align-items-center justify-content-center active" data-bs-toggle="tab" href="#tabs-icons-text-1" role="tab" aria-controls="preview" aria-selected="true">
|
||||
<i class="material-icons text-sm me-2">person</i> Ar-Rahn
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-0 px-0 py-1 d-flex align-items-center justify-content-center" data-bs-toggle="tab" href="#tawarruq" role="tab" aria-controls="code" aria-selected="false">
|
||||
<a class="nav-link mb-0 px-0 py-1 d-flex align-items-center justify-content-center" data-bs-toggle="tab" href="#tabs-icons-text-2" role="tab" aria-controls="code" aria-selected="false">
|
||||
<i class="material-icons text-sm me-2">dashboard</i> Tawarruq
|
||||
</a>
|
||||
</li>
|
||||
@@ -36,82 +58,268 @@
|
||||
|
||||
<div class="container col-11 shadow-lg p-3 bg-white rounded">
|
||||
<div class="tab-content tab-space">
|
||||
<div class="tab-pane active" id="arrahn">
|
||||
<form id="contact-form" method="#" autocomplete="off">
|
||||
<div class="card-header border-0">
|
||||
<h5 class="mb-0">Ar-Rahn</h5>
|
||||
</div>
|
||||
<div class="table-responsive table-bordered">
|
||||
<table class="table align-items-center table-flush" id="arrahn">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th scope="col" class="sort" data-sort="name">No Rujukan</th>
|
||||
<th scope="col" class="sort" data-sort="budget">Pinjaman</th>
|
||||
<th scope="col" class="sort" data-sort="budget">N. Marhun</th>
|
||||
<th scope="col" class="sort" data-sort="budget">Berat(gm)</th>
|
||||
<th scope="col" class="sort" data-sort="budget">JBG</th>
|
||||
<th scope="col" class="sort" data-sort="budget">Upah</th>
|
||||
<th scope="col" class="sort" data-sort="budget">J.Tebus</th>
|
||||
<th scope="col" class="sort" data-sort="budget">T.Tebus</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="list">
|
||||
<tr style="text-align: center;">
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<form method="post" action="{{ route('payment.action') }}" onsubmit="return validateform()">
|
||||
@csrf
|
||||
<div class="card shadow">
|
||||
<div class="card-body">
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="tabs-icons-text-1" role="tabpanel" aria-labelledby="tabs-icons-text-1-tab">
|
||||
<div class="table-responsive table-bordered table-hover">
|
||||
<table class="table align-items-center table-flush" id="belum_tawarruq" style="text-align: center;">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Tempoh Simpan</th>
|
||||
<th>Upah telah bayar</th>
|
||||
<th>Upah semasa</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="list">
|
||||
@foreach($belum_tebus as $index=>$bt)
|
||||
@if($bt['hargajualan'] == '')
|
||||
@php
|
||||
|
||||
</div>
|
||||
<div class="tab-pane" id="tawarruq">
|
||||
<form id="contact-form" method="#" autocomplete="off">
|
||||
<div class="card-header border-0">
|
||||
<h5 class="mb-0">Tawarruq</h5>
|
||||
</div>
|
||||
<div class="table-responsive table-bordered">
|
||||
<table class="table align-items-center table-flush" id="arrahn">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th scope="col" class="sort" data-sort="name">No Rujukan</th>
|
||||
<th scope="col" class="sort" data-sort="budget">Pinjaman</th>
|
||||
<th scope="col" class="sort" data-sort="budget">N. Marhun</th>
|
||||
<th scope="col" class="sort" data-sort="budget">Berat(gm)</th>
|
||||
<th scope="col" class="sort" data-sort="budget">JBG</th>
|
||||
<th scope="col" class="sort" data-sort="budget">Upah</th>
|
||||
<th scope="col" class="sort" data-sort="budget">J.Tebus</th>
|
||||
<th scope="col" class="sort" data-sort="budget">T.Tebus</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="list">
|
||||
<tr style="text-align: center;">
|
||||
<td>12122</td>
|
||||
<td>12122</td>
|
||||
<td>12122</td>
|
||||
<td>12122</td>
|
||||
<td>12122</td>
|
||||
<td>12122</td>
|
||||
<td>12122</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="d-flex flex-row-reverse">
|
||||
<a type="button" class="btn bg-gradient-primary w-auto me-2" href="bayarsag">Checkout</a>
|
||||
</div>
|
||||
$koskeuntungan = Http::get(config('api.url') . '/api/upahbukantawarruq/' . $bt['kodcaw'] . '/' . $bt['norujukan'])->json();
|
||||
$searchonline = Http::get(config('api.url') . '/portal/searchsagonline/',['norujukan' => $bt['norujukan']])->json();
|
||||
|
||||
$searchLelong = Http::get(config('api.url').'/api/search/lelong',[
|
||||
'kodcaw' => $bt['kodcaw'],
|
||||
'norujukan' => $bt['norujukan']
|
||||
])->json();
|
||||
|
||||
$tarikh_hari_ini = Carbon\Carbon::now()->toDateString();
|
||||
|
||||
if($searchLelong){
|
||||
$t_lelong = Carbon\Carbon::parse($searchLelong['t_lelong'].' 00:00:00');
|
||||
$tarikhini = Carbon\Carbon::parse($tarikh_hari_ini.' 00:00:00');
|
||||
$diff=date_diff($tarikhini,$t_lelong);
|
||||
$diff = (int)$diff->format("%R%a");
|
||||
if($diff <= 2){ // 'messageamaran'=>'Rekod Gadaian Dalam Proses Lelong, Sila Hadir ke Cawangan.'
|
||||
}elseif($searchLelong['t_jual'] != null && $searchLelong['hargajual'] != 0.00){
|
||||
// 'messageamaran'=>'Rekod Gadaian Telah Dilelong.'
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
<tr {{ ($searchonline) ? 'style=background-color:#81ecec;' : '' }}>
|
||||
<td>
|
||||
<input type="checkbox" name="chkboxsag[]" value="{{ $bt['norujukan'] }}" id="sag-{{ $loop->iteration }}" data-norujukan="{{ $bt['norujukan'] }}" {{ ($searchonline || $koskeuntungan <= 0) ? 'disabled' : '' }} />
|
||||
</td>
|
||||
<td scope="row">
|
||||
<div class="media align-items-center">
|
||||
<div class="media-body">
|
||||
@php
|
||||
$marhun = Http::get(config('api.url') . '/api/marhun/' . $bt['norujukan'] )->json();
|
||||
@endphp
|
||||
<a href="#" class="linktarget" data-toggle="modal" data-marhun="{{ json_encode($marhun) }}" data-pinjaman="{{$bt['pinjaman']}}" data-norujukan="{{$bt['norujukan']}}" data-hargajualan="{{$bt['hargajualan']}}" data-kodcaw="{{ $bt['kodcaw'] }}" data-target="#marhunModal"><span class="name mb-0 text-sm">{{ $bt['norujukan'] }}</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bt['pinjaman'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bt['tempoh'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bt['telahbayar'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($koskeuntungan,2) }}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="tabs-icons-text-2" role="tabpanel" aria-labelledby="tabs-icons-text-2-tab">
|
||||
|
||||
<!-- Light table -->
|
||||
<div class="table-responsive table-bordered table-hover">
|
||||
<table class="table align-items-center table-flush" id="selepas_tawarruq" style="text-align: center;">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>B. Pembiayaan</th>
|
||||
<th>Keuntungan (6bulan)</th>
|
||||
<th>Keuntungan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="list">
|
||||
@foreach($belum_tebus as $index=>$bt)
|
||||
@if($bt['hargajualan'] != '')
|
||||
@php
|
||||
$searchonline = Http::get(config('api.url') . '/portal/searchsagonline/',['norujukan' => $bt['norujukan']])->json();
|
||||
|
||||
$searchLelong = Http::get(config('api.url').'/api/search/lelong',[
|
||||
'kodcaw' => $bt['kodcaw'],
|
||||
'norujukan' => $bt['norujukan']
|
||||
])->json();
|
||||
|
||||
if($searchLelong){
|
||||
$t_lelong = Carbon\Carbon::parse($searchLelong['t_lelong'].' 00:00:00');
|
||||
$tarikhini = Carbon\Carbon::parse($tarikh_hari_ini.' 00:00:00');
|
||||
$diff=date_diff($tarikhini,$t_lelong);
|
||||
$diff = (int)$diff->format("%R%a");
|
||||
if($diff <= 2){ // 'messageamaran'=>'Rekod Gadaian Dalam Proses Lelong, Sila Hadir ke Cawangan.'
|
||||
}elseif($searchLelong['t_jual'] != null && $searchLelong['hargajual'] != 0.00){
|
||||
// 'messageamaran'=>'Rekod Gadaian Telah Dilelong.'
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$koskeuntungan = Http::get(config('api.url') . '/api/upahtawarruq/' . $bt['kodcaw'] . '/' . $bt['norujukan'])->json();
|
||||
$keuntungan_1bln = $bt['pinjaman'] * ($bt['kadarupah'] / 100);
|
||||
$ten_percent = floatval($bt['nilaimarhun']) * 0.1;
|
||||
$baki_pinjaman = floatval($bt['bakipjm']);
|
||||
$max_bayaran = $baki_pinjaman - $ten_percent;
|
||||
@endphp
|
||||
<tr {{ ($searchonline) ? 'style=background-color:#81ecec;' : '' }}>
|
||||
<td>
|
||||
<input type="checkbox" name="chkboxsag[]" value="{{ $bt['norujukan'] }}" id="sag-{{ $loop->iteration }}" data-norujukan="{{ $bt['norujukan'] }}" {{ ($searchonline || $koskeuntungan <= 0) ? 'disabled' : '' }} />
|
||||
{{-- <i data-toggle="tooltip" title="Hooray!" class="fas fa-exclamation-circle ml-3 text-right" style="font-size: 20px;"></i> --}}
|
||||
</td>
|
||||
<th scope="row">
|
||||
<div class="media align-items-center">
|
||||
<div class="media-body">
|
||||
@php
|
||||
$marhun = Http::get(config('api.url') . '/api/marhun/' . $bt['norujukan'] )->json();
|
||||
@endphp
|
||||
<a href="#" class="linktarget" data-toggle="modal" data-marhun="{{ json_encode($marhun) }}" data-pinjaman="{{$bt['pinjaman']}}" data-norujukan="{{$bt['norujukan']}}" data-hargajualan="{{$bt['hargajualan']}}" data-kodcaw="{{ $bt['kodcaw'] }}" data-target="#marhunModal"><span class="name mb-0 text-sm">{{ $bt['norujukan'] }}</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</th>
|
||||
<td>
|
||||
{{ number_format($bt['pinjaman'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bt['bakipjm'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bt['bakiupah'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($koskeuntungan,2) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end mt-2">
|
||||
<button type="submit" class="btn btn-primary" onclick="loadingbtn();">Checkout <span class="rounded bg-red ml-2 pr-1 pl-1" id="totalsag">0</span></button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var belumtawarruqtable = $('#belum_tawarruq').DataTable({
|
||||
"bLengthChange": false,
|
||||
"bFilter": true,
|
||||
"bInfo": false,
|
||||
language: {
|
||||
'paginate': {
|
||||
'previous': '<span class="fas fa-backward"></span>',
|
||||
'next': '<span class="fas fa-forward"></span>'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var selepastawarruqtable = $('#selepas_tawarruq').DataTable({
|
||||
"bLengthChange": false,
|
||||
"bFilter": true,
|
||||
"bInfo": false,
|
||||
language: {
|
||||
'paginate': {
|
||||
'previous': '<span class="fas fa-backward"></span>',
|
||||
'next': '<span class="fas fa-forward"></span>'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("input[type='checkbox'][name='chkboxsag[]']").click(function() {
|
||||
var count = parseInt($('#totalsag').text());
|
||||
if ($(this).is(':checked')) {
|
||||
var total = count + 1;
|
||||
$('#totalsag').text(total);
|
||||
} else {
|
||||
var total = count - 1;
|
||||
$('#totalsag').text(total);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function validateform() {
|
||||
return true;
|
||||
}
|
||||
|
||||
var api_url = "{{ config('api.url') }}";
|
||||
|
||||
$('.linktarget').on('click', function(event) {
|
||||
|
||||
var arraymarhun = $(this).data('marhun');
|
||||
var norujukan = $(this).data('norujukan');
|
||||
var kodcaw = $(this).data('kodcaw');
|
||||
var hargajualan = $(this).data('hargajualan');
|
||||
var pinjaman = $(this).data('pinjaman');
|
||||
|
||||
$('#norujukan_modal').val(norujukan);
|
||||
$('#pinjaman_modal').val(pinjaman);
|
||||
$('#tablemarhun').empty();
|
||||
var bil_count = 0;
|
||||
$.each(arraymarhun, function(index, marhun) {
|
||||
$.each(marhun, function(index2, marhun_detail) {
|
||||
|
||||
var marhun_name;
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: api_url + '/api/jemas/nama_marhun',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
marhun: marhun_detail['marhun']
|
||||
},
|
||||
success: function(marhun_ajax) {
|
||||
bil_count++;
|
||||
$("#tablemarhun").append("<tr><td>" + bil_count + "</td><td>" + marhun_ajax['descpt'] + "</td><td>" + marhun_detail['berat'] + "</td><td>" + marhun_detail['karat'] + "</td><td>RM " + marhun_detail['n_marhun'].toLocaleString(undefined, {
|
||||
minimumFractionDigits: 2
|
||||
}) + "</td><td>" + marhun_detail['nota'] + "</td></tr>");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
if (document.addEventListener) {
|
||||
window.addEventListener('pageshow', function(event) {
|
||||
if (event.persisted || window.performance && window.performance.navigation.type == 2) {
|
||||
$('#logout-form').submit();
|
||||
// location.reload();
|
||||
}
|
||||
},
|
||||
false);
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('argon') }}/vendor/chart.js/dist/Chart.min.js"></script>
|
||||
<script src="{{ asset('argon') }}/vendor/chart.js/dist/Chart.extension.js"></script>
|
||||
@endpush
|
||||
@@ -157,7 +157,25 @@
|
||||
<script src="{{ asset('assets/js/material-kit/material-kit.min.js?v=3.0.0') }}" type="text/javascript"></script>
|
||||
|
||||
<script>
|
||||
// listen for scroll event and call animate function
|
||||
document.addEventListener('scroll', animate);
|
||||
|
||||
|
||||
|
||||
var animateComplete = true;
|
||||
// animate element when it is in view
|
||||
function animate() {}
|
||||
|
||||
if (document.getElementById('typed')) {
|
||||
var typed = new Typed("#typed", {
|
||||
stringsElement: '#typed-strings',
|
||||
typeSpeed: 90,
|
||||
backSpeed: 90,
|
||||
backDelay: 200,
|
||||
startDelay: 500,
|
||||
loop: true
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
if (document.getElementsByClassName('page-header')) {
|
||||
@@ -165,7 +183,7 @@
|
||||
var scrollPosition = window.pageYOffset;
|
||||
var bgParallax = document.querySelector('.page-header');
|
||||
var oVal = (window.scrollY / 3);
|
||||
bgParallax.style.transform = 'translate3d(0,' + oVal + 'px,0)';
|
||||
// bgParallax.style.transform = 'translate3d(0,' + oVal + 'px,0)';
|
||||
}, 6);
|
||||
}
|
||||
</script>
|
||||
@@ -164,7 +164,7 @@
|
||||
var scrollPosition = window.pageYOffset;
|
||||
var bgParallax = document.querySelector('.page-header');
|
||||
var oVal = (window.scrollY / 3);
|
||||
bgParallax.style.transform = 'translate3d(0,' + oVal + 'px,0)';
|
||||
// bgParallax.style.transform = 'translate3d(0,' + oVal + 'px,0)';
|
||||
}, 6);
|
||||
}
|
||||
</script>
|
||||
@@ -25,3 +25,4 @@
|
||||
|
||||
<script src="{{ asset('argon') }}/vendor/jquery/dist/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js"></script>
|
||||
<script src="{{ asset('argon') }}/js/bootstrap-notify.js"></script>
|
||||
@@ -1,238 +1,238 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
@include('layouts.headers.cards')
|
||||
@include('layouts.headers.cards')
|
||||
|
||||
<!-- Header -->
|
||||
<div class="header bg-primary pb-6">
|
||||
<div class="container-fluid">
|
||||
<div class="header-body">
|
||||
<div class="row align-items-center py-4">
|
||||
<div class="col-lg-6 col-7">
|
||||
<!-- Header -->
|
||||
<div class="header bg-primary pb-6">
|
||||
<div class="container-fluid">
|
||||
<div class="header-body">
|
||||
<div class="row align-items-center py-4">
|
||||
<div class="col-lg-6 col-7">
|
||||
|
||||
<nav aria-label="breadcrumb" class="d-none d-md-inline-block ml-md-4">
|
||||
<ol class="breadcrumb breadcrumb-links breadcrumb-dark">
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}"><i class="fas fa-home"></i></a></li>
|
||||
<li class="breadcrumb-item"><a href="#">Semak SAG</a></li>
|
||||
<li class="breadcrumb-item"><a href="#">Senarai SAG</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Checkout</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<nav aria-label="breadcrumb" class="d-none d-md-inline-block ml-md-4">
|
||||
<ol class="breadcrumb breadcrumb-links breadcrumb-dark">
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}"><i class="fas fa-home"></i></a></li>
|
||||
<li class="breadcrumb-item"><a href="#">Semak SAG</a></li>
|
||||
<li class="breadcrumb-item"><a href="#">Senarai SAG</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Checkout</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Page content -->
|
||||
<div class="container-fluid mt--6">
|
||||
</div>
|
||||
</div>
|
||||
<!-- Page content -->
|
||||
<div class="container-fluid mt--6">
|
||||
|
||||
<form method="post" action="{{ route('payment.engine') }}">
|
||||
@csrf
|
||||
<form method="post" action="{{ route('payment.engine') }}">
|
||||
@csrf
|
||||
|
||||
<div class="row mt-5">
|
||||
<div class="col-xl-8 mb-5 mb-xl-0">
|
||||
<div class="card shadow">
|
||||
<div class="card-header border-0">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h3 class="mb-0">Senarai Surat Gadaian</h3>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<i class="fas fa-list-alt fa-2x"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nav-wrapper">
|
||||
<ul class="nav nav-pills ml-2" id="tabs-icons-text" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-sm-3 mb-md-0 active" id="tabs-icons-text-1-tab" data-toggle="tab" href="#tabs-icons-text-1" role="tab" aria-controls="tabs-icons-text-1" aria-selected="true">Ar-Rahn</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-sm-3 mb-md-0" id="tabs-icons-text-2-tab" data-toggle="tab" href="#tabs-icons-text-2" role="tab" aria-controls="tabs-icons-text-2" aria-selected="false">Tawarruq</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="tabs-icons-text-1" role="tabpanel" aria-labelledby="tabs-icons-text-1-tab">
|
||||
|
||||
<div class="table-responsive table-striped text-center">
|
||||
<table class="table align-items-center table-flush" id="belum_tawarruq">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>No.</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Tempoh Simpan</th>
|
||||
<th>Upah telah bayar</th>
|
||||
<th>Upah semasa</th>
|
||||
<th width="20%">Bayaran</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="list">
|
||||
@php $counter = 1;$jenisbayaran = 'arrahn'; @endphp
|
||||
@foreach($arraybayar as $index=>$bayar)
|
||||
@if($bayar['hargajualan'] == '')
|
||||
@php
|
||||
$koskeuntungan = Http::get(config('api.url') . '/api/upahbukantawarruq/' . $bayar['kodcaw'] . '/' . $bayar['norujukan'])->json();
|
||||
@endphp
|
||||
<tr>
|
||||
<td>
|
||||
{{ $counter }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $bayar['norujukan'] }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['pinjaman'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['tempoh'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['telahbayar'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($koskeuntungan,2) }}
|
||||
</td>
|
||||
<td>
|
||||
<select name="sltbayaran" class="form-control mb-2" data-upah="{{ $koskeuntungan }}" data-jenis="arrahn">
|
||||
<option selected disabled>Pilih Bayaran</option>
|
||||
<option value="fixed">Amaun Semasa</option>
|
||||
{{-- <option value="otheramount">Amaun Lain</option> --}}
|
||||
</select>
|
||||
|
||||
<input type="text" data-pinjaman="{{ $bayar['pinjaman'] }}" data-taglel="{{ $bayar['taglel'] }}" data-upah="{{ $koskeuntungan }}" data-nm="{{ $bayar['nilaimarhun'] }}" data-jenis="arrahn" name="txtbayaranarrahn" readonly class="form-control txtbayaran"/>
|
||||
|
||||
<input type="hidden" name="txtbayaranhidden[]" class="bayaran"/>
|
||||
<input type="hidden" name="txtupahhidden[]" value="{{ $koskeuntungan }}"/>
|
||||
<input type="hidden" name="txtjbghidden[]" value="{{ $bayar['tempoh'] }}"/>
|
||||
<input type="hidden" name="txtjenisbayaran[]" value="{{ $jenisbayaran }}"/>
|
||||
<input type="hidden" name="txtnorujukanhidden[]" value="{{ $bayar['norujukan'] }}"/>
|
||||
<input type="hidden" name="txtkodcawhidden[]" value="{{ $bayar['kodcaw'] }}"/>
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="tabs-icons-text-2" role="tabpanel" aria-labelledby="tabs-icons-text-2-tab">
|
||||
|
||||
<div class="table-responsive table-striped text-center">
|
||||
<table class="table align-items-center table-flush" id="selepas_tawarruq">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Pembiayaan Asal</th>
|
||||
<th>B. Pembiayaan</th>
|
||||
<th>Tempoh</th>
|
||||
<th>Keuntungan</th>
|
||||
<th width="20%">Bayaran</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@php $counter = 1;$jenisbayaran = 'tawarruq'; @endphp
|
||||
@foreach($arraybayar as $index=>$bayar)
|
||||
@if($bayar['hargajualan'] != '')
|
||||
<tbody class="list">
|
||||
<tr>
|
||||
<td>
|
||||
{{ $counter }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $bayar['norujukan'] }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['pinjaman'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['bakipjm'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $bayar['tempoh'] }}
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$upahtawarruq = Http::get(config('api.url') . '/api/upahtawarruq/'. $bayar['kodcaw'] . '/' . $bayar['norujukan'])->json();
|
||||
@endphp
|
||||
{{ $upahtawarruq }}
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<select name="sltbayaran" class="form-control mb-2" data-upah="{{ $upahtawarruq }}" data-jenis="tawarruq">
|
||||
<option selected disabled>Pilih Bayaran</option>
|
||||
<option value="fixed">Amaun Semasa</option>
|
||||
<option value="otheramount">Amaun Lain</option>
|
||||
</select>
|
||||
|
||||
<input type="text" data-bakipjm="{{ $bayar['bakipjm'] }}" data-taglel="{{ $bayar['taglel'] }}" data-upah="{{ $upahtawarruq }}" data-nm="{{ $bayar['nilaimarhun'] }}" data-jenis="tawarruq" name="txtbayarantawarruq" readonly class="form-control txtbayaran"/>
|
||||
|
||||
<input type="hidden" name="txtbayaranhidden[]" class="bayaran"/>
|
||||
<input type="hidden" name="txtjenisbayaran[]" value="{{ $jenisbayaran }}"/>
|
||||
<input type="hidden" name="txtnorujukanhidden[]" value="{{ $bayar['norujukan'] }}"/>
|
||||
<input type="hidden" name="txtkodcawhidden[]" value="{{ $bayar['kodcaw'] }}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@php $counter++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mt-5">
|
||||
<div class="col-xl-8 mb-5 mb-xl-0">
|
||||
<div class="card shadow">
|
||||
<div class="card-header border-0">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h3 class="mb-0">Senarai Surat Gadaian</h3>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<i class="fas fa-list-alt fa-2x"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nav-wrapper">
|
||||
<ul class="nav nav-pills ml-2" id="tabs-icons-text" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-sm-3 mb-md-0 active" id="tabs-icons-text-1-tab" data-toggle="tab" href="#tabs-icons-text-1" role="tab" aria-controls="tabs-icons-text-1" aria-selected="true">Ar-Rahn</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-sm-3 mb-md-0" id="tabs-icons-text-2-tab" data-toggle="tab" href="#tabs-icons-text-2" role="tab" aria-controls="tabs-icons-text-2" aria-selected="false">Tawarruq</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-4">
|
||||
<div class="card shadow">
|
||||
<div class="card-header border-0">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h3 class="mb-0">Ringkasan Pembayaran</h3>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<i class="fas fa-shopping-cart fa-2x"></i>
|
||||
</div>
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="tabs-icons-text-1" role="tabpanel" aria-labelledby="tabs-icons-text-1-tab">
|
||||
|
||||
<div class="form">
|
||||
<div class="table-responsive table-striped text-center">
|
||||
<table class="table align-items-center table-flush" id="belum_tawarruq">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>No.</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Tempoh Simpan</th>
|
||||
<th>Upah telah bayar</th>
|
||||
<th>Upah semasa</th>
|
||||
<th width="20%">Bayaran</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="list">
|
||||
@php $counter = 1;$jenisbayaran = 'arrahn'; @endphp
|
||||
@foreach($arraybayar as $index=>$bayar)
|
||||
@if($bayar['hargajualan'] == '')
|
||||
@php
|
||||
$koskeuntungan = Http::get(config('api.url') . '/api/upahbukantawarruq/' . $bayar['kodcaw'] . '/' . $bayar['norujukan'])->json();
|
||||
@endphp
|
||||
<tr>
|
||||
<td>
|
||||
{{ $counter }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $bayar['norujukan'] }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['pinjaman'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['tempoh'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['telahbayar'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($koskeuntungan,2) }}
|
||||
</td>
|
||||
<td>
|
||||
<select name="sltbayaran" class="form-control mb-2" data-upah="{{ $koskeuntungan }}" data-jenis="arrahn">
|
||||
<option selected disabled>Pilih Bayaran</option>
|
||||
<option value="fixed">Amaun Semasa</option>
|
||||
{{-- <option value="otheramount">Amaun Lain</option> --}}
|
||||
</select>
|
||||
|
||||
<div class="row mb--4 font-weight-light">
|
||||
<div class="col-7">
|
||||
<label class="text-dark ml-4 ">Bayaran Ar-Rahn</label>
|
||||
</div>
|
||||
<input type="text" data-pinjaman="{{ $bayar['pinjaman'] }}" data-taglel="{{ $bayar['taglel'] }}" data-upah="{{ $koskeuntungan }}" data-nm="{{ $bayar['nilaimarhun'] }}" data-jenis="arrahn" name="txtbayaranarrahn" readonly class="form-control txtbayaran" />
|
||||
|
||||
<div class="col-5 text-right pr-5">
|
||||
<span>RM <span id="spanbayaranarrahn">0.00</span></span>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<input type="hidden" name="txtbayaranhidden[]" class="bayaran" />
|
||||
<input type="hidden" name="txtupahhidden[]" value="{{ $koskeuntungan }}" />
|
||||
<input type="hidden" name="txtjbghidden[]" value="{{ $bayar['tempoh'] }}" />
|
||||
<input type="hidden" name="txtjenisbayaran[]" value="{{ $jenisbayaran }}" />
|
||||
<input type="hidden" name="txtnorujukanhidden[]" value="{{ $bayar['norujukan'] }}" />
|
||||
<input type="hidden" name="txtkodcawhidden[]" value="{{ $bayar['kodcaw'] }}" />
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb--4 font-weight-light">
|
||||
<div class="col-7">
|
||||
<label class="text-dark ml-4 ">Bayaran Tawarruq</label>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="tabs-icons-text-2" role="tabpanel" aria-labelledby="tabs-icons-text-2-tab">
|
||||
|
||||
<div class="col-5 text-right pr-5">
|
||||
<span>RM <span id="spanbayarantawarruq">0.00</span></span>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="table-responsive table-striped text-center">
|
||||
<table class="table align-items-center table-flush" id="selepas_tawarruq">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Pembiayaan Asal</th>
|
||||
<th>B. Pembiayaan</th>
|
||||
<th>Tempoh</th>
|
||||
<th>Keuntungan</th>
|
||||
<th width="20%">Bayaran</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@php $counter = 1;$jenisbayaran = 'tawarruq'; @endphp
|
||||
@foreach($arraybayar as $index=>$bayar)
|
||||
@if($bayar['hargajualan'] != '')
|
||||
<tbody class="list">
|
||||
<tr>
|
||||
<td>
|
||||
{{ $counter }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $bayar['norujukan'] }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['pinjaman'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ number_format($bayar['bakipjm'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $bayar['tempoh'] }}
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$upahtawarruq = Http::get(config('api.url') . '/api/upahtawarruq/'. $bayar['kodcaw'] . '/' . $bayar['norujukan'])->json();
|
||||
@endphp
|
||||
{{ $upahtawarruq }}
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<select name="sltbayaran" class="form-control mb-2" data-upah="{{ $upahtawarruq }}" data-jenis="tawarruq">
|
||||
<option selected disabled>Pilih Bayaran</option>
|
||||
<option value="fixed">Amaun Semasa</option>
|
||||
<option value="otheramount">Amaun Lain</option>
|
||||
</select>
|
||||
|
||||
<input type="text" data-bakipjm="{{ $bayar['bakipjm'] }}" data-taglel="{{ $bayar['taglel'] }}" data-upah="{{ $upahtawarruq }}" data-nm="{{ $bayar['nilaimarhun'] }}" data-jenis="tawarruq" name="txtbayarantawarruq" readonly class="form-control txtbayaran" />
|
||||
|
||||
<input type="hidden" name="txtbayaranhidden[]" class="bayaran" />
|
||||
<input type="hidden" name="txtjenisbayaran[]" value="{{ $jenisbayaran }}" />
|
||||
<input type="hidden" name="txtnorujukanhidden[]" value="{{ $bayar['norujukan'] }}" />
|
||||
<input type="hidden" name="txtkodcawhidden[]" value="{{ $bayar['kodcaw'] }}" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@php $counter++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
{{-- <div class="row mb--4 font-weight-light">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-xl-4">
|
||||
<div class="card shadow">
|
||||
<div class="card-header border-0">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h3 class="mb-0">Ringkasan Pembayaran</h3>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<i class="fas fa-shopping-cart fa-2x"></i>
|
||||
</div>
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form">
|
||||
|
||||
<div class="row mb--4 font-weight-light">
|
||||
<div class="col-7">
|
||||
<label class="text-dark ml-4 ">Bayaran Ar-Rahn</label>
|
||||
</div>
|
||||
|
||||
<div class="col-5 text-right pr-5">
|
||||
<span>RM <span id="spanbayaranarrahn">0.00</span></span>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div class="row mb--4 font-weight-light">
|
||||
<div class="col-7">
|
||||
<label class="text-dark ml-4 ">Bayaran Tawarruq</label>
|
||||
</div>
|
||||
|
||||
<div class="col-5 text-right pr-5">
|
||||
<span>RM <span id="spanbayarantawarruq">0.00</span></span>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
|
||||
{{-- <div class="row mb--4 font-weight-light">
|
||||
<div class="col-7">
|
||||
<label class="text-dark ml-4">Keuntungan</label>
|
||||
</div>
|
||||
@@ -244,198 +244,192 @@
|
||||
<hr/> --}}
|
||||
|
||||
|
||||
<div class="row pb-4 font-weight-light">
|
||||
<div class="col-7">
|
||||
<label class="text-dark ml-4">Jumlah Keseluruhan</label>
|
||||
</div>
|
||||
|
||||
<div class="col-5 text-right pr-5">
|
||||
<span>RM <span id="spanjumlah">0.00</span></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row pb-4 font-weight-light">
|
||||
<div class="col-7">
|
||||
<label class="text-dark ml-4">Jumlah Keseluruhan</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="d-flex justify-content-end col-12 mt-3 align-self-end">
|
||||
<button type="submit" id="bayarsbmt" class="btn btn-primary" disabled onclick="loadingbtn();">Bayar</button>
|
||||
<div class="col-5 text-right pr-5">
|
||||
<span>RM <span id="spanjumlah">0.00</span></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<div class="d-flex justify-content-end col-12 mt-3 align-self-end">
|
||||
<button type="submit" id="bayarsbmt" class="btn btn-primary" disabled onclick="loadingbtn();">Bayar</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
const formatter = new Intl.NumberFormat('en-US', {
|
||||
minimumFractionDigits: 2
|
||||
});
|
||||
<script>
|
||||
const formatter = new Intl.NumberFormat('en-US', {
|
||||
minimumFractionDigits: 2
|
||||
});
|
||||
|
||||
var belumtawarruqtable = $('#belum_tawarruq').DataTable({
|
||||
"bLengthChange": false,
|
||||
"bFilter": false,
|
||||
"bInfo": false,
|
||||
language: {
|
||||
'paginate': {
|
||||
'previous': '<span class="fas fa-backward"></span>',
|
||||
'next': '<span class="fas fa-forward"></span>'
|
||||
}
|
||||
}
|
||||
});
|
||||
var belumtawarruqtable = $('#belum_tawarruq').DataTable({
|
||||
"bLengthChange": false,
|
||||
"bFilter": false,
|
||||
"bInfo": false,
|
||||
language: {
|
||||
'paginate': {
|
||||
'previous': '<span class="fas fa-backward"></span>',
|
||||
'next': '<span class="fas fa-forward"></span>'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var selepastawarruqtable = $('#selepas_tawarruq').DataTable({
|
||||
"bLengthChange": false,
|
||||
"bFilter": false,
|
||||
"bInfo": false,
|
||||
language: {
|
||||
'paginate': {
|
||||
'previous': '<span class="fas fa-backward"></span>',
|
||||
'next': '<span class="fas fa-forward"></span>'
|
||||
}
|
||||
}
|
||||
});
|
||||
var selepastawarruqtable = $('#selepas_tawarruq').DataTable({
|
||||
"bLengthChange": false,
|
||||
"bFilter": false,
|
||||
"bInfo": false,
|
||||
language: {
|
||||
'paginate': {
|
||||
'previous': '<span class="fas fa-backward"></span>',
|
||||
'next': '<span class="fas fa-forward"></span>'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function validateform()
|
||||
{
|
||||
return false;
|
||||
function validateform() {
|
||||
return false;
|
||||
}
|
||||
|
||||
let total = 0;
|
||||
|
||||
$("select[name=sltbayaran]").change(function(e) {
|
||||
let selected = $('option:selected', this).attr('value');
|
||||
let jenis = $(this).data('jenis');
|
||||
let upah = $(this).data('upah');
|
||||
let taglel = $(this).data('taglel');
|
||||
|
||||
if (selected === 'fixed') {
|
||||
$(this).closest('tr').find("input").attr('readonly', true);
|
||||
$(this).closest('tr').find(".txtbayaran").val(upah);
|
||||
$(this).closest('tr').find(".bayaran").val(upah);
|
||||
calculateall(jenis, taglel);
|
||||
|
||||
} else {
|
||||
// $(this).closest('tr').find("input").val();
|
||||
$(this).closest('tr').find("input").attr('readonly', false);
|
||||
calculateall(jenis, taglel);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name=txtbayaranarrahn]").change(function(e) {
|
||||
|
||||
let upah = $(this).data('upah');
|
||||
let pinjaman = $(this).data('pinjaman');
|
||||
let jenis = $(this).data('jenis');
|
||||
let nm = $(this).data('nm');
|
||||
let taglel = $(this).data('taglel');
|
||||
|
||||
let bayar = Number(this.value);
|
||||
|
||||
let errorlebih = nm - (nm * 0.1);
|
||||
|
||||
if (bayar > parseFloat(errorlebih)) {
|
||||
$("#bayarsbmt").prop('disabled', false);
|
||||
Swal.fire(
|
||||
'Amaran!',
|
||||
'Bayaran tidak boleh melebihi 10% nilai marhun!',
|
||||
'error'
|
||||
)
|
||||
$(this).val(upah);
|
||||
$(this).closest('tr').find('.bayaran').val(upah);
|
||||
calculateall(jenis, taglel);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$(this).closest('tr').find('.bayaran').val(this.value);
|
||||
calculateall(jenis, taglel);
|
||||
|
||||
});
|
||||
|
||||
$("input[name=txtbayarantawarruq]").change(function(e) {
|
||||
|
||||
let upah = $(this).data('upah');
|
||||
let bakipinjam = $(this).data('bakipjm');
|
||||
let jenis = $(this).data('jenis');
|
||||
let nm = $(this).data('nm');
|
||||
let taglel = $(this).data('taglel');
|
||||
|
||||
let bayar = Number(this.value);
|
||||
|
||||
let errorlebih = (bakipinjam - (nm * 0.1));
|
||||
|
||||
if (bayar > parseFloat(errorlebih)) {
|
||||
$("#bayarsbmt").prop('disabled', false);
|
||||
Swal.fire(
|
||||
'Amaran!',
|
||||
'Bayaran tidak boleh melebihi 10% nilai marhun!',
|
||||
'error'
|
||||
)
|
||||
$(this).val(upah);
|
||||
$(this).closest('tr').find('.bayaran').val(upah);
|
||||
calculateall(jenis, taglel);
|
||||
return false;
|
||||
}
|
||||
|
||||
$(this).closest('tr').find('.bayaran').val(this.value);
|
||||
calculateall(jenis, taglel);
|
||||
});
|
||||
|
||||
function calculateall(jenis, taglel) {
|
||||
var $row = $(this).closest('tr');
|
||||
var sumarrahn = 0;
|
||||
var sumtawarruq = 0;
|
||||
var sum = 0;
|
||||
var counterrorbayar = 0;
|
||||
|
||||
$('#belum_tawarruq').find('input[name=txtbayaranarrahn]').each(function() {
|
||||
sumarrahn += parseFloat(this.value) || 0;
|
||||
|
||||
if (this.value <= 0 || this.value == '') {
|
||||
counterrorbayar++;
|
||||
}
|
||||
|
||||
let total = 0;
|
||||
});
|
||||
|
||||
$("select[name=sltbayaran]").change(function(e)
|
||||
{
|
||||
let selected = $('option:selected',this).attr('value');
|
||||
let jenis = $(this).data('jenis');
|
||||
let upah = $(this).data('upah');
|
||||
let taglel = $(this).data('taglel');
|
||||
$('#selepas_tawarruq').find('input[name=txtbayarantawarruq]').each(function() {
|
||||
sumtawarruq += parseFloat(this.value) || 0;
|
||||
|
||||
if(selected === 'fixed')
|
||||
{
|
||||
$(this).closest('tr').find("input").attr('readonly',true);
|
||||
$(this).closest('tr').find(".txtbayaran").val(upah);
|
||||
$(this).closest('tr').find(".bayaran").val(upah);
|
||||
calculateall(jenis,taglel);
|
||||
|
||||
}else{
|
||||
// $(this).closest('tr').find("input").val();
|
||||
$(this).closest('tr').find("input").attr('readonly',false);
|
||||
calculateall(jenis,taglel);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name=txtbayaranarrahn]").change(function(e){
|
||||
|
||||
let upah = $(this).data('upah');
|
||||
let pinjaman = $(this).data('pinjaman');
|
||||
let jenis = $(this).data('jenis');
|
||||
let nm = $(this).data('nm');
|
||||
let taglel = $(this).data('taglel');
|
||||
|
||||
let bayar = Number(this.value);
|
||||
|
||||
let errorlebih = nm - (nm * 0.1);
|
||||
|
||||
if(bayar > parseFloat(errorlebih)){
|
||||
$("#bayarsbmt").prop('disabled', false);
|
||||
Swal.fire(
|
||||
'Amaran!',
|
||||
'Bayaran tidak boleh melebihi 10% nilai marhun!',
|
||||
'error'
|
||||
)
|
||||
$(this).val(upah);
|
||||
$(this).closest('tr').find('.bayaran').val(upah);
|
||||
calculateall(jenis,taglel);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$(this).closest('tr').find('.bayaran').val(this.value);
|
||||
calculateall(jenis,taglel);
|
||||
|
||||
});
|
||||
|
||||
$("input[name=txtbayarantawarruq]").change(function(e){
|
||||
|
||||
let upah = $(this).data('upah');
|
||||
let bakipinjam = $(this).data('bakipjm');
|
||||
let jenis = $(this).data('jenis');
|
||||
let nm = $(this).data('nm');
|
||||
let taglel = $(this).data('taglel');
|
||||
|
||||
let bayar = Number(this.value);
|
||||
|
||||
let errorlebih = (bakipinjam - (nm * 0.1));
|
||||
|
||||
if(bayar > parseFloat(errorlebih)){
|
||||
$("#bayarsbmt").prop('disabled', false);
|
||||
Swal.fire(
|
||||
'Amaran!',
|
||||
'Bayaran tidak boleh melebihi 10% nilai marhun!',
|
||||
'error'
|
||||
)
|
||||
$(this).val(upah);
|
||||
$(this).closest('tr').find('.bayaran').val(upah);
|
||||
calculateall(jenis,taglel);
|
||||
return false;
|
||||
}
|
||||
|
||||
$(this).closest('tr').find('.bayaran').val(this.value);
|
||||
calculateall(jenis,taglel);
|
||||
});
|
||||
|
||||
function calculateall(jenis,taglel)
|
||||
{
|
||||
var $row = $(this).closest('tr');
|
||||
var sumarrahn = 0;
|
||||
var sumtawarruq = 0;
|
||||
var sum = 0;
|
||||
var counterrorbayar = 0;
|
||||
|
||||
$('#belum_tawarruq').find('input[name=txtbayaranarrahn]').each(function() {
|
||||
sumarrahn += parseFloat(this.value) || 0;
|
||||
|
||||
if(this.value <= 0 || this.value == ''){
|
||||
counterrorbayar++;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#selepas_tawarruq').find('input[name=txtbayarantawarruq]').each(function() {
|
||||
sumtawarruq += parseFloat(this.value) || 0;
|
||||
|
||||
if(this.value <= 0 || this.value == ''){
|
||||
counterrorbayar++;
|
||||
}
|
||||
});
|
||||
|
||||
sum = sumarrahn + sumtawarruq;
|
||||
|
||||
if(counterrorbayar > 0){
|
||||
$("#bayarsbmt").prop('disabled', true);
|
||||
}else{
|
||||
$("#bayarsbmt").prop('disabled', false);
|
||||
}
|
||||
|
||||
$("#spanbayaranarrahn").text(sumarrahn.toFixed(2));
|
||||
$("#spanbayarantawarruq").text(sumtawarruq.toFixed(2));
|
||||
$('#spanjumlah').text(formatter.format(sum));
|
||||
if (this.value <= 0 || this.value == '') {
|
||||
counterrorbayar++;
|
||||
}
|
||||
});
|
||||
|
||||
if (document.addEventListener) {
|
||||
window.addEventListener('pageshow', function (event) {
|
||||
if (event.persisted || window.performance && window.performance.navigation.type == 2)
|
||||
{
|
||||
$('#logout-form').submit();
|
||||
// location.reload();
|
||||
}
|
||||
},
|
||||
false);
|
||||
}
|
||||
</script>
|
||||
sum = sumarrahn + sumtawarruq;
|
||||
|
||||
if (counterrorbayar > 0) {
|
||||
$("#bayarsbmt").prop('disabled', true);
|
||||
} else {
|
||||
$("#bayarsbmt").prop('disabled', false);
|
||||
}
|
||||
|
||||
$("#spanbayaranarrahn").text(sumarrahn.toFixed(2));
|
||||
$("#spanbayarantawarruq").text(sumtawarruq.toFixed(2));
|
||||
$('#spanjumlah').text(formatter.format(sum));
|
||||
}
|
||||
|
||||
if (document.addEventListener) {
|
||||
window.addEventListener('pageshow', function(event) {
|
||||
if (event.persisted || window.performance && window.performance.navigation.type == 2) {
|
||||
$('#logout-form').submit();
|
||||
// location.reload();
|
||||
}
|
||||
},
|
||||
false);
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
Reference in New Issue
Block a user