refactor(FE): Enable sales tab and fetch sales data

This commit is contained in:
rstubryan
2026-01-12 14:30:34 +07:00
parent def2167803
commit 90eef08f9b
3 changed files with 34 additions and 34 deletions
@@ -52,11 +52,11 @@ const ClosingDetail: React.FC<ClosingDetailProps> = ({
/>
),
},
// {
// id: 'penjualan',
// label: 'Penjualan',
// content: <SalesReportTable initialValues={salesData} />,
// },
{
id: 'penjualan',
label: 'Penjualan',
content: <SalesReportTable initialValues={salesData} />,
},
{
id: 'overhead',
label: 'Overhead',
@@ -215,31 +215,31 @@ const SalesReportTable = ({
return kandang?.name || '-';
},
},
{
id: 'payment_status',
accessorKey: 'payment_status',
header: 'Status Pembayaran',
cell: (props) => {
const status = props.getValue() as string;
const getStatusColor = (status: string) => {
if (!status) return 'neutral';
switch (status.toLowerCase()) {
case 'paid':
return 'success';
case 'tempo':
return 'warning';
default:
return 'neutral';
}
};
// {
// id: 'payment_status',
// accessorKey: 'payment_status',
// header: 'Status Pembayaran',
// cell: (props) => {
// const status = props.getValue() as string;
// const getStatusColor = (status: string) => {
// if (!status) return 'neutral';
// switch (status.toLowerCase()) {
// case 'paid':
// return 'success';
// case 'tempo':
// return 'warning';
// default:
// return 'neutral';
// }
// };
return (
<Badge variant='soft' size='sm' color={getStatusColor(status)}>
{status || '-'}
</Badge>
);
},
},
// return (
// <Badge variant='soft' size='sm' color={getStatusColor(status)}>
// {status || '-'}
// </Badge>
// );
// },
// },
],
[]
);