19122023
This commit is contained in:
Submodule nearlexpressbuild updated: 088ac08a24...5d8638cb57
@@ -5,7 +5,7 @@
|
||||
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta name="description" content="Nearle" />
|
||||
<meta name="description" content="Nearle Neighbourhood commerce" />
|
||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||
|
||||
<!--
|
||||
@@ -27,6 +27,11 @@
|
||||
|
||||
<!-- this is to resolve issue in old safari browser in tablet -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/resize-observer-polyfill@1.5.1/dist/ResizeObserver.min.js"></script>
|
||||
<style>
|
||||
.datedialog > div > div > .MuiPaper-root{
|
||||
box-shadow: none !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
||||
@@ -334,8 +334,8 @@ import {
|
||||
fetchtableuncovered(val);
|
||||
fetchtablecovered(val);
|
||||
fetchtablecancelled(val);
|
||||
fetchtableassigned(val);
|
||||
fetchtablepicked(val);
|
||||
// fetchtableassigned(val);
|
||||
// fetchtablepicked(val);
|
||||
fetchtablecreated(val);
|
||||
}
|
||||
}
|
||||
@@ -1176,11 +1176,11 @@ import {
|
||||
|
||||
|
||||
|
||||
const [startdate, setStartdate] = useState(''
|
||||
// dayjs().format('YYYY-MM-DD')
|
||||
const [startdate, setStartdate] = useState(
|
||||
dayjs().format('YYYY-MM-DD')
|
||||
);
|
||||
const [enddate, setEnddate] = useState(''
|
||||
// dayjs().format('YYYY-MM-DD')
|
||||
const [enddate, setEnddate] = useState(
|
||||
dayjs().format('YYYY-MM-DD')
|
||||
);
|
||||
|
||||
const [tenantid, setTenantid] = useState('')
|
||||
@@ -1232,9 +1232,13 @@ import {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [dateselect, setDateselect] = useState('select');
|
||||
|
||||
const [tabstatus1, setTabstatus1] = useState('All');
|
||||
// const [tabstatus1, setTabstatus1] = useState('All');
|
||||
const [tabstatus1, setTabstatus1] = useState('Today');
|
||||
|
||||
|
||||
// const [datestatus, setDatestatus] = useState('All');
|
||||
const [datestatus, setDatestatus] = useState('Today');
|
||||
|
||||
const [datestatus, setDatestatus] = useState('All');
|
||||
const [searchword, setSearchword] = useState('')
|
||||
|
||||
|
||||
@@ -1249,10 +1253,10 @@ import {
|
||||
// if (i === 2) setTabstatus('Modified')
|
||||
if (i === 1) setTabstatus('Pending')
|
||||
|
||||
if (i === 2) setTabstatus('Assigned')
|
||||
if (i === 3) setTabstatus('Picked')
|
||||
if (i === 4) setTabstatus('Delivered')
|
||||
if (i === 5) setTabstatus('Cancelled')
|
||||
// if (i === 2) setTabstatus('Assigned')
|
||||
// if (i === 3) setTabstatus('Picked')
|
||||
if (i === 2) setTabstatus('Delivered')
|
||||
if (i === 3) setTabstatus('Cancelled')
|
||||
|
||||
// if (i === 0) setTabstatus('All orders')
|
||||
// if (i === 1) setTabstatus('Pending')
|
||||
@@ -1283,8 +1287,8 @@ import {
|
||||
fetchtableuncovered(val);
|
||||
fetchtablecovered(val);
|
||||
fetchtablecancelled(val);
|
||||
fetchtableassigned(val);
|
||||
fetchtablepicked(val);
|
||||
// fetchtableassigned(val);
|
||||
// fetchtablepicked(val);
|
||||
fetchtablecreated(val);
|
||||
// fetchtableconfirmed(val);
|
||||
// fetchtablemodified(val);
|
||||
@@ -1308,8 +1312,8 @@ import {
|
||||
fetchtableuncovered(val);
|
||||
fetchtablecovered(val);
|
||||
fetchtablecancelled(val);
|
||||
fetchtableassigned(val);
|
||||
fetchtablepicked(val);
|
||||
// fetchtableassigned(val);
|
||||
// fetchtablepicked(val);
|
||||
// fetchtableconfirmed(val);
|
||||
// fetchtablemodified(val);
|
||||
// fetchtableclosed(val)
|
||||
@@ -1369,12 +1373,12 @@ import {
|
||||
setEnddate(new Date().toISOString().substring(0, 10));
|
||||
setDateselect('select');
|
||||
}
|
||||
else if (tabstatus1 === 'All') {
|
||||
setEnddate('');
|
||||
setStartdate('');
|
||||
// else if (tabstatus1 === 'All') {
|
||||
// setEnddate('');
|
||||
// setStartdate('');
|
||||
|
||||
setDateselect('all');
|
||||
}
|
||||
// setDateselect('all');
|
||||
// }
|
||||
}, [tabstatus1]);
|
||||
|
||||
const choosedate = (date) => {
|
||||
@@ -1640,7 +1644,7 @@ import {
|
||||
|
||||
try {
|
||||
// await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=completed`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=delivered`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=delivered&fromdate=${startdate}&todate=${enddate}`)
|
||||
.then((res) => {
|
||||
// if (res.data.message === "Success") {
|
||||
let arr = []
|
||||
@@ -1663,7 +1667,7 @@ import {
|
||||
|
||||
try {
|
||||
// await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=completed`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=created`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=created&fromdate=${startdate}&todate=${enddate}`)
|
||||
.then((res) => {
|
||||
// if (res.data.message === "Success") {
|
||||
let arr = []
|
||||
@@ -1712,7 +1716,7 @@ import {
|
||||
const fetchtableuncovered = async (tid) => {
|
||||
|
||||
try {
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=pending`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=pending&fromdate=${startdate}&todate=${enddate}`)
|
||||
.then((res) => {
|
||||
if (res.data.message === "Success") {
|
||||
let arr = []
|
||||
@@ -1735,7 +1739,7 @@ import {
|
||||
const fetchtablecancelled = async (tid) => {
|
||||
|
||||
try {
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=cancelled`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=cancelled&fromdate=${startdate}&todate=${enddate}`)
|
||||
// await axios.get(`${process.env.REACT_APP_URL2}/client/orders/getordersbystatus?tenantid=${tid}&status=cancelled`)
|
||||
|
||||
.then((res) => {
|
||||
@@ -1761,7 +1765,7 @@ import {
|
||||
const fetchtableassigned = async (tid) => {
|
||||
|
||||
try {
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=accepted`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=accepted&fromdate=${startdate}&todate=${enddate}`)
|
||||
.then((res) => {
|
||||
// if (res.data.message === "Success") {
|
||||
let arr = [];
|
||||
@@ -1785,7 +1789,7 @@ import {
|
||||
const fetchtablepicked = async (tid) => {
|
||||
|
||||
try {
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=picked`)
|
||||
await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=picked&fromdate=${startdate}&todate=${enddate}`)
|
||||
.then((res) => {
|
||||
// if (res.data.message === "Success") {
|
||||
let arr = [];
|
||||
@@ -1901,26 +1905,26 @@ import {
|
||||
setCancelled(res.data.details.cancelled.toString())
|
||||
setUncoveredorders(res.data.details.pending.toString())
|
||||
// setActiveorders(res.data.details.assigned.toString());
|
||||
setAssigned(res.data.details.accepted.toString());
|
||||
// setAssigned(res.data.details.accepted.toString());
|
||||
setCreated(res.data.details.created.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())
|
||||
setPercentage3((Math.round((res.data.details.picked / res.data.details.total) * 100) || 0).toString())
|
||||
// setPicked(res.data.details.picked.toString())
|
||||
setPercentage1((Math.round((res.data.details.total / res.data.details.total) * 100) || 0).toString())
|
||||
setPercentage3((Math.round((res.data.details.delivered / res.data.details.total) * 100) || 0).toString())
|
||||
|
||||
setPercentage4((Math.round((res.data.details.delivered / res.data.details.total) * 100) || 0).toString())
|
||||
setPercentage4((Math.round((res.data.details.cancelled / res.data.details.total) * 100) || 0).toString())
|
||||
|
||||
setPercentage2((Math.round((res.data.details.accepted / res.data.details.total) * 100) || 0).toString())
|
||||
setPercentage2((Math.round((res.data.details.pending / res.data.details.total) * 100) || 0).toString())
|
||||
|
||||
|
||||
setLoading(false)
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
setLoading(false)
|
||||
enqueueSnackbar(err.message, {
|
||||
variant: 'error', anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
autoHideDuration: 2000
|
||||
})
|
||||
// enqueueSnackbar(err.message, {
|
||||
// variant: 'error', anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||
// autoHideDuration: 2000
|
||||
// })
|
||||
})
|
||||
|
||||
} catch (err) {
|
||||
@@ -1947,7 +1951,7 @@ import {
|
||||
{(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('MM/DD/YYYY')} - {dayjs(enddate).format('MM/DD/YYYY')}</Typography>} variant="combined" color='warning' 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>
|
||||
@@ -2012,7 +2016,7 @@ import {
|
||||
|
||||
</Box>*/}
|
||||
|
||||
{/* <Tooltip title='Order Filter'>
|
||||
<Tooltip title='Order Filter'>
|
||||
<IconButton
|
||||
|
||||
|
||||
@@ -2031,7 +2035,7 @@ import {
|
||||
onClick={() => setOpen(true)} >
|
||||
<FilterList />
|
||||
</IconButton>
|
||||
</Tooltip> */}
|
||||
</Tooltip>
|
||||
|
||||
</Stack>
|
||||
</Grid>
|
||||
@@ -2050,13 +2054,19 @@ import {
|
||||
|
||||
: modified} percentage={percentage2.toString()} color={theme.palette.secondary[600]} />
|
||||
</Grid> */}
|
||||
<Grid item xs={12} lg={3} sm={6}>
|
||||
<HoverSocialCard primary="All orders" secondary={(allorders === '') ?
|
||||
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
||||
|
||||
: allorders} percentage={percentage1.toString()} color={theme.palette.primary.main} />
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={3} sm={6}>
|
||||
<HoverSocialCard primary="Pending orders" secondary={(uncoveredorders == '') ?
|
||||
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
||||
|
||||
: uncoveredorders} percentage={percentage1.toString()} color={theme.palette.warning.main} />
|
||||
: uncoveredorders} percentage={percentage2.toString()} color={theme.palette.warning.main} />
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={3} sm={6}>
|
||||
{/* <Grid item xs={12} lg={3} sm={6}>
|
||||
<HoverSocialCard primary="Accepted orders" secondary={(assigned === '') ?
|
||||
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
||||
|
||||
@@ -2067,12 +2077,12 @@ import {
|
||||
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
||||
|
||||
: picked} percentage={percentage3.toString()} color={theme.palette.primary.main} />
|
||||
</Grid>
|
||||
</Grid> */}
|
||||
<Grid item xs={12} lg={3} sm={6}>
|
||||
<HoverSocialCard primary="Delivered orders" secondary={(coveredorders === '') ?
|
||||
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
||||
|
||||
: coveredorders} percentage={percentage4.toString()} color={theme.palette.success.main} />
|
||||
: coveredorders} percentage={percentage3.toString()} color={theme.palette.success.main} />
|
||||
</Grid>
|
||||
{/*
|
||||
<Grid item xs={12} lg={3} sm={6}>
|
||||
@@ -2081,12 +2091,13 @@ import {
|
||||
|
||||
: closed} percentage={percentage4.toString()} color={theme.palette.warning.main} />
|
||||
</Grid>
|
||||
*/}
|
||||
<Grid item xs={12} lg={3} sm={6}>
|
||||
<HoverSocialCard primary="Cancelled Orders" secondary={(cancelled === '') ?
|
||||
<Skeleton sx={{ width: '30px' }} animation="wave" />
|
||||
|
||||
: cancelled} percentage={percentage2.toString()} color={theme.palette.secondary[600]} />
|
||||
</Grid> */}
|
||||
: cancelled} percentage={percentage4.toString()} color={theme.palette.secondary[600]} />
|
||||
</Grid>
|
||||
|
||||
|
||||
<Grid item md={8} sx={{ display: { sm: 'none', md: 'block', lg: 'none' } }} />
|
||||
@@ -2113,17 +2124,17 @@ import {
|
||||
icon={<Chip label={allorders} color="primary" variant="light" size="small" />}
|
||||
/> */}
|
||||
<Tab label="Created"
|
||||
icon={<Chip label={created} color="primary" variant="light" size="small" />}
|
||||
icon={<Chip label={orderarrcreated.length} color="primary" variant="light" size="small" />}
|
||||
iconPosition="end"
|
||||
/>
|
||||
<Tab label="Pending"
|
||||
icon={<Chip label={uncoveredorders} color="primary" variant="light" size="small" />}
|
||||
icon={<Chip label={orderarruncovered.length} color="primary" variant="light" size="small" />}
|
||||
iconPosition="end"
|
||||
/>
|
||||
<Tab label="Accepted"
|
||||
{/* <Tab label="Accepted"
|
||||
icon={<Chip label={assigned} color="primary" variant="light" size="small" />}
|
||||
iconPosition="end"
|
||||
/>
|
||||
/> */}
|
||||
{/* <Tab label="Confirmed"
|
||||
icon={<Chip label={confirmed} color="primary" variant="light" size="small" />}
|
||||
iconPosition="end"
|
||||
@@ -2132,13 +2143,13 @@ import {
|
||||
icon={<Chip label={modified} color="primary" variant="light" size="small" />}
|
||||
iconPosition="end"
|
||||
/> */}
|
||||
<Tab label="Picked"
|
||||
{/* <Tab label="Picked"
|
||||
icon={<Chip label={picked} color="primary" variant="light" size="small" />}
|
||||
iconPosition="end"
|
||||
/>
|
||||
/> */}
|
||||
|
||||
<Tab label="Delivered"
|
||||
icon={<Chip label={coveredorders} color="primary" variant="light" size="small" />}
|
||||
icon={<Chip label={orderarrcovered.length} color="primary" variant="light" size="small" />}
|
||||
iconPosition="end"
|
||||
/>
|
||||
|
||||
@@ -2148,7 +2159,7 @@ import {
|
||||
iconPosition="end"
|
||||
/> */}
|
||||
<Tab label="Cancelled"
|
||||
icon={<Chip label={cancelled} color="primary" variant="light" size="small" />}
|
||||
icon={<Chip label={orderarrcancelled.length} color="primary" variant="light" size="small" />}
|
||||
iconPosition="end"
|
||||
/>
|
||||
</Tabs>
|
||||
@@ -2199,7 +2210,7 @@ import {
|
||||
|
||||
</Grid>
|
||||
|
||||
{/* <Dialog open={open} >
|
||||
<Dialog open={open} >
|
||||
<DialogTitle align='left'>
|
||||
<Typography variant='h4'>Select Filter Options</Typography>
|
||||
</DialogTitle>
|
||||
@@ -2273,11 +2284,11 @@ import {
|
||||
startDate: startOfMonth(addMonths(new Date(), -1)),
|
||||
endDate: endOfMonth(addMonths(new Date(), -1)),
|
||||
},
|
||||
{
|
||||
label: 'All',
|
||||
startDate: new Date(),
|
||||
endDate: addDays(new Date(), -1),
|
||||
},
|
||||
// {
|
||||
// label: 'All',
|
||||
// startDate: new Date(),
|
||||
// endDate: addDays(new Date(), -1),
|
||||
// },
|
||||
|
||||
]}
|
||||
|
||||
@@ -2289,7 +2300,7 @@ import {
|
||||
</Stack>
|
||||
|
||||
</Dialog>
|
||||
*/}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user