updates on the changes arelated toe the order creation and delivery fixes as well
This commit is contained in:
@@ -6,6 +6,7 @@ import { Box, Paper, TextField, Typography } from '@mui/material';
|
||||
import { MdCalendarMonth } from 'react-icons/md';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import { parseDoormileTimestamp } from 'utils/doormileTimestamp';
|
||||
|
||||
import { fetchDeliveries } from 'pages/api/api';
|
||||
import Loader from 'components/Loader';
|
||||
@@ -111,10 +112,12 @@ const Profitability = () => {
|
||||
rider.orders.forEach((o) => {
|
||||
const status = String(o.orderstatus || '').toLowerCase();
|
||||
if (SKIPPED_STATUSES.has(status)) return;
|
||||
// parseDoormileTimestamp (not bare dayjs()) avoids the false-trailing-Z
|
||||
// parse bug (utils/doormileTimestamp.js) — see ProfitabilitySection.js.
|
||||
const dateStr = o.assigntime
|
||||
? dayjs(o.assigntime).format('YYYY-MM-DD')
|
||||
? parseDoormileTimestamp(o.assigntime).format('YYYY-MM-DD')
|
||||
: o.deliverydate
|
||||
? dayjs(o.deliverydate).format('YYYY-MM-DD')
|
||||
? parseDoormileTimestamp(o.deliverydate).format('YYYY-MM-DD')
|
||||
: null;
|
||||
if (dateStr !== selectedDate) return;
|
||||
const km = parseFloat(o.riderkms || 0);
|
||||
|
||||
Reference in New Issue
Block a user