fixing bug skit2
This commit is contained in:
Vendored
+31
-16
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user