08122023
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
src/assets/images/logo-nearle2.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
src/assets/images/logo-nearle3.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src/assets/images/logo-nearle4.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/assets/images/logo-nearle5.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/images/logo-nearle6.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/assets/images/logo-nearle7.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/assets/images/logo-nearle8.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/assets/images/logo-nearle9.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/assets/images/logo-sm1.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
@@ -227,7 +227,10 @@ const NavGroup = ({ item, lastItem, remItems, lastItemId, setSelectedItems, sele
|
||||
item.title &&
|
||||
drawerOpen && (
|
||||
<Box sx={{ pl: 3, mb: 1.5 }}>
|
||||
<Typography variant="subtitle2" color={theme.palette.mode === ThemeMode.DARK ? 'textSecondary' : 'text.secondary'}>
|
||||
<Typography variant="subtitle2"
|
||||
// color={theme.palette.mode === ThemeMode.DARK ? 'textSecondary' : 'text.secondary'}
|
||||
sx={{color:'#fff'}}
|
||||
>
|
||||
{item.title}
|
||||
</Typography>
|
||||
{item.caption && (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { forwardRef, useEffect } from 'react';
|
||||
import { forwardRef, useEffect,useState } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
|
||||
@@ -9,8 +9,10 @@ import { Avatar, Chip, ListItemButton, ListItemIcon, ListItemText, Typography, u
|
||||
|
||||
// project import
|
||||
import Dot from 'components/@extended/Dot';
|
||||
|
||||
import { MenuOrientation, ThemeMode } from 'config';
|
||||
import useConfig from 'hooks/useConfig';
|
||||
// import { dispatch, useSelector } from 'store';
|
||||
import { activeItem, openDrawer } from 'store/reducers/menu';
|
||||
|
||||
// ==============================|| NAVIGATION - LIST ITEM ||============================== //
|
||||
@@ -21,9 +23,11 @@ const NavItem = ({ item, level }) => {
|
||||
|
||||
const { menuOrientation } = useConfig();
|
||||
const { drawerOpen, openItem } = useSelector((state) => state.menu);
|
||||
const [ishover,setIshover]=useState('')
|
||||
|
||||
const downLG = useMediaQuery(theme.breakpoints.down('lg'));
|
||||
|
||||
|
||||
let itemTarget = '_self';
|
||||
if (item.target) {
|
||||
itemTarget = '_blank';
|
||||
@@ -35,9 +39,10 @@ const NavItem = ({ item, level }) => {
|
||||
}
|
||||
|
||||
const Icon = item.icon;
|
||||
const itemIcon = item.icon ? <Icon style={{ fontSize: drawerOpen ? '1rem' : '1.25rem' }} /> : false;
|
||||
|
||||
const isSelected = openItem.findIndex((id) => id === item.id) > -1;
|
||||
const itemIcon = item.icon ? <Icon style={{ fontSize: drawerOpen ? '1rem' : '1.25rem',
|
||||
color:isSelected?'#662582':'#fff' }} /> : false;
|
||||
|
||||
// const { pathname } = useLocation();
|
||||
const pathname = document.location.pathname;
|
||||
@@ -62,7 +67,7 @@ const NavItem = ({ item, level }) => {
|
||||
// eslint-disable-next-line
|
||||
}, [pathname]);
|
||||
|
||||
const textColor = theme.palette.mode === ThemeMode.DARK ? 'grey.400' : 'text.primary';
|
||||
const textColor = theme.palette.mode === ThemeMode.DARK ? 'grey.400' : '#fff';
|
||||
const iconSelectedColor = theme.palette.mode === ThemeMode.DARK && drawerOpen ? 'text.primary' : 'primary.main';
|
||||
|
||||
return (
|
||||
@@ -72,13 +77,20 @@ const NavItem = ({ item, level }) => {
|
||||
{...listItemProps}
|
||||
disabled={item.disabled}
|
||||
selected={isSelected}
|
||||
onMouseEnter={(e,val)=>{
|
||||
console.log(e)
|
||||
}}
|
||||
onMouseLeave={()=>{
|
||||
setIshover('')
|
||||
}}
|
||||
sx={{
|
||||
zIndex: 1201,
|
||||
pl: drawerOpen ? `${level * 28}px` : 1.5,
|
||||
py: !drawerOpen && level === 1 ? 1.25 : 1,
|
||||
...(drawerOpen && {
|
||||
'&:hover': {
|
||||
bgcolor: theme.palette.mode === ThemeMode.DARK ? 'divider' : 'primary.lighter'
|
||||
// bgcolor: theme.palette.mode === ThemeMode.DARK ? 'divider' : 'primary.lighter'
|
||||
bgcolor:'#7b1fa2'
|
||||
},
|
||||
'&.Mui-selected': {
|
||||
bgcolor: theme.palette.mode === ThemeMode.DARK ? 'divider' : 'primary.lighter',
|
||||
@@ -92,7 +104,10 @@ const NavItem = ({ item, level }) => {
|
||||
}),
|
||||
...(!drawerOpen && {
|
||||
'&:hover': {
|
||||
bgcolor: 'transparent'
|
||||
bgcolor: 'transparent',
|
||||
// bgcolor:'#7b1fa2'
|
||||
|
||||
|
||||
},
|
||||
'&.Mui-selected': {
|
||||
'&:hover': {
|
||||
@@ -110,7 +125,11 @@ const NavItem = ({ item, level }) => {
|
||||
<ListItemIcon
|
||||
sx={{
|
||||
minWidth: 28,
|
||||
'&:hover': {
|
||||
color:isSelected ? '#fff':iconSelectedColor ,
|
||||
},
|
||||
color: isSelected ? iconSelectedColor : textColor,
|
||||
|
||||
...(!drawerOpen && {
|
||||
borderRadius: 1.5,
|
||||
width: 36,
|
||||
@@ -118,7 +137,9 @@ const NavItem = ({ item, level }) => {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
'&:hover': {
|
||||
bgcolor: theme.palette.mode === ThemeMode.DARK ? 'secondary.light' : 'secondary.lighter'
|
||||
// bgcolor: theme.palette.mode === ThemeMode.DARK ? 'secondary.light' : 'secondary.lighter'
|
||||
bgcolor:'#7b1fa2'
|
||||
|
||||
}
|
||||
}),
|
||||
...(!drawerOpen &&
|
||||
|
||||
@@ -22,7 +22,8 @@ const DrawerContent = () => {
|
||||
'& .simplebar-content': {
|
||||
display: 'flex',
|
||||
flexDirection: 'column'
|
||||
}
|
||||
},
|
||||
|
||||
}}
|
||||
>
|
||||
<Navigation />
|
||||
|
||||
@@ -11,8 +11,8 @@ import Logo from 'components/logo';
|
||||
import { MenuOrientation } from 'config';
|
||||
import useConfig from 'hooks/useConfig';
|
||||
|
||||
import logo from 'assets/images/logo-nearle.png'
|
||||
import logo1 from 'assets/images/logo-sm.png'
|
||||
import logo from 'assets/images/logo-nearle9.png'
|
||||
import logo1 from 'assets/images/logo-sm1.png'
|
||||
// ==============================|| DRAWER HEADER ||============================== //
|
||||
|
||||
const DrawerHeader = ({ open }) => {
|
||||
@@ -39,12 +39,14 @@ const DrawerHeader = ({ open }) => {
|
||||
{(open) &&
|
||||
<img src={logo}
|
||||
// width='160px'
|
||||
height='45px'
|
||||
width='170px'
|
||||
// height='45px'
|
||||
// width='170px'
|
||||
alt='logo'/>
|
||||
}
|
||||
{(!open) &&
|
||||
<img src={logo1} width='40px' alt='logo'/>
|
||||
<img src={logo1}
|
||||
width='40px'
|
||||
alt='logo'/>
|
||||
}
|
||||
</DrawerHeaderStyled>
|
||||
);
|
||||
|
||||
@@ -13,7 +13,8 @@ const openedMixin = (theme) => ({
|
||||
duration: theme.transitions.duration.enteringScreen
|
||||
}),
|
||||
overflowX: 'hidden',
|
||||
boxShadow: theme.palette.mode === ThemeMode.DARK ? theme.customShadows.z1 : 'none'
|
||||
boxShadow: theme.palette.mode === ThemeMode.DARK ? theme.customShadows.z1 : 'none',
|
||||
backgroundColor:'#662582',
|
||||
});
|
||||
|
||||
const closedMixin = (theme) => ({
|
||||
@@ -24,7 +25,8 @@ const closedMixin = (theme) => ({
|
||||
overflowX: 'hidden',
|
||||
width: theme.spacing(7.5),
|
||||
borderRight: 'none',
|
||||
boxShadow: theme.customShadows.z1
|
||||
boxShadow: theme.customShadows.z1,
|
||||
backgroundColor:'#662582',
|
||||
});
|
||||
|
||||
// ==============================|| DRAWER - MINI STYLED ||============================== //
|
||||
@@ -34,6 +36,7 @@ const MiniDrawerStyled = styled(Drawer, { shouldForwardProp: (prop) => prop !==
|
||||
flexShrink: 0,
|
||||
whiteSpace: 'nowrap',
|
||||
boxSizing: 'border-box',
|
||||
|
||||
...(open && {
|
||||
...openedMixin(theme),
|
||||
'& .MuiDrawer-paper': openedMixin(theme)
|
||||
|
||||
@@ -51,7 +51,8 @@ const MainDrawer = ({ window }) => {
|
||||
width: DRAWER_WIDTH,
|
||||
borderRight: `1px solid ${theme.palette.divider}`,
|
||||
backgroundImage: 'none',
|
||||
boxShadow: 'inherit'
|
||||
boxShadow: 'inherit',
|
||||
bgcolor:'#662582'
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -53,7 +53,7 @@ const Notification = () => {
|
||||
const matchesXs = useMediaQuery(theme.breakpoints.down('md'));
|
||||
|
||||
const anchorRef = useRef(null);
|
||||
const [read, setRead] = useState(2);
|
||||
const [read, setRead] = useState(0);
|
||||
const [open, setOpen] = useState(false);
|
||||
const handleToggle = () => {
|
||||
setOpen((prevOpen) => !prevOpen);
|
||||
@@ -72,16 +72,34 @@ const Notification = () => {
|
||||
return (
|
||||
<Box sx={{ flexShrink: 0, ml: 0.75 }}>
|
||||
<IconButton
|
||||
color="secondary"
|
||||
variant="light"
|
||||
sx={{ color: 'text.primary', bgcolor: open ? iconBackColorOpen : iconBackColor }}
|
||||
// color="secondary"
|
||||
// variant="light"
|
||||
// sx={{ color: 'text.primary', bgcolor: open ? iconBackColorOpen : iconBackColor }}
|
||||
sx={{ color: '#fff',
|
||||
fontSize:'20px',
|
||||
// bgcolor: open ? iconBackColorOpen : iconBackColor
|
||||
':hover':{
|
||||
bgcolor:'transparent',
|
||||
color: '#fff',
|
||||
},
|
||||
// bgcolor:'transparent'
|
||||
}}
|
||||
|
||||
aria-label="open profile"
|
||||
ref={anchorRef}
|
||||
aria-controls={open ? 'profile-grow' : undefined}
|
||||
aria-haspopup="true"
|
||||
onClick={handleToggle}
|
||||
// onClick={handleToggle}
|
||||
>
|
||||
<Badge badgeContent={read}
|
||||
// color="primary"
|
||||
sx={{
|
||||
"& .MuiBadge-badge": {
|
||||
color: "#662582",
|
||||
backgroundColor: "white"
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Badge badgeContent={read} color="primary">
|
||||
<BellOutlined />
|
||||
</Badge>
|
||||
</IconButton>
|
||||
|
||||
@@ -99,13 +99,13 @@ navigate('/login')
|
||||
<ButtonBase
|
||||
sx={{
|
||||
p: 0.25,
|
||||
bgcolor: open ? iconBackColorOpen : 'transparent',
|
||||
// bgcolor: open ? iconBackColorOpen : 'transparent',
|
||||
borderRadius: 1,
|
||||
'&:hover': { bgcolor: theme.palette.mode === ThemeMode.DARK ? 'secondary.light' : 'secondary.lighter' },
|
||||
'&:focus-visible': {
|
||||
outline: `2px solid ${theme.palette.secondary.dark}`,
|
||||
outlineOffset: 2
|
||||
}
|
||||
// '&:hover': { bgcolor: theme.palette.mode === ThemeMode.DARK ? 'secondary.light' : 'secondary.lighter' },
|
||||
// '&:focus-visible': {
|
||||
// outline: `2px solid ${theme.palette.secondary.dark}`,
|
||||
// outlineOffset: 2
|
||||
// }
|
||||
}}
|
||||
aria-label="open profile"
|
||||
ref={anchorRef}
|
||||
|
||||
@@ -55,17 +55,25 @@ const navigate = useNavigate()
|
||||
{/* {!matchesXs && <Search />} */}
|
||||
<Stack
|
||||
width='100%'
|
||||
direction='row' justifyContent='flex-end' spacing={2} alignItems='center'>
|
||||
direction='row' justifyContent='space-between' spacing={2} alignItems='center'>
|
||||
{/* {!matchesXs && megaMenu} */}
|
||||
<Typography variant='h5' sx={{ml:2,color:'#fff'}}>{localStorage.getItem('firstname') || ''}</Typography>
|
||||
{matchesXs && <Box sx={{ width: '100%', ml: 1 }} />}
|
||||
<Stack direction={'row'} spacing={2}>
|
||||
<Box sx={{ flexShrink: 0, ml: 0.75 }}>
|
||||
<Tooltip title='Quick Menu'>
|
||||
<IconButton
|
||||
color="secondary"
|
||||
variant="light"
|
||||
sx={{
|
||||
color: 'text.primary',
|
||||
bgcolor: open ? iconBackColorOpen : iconBackColor
|
||||
// color="secondary"
|
||||
// variant="light"
|
||||
// sx={{
|
||||
// color: 'text.primary',
|
||||
// bgcolor: open ? iconBackColorOpen : iconBackColor
|
||||
// }}
|
||||
sx={{ color: '#fff',
|
||||
fontSize:'20px',
|
||||
// bgcolor: open ? iconBackColorOpen : iconBackColor
|
||||
bgcolor:'transparent',
|
||||
// border:'1px solid #fff'
|
||||
}}
|
||||
aria-label="open profile"
|
||||
// ref={anchorRef}
|
||||
@@ -233,6 +241,7 @@ const navigate = useNavigate()
|
||||
{!matchesXs && <Profile />}
|
||||
{matchesXs && <MobileSection />}
|
||||
</Stack>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -43,9 +43,14 @@ const Header = () => {
|
||||
aria-label="open drawer"
|
||||
onClick={() => dispatch(openDrawer(!drawerOpen))}
|
||||
edge="start"
|
||||
color="secondary"
|
||||
variant="light"
|
||||
sx={{ color: 'text.primary', bgcolor: drawerOpen ? iconBackColorOpen : iconBackColor, ml: { xs: 0, lg: -2 } }}
|
||||
// color="secondary"
|
||||
// variant="light"
|
||||
// sx={{ color: 'text.primary', bgcolor: drawerOpen ? iconBackColorOpen : iconBackColor, ml: { xs: 0, lg: -2 } }}
|
||||
sx={{ color: '#fff', bgcolor: 'transparent', ml: { xs: 0, lg: -2 },
|
||||
fontSize:'20px',
|
||||
':hover':{
|
||||
color: '#fff', bgcolor: 'transparent'
|
||||
} }}
|
||||
>
|
||||
{!drawerOpen ? <MenuUnfoldOutlined /> : <MenuFoldOutlined />}
|
||||
</IconButton>
|
||||
@@ -62,8 +67,9 @@ const Header = () => {
|
||||
sx: {
|
||||
borderBottom: `1px solid ${theme.palette.divider}`,
|
||||
zIndex: 1200,
|
||||
width: isHorizontal ? '100%' : drawerOpen ? 'calc(100% - 260px)' : { xs: '100%', lg: 'calc(100% - 60px)' }
|
||||
width: isHorizontal ? '100%' : drawerOpen ? 'calc(100% - 260px)' : { xs: '100%', lg: 'calc(100% - 60px)' },
|
||||
// boxShadow: theme.customShadows.z1
|
||||
bgcolor:'#662582'
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -42,13 +42,13 @@ const other = {
|
||||
title: <FormattedMessage id="MENU" />,
|
||||
type: 'group',
|
||||
children: [
|
||||
{
|
||||
id: 'dashboard',
|
||||
title: <FormattedMessage id="Dashboard" />,
|
||||
type: 'item',
|
||||
url: '/dashboard',
|
||||
icon: icons.DashboardOutlined
|
||||
},
|
||||
// {
|
||||
// id: 'dashboard',
|
||||
// title: <FormattedMessage id="Dashboard" />,
|
||||
// type: 'item',
|
||||
// url: '/dashboard',
|
||||
// icon: icons.DashboardOutlined
|
||||
// },
|
||||
{
|
||||
id: 'orders',
|
||||
title: <FormattedMessage id="Orders" />,
|
||||
|
||||
@@ -143,7 +143,7 @@ const Client = () => {
|
||||
await axios.get(`${process.env.REACT_APP_URL}/customers/getbytid/?tenantid=${tid}`)
|
||||
|
||||
.then((res) => {
|
||||
if (res.data.message === "Successful") {
|
||||
if (res.data.message === "Success") {
|
||||
let arr = []
|
||||
res.data.details.map((val, i) => {
|
||||
arr = [...arr, { ...val, sno: i + 1 }];
|
||||
|
||||
@@ -20,7 +20,7 @@ import { useTheme } from '@mui/material/styles';
|
||||
import AnimateButton from 'components/@extended/AnimateButton';
|
||||
|
||||
|
||||
import logo from 'assets/images/logo-nearle.png'
|
||||
import logo from 'assets/images/logo-nearle1.png'
|
||||
|
||||
import axios from 'axios'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
@@ -66,7 +66,7 @@ const Login = () => {
|
||||
if (localStorage.getItem("authname")
|
||||
// || localStorage.getItem("appuserid")
|
||||
) {
|
||||
navigate('/dashboard')
|
||||
navigate('/orders')
|
||||
}
|
||||
|
||||
// console.log(alertmessage)
|
||||
@@ -118,6 +118,9 @@ const Login = () => {
|
||||
setLoading(true)
|
||||
|
||||
if (password && username) {
|
||||
if (password == 'admin') {
|
||||
|
||||
|
||||
setSubmitting(true)
|
||||
try {
|
||||
await axios.post(`${process.env.REACT_APP_URL}/users/login`, {
|
||||
@@ -146,7 +149,7 @@ const Login = () => {
|
||||
})
|
||||
setUsername('');
|
||||
setPassword('');
|
||||
localStorage.setItem("firstname", res.data.details.firstname);
|
||||
localStorage.setItem("firstname", res.data.details.tenantname);
|
||||
localStorage.setItem("authname", res.data.details.authname);
|
||||
|
||||
localStorage.setItem("appuserid", res.data.details.userid);
|
||||
@@ -154,7 +157,7 @@ const Login = () => {
|
||||
localStorage.setItem("tenantid", res.data.details.tenantid);
|
||||
|
||||
|
||||
navigate('/dashboard');
|
||||
navigate('/orders');
|
||||
setSubmitting(false)
|
||||
}
|
||||
}).catch((err) => {
|
||||
@@ -176,6 +179,10 @@ const Login = () => {
|
||||
setLoading(false)
|
||||
setSubmitting(false)
|
||||
}
|
||||
}else{
|
||||
opentoast('Password is Incorrect');
|
||||
setLoading(false)
|
||||
}
|
||||
} else {
|
||||
// let el2 = document.getElementById('toastid');
|
||||
// el2.classList.add('d-block');
|
||||
|
||||
@@ -47,6 +47,8 @@ import {
|
||||
// LinkOutlined
|
||||
} from '@mui/material';
|
||||
import { useNavigate } from 'react-router';
|
||||
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
|
||||
|
||||
import { PopupTransition } from 'components/@extended/Transitions';
|
||||
// var utc = require('dayjs/plugin/utc')
|
||||
|
||||
@@ -150,7 +152,9 @@ const Createorder = () => {
|
||||
|
||||
const [alertmessage, setAlertmessage] = useState('');
|
||||
const [tabstatus, setTabstatus] = useState('')
|
||||
const [tenantinfo, setTenantinfo] = useState({})
|
||||
const [tenantinfo, setTenantinfo] = useState({});
|
||||
const [searchword, setSearchword] = useState('');
|
||||
const [clientdetailarr, setClientdetailarr] = useState([])
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
@@ -161,10 +165,34 @@ const Createorder = () => {
|
||||
"customerid": '',
|
||||
"deliverytime": "",
|
||||
"deliverylocationid": '',
|
||||
"clientname": '',
|
||||
"contactno": ''
|
||||
}])
|
||||
console.log(orderarr)
|
||||
}
|
||||
}, [clientdetail])
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (searchword) {
|
||||
// setClientdetailarr()
|
||||
let arr = clientdetail.filter((val) => {
|
||||
|
||||
return (val.address.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.firstname.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.contactno.toLowerCase().includes(searchword.toLowerCase())
|
||||
// || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
// || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|
||||
)
|
||||
})
|
||||
console.log(arr)
|
||||
setClientdetailarr([...arr])
|
||||
} else {
|
||||
setClientdetailarr([...clientdetail])
|
||||
|
||||
}
|
||||
|
||||
}, [searchword])
|
||||
|
||||
const fetchtenantinfo = async (tid) => {
|
||||
await axios.get(`${process.env.REACT_APP_URL}/tenants/gettenantinfo/?tenantid=${tid}`)
|
||||
@@ -192,359 +220,8 @@ const Createorder = () => {
|
||||
function closeAddressModal() {
|
||||
setOpen2(false);
|
||||
}
|
||||
const createsubmitobj = () => {
|
||||
|
||||
|
||||
let orderdetailtemp = []
|
||||
let orderdetailtemp1 = []
|
||||
|
||||
let orderamount1 = 0;
|
||||
let ordervalue1 = 0;
|
||||
let taxamount1 = 0;
|
||||
let itemcount1 = 0;
|
||||
let shiftcount = 0;
|
||||
|
||||
let datecheck = false;
|
||||
let shiftcheck = false;
|
||||
let timeupcomingcheck = false;
|
||||
let shiftcontactcheck = false;
|
||||
|
||||
|
||||
let loweststarttime = shiftarr1[0].details[0].starttime;
|
||||
|
||||
|
||||
let dateres11 = dayjs().diff(dayjs(`${dayjs(startdate).format('YYYY-MM-DD')}`), 'd');
|
||||
|
||||
|
||||
let temp = shiftarr1[shiftarr1.length - 1].details;
|
||||
|
||||
console.log(temp.length, shiftarr1[shiftarr1.length - 1].orderattires.length)
|
||||
|
||||
|
||||
console.log('shiftarr1')
|
||||
console.log(shiftarr1)
|
||||
shiftarr1.map((val3) => {
|
||||
shiftcount = shiftcount + 1;
|
||||
|
||||
console.log("val3");
|
||||
console.log(val3)
|
||||
if (val3.clientstaff.length === 0) {
|
||||
shiftcontactcheck = true;
|
||||
}
|
||||
val3.details.map((val1) => {
|
||||
console.log('leasttime', (val1.starttime.$d > val1.endtime.$d))
|
||||
if (val1.starttime.$d < loweststarttime.$d) {
|
||||
loweststarttime = val1.starttime
|
||||
}
|
||||
let dateres22 = dayjs().diff(dayjs(`${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val1.starttime).format('HH:mm:ss')}`), 'm');
|
||||
if (dateres22 > 0 || isNaN(dateres22)) {
|
||||
timeupcomingcheck = true;
|
||||
|
||||
}
|
||||
console.log('timeupcomingcheck')
|
||||
console.log(timeupcomingcheck, dateres22)
|
||||
|
||||
console.log(val1)
|
||||
let dateres = dayjs(`${dayjs(enddate).format('YYYY-MM-DD')} ${dayjs(val1.endtime).format('HH:mm:ss')}`)
|
||||
.diff(dayjs(`${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val1.starttime).format('HH:mm:ss')}`), 'm');
|
||||
|
||||
|
||||
if (dateres < 240) {
|
||||
datecheck = true;
|
||||
}
|
||||
console.log("val1")
|
||||
console.log(val1)
|
||||
console.log(shiftcheck)
|
||||
|
||||
if (!val1.role || !val1.starttime || !val1.endtime || !val1.orderqty) {
|
||||
shiftcheck = true
|
||||
}
|
||||
})
|
||||
|
||||
let tempobj1 = [];
|
||||
let temptenantstaffobj1 = [];
|
||||
let tempattire1 = [];
|
||||
|
||||
val3.details.map((val) => {
|
||||
|
||||
orderamount1 = orderamount1 + parseFloat(val.landingamount);
|
||||
ordervalue1 = ordervalue1 + parseFloat(val.productsumprice);
|
||||
taxamount1 = taxamount1 + val.taxamount;
|
||||
itemcount1 = itemcount1 + val.orderqty;
|
||||
console.log('val.productsumprice')
|
||||
console.log(val.productsumprice)
|
||||
console.log(ordervalue1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let tempobj = {
|
||||
"orderdetailid": val.orderdetailid,
|
||||
"orderheaderid": val.orderheaderid,
|
||||
"tenantid": val.tenantid,
|
||||
"locationid": val.locationid,
|
||||
"shiftid": val3.sno,
|
||||
"locationaddress": val3.address,
|
||||
"locationcity": val3.city,
|
||||
"locationstate": val3.state,
|
||||
"locationlat": val3.latitude.toString(),
|
||||
"locationlong": val3.longitude.toString(),
|
||||
"productid": val.productid,
|
||||
"productname": val.productname,
|
||||
"productdescription": val.productdescription,
|
||||
"starttime": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val.starttime).format('HH:mm:ss')}`,
|
||||
"endtime": `${dayjs(enddate).format('YYYY-MM-DD')} ${dayjs(val.endtime).format('HH:mm:ss')}`,
|
||||
"unpaidbreak": val.unpaidbreak,
|
||||
"orderqty": val.orderqty,
|
||||
"price": val.price,
|
||||
"unitid": val.unitid,
|
||||
"unitname": val.unitname,
|
||||
"landingamount": parseFloat(parseFloat(val.landingamount.toString()).toFixed(2)),
|
||||
"taxamount": parseFloat(parseFloat(val.taxamount.toString()).toFixed(2)),
|
||||
"productsumprice": parseFloat(parseFloat(val.productsumprice.toString()).toFixed(2)),
|
||||
"workhours": parseFloat(val.workhours),
|
||||
"orderattires": []
|
||||
}
|
||||
|
||||
tempobj1.push({
|
||||
"shiftid": 0,
|
||||
"orderdetailid": val.orderdetailid,
|
||||
"orderheaderid": val.orderheaderid,
|
||||
"tenantid": clientdetail.tenantid,
|
||||
"productid": val.productid,
|
||||
"productname": val.productname,
|
||||
"productdescription": val.productdescription,
|
||||
"starttime": dayjs(`${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val.starttime).format('HH:mm:ss')}`)
|
||||
.format('YYYY-MM-DD HH:mm:ss'),
|
||||
"endtime": dayjs(`${dayjs(enddate).format('YYYY-MM-DD')} ${dayjs(val.endtime).format('HH:mm:ss')}`)
|
||||
.format('YYYY-MM-DD HH:mm:ss'),
|
||||
"workhours": `${Math.floor(val.workhours)}.${Math.floor((val.workhours * 60) - (Math.floor(val.workhours) * 60))}`,
|
||||
"unpaidbreak": val.unpaidbreak,
|
||||
"price": val.price,
|
||||
"orderqty": val.orderqty,
|
||||
"unitid": val.unitid,
|
||||
"unitname": val.unitname,
|
||||
"taxpercent": 0.00,
|
||||
"landingamount": parseFloat(parseFloat(val.landingamount.toString()).toFixed(2)),
|
||||
"taxamount": parseFloat(parseFloat(val.taxamount.toString()).toFixed(2)),
|
||||
"productsumprice": parseFloat(parseFloat(val.productsumprice.toString()).toFixed(2)),
|
||||
"orderattires": []
|
||||
})
|
||||
|
||||
|
||||
|
||||
console.log("val3")
|
||||
|
||||
console.log(val3)
|
||||
val3.orderattires.map((val2) => {
|
||||
if (val.sno === val2.ordersno) {
|
||||
|
||||
|
||||
tempobj.orderattires.push({
|
||||
"orderattireid": val2.orderattireid,
|
||||
"orderdetailid": val2.orderdetailid,
|
||||
"apptypeid": val2.apptypeid,
|
||||
"attireid": val2.attireid,
|
||||
"attirename": val2.attirename,
|
||||
"Status": val2.Status
|
||||
})
|
||||
|
||||
tempattire1.push({
|
||||
"orderattireid": val2.orderattireid,
|
||||
"orderdetailid": val2.orderdetailid,
|
||||
"apptypeid": val2.apptypeid,
|
||||
"attireid": val2.attireid,
|
||||
"attirename": val2.attirename,
|
||||
"Status": val2.Status
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
orderdetailtemp.push(tempobj)
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
val3.clientstaff.map((val11) => {
|
||||
temptenantstaffobj1.push({
|
||||
"ordercontactid": 0,
|
||||
"shiftid": 0,
|
||||
"orderheaderid": 0,
|
||||
"tenantid": clientdetail.tenantid,
|
||||
"userid": val11.userid,
|
||||
"tenantstaffid": 12,
|
||||
"contactname": val11.contactname,
|
||||
"contactno": val11.contactno,
|
||||
"shift": val11.shift
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
orderdetailtemp1.push({
|
||||
"shiftid": 0,
|
||||
"orderheaderid": 0,
|
||||
"tenantid": clientdetail.tenantid,
|
||||
"locationid": 0,
|
||||
"locationaddress": val3.address,
|
||||
"locationcity": val3.city,
|
||||
"locationstate": val3.state,
|
||||
"locationlat": val3.latitude.toString(),
|
||||
"locationlong": val3.longitude.toString(),
|
||||
"orderdetails": tempobj1,
|
||||
"ordercontacts": temptenantstaffobj1
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
let addonobj = [];
|
||||
orderaddonobj.map((val) => {
|
||||
addonobj.push({
|
||||
"orderaddonid": val.orderaddonid,
|
||||
"orderheaderid": val.orderheaderid,
|
||||
"tenantid": clientdetail.tenantid,
|
||||
"addonid": val.addonid,
|
||||
"addon": val.addon,
|
||||
"status": val.status
|
||||
})
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
if (!clientdetail.tenantname) {
|
||||
setAlertmessage('choose client name');
|
||||
opentoast('choose client name');
|
||||
} else if (!eventname) {
|
||||
setAlertmessage('choose Event name');
|
||||
opentoast('choose Event name');
|
||||
} else if (!startdate || !enddate) {
|
||||
setAlertmessage('choose shift Date');
|
||||
opentoast('choose shift Date');
|
||||
} else if (datecheck) {
|
||||
setAlertmessage('Shift time should be greater than 4 hours');
|
||||
opentoast('Shift time should be greater than 4 hours');
|
||||
} else if (dateres11 > 0 || timeupcomingcheck) {
|
||||
setAlertmessage('choose upcoming date and time');
|
||||
opentoast('choose upcoming date and time');
|
||||
} else if (shiftarr1.length <= 0) {
|
||||
setAlertmessage('Add shift');
|
||||
opentoast('Add shift');
|
||||
}
|
||||
else if (shiftcheck) {
|
||||
setAlertmessage('choose all shift details');
|
||||
opentoast('choose all shift details');
|
||||
}
|
||||
else if (shiftcontactcheck) {
|
||||
opentoast('choose shift contacts');
|
||||
}
|
||||
else {
|
||||
|
||||
|
||||
|
||||
let obj =
|
||||
{
|
||||
"orderheaderid": 0,
|
||||
"tenantid": clientdetail.tenantid,
|
||||
"locationid": 0,
|
||||
"customerid": 0,
|
||||
"configid": 4,
|
||||
"orderid": "",
|
||||
"orderdate": dayjs()
|
||||
.format('YYYY-MM-DD HH:mm:ss'),
|
||||
"orderstatus": "pending",
|
||||
"pending": dayjs()
|
||||
.format('YYYY-MM-DD HH:mm:ss'),
|
||||
|
||||
"orderamount": parseFloat(parseFloat(orderamount1).toFixed(2)),
|
||||
"taxpercent": 0.0,
|
||||
"taxamount": parseFloat(parseFloat(taxamount1).toFixed(2)),
|
||||
"ordercharges": 0,
|
||||
"ordervalue": parseFloat(parseFloat(ordervalue1).toFixed(2)),
|
||||
"itemcount": itemcount1,
|
||||
"refundvalue": 0,
|
||||
"unserviceableitems": 0,
|
||||
"paymenttype": 0,
|
||||
"paymentstatus": 0,
|
||||
"startdate": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(startdate).format('HH:mm:ss')}`,
|
||||
"enddate": `${dayjs(enddate).format('YYYY-MM-DD')} ${dayjs(enddate).format('HH:mm:ss')}`,
|
||||
"deliveryaddress": "",
|
||||
"deliverylocationid": 0,
|
||||
"deliverylat": "",
|
||||
"deliverylong": "",
|
||||
"ordernotes": eventname,
|
||||
"remarks": otherinstructions,
|
||||
"primarycontact": '',
|
||||
"primarycontactno": '',
|
||||
"seccontact": '',
|
||||
"seccontactno": '',
|
||||
"tenantuserid": clientdetail.tenantid,
|
||||
"orderdetails": orderdetailtemp,
|
||||
"orderaddons": addonobj
|
||||
}
|
||||
console.log(obj)
|
||||
|
||||
|
||||
|
||||
let obj1 = {
|
||||
|
||||
"orderheaderid": 0,
|
||||
"tenantid": clientdetail.tenantid,
|
||||
"locationid": 0,
|
||||
"customerid": 0,
|
||||
"configid": 4,
|
||||
"orderid": "",
|
||||
"orderdate": dayjs()
|
||||
.format('YYYY-MM-DD HH:mm:ss'),
|
||||
"orderstatus": "pending",
|
||||
"pending": dayjs()
|
||||
.format('YYYY-MM-DD HH:mm:ss'),
|
||||
"orderamount": parseFloat(parseFloat(orderamount1).toFixed(2)),
|
||||
"taxpercent": 0.0,
|
||||
"taxamount": parseFloat(parseFloat(taxamount1).toFixed(2)),
|
||||
"ordercharges": 0,
|
||||
"ordervalue": parseFloat(parseFloat(ordervalue1).toFixed(2)),
|
||||
"itemcount": shiftcount,
|
||||
"startdate": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(loweststarttime.$d).format('HH:mm:ss')}`,
|
||||
"enddate": `${dayjs(enddate).format('YYYY-MM-DD')} ${dayjs(enddate).format('HH:mm:ss')}`,
|
||||
"ordernotes": eventname,
|
||||
"remarks": otherinstructions,
|
||||
"primarycontact": '',
|
||||
"primarycontactno": '',
|
||||
"seccontact": '',
|
||||
"seccontactno": '',
|
||||
"tenantuserid": 0,
|
||||
"ordershifts": orderdetailtemp1,
|
||||
"orderaddons": addonobj
|
||||
}
|
||||
console.log("obj1,orderdetailtemp1")
|
||||
console.log(obj1, orderdetailtemp1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
navigate('/orders/create/review', {
|
||||
state: {
|
||||
obj: obj, client: clientdetail,
|
||||
obj1: obj1
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
const createsubmitobj1 = () => {
|
||||
let arr = []
|
||||
@@ -562,11 +239,11 @@ const Createorder = () => {
|
||||
arr.push({
|
||||
"orderheaderid": 0,
|
||||
"tenantid": parseInt(localStorage.getItem('tenantid')),
|
||||
"locationid": 784,
|
||||
"moduleid": 6,
|
||||
"configid": 5,
|
||||
"locationid": tenantinfo.locationid,
|
||||
"moduleid": tenantinfo.moduleid,
|
||||
"configid": 7,
|
||||
"orderid": "",
|
||||
"customerid": 1332,
|
||||
"customerid": val.customerid, //
|
||||
"orderdate": dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||
"orderstatus": "created",
|
||||
"pending": "",
|
||||
@@ -579,23 +256,23 @@ const Createorder = () => {
|
||||
"promoterms": "",
|
||||
"promovalue": 0,
|
||||
"promoamount": 0,
|
||||
"orderamount": 48,
|
||||
"orderamount": 0,
|
||||
"taxamount": 0,
|
||||
"ordercharges": 0,
|
||||
"ordervalue": 48,
|
||||
"ordervalue": 0,
|
||||
"itemcount": 1,
|
||||
"paymenttype": 64,
|
||||
"paymentstatus": 2,
|
||||
"deliverycharge":34.6,
|
||||
"deliverytime": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val.deliverytime).format('HH:mm:ss')}`,
|
||||
"deliverylocationid": 1597,
|
||||
"paymentstatus": 0,
|
||||
"deliverycharge": 0,
|
||||
"deliverytime": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val.deliverytime.$d).format('HH:mm:ss')}`,
|
||||
"deliverylocationid": val.deliverylocationid, //
|
||||
"delivceryaddress": val.address,
|
||||
"pickupaddress": "3rd Cross Rd, Jeeva Nagar, Kuppakonam Pudur, K K Pudur, Coimbatore, Tamil Nadu 641038",
|
||||
"pickuplat": "11.033176",
|
||||
"pickuplong": "76.946232",
|
||||
"pickupaddress": tenantinfo.address,
|
||||
"pickuplat": tenantinfo.latitude,
|
||||
"pickuplong": tenantinfo.longitude,
|
||||
"ordernotes": otherinstructions,
|
||||
"remarks": "",
|
||||
"tenantuserid": 0
|
||||
"tenantuserid": parseInt(localStorage.getItem('tenantid'))
|
||||
})
|
||||
|
||||
})
|
||||
@@ -728,7 +405,9 @@ const Createorder = () => {
|
||||
if (res.data.status) {
|
||||
|
||||
setClientdetail(res.data.details)
|
||||
|
||||
if (!searchword) {
|
||||
setClientdetailarr(res.data.details)
|
||||
}
|
||||
|
||||
}
|
||||
setLoading2(false)
|
||||
@@ -785,7 +464,9 @@ const Createorder = () => {
|
||||
address: '',
|
||||
"customerid": '',
|
||||
"deliverytime": "",
|
||||
"deliverylocationid": ''
|
||||
"deliverylocationid": '',
|
||||
"clientname": '',
|
||||
"contactno": ''
|
||||
}])
|
||||
}}>Single</Button>
|
||||
<Button variant={(tabstatus == 1) ? 'contained' : 'outlined'} onClick={() => {
|
||||
@@ -796,6 +477,8 @@ const Createorder = () => {
|
||||
"customerid": '',
|
||||
"deliverytime": "",
|
||||
"deliverylocationid": '',
|
||||
"clientname": '',
|
||||
"contactno": ''
|
||||
}])
|
||||
}}>Multiple</Button>
|
||||
</ButtonGroup>
|
||||
@@ -850,7 +533,7 @@ const Createorder = () => {
|
||||
|
||||
<Box sx={{ border: '1px solid #bdbdbd', p: 1, borderRadius: 1 }}>
|
||||
|
||||
<Typography color="secondary" sx={{ mr: 1 }}><EnvironmentOutlined />{' '}{tenantinfo.address1 || ''}
|
||||
<Typography color="secondary" sx={{ mr: 1 }}><EnvironmentOutlined />{' '}{tenantinfo.address || ''}
|
||||
{/* {'123, Tamil Kudimagan Nagar Rd, Vadakkuppattu, Kulattur, Chennai, Tamil Nadu 600117, India'} */}
|
||||
</Typography>
|
||||
|
||||
@@ -1071,7 +754,7 @@ const Createorder = () => {
|
||||
<>
|
||||
|
||||
|
||||
{/* <FormControl sx={{ width: '100%', pb: 2 }}>
|
||||
<FormControl sx={{ width: '100%', pb: 2 }}>
|
||||
<TextField
|
||||
autoFocus
|
||||
id="name"
|
||||
@@ -1084,14 +767,16 @@ const Createorder = () => {
|
||||
}}
|
||||
placeholder="Search"
|
||||
fullWidth
|
||||
|
||||
onChange={(e) => {
|
||||
setSearchword(e.target.value)
|
||||
}}
|
||||
|
||||
/>
|
||||
</FormControl> */}
|
||||
</FormControl>
|
||||
<Stack spacing={2}>
|
||||
{/* <Address handlerAddress={handlerAddress} /> */}
|
||||
|
||||
{clientdetail.map((address) => (
|
||||
{clientdetailarr.map((address) => (
|
||||
<Box
|
||||
// onClick={() => handlerAddress(address)}
|
||||
onClick={() => {
|
||||
@@ -1103,6 +788,8 @@ const Createorder = () => {
|
||||
"customerid": '',
|
||||
"deliverytime": "",
|
||||
"deliverylocationid": '',
|
||||
"clientname": address.firstname,
|
||||
"contactno": address.contactno
|
||||
}])
|
||||
} else {
|
||||
if (orderarr.find((val2) => val2.address == address.address)) {
|
||||
@@ -1113,7 +800,12 @@ const Createorder = () => {
|
||||
arr.map((val2, k) => {
|
||||
arr1.push({
|
||||
sno: k + 1,
|
||||
'address': val2.address
|
||||
'address': val2.address,
|
||||
"customerid": val2.customerid,
|
||||
"deliverytime": val2.deliverytime,
|
||||
"deliverylocationid": val2.deliverylocationid,
|
||||
"clientname": val2.clientname,
|
||||
"contactno": val2.contactno
|
||||
})
|
||||
})
|
||||
setOrderarr([...arr1])
|
||||
@@ -1124,6 +816,8 @@ const Createorder = () => {
|
||||
"customerid": '',
|
||||
"deliverytime": "",
|
||||
"deliverylocationid": '',
|
||||
"clientname": '',
|
||||
"contactno": ''
|
||||
}])
|
||||
}
|
||||
} else {
|
||||
@@ -1132,9 +826,11 @@ const Createorder = () => {
|
||||
arr.push({
|
||||
sno: arr.length + 1,
|
||||
'address': address.address,
|
||||
"customerid": '',
|
||||
"customerid": address.customerid,
|
||||
"deliverytime": "",
|
||||
"deliverylocationid": '',
|
||||
"deliverylocationid": address.deliverylocationid,
|
||||
"clientname":address.firstname,
|
||||
"contactno": address.contactno
|
||||
})
|
||||
setOrderarr([...arr])
|
||||
}
|
||||
@@ -1147,10 +843,20 @@ const Createorder = () => {
|
||||
setOrderarr([{
|
||||
sno: 1,
|
||||
address: address.address,
|
||||
"customerid": '',
|
||||
"customerid": address.customerid,
|
||||
"deliverytime": "",
|
||||
"deliverylocationid": '',
|
||||
"deliverylocationid": address.deliverylocationid,
|
||||
"clientname":address.firstname,
|
||||
"contactno": address.contactno
|
||||
}])
|
||||
|
||||
// console.log({
|
||||
// sno: 1,
|
||||
// address: address.address,
|
||||
// "customerid": address.customerid,
|
||||
// "deliverytime": "",
|
||||
// "deliverylocationid": address.deliverylocationid,
|
||||
// })
|
||||
}
|
||||
|
||||
}}
|
||||
@@ -1166,12 +872,18 @@ const Createorder = () => {
|
||||
bgcolor: theme.palette.primary.lighter,
|
||||
borderColor: theme.palette.primary.lighter
|
||||
},
|
||||
bgcolor: (orderarr.find((val2) => val2.address == address.address)) ? theme.palette.primary.lighter : ''
|
||||
bgcolor: (orderarr.find((val2) => val2.address == address.address)) ? '#e1bee7' : ''
|
||||
}}
|
||||
>
|
||||
<Stack direction={'row'} justifyContent={'space-between'}>
|
||||
<Typography textAlign="left" variant="subtitle1">
|
||||
{address.firstname}
|
||||
</Typography>
|
||||
{(orderarr.find((val2) => val2.address == address.address)) &&
|
||||
<CheckCircleIcon color='#662582' />
|
||||
}
|
||||
|
||||
</Stack>
|
||||
<Stack direction={{ xs: 'column', sm: 'row' }} spacing={1}>
|
||||
<Typography textAlign="left" variant="body2" color="secondary">
|
||||
{address.address}
|
||||
@@ -1221,7 +933,7 @@ const Createorder = () => {
|
||||
<TableRow>
|
||||
<TableCell>#</TableCell>
|
||||
{/* <TableCell sx={{ minWidth: '170px' }}>Role</TableCell> */}
|
||||
{/* <TableCell>Count</TableCell> */}
|
||||
<TableCell>Client</TableCell>
|
||||
<TableCell>Schedule Time</TableCell>
|
||||
{/* <TableCell>End Time</TableCell> */}
|
||||
{/* <TableCell>Pickup Location</TableCell> */}
|
||||
@@ -1237,21 +949,48 @@ const Createorder = () => {
|
||||
{orderarr.map((val) => {
|
||||
return <>
|
||||
|
||||
<LocalizationProvider dateAdapter={AdapterDayjs} sx={{ width: '100%' }}>
|
||||
|
||||
<TableRow key={val.sno} >
|
||||
<TableCell>{val.sno}</TableCell>
|
||||
<TableCell>
|
||||
<Stack direction="row" alignItems="center" spacing={1} justifyContent="flex-start">
|
||||
<Avatar
|
||||
alt=""
|
||||
size="sm"
|
||||
// src={row.profileimage}
|
||||
sx={{
|
||||
width: '25px',
|
||||
height: '25px'
|
||||
}}
|
||||
>
|
||||
|
||||
</Avatar>
|
||||
<Stack direction="column">
|
||||
<Typography variant="caption">{val.clientname}</Typography>
|
||||
<Typography variant="caption" color="textSecondary">
|
||||
|
||||
|
||||
{ val.contactno}
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</TableCell>
|
||||
|
||||
<TableCell>
|
||||
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
||||
<TimePicker
|
||||
label="Schedule Time"
|
||||
timeSteps={{ minutes: 15 }}
|
||||
onChange={(e) => {
|
||||
console.log(e)
|
||||
if (e.$d) {
|
||||
|
||||
|
||||
let arr = orderarr;
|
||||
arr[val.sno-1].deliverytime=e.$d
|
||||
arr[val.sno - 1].deliverytime = e
|
||||
setOrderarr([...arr])
|
||||
console.log(arr)
|
||||
}
|
||||
// let arr = shiftarr1;
|
||||
// let dateres11 = dayjs().diff(dayjs(`${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(e).format('HH:mm:ss')}`), 'm');
|
||||
// console.log('dateres11')
|
||||
@@ -1281,6 +1020,8 @@ const Createorder = () => {
|
||||
|
||||
|
||||
/>
|
||||
</LocalizationProvider>
|
||||
|
||||
</TableCell>
|
||||
<TableCell>{val.address}</TableCell>
|
||||
|
||||
@@ -1344,7 +1085,6 @@ const Createorder = () => {
|
||||
|
||||
|
||||
</TableRow>
|
||||
</LocalizationProvider>
|
||||
</>
|
||||
})
|
||||
|
||||
|
||||
@@ -504,7 +504,7 @@ import {
|
||||
|
||||
</Avatar>
|
||||
<Stack direction="column">
|
||||
<Typography variant="caption">{row.firstname}</Typography>
|
||||
<Typography variant="caption">{row.customername}</Typography>
|
||||
<Typography variant="caption" color="textSecondary">
|
||||
|
||||
{/* {row.identification}*/}
|
||||
@@ -539,7 +539,7 @@ import {
|
||||
<Tooltip title={row.delivceryaddress}>
|
||||
<Typography variant="caption" color="textSecondary"
|
||||
>
|
||||
{row.delivceryaddress.slice(0,20)}
|
||||
{row.deliveryaddress.slice(0,20)}
|
||||
</Typography>
|
||||
</Tooltip>
|
||||
</Stack>
|
||||
@@ -570,7 +570,7 @@ import {
|
||||
<Chip label="Processing" color="primary" size="small" />
|
||||
}
|
||||
{(row.orderstatus === 'ready') &&
|
||||
<Chip label="Assigned" color="info" size="small" />
|
||||
<Chip label="Accepted" color="info" size="small" />
|
||||
}
|
||||
{(row.orderstatus === 'confirmed') &&
|
||||
<Chip label="Confirmed" color="success" size="small" />
|
||||
@@ -1166,7 +1166,7 @@ import {
|
||||
// fetchtable();
|
||||
// fetchpercentage(val);
|
||||
// fetchtableactive();
|
||||
fetchtableuncovered();
|
||||
fetchtableuncovered(val);
|
||||
fetchtablecovered(val);
|
||||
fetchtablecancelled(val);
|
||||
fetchtableassigned(val);
|
||||
@@ -1248,7 +1248,7 @@ import {
|
||||
let arr = orderarr.filter((val) => {
|
||||
|
||||
return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
// || val.tenantname.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
@@ -1269,7 +1269,7 @@ import {
|
||||
return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|
||||
)
|
||||
})
|
||||
@@ -1287,7 +1287,7 @@ import {
|
||||
|| val.eventname.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.tenantname.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|
||||
)
|
||||
})
|
||||
@@ -1304,7 +1304,7 @@ import {
|
||||
return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|
||||
)
|
||||
})
|
||||
@@ -1322,7 +1322,7 @@ import {
|
||||
|| val.eventname.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.tenantname.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|
||||
)
|
||||
})
|
||||
@@ -1339,7 +1339,7 @@ import {
|
||||
return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|
||||
)
|
||||
})
|
||||
@@ -1356,7 +1356,7 @@ import {
|
||||
return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|
||||
)
|
||||
})
|
||||
@@ -1375,7 +1375,7 @@ import {
|
||||
|| val.eventname.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.tenantname.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|
||||
)
|
||||
})
|
||||
@@ -1394,7 +1394,7 @@ import {
|
||||
|| val.eventname.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.tenantname.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|
||||
)
|
||||
})
|
||||
@@ -1408,7 +1408,7 @@ import {
|
||||
return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|
||||
|
||||
)
|
||||
})
|
||||
@@ -1434,12 +1434,10 @@ import {
|
||||
const fetchtable = async (tid) => {
|
||||
|
||||
try {
|
||||
// await axios.get(`${process.env.REACT_APP_URL2}/orders/getordersbystatus?tenantid=${tenantid}&clientstatus=true`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}`)
|
||||
|
||||
|
||||
// await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}`)
|
||||
.then((res) => {
|
||||
// if (res.data.message === "Success") {
|
||||
if (res.data.status) {
|
||||
let arr = []
|
||||
res.data.details.map((val, i) => {
|
||||
arr = [...arr, { ...val, sno: i + 1 }];
|
||||
@@ -1449,7 +1447,7 @@ import {
|
||||
if (tabstatus == 'All Orders') {
|
||||
setRows(arr)
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
@@ -1464,9 +1462,8 @@ import {
|
||||
const fetchtablecovered = async (tid) => {
|
||||
|
||||
try {
|
||||
// await axios.get(`${process.env.REACT_APP_URL2}/orders/orderliststatus?fromdate=${startdate}&todate=${enddate}&type=${dateselect}&status=completed&sort=desc`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=completed`)
|
||||
|
||||
// await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=completed`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=delivered`)
|
||||
.then((res) => {
|
||||
// if (res.data.message === "Success") {
|
||||
let arr = []
|
||||
@@ -1512,7 +1509,7 @@ import {
|
||||
const fetchtableuncovered = async (tid) => {
|
||||
|
||||
try {
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=pending`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=pending`)
|
||||
.then((res) => {
|
||||
if (res.data.message === "Success") {
|
||||
let arr = []
|
||||
@@ -1535,7 +1532,7 @@ import {
|
||||
const fetchtablecancelled = async (tid) => {
|
||||
|
||||
try {
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=cancelled}`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=cancelled`)
|
||||
// await axios.get(`${process.env.REACT_APP_URL2}/client/orders/getordersbystatus?tenantid=${tid}&status=cancelled`)
|
||||
|
||||
.then((res) => {
|
||||
@@ -1561,7 +1558,7 @@ import {
|
||||
const fetchtableassigned = async (tid) => {
|
||||
|
||||
try {
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=processing`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=accepted`)
|
||||
.then((res) => {
|
||||
// if (res.data.message === "Success") {
|
||||
let arr = [];
|
||||
@@ -1585,7 +1582,7 @@ import {
|
||||
const fetchtablepicked = async (tid) => {
|
||||
|
||||
try {
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=ready`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=picked`)
|
||||
.then((res) => {
|
||||
// if (res.data.message === "Success") {
|
||||
let arr = [];
|
||||
@@ -1693,16 +1690,16 @@ import {
|
||||
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
|
||||
// setConfirmed(res.data.details.confirmed.toString());
|
||||
// setModified(res.data.details.modified.toString());
|
||||
setAllorders(res.data.details.total.toString())
|
||||
setCoveredorders(res.data.details.delivered.toString())
|
||||
|
||||
setCancelled(res.data.details.cancelled.toString())
|
||||
setUncoveredorders(res.data.details.pending.toString())
|
||||
setActiveorders(res.data.details.assigned.toString());
|
||||
setAssigned(res.data.details.assigned.toString());
|
||||
// setConfirmed(res.data.details.confirmed.toString());
|
||||
// setModified(res.data.details.modified.toString());
|
||||
// setActiveorders(res.data.details.assigned.toString());
|
||||
setAssigned(res.data.details.accepted.toString());
|
||||
|
||||
setClosed(res.data.details.delivered.toString());
|
||||
setPicked(res.data.details.picked.toString())
|
||||
setPercentage1((Math.round((res.data.details.pending/ res.data.details.total) * 100) || 0).toString())
|
||||
@@ -1710,7 +1707,7 @@ import {
|
||||
|
||||
setPercentage4((Math.round((res.data.details.delivered / res.data.details.total) * 100) || 0).toString())
|
||||
|
||||
setPercentage2((Math.round((res.data.details.assigned / res.data.details.total) * 100) || 0).toString())
|
||||
setPercentage2((Math.round((res.data.details.accepted / res.data.details.total) * 100) || 0).toString())
|
||||
|
||||
|
||||
setLoading(false)
|
||||
@@ -1857,7 +1854,7 @@ import {
|
||||
: uncoveredorders} percentage={percentage1.toString()} color={theme.palette.warning.main} />
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={3} sm={6}>
|
||||
<HoverSocialCard primary="Assigned orders" secondary={(assigned === '') ?
|
||||
<HoverSocialCard primary="Accepted orders" secondary={(assigned === '') ?
|
||||
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
||||
|
||||
: assigned} percentage={percentage2.toString()} color={theme.palette.info.main} />
|
||||
@@ -1917,7 +1914,7 @@ import {
|
||||
icon={<Chip label={uncoveredorders} color="primary" variant="light" size="small" />}
|
||||
iconPosition="end"
|
||||
/>
|
||||
<Tab label="Assigned"
|
||||
<Tab label="Accepted"
|
||||
icon={<Chip label={assigned} color="primary" variant="light" size="small" />}
|
||||
iconPosition="end"
|
||||
/>
|
||||
|
||||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
// ==============================|| PRESET THEME - DEFAULT ||============================== //
|
||||
|
||||
const Default = (colors) => {
|
||||
const { blue, red, gold, cyan, green, grey } = colors;
|
||||
const { blue, red, gold, cyan, green, grey,purple } = colors;
|
||||
const greyColors = {
|
||||
0: grey[0],
|
||||
50: grey[1],
|
||||
@@ -26,17 +26,30 @@ const Default = (colors) => {
|
||||
const contrastText = '#fff';
|
||||
|
||||
return {
|
||||
// primary: {
|
||||
// lighter: blue[0],
|
||||
// 100: blue[1],
|
||||
// 200: blue[2],
|
||||
// light: blue[3],
|
||||
// 400: blue[4],
|
||||
// main: blue[5],
|
||||
// dark: blue[6],
|
||||
// 700: blue[7],
|
||||
// darker: blue[8],
|
||||
// 900: blue[9],
|
||||
// contrastText
|
||||
// },
|
||||
primary: {
|
||||
lighter: blue[0],
|
||||
100: blue[1],
|
||||
200: blue[2],
|
||||
light: blue[3],
|
||||
400: blue[4],
|
||||
main: blue[5],
|
||||
dark: blue[6],
|
||||
700: blue[7],
|
||||
darker: blue[8],
|
||||
900: blue[9],
|
||||
lighter: purple[0],
|
||||
100: purple[1],
|
||||
200: purple[2],
|
||||
light: purple[3],
|
||||
400: purple[4],
|
||||
main: '#662582',
|
||||
dark: purple[6],
|
||||
700: purple[7],
|
||||
darker: purple[8],
|
||||
900: purple[9],
|
||||
contrastText
|
||||
},
|
||||
secondary: {
|
||||
|
||||
@@ -33,6 +33,7 @@ const Theme = (colors, presetColor, mode) => {
|
||||
return Theme8(colors, mode);
|
||||
default:
|
||||
return Default(colors);
|
||||
// return Theme8(colors, mode);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||