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,
|
||||
avgPricePartner: 0,
|
||||
totalPartner: 0,
|
||||
avgPriceAct: 0,
|
||||
totalAct: 0,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -156,17 +154,12 @@ const SalesReportTable = ({
|
||||
0
|
||||
);
|
||||
|
||||
const avgPriceAct = avgPricePartner;
|
||||
const totalAct = totalPartner;
|
||||
|
||||
return {
|
||||
totalQuantity,
|
||||
totalWeight,
|
||||
avgWeight,
|
||||
avgPricePartner,
|
||||
totalPartner,
|
||||
avgPriceAct,
|
||||
totalAct,
|
||||
};
|
||||
}, [salesBroilerData]);
|
||||
|
||||
@@ -307,12 +300,10 @@ const SalesReportTable = ({
|
||||
const getStatusColor = (status: string) => {
|
||||
if (!status) return 'neutral';
|
||||
switch (status.toLowerCase()) {
|
||||
case 'lunas':
|
||||
case 'paid':
|
||||
return 'success';
|
||||
case 'pending':
|
||||
case 'tempo':
|
||||
return 'warning';
|
||||
case 'belum lunas':
|
||||
return 'error';
|
||||
default:
|
||||
return 'neutral';
|
||||
}
|
||||
@@ -399,10 +390,10 @@ const SalesReportTable = ({
|
||||
{formatCurrency(totals.totalPartner)}
|
||||
</td>
|
||||
<td className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap text-right '>
|
||||
{formatCurrency(totals.avgPriceAct)}
|
||||
{formatCurrency(totals.avgPricePartner)}
|
||||
</td>
|
||||
<td className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap text-right '>
|
||||
{formatCurrency(totals.totalAct)}
|
||||
{formatCurrency(totals.totalPartner)}
|
||||
</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