fix handle error and add note for shippings receive approve and reject mutations
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user