diff --git a/nearlexpressbuild b/nearlexpressbuild
index 088ac08..5d8638c 160000
--- a/nearlexpressbuild
+++ b/nearlexpressbuild
@@ -1 +1 @@
-Subproject commit 088ac08a24e74023a6c68ba3dd63c5fcabd7a5e8
+Subproject commit 5d8638cb57933fb4431db56ce7129cc0f76bba3f
diff --git a/public/index.html b/public/index.html
index 844d5fc..d1e4715 100644
--- a/public/index.html
+++ b/public/index.html
@@ -5,7 +5,7 @@
-
+
+
diff --git a/src/pages/nearle/orders/orders.js b/src/pages/nearle/orders/orders.js
index 16c72e0..9b4dba9 100644
--- a/src/pages/nearle/orders/orders.js
+++ b/src/pages/nearle/orders/orders.js
@@ -5,708 +5,708 @@ import { DeleteFilled, NotificationOutlined } from '@ant-design/icons';
import {
- useState,
- useEffect,
- Fragment
- } from 'react';
- import { Empty } from 'antd';
- import { DatePicker } from '@mui/x-date-pickers/DatePicker';
- import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
- import dayjs from 'dayjs';
- var utc = require('dayjs/plugin/utc')
- dayjs.extend(utc)
- import axios from 'axios';
- import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
- // import { DataGrid } from '@mui/x-data-grid'
- // material-ui
- import HoverSocialCard from 'components/cards/statistics/HoverSocialCard';
- // import {FacebookOutlined} from '@ant-design/icons';
- import { useTheme } from '@mui/material/styles';
- // import { edittabstatus1 } from 'store/reducers/dashboard1';
- import {
- Avatar,
- // AvatarGroup,
- // Button as Button1,
- Box,
- // DateRangePicker,
- Button,
- Grid,
- Tabs,
- Tab,
- IconButton,
- Stack,
- // TextField,
- Chip,
- // TableSortLabel,
- Typography,
- // Divider,
- Table, TableCell, TableBody, TableHead,
- // TableSortLabel,
- Collapse,
- Dialog,
- TableRow,
- DialogContent,
- DialogTitle,
- Tooltip,
- FormControl,
- OutlinedInput,
- InputAdornment,
- Skeleton,
- CircularProgress,
- DialogActions,
- // Popper,
- // ClickAwayListener
-
- // Checkbox
- } from '@mui/material';
- import MainCard from 'components/MainCard';
-
- // import { useSelector } from 'store';
- // import { useDispatch } from 'react-redux';
-
-
- import {
- SearchOutlined, EnvironmentOutlined, UserOutlined,
- // MoreOutlined ,
- CloseOutlined
- } from '@ant-design/icons';
- import { PopupTransition } from 'components/@extended/Transitions';
-
- // import FilterList from '@mui/icons-material/FilterList';
- import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
- import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
-
- import {
- addDays,
- addMonths,
- addWeeks,
- // addYears,
- endOfMonth,
- endOfWeek,
- // endOfYear,
- startOfMonth,
- startOfWeek,
- // startOfYear,
- } from 'date-fns';
-
- // import { DateRangePicker } from '@mui/x-date-pickers-pro/DateRangePicker';
- // import { DesktopDateRangePicker } from '@mui/x-date-pickers-pro/DesktopDateRangePicker';
- // import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
- // import { DateRangePicker } from "mui-daterange-picker-orient";
- import { DateRangePicker } from "mui-daterange-picker";
-
-
-
- // import EnhancedTable from 'components/tablemuiedit'
- import {
- // CloseOutlined,
- // PlusOutlined,
- EyeTwoTone,
- // EditTwoTone,
- // DeleteTwoTone
- } from '@ant-design/icons';
-
- import { useNavigate } from 'react-router';
-
-
- import * as React from 'react';
- import PropTypes from 'prop-types';
- // import { alpha } from '@mui/material/styles';
- // import Box from '@mui/material/Box';
- // import Table from '@mui/material/Table';
- // import TableBody from '@mui/material/TableBody';
- // import TableCell from '@mui/material/TableCell';
- import TableContainer from '@mui/material/TableContainer';
- // import TableHead from '@mui/material/TableHead';
- import TablePagination from '@mui/material/TablePagination';
- // import TableRow from '@mui/material/TableRow';
- // import TablePagination from '@mui/material/TablePagination';
- import TableSortLabel from '@mui/material/TableSortLabel';
- // import Toolbar from '@mui/material/Toolbar';
- // import Typography from '@mui/material/Typography';
- // import Paper from '@mui/material/Paper';
- // import Checkbox from '@mui/material/Checkbox';
- // import IconButton from '@mui/material/IconButton';
- // import Tooltip from '@mui/material/Tooltip';
- // import FormControlLabel from '@mui/material/FormControlLabel';
- // // import Switch from '@mui/material/Switch';
- // import DeleteIcon from '@mui/icons-material/Delete';
- // import FilterListIcon from '@mui/icons-material/FilterList';
- import { visuallyHidden } from '@mui/utils';
- import Loader from 'components/Loader'
- import { FilterList } from '@mui/icons-material';
- // import MainCard from 'components/MainCard';
- // import DialogTitle from 'themes/overrides/DialogTitle';
- // import MainCard from 'components/MainCard';
-
-
-
-
-
-
-
- const Orders = () => {
-
-
- function descendingComparator(a, b, orderBy) {
- if (b[orderBy] < a[orderBy]) {
- return -1;
+ useState,
+ useEffect,
+ Fragment
+} from 'react';
+import { Empty } from 'antd';
+import { DatePicker } from '@mui/x-date-pickers/DatePicker';
+import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
+import dayjs from 'dayjs';
+var utc = require('dayjs/plugin/utc')
+dayjs.extend(utc)
+import axios from 'axios';
+import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
+// import { DataGrid } from '@mui/x-data-grid'
+// material-ui
+import HoverSocialCard from 'components/cards/statistics/HoverSocialCard';
+// import {FacebookOutlined} from '@ant-design/icons';
+import { useTheme } from '@mui/material/styles';
+// import { edittabstatus1 } from 'store/reducers/dashboard1';
+import {
+ Avatar,
+ // AvatarGroup,
+ // Button as Button1,
+ Box,
+ // DateRangePicker,
+ Button,
+ Grid,
+ Tabs,
+ Tab,
+ IconButton,
+ Stack,
+ // TextField,
+ Chip,
+ // TableSortLabel,
+ Typography,
+ // Divider,
+ Table, TableCell, TableBody, TableHead,
+ // TableSortLabel,
+ Collapse,
+ Dialog,
+ TableRow,
+ DialogContent,
+ DialogTitle,
+ Tooltip,
+ FormControl,
+ OutlinedInput,
+ InputAdornment,
+ Skeleton,
+ CircularProgress,
+ DialogActions,
+ // Popper,
+ // ClickAwayListener
+
+ // Checkbox
+} from '@mui/material';
+import MainCard from 'components/MainCard';
+
+// import { useSelector } from 'store';
+// import { useDispatch } from 'react-redux';
+
+
+import {
+ SearchOutlined, EnvironmentOutlined, UserOutlined,
+ // MoreOutlined ,
+ CloseOutlined
+} from '@ant-design/icons';
+import { PopupTransition } from 'components/@extended/Transitions';
+
+// import FilterList from '@mui/icons-material/FilterList';
+import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
+import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
+
+import {
+ addDays,
+ addMonths,
+ addWeeks,
+ // addYears,
+ endOfMonth,
+ endOfWeek,
+ // endOfYear,
+ startOfMonth,
+ startOfWeek,
+ // startOfYear,
+} from 'date-fns';
+
+// import { DateRangePicker } from '@mui/x-date-pickers-pro/DateRangePicker';
+// import { DesktopDateRangePicker } from '@mui/x-date-pickers-pro/DesktopDateRangePicker';
+// import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
+// import { DateRangePicker } from "mui-daterange-picker-orient";
+import { DateRangePicker } from "mui-daterange-picker";
+
+
+
+// import EnhancedTable from 'components/tablemuiedit'
+import {
+ // CloseOutlined,
+ // PlusOutlined,
+ EyeTwoTone,
+ // EditTwoTone,
+ // DeleteTwoTone
+} from '@ant-design/icons';
+
+import { useNavigate } from 'react-router';
+
+
+import * as React from 'react';
+import PropTypes from 'prop-types';
+// import { alpha } from '@mui/material/styles';
+// import Box from '@mui/material/Box';
+// import Table from '@mui/material/Table';
+// import TableBody from '@mui/material/TableBody';
+// import TableCell from '@mui/material/TableCell';
+import TableContainer from '@mui/material/TableContainer';
+// import TableHead from '@mui/material/TableHead';
+import TablePagination from '@mui/material/TablePagination';
+// import TableRow from '@mui/material/TableRow';
+// import TablePagination from '@mui/material/TablePagination';
+import TableSortLabel from '@mui/material/TableSortLabel';
+// import Toolbar from '@mui/material/Toolbar';
+// import Typography from '@mui/material/Typography';
+// import Paper from '@mui/material/Paper';
+// import Checkbox from '@mui/material/Checkbox';
+// import IconButton from '@mui/material/IconButton';
+// import Tooltip from '@mui/material/Tooltip';
+// import FormControlLabel from '@mui/material/FormControlLabel';
+// // import Switch from '@mui/material/Switch';
+// import DeleteIcon from '@mui/icons-material/Delete';
+// import FilterListIcon from '@mui/icons-material/FilterList';
+import { visuallyHidden } from '@mui/utils';
+import Loader from 'components/Loader'
+import { FilterList } from '@mui/icons-material';
+// import MainCard from 'components/MainCard';
+// import DialogTitle from 'themes/overrides/DialogTitle';
+// import MainCard from 'components/MainCard';
+
+
+
+
+
+
+
+const Orders = () => {
+
+
+ function descendingComparator(a, b, orderBy) {
+ if (b[orderBy] < a[orderBy]) {
+ return -1;
+ }
+ if (b[orderBy] > a[orderBy]) {
+ return 1;
+ }
+ return 0;
+ }
+
+ function getComparator(order, orderBy) {
+ return order === 'desc'
+ ? (a, b) => descendingComparator(a, b, orderBy)
+ : (a, b) => -descendingComparator(a, b, orderBy);
+ }
+
+ // Since 2020 all major browsers ensure sort stability with Array.prototype.sort().
+ // stableSort() brings sort stability to non-modern browsers (notably IE11). If you
+ // only support modern browsers you can replace stableSort(exampleArray, exampleComparator)
+ // with exampleArray.slice().sort(exampleComparator)
+ function stableSort(array, comparator) {
+ const stabilizedThis = array.map((el, index) => [el, index]);
+ stabilizedThis.sort((a, b) => {
+ const order = comparator(a[0], b[0]);
+ if (order !== 0) {
+ return order;
}
- if (b[orderBy] > a[orderBy]) {
- return 1;
- }
- return 0;
- }
-
- function getComparator(order, orderBy) {
- return order === 'desc'
- ? (a, b) => descendingComparator(a, b, orderBy)
- : (a, b) => -descendingComparator(a, b, orderBy);
- }
-
- // Since 2020 all major browsers ensure sort stability with Array.prototype.sort().
- // stableSort() brings sort stability to non-modern browsers (notably IE11). If you
- // only support modern browsers you can replace stableSort(exampleArray, exampleComparator)
- // with exampleArray.slice().sort(exampleComparator)
- function stableSort(array, comparator) {
- const stabilizedThis = array.map((el, index) => [el, index]);
- stabilizedThis.sort((a, b) => {
- const order = comparator(a[0], b[0]);
- if (order !== 0) {
- return order;
- }
- return a[1] - b[1];
- });
- return stabilizedThis.map((el) => el[0]);
- }
-
-
-
-
-
- const headCells = [
- {
- id: 'sno',
- disablePadding: true,
- label: 'S NO',
-
- },
- {
- id: 'tenantname',
- numeric: false,
- disablePadding: false,
- label: 'CUSTOMER',
- },
- {
- id: 'orderid',
- numeric: false,
- disablePadding: false,
- label: 'ORDER ID',
- },
- {
- id: 'eventname',
- disablePadding: false,
- label: 'Pickup Location',
- },
- {
- id: 'eventname4',
- disablePadding: false,
- label: 'Delivery Location',
- },
+ return a[1] - b[1];
+ });
+ return stabilizedThis.map((el) => el[0]);
+ }
+
+
+
+
+
+ const headCells = [
+ {
+ id: 'sno',
+ disablePadding: true,
+ label: 'S NO',
+
+ },
+ {
+ id: 'tenantname',
+ numeric: false,
+ disablePadding: false,
+ label: 'CUSTOMER',
+ },
+ {
+ id: 'orderid',
+ numeric: false,
+ disablePadding: false,
+ label: 'ORDER ID',
+ },
+ {
+ id: 'eventname',
+ disablePadding: false,
+ label: 'Pickup Location',
+ },
+ {
+ id: 'eventname4',
+ disablePadding: false,
+ label: 'Delivery Location',
+ },
// {
// id: 'ordervalue',
// disablePadding: false,
// label: 'VALUE $',
// },
- {
- id: 'itemcount',
- disablePadding: false,
- label: 'NOTES',
- },
- {
- id: 'orderstatus',
- disablePadding: false,
- label: 'STATUS',
- },
- {
- id: 'action',
- disablePadding: false,
- label: 'ACTION',
- }
- ];
-
-
- function EnhancedTableHead(props) {
- const {
- order, orderBy,
- onRequestSort } =
- props;
- const createSortHandler = (property) => (event) => {
- onRequestSort(event, property);
- };
-
- return (
-
-
-
- {headCells.map((headCell) => (
-
-
- {headCell.label}
- {orderBy === headCell.id ? (
-
- {order === 'desc' ? 'sorted descending' : 'sorted ascending'}
-
- ) : null}
-
-
- ))}
-
-
- );
+ {
+ id: 'itemcount',
+ disablePadding: false,
+ label: 'NOTES',
+ },
+ {
+ id: 'orderstatus',
+ disablePadding: false,
+ label: 'STATUS',
+ },
+ {
+ id: 'action',
+ disablePadding: false,
+ label: 'ACTION',
}
-
- EnhancedTableHead.propTypes = {
- numSelected: PropTypes.number.isRequired,
- onRequestSort: PropTypes.func.isRequired,
- onSelectAllClick: PropTypes.func.isRequired,
- order: PropTypes.oneOf(['asc', 'desc']).isRequired,
- orderBy: PropTypes.string.isRequired,
- rowCount: PropTypes.number.isRequired,
+ ];
+
+
+ function EnhancedTableHead(props) {
+ const {
+ order, orderBy,
+ onRequestSort } =
+ props;
+ const createSortHandler = (property) => (event) => {
+ onRequestSort(event, property);
};
-
-
-
- function EnhancedTable() {
- const [order, setOrder] = React.useState('asc');
- const [orderBy, setOrderBy] = React.useState('calories');
- const [selected, setSelected] = React.useState([]);
- const [page, setPage] = React.useState(0);
- const [rowsPerPage, setRowsPerPage] = React.useState(10);
- const [expandopen, setExpandopen] = React.useState('');
-
-
- const [dialogopen, setDialogopen] = useState(false);
- const [stafflist, setStafflist] = useState([])
- const [loading1, setLoading1] = useState(false)
- const [open,setOpen]=useState(false);
- const [orderheaderid,setOrderheaderid]=useState('')
- const cancelorder = async () => {
+ return (
+
+
- await axios.put(`${process.env.REACT_APP_URL}/orders/updateorder`, {
- "orderheaderid": orderheaderid,
- "orderstatus": "cancelled",
- "cancelled": dayjs().format('YYYY-MM-DD HH:mm:ss')
-
-
-
+ {headCells.map((headCell) => (
+
+
+ {headCell.label}
+ {orderBy === headCell.id ? (
+
+ {order === 'desc' ? 'sorted descending' : 'sorted ascending'}
+
+ ) : null}
+
+
+ ))}
+
+
+ );
+ }
+
+ EnhancedTableHead.propTypes = {
+ numSelected: PropTypes.number.isRequired,
+ onRequestSort: PropTypes.func.isRequired,
+ onSelectAllClick: PropTypes.func.isRequired,
+ order: PropTypes.oneOf(['asc', 'desc']).isRequired,
+ orderBy: PropTypes.string.isRequired,
+ rowCount: PropTypes.number.isRequired,
+ };
+
+
+
+ function EnhancedTable() {
+ const [order, setOrder] = React.useState('asc');
+ const [orderBy, setOrderBy] = React.useState('calories');
+ const [selected, setSelected] = React.useState([]);
+ const [page, setPage] = React.useState(0);
+ const [rowsPerPage, setRowsPerPage] = React.useState(10);
+ const [expandopen, setExpandopen] = React.useState('');
+
+
+ const [dialogopen, setDialogopen] = useState(false);
+ const [stafflist, setStafflist] = useState([])
+ const [loading1, setLoading1] = useState(false)
+ const [open, setOpen] = useState(false);
+ const [orderheaderid, setOrderheaderid] = useState('')
+
+ const cancelorder = async () => {
+
+ await axios.put(`${process.env.REACT_APP_URL}/orders/updateorder`, {
+ "orderheaderid": orderheaderid,
+ "orderstatus": "cancelled",
+ "cancelled": dayjs().format('YYYY-MM-DD HH:mm:ss')
+
+
+
+ })
+ .then((res) => {
+ console.log(res)
+ if (res.data.status) {
+ // if (orderheaderid && tenantid) {
+ // fetchorderdetails();
+ // fetchorderaddons();
+ // fetchorderattires();
+ // }
+ enqueueSnackbar('Order Cancelled Successfully', {
+ variant: 'success', anchorOrigin: { vertical: 'top', horizontal: 'right' },
+ autoHideDuration: 2000
+ })
+ handleClose(true);
+
+ if (localStorage.getItem('tenantid')) {
+ setTenantid(localStorage.getItem('tenantid'))
+ let val = localStorage.getItem('tenantid')
+
+ fetchtable(val);
+ fetchpercentage(val);
+ fetchtableuncovered(val);
+ fetchtablecovered(val);
+ fetchtablecancelled(val);
+ // fetchtableassigned(val);
+ // fetchtablepicked(val);
+ fetchtablecreated(val);
+ }
+ }
+
+ }).catch((err) => {
+ console.log(err)
})
+
+ }
+
+
+ const fetchstafflist = async (odid) => {
+ setLoading1(true)
+ try {
+ await axios.get(`${process.env.REACT_APP_URL2}/orders/getassignedinfo?orderdetailid=${odid}`)
+
.then((res) => {
console.log(res)
if (res.data.status) {
- // if (orderheaderid && tenantid) {
- // fetchorderdetails();
- // fetchorderaddons();
- // fetchorderattires();
- // }
- enqueueSnackbar('Order Cancelled Successfully', {
- variant: 'success', anchorOrigin: { vertical: 'top', horizontal: 'right' },
- autoHideDuration: 2000
- })
- handleClose(true);
-
- if (localStorage.getItem('tenantid')) {
- setTenantid(localStorage.getItem('tenantid'))
- let val = localStorage.getItem('tenantid')
-
- fetchtable(val);
- fetchpercentage(val);
- fetchtableuncovered(val);
- fetchtablecovered(val);
- fetchtablecancelled(val);
- fetchtableassigned(val);
- fetchtablepicked(val);
- fetchtablecreated(val);
- }
+ setStafflist(res.data.Details)
}
-
+
+ setLoading1(false)
}).catch((err) => {
console.log(err)
+ setLoading1(false)
})
-
- }
-
-
- const fetchstafflist = async (odid) => {
- setLoading1(true)
- try {
- await axios.get(`${process.env.REACT_APP_URL2}/orders/getassignedinfo?orderdetailid=${odid}`)
-
- .then((res) => {
- console.log(res)
- if (res.data.status) {
- setStafflist(res.data.Details)
- }
-
- setLoading1(false)
- }).catch((err) => {
- console.log(err)
- setLoading1(false)
- })
-
- } catch (err) {
- console.log(err);
- setLoading1(false)
- }
-
- }
-
-
-
-
-
- const dialogclose = () => {
- setDialogopen(false);
- };
-
- const handleRequestSort = (event, property) => {
- const isAsc = orderBy === property && order === 'asc';
- setOrder(isAsc ? 'desc' : 'asc');
- setOrderBy(property);
- };
-
- const handleSelectAllClick = (event) => {
- if (event.target.checked) {
- const newSelected = rows.map((n) => n.name);
- setSelected(newSelected);
- return;
- }
- setSelected([]);
- };
-
-
-
- const handleChangePage = (event, newPage) => {
- setPage(newPage);
- };
-
- const handleChangeRowsPerPage = (event) => {
- setRowsPerPage(parseInt(event.target.value, 10));
- setPage(0);
- };
-
-
-
- const isSelected = (name) => selected.indexOf(name) !== -1;
-
- // Avoid a layout jump when reaching the last page with empty rows.
- const emptyRows =
- page > 0 ? Math.max(0, (1 + page) * rowsPerPage - rows.length) : 0;
-
- const visibleRows = React.useMemo(
- () =>
- stableSort(rows, getComparator(order, orderBy)).slice(
- page * rowsPerPage,
- page * rowsPerPage + rowsPerPage,
- ),
- [order, orderBy, page, rowsPerPage],
- );
- const handleClose = () => {
- setOpen(false);
- setOrderheaderid('')
- };
-
+ } catch (err) {
+ console.log(err);
+ setLoading1(false)
+ }
- function AlertCustomerDelete({
- // title,
- open, handleClose }) {
- // const [deletepassword, setDeletepassword] = useState('');
-
- return (
-