Merged in bugfix/block-tuntutbaki (pull request #330)
Bugfix/block tuntutbaki
This commit is contained in:
@@ -601,9 +601,26 @@ function ubahwakil(e)
|
||||
'hargajual' : hargajual
|
||||
},
|
||||
success:function(data){
|
||||
let urlroute = '{{ route("resit.tuntutbaki", ":id") }}';
|
||||
urlroute = urlroute.replace(':id', norujukan);
|
||||
Swal.fire(
|
||||
|
||||
if(data == 'kemaskini'){
|
||||
Swal.fire(
|
||||
'Amaran!',
|
||||
'Sila kemaskini aliran tunai dahulu!',
|
||||
'error'
|
||||
)
|
||||
return false;
|
||||
}
|
||||
else if(data == 'Baki tidak mencukupi'){
|
||||
Swal.fire(
|
||||
'Amaran!',
|
||||
'Baki tunai tidak mencukupi. Sila tambah baki tunai dahulu!',
|
||||
'error'
|
||||
)
|
||||
return false;
|
||||
}else if(data == 'Berjaya'){
|
||||
let urlroute = '{{ route("resit.tuntutbaki", ":id") }}';
|
||||
urlroute = urlroute.replace(':id', norujukan);
|
||||
Swal.fire(
|
||||
'Berjaya!',
|
||||
'Tuntut Baki Berjaya',
|
||||
'success'
|
||||
@@ -611,6 +628,15 @@ function ubahwakil(e)
|
||||
window.open(urlroute, '_blank');
|
||||
window.location.replace("{{ route('customer_info') }}");
|
||||
})
|
||||
}else{
|
||||
Swal.fire(
|
||||
'Amaran!',
|
||||
'Terdapat ralat semasa proses. Sila cuba lagi!',
|
||||
'error'
|
||||
)
|
||||
return false;
|
||||
}
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
|
||||
Reference in New Issue
Block a user