fix handle error and add note for shippings receive approve and reject mutations

This commit is contained in:
2025-06-13 14:19:12 +07:00
parent b2bfd666a7
commit 2f5eff9e63
28 changed files with 13055 additions and 154 deletions

View File

@@ -21,7 +21,12 @@ $(document).ready(function () {
if (fromDealerId && toDealerId && fromDealerId === toDealerId) {
$(this).val("").trigger("change");
alert("Dealer asal dan tujuan tidak boleh sama!");
Swal.fire({
type: "error",
title: "Oops...",
text: "Dealer asal dan tujuan tidak boleh sama",
});
return false;
}
// Update available stock when dealer changes
@@ -216,24 +221,40 @@ $(document).ready(function () {
// Check dealers
if (!fromDealerId) {
alert("Pilih dealer asal");
Swal.fire({
type: "error",
title: "Oops...",
text: "Pilih dealer asal",
});
return false;
}
if (!toDealerId) {
alert("Pilih dealer tujuan");
Swal.fire({
type: "error",
title: "Oops...",
text: "Pilih dealer tujuan",
});
return false;
}
if (fromDealerId === toDealerId) {
alert("Dealer asal dan tujuan tidak boleh sama");
Swal.fire({
type: "error",
title: "Oops...",
text: "Dealer asal dan tujuan tidak boleh sama",
});
return false;
}
// Check products
const productRows = $(".product-row");
if (productRows.length === 0) {
alert("Tambahkan minimal satu produk");
Swal.fire({
type: "error",
title: "Oops...",
text: "Tambahkan minimal satu produk",
});
return false;
}
@@ -248,7 +269,11 @@ $(document).ready(function () {
});
if (!hasValidProduct) {
alert("Pilih minimal satu produk dengan quantity yang valid");
Swal.fire({
type: "error",
title: "Oops...",
text: "Pilih minimal satu produk dengan quantity yang valid",
});
return false;
}