aliran tunai fix carry forward baki
This commit is contained in:
@@ -716,250 +716,293 @@
|
||||
var min_pinjaman = nilai_marhun_total * 0.10;
|
||||
var max_pinjaman = nilai_marhun_total * 0.80;
|
||||
|
||||
if(pinjaman < min_pinjaman){
|
||||
let teller = "{{ Auth::user()->name }}";
|
||||
let bakiakhir = 0;
|
||||
var kodcaw = $('#kodcaw').val();
|
||||
|
||||
$.ajax({
|
||||
method: 'get',
|
||||
url: api_url + '/api/GetCurrentTunai/' + kodcaw,
|
||||
async: false,
|
||||
dataType:'json',
|
||||
data:{
|
||||
'kodlaluan': teller
|
||||
},
|
||||
success:function(data){
|
||||
bakiakhir = data.baki;
|
||||
}
|
||||
});
|
||||
|
||||
if(bakiakhir < pinjaman)
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Baki Akhir Tunai Lebih Rendah Daripada Nilai Marhun Yang Ingin Digadaikan. Sila Tambah Pendahuluan di Laman Aliran Tunai Segera. '
|
||||
});
|
||||
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
|
||||
if($.isNumeric(pinjaman) == false){
|
||||
$("#terima_gadai").prop('disabled', false);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukan Pembiayaan, Minimal Pembiayaan ialah RM '+ formatter.format(min_pinjaman)
|
||||
text: 'Sila Masukkan Nombor Sahaja'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
else if(pinjaman > max_pinjaman){
|
||||
$("#terima_gadai").prop('disabled', false);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Pinjaman Melebihi Margin Yang Dibenarkan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
if(pinjaman > Number(pembiyaan_max_pelulus)+10 || pinjaman >=10000){
|
||||
const swalWithBootstrapButtons = Swal.mixin({
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-success',
|
||||
cancelButton: 'btn btn-danger'
|
||||
},
|
||||
buttonsStyling: false
|
||||
})
|
||||
}
|
||||
if(pinjaman < min_pinjaman){
|
||||
$("#terima_gadai").prop('disabled', false);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila Masukan Pembiayaan, Minimal Pembiayaan ialah RM '+ formatter.format(min_pinjaman)
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
else if(pinjaman > max_pinjaman){
|
||||
$("#terima_gadai").prop('disabled', false);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Pinjaman Melebihi Margin Yang Dibenarkan'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
if(pinjaman > Number(pembiyaan_max_pelulus)+10 || pinjaman >=10000){
|
||||
const swalWithBootstrapButtons = Swal.mixin({
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-success',
|
||||
cancelButton: 'btn btn-danger'
|
||||
},
|
||||
buttonsStyling: false
|
||||
})
|
||||
|
||||
if(pinjaman > Number(pembiyaan_max_pelulus)+10){
|
||||
var errortext = "Tetapan margin melebihi 75% untuk Operasi!";
|
||||
}
|
||||
if(pinjaman >= 10000){
|
||||
var errortext = "Pinjaman Melebihi 10000";
|
||||
}
|
||||
if(pinjaman > Number(pembiyaan_max_pelulus)+10){
|
||||
var errortext = "Tetapan margin melebihi 75% untuk Operasi!";
|
||||
}
|
||||
if(pinjaman >= 10000){
|
||||
var errortext = "Pinjaman Melebihi 10000";
|
||||
}
|
||||
|
||||
swalWithBootstrapButtons.fire({
|
||||
title: 'Dapatkan Pengesahan Operasi',
|
||||
text: errortext,
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Hantar',
|
||||
cancelButtonText: 'Batal',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
let norujukan = $('#norujukan').val();
|
||||
|
||||
Swal.fire({
|
||||
title: 'Tunggu Pengesahan Daripada Operasi.',
|
||||
icon: 'info',
|
||||
width: 600,
|
||||
padding: '3em',
|
||||
background: '#fffff',
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false
|
||||
})
|
||||
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url: "{{ route('operasi.createkelulusan') }}",
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"norujukan" : norujukan
|
||||
// "teller" : teller,
|
||||
// "dategadai" : dategadai,
|
||||
// "bilgadai" : noic,
|
||||
// "jumpinjam" : jumpinjam,
|
||||
// "teller" : teller
|
||||
|
||||
},
|
||||
success:function(data){
|
||||
swalWithBootstrapButtons.fire({
|
||||
title: 'Dapatkan Pengesahan Operasi',
|
||||
text: errortext,
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Hantar',
|
||||
cancelButtonText: 'Batal',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
console.log(data);
|
||||
let norujukan = $('#norujukan').val();
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
Swal.fire({
|
||||
title: 'Tunggu Pengesahan Daripada Operasi.',
|
||||
icon: 'info',
|
||||
width: 600,
|
||||
padding: '3em',
|
||||
background: '#fffff',
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false
|
||||
})
|
||||
|
||||
//TIME INTERVAL
|
||||
let timerInterval;
|
||||
|
||||
timerInterval = setInterval(function(){
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: "{{ route('operasi.getkelulusan') }}",
|
||||
method:'post',
|
||||
url: "{{ route('operasi.createkelulusan') }}",
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"norujukan" : norujukan
|
||||
// "teller" : teller,
|
||||
// "dategadai" : dategadai,
|
||||
// "bilgadai" : noic,
|
||||
// "jumpinjam" : jumpinjam,
|
||||
// "teller" : teller
|
||||
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
if(data != '')
|
||||
{
|
||||
clearInterval(timerInterval);
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Anda Berjaya Menerima Pengesahan'
|
||||
}).then(function(){
|
||||
|
||||
$(func).attr("onSubmit","return true;");
|
||||
$(func).submit();
|
||||
return true;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
console.log(data);
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}, 3000);
|
||||
} else if (result.dismiss === Swal.DismissReason.cancel){
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Batal',
|
||||
'Malumat Gadaian Tidak Berjaya Disimpan',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
event.preventDefault();
|
||||
return false;
|
||||
|
||||
}else if(pinjaman > Number(pembiayaan_max_teller)+10){
|
||||
const swalWithBootstrapButtons = Swal.mixin({
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-success',
|
||||
cancelButton: 'btn btn-danger'
|
||||
},
|
||||
buttonsStyling: false
|
||||
})
|
||||
|
||||
swalWithBootstrapButtons.fire({
|
||||
title: 'Dapatkan Pengesahan Daripada Khazanah?',
|
||||
text: "Tetapan margin melebihi 70% untuk Khazanah!",
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Hantar',
|
||||
cancelButtonText: 'Batal',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
//TIME INTERVAL
|
||||
let timerInterval;
|
||||
|
||||
let norujukan = $('#norujukan').val();
|
||||
timerInterval = setInterval(function(){
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: "{{ route('operasi.getkelulusan') }}",
|
||||
data: {
|
||||
"norujukan" : norujukan
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
if(data != '')
|
||||
{
|
||||
clearInterval(timerInterval);
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Anda Berjaya Menerima Pengesahan'
|
||||
}).then(function(){
|
||||
|
||||
Swal.fire({
|
||||
title: 'Tunggu Pengesahan Daripada Khazanah.',
|
||||
icon: 'info',
|
||||
width: 600,
|
||||
padding: '3em',
|
||||
background: '#fffff',
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false
|
||||
})
|
||||
$(func).attr("onSubmit","return true;");
|
||||
$(func).submit();
|
||||
return true;
|
||||
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url: "{{ route('khazanah.createkelulusan') }}",
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"norujukan" : norujukan
|
||||
// "teller" : teller,
|
||||
// "dategadai" : dategadai,
|
||||
// "bilgadai" : noic,
|
||||
// "jumpinjam" : jumpinjam,
|
||||
// "teller" : teller
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
console.log(data);
|
||||
});
|
||||
}
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
//TIME INTERVAL
|
||||
let timerInterval;
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}, 3000);
|
||||
} else if (result.dismiss === Swal.DismissReason.cancel){
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Batal',
|
||||
'Malumat Gadaian Tidak Berjaya Disimpan',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
timerInterval = setInterval(function(){
|
||||
event.preventDefault();
|
||||
return false;
|
||||
|
||||
}else if(pinjaman > Number(pembiayaan_max_teller)+10){
|
||||
const swalWithBootstrapButtons = Swal.mixin({
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-success',
|
||||
cancelButton: 'btn btn-danger'
|
||||
},
|
||||
buttonsStyling: false
|
||||
})
|
||||
|
||||
swalWithBootstrapButtons.fire({
|
||||
title: 'Dapatkan Pengesahan Daripada Khazanah?',
|
||||
text: "Tetapan margin melebihi 70% untuk Khazanah!",
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Hantar',
|
||||
cancelButtonText: 'Batal',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
let norujukan = $('#norujukan').val();
|
||||
|
||||
Swal.fire({
|
||||
title: 'Tunggu Pengesahan Daripada Khazanah.',
|
||||
icon: 'info',
|
||||
width: 600,
|
||||
padding: '3em',
|
||||
background: '#fffff',
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false
|
||||
})
|
||||
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: "{{ route('khazanah.getkelulusan') }}",
|
||||
method:'post',
|
||||
url: "{{ route('khazanah.createkelulusan') }}",
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"norujukan" : norujukan
|
||||
// "teller" : teller,
|
||||
// "dategadai" : dategadai,
|
||||
// "bilgadai" : noic,
|
||||
// "jumpinjam" : jumpinjam,
|
||||
// "teller" : teller
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
if(data != '')
|
||||
{
|
||||
clearInterval(timerInterval);
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Anda Berjaya Menerima Pengesahan'
|
||||
}).then(function(){
|
||||
|
||||
$(func).attr("onSubmit","return true;");
|
||||
$(func).submit();
|
||||
return true;
|
||||
|
||||
});
|
||||
}
|
||||
console.log(data);
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
}, 3000);
|
||||
|
||||
} else if (result.dismiss === Swal.DismissReason.cancel) {
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Batal',
|
||||
'Maklumat Gadaian Tidak Berjaya Disimpan',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
else if(pinjaman < 10000){
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Berjaya!',
|
||||
text: 'Gadaian Berjaya Disimpan'
|
||||
});
|
||||
return true;
|
||||
});
|
||||
|
||||
//TIME INTERVAL
|
||||
let timerInterval;
|
||||
|
||||
timerInterval = setInterval(function(){
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: "{{ route('khazanah.getkelulusan') }}",
|
||||
data: {
|
||||
"norujukan" : norujukan
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
if(data != '')
|
||||
{
|
||||
clearInterval(timerInterval);
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Anda Berjaya Menerima Pengesahan'
|
||||
}).then(function(){
|
||||
|
||||
$(func).attr("onSubmit","return true;");
|
||||
$(func).submit();
|
||||
return true;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
}, 3000);
|
||||
|
||||
} else if (result.dismiss === Swal.DismissReason.cancel) {
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Batal',
|
||||
'Maklumat Gadaian Tidak Berjaya Disimpan',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
else if(pinjaman < 10000){
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Berjaya!',
|
||||
text: 'Gadaian Berjaya Disimpan'
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user