|
@@ -56,6 +56,7 @@ import { fetchPoQrcode } from "@/app/api/pdf/actions"; |
|
|
import { fetchQcResult } from "@/app/api/qc/actions"; |
|
|
import { fetchQcResult } from "@/app/api/qc/actions"; |
|
|
import PoQcStockInModal from "./PoQcStockInModal" |
|
|
import PoQcStockInModal from "./PoQcStockInModal" |
|
|
import DoDisturbIcon from "@mui/icons-material/DoDisturb"; |
|
|
import DoDisturbIcon from "@mui/icons-material/DoDisturb"; |
|
|
|
|
|
import { useSession } from "next-auth/react"; |
|
|
|
|
|
|
|
|
interface ResultWithId { |
|
|
interface ResultWithId { |
|
|
id: number; |
|
|
id: number; |
|
@@ -135,6 +136,8 @@ function PoInputGrid({ |
|
|
return total; |
|
|
return total; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const { data: session } = useSession(); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
const completedList = entries.filter((e) => e.status === "completed"); |
|
|
const completedList = entries.filter((e) => e.status === "completed"); |
|
|
const processedQty = completedList.reduce( |
|
|
const processedQty = completedList.reduce( |
|
@@ -475,7 +478,8 @@ function PoInputGrid({ |
|
|
disabled={ |
|
|
disabled={ |
|
|
stockInLineStatusMap[status] === 9 || |
|
|
stockInLineStatusMap[status] === 9 || |
|
|
stockInLineStatusMap[status] <= 2 || |
|
|
stockInLineStatusMap[status] <= 2 || |
|
|
stockInLineStatusMap[status] >= 7 |
|
|
|
|
|
|
|
|
stockInLineStatusMap[status] >= 7 || |
|
|
|
|
|
(!session?.user?.abilities?.includes("APPROVAL") && stockInLineStatusMap[status] >= 3 && stockInLineStatusMap[status] <= 5) |
|
|
} |
|
|
} |
|
|
// set _isNew to false after posting |
|
|
// set _isNew to false after posting |
|
|
// or check status |
|
|
// or check status |
|
|