feat: add total average weight and total sales price in table footer

This commit is contained in:
ValdiANS
2026-01-20 16:35:12 +07:00
parent 6b2f95b9a3
commit 696ec3a69c
@@ -123,6 +123,13 @@ const DailyMarketingsTable = ({
accessorKey: 'average_weight',
header: 'Bobot Rata-Rata (Kg)',
cell: (props) => formatNumber(props.row.original.average_weight_kg),
footer: () => {
const totalAverageWeightKg = isResponseSuccess(dailyMarketings)
? dailyMarketings?.total?.total_average_weight
: 0;
return totalAverageWeightKg ? formatNumber(totalAverageWeightKg) : '-';
},
},
{
accessorKey: 'total_weight',
@@ -140,6 +147,13 @@ const DailyMarketingsTable = ({
accessorKey: 'sales_price',
header: 'Harga Jual (Rp)',
cell: (props) => formatCurrency(props.row.original.sales_price_per_kg),
footer: () => {
const totalSalesPrice = isResponseSuccess(dailyMarketings)
? dailyMarketings?.total?.total_sales_price
: 0;
return totalSalesPrice ? formatNumber(totalSalesPrice) : '-';
},
},
{
accessorKey: 'hpp_price',