add kadar rebet annur at gadai page
This commit is contained in:
@@ -113,10 +113,11 @@
|
|||||||
<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
|
Kadar Rebet
|
||||||
</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="rebate" id="rebate">
|
||||||
|
<input type="text" class="form-control" readonly name="kadar_rebate" id="kadar_rebate">
|
||||||
</div>
|
</div>
|
||||||
</diV>
|
</diV>
|
||||||
</div>
|
</div>
|
||||||
@@ -150,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 6 Bulan
|
Pendapatan Sebulan
|
||||||
</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="keuntungan_sebulan" id="keuntungan_sebulan">
|
||||||
</div>
|
</div>
|
||||||
</diV>
|
</diV>
|
||||||
</div>
|
</div>
|
||||||
@@ -180,6 +181,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</diV>
|
</diV>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<div class="form-group row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
Pendapatan 6 Bulan
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input type="text" class="form-control" readonly name="keuntungan_6bln" id="keuntungan_6bln">
|
||||||
|
</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>
|
||||||
<input type="text" name="marhun_detail" id="marhun_detail" value="" hidden>
|
<input type="text" name="marhun_detail" id="marhun_detail" value="" hidden>
|
||||||
@@ -642,6 +653,7 @@
|
|||||||
'pembiayaan' : pinjaman,
|
'pembiayaan' : pinjaman,
|
||||||
'kadarujrah' : kadarupah,
|
'kadarujrah' : kadarupah,
|
||||||
'margin' : percent_pinjaman,
|
'margin' : percent_pinjaman,
|
||||||
|
'kadarrebet' : kadar_rebate,
|
||||||
'kodcaw' : "{{ Auth::user()->cawangan }}"
|
'kodcaw' : "{{ Auth::user()->cawangan }}"
|
||||||
},
|
},
|
||||||
success:function(data){
|
success:function(data){
|
||||||
@@ -651,13 +663,35 @@
|
|||||||
|
|
||||||
var keuntungan_sebulan = getRoundedMethod(array_keuntungan['keuntungan']);
|
var keuntungan_sebulan = getRoundedMethod(array_keuntungan['keuntungan']);
|
||||||
var keuntungan_6bln = getRoundedMethod(keuntungan_sebulan * 6);
|
var keuntungan_6bln = getRoundedMethod(keuntungan_sebulan * 6);
|
||||||
|
var kadar_rebate;
|
||||||
|
|
||||||
|
if (pinjaman < 20000) {
|
||||||
|
var rebate = keuntungan_sebulan * 0.05;
|
||||||
|
} else if (pinjaman >= 20000 && pinjaman <= 50000) {
|
||||||
|
var rebate = keuntungan_sebulan * 0.10;
|
||||||
|
} else if (pinjaman > 50000 && pinjaman <= 100000) {
|
||||||
|
var rebate = keuntungan_sebulan * 0.15;
|
||||||
|
} else {
|
||||||
|
var rebate = keuntungan_sebulan * 0.20;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pinjaman < 20000) {
|
||||||
|
kadar_rebate = (5 / 100) * 100;
|
||||||
|
} else if (pinjaman >= 20000 && pinjaman <= 50000) {
|
||||||
|
kadar_rebate = (10 / 100) * 100;
|
||||||
|
} else if (pinjaman > 50000 && pinjaman <= 100000) {
|
||||||
|
kadar_rebate = (15 / 100) * 100;
|
||||||
|
} else {
|
||||||
|
kadar_rebate = (20 / 100) * 100;
|
||||||
|
}
|
||||||
|
|
||||||
$('.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(getRoundedMethod(array_keuntungan['ujrah']).toFixed(2)));
|
$('#ujrah').val(formatter.format(getRoundedMethod(array_keuntungan['ujrah']).toFixed(2)));
|
||||||
$('#onepercent').val(formatter.format(getRoundedMethod(array_keuntungan['onepercent']).toFixed(2)));
|
$('#onepercent').val(formatter.format(getRoundedMethod(array_keuntungan['onepercent']).toFixed(2)));
|
||||||
|
$('#rebate').val(formatter.format(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', {
|
||||||
|
|||||||
Reference in New Issue
Block a user