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) => { cell: (props) => {
const value = props.row.original.accounts_receivable; const value = props.row.original.accounts_receivable;
return ( return (
<div className='text-right text-error'>{formatCurrency(value)}</div> <div className={`text-right ${value < 0 ? 'text-error' : ''}`}>
{formatCurrency(value)}
</div>
); );
}, },
footer: () => ( 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) || '-'} {formatCurrency(summary.total_accounts_receivable) || '-'}
</div> </div>
), ),
@@ -782,8 +788,14 @@ const CustomerPaymentTab = () => {
className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap' className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap'
colSpan={13} colSpan={13}
></td> ></td>
<td className='px-4 py-3 text-xs text-gray-900 whitespace-nowrap'> <td className='px-4 py-3 text-xs whitespace-nowrap'>
<div className='text-right text-error'> <div
className={`text-right ${
row.original.accounts_receivable < 0
? 'text-error'
: ''
}`}
>
{formatCurrency(row.original.accounts_receivable)} {formatCurrency(row.original.accounts_receivable)}
</div> </div>
</td> </td>