mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 23:00:57 +00:00
Merge pull request #334 from Tria-plc/freight/feature/last_mile_invoice
Freight/feature/last mile invoice
This commit is contained in:
@@ -314,6 +314,7 @@ const FirstMilePage = () => {
|
||||
|
||||
const [search, setSearch] = useState("");
|
||||
const [statusFilter, setStatusFilter] = useState<StatusFilter>("ALL");
|
||||
const [filterPostPaymentPending, setFilterPostPaymentPending] = useState(false);
|
||||
const [rowSelection, setRowSelection] = useState<Record<string, boolean>>({});
|
||||
|
||||
const [assignOpen, setAssignOpen] = useState(false);
|
||||
@@ -529,6 +530,7 @@ const FirstMilePage = () => {
|
||||
};
|
||||
|
||||
const matchesFilter = (r: FirstMileRecord) => {
|
||||
if (filterPostPaymentPending && r.isPostPaymentCompleted) return false;
|
||||
switch (statusFilter) {
|
||||
case "ALL": return true;
|
||||
case "ASSIGNED": return isAssigned(r);
|
||||
@@ -566,7 +568,7 @@ const FirstMilePage = () => {
|
||||
.includes(term);
|
||||
});
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [records, search, statusFilter]);
|
||||
}, [records, search, statusFilter, filterPostPaymentPending]);
|
||||
|
||||
const pageCount = Math.max(1, Math.ceil(filteredRecords.length / pagination.pageSize));
|
||||
const pagedRecords = useMemo(() => {
|
||||
@@ -887,6 +889,17 @@ const FirstMilePage = () => {
|
||||
</Button>
|
||||
);
|
||||
})}
|
||||
<Button
|
||||
size="xs"
|
||||
variant={filterPostPaymentPending ? "filled" : "default"}
|
||||
styles={{ label: { fontWeight: 500 } }}
|
||||
onClick={() => {
|
||||
setFilterPostPaymentPending(!filterPostPaymentPending);
|
||||
setPagination((p) => ({ ...p, pageIndex: 0 }));
|
||||
}}
|
||||
>
|
||||
Post Payment Pending
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Box>
|
||||
|
||||
@@ -298,6 +298,7 @@ const LastMilePage = () => {
|
||||
|
||||
const [search, setSearch] = useState("");
|
||||
const [statusFilter, setStatusFilter] = useState<StatusFilter>("ALL");
|
||||
const [filterPostPaymentPending, setFilterPostPaymentPending] = useState(false);
|
||||
const [rowSelection, setRowSelection] = useState<Record<string, boolean>>({});
|
||||
|
||||
const [assignOpen, setAssignOpen] = useState(false);
|
||||
@@ -508,6 +509,7 @@ const LastMilePage = () => {
|
||||
);
|
||||
|
||||
const matchesFilter = (r: LastMileRecord) => {
|
||||
if (filterPostPaymentPending && r.isPostPaymentCompleted) return false;
|
||||
switch (statusFilter) {
|
||||
case "ALL": return true;
|
||||
case "ASSIGNED": return isAssigned(r);
|
||||
@@ -545,7 +547,7 @@ const LastMilePage = () => {
|
||||
.includes(term);
|
||||
});
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [records, search, statusFilter]);
|
||||
}, [records, search, statusFilter, filterPostPaymentPending]);
|
||||
|
||||
const pageCount = Math.max(1, Math.ceil(filteredRecords.length / pagination.pageSize));
|
||||
const pagedRecords = useMemo(() => {
|
||||
@@ -866,6 +868,17 @@ const LastMilePage = () => {
|
||||
</Button>
|
||||
);
|
||||
})}
|
||||
<Button
|
||||
size="xs"
|
||||
variant={filterPostPaymentPending ? "filled" : "default"}
|
||||
styles={{ label: { fontWeight: 500 } }}
|
||||
onClick={() => {
|
||||
setFilterPostPaymentPending(!filterPostPaymentPending);
|
||||
setPagination((p) => ({ ...p, pageIndex: 0 }));
|
||||
}}
|
||||
>
|
||||
Post Payment Pending
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user