mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-22 22:35:45 +00:00
feat(FE-344,345): Integrate HPP Ekspedisi into Closing detail
This commit is contained in:
@@ -21,25 +21,16 @@ const CostOfRevenueExpeditionReportTable = ({
|
||||
}: CostOfRevenueExpeditionReportTableProps) => {
|
||||
const costOfRevenueExpeditionData: BaseCostOfRevenueExpedition[] =
|
||||
useMemo(() => {
|
||||
return initialValues?.cos_expeditions || [];
|
||||
return initialValues?.expedition_costs || [];
|
||||
}, [initialValues]);
|
||||
|
||||
const totals = useMemo(() => {
|
||||
if (costOfRevenueExpeditionData.length === 0) {
|
||||
return {
|
||||
totalHpp: 0,
|
||||
};
|
||||
}
|
||||
|
||||
const totalHpp = costOfRevenueExpeditionData.reduce(
|
||||
(sum, item) => sum + (item.hpp || 0),
|
||||
0
|
||||
);
|
||||
const totalHpp = initialValues?.total_hpp_amount || 0;
|
||||
|
||||
return {
|
||||
totalHpp,
|
||||
};
|
||||
}, [costOfRevenueExpeditionData]);
|
||||
}, [initialValues]);
|
||||
|
||||
const costOfRevenueExpeditionColumns: ColumnDef<BaseCostOfRevenueExpedition>[] =
|
||||
useMemo(
|
||||
@@ -58,14 +49,14 @@ const CostOfRevenueExpeditionReportTable = ({
|
||||
),
|
||||
},
|
||||
{
|
||||
id: 'expedition_name',
|
||||
accessorKey: 'expedition_name',
|
||||
id: 'expedition_vendor_name',
|
||||
accessorKey: 'expedition_vendor_name',
|
||||
header: 'Nama Ekspedisi',
|
||||
cell: (props) => props.getValue() || '-',
|
||||
},
|
||||
{
|
||||
id: 'hpp',
|
||||
accessorKey: 'hpp',
|
||||
id: 'hpp_amount',
|
||||
accessorKey: 'hpp_amount',
|
||||
header: 'HPP Ekspedisi',
|
||||
cell: (props) => {
|
||||
const value = props.getValue() as number;
|
||||
|
||||
Reference in New Issue
Block a user