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