mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 15:25:46 +00:00
feat: add total average weight and total sales price in table footer
This commit is contained in:
@@ -123,6 +123,13 @@ const DailyMarketingsTable = ({
|
|||||||
accessorKey: 'average_weight',
|
accessorKey: 'average_weight',
|
||||||
header: 'Bobot Rata-Rata (Kg)',
|
header: 'Bobot Rata-Rata (Kg)',
|
||||||
cell: (props) => formatNumber(props.row.original.average_weight_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',
|
accessorKey: 'total_weight',
|
||||||
@@ -140,6 +147,13 @@ const DailyMarketingsTable = ({
|
|||||||
accessorKey: 'sales_price',
|
accessorKey: 'sales_price',
|
||||||
header: 'Harga Jual (Rp)',
|
header: 'Harga Jual (Rp)',
|
||||||
cell: (props) => formatCurrency(props.row.original.sales_price_per_kg),
|
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',
|
accessorKey: 'hpp_price',
|
||||||
|
|||||||
Reference in New Issue
Block a user