ordercreste

This commit is contained in:
joshikannan
2024-04-24 16:42:28 +05:30
parent f61be9285d
commit 86034b370c

View File

@@ -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');