ordercreste
This commit is contained in:
@@ -276,6 +276,7 @@ const MultipleOrders = () => {
|
||||
|
||||
// ========================================================= || handleCheckboxChange || =========================================================
|
||||
const handleCheckboxChange = async (event, customer) => {
|
||||
console.log('customer', customer);
|
||||
if (event.target.checked) {
|
||||
// If the checkbox is checked, calculate the distance and add the customer
|
||||
try {
|
||||
@@ -343,6 +344,10 @@ const MultipleOrders = () => {
|
||||
const roundedDistance = Math.round(distanceInKilometers);
|
||||
let totalcharge;
|
||||
if (roundedDistance < minKm) {
|
||||
console.log('minKm', minKm);
|
||||
console.log('pricePerKm', pricePerKm);
|
||||
console.log('basePrice', basePrice);
|
||||
totalcharge = basePrice;
|
||||
setTotalCharge(basePrice);
|
||||
} else {
|
||||
console.log('minKm', minKm);
|
||||
@@ -598,7 +603,6 @@ const MultipleOrders = () => {
|
||||
// notifyadmin(admintoken);
|
||||
sendnotifications();
|
||||
}
|
||||
|
||||
navigate('/orders');
|
||||
} else {
|
||||
opentoast(res.data.message, 'warning');
|
||||
|
||||
Reference in New Issue
Block a user