refactor(FE): Highlight negative accounts receivable values

This commit is contained in:
rstubryan
2026-01-14 17:03:40 +07:00
parent 916de1432b
commit efde742518
@@ -470,11 +470,17 @@ const CustomerPaymentTab = () => {
cell: (props) => {
const value = props.row.original.accounts_receivable;
return (
<div className='text-right text-error'>{formatCurrency(value)}</div>
<div className={`text-right ${value < 0 ? 'text-error' : ''}`}>
{formatCurrency(value)}
</div>
);
},
footer: () => (
<div className='text-right font-semibold text-gray-900'>
<div
className={`text-right font-semibold ${
summary.total_accounts_receivable < 0 ? 'text-error' : ''
}`}
>
{formatCurrency(summary.total_accounts_receivable) || '-'}
</div>
),
@@ -782,8 +788,14 @@ const CustomerPaymentTab = () => {
className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap'
colSpan={13}
></td>
<td className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap'>
<div className='text-right text-error'>
<td className='px-4 py-3 text-xs whitespace-nowrap'>
<div
className={`text-right ${
row.original.accounts_receivable < 0
? 'text-error'
: ''
}`}
>
{formatCurrency(row.original.accounts_receivable)}
</div>
</td>