fix kadar rebet on teller page
This commit is contained in:
@@ -114,11 +114,10 @@
|
|||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
Kadar Rebet
|
Pendapatan Sebulan
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input type="text" class="form-control" readonly name="rebate" id="rebate">
|
<input type="text" class="form-control" readonly name="keuntungan_sebulan" id="keuntungan_sebulan">
|
||||||
<input type="text" class="form-control" readonly name="kadar_rebate" id="kadar_rebate">
|
|
||||||
</div>
|
</div>
|
||||||
</diV>
|
</diV>
|
||||||
</div>
|
</div>
|
||||||
@@ -152,10 +151,10 @@
|
|||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
Pendapatan Sebulan
|
Pendapatan 6 Bulan
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input type="text" class="form-control" readonly name="keuntungan_sebulan" id="keuntungan_sebulan">
|
<input type="text" class="form-control" readonly name="keuntungan_6bln" id="keuntungan_6bln">
|
||||||
</div>
|
</div>
|
||||||
</diV>
|
</diV>
|
||||||
</div>
|
</div>
|
||||||
@@ -185,12 +184,13 @@
|
|||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
Pendapatan 6 Bulan
|
Kadar Rebet
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input type="text" class="form-control" readonly name="keuntungan_6bln" id="keuntungan_6bln">
|
<input type="text" class="form-control" readonly name="rebate" id="rebate">
|
||||||
|
<input type="text" class="form-control" readonly name="kadar_rebate" id="kadar_rebate">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</diV>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<input type="text" name="norujukan_gadai" id="norujukan_gadai" value="{{ $norujukan }}" hidden>
|
<input type="text" name="norujukan_gadai" id="norujukan_gadai" value="{{ $norujukan }}" hidden>
|
||||||
@@ -641,16 +641,19 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#pinjaman').on('input', function () {
|
$('#pinjaman').on('input',function(){
|
||||||
var pinjaman = Number(this.value);
|
var pinjaman = Number(this.value);
|
||||||
var nilaimarhun = Number($('#jumlah_nilai_marhun').val());
|
var nilaimarhun = Number($('#jumlah_nilai_marhun').val());
|
||||||
var nokp = $('#nokp').val();
|
var nokp = $('#nokp').val();
|
||||||
//console.log('DEBUG NOKP:', nokp, kadarupah);
|
//console.log('DEBUG NOKP:', nokp, kadarupah);
|
||||||
|
|
||||||
|
|
||||||
var percent_pinjaman = (pinjaman / total_nilai_marhun) * 100;
|
// var keuntungan_sebulan = pinjaman * kadarupah;
|
||||||
|
// var keuntungan_6bln = keuntungan_sebulan * 6;
|
||||||
|
|
||||||
let array_keuntungan = {}; // Initialize as an object
|
percent_pinjaman = (Number(pinjaman)/Number(total_nilai_marhun))*100;
|
||||||
|
|
||||||
|
let array_keuntungan = [];
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method:'POST',
|
method:'POST',
|
||||||
@@ -696,14 +699,12 @@
|
|||||||
$('.span-pinjaman').text(formatter.format(percent_pinjaman.toFixed(2)) + ' %');
|
$('.span-pinjaman').text(formatter.format(percent_pinjaman.toFixed(2)) + ' %');
|
||||||
$('#keuntungan_sebulan').val(formatter.format(keuntungan_sebulan.toFixed(2)));
|
$('#keuntungan_sebulan').val(formatter.format(keuntungan_sebulan.toFixed(2)));
|
||||||
$('#keuntungan_6bln').val(formatter.format(keuntungan_6bln.toFixed(2)));
|
$('#keuntungan_6bln').val(formatter.format(keuntungan_6bln.toFixed(2)));
|
||||||
$('#ujrah').val(formatter.format(ujrah.toFixed(2)));
|
$('#ujrah').val(formatter.format(getRoundedMethod(array_keuntungan['ujrah']).toFixed(2)));
|
||||||
$('#onepercent').val(formatter.format(onepercent.toFixed(2)));
|
$('#onepercent').val(formatter.format(getRoundedMethod(array_keuntungan['onepercent']).toFixed(2)));
|
||||||
$('#rebate').val(formatter.format(rebate.toFixed(2))); // Correctly displaying rebate
|
$('#rebate').val(formatter.format(rebate.toFixed(2))); // Correctly displaying rebate
|
||||||
$('#kadar_rebate').val(formatter.format(kadar_rebate.toFixed(2)) + ' %');
|
$('#kadar_rebate').val(formatter.format(kadar_rebate.toFixed(2)) + ' %');
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
const formatter = new Intl.NumberFormat('en-US', {
|
const formatter = new Intl.NumberFormat('en-US', {
|
||||||
minimumFractionDigits: 2
|
minimumFractionDigits: 2
|
||||||
|
|||||||
Reference in New Issue
Block a user