new update
This commit is contained in:
@@ -18,7 +18,6 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
<form id="kemaskiniform">
|
<form id="kemaskiniform">
|
||||||
<div class='row form-group'>
|
<div class='row form-group'>
|
||||||
<div class='col-md-6'>
|
<div class='col-md-6'>
|
||||||
@@ -302,8 +301,8 @@
|
|||||||
<th>No Rujukan</th>
|
<th>No Rujukan</th>
|
||||||
<th>Tarikh Gadai</th>
|
<th>Tarikh Gadai</th>
|
||||||
<th>Tarikh Matang</th>
|
<th>Tarikh Matang</th>
|
||||||
<th>Nilai Marhun</th>
|
<th>Baki Harga Jualan</th>
|
||||||
<th>Pembiayaan</th>
|
<th>Baki Pembiayaan</th>
|
||||||
<th>Margin</th>
|
<th>Margin</th>
|
||||||
<th>Tempoh</th>
|
<th>Tempoh</th>
|
||||||
<th>Keuntungan</th>
|
<th>Keuntungan</th>
|
||||||
@@ -320,8 +319,8 @@
|
|||||||
<th>No Rujukan</th>
|
<th>No Rujukan</th>
|
||||||
<th>Tarikh Gadai</th>
|
<th>Tarikh Gadai</th>
|
||||||
<th>Tarikh Matang</th>
|
<th>Tarikh Matang</th>
|
||||||
<th>Nilai Marhun</th>
|
<th>Baki Harga Jualan</th>
|
||||||
<th>Pembiayaan</th>
|
<th>Baki Pembiayaan</th>
|
||||||
<th>Margin</th>
|
<th>Margin</th>
|
||||||
<th>Tempoh</th>
|
<th>Tempoh</th>
|
||||||
<th>Keuntungan</th>
|
<th>Keuntungan</th>
|
||||||
@@ -336,8 +335,8 @@
|
|||||||
<th>No Rujukan</th>
|
<th>No Rujukan</th>
|
||||||
<th>Tarikh Gadai</th>
|
<th>Tarikh Gadai</th>
|
||||||
<th>Tarikh Matang</th>
|
<th>Tarikh Matang</th>
|
||||||
<th>Nilai Marhun</th>
|
<th>Baki Harga Jualan</th>
|
||||||
<th>Pembiayaan</th>
|
<th>Baki Pembiayaan</th>
|
||||||
<th>Margin</th>
|
<th>Margin</th>
|
||||||
<th>Tempoh</th>
|
<th>Tempoh</th>
|
||||||
<th>Keuntungan</th>
|
<th>Keuntungan</th>
|
||||||
@@ -348,7 +347,7 @@
|
|||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<button class="btn btn-primary" onclick="ubahfunc(this)">Ubah</button>
|
<button class="btn btn-primary" onclick="ubahfunc(this)">Ubah</button>
|
||||||
<button class="btn btn-primary" onclick="hapusfunc()">Hapus</button>
|
<button class="btn btn-primary" onclick="hapusfunc()">Hapus</button>
|
||||||
<button class="btn btn-primary" onclick="histfunc()">History</button>
|
<button class="btn btn-primary" onclick="histfunc()">Rekod Gadaian</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -404,6 +403,10 @@
|
|||||||
"scrollX": true
|
"scrollX": true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var historybayarandatatable = $('#tablehistorybayaran').DataTable({
|
||||||
|
"ordering": false
|
||||||
|
});
|
||||||
|
|
||||||
const formatter = new Intl.NumberFormat('en-US', {
|
const formatter = new Intl.NumberFormat('en-US', {
|
||||||
minimumFractionDigits: 2
|
minimumFractionDigits: 2
|
||||||
});
|
});
|
||||||
@@ -425,8 +428,8 @@
|
|||||||
'<a href=' + urlroute +'>' + gadai_detail['norujukan'] + '</a>',
|
'<a href=' + urlroute +'>' + gadai_detail['norujukan'] + '</a>',
|
||||||
gadai_detail['t_gadai'],
|
gadai_detail['t_gadai'],
|
||||||
gadai_detail['t_matang1'],
|
gadai_detail['t_matang1'],
|
||||||
'RM '+ formatter.format(gadai_detail['nilaimarhun']),
|
'RM '+ formatter.format(gadai_detail['bakihargajualan']),
|
||||||
'RM '+formatter.format(gadai_detail['pinjaman']),
|
'RM '+formatter.format(gadai_detail['bakipjm']),
|
||||||
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
|
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
|
||||||
gadai_detail['jbg'],
|
gadai_detail['jbg'],
|
||||||
'RM '+ formatter.format((Number(gadai_detail['kadarupah'])/100)*Number(gadai_detail['bakipjm'])*Number(gadai_detail['jbg']))
|
'RM '+ formatter.format((Number(gadai_detail['kadarupah'])/100)*Number(gadai_detail['bakipjm'])*Number(gadai_detail['jbg']))
|
||||||
@@ -438,8 +441,8 @@
|
|||||||
gadai_detail['norujukan'],
|
gadai_detail['norujukan'],
|
||||||
gadai_detail['t_gadai'],
|
gadai_detail['t_gadai'],
|
||||||
gadai_detail['t_matang1'],
|
gadai_detail['t_matang1'],
|
||||||
'RM '+ formatter.format(gadai_detail['nilaimarhun']),
|
'RM '+ formatter.format(gadai_detail['bakihargajualan']),
|
||||||
'RM '+formatter.format(gadai_detail['pinjaman']),
|
'RM '+formatter.format(gadai_detail['bakipjm']),
|
||||||
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
|
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
|
||||||
gadai_detail['jbg'],
|
gadai_detail['jbg'],
|
||||||
'RM '+ formatter.format((Number(gadai_detail['kadarupah'])/100)*Number(gadai_detail['bakipjm'])*Number(gadai_detail['jbg']))
|
'RM '+ formatter.format((Number(gadai_detail['kadarupah'])/100)*Number(gadai_detail['bakipjm'])*Number(gadai_detail['jbg']))
|
||||||
@@ -451,8 +454,8 @@
|
|||||||
gadai_detail['norujukan'],
|
gadai_detail['norujukan'],
|
||||||
gadai_detail['t_gadai'],
|
gadai_detail['t_gadai'],
|
||||||
gadai_detail['t_matang1'],
|
gadai_detail['t_matang1'],
|
||||||
'RM '+ formatter.format(gadai_detail['nilaimarhun']),
|
'RM '+ formatter.format(gadai_detail['bakihargajualan']),
|
||||||
'RM '+formatter.format(gadai_detail['pinjaman']),
|
'RM '+formatter.format(gadai_detail['bakipjm']),
|
||||||
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
|
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
|
||||||
gadai_detail['jbg'],
|
gadai_detail['jbg'],
|
||||||
'RM '+ formatter.format((Number(gadai_detail['kadarupah'])/100)*Number(gadai_detail['bakipjm'])*Number(gadai_detail['jbg']))
|
'RM '+ formatter.format((Number(gadai_detail['kadarupah'])/100)*Number(gadai_detail['bakipjm'])*Number(gadai_detail['jbg']))
|
||||||
@@ -495,7 +498,6 @@
|
|||||||
function histfunc(){
|
function histfunc(){
|
||||||
if($("input[name='options']:checked").val() == 'belum_tebus'){
|
if($("input[name='options']:checked").val() == 'belum_tebus'){
|
||||||
let histid = $('input[name="belum"]:checked').val();
|
let histid = $('input[name="belum"]:checked').val();
|
||||||
|
|
||||||
if(histid == null){
|
if(histid == null){
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
@@ -516,6 +518,20 @@
|
|||||||
alert(xhr.responseText);
|
alert(xhr.responseText);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$.ajax({
|
||||||
|
method: 'get',
|
||||||
|
url: api_url + '/api/transaction/' + histid,
|
||||||
|
success: function(data){
|
||||||
|
historybayarantable(data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
method:'get',
|
||||||
|
url:api_url + '/api/gadai/norujukan/'+histid,
|
||||||
|
success:function(gadai){
|
||||||
|
rekodasal(gadai);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}else if($("input[name='options']:checked").val() == 'sudah_tebus'){
|
}else if($("input[name='options']:checked").val() == 'sudah_tebus'){
|
||||||
let histid = $('input[name="sudahtebus"]:checked').val();
|
let histid = $('input[name="sudahtebus"]:checked').val();
|
||||||
@@ -539,9 +555,48 @@
|
|||||||
alert(xhr.responseText);
|
alert(xhr.responseText);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$.ajax({
|
||||||
|
method: 'get',
|
||||||
|
url: api + '/api/transaction/' + histid,
|
||||||
|
success: function(data){
|
||||||
|
historybayarantable(data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
method:'get',
|
||||||
|
url:api_url + '/api/gadai/norujukan/'+histid,
|
||||||
|
success:function(gadai){
|
||||||
|
rekodasal(gadai);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function rekodasal(gadaian){
|
||||||
|
$('#hargajualanmodal').text('RM ' + formatter.format(gadaian[0][0]['hargajualan']));
|
||||||
|
$('#pembiayaanmodal').text('RM ' + formatter.format(gadaian[0][0]['pinjaman']));
|
||||||
|
$('#nilaimarhunmodal').text('RM ' + formatter.format(gadaian[0][0]['nilaimarhun']));
|
||||||
|
}
|
||||||
|
|
||||||
|
function historybayarantable(data){
|
||||||
|
var counter = 1;
|
||||||
|
|
||||||
|
historybayarandatatable.clear().draw();
|
||||||
|
$.each(data,function(index,bayaran){
|
||||||
|
|
||||||
|
var urlroute = '{{ route("resit.ansuran", ":id") }}';
|
||||||
|
urlroute = urlroute.replace(':id', bayaran['id']);
|
||||||
|
|
||||||
|
console.log(bayaran['']);
|
||||||
|
historybayarandatatable.row.add([
|
||||||
|
counter,
|
||||||
|
bayaran['created_at'],
|
||||||
|
"RM " + bayaran['duit_masuk'],
|
||||||
|
'<a class="btn btn-info" target="_blank" href='+ urlroute +'>Cetak</a>'
|
||||||
|
]).draw();
|
||||||
|
counter = counter + 1;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var historytebusbayaran = $('#tablehistorytebus').DataTable({
|
var historytebusbayaran = $('#tablehistorytebus').DataTable({
|
||||||
|
|||||||
@@ -9,22 +9,61 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<table id="tablehistorytebus" class="table table-striped table-bordered text-center">
|
<div class="row">
|
||||||
<thead>
|
<div class="col-12">
|
||||||
|
<div>Harga Jualan : <span id="hargajualanmodal"></span></div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<div>Pembiayaan : <span id="pembiayaanmodal"></span></div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<div>Nilai Marhun : <span id="nilaimarhunmodal"></span></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ul class="nav nav-tabs" id="custom-tabs-one-tab" role="tablist">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" id="custom-tabs-one-home-tab" data-toggle="pill" href="#custom-tabs-one-home" role="tab" aria-controls="custom-tabs-one-home" aria-selected="true">Rekod Bayaran</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" id="custom-tabs-one-profile-tab" data-toggle="pill" href="#custom-tabs-one-profile" role="tab" aria-controls="custom-tabs-one-profile" aria-selected="false">Rekod SAG</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="tab-content" id="custom-content-below-tabContent">
|
||||||
|
<div class="tab-pane fade show active" id="custom-tabs-one-home" role="tabpanel" aria-labelledby="custom-content-below-home-tab">
|
||||||
|
<hr>
|
||||||
|
<h4>Rekod Bayaran</h4>
|
||||||
|
<table id="tablehistorybayaran" class="table table-striped table-bordered text-center">
|
||||||
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Bil</th>
|
<th>Bil</th>
|
||||||
<th>No Rujukan</th>
|
<th>Tarikh Bayaran</th>
|
||||||
<th>Jenis Tebus</th>
|
<th>Bayaran</th>
|
||||||
<th>JBG</th>
|
<th>Action</th>
|
||||||
<th>Tarikh Tebus</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
</tbody>
|
||||||
</tbody>
|
</table>
|
||||||
</table>
|
</div>
|
||||||
|
<div class="tab-pane fade" id="custom-tabs-one-profile" role="tabpanel" aria-labelledby="custom-content-below-profile-tab">
|
||||||
|
<hr>
|
||||||
|
<h4>Rekod SAG</h4>
|
||||||
|
<table id="tablehistorytebus" class="table table-striped table-bordered text-center">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Bil</th>
|
||||||
|
<th>No Rujukan</th>
|
||||||
|
<th>Jenis Tebus</th>
|
||||||
|
<th>JBG</th>
|
||||||
|
<th>Tarikh Tebus</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-danger btn-lg" data-dismiss="modal">Batal</button>
|
<button type="button" class="btn btn-danger btn-lg" data-dismiss="modal">Batal</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -264,7 +264,6 @@
|
|||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<input type="button" class="float-right btn btn-danger mr-2" value="BATAL" onclick="window.location.replace('{{ url()->previous() }}')">
|
<input type="button" class="float-right btn btn-danger mr-2" value="BATAL" onclick="window.location.replace('{{ url()->previous() }}')">
|
||||||
<input type="button" class="float-right btn btn-primary mr-2" value="TERIMA" onclick="bayaransemua()">
|
<input type="button" class="float-right btn btn-primary mr-2" value="TERIMA" onclick="bayaransemua()">
|
||||||
<input type="button" class="float-left btn btn-warning mr-2" value="HISTORY" id="histbtn" onclick="historybayaran()">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -1475,42 +1474,6 @@ function ubahwakil(e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function historybayaran()
|
|
||||||
{
|
|
||||||
$.ajax({
|
|
||||||
method: 'get',
|
|
||||||
url: api + '/api/transaction/' + norujukan,
|
|
||||||
success: function(data)
|
|
||||||
{
|
|
||||||
historybayarantable(data);
|
|
||||||
$('#historybayaranModal').modal();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function historybayarantable(data){
|
|
||||||
var counter = 1;
|
|
||||||
|
|
||||||
historybayarandatatable.clear().draw();
|
|
||||||
$.each(data,function(index,bayaran){
|
|
||||||
|
|
||||||
var urlroute = '{{ route("resit.ansuran", ":id") }}';
|
|
||||||
urlroute = urlroute.replace(':id', bayaran['id']);
|
|
||||||
|
|
||||||
console.log(bayaran['']);
|
|
||||||
historybayarandatatable.row.add([
|
|
||||||
counter,
|
|
||||||
bayaran['created_at'],
|
|
||||||
"RM " + bayaran['duit_masuk'],
|
|
||||||
'<a class="btn btn-info" target="_blank" href='+ urlroute +'>Cetak</a>'
|
|
||||||
]).draw();
|
|
||||||
counter = counter + 1;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Restricts input for the set of matched elements to the given inputFilter function.
|
// Restricts input for the set of matched elements to the given inputFilter function.
|
||||||
(function($) {
|
(function($) {
|
||||||
$.fn.inputFilter = function(inputFilter) {
|
$.fn.inputFilter = function(inputFilter) {
|
||||||
|
|||||||
Reference in New Issue
Block a user