fix many bugs

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-30 19:03:31 +03:00
co-authored by Copilot
parent 0c43c8edd2
commit e1ef6fa2ea
24 changed files with 333 additions and 82 deletions
@@ -13,6 +13,7 @@ import {
UserIcon,
ClipboardListIcon,
} from "lucide-react"
import { getFullName } from "@/shared/utils/getFullName"
type PaymentReceivedItem = {
id: number
@@ -63,24 +64,24 @@ export default function PaymentReceivedPage() {
},
},
{
accessorKey: "customer_name",
accessorKey: "customer",
header: ({ column }) => <ColumnHeader column={column} title="Customer" />,
cell: ({ row }) => {
const item = row.original as unknown as PaymentReceivedItem
const item:any = row.original as unknown as PaymentReceivedItem
return (
<div className="flex items-center gap-2">
<UserIcon className="h-4 w-4 text-muted-foreground" />
<span>{item.customer_name || "—"}</span>
<span>{getFullName(item.customer) || "—"}</span>
</div>
)
},
},
{
accessorKey: "job_card_name",
accessorKey: "job_card",
header: ({ column }) => <ColumnHeader column={column} title="Job Card" />,
cell: ({ row }) => {
const item = row.original as unknown as PaymentReceivedItem
const label = item.job_card_number || item.job_card_name
const item:any = row.original as unknown as PaymentReceivedItem
const label = item.job_card?.title
return (
<div className="flex items-center gap-2">
<ClipboardListIcon className="h-4 w-4 text-muted-foreground" />
@@ -111,14 +112,14 @@ export default function PaymentReceivedPage() {
},
},
{
accessorKey: "payment_mode_name",
accessorKey: "payment_mode",
header: ({ column }) => <ColumnHeader column={column} title="Payment Mode" />,
cell: ({ row }) => {
const item = row.original as unknown as PaymentReceivedItem
const item:any = row.original as unknown as PaymentReceivedItem
return (
<div className="flex items-center gap-2">
<CreditCardIcon className="h-4 w-4 text-muted-foreground" />
<span className="capitalize">{item.payment_mode_name || "—"}</span>
<span className="capitalize">{item.payment_mode?.title || "—"}</span>
</div>
)
},