FIX_COMMISSION
This commit is contained in:
parent
5c668e41f9
commit
5247d20e07
@ -43,6 +43,14 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.swal-append-btn {
|
||||
background-color: #007bff !important; /* Blue */
|
||||
color: #fff !important;
|
||||
border: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<style>
|
||||
@ -524,29 +532,45 @@
|
||||
|
||||
// Duplicate check
|
||||
if (isDublicateFound) {
|
||||
|
||||
Swal.fire({
|
||||
title: "Duplicate found. What do you want?",
|
||||
showCancelButton: true,
|
||||
icon: "warning",
|
||||
title: "Existing rules found for this insurer and month. What would you like to do?",
|
||||
showDenyButton: true, // For Append
|
||||
showCancelButton: true, // For Cancel
|
||||
confirmButtonText: "Overwrite",
|
||||
cancelButtonText: "Append",
|
||||
denyButtonText: "Append",
|
||||
cancelButtonText: "Cancel",
|
||||
confirmButtonColor: "#ff3333",
|
||||
customClass: {
|
||||
denyButton: 'swal-append-btn' // Apply CSS class
|
||||
}
|
||||
}).then((result) => {
|
||||
|
||||
if (result.isConfirmed) {
|
||||
// Overwrite
|
||||
formData.append('overwrite', 1);
|
||||
} else {
|
||||
submitAjax(formData);
|
||||
isDublicateFound = false;
|
||||
|
||||
} else if (result.isDenied) {
|
||||
// Append
|
||||
formData.append('overwrite', 0);
|
||||
submitAjax(formData);
|
||||
isDublicateFound = false;
|
||||
|
||||
} else if (result.dismiss === Swal.DismissReason.cancel) {
|
||||
// Cancel clicked
|
||||
console.log("Cancelled");
|
||||
isDublicateFound = true;
|
||||
}
|
||||
|
||||
isDublicateFound = false;
|
||||
|
||||
// 🔥 Continue with form submission AFTER append
|
||||
submitAjax(formData);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// If no duplicate, submit normally
|
||||
submitAjax(formData);
|
||||
|
||||
@ -563,7 +587,9 @@
|
||||
function deleteCommissionData(id) {
|
||||
|
||||
Swal.fire({
|
||||
icon: "warning",
|
||||
title: "Do you want to delete commission & it's data if any?",
|
||||
html: "<small class='text-danger'>This data cannot be retrieved.</small>",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: "Delete",
|
||||
confirmButtonColor: "#ff3333",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user