This commit is contained in:
Malai Raja
2024-01-09 15:58:22 +05:30
parent 92cc1445ea
commit 4e0606ef59
9 changed files with 266 additions and 153 deletions

Submodule nearlexpressbuild updated: 7bbcc4548e...4148053366

View File

@@ -15,6 +15,9 @@ const ProfileTab = ({ handleLogout }) => {
const navigate=useNavigate(); const navigate=useNavigate();
const handleListItemClick = (event, index) => { const handleListItemClick = (event, index) => {
setSelectedIndex(index); setSelectedIndex(index);
if(index == 1){
navigate('/accountsettings');
}
}; };
return ( return (

View File

@@ -194,7 +194,8 @@ navigate('/login')
sx={{ sx={{
display: 'flex', display: 'flex',
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'center', // justifyContent: 'center',
justifyContent: 'flex-start',
alignItems: 'center', alignItems: 'center',
textTransform: 'capitalize' textTransform: 'capitalize'
}} }}

View File

@@ -63,13 +63,13 @@ const other = {
url: '/customers', url: '/customers',
icon: icons.UserOutlined icon: icons.UserOutlined
}, },
{ // {
id: 'account', // id: 'account',
title: <FormattedMessage id="Settings" />, // title: <FormattedMessage id="Settings" />,
type: 'item', // type: 'item',
url: '/accountsettings', // url: '/accountsettings',
icon: icons.SettingOutlined // icon: icons.SettingOutlined
}, // },
// { // {
// id: 'documentation', // id: 'documentation',
// title: <FormattedMessage id="documentation" />, // title: <FormattedMessage id="documentation" />,

View File

@@ -254,9 +254,11 @@ const Createclient = () => {
opentoast('Fill post code') opentoast('Fill post code')
} else if (!suburb) { } else if (!suburb) {
opentoast('Fill suburb') opentoast('Fill suburb')
} else if (!emailaddress) { }
opentoast('Fill emailaddress') // else if (!emailaddress) {
} else if (!latlong.lat || !latlong.lng) { // opentoast('Fill emailaddress')
// }
else if (!latlong.lat || !latlong.lng) {
opentoast('Choose valid address') opentoast('Choose valid address')
} else { } else {
let obj = { let obj = {

View File

@@ -185,6 +185,7 @@ const Createorder = () => {
// }]) // }])
// console.log(dayjs()) // console.log(dayjs())
fetchtenantlocation(localStorage.getItem('tenantid')) fetchtenantlocation(localStorage.getItem('tenantid'))
clientdetails(localStorage.getItem('tenantid'))
} }
}, []) }, [])
@@ -550,7 +551,14 @@ const Createorder = () => {
setClientdetail(res.data.details) setClientdetail(res.data.details)
if (!searchword) { if (!searchword) {
setClientdetailarr(res.data.details) let arr=[];
res.data.details.map((val)=>{
arr.push({
...val,
label:`${val.firstname} | ${val.contactno}`
})
})
setClientdetailarr(arr)
} }
} }
@@ -748,7 +756,8 @@ const Createorder = () => {
<Autocomplete <Autocomplete
id="free-solo-demo" id="free-solo-demo"
sx={{ mt: 2 }} sx={{ mt: 2 }}
options={tenantlocationlist} // options={tenantlocationlist}
options={clientdetailarr}
renderInput={(params) => <TextField {...params} label="Choose Location" />} renderInput={(params) => <TextField {...params} label="Choose Location" />}
onChange={(e, val) => { onChange={(e, val) => {
if (val) { if (val) {
@@ -981,7 +990,7 @@ const Createorder = () => {
}) })
if (arr[0]) { if (arr[0]) {
if (tenantinfo.tenantid) { if (tenantinfo.tenantid) {
clientdetails(tenant.tenantid); // clientdetails(tenant.tenantid);
setOpen2(true) setOpen2(true)
} else { } else {

View File

@@ -57,6 +57,7 @@ import AccessTimeOutlinedIcon from '@mui/icons-material/AccessTimeOutlined';
import { PopupTransition } from 'components/@extended/Transitions'; import { PopupTransition } from 'components/@extended/Transitions';
// var utc = require('dayjs/plugin/utc') // var utc = require('dayjs/plugin/utc')
import * as React from 'react'; import * as React from 'react';
import SwapVertIcon from '@mui/icons-material/SwapVert';
import axios from 'axios'; import axios from 'axios';
import { useTheme } from '@mui/material/styles'; import { useTheme } from '@mui/material/styles';
@@ -757,6 +758,7 @@ const Createorder1 = () => {
if (localStorage.getItem('tenantid')) { if (localStorage.getItem('tenantid')) {
fetchtenantlocation(localStorage.getItem('tenantid')) fetchtenantlocation(localStorage.getItem('tenantid'))
clientdetails(localStorage.getItem('tenantid'))
} }
}, []) }, [])
@@ -948,11 +950,11 @@ const Createorder1 = () => {
arr = [{ arr = [{
"orderheaderid": 0, "orderheaderid": 0,
"tenantid": parseInt(localStorage.getItem('tenantid')), "tenantid": parseInt(localStorage.getItem('tenantid')),
"locationid": tenantinfo.locationid, "locationid": tenant.locationid,
"moduleid": tenantinfo.moduleid, "moduleid": tenant.moduleid,
"configid": 7, "configid": 7,
"orderid": "", "orderid": "",
"customerid": clientinfo.customerid, "customerid": tenantinfo.customerid,
"orderdate": dayjs().format('YYYY-MM-DD HH:mm:ss'), "orderdate": dayjs().format('YYYY-MM-DD HH:mm:ss'),
"orderstatus": "created", "orderstatus": "created",
"pending": "", "pending": "",
@@ -960,11 +962,11 @@ const Createorder1 = () => {
"ready": "", "ready": "",
"delivered": "", "delivered": "",
"cancellled": "", "cancellled": "",
"promoid": 0, // "promoid": 0,
"promoname": "", // "promoname": "",
"promoterms": "", // "promoterms": "",
"promovalue": 0, // "promovalue": 0,
"promoamount": 0, // "promoamount": 0,
"orderamount": 0, "orderamount": 0,
"taxamount": 0, "taxamount": 0,
"ordercharges": 0, "ordercharges": 0,
@@ -976,9 +978,12 @@ const Createorder1 = () => {
"deliverytime": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(selectedtime.$d).format('HH:mm:ss')}`, "deliverytime": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(selectedtime.$d).format('HH:mm:ss')}`,
"deliverylocationid": clientinfo.deliverylocationid, "deliverylocationid": clientinfo.deliverylocationid,
"deliveryaddress": clientinfo.address, "deliveryaddress": clientinfo.address,
"pickupaddress": tenantinfo.locationaddress, // "pickupaddress": tenantinfo.locationaddress,//
"pickuplat": tenantinfo.locationlatitude, // "pickuplat": tenantinfo.locationlatitude,//
"pickuplong": tenantinfo.locationlong, // "pickuplong": tenantinfo.locationlong,//
"pickupaddress": tenantinfo.address,//
"pickuplat": tenantinfo.latitude,//
"pickuplong": tenantinfo.longitude,//
"ordernotes": otherinstructions, "ordernotes": otherinstructions,
"remarks": "", "remarks": "",
"tenantuserid": parseInt(localStorage.getItem('tenantid')), "tenantuserid": parseInt(localStorage.getItem('tenantid')),
@@ -987,20 +992,29 @@ const Createorder1 = () => {
"partnerid": tenant.partnerid, "partnerid": tenant.partnerid,
"deliverylat": clientinfo.latitude, "deliverylat": clientinfo.latitude,
"deliverylong": clientinfo.longitude, "deliverylong": clientinfo.longitude,
"applocationid": parseInt(localStorage.getItem('applocationid')) "applocationid": parseInt(localStorage.getItem('applocationid')),
"deliveryid":clientinfo.customerid,
"pickuplocationid":tenantinfo.deliverylocationid
}] }]
if (!tenantinfo.tenantid) { // if (!tenantinfo.tenantid) {
opentoast('Choose Location') // opentoast('Choose Location')
} else if (!clientinfo.address) { // }
opentoast('Choose Customer') // else
if(!tenantinfo.address){
opentoast('Choose Pickup Location')
}else
if (!clientinfo.address) {
opentoast('Choose Drop Location')
} else if (!selectedtime) { } else if (!selectedtime) {
opentoast('Choose Schedule Time') opentoast('Choose Schedule Time')
} else { } else {
setLoading(true) setLoading(true)
await axios.post(`${process.env.REACT_APP_URL}/orders/createorders1`, arr) await axios.post(`${process.env.REACT_APP_URL}/orders/createorders`, arr)
.then((res) => { .then((res) => {
if (res.data.status) { if (res.data.status) {
enqueueSnackbar('Order Created Successfully', { enqueueSnackbar('Order Created Successfully', {
@@ -1171,14 +1185,14 @@ const Createorder1 = () => {
> >
<Grid item xs={12} <Grid item xs={12}
> >
<Stack <Stack
// direction={{ md: 'row', xs: 'column' }} // direction={{ md: 'row', xs: 'column' }}
direction={'row'} direction={'row'}
sx={{ p: 1, ml: 1,mt:1 }} justifyContent="space-between" alignItems="center" width="100%"> sx={{ p: 1, ml: 1, mt: 1 }} justifyContent="space-between" alignItems="center" width="100%">
<Typography variant="h3">Create Order</Typography> <Typography variant="h3">Create Order</Typography>
<Button variant="outlined" onClick={() => { <Button variant="outlined" onClick={() => {
setOpen4(true) setOpen4(true)
}} color="success" startIcon={<PlusOutlined />} >Create Customer</Button> }} color="success" startIcon={<PlusOutlined />} >Create Customer</Button>
</Stack> </Stack>
</Grid> </Grid>
</CardActions> </CardActions>
@@ -1204,7 +1218,7 @@ const Createorder1 = () => {
<Grid item xs={12}> <Grid item xs={12}>
<Grid container spacing={2} sx={{ height: '100%' }}> <Grid container spacing={2} sx={{ height: '100%' }}>
<Grid item xs={12} sm={6} <Grid item xs={12} sm={6}
sx={{ height: '100%' }} // sx={{ height: '100%' }}
> >
<MainCard <MainCard
@@ -1218,13 +1232,22 @@ const Createorder1 = () => {
<Autocomplete <Autocomplete
id="free-solo-demo" id="free-solo-demo"
sx={{ mt: 2 }} sx={{ mt: 2 }}
options={tenantlocationlist} // options={tenantlocationlist}
options={clientdetailarr}
renderInput={(params) => <TextField {...params} label="Choose Location" />} renderInput={(params) => <TextField {...params} label="Choose Location" />}
onChange={(e, val) => { onChange={(e, val) => {
if (val) { if (val) {
setTenantinfo(val)
clientdetails(val.tenantid) // clientdetails(val.tenantid)
if(clientinfo.customerid == val.customerid){
opentoast('choose different Location')
setTenantinfo({})
}else{
setTenantinfo(val)
}
} else { } else {
setTenantinfo({}) setTenantinfo({})
} }
@@ -1235,18 +1258,28 @@ const Createorder1 = () => {
disabled={(tenant.tenantid) ? false : true} disabled={(tenant.tenantid) ? false : true}
/> />
</Grid> </Grid>
<Grid item xs={12}> <Grid item xs={12} >
<Box sx={{ border: '1px solid #bdbdbd', p: 1, borderRadius: 1, mt: 2 }}> <Box sx={{ border: '1px solid #bdbdbd', p: 1, borderRadius: 1, mt: 2 }}>
<Typography color="secondary" sx={{ mr: 1 }}><EnvironmentOutlined />{' '}{tenantinfo.locationaddress || ''} <Typography color="secondary" sx={{ mr: 1 }}><EnvironmentOutlined />{' '}
{/* {tenantinfo.locationaddress || ''} */}
{tenantinfo.address || ''}
</Typography> </Typography>
</Box> </Box>
</Grid> </Grid>
{/* <Grid item xs={12} >
<IconButton sx={{p:1,fontSize:'30px',border:'1px solid grey'}}>
<SwapVertIcon
fontSize='18px'
/>
</IconButton>
</Grid> */}
<Grid item xs={12} sx={{ height: '100%' }} > <Grid item xs={12} sx={{ height: '100%',mt:5 }} >
<FormLabel>Drop Location</FormLabel> <FormLabel>Drop Location</FormLabel>
<Autocomplete <Autocomplete
@@ -1257,7 +1290,14 @@ const Createorder1 = () => {
onChange={(e, val) => { onChange={(e, val) => {
if (val) { if (val) {
setClientinfo(val) if(tenantinfo.customerid == val.customerid){
opentoast('choose different Location')
setClientinfo({})
}else{
setClientinfo(val)
}
} else { } else {
setClientinfo({}) setClientinfo({})
} }
@@ -1272,7 +1312,7 @@ const Createorder1 = () => {
<Box sx={{ border: '1px solid #bdbdbd', p: 1, borderRadius: 1, my: 2 }}> <Box sx={{ border: '1px solid #bdbdbd', p: 1, borderRadius: 1, my: 2 }}>
<Typography color="secondary" sx={{ mr: 1 }}><EnvironmentOutlined />{' '}{clientinfo.address || ''} <Typography color="secondary" sx={{ mr: 1 }} ><EnvironmentOutlined />{' '}{clientinfo.address || ''}
</Typography> </Typography>
</Box> </Box>
@@ -1283,11 +1323,13 @@ const Createorder1 = () => {
</MainCard> </MainCard>
</Grid> </Grid>
<Grid item xs={12} sm={6} sx={{ height: '100%' }}> <Grid item xs={12} sm={6}
// sx={{ height: '100%' }}
>
<MainCard <MainCard
sx={{ height: '100%' }} sx={{ height: '100%' }}
> >
<Grid container spacing={2}> <Grid container spacing={2} sx={{ height: '100%' }}>
<Grid item xs={12} > <Grid item xs={12} >
<LocalizationProvider dateAdapter={AdapterDayjs} sx={{ width: '100%' }}> <LocalizationProvider dateAdapter={AdapterDayjs} sx={{ width: '100%' }}>
@@ -1350,7 +1392,17 @@ const Createorder1 = () => {
{/* <p>{selectedtime}</p> */} {/* <p>{selectedtime}</p> */}
<MainCard sx={{ <MainCard sx={{
mt: 1, mt: 1,
// height: { md: '270px', xs: '100%' } height: { md: '150px' },
overflowY: "scroll",
scrollbarWidth: "thin", // Hide scrollbar in Firefox
"&::-webkit-scrollbar": {
width: "3px", // Customize the width of the scrollbar
},
"&::-webkit-scrollbar-thumb": {
backgroundColor: "#65387A", // Customize the scrollbar thumb color
borderRadius: "6px", // Round the scrollbar thumb
},
}}> }}>
<Grid container spacing={2} > <Grid container spacing={2} >
@@ -1413,19 +1465,19 @@ const Createorder1 = () => {
</Stack> </Stack>
</Box> */} </Box> */}
</Grid> </Grid>
<Grid item xs={12}> <Grid item xs={12} >
<Grid item xs={12}> {/* <Grid item xs={12}> */}
<TextField id="outlined-multiline-static" sx={{ width: '100%', height: '100%',mb:2 }} multiline rows={1} placeholder='Notes' <TextField id="outlined-multiline-static" sx={{ width: '100%', height: '100%', mb: 2 }} multiline rows={1} placeholder='Notes'
value={otherinstructions} onChange={(e) => setOtherinstructions(e.target.value)} /> value={otherinstructions} onChange={(e) => setOtherinstructions(e.target.value)} />
</Grid> {/* </Grid> */}
@@ -1435,20 +1487,22 @@ const Createorder1 = () => {
</MainCard> </MainCard>
</Grid> </Grid>
<Grid item xs={12}>
<Stack direction='row' justifyContent='flex-end' sx={{ mt: 2, backgroundColor: '#fff' }} >
<Button variant='contained' onClick={() => {
createsubmitobj1()
}}>Create</Button>
</Stack>
</Grid>
</Grid> </Grid>
</Grid> </Grid>
<Grid item xs={12}>
<Stack direction='row' justifyContent='flex-end' sx={{ mt: 2, backgroundColor: '#fff' }} >
<Button variant='contained' onClick={() => {
createsubmitobj1()
}}>Create</Button>
</Stack>
</Grid>
</Grid > </Grid >

View File

@@ -191,12 +191,12 @@ const Orders = () => {
label: 'S NO', label: 'S NO',
}, },
{ // {
id: 'tenantname', // id: 'tenantname',
numeric: false, // numeric: false,
disablePadding: false, // disablePadding: false,
label: 'CUSTOMER', // label: 'CUSTOMER',
}, // },
{ {
id: 'orderid', id: 'orderid',
numeric: false, numeric: false,
@@ -206,12 +206,12 @@ const Orders = () => {
{ {
id: 'eventname', id: 'eventname',
disablePadding: false, disablePadding: false,
label: 'Pickup Location', label: 'Pickup',
}, },
{ {
id: 'eventname4', id: 'eventname4',
disablePadding: false, disablePadding: false,
label: 'Delivery Location', label: 'Delivery',
}, },
// { // {
// id: 'ordervalue', // id: 'ordervalue',
@@ -603,31 +603,8 @@ const Orders = () => {
</TableCell> </TableCell>
<TableCell align="left" sx={{ paddingLeft: '12px !important' }}>
<Stack direction="row" alignItems="center" spacing={1} justifyContent="flex-start"> <TableCell align='left'>
<Avatar
alt=""
size="sm"
// src={row.profileimage}
sx={{
width: '25px',
height: '25px'
}}
>
</Avatar>
<Stack direction="column">
<Typography variant="caption">{row.customername}</Typography>
<Typography variant="caption" color="textSecondary">
{/* {row.identification}*/}
{row.contactno}
</Typography>
</Stack>
</Stack>
</TableCell>
<TableCell align="left">
<Typography variant='body2' noWrap>{row.orderid}</Typography> <Typography variant='body2' noWrap>{row.orderid}</Typography>
<Typography noWrap <Typography noWrap
sx={{ fontSize: '11px' }}> sx={{ fontSize: '11px' }}>
@@ -640,31 +617,98 @@ const Orders = () => {
{dayjs(row.deliverytime).utc().format('hh:mm A')} {dayjs(row.deliverytime).utc().format('hh:mm A')}
</Typography> </Typography>
</TableCell> </TableCell>
<TableCell align="left">
<Stack direction='column'>
{/* <Typography variant="caption" > {row.eventname}</Typography> */}
<Tooltip title={row.pickupaddress}>
<Typography variant="caption" color="textSecondary"
>
{/* {row.pickupaddress.slice(0, 20)} */}
{row.locationsuburb || row.pickupaddress.slice(0, 20)}
{/* <TableCell align="left" sx={{ paddingLeft: '12px !important' }}>
<Stack direction="row" alignItems="center" spacing={1} justifyContent="flex-start">
<Avatar
alt=""
size="sm"
sx={{
width: '25px',
height: '25px'
}}
>
</Avatar>
<Stack direction="column">
<Typography variant="caption">{row.customername}</Typography>
<Typography variant="caption" color="textSecondary">
{row.contactno}
</Typography> </Typography>
</Tooltip> </Stack>
</Stack> </Stack>
</TableCell> */}
<TableCell align="left">
<Stack direction={'row'} spacing={1}>
<Avatar
alt=""
size="sm"
sx={{
width: '25px',
height: '25px'
}}
>
</Avatar>
<Stack direction="column">
<Typography variant="caption">{row.pickupcustomer}</Typography>
<Typography variant="caption" color="textSecondary">
{row.pickupcontactno}
</Typography>
<Tooltip title={row.pickupaddress}>
<Typography variant="caption" color="textSecondary"
>
{/* {row.pickupaddress.slice(0, 20)} */}
{row.pickupsuburb || row.pickupaddress.slice(0, 20)}
</Typography>
</Tooltip>
</Stack>
</Stack>
{/* <Stack direction='column'>
</Stack> */}
</TableCell> </TableCell>
<TableCell align="left"> <TableCell align="left">
<Stack direction='column'> {/* <Stack direction='column'>
{/* <Typography variant="caption" > {row.eventname}</Typography> */}
<Tooltip title={row.deliveryaddress}> <Tooltip title={row.deliveryaddress}>
<Typography variant="caption" color="textSecondary" <Typography variant="caption" color="textSecondary"
> >
{/* {row.deliveryaddress.slice(0, 20)} */} {row.customersuburb || row.deliveryaddress.slice(0, 20)}
{row.customersuburb || row.deliveryaddress.slice(0, 20)}
</Typography> </Typography>
</Tooltip> </Tooltip>
</Stack> */}
<Stack direction={'row'} spacing={1}>
<Avatar
alt=""
size="sm"
sx={{
width: '25px',
height: '25px'
}}
>
</Avatar>
<Stack direction="column">
<Typography variant="caption">{row.deliverycustomer}</Typography>
<Typography variant="caption" color="textSecondary">
{row.deliverycontactno}
</Typography>
<Tooltip title={row.deliveryaddress}>
<Typography variant="caption" color="textSecondary"
>
{/* {row.pickupaddress.slice(0, 20)} */}
{row.deliverysuburb || row.deliveryaddress.slice(0, 20)}
</Typography>
</Tooltip>
</Stack>
</Stack> </Stack>
</TableCell> </TableCell>
@@ -1399,10 +1443,10 @@ const Orders = () => {
return (val.orderid.toLowerCase().includes(searchword.toLowerCase()) return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.customername.toLowerCase().includes(searchword.toLowerCase()) // || val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase()) || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase()) // || val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1421,8 +1465,8 @@ const Orders = () => {
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase()) || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.customername.toLowerCase().includes(searchword.toLowerCase()) // || val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase()) // || val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1438,10 +1482,10 @@ const Orders = () => {
return (val.orderid.toLowerCase().includes(searchword.toLowerCase()) return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
|| val.eventname.toLowerCase().includes(searchword.toLowerCase()) || val.eventname.toLowerCase().includes(searchword.toLowerCase())
|| val.customername.toLowerCase().includes(searchword.toLowerCase()) // || val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase()) // || val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1459,8 +1503,8 @@ const Orders = () => {
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase()) || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.customername.toLowerCase().includes(searchword.toLowerCase()) // || val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase()) // || val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1478,8 +1522,8 @@ const Orders = () => {
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase()) || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.customername.toLowerCase().includes(searchword.toLowerCase()) // || val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase()) // || val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1497,8 +1541,8 @@ const Orders = () => {
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase()) || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.customername.toLowerCase().includes(searchword.toLowerCase()) // || val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase()) // || val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1516,8 +1560,8 @@ const Orders = () => {
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase()) || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.customername.toLowerCase().includes(searchword.toLowerCase()) // || val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase()) // || val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -1592,8 +1636,8 @@ const Orders = () => {
|| val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase()) || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase()) || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
|| val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase()) || val.deliveryaddress.toLowerCase().includes(searchword.toLowerCase())
|| val.customername.toLowerCase().includes(searchword.toLowerCase()) // || val.customername.toLowerCase().includes(searchword.toLowerCase())
|| val.contactno.toString().toLowerCase().includes(searchword.toLowerCase()) // || val.contactno.toString().toLowerCase().includes(searchword.toLowerCase())
) )
}) })
@@ -2072,44 +2116,44 @@ const Orders = () => {
{/* <Grid item md={8} sx={{ display: { sm: 'none', md: 'block', lg: 'none' } }} /> */} {/* <Grid item md={8} sx={{ display: { sm: 'none', md: 'block', lg: 'none' } }} /> */}
<Grid item xs={12} sx={{mb:-3}}> <Grid item xs={12} sx={{ mb: -3 }}>
<Stack direction={'row'} justifyContent={'space-between'}> <Stack direction={'row'} justifyContent={'space-between'}>
{(startdate && enddate) && {(startdate && enddate) &&
<Stack direction='row' spacing={2}>
<Chip label={`Orders-${datestatus}`} color="primary" variant="light" size="small" />
<Chip label={<Typography noWrap color="secondary">{dayjs(startdate).format('DD/MM/YYYY')} - {dayjs(enddate).format('DD/MM/YYYY')}</Typography>} variant="combined" color='warning' size='small' />
</Stack>
}
{(!startdate || !enddate) &&
<>
<Stack direction='row' spacing={2}> <Stack direction='row' spacing={2}>
<Chip label='Orders-All' color="primary" variant="light" size="small" /> <Chip label={`Orders-${(datestatus)?datestatus:''}`} color="primary" variant="light" size="small" />
<Chip label={<Typography noWrap color="secondary">{dayjs(startdate).format('DD/MM/YYYY')} - {dayjs(enddate).format('DD/MM/YYYY')}</Typography>} variant="combined" color='warning' size='small' />
</Stack> </Stack>
</> }
} {(!startdate || !enddate) &&
<>
<Stack direction='row' spacing={2}>
<Chip label='Orders-All' color="primary" variant="light" size="small" />
</Stack>
</>
}
<Tooltip title='Order Filter'> <Tooltip title='Order Filter'>
<IconButton <IconButton
color="secondary" color="secondary"
variant="light" variant="light"
sx={{ color: 'text.primary', bgcolor: 'grey.200', display: { xs: 'none', md: 'flex' } }} sx={{ color: 'text.primary', bgcolor: 'grey.200', display: { xs: 'none', md: 'flex' } }}
aria-haspopup="true" aria-haspopup="true"
onClick={() => setOpen(true)} > onClick={() => setOpen(true)} >
<FilterList /> <FilterList />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
</Stack> </Stack>
</Grid> </Grid>

View File

@@ -70,11 +70,11 @@ const MainRoutes = {
element: <Accountsettings /> element: <Accountsettings />
}, },
{ {
path: 'orders/create', path: 'orders/create1',
element: <Createorder /> element: <Createorder />
}, },
{ {
path: 'orders/create1', path: 'orders/create',
element: <Createorder1 /> element: <Createorder1 />
}, },
{ {