ordercreste
This commit is contained in:
@@ -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');
|
||||||
|
|||||||
Reference in New Issue
Block a user