feat: report inventory

This commit is contained in:
efrilm
2025-08-14 03:17:17 +07:00
parent e2f18ac9bb
commit 16ad569297
4 changed files with 428 additions and 8 deletions
@@ -41,6 +41,10 @@ import { useInventoriesMutation } from '../../../../../services/mutations/invent
import { useInventories } from '../../../../../services/queries/inventories'
import { Inventory } from '../../../../../types/services/inventory'
import AddStockDrawer from './AddStockDrawer'
import Link from 'next/link'
import { getLocalizedUrl } from '@/utils/i18n'
import { Locale } from '@/configs/i18n'
import { useParams } from 'next/navigation'
declare module '@tanstack/table-core' {
interface FilterFns {
@@ -109,6 +113,9 @@ const StockListTable = () => {
const [addInventoryOpen, setAddInventoryOpen] = useState(false)
const [search, setSearch] = useState('')
// Hooks
const { lang: locale } = useParams()
// Fetch products with pagination and search
const { data, isLoading, error, isFetching } = useInventories({
page: currentPage,
@@ -259,14 +266,16 @@ const StockListTable = () => {
<MenuItem value='25'>25</MenuItem>
<MenuItem value='50'>50</MenuItem>
</CustomTextField>
<Button
color='secondary'
variant='tonal'
className='max-sm:is-full is-auto'
startIcon={<i className='tabler-upload' />}
>
Export
</Button>
<Link href={getLocalizedUrl(`/apps/inventory/stock/export`, locale as Locale)}>
<Button
color='secondary'
variant='tonal'
className='max-sm:is-full is-auto'
startIcon={<i className='tabler-upload' />}
>
Export
</Button>
</Link>
<Button
variant='contained'
className='max-sm:is-full'