mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 20:40:55 +00:00
Merge pull request #1444 from Tria-plc/credit-invoice
refactor(container-returns): surface the template download in the header
This commit is contained in:
@@ -2,7 +2,6 @@ import { useEffect, useMemo, useState } from "react";
|
||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import {
|
||||
Alert,
|
||||
Anchor,
|
||||
Autocomplete,
|
||||
Badge,
|
||||
Button,
|
||||
@@ -25,11 +24,7 @@ import { importOperationsService } from "@/services/importOperations.service";
|
||||
import { warehouseService } from "@/services/warehouse.service";
|
||||
import type { CreateEmptyContainerReturnPayload } from "@/types/importOperations";
|
||||
|
||||
import {
|
||||
downloadContainerReturnTemplate,
|
||||
parseContainerReturnExcel,
|
||||
type ParsedReturnRow,
|
||||
} from "./container-return-excel";
|
||||
import { parseContainerReturnExcel, type ParsedReturnRow } from "./container-return-excel";
|
||||
import { useCompanyOptions } from "./useCompanyOptions";
|
||||
|
||||
interface BulkContainerReturnModalProps {
|
||||
@@ -172,10 +167,7 @@ export default function BulkContainerReturnModal({
|
||||
<Stack gap="md">
|
||||
<Text size="sm" c="dimmed">
|
||||
For empties already sitting in the yard but not yet on the system. Values below fill any
|
||||
blank cell in the sheet.{" "}
|
||||
<Anchor size="sm" onClick={() => downloadContainerReturnTemplate()}>
|
||||
Download template
|
||||
</Anchor>
|
||||
blank cell in the sheet.
|
||||
</Text>
|
||||
|
||||
<Group grow align="flex-start">
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
Autocomplete,
|
||||
Input,
|
||||
} from "@mantine/core";
|
||||
import { ChevronDown, ChevronRight, FileText, History, Upload } from "lucide-react";
|
||||
import { ChevronDown, ChevronRight, Download, FileText, History, Upload } from "lucide-react";
|
||||
import { DataTable, type ColumnDef } from "@edr/ui-common";
|
||||
|
||||
import { PageContainer, PageHeader } from "@/components/page";
|
||||
@@ -30,6 +30,7 @@ import RuleEngineListFooter from "@/components/ruleEngine/RuleEngineListFooter";
|
||||
import { extractDownloadErrorMessage } from "@/components/warehouses/options";
|
||||
import { openPdfBlob } from "@/components/warehouses/pdf";
|
||||
import BulkContainerReturnModal from "@/components/warehouses/BulkContainerReturnModal";
|
||||
import { downloadContainerReturnTemplate } from "@/components/warehouses/container-return-excel";
|
||||
import { useCompanyOptions } from "@/components/warehouses/useCompanyOptions";
|
||||
import { OverviewHorizontalBarChart } from "@/components/overview/OverviewHorizontalBarChart";
|
||||
import { OverviewStackedBarChart } from "@/components/overview/OverviewStackedBarChart";
|
||||
@@ -529,6 +530,13 @@ export default function ContainerReturnsPage() {
|
||||
]}
|
||||
/>
|
||||
<Group gap="sm">
|
||||
<Button
|
||||
variant="subtle"
|
||||
leftSection={<Download size={16} />}
|
||||
onClick={() => downloadContainerReturnTemplate()}
|
||||
>
|
||||
Download Template
|
||||
</Button>
|
||||
<Button
|
||||
variant="default"
|
||||
leftSection={<Upload size={16} />}
|
||||
|
||||
Reference in New Issue
Block a user