mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor(FE-326): Remove avgPriceAct/totalAct and use partner totals,
fix badge case
This commit is contained in:
@@ -127,8 +127,6 @@ const SalesReportTable = ({
|
|||||||
avgWeight: 0,
|
avgWeight: 0,
|
||||||
avgPricePartner: 0,
|
avgPricePartner: 0,
|
||||||
totalPartner: 0,
|
totalPartner: 0,
|
||||||
avgPriceAct: 0,
|
|
||||||
totalAct: 0,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,17 +154,12 @@ const SalesReportTable = ({
|
|||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
const avgPriceAct = avgPricePartner;
|
|
||||||
const totalAct = totalPartner;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
totalQuantity,
|
totalQuantity,
|
||||||
totalWeight,
|
totalWeight,
|
||||||
avgWeight,
|
avgWeight,
|
||||||
avgPricePartner,
|
avgPricePartner,
|
||||||
totalPartner,
|
totalPartner,
|
||||||
avgPriceAct,
|
|
||||||
totalAct,
|
|
||||||
};
|
};
|
||||||
}, [salesBroilerData]);
|
}, [salesBroilerData]);
|
||||||
|
|
||||||
@@ -307,12 +300,10 @@ const SalesReportTable = ({
|
|||||||
const getStatusColor = (status: string) => {
|
const getStatusColor = (status: string) => {
|
||||||
if (!status) return 'neutral';
|
if (!status) return 'neutral';
|
||||||
switch (status.toLowerCase()) {
|
switch (status.toLowerCase()) {
|
||||||
case 'lunas':
|
case 'paid':
|
||||||
return 'success';
|
return 'success';
|
||||||
case 'pending':
|
case 'tempo':
|
||||||
return 'warning';
|
return 'warning';
|
||||||
case 'belum lunas':
|
|
||||||
return 'error';
|
|
||||||
default:
|
default:
|
||||||
return 'neutral';
|
return 'neutral';
|
||||||
}
|
}
|
||||||
@@ -399,10 +390,10 @@ const SalesReportTable = ({
|
|||||||
{formatCurrency(totals.totalPartner)}
|
{formatCurrency(totals.totalPartner)}
|
||||||
</td>
|
</td>
|
||||||
<td className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap text-right '>
|
<td className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap text-right '>
|
||||||
{formatCurrency(totals.avgPriceAct)}
|
{formatCurrency(totals.avgPricePartner)}
|
||||||
</td>
|
</td>
|
||||||
<td className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap text-right '>
|
<td className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap text-right '>
|
||||||
{formatCurrency(totals.totalAct)}
|
{formatCurrency(totals.totalPartner)}
|
||||||
</td>
|
</td>
|
||||||
<td className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap '></td>
|
<td className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap '></td>
|
||||||
<td className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap '></td>
|
<td className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap '></td>
|
||||||
|
|||||||
Reference in New Issue
Block a user