diff --git a/src/components/pages/inventory/product/InventoryProductTable.tsx b/src/components/pages/inventory/product/InventoryProductTable.tsx index 20c7859c..3c188d17 100644 --- a/src/components/pages/inventory/product/InventoryProductTable.tsx +++ b/src/components/pages/inventory/product/InventoryProductTable.tsx @@ -9,7 +9,7 @@ import RowDropdownOptions from '@/components/table/RowDropdownOptions'; import RowOptionsMenuWrapper from '@/components/table/RowOptionsMenuWrapper'; import { ROWS_OPTIONS } from '@/config/constant'; import { isResponseSuccess } from '@/lib/api-helper'; -import { cn, formatCurrency } from '@/lib/helper'; +import { cn, formatCurrency, formatNumber } from '@/lib/helper'; import { InventoryProductApi } from '@/services/api/inventory'; import { useTableFilter } from '@/services/hooks/useTableFilter'; import { InventoryProduct } from '@/types/api/inventory/product'; @@ -117,8 +117,8 @@ const InventoryProductTable = () => { header: 'Stok', cell: (props) => { return props.row.original.total_stock - ? formatCurrency(props.row.original.total_stock) - : '-'; + ? formatNumber(props.row.original.total_stock) + : '0'; }, }, { diff --git a/src/components/pages/inventory/product/detail/InventoryProductDetail.tsx b/src/components/pages/inventory/product/detail/InventoryProductDetail.tsx index 8f209c83..ad523929 100644 --- a/src/components/pages/inventory/product/detail/InventoryProductDetail.tsx +++ b/src/components/pages/inventory/product/detail/InventoryProductDetail.tsx @@ -97,7 +97,7 @@ const InventoryProductDetail = ({ {inventoryProduct?.total_stock ? formatNumber(inventoryProduct?.total_stock) - : '-'} + : '0'} diff --git a/src/components/pages/inventory/product/detail/StockLogTable.tsx b/src/components/pages/inventory/product/detail/StockLogTable.tsx index 666a8b57..42f7bc29 100644 --- a/src/components/pages/inventory/product/detail/StockLogTable.tsx +++ b/src/components/pages/inventory/product/detail/StockLogTable.tsx @@ -59,7 +59,7 @@ const StockLogTable = ({ stockLogs }: { stockLogs: StockLog[] }) => { }, { header: 'Oleh', - accessorKey: 'created_by.name', + accessorKey: 'created_user.name', }, ]} className={{ diff --git a/src/components/pages/inventory/product/detail/StockProductWarehouseTable.tsx b/src/components/pages/inventory/product/detail/StockProductWarehouseTable.tsx index 10343d8a..6f48f7cd 100644 --- a/src/components/pages/inventory/product/detail/StockProductWarehouseTable.tsx +++ b/src/components/pages/inventory/product/detail/StockProductWarehouseTable.tsx @@ -31,8 +31,8 @@ const StockProductWarehouseTable = ({ header: 'Lokasi', accessorKey: 'location', cell: (props) => { - return Boolean(props.row.original.location) - ? props.row.original.location + return props.row.original.location != null + ? props.row.original.location.name : '-'; }, }, diff --git a/src/types/api/inventory/product.d.ts b/src/types/api/inventory/product.d.ts index d631d71f..cb8f98a1 100644 --- a/src/types/api/inventory/product.d.ts +++ b/src/types/api/inventory/product.d.ts @@ -3,6 +3,7 @@ import { ProductWarehouse } from '@/types/api/inventory/product-warehouse'; import { ProductCategory } from '@/types/api/master-data/product-category'; import { Supplier } from '@/types/api/master-data/supplier'; import { Uom } from '@/types/api/master-data/uom'; +import { Location } from '@/types/api/master-data/location'; export type BaseInventoryProduct = { id: number; @@ -39,7 +40,8 @@ export type StockLog = { loggable_id: number; notes: string; product_warehouse_id: number; - created_by: CreatedUser; + created_by: number; + created_user: CreatedUser; created_at: string; };