pendahuluan
This commit is contained in:
@@ -143,7 +143,7 @@
|
||||
BAKI HARGA JUALAN(RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" id="bakihargajualan" value="{{ $gadai['bakihargajualan'] }}" class="form-control" readonly/>
|
||||
<input type="text" id="bakihargajualan" value="{{ number_format($gadai['bakihargajualan'],2) }}" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
BAKI PEMBIAYAAN(RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" id="pinjaman" value="{{ $gadai['bakipjm'] }}" class="form-control" readonly/>
|
||||
<input type="text" id="pinjaman" value="{{ number_format($gadai['bakipjm'],2) }}" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -164,7 +164,7 @@
|
||||
PEMBIAYAAN ASAL(RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" id="pinjamanasal" value="{{ $gadai['pinjaman'] }}" class="form-control" readonly/>
|
||||
<input type="text" id="pinjamanasal" value="{{ number_format($gadai['pinjaman'],2) }}" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -241,9 +241,9 @@
|
||||
PINJAMAN BARU(RM)
|
||||
</div>
|
||||
<div class="col-8 input-group mb-3">
|
||||
<input type="text" id="pinjamanbaru" value="{{ $gadai['pinjaman'] }}" class="form-control" aria-describedby="basic-addon2" readonly/>
|
||||
<input type="text" id="pinjamanbaru" value="{{ number_format($gadai['pinjaman'],2) }}" class="form-control" aria-describedby="basic-addon2" readonly/>
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text" id="basic-addon2">{{ $gadai['percentpinj']}}</span>
|
||||
<span class="input-group-text" id="basic-addon2">{{ $gadai['percentpinj'] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</diV>
|
||||
@@ -275,6 +275,10 @@
|
||||
|
||||
<script>
|
||||
|
||||
const formatter = new Intl.NumberFormat('en-US', {
|
||||
minimumFractionDigits: 2
|
||||
});
|
||||
|
||||
$('form input').keydown(function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
e.preventDefault();
|
||||
@@ -359,7 +363,7 @@
|
||||
url: api + '/api/upahtawarruq/' + kodcaw + '/' + norujukan,
|
||||
dataType: 'json',
|
||||
success:function(data){
|
||||
$('#jumlahupah').val(data.toFixed(2));
|
||||
$('#jumlahupah').val(formatter.format(data.toFixed(2)));
|
||||
$('#bayaranditerima').val(data);
|
||||
}
|
||||
});
|
||||
@@ -370,7 +374,7 @@
|
||||
url: api + '/api/tebustawarruq/' + kodcaw + '/' + norujukan,
|
||||
dataType: 'json',
|
||||
success:function(harga_tebus){
|
||||
$('#perludibayar').val(harga_tebus.toFixed(2));
|
||||
$('#perludibayar').val(formatter.format(harga_tebus.toFixed(2)));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -378,7 +382,7 @@
|
||||
}else if(tarikhgadai < tarikhtawarruq){
|
||||
let maxgadaila = "{{ $maxgadai = ($gadai['nilaimarhun'] * 0.8) - $gadai['pinjaman'] }}";
|
||||
|
||||
$('#tambahpinjamsebenar').val(Number(maxgadaila).toFixed(2));
|
||||
$('#tambahpinjamsebenar').val(formatter.format(Number(maxgadaila).toFixed(2)));
|
||||
|
||||
$('#divpembiayaanasal').show();
|
||||
$('#divbakihargajualan').hide();
|
||||
@@ -489,16 +493,16 @@
|
||||
"array_recno" : array_recno
|
||||
},
|
||||
success:function(success){
|
||||
let bayarz = $('#bayaran').val(Number(success.toFixed(2)));
|
||||
let bayarz = $('#bayaran').val(formatter.format(Number(success.toFixed(2))));
|
||||
|
||||
bayaranseparuhasal = Number(success.toFixed(2));
|
||||
|
||||
let bakihargajual = $('#bakihargajualan').val();
|
||||
let bakihargajual = $('#bakihargajualan').val().replace(/[^0-9.-]+/g,"");
|
||||
|
||||
$('#perludibayar').val(Number(success.toFixed(2)) + parseFloat($('#jumlahupah').val()));
|
||||
$('#perludibayar').val(formatter.format(Number(success.toFixed(2)) + parseFloat($('#jumlahupah').val())));
|
||||
|
||||
let totalbakipinjam = parseFloat($('#pinjaman').val()) - success;
|
||||
$('#bakipinjaman').val(totalbakipinjam.toFixed(2));
|
||||
let totalbakipinjam = parseFloat($('#pinjaman').val().replace(/[^0-9.-]+/g,"")) - success;
|
||||
$('#bakipinjaman').val(formatter.format(totalbakipinjam.toFixed(2)));
|
||||
|
||||
},error:function(xhr, textStatus, errorThrown){
|
||||
console.log(xhr.responseText);
|
||||
|
||||
Reference in New Issue
Block a user