|
|
|
@@ -1,22 +1,29 @@ |
|
|
|
import { Button, Card, CardContent, Stack, Typography } from "@mui/material"; |
|
|
|
import { Button, Card, CardContent, Stack, Typography, Box } from "@mui/material"; |
|
|
|
import { useTranslation } from "react-i18next"; |
|
|
|
import { JoDetailPickLine } from "@/app/api/jo"; |
|
|
|
import { fetchInventories } from "@/app/api/inventory/actions"; |
|
|
|
import { InventoryResult } from "@/app/api/inventory"; |
|
|
|
import { useEffect, useState, useMemo } from "react"; |
|
|
|
import { useFormContext } from "react-hook-form"; |
|
|
|
import { JoDetail } from "@/app/api/jo"; |
|
|
|
|
|
|
|
type Props = { |
|
|
|
onActionClick?: () => void; |
|
|
|
pickLines: JoDetailPickLine[]; |
|
|
|
handleRelease: () => void; |
|
|
|
} |
|
|
|
|
|
|
|
const JoRelease: React.FC<Props> = ({ |
|
|
|
onActionClick, |
|
|
|
pickLines |
|
|
|
pickLines, |
|
|
|
handleRelease |
|
|
|
}) => { |
|
|
|
|
|
|
|
const { t } = useTranslation("jo"); |
|
|
|
const [inventoryData, setInventoryData] = useState<InventoryResult[]>([]); |
|
|
|
|
|
|
|
const { watch } = useFormContext<JoDetail>(); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
const fetchInventoryData = async () => { |
|
|
|
try { |
|
|
|
@@ -86,13 +93,15 @@ const JoRelease: React.FC<Props> = ({ |
|
|
|
<Typography variant="body2" color="text.secondary" sx={{ mt: 1 }}> |
|
|
|
{t("Lines with insufficient stock: ")}<strong style={{ color: 'red' }}>{stockCounts.insufficient}</strong> |
|
|
|
</Typography> |
|
|
|
{/*<Button |
|
|
|
|
|
|
|
<Button |
|
|
|
variant="contained" |
|
|
|
color="primary" |
|
|
|
onClick={onActionClick} |
|
|
|
onClick={handleRelease} |
|
|
|
> |
|
|
|
{t("Release")} |
|
|
|
</Button>*/} |
|
|
|
</Button> |
|
|
|
|
|
|
|
</Stack> |
|
|
|
|
|
|
|
</CardContent> |
|
|
|
|