added config for redeemoptions and changes from 'tebus separuh to tebus sebahagian'

This commit is contained in:
Hafifie PKB
2024-04-22 11:14:14 +08:00
parent ad024eb40a
commit 96ca467dd1
9 changed files with 69 additions and 52 deletions
+7
View File
@@ -0,0 +1,7 @@
<?php
return [
'enable_tambahpinjam' => env('ENABLE_TAMBAHPINJAM',1),
'enable_separuh' => env('ENABLE_SEPARUH',1),
'enable_pembiayaansemula' => env('ENABLE_AUTOTAWARRUQ',1)
];
?>
@@ -3384,7 +3384,7 @@
urlroute = urlroute.replace(':id', norujukan);
Swal.fire(
'Berjaya!',
'Tebus Separuh Berjaya',
'Tebus Sebahagian Berjaya',
'success'
) .then(function() {
window.open(urlroute, '_blank');
+1 -1
View File
@@ -246,7 +246,7 @@
<button class="btn btn-primary" onclick="ubahfunc(this)" id="button-edit-gadaian">Ubah</button>
<button class="btn btn-primary" onclick="hapusfunc()">Hapus</button>
<button class="btn btn-primary" onclick="histfunc()">Rekod Gadaian</button>
{{-- <button class="btn btn-primary" onclick="removeansuran(this)" id="button-remove-ansuran">Hapus Ansuran</button> --}}
<button class="btn btn-primary" onclick="removeansuran(this)" id="button-remove-ansuran">Hapus Ansuran</button>
</div>
</div>
+27 -27
View File
@@ -830,33 +830,33 @@
return false;
}
}else if(id_type=='passport'){
if(nokp.length < 5){
Swal.fire({
icon: 'error',
title: 'Amaran!',
text: 'Sila Periksa Passport Pelanggan'
});
event.preventDefault();
return false;
}
if(nokp.indexOf(' ') > 0){
Swal.fire({
icon: 'error',
title: 'Amaran!',
text: 'Sila Masukkan Passport Tanpa Ruang \'Kosong\' \n e.g(AP1111111)'
});
event.preventDefault();
return false;
}
if(regex.test(nokp) == false){
Swal.fire({
icon: 'error',
title: 'Amaran!',
text: 'Sila Periksa Passport Pelanggan'
});
event.preventDefault();
return false;
}
// if(nokp.length < 5){
// Swal.fire({
// icon: 'error',
// title: 'Amaran!',
// text: 'Sila Periksa Passport Pelanggan'
// });
// event.preventDefault();
// return false;
// }
// if(nokp.indexOf(' ') > 0){
// Swal.fire({
// icon: 'error',
// title: 'Amaran!',
// text: 'Sila Masukkan Passport Tanpa Ruang \'Kosong\' \n e.g(AP1111111)'
// });
// event.preventDefault();
// return false;
// }
// if(regex.test(nokp) == false){
// Swal.fire({
// icon: 'error',
// title: 'Amaran!',
// text: 'Sila Periksa Passport Pelanggan'
// });
// event.preventDefault();
// return false;
// }
}
}
</script>
+1 -1
View File
@@ -2539,7 +2539,7 @@
urlroute = urlroute.replace(':id', norujukan);
Swal.fire(
'Berjaya!',
'Tebus Separuh Berjaya',
'Tebus Sebahagian Berjaya',
'success'
) .then(function() {
window.open(urlroute, '_blank');
@@ -2800,7 +2800,7 @@
urlroute = urlroute.replace(':id', norujukan);
Swal.fire(
'Berjaya!',
'Tebus Separuh Berjaya',
'Tebus Sebahagian Berjaya',
'success'
) .then(function() {
window.open(urlroute, '_blank');
@@ -3011,7 +3011,7 @@
urlroute = urlroute.replace(':id', norujukan);
Swal.fire(
'Berjaya!',
'Tebus Separuh Berjaya',
'Tebus Sebahagian Berjaya',
'success'
) .then(function() {
window.open(urlroute, '_blank');
+24 -14
View File
@@ -92,10 +92,16 @@
<option value="T">T = Tebus</option>
<option value="A" {{ $gadai['tempoh'] >= 12 ? 'disabled' : '' }}>A = Ansuran</option>
@if($gadai['tagbaru'] == 1)
<option value="S">S = Sebahagian</option>
<option value="P">P = Tambah Pembiayaan</option>
@if(config('redeemoption.enable_separuh') == 1)
<option value="S">S = Sebahagian</option>
@endif
@if(config('redeemoption.enable_tambahpinjam') == 1)
<option value="P">P = Tambah Pembiayaan</option>
@endif
@endif
@if(config('redeemoption.enable_pembiayaansemula') == 1)
<option value="AT">PS = Pembiayaan Semula</option>
@endif
<option value="AT">PS = Pembiayaan Semula</option>
<option value="" disabled hidden>Pilih Jenis Tebus</option>
</select>
</div>
@@ -1740,14 +1746,14 @@
function bayaransemua()
{
$("#terima_transaksi").prop('disabled', true);
Swal.fire({
title: 'Memuatkan...',
allowEscapeKey : false,
allowOutsideClick: false,
didOpen: function () {
Swal.showLoading();
}
});
// Swal.fire({
// title: 'Memuatkan...',
// allowEscapeKey : false,
// allowOutsideClick: false,
// didOpen: function () {
// Swal.showLoading();
// }
// });
var jumupah = parseFloat($('#jumlahupah').val().replace(/[^0-9.-]+/g,""));
@@ -2432,6 +2438,7 @@
var check_komuditi = Object.keys(komoditi).length;
if(check_komuditi == 0){
$("#terima_transaksi").prop('disabled', false);
Swal.close();
Swal.fire({
icon: 'error',
title: 'Unit Komuditi Berbaki Minumum',
@@ -2443,6 +2450,7 @@
}else{
if(Number(komoditi['unit_komuditi']) < pinjaman_baru){
$("#terima_transaksi").prop('disabled', false);
Swal.close();
Swal.fire({
icon: 'error',
title: 'Baki Unit Komuditi Tidak Mencukupi',
@@ -2485,7 +2493,8 @@
event.preventDefault();
}
if( $('#tambahpinjam').val() <= 0 && $('#tambahpinjam').val() === ''){
if( $('#tambahpinjam').val() <= 0 || $('#tambahpinjam').val() === ''){
$("#terima_transaksi").prop('disabled', false);
Swal.fire(
'Amaran!',
@@ -2495,13 +2504,14 @@
return false;
}
if(parseFloat($('#basic-addon2').text()) > 75 && parseFloat($('#basic-addon2').text()) <= 80){
const swalWithBootstrapButtons = Swal.mixin({
customClass: {
confirmButton: 'btn btn-success',
cancelButton: 'btn btn-danger'
},
buttonsStyling: false
buttonsStyling: false,
});
swalWithBootstrapButtons.fire({
@@ -3455,7 +3465,7 @@
urlroute = urlroute.replace(':id', norujukan);
Swal.fire(
'Berjaya!',
'Tebus Separuh Berjaya',
'Tebus Sebahagian Berjaya',
'success'
) .then(function() {
window.open(urlroute, '_blank');
@@ -225,8 +225,8 @@
$totalduitmasuk += $item['duit_masuk'];
$totalkeuntungan += $item['bayaran_keuntungan'];
$totalpendahuluan += $item['bayaran_pembiayaan'];
$totalujrah += bcdiv(round($item['ansuranujrah'],2),1,1);
$totalonepercent += bcdiv(round($item['ansuranonepercent'],2),1,1);
$totalujrah += round($item['ansuranujrah'],2);
$totalonepercent += round($item['ansuranonepercent'],2);
@endphp
@if($index > 0)
@@ -267,8 +267,8 @@
<td>{{ $item['tempoh'] }}</td>
<td>{{ number_format($item['bakipjm'],2) }}</td>
<td>{{ number_format($item['bayaran_pembiayaan'],2) }}</td>
<td>{{ number_format(bcdiv(round($item['ansuranujrah'],2),1,1),2) }}</td>
<td>{{ number_format(bcdiv(round($item['ansuranonepercent'],2),1,1),2) }}</td>
<td>{{ number_format(round($item['ansuranujrah'],2),2) }}</td>
<td>{{ number_format(round($item['ansuranonepercent'],2),2) }}</td>
<td>{{ number_format($item['bayaran_keuntungan'],2) }}</td>
<td>{{ number_format($item['duit_masuk'],2) }}</td>
</tr>
@@ -277,8 +277,8 @@
$totaldmteller += $item['duit_masuk'];
$totalupahteller += $item['bayaran_keuntungan'];
$totalpendhteller += $item['bayaran_pembiayaan'];
$totalujrahteller += bcdiv(round($item['ansuranujrah'],2),1,1);
$totalonepercentteller += bcdiv(round($item['ansuranonepercent'],2),1,1);
$totalujrahteller += round($item['ansuranujrah'],2);
$totalonepercentteller += round($item['ansuranonepercent'],2);
@endphp
@if($index+1 < sizeof($tebus))