updates on the dead codes removal
This commit is contained in:
@@ -229,14 +229,6 @@ const OrdersPreview = () => {
|
||||
enabled: appId !== 0 // Ensures query runs only when appId is valid
|
||||
});
|
||||
|
||||
const getRiderName = async (userid) => {
|
||||
await ridersList.map((rider) => {
|
||||
if (rider.userid == userid) {
|
||||
return rider.firstname;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const paymentOptions = useMemo(
|
||||
() => (paymentModes || []).map((v) => ({ value: String(v.apptypeid), label: v.label })),
|
||||
[paymentModes]
|
||||
|
||||
@@ -11,7 +11,6 @@ import { FaLocationDot } from 'react-icons/fa6';
|
||||
import axios from 'axios';
|
||||
import Geocode from 'react-geocode';
|
||||
import Loader from 'components/Loader';
|
||||
import * as geolib from 'geolib';
|
||||
import { FaUser } from 'react-icons/fa6';
|
||||
import dayjs from 'dayjs';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
@@ -58,10 +57,10 @@ import {
|
||||
|
||||
// ============================================================================
|
||||
// Plain-CSS layout shims — Astryx has no Grid/Stack/Box/Typography/Paper
|
||||
// equivalents, so these small local helpers (not @mui) stand in for the MUI
|
||||
// equivalents, so these small local helpers stand in for the
|
||||
// layout primitives previously used here, translating the same `sx`-shaped
|
||||
// spacing shorthand (p/m/gap/borderRadius are ×8px steps, bgcolor→
|
||||
// backgroundColor) into real inline CSS. MUI pseudo-selector keys (e.g.
|
||||
// backgroundColor) into real inline CSS. Pseudo-selector keys (e.g.
|
||||
// `'&:hover'`) are not representable inline and are dropped.
|
||||
// ============================================================================
|
||||
const SPACING_KEYS = {
|
||||
@@ -321,37 +320,13 @@ function loadScript(src, position, id) {
|
||||
const Createorder1 = () => {
|
||||
Geocode.setApiKey(process.env.REACT_APP_GOOGLE_MAPS_API_KEY);
|
||||
// ================================================= || GoogleMaps (Drawer) || =================================================
|
||||
const [value, setValue] = React.useState(null);
|
||||
const [value1, setValue1] = React.useState(null);
|
||||
const [inputValue, setInputValue] = React.useState('');
|
||||
const [inputValue1, setInputValue1] = React.useState('');
|
||||
const [, setValue] = React.useState(null);
|
||||
const [, setValue1] = React.useState(null);
|
||||
const [inputValue2, setInputValue2] = React.useState('');
|
||||
const [inputValue3, setInputValue3] = React.useState('');
|
||||
const [options, setOptions] = React.useState([]);
|
||||
const [options1, setOptions1] = React.useState([]);
|
||||
const loaded = React.useRef(false);
|
||||
const loaded1 = React.useRef(false);
|
||||
const [mobilenumber, setMobilenumber] = useState('');
|
||||
const [emailaddress, setEmailaddress] = useState('');
|
||||
const [city, setCity] = useState('');
|
||||
const [city1, setCity1] = useState('');
|
||||
const [zipcode, setZipcode] = useState('');
|
||||
const [zipcode1, setZipcode1] = useState('');
|
||||
const [state, setState] = useState('');
|
||||
const [state1, setState1] = useState('');
|
||||
const [suburb, setSuburb] = useState('');
|
||||
const [suburb1, setSuburb1] = useState('');
|
||||
const [pickContactName, setPickContactName] = useState('');
|
||||
const [dropContactName, setDropContactName] = useState('');
|
||||
const [pickdoorno, setPickDoorno] = useState('');
|
||||
const [dropDoorno, setDropDoorno] = useState('');
|
||||
const [pickLandmark, setPickLandmark] = useState('');
|
||||
const [dropLandmark, setDropLandmark] = useState('');
|
||||
const [address, setAddress] = useState('');
|
||||
const [address1, setAddress1] = useState('');
|
||||
const [latlong, setLatlong] = useState({});
|
||||
const [latlong1, setLatlong1] = useState({});
|
||||
const autocompleteService = useRef(null);
|
||||
const [, setAddress] = useState('');
|
||||
const [, setAddress1] = useState('');
|
||||
const [tenanatLocoId, setTenanatLocoId] = useState(localStorage.getItem('locationid'));
|
||||
const [isLocation, setIsLocation] = useState(false);
|
||||
const textFieldRef1 = useRef(null);
|
||||
@@ -359,28 +334,6 @@ const Createorder1 = () => {
|
||||
const [collectionamt, setCollectionamt] = useState(0);
|
||||
const [quantity, setQuantity] = useState(1);
|
||||
|
||||
const handleOkClick1 = () => {
|
||||
// Set focus back to the text field after clicking the "OK" chip
|
||||
if (textFieldRef1.current) {
|
||||
textFieldRef1.current.focus();
|
||||
}
|
||||
};
|
||||
|
||||
const handleOkClick2 = () => {
|
||||
// Set focus back to the text field after clicking the "OK" chip
|
||||
if (textFieldRef2.current) {
|
||||
textFieldRef2.current.focus();
|
||||
}
|
||||
};
|
||||
|
||||
const top100Films = [
|
||||
{ label: 'The Shawshank Redemption', year: 1994 },
|
||||
{ label: 'The Godfather', year: 1972 },
|
||||
{ label: 'The Godfather: Part II', year: 1974 },
|
||||
{ label: 'The Dark Knight', year: 2008 },
|
||||
{ label: '12 Angry Men', year: 1957 }
|
||||
];
|
||||
|
||||
// // // ====================================================== || address (pick)|| ======================================================
|
||||
// useEffect(() => {
|
||||
// if (address) {
|
||||
@@ -603,52 +556,28 @@ const Createorder1 = () => {
|
||||
|
||||
const appId = localStorage.getItem('applocationid');
|
||||
const navigate = useNavigate();
|
||||
const [open, setOpen] = useState({});
|
||||
const [open1, setOpen1] = useState('');
|
||||
const [open2, setOpen2] = useState(false);
|
||||
const [open3, setOpen3] = useState(false);
|
||||
const [open4, setOpen4] = useState(false);
|
||||
const [shift, setShift] = useState(1);
|
||||
const [clientlist, setClientlist] = useState([]);
|
||||
const [clientdetail, setClientdetail] = useState([]);
|
||||
const [eventname, setEventname] = useState('');
|
||||
const [startdate, setStartdate] = useState(dayjs().format('MM-DD-YYYY'));
|
||||
const [enddate, setEnddate] = useState(dayjs().add(1, 'day').format('MM-DD-YYYY'));
|
||||
const [, setEnddate] = useState(dayjs().add(1, 'day').format('MM-DD-YYYY'));
|
||||
// const [starttime, setStatrttime] = useState(`${dayjs().format('MM-DD-YYYY')} 08:00:00`);
|
||||
const [starttime, setStatrttime] = useState();
|
||||
// const [endtime, setEndtime] = useState(`${dayjs().format('MM-DD-YYYY')} 20:00:00`);
|
||||
const [endtime, setEndtime] = useState();
|
||||
const [timeslotarr, setTimeslotarr] = useState([]);
|
||||
const [currentsno, setCurrentsno] = useState('');
|
||||
const [roleoptions, setRoleoptions] = useState([]);
|
||||
const [otherinstructions, setOtherinstructions] = useState('');
|
||||
const [attireslist, setAttireslist] = useState([]);
|
||||
const [serviceaddonslist, setServiceaddonslist] = useState([]);
|
||||
const [orderaddonobj, setOrderaddonobj] = useState([]);
|
||||
const [stafflist, setStafflist] = useState([]);
|
||||
const [loading2, setLoading2] = useState(false);
|
||||
const [, setLoading2] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [btnLoading, setBtnLoading] = useState(false);
|
||||
const [shiftarr, setShiftarr] = useState([]);
|
||||
const [shiftarr1, setShiftarr1] = useState([]);
|
||||
const [orderarr, setOrderarr] = useState([]);
|
||||
const [shiftarr] = useState([]);
|
||||
const [, setOrderarr] = useState([]);
|
||||
const [alertmessage, setAlertmessage] = useState('');
|
||||
const [tabstatus, setTabstatus] = useState('');
|
||||
const [tenantinfo, setTenantinfo] = useState({});
|
||||
const [searchword, setSearchword] = useState('');
|
||||
const [clientdetailarr, setClientdetailarr] = useState([]);
|
||||
const [clientdetailbusinessarr, setClientdetailbusinessarr] = useState([]);
|
||||
const [searchword] = useState('');
|
||||
const [, setClientdetailarr] = useState([]);
|
||||
const [admintoken, setAdmintoken] = useState();
|
||||
const [tenantlocationlist, setTenantlocationlist] = useState([]);
|
||||
const [tenant, setTenant] = useState({});
|
||||
const [clientinfo, setClientinfo] = useState({});
|
||||
const [selectedtime, setSelectedtime] = useState('');
|
||||
const [tenantlist, setTenantlist] = useState([]);
|
||||
const [tenantid, setTenantid] = useState();
|
||||
const [tenantlocation, setTenantlocation] = useState('');
|
||||
const [pickupswitch, setPickupswitch] = useState(true);
|
||||
const [deliverytype, setDeliverytype] = useState('B');
|
||||
const [dropswitch, setDropswitch] = useState(false);
|
||||
const [, setTenantid] = useState();
|
||||
const [startPoint, setStartPoint] = useState({ latitude: 0, longitude: 0 });
|
||||
const [endPoint, setEndPoint] = useState({ latitude: 0, longitude: 0 });
|
||||
const [showDistance, setShowDistance] = useState(false);
|
||||
@@ -660,7 +589,7 @@ const Createorder1 = () => {
|
||||
const [subCat, setSubCat] = useState([]);
|
||||
const [subCatName, setSubCatName] = useState('Select ');
|
||||
const [subCatId, setSubCatId] = useState();
|
||||
const [weight, setWeight] = useState('');
|
||||
const [, setWeight] = useState('');
|
||||
const tid = localStorage.getItem('tenantid');
|
||||
const [selectedCatChip, setSelectedCatChip] = useState(null);
|
||||
const [isCustomerOpen, setIsCustomerOpen] = useState(false);
|
||||
@@ -717,26 +646,6 @@ const Createorder1 = () => {
|
||||
}
|
||||
}, [startPoint, endPoint]);
|
||||
|
||||
const getDistance = () => {
|
||||
const dist = geolib.getPreciseDistance(startPoint, endPoint, 1);
|
||||
logger.info(`Distance: ${dist} meters`);
|
||||
const distanceInKm = (dist / 1000).toFixed(2);
|
||||
const roundedDistance = Math.round(distanceInKm);
|
||||
logger.info('roundedDistance', roundedDistance);
|
||||
setDistance(roundedDistance.toFixed(2));
|
||||
if (roundedDistance < minKm) {
|
||||
setTotalCharge(basePrice);
|
||||
} else {
|
||||
const total = (roundedDistance - minKm) * pricePerKm + basePrice;
|
||||
setTotalCharge(total);
|
||||
}
|
||||
setShowDistance(true);
|
||||
if (roundedDistance > appLocaRadius) {
|
||||
setShowDistance(true);
|
||||
setOpen4(true);
|
||||
}
|
||||
};
|
||||
|
||||
const calculateDistance = async (pickup, drop) => {
|
||||
try {
|
||||
const roundedDistance = await calculateDrivingDistance(pickup, drop);
|
||||
@@ -904,9 +813,9 @@ const Createorder1 = () => {
|
||||
logger.info('endtime', `${dayjs().format('MM-DD-YYYY')} ${closetime} `);
|
||||
let arr = [];
|
||||
for (
|
||||
let i = `${dayjs().format('MM-DD-YYYY')} ${opentime}`, j = 0;
|
||||
let i = `${dayjs().format('MM-DD-YYYY')} ${opentime}`;
|
||||
dayjs(`${dayjs().format('MM-DD-YYYY')} ${closetime} `).diff(i, 'm') >= 0;
|
||||
j++, i = dayjs(i).add(30, 'm')
|
||||
i = dayjs(i).add(30, 'm')
|
||||
) {
|
||||
arr.push(i);
|
||||
}
|
||||
@@ -961,14 +870,6 @@ const Createorder1 = () => {
|
||||
logger.info(alertmessage);
|
||||
};
|
||||
|
||||
function closeAddressModal() {
|
||||
setOpen2(false);
|
||||
}
|
||||
function closetimemodal() {
|
||||
setOpen3(false);
|
||||
setCurrentsno('');
|
||||
}
|
||||
|
||||
// =============================================== || createsubmitobj1 (create orders) || ===============================================
|
||||
|
||||
const createsubmitobj2 = async () => {
|
||||
@@ -1149,17 +1050,6 @@ const Createorder1 = () => {
|
||||
logger.info(shiftarr);
|
||||
}, [shiftarr]);
|
||||
|
||||
const clicked1 = (e) => {
|
||||
setShift(e);
|
||||
};
|
||||
|
||||
const dialogopen = (i, result) => {
|
||||
logger.info(i, result);
|
||||
setOpen({ shiftsno: result.sno, sno: i.sno });
|
||||
};
|
||||
const dialogclose = () => {
|
||||
setOpen('');
|
||||
};
|
||||
// ========================================================= || clientdetails || =========================================================
|
||||
const clientdetails = async () => {
|
||||
setLoading2(true);
|
||||
@@ -1207,78 +1097,6 @@ const Createorder1 = () => {
|
||||
clientdetails();
|
||||
// clientdetailsbusiness();
|
||||
}, [searchCustList.length > 3, searchCustList == '']);
|
||||
// ========================================================= || clientdetailsbusiness || =========================================================
|
||||
const clientdetailsbusiness = async () => {
|
||||
setLoading2(true);
|
||||
try {
|
||||
await axios
|
||||
.get(`${process.env.REACT_APP_URL}/customers/getbytid/?tenantid=${tid}&locationid=1`)
|
||||
.then((res) => {
|
||||
logger.info('clientdetailsbusiness', res.data.details);
|
||||
if (res.data.status) {
|
||||
setClientdetail(res.data.details);
|
||||
// if (!searchword) {
|
||||
// setClientdetailarr(res.data.details)
|
||||
// }
|
||||
let arr = [];
|
||||
res.data.details.map((val) => {
|
||||
arr.push({
|
||||
label: `${val.firstname} | ${val.contactno}`,
|
||||
...val
|
||||
});
|
||||
});
|
||||
setClientdetailbusinessarr(arr);
|
||||
}
|
||||
setLoading2(false);
|
||||
})
|
||||
.catch((err) => {
|
||||
logger.error(err);
|
||||
setLoading2(false);
|
||||
opentoast('server error', 'warning');
|
||||
});
|
||||
} catch (err) {
|
||||
logger.error(err);
|
||||
setLoading2(false);
|
||||
}
|
||||
};
|
||||
|
||||
// ================================================== || sendnotifications || ==================================================
|
||||
const sendnotifications = async () => {
|
||||
setLoading(true);
|
||||
await axios
|
||||
.post(`${process.env.REACT_APP_URL}/utils/sendnotifications`, {
|
||||
priority: 'high',
|
||||
registration_ids: admintoken,
|
||||
data: {
|
||||
accessid: process.env.REACT_APP_RIDER_ACCESS_ID
|
||||
},
|
||||
notification: {
|
||||
title: 'Nearle Merchant',
|
||||
body: 'An Order has been placed successfully,kindly process the same',
|
||||
sound: 'ring'
|
||||
}
|
||||
})
|
||||
.then((res) => {
|
||||
logger.info(res);
|
||||
if (res.data.message == 'Success') {
|
||||
enqueueSnackbar('Notification sent Successfully', {
|
||||
variant: 'success',
|
||||
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
autoHideDuration: 1000
|
||||
});
|
||||
}
|
||||
setLoading(false);
|
||||
})
|
||||
.catch((err) => {
|
||||
logger.error(err);
|
||||
enqueueSnackbar(err.message, {
|
||||
variant: 'error',
|
||||
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
autoHideDuration: 1000
|
||||
});
|
||||
setLoading(false);
|
||||
});
|
||||
};
|
||||
// ============================================= || Google Maps Autocomplete(pick) || =============================================
|
||||
useEffect(() => {
|
||||
// Initialize Google Maps Autocomplete
|
||||
@@ -1294,7 +1112,6 @@ const Createorder1 = () => {
|
||||
radius: appLocaRadius * 1000
|
||||
}).getBounds()
|
||||
});
|
||||
let arr = [];
|
||||
// Event listener for autocomplete place changed
|
||||
autocomplete.addListener('place_changed', () => {
|
||||
const place = autocomplete.getPlace();
|
||||
@@ -1380,7 +1197,6 @@ const Createorder1 = () => {
|
||||
// radius: 100000 //km to m
|
||||
}).getBounds()
|
||||
});
|
||||
let arr = [];
|
||||
// Event listener for autocomplete place changed
|
||||
autocomplete.addListener('place_changed', () => {
|
||||
const place = autocomplete.getPlace();
|
||||
|
||||
@@ -241,7 +241,7 @@ const Details = () => {
|
||||
const [tenantaddress, setTenantaddress] = useState('');
|
||||
const [dialogopen, setDialogopen] = useState(false);
|
||||
const [orderstatus, setOrderstatus] = useState('');
|
||||
const [currentrole, setCurrentrole] = useState('');
|
||||
const [currentrole] = useState('');
|
||||
const [taxamount, setTaxamount] = useState('');
|
||||
const [subtotal, setSubtotal] = useState('');
|
||||
const [grandtotal, setGrandtotal] = useState('');
|
||||
@@ -253,13 +253,13 @@ const Details = () => {
|
||||
const [staffarr, setStaffarr] = useState([]);
|
||||
const [orderheaderid, setOrderheaderid] = useState('');
|
||||
const [tenantid, setTenantid] = useState('');
|
||||
const [starttime, setStarttime] = useState('');
|
||||
const [endtime, setEndtime] = useState('');
|
||||
const [starttime] = useState('');
|
||||
const [endtime] = useState('');
|
||||
// const [orderstatus,setOrderstatus]=useStatus('');
|
||||
const [pendingtime, setPendingtime] = useState('');
|
||||
// const [processdate,setProcessdate]=useState('');
|
||||
const [orderdetailid, setOrderdetailid] = useState('');
|
||||
const [productid, setProductid] = useState('');
|
||||
const [orderdetailid] = useState('');
|
||||
const [productid] = useState('');
|
||||
const [categoryarr, setcategoryarr] = useState([])
|
||||
const [currentshiftobj, setCurrentshiftobj] = useState({
|
||||
shifts: 0,
|
||||
@@ -268,7 +268,7 @@ const Details = () => {
|
||||
shiftid: 0,
|
||||
price: 0
|
||||
});
|
||||
const [tabstatus, setTabstatus] = useState(0)
|
||||
const [, setTabstatus] = useState(0)
|
||||
const { state } = useLocation();
|
||||
const [assignedpendingcount, setAssignedpendingcount] = useState('');
|
||||
// const [, forceUpdate] = useReducer(x => x + 1, 0);
|
||||
@@ -409,48 +409,6 @@ const Details = () => {
|
||||
});
|
||||
}
|
||||
|
||||
const fetchroleslist = async (cid, starttime1, endtime1, hid, sid) => {
|
||||
let fromdate = dayjs(starttime1).subtract(59, 'minutes')
|
||||
.format('YYYY-MM-DD HH:mm:ss');
|
||||
// let todate = dayjs(endtime1).utc().format('YYYY-MM-DD HH:mm:ss');
|
||||
// let fromdate = dayjs(starttime1).utc().format('YYYY-MM-DD HH:mm:ss');
|
||||
let todate = dayjs(endtime1)
|
||||
.format('YYYY-MM-DD HH:mm:ss');
|
||||
let url1;
|
||||
if (starttime1) {
|
||||
url1 = `${process.env.REACT_APP_URL2}/staffs/pools/getstaffs/?categoryid=${cid}&headerid=${hid}&shiftid=${sid}&starttime=${fromdate}&endtime=${todate}`;
|
||||
} else {
|
||||
url1 = `${process.env.REACT_APP_URL2}/staffs/pools/getstaffs/?categoryid=${cid}&headerid=${hid}&shiftid=${sid}`
|
||||
}
|
||||
setLoading(true);
|
||||
setStafflist([])
|
||||
await axios
|
||||
// .get(`${process.env.REACT_APP_URL2}/staffs/pools/getstaffs/?categoryid=${cid}&headerid=${hid}&starttime=${fromdate}&endtime=${todate}`)
|
||||
.get(url1)
|
||||
.then((res) => {
|
||||
logger.info('rolelist');
|
||||
logger.info(res);
|
||||
// logger.info(fromdate, todate)
|
||||
// logger.info(dayjs(starttime1).format('YYYY-MM-DD HH:mm:ss'))
|
||||
// logger.info(dayjs(endtime1).format('HH:mm:ss'))
|
||||
|
||||
|
||||
setStafflist(res.data.Details || [])
|
||||
// let result = res.data.Details.find((res1) => res1.orderheaderid == searchParams.get('id'))
|
||||
// orderheaderid
|
||||
// logger.info(result)
|
||||
// setOrderaddons(result.orderaddons);
|
||||
// setVenuetype(result.venuetype)
|
||||
// setOtherinstructions(result.remarks)
|
||||
setLoading(false);
|
||||
})
|
||||
.catch((err) => {
|
||||
logger.error(err);
|
||||
setLoading(false);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
const fetchstafflist = async (odid) => {
|
||||
setLoading(true)
|
||||
try {
|
||||
@@ -789,88 +747,6 @@ const Details = () => {
|
||||
|
||||
}
|
||||
|
||||
const fetchassignedstaffs = async () => {
|
||||
|
||||
// logger.info(obj1)
|
||||
await axios.get(`${process.env.REACT_APP_URL2}/orders/getnotificationusers?orderheaderid=${orderheaderid}`)
|
||||
.then((res) => {
|
||||
if (res.data.status) {
|
||||
let arr1 = [];
|
||||
let data2;
|
||||
let tokenarr = []
|
||||
logger.info(res)
|
||||
|
||||
res.data.details.map((val) => {
|
||||
arr1.push({
|
||||
"notificationid": 0,
|
||||
"notificationdate": dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||
"Title": "Staff Asigned",
|
||||
"message": `${val.staffname} has been assigned to the order ${orderid}`,
|
||||
"configid": 2,
|
||||
"tenantid": tenantid,
|
||||
"orderheaderid": orderheaderid,
|
||||
"orderprocessid": val.orderprocessid,
|
||||
"shiftid": val.shiftid,
|
||||
"userid": val.userid,
|
||||
"orderid": orderid,
|
||||
"success": 0,
|
||||
"orderstatus": 'assigned',
|
||||
"processing": dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||
"notifytype": 1,
|
||||
"notifyreason": 'Staff Assigned'
|
||||
// "sound": "ring",
|
||||
// "click_action": "FLUTTER_NOTIFICATION_CLICK",
|
||||
// "firstname": val.firstname
|
||||
|
||||
});
|
||||
tokenarr.push(val.userfcmtoken);
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
data2 = {
|
||||
"Title": "Staff Asigned",
|
||||
"message": `A Staff has been assigned to the order ${orderid}`,
|
||||
"tenantid": tenantid,
|
||||
"orderheaderid": orderheaderid,
|
||||
"orderid": orderid,
|
||||
"configid": 2,
|
||||
// "click_action": "FLUTTER_NOTIFICATION_CLICK"
|
||||
}
|
||||
let fcmmodel = {
|
||||
"priority": "high",
|
||||
"registration_ids": tokenarr,
|
||||
"data": data2,
|
||||
"notification": {
|
||||
"body": `An order has been assigned ${orderid}`,
|
||||
"title": "Legendary",
|
||||
"sound": "ring",
|
||||
"content_available": true,
|
||||
"click_action": "FLUTTER_NOTIFICATION_CLICK"
|
||||
}
|
||||
}
|
||||
let grpnotifyobj = {
|
||||
"notifications": arr1,
|
||||
"fcmmodel": fcmmodel
|
||||
}
|
||||
logger.info("grpnotifyobj")
|
||||
logger.info(grpnotifyobj)
|
||||
sendgroupnotification(grpnotifyobj)
|
||||
// notificationpush(obj2, val.userfcmtoken);
|
||||
// notificationpush(arr1,tokenarr);
|
||||
// enqueueSnackbar('Notifications sent successfully', {
|
||||
// variant: 'success', anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
// autoHideDuration: 2000
|
||||
// })
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
logger.error(err)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
const sendgroupnotification = async (obj1) => {
|
||||
|
||||
logger.info(obj1)
|
||||
|
||||
@@ -256,7 +256,7 @@ const MultipleOrders = () => {
|
||||
const tenantid = localStorage.getItem('tenantid');
|
||||
|
||||
// ============================== state ==============================
|
||||
const [locations, setLocations] = useState([]);
|
||||
const [, setLocations] = useState([]);
|
||||
const [tenantLocations, setTenantlocations] = useState([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [btnLoading, setBtnLoading] = useState(false);
|
||||
|
||||
@@ -30,7 +30,7 @@ import { useHotkeyFocus } from 'components/nearle_components/useHotkeyFocus';
|
||||
import DateFilterDialog from 'components/nearle_components/DateFilterDialog';
|
||||
import CircularLoader from 'components/nearle_components/CircularLoader';
|
||||
import { useQuery, useMutation, useInfiniteQuery } from '@tanstack/react-query';
|
||||
import { useNavigate, useLocation } from 'react-router-dom';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import logger from 'utils/logger';
|
||||
import {
|
||||
fetchPercentageData,
|
||||
@@ -141,7 +141,6 @@ const scrollbarStyle = `
|
||||
|
||||
const Orders = () => {
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
const tid = localStorage.getItem('tenantid');
|
||||
const loadMoreRef = useRef();
|
||||
const containerRef = useRef();
|
||||
@@ -162,7 +161,6 @@ const Orders = () => {
|
||||
const [debouncedSearch, setDebouncedSearch] = useState('');
|
||||
|
||||
// Floating button and Dialog states
|
||||
const [speedDialOpen, setSpeedDialOpen] = useState(false);
|
||||
const [multiDeleteDialog, setMultiDeleteDialog] = useState(false);
|
||||
const [createloader, setCreateloader] = useState(false);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
@@ -190,7 +188,6 @@ const Orders = () => {
|
||||
|
||||
// React Queries
|
||||
const {
|
||||
data: percentageData,
|
||||
isLoading: fetchpercentageIsLoading,
|
||||
refetch: percentagedataRefetch
|
||||
} = useQuery({
|
||||
@@ -378,12 +375,6 @@ const Orders = () => {
|
||||
});
|
||||
};
|
||||
|
||||
// KPI tile definitions.
|
||||
const kpiCards = [
|
||||
{ key: 'created', label: 'Created Orders', color: BRAND, icon: MdLocalShipping, value: percentageData?.created, percentage: percentageData?.percentage1 },
|
||||
{ key: 'pending', label: 'Pending Orders', color: '#f59e0b', icon: MdHourglassEmpty, value: percentageData?.uncoveredOrders, percentage: percentageData?.percentage2 }
|
||||
];
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<style>{scrollbarStyle}</style>
|
||||
@@ -648,17 +639,6 @@ const Orders = () => {
|
||||
)}
|
||||
|
||||
{rows.map((row, index) => {
|
||||
const isItemSelected = !!deliverylist.find((res) => res.orderheaderid === row.orderheaderid);
|
||||
const handleCheckbox = (e) => {
|
||||
if (e.target.checked) {
|
||||
setDeliverylist((prev) => [...prev, { ...row, sno: prev.length + 1 }]);
|
||||
} else {
|
||||
setDeliverylist((prev) =>
|
||||
prev.filter((item) => item.orderheaderid !== row.orderheaderid).map((item, i) => ({ ...item, sno: i + 1 }))
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<tr key={`${row.orderheaderid}-${index}`} className="ordpg-row" style={{ cursor: 'pointer', transition: 'background-color 0.12s, box-shadow 0.12s' }}>
|
||||
<td style={{ borderBottom: `1px solid ${DT.divider}`, padding: '5px 8px', verticalAlign: 'top' }}>
|
||||
|
||||
Reference in New Issue
Block a user