diff --git a/src/components/pages/inventory/adjustment/InventoryAdjustmentTable.tsx b/src/components/pages/inventory/adjustment/InventoryAdjustmentTable.tsx index 38c9e76a..67b5daac 100644 --- a/src/components/pages/inventory/adjustment/InventoryAdjustmentTable.tsx +++ b/src/components/pages/inventory/adjustment/InventoryAdjustmentTable.tsx @@ -49,16 +49,19 @@ const InventoryAdjustmentTable = () => { const inventoryAdjustmentsColumns: ColumnDef[] = useMemo( () => [ { - header: 'No', - cell: (props) => - tableFilterState.pageSize * (tableFilterState.page - 1) + - props.row.index + - 1, + id: 'adj_number', + header: 'No. Referensi', + accessorFn: (row) => row.adj_number ?? '-', }, { - id: 'product_name', - header: 'Nama Produk', - accessorFn: (row) => row.product_warehouse?.product?.name ?? '-', + id: 'location', + header: 'Lokasi', + accessorFn: (row) => row.location?.name ?? '-', + }, + { + id: 'project_flock', + header: 'Flock', + accessorFn: (row) => row.project_flock?.flock_name ?? '-', }, { id: 'warehouse_name', @@ -66,25 +69,35 @@ const InventoryAdjustmentTable = () => { accessorFn: (row) => row.product_warehouse?.warehouse?.name ?? '-', }, { - id: 'created_at', - header: 'Tanggal', - accessorFn: (row) => - row.created_at ? formatDate(row.created_at, 'DD MMM YYYY') : '-', + id: 'product_name', + header: 'Nama Produk', + accessorFn: (row) => row.product_warehouse?.product?.name ?? '-', }, { id: 'quantity', header: 'Kuantitas', - cell: (props) => { - const value = - props.row.original.increase + props.row.original.decrease; + accessorFn: (row) => row.qty ?? '-', + cell: (row) => { + const value = row.row.original.increase + row.row.original.decrease; return
{formatNumber(value)}
; }, }, + { + id: 'price', + header: 'Harga', + accessorFn: (row) => row.price ?? '-', + }, + { + id: 'grand_total', + header: 'Total', + accessorFn: (row) => row.grand_total ?? '-', + }, { id: 'transaction_type', header: 'Tipe Transaksi', - cell: (props) => { - const type = props.row.original.increase; + accessorFn: (row) => row.transaction_type ?? '-', + cell: (row) => { + const type = row.row.original.increase; const label = type > 0 ? 'Peningkatan' : type <= 0 ? 'Penurunan' : '-'; @@ -99,6 +112,12 @@ const InventoryAdjustmentTable = () => { ); }, }, + { + id: 'created_at', + header: 'Tanggal', + accessorFn: (row) => + row.created_at ? formatDate(row.created_at, 'DD MMM YYYY') : '-', + }, { id: 'created_by', header: 'Oleh',