feat(FE-327): Include Kandang in sales data and display name

This commit is contained in:
rstubryan
2025-12-05 19:15:38 +07:00
parent 30db7ee95d
commit eaf118845c
2 changed files with 7 additions and 1 deletions
@@ -10,6 +10,7 @@ import { formatCurrency, formatNumber, formatDate } from '@/lib/helper';
import { BaseClosingSales, BaseSales } from '@/types/api/closing/closing';
import { Product } from '@type/api/master-data/product';
import { Customer } from '@type/api/master-data/customer';
import { Kandang } from '@type/api/master-data/kandang';
interface SalesReportTableProps {
type?: 'detail';
@@ -298,7 +299,10 @@ const SalesReportTable = ({
id: 'kandang',
accessorKey: 'kandang',
header: 'Kandang',
cell: (props) => props.getValue() || '-',
cell: (props) => {
const kandang = props.getValue() as Kandang;
return kandang?.name || '-';
},
},
{
id: 'payment_status',
+2
View File
@@ -1,6 +1,7 @@
import { BaseMetadata } from '@/types/api/api-general';
import { Product } from '@type/api/master-data/product';
import { Customer } from '@type/api/master-data/customer';
import { Kandang } from '@type/api/master-data/kandang';
export type BaseSales = {
id: number;
@@ -14,6 +15,7 @@ export type BaseSales = {
avg_weight: number;
price: number;
total_price: number;
kandang: Kandang;
payment_status: string;
};