customers

This commit is contained in:
joshikannan
2024-04-09 13:08:33 +05:30
parent b8868122c6
commit 77f5295720
4 changed files with 71 additions and 22 deletions

View File

@@ -329,6 +329,47 @@ export default function ordersDetails() {
row.deliverylocation.toLowerCase().includes(searchword.toLowerCase()) ||
row.ridername.toLowerCase().includes(searchword.toLowerCase())
);
// to download ex format filtered data
const csvData = filteredOrders.map((order) => ({
tenantname: order.tenantname,
tenantcity: order.tenantcity,
tenantcontactno: order.tenantcontactno,
rider: order.rider,
orderid: order.orderid,
orderdate: order.orderdate,
deliverydate: order.deliverydate,
orderstatus: order.orderstatus,
deliverystatus: order.deliverystatus,
ordernotes: order.ordernotes,
kms: order.kms,
actualkms: order.actualkms,
assigntime: order.assigntime,
starttime: order.starttime,
arrivaltime: order.arrivaltime,
pickuptime: order.pickuptime,
deliverytime: order.deliverytime,
canceltime: order.canceltime,
deliverycharge: order.deliverycharge,
deliveryamt: order.deliveryamt,
pickupcustomer: order.pickupcustomer,
pickupcontactno: order.pickupcontactno,
pickupaddress: order.pickupaddress,
pickupsuburb: order.pickupsuburb,
pickupcity: order.pickupcity,
pickuplat: order.pickuplat,
pickuplong: order.pickuplong,
deliverycustomer: order.deliverycustomer,
deliverycontactno: order.deliverycontactno,
deliveryaddress: order.deliveryaddress,
deliverysuburb: order.deliverysuburb,
deliverylat: order.deliverylat,
deliverylong: order.deliverylong,
locationname: order.locationname,
locationsuburb: order.locationsuburb,
locationcity: order.locationcity,
locationcontactno: order.locationcontactno
}));
const handleSelectAllClick = (event) => {
if (event.target.checked) {
const newSelectedId = rows.map((n) => n.name);
@@ -426,17 +467,16 @@ export default function ordersDetails() {
</Stack>
</Grid>
<Grid item xs={8}>
{' '}
<div
style={{
<Stack
sx={{
display: 'flex',
flexDirection: 'row',
flexDirection: { md: 'row', xs: 'column' },
justifyContent: 'end',
alignItems: 'center',
marginRight: '25px'
}}
>
<FormControl sx={{ width: 250, display: { xs: 'none', md: 'flex' } }}>
<FormControl sx={{ width: 250 }}>
<OutlinedInput
inputRef={textFieldRef}
aria-describedby="header-search-text"
@@ -476,28 +516,22 @@ export default function ordersDetails() {
<Tooltip title="Order Filter">
<IconButton
// size='large'
color="secondary"
variant="light"
sx={{
color: 'text.primary',
bgcolor: 'grey.200',
display: { xs: 'none', md: 'flex' },
ml: 2
mx: 2
}}
// aria-label="open profile"
// ref={anchorRef}
// aria-controls={open ? 'profile-grow' : undefined}
aria-haspopup="true"
// onClick={handleToggle}
onClick={() => setOpen(true)}
>
<FilterList />
</IconButton>
</Tooltip>
</div>
<CSVExport data={csvData} filename={`Orders_Detail_${dayjs().format('YYYY-MM-DD_HHmmss')}.csv`} />
</Stack>
</Grid>
</Grid>
{/* <Box sx={{ bgcolor: "#eeeeee" }}>