refactor(FE): Format product prices using formatCurrency helper

This commit is contained in:
rstubryan
2026-02-27 15:38:11 +07:00
parent 9bd4a73a90
commit 80a94c48c3
@@ -24,7 +24,7 @@ import RequirePermission from '@/components/helper/RequirePermission';
import { Product } from '@/types/api/master-data/product'; import { Product } from '@/types/api/master-data/product';
import { ProductApi } from '@/services/api/master-data'; import { ProductApi } from '@/services/api/master-data';
import { cn } from '@/lib/helper'; import { cn, formatCurrency } from '@/lib/helper';
import { isResponseError, isResponseSuccess } from '@/lib/api-helper'; import { isResponseError, isResponseSuccess } from '@/lib/api-helper';
import { useTableFilter } from '@/services/hooks/useTableFilter'; import { useTableFilter } from '@/services/hooks/useTableFilter';
import { ROWS_OPTIONS } from '@/config/constant'; import { ROWS_OPTIONS } from '@/config/constant';
@@ -155,13 +155,17 @@ const ProductsTable = () => {
accessorKey: 'product_price', accessorKey: 'product_price',
header: 'Harga Produk', header: 'Harga Produk',
cell: (props) => cell: (props) =>
props.row.original.product_price?.toLocaleString() ?? '-', props.row.original.product_price
? formatCurrency(props.row.original.product_price)
: '-',
}, },
{ {
accessorKey: 'selling_price', accessorKey: 'selling_price',
header: 'Harga Jual', header: 'Harga Jual',
cell: (props) => cell: (props) =>
props.row.original.selling_price?.toLocaleString() ?? '-', props.row.original.selling_price
? formatCurrency(props.row.original.selling_price)
: '-',
}, },
{ {
accessorKey: 'tax', accessorKey: 'tax',