fixing bug skit2

This commit is contained in:
hafifierahman
2021-02-27 10:59:34 +08:00
parent 36b21e6a82
commit 8243987555
7 changed files with 717 additions and 339 deletions
+31 -16
View File
@@ -283,8 +283,18 @@ async function openuptambahdanserah(e)
confirmButtonText: 'Terima',
showCancelButton:true,
cancelButtonText:'Batal',
allowOutsideClick: true
})
allowOutsideClick: true,
inputValidator: (value) => {
if (!value) {
return 'Isikan tempat kosong diatas!'
}
if(isNaN(value))
{
return 'Amaun hendaklah dalam nombor!'
}
}
});
if (amaun) {
// Swal.fire(`Entered email: ${amaun}`)
@@ -346,11 +356,11 @@ async function openuptambahdanserah(e)
}
}
else{
Swal.fire('error','Isikan kotak kosong diatas!','error');
}
}else if(id == 'serahanmodal')
{
let bakiakhir = parseFloat($('#bakiakhir').text().substring(2).replace(/[^0-9.-]+/g,""));
const { value: amaun } = await Swal.fire({
title: 'Masukkan Amaun Serahan',
input: 'text',
@@ -358,16 +368,24 @@ async function openuptambahdanserah(e)
confirmButtonText: 'Terima',
showCancelButton:true,
cancelButtonText:'Batal',
allowOutsideClick: true
})
allowOutsideClick: true,
inputValidator: (value) => {
if (!value) {
return 'Isikan tempat kosong diatas!'
}
let bakiakhir = parseFloat($('#bakiakhir').text().substring(2).replace(/[^0-9.-]+/g,""));
if(value > bakiakhir)
{
return 'Amaun serahan hendaklah tidak lebih daripada baki akhir tunai!';
}
if(isNaN(value))
{
return 'Amaun hendaklah dalam nombor!'
}
}
});
if(amaun > bakiakhir)
{
Swal.fire('error','Amaun serahan hendaklah tidak lebih daripada baki akhir tunai!','error');
return false;
}
if (amaun) {
// Swal.fire(`Entered email: ${amaun}`)
@@ -386,9 +404,6 @@ async function openuptambahdanserah(e)
}
}
else{
Swal.fire('error','Isikan kotak kosong diatas!','error');
}
}