removed the charges column in the report section
This commit is contained in:
@@ -2694,7 +2694,7 @@ const Dispatch = ({
|
||||
)}
|
||||
</div>
|
||||
|
||||
{(o.actualkms != null || (!isDelivered && o.riderkms != null) || estMeters !== null) && (
|
||||
{(o.actualkms != null || o.riderkms != null || estMeters !== null) && (
|
||||
<div className="pu-distance-row">
|
||||
{o.actualkms != null && o.actualkms !== '' && (
|
||||
<div className="pu-distance-chip">
|
||||
@@ -2703,7 +2703,7 @@ const Dispatch = ({
|
||||
<span className="pu-distance-value">{o.actualkms} km</span>
|
||||
</div>
|
||||
)}
|
||||
{!isDelivered && o.riderkms != null && o.riderkms !== '' && (
|
||||
{o.riderkms != null && o.riderkms !== '' && (
|
||||
<div className="pu-distance-chip">
|
||||
<span className="pu-distance-icon"><MdDirectionsBike /></span>
|
||||
<span className="pu-distance-label">Rider</span>
|
||||
|
||||
@@ -757,7 +757,7 @@ export default function OrdersReport() {
|
||||
</Stack>
|
||||
</TableCell>
|
||||
<TableCell rowSpan={2} align="center">Kms</TableCell>
|
||||
<TableCell rowSpan={2} align="right">Amount</TableCell>
|
||||
<TableCell rowSpan={2} align="center">Actual KMs</TableCell>
|
||||
<TableCell rowSpan={2} align="center">Action</TableCell>
|
||||
</TableRow>
|
||||
<TableRow
|
||||
@@ -903,10 +903,14 @@ export default function OrdersReport() {
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
|
||||
<TableCell align="right">
|
||||
<Tooltip title="Total Charges" placement="top">
|
||||
<TableCell align="center">
|
||||
<Tooltip title="Actual KMs" placement="top">
|
||||
<Box sx={{ display: 'inline-block' }}>
|
||||
<MetricPill value={row.charges} color={BRAND} icon={<MdCurrencyRupee size={11} />} isMoney />
|
||||
<MetricPill
|
||||
value={parseFloat(row.actualkms || 0).toFixed(2)}
|
||||
color={C_KMS}
|
||||
icon={<MdStraighten size={11} />}
|
||||
/>
|
||||
</Box>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
@@ -992,7 +996,6 @@ export default function OrdersReport() {
|
||||
<TableCell align="center">Skipped</TableCell>
|
||||
<TableCell align="center">Delivered</TableCell>
|
||||
<TableCell align="center">Kms</TableCell>
|
||||
<TableCell align="center">Charges</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
@@ -1061,14 +1064,11 @@ export default function OrdersReport() {
|
||||
<TableCell align="center">
|
||||
<MetricPill value={rider?.cumulativekms} color={C_KMS} icon={<MdStraighten size={10} />} />
|
||||
</TableCell>
|
||||
<TableCell align="center">
|
||||
<MetricPill value={rider?.deliveryamt} color={BRAND} icon={<MdCurrencyRupee size={10} />} isMoney />
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))
|
||||
) : (
|
||||
<TableRow>
|
||||
<TableCell colSpan={12} sx={{ py: 3, borderBottom: 'none' }}>
|
||||
<TableCell colSpan={11} sx={{ py: 3, borderBottom: 'none' }}>
|
||||
<Stack alignItems="center" spacing={1}>
|
||||
<Avatar sx={{ width: 40, height: 40, bgcolor: soft('#94a3b8'), color: DT.textMuted }}>
|
||||
<MdLocalShipping size={18} />
|
||||
@@ -1157,11 +1157,7 @@ export default function OrdersReport() {
|
||||
<Typography sx={{ fontWeight: 800, color: C_CANCELLED }}>{totalDeliCancel}</Typography>
|
||||
</TableCell>
|
||||
<TableCell />
|
||||
<TableCell align="right">
|
||||
<Typography sx={{ fontWeight: 800, color: BRAND, fontSize: 14 }}>
|
||||
{formatNumberToRupees(total)}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
<TableCell />
|
||||
<TableCell />
|
||||
</TableRow>
|
||||
)}
|
||||
|
||||
@@ -329,8 +329,7 @@ export default function OrdersDetails() {
|
||||
{ key: 'picked', label: 'Picked', group: 'Lifecycle', defaultVisible: true, minWidth: 90 },
|
||||
{ key: 'delivered', label: 'Delivered', group: 'Lifecycle', defaultVisible: true, minWidth: 90 },
|
||||
{ key: 'cancelled', label: 'Cancelled', group: 'Lifecycle', defaultVisible: false, minWidth: 90 },
|
||||
{ key: 'kms', label: 'Kms', group: 'Metrics', defaultVisible: true, width: 70, align: 'center' },
|
||||
{ key: 'charges', label: 'Charges', group: 'Metrics', defaultVisible: true, width: 100, align: 'right' }
|
||||
{ key: 'kms', label: 'Kms', group: 'Metrics', defaultVisible: true, width: 70, align: 'center' }
|
||||
];
|
||||
const COLUMN_GROUPS = ['Core', 'Lifecycle', 'Metrics'];
|
||||
const COLUMN_DEFAULTS = ALL_COLUMNS.reduce((acc, c) => ({ ...acc, [c.key]: c.defaultVisible }), {});
|
||||
@@ -1090,7 +1089,6 @@ export default function OrdersDetails() {
|
||||
{isVisible('delivered') && <TableCell sx={{ minWidth: 90 }}>Delivered</TableCell>}
|
||||
{isVisible('cancelled') && <TableCell sx={{ minWidth: 90 }}>Cancelled</TableCell>}
|
||||
{isVisible('kms') && <TableCell align="center" sx={{ width: 70 }}>Kms</TableCell>}
|
||||
{isVisible('charges') && <TableCell align="right" sx={{ width: 100 }}>Charges</TableCell>}
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
|
||||
@@ -1315,21 +1313,6 @@ export default function OrdersDetails() {
|
||||
</TableCell>
|
||||
)}
|
||||
|
||||
{/* Charges */}
|
||||
{isVisible('charges') && (
|
||||
<TableCell align="right">
|
||||
<MetricPill
|
||||
value={
|
||||
row.orderstatus === 'cancelled' || row.deliverycharges === ''
|
||||
? 0
|
||||
: Number(row.deliverycharges)
|
||||
}
|
||||
color={BRAND}
|
||||
icon={<MdCurrencyRupee size={11} />}
|
||||
isMoney
|
||||
/>
|
||||
</TableCell>
|
||||
)}
|
||||
</TableRow>
|
||||
))}
|
||||
|
||||
|
||||
@@ -167,7 +167,6 @@ export default function RidersSummary() {
|
||||
const [enddate, setEnddate] = useState(dayjs().format('YYYY-MM-DD'));
|
||||
const [open, setOpen] = useState(false);
|
||||
const [datestatus, setDatestatus] = useState('Today');
|
||||
const [total, settotal] = useState(0);
|
||||
const [tenantData, setTenantData] = useState([]);
|
||||
const [openRow, setOpenRow] = useState(null);
|
||||
const [searchword, setSearchword] = useState('');
|
||||
@@ -206,15 +205,6 @@ export default function RidersSummary() {
|
||||
queryFn: fetchRidersSummary
|
||||
});
|
||||
|
||||
// ============================================= || calculate totals || =============================================
|
||||
useEffect(() => {
|
||||
if (!rows) return;
|
||||
let calculatedTotal = 0;
|
||||
rows.forEach((row) => {
|
||||
calculatedTotal += Number(row.Deliveryamt || row.deliveryamt || 0);
|
||||
});
|
||||
settotal(calculatedTotal);
|
||||
}, [rows]);
|
||||
|
||||
// ============================================= || fetchTenantSummary (per rider) || =============================================
|
||||
const fetchTenantSummary = async (riderUserid) => {
|
||||
@@ -611,7 +601,6 @@ export default function RidersSummary() {
|
||||
<TableCell align="center" sx={{ color: `${C_DELIVERED} !important` }}>Delivered</TableCell>
|
||||
<TableCell align="center">Kms</TableCell>
|
||||
<TableCell align="center">COD / PLA</TableCell>
|
||||
<TableCell align="right">Charges</TableCell>
|
||||
<TableCell align="center">Action</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
@@ -621,7 +610,7 @@ export default function RidersSummary() {
|
||||
filteredRows.length === 0 &&
|
||||
Array.from({ length: 10 }).map((_, idx) => (
|
||||
<TableRow key={`sk-${idx}`}>
|
||||
{Array.from({ length: 16 }).map((__, ci) => (
|
||||
{Array.from({ length: 15 }).map((__, ci) => (
|
||||
<TableCell key={ci} sx={{ borderBottom: `1px solid ${DT.divider}`, py: 0.625, px: 1 }}>
|
||||
<Skeleton animation="wave" height={20} />
|
||||
</TableCell>
|
||||
@@ -631,7 +620,7 @@ export default function RidersSummary() {
|
||||
|
||||
{!isLoadingReports && filteredRows.length === 0 && (
|
||||
<TableRow>
|
||||
<TableCell colSpan={16} sx={{ py: 7, borderBottom: 'none' }}>
|
||||
<TableCell colSpan={15} sx={{ py: 7, borderBottom: 'none' }}>
|
||||
<Stack alignItems="center" spacing={1.25}>
|
||||
<Avatar
|
||||
variant="rounded"
|
||||
@@ -774,14 +763,6 @@ export default function RidersSummary() {
|
||||
</Stack>
|
||||
</TableCell>
|
||||
|
||||
<TableCell align="right">
|
||||
<Tooltip title="Total Charges" placement="top">
|
||||
<Box sx={{ display: 'inline-block' }}>
|
||||
<MetricPill value={row.deliveryamt} color={BRAND} icon={<MdCurrencyRupee size={11} />} isMoney />
|
||||
</Box>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
|
||||
<TableCell align="center">
|
||||
<Tooltip title={openRow === row.userid ? 'Collapse locations' : 'View locations'}>
|
||||
<IconButton
|
||||
@@ -813,7 +794,7 @@ export default function RidersSummary() {
|
||||
{/* ===================== || Collapsible per-location summary || ===================== */}
|
||||
{openRow === row.userid && (
|
||||
<TableRow>
|
||||
<TableCell colSpan={16} sx={{ p: 0, borderBottom: `1px solid ${DT.divider}`, bgcolor: DT.surfaceAlt }}>
|
||||
<TableCell colSpan={15} sx={{ p: 0, borderBottom: `1px solid ${DT.divider}`, bgcolor: DT.surfaceAlt }}>
|
||||
<Collapse in={openRow === row.userid} timeout="auto" unmountOnExit>
|
||||
<Box sx={{ p: { xs: 1.5, md: 2 } }}>
|
||||
<Stack direction="row" alignItems="center" spacing={1} sx={{ mb: 1.25 }}>
|
||||
@@ -860,7 +841,6 @@ export default function RidersSummary() {
|
||||
<TableCell align="center">Cancelled</TableCell>
|
||||
<TableCell align="center">Kms</TableCell>
|
||||
<TableCell align="center">COD / PLA</TableCell>
|
||||
<TableCell align="right">Amount</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
@@ -921,14 +901,11 @@ export default function RidersSummary() {
|
||||
</Tooltip>
|
||||
</Stack>
|
||||
</TableCell>
|
||||
<TableCell align="right">
|
||||
<MetricPill value={subrow.charges} color={BRAND} icon={<MdCurrencyRupee size={10} />} isMoney />
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))
|
||||
) : (
|
||||
<TableRow>
|
||||
<TableCell colSpan={9} sx={{ py: 3, borderBottom: 'none' }}>
|
||||
<TableCell colSpan={8} sx={{ py: 3, borderBottom: 'none' }}>
|
||||
<Stack alignItems="center" spacing={1}>
|
||||
<Avatar sx={{ width: 40, height: 40, bgcolor: soft('#94a3b8'), color: DT.textMuted }}>
|
||||
<MdPlace size={18} />
|
||||
@@ -954,40 +931,6 @@ export default function RidersSummary() {
|
||||
</Table>
|
||||
</TableContainer>
|
||||
|
||||
<Divider />
|
||||
|
||||
{/* ===================== || Footer total strip || ===================== */}
|
||||
{filteredRows.length > 0 && (
|
||||
<Stack
|
||||
direction={{ xs: 'column', sm: 'row' }}
|
||||
spacing={1.25}
|
||||
alignItems="center"
|
||||
justifyContent="flex-end"
|
||||
sx={{
|
||||
p: { xs: 1.25, md: 1.75 },
|
||||
background: `linear-gradient(135deg, ${tint(BRAND)} 0%, ${tint(BRAND_LIGHT)} 100%)`,
|
||||
borderTop: `1px solid ${edge(BRAND)}`
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
gap: 0.75,
|
||||
px: 1.25,
|
||||
py: 0.5,
|
||||
borderRadius: 999,
|
||||
bgcolor: '#fff',
|
||||
border: `1.5px solid ${edge(BRAND)}`,
|
||||
color: BRAND,
|
||||
fontWeight: 800,
|
||||
fontSize: 13
|
||||
}}
|
||||
>
|
||||
<MdLocalOffer size={13} /> Total Amount · {formatNumberToRupees(total)}
|
||||
</Box>
|
||||
</Stack>
|
||||
)}
|
||||
</Paper>
|
||||
|
||||
{/* ============================================= || Date Filter Dialog || ============================================= */}
|
||||
|
||||
Reference in New Issue
Block a user