diff --git a/src/components/pages/report/finance/tab/CustomerPaymentTab.tsx b/src/components/pages/report/finance/tab/CustomerPaymentTab.tsx index 6cd0ba3d..2b2c09a2 100644 --- a/src/components/pages/report/finance/tab/CustomerPaymentTab.tsx +++ b/src/components/pages/report/finance/tab/CustomerPaymentTab.tsx @@ -2,6 +2,7 @@ import { useState, useMemo, useCallback } from 'react'; import useSWR from 'swr'; import { Icon } from '@iconify/react'; import Card from '@/components/Card'; +import Badge from '@/components/Badge'; import SelectInput, { useSelect, OptionType, @@ -67,6 +68,38 @@ const CustomerPaymentTab = () => { [] ); + const getPaymentStatusColor = (notes: string) => { + const normalizedValue = notes.toLowerCase(); + + if (normalizedValue === 'lunas') { + return 'bg-info/10 text-info border-info'; + } + + if (normalizedValue.includes('belum')) { + return 'bg-warning/10 text-warning border-warning'; + } + + return 'bg-gray-100 text-gray-600 border-gray-300'; + }; + + const getPaymentStatusIndicatorColor = (notes: string) => { + const normalizedValue = notes.toLowerCase(); + + if (normalizedValue === 'lunas') { + return 'bg-info'; + } + + if (normalizedValue.includes('belum')) { + return 'bg-warning'; + } + + return 'bg-gray-400'; + }; + + const getPaymentStatusText = (notes: string) => { + return notes; + }; + // ===== FILTER HANDLERS ===== const handleResetFilters = useCallback(() => { setIsSubmitted(false); @@ -435,7 +468,9 @@ const CustomerPaymentTab = () => { accessorKey: 'accounts_receivable', cell: (props) => { const value = props.row.original.accounts_receivable; - return