Merge pull request #1444 from Tria-plc/credit-invoice

refactor(container-returns): surface the template download in the header
This commit is contained in:
Hagernesh Tadesse
2026-08-28 15:37:30 +03:00
committed by GitHub
2 changed files with 11 additions and 11 deletions

View File

@@ -2,7 +2,6 @@ import { useEffect, useMemo, useState } from "react";
import { useMutation, useQuery } from "@tanstack/react-query"; import { useMutation, useQuery } from "@tanstack/react-query";
import { import {
Alert, Alert,
Anchor,
Autocomplete, Autocomplete,
Badge, Badge,
Button, Button,
@@ -25,11 +24,7 @@ import { importOperationsService } from "@/services/importOperations.service";
import { warehouseService } from "@/services/warehouse.service"; import { warehouseService } from "@/services/warehouse.service";
import type { CreateEmptyContainerReturnPayload } from "@/types/importOperations"; import type { CreateEmptyContainerReturnPayload } from "@/types/importOperations";
import { import { parseContainerReturnExcel, type ParsedReturnRow } from "./container-return-excel";
downloadContainerReturnTemplate,
parseContainerReturnExcel,
type ParsedReturnRow,
} from "./container-return-excel";
import { useCompanyOptions } from "./useCompanyOptions"; import { useCompanyOptions } from "./useCompanyOptions";
interface BulkContainerReturnModalProps { interface BulkContainerReturnModalProps {
@@ -172,10 +167,7 @@ export default function BulkContainerReturnModal({
<Stack gap="md"> <Stack gap="md">
<Text size="sm" c="dimmed"> <Text size="sm" c="dimmed">
For empties already sitting in the yard but not yet on the system. Values below fill any For empties already sitting in the yard but not yet on the system. Values below fill any
blank cell in the sheet.{" "} blank cell in the sheet.
<Anchor size="sm" onClick={() => downloadContainerReturnTemplate()}>
Download template
</Anchor>
</Text> </Text>
<Group grow align="flex-start"> <Group grow align="flex-start">

View File

@@ -21,7 +21,7 @@ import {
Autocomplete, Autocomplete,
Input, Input,
} from "@mantine/core"; } 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 { DataTable, type ColumnDef } from "@edr/ui-common";
import { PageContainer, PageHeader } from "@/components/page"; import { PageContainer, PageHeader } from "@/components/page";
@@ -30,6 +30,7 @@ import RuleEngineListFooter from "@/components/ruleEngine/RuleEngineListFooter";
import { extractDownloadErrorMessage } from "@/components/warehouses/options"; import { extractDownloadErrorMessage } from "@/components/warehouses/options";
import { openPdfBlob } from "@/components/warehouses/pdf"; import { openPdfBlob } from "@/components/warehouses/pdf";
import BulkContainerReturnModal from "@/components/warehouses/BulkContainerReturnModal"; import BulkContainerReturnModal from "@/components/warehouses/BulkContainerReturnModal";
import { downloadContainerReturnTemplate } from "@/components/warehouses/container-return-excel";
import { useCompanyOptions } from "@/components/warehouses/useCompanyOptions"; import { useCompanyOptions } from "@/components/warehouses/useCompanyOptions";
import { OverviewHorizontalBarChart } from "@/components/overview/OverviewHorizontalBarChart"; import { OverviewHorizontalBarChart } from "@/components/overview/OverviewHorizontalBarChart";
import { OverviewStackedBarChart } from "@/components/overview/OverviewStackedBarChart"; import { OverviewStackedBarChart } from "@/components/overview/OverviewStackedBarChart";
@@ -529,6 +530,13 @@ export default function ContainerReturnsPage() {
]} ]}
/> />
<Group gap="sm"> <Group gap="sm">
<Button
variant="subtle"
leftSection={<Download size={16} />}
onClick={() => downloadContainerReturnTemplate()}
>
Download Template
</Button>
<Button <Button
variant="default" variant="default"
leftSection={<Upload size={16} />} leftSection={<Upload size={16} />}