FIX_COMMISSION
This commit is contained in:
parent
5c668e41f9
commit
5247d20e07
@ -43,6 +43,14 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.swal-append-btn {
|
||||||
|
background-color: #007bff !important; /* Blue */
|
||||||
|
color: #fff !important;
|
||||||
|
border: none !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@ -524,29 +532,45 @@
|
|||||||
|
|
||||||
// Duplicate check
|
// Duplicate check
|
||||||
if (isDublicateFound) {
|
if (isDublicateFound) {
|
||||||
|
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: "Duplicate found. What do you want?",
|
icon: "warning",
|
||||||
showCancelButton: true,
|
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",
|
confirmButtonText: "Overwrite",
|
||||||
cancelButtonText: "Append",
|
denyButtonText: "Append",
|
||||||
|
cancelButtonText: "Cancel",
|
||||||
confirmButtonColor: "#ff3333",
|
confirmButtonColor: "#ff3333",
|
||||||
|
customClass: {
|
||||||
|
denyButton: 'swal-append-btn' // Apply CSS class
|
||||||
|
}
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
|
|
||||||
if (result.isConfirmed) {
|
if (result.isConfirmed) {
|
||||||
|
// Overwrite
|
||||||
formData.append('overwrite', 1);
|
formData.append('overwrite', 1);
|
||||||
} else {
|
submitAjax(formData);
|
||||||
|
isDublicateFound = false;
|
||||||
|
|
||||||
|
} else if (result.isDenied) {
|
||||||
|
// Append
|
||||||
formData.append('overwrite', 0);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// If no duplicate, submit normally
|
// If no duplicate, submit normally
|
||||||
submitAjax(formData);
|
submitAjax(formData);
|
||||||
|
|
||||||
@ -563,7 +587,9 @@
|
|||||||
function deleteCommissionData(id) {
|
function deleteCommissionData(id) {
|
||||||
|
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
|
icon: "warning",
|
||||||
title: "Do you want to delete commission & it's data if any?",
|
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,
|
showCancelButton: true,
|
||||||
confirmButtonText: "Delete",
|
confirmButtonText: "Delete",
|
||||||
confirmButtonColor: "#ff3333",
|
confirmButtonColor: "#ff3333",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user