Project structure changes ad new files added in dashboard folders
This commit is contained in:
201
components/dashboard/finance/budget.tsx
Normal file
201
components/dashboard/finance/budget.tsx
Normal file
@@ -0,0 +1,201 @@
|
||||
import {
|
||||
Database,
|
||||
FileText,
|
||||
Activity,
|
||||
AlertTriangle,
|
||||
Plus
|
||||
} from "lucide-react";
|
||||
|
||||
import InfoBanner from "@/components/common/infoBanner";
|
||||
import Button from "@/components/common/button";
|
||||
import StatCard from "@/components/common/dashStatCard";
|
||||
import { Card } from '@/components/common/cardWrapper';
|
||||
import { CardHeader } from '@/components/common/cardHeader';
|
||||
import { approvalQueueData, categoryData } from "@/constants/constant";
|
||||
|
||||
|
||||
|
||||
export default function BudgetPortal() {
|
||||
return (
|
||||
<div className="my-15 text-slate-100 font-sans">
|
||||
{/* --- HEADER SECTION WITH BUTTONS --- */}
|
||||
<div className="flex flex-col md:flex-row md:items-start md:justify-between gap-4 mb-6">
|
||||
<div>
|
||||
<div className="flex items-center gap-2 text-[10px] font-bold tracking-widest text-slate-500 uppercase font-mono">
|
||||
<span className="text-teal-400">Apple One — HQ Tower</span>
|
||||
<span>•</span>
|
||||
<span>FINANCE</span>
|
||||
<span>•</span>
|
||||
<span>O&M BUDGET</span>
|
||||
</div>
|
||||
|
||||
<h1 className="text-2xl font-bold text-white tracking-tight mt-2">
|
||||
O&M budget management
|
||||
</h1>
|
||||
|
||||
<p className="text-sm font-medium text-slate-400 mt-2 max-w-xl leading-relaxed">
|
||||
Multi-dimensional budgets by site, department and asset — planned vs actual, variance, approvals and overrun alerts.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* --- HEADER BUTTONS --- */}
|
||||
<div className="flex items-center gap-2.5 self-start md:mt-6">
|
||||
<Button className="bg-[#0b1727] hover:bg-slate-800/60 text-slate-200 border border-slate-800 text-xs px-4 py-2 rounded-lg font-semibold transition-colors">
|
||||
<span>Export</span>
|
||||
</Button>
|
||||
|
||||
<Button className="bg-teal-400 hover:bg-teal-300 text-slate-950 font-bold text-xs px-4 py-2 rounded-lg flex items-center gap-1.5 transition-colors">
|
||||
<Plus className="w-4 h-4 stroke-[3]" />
|
||||
<span>New budget</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* --- STAT CARDS --- */}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
|
||||
{/* Annual budget */}
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Annual budget"
|
||||
value="₹1.91 Cr"
|
||||
icon={Database}
|
||||
badgeText="FY 2026"
|
||||
badgeClassName="text-slate-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-blue-950/40 border-blue-800/30 text-blue-400"
|
||||
/>
|
||||
|
||||
{/* Spent YTD */}
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Spent YTD"
|
||||
value="₹1.42 Cr"
|
||||
icon={FileText}
|
||||
badgeText="74% used"
|
||||
badgeClassName="text-emerald-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-emerald-950/40 border-emerald-800/30 text-emerald-400"
|
||||
/>
|
||||
|
||||
{/* Remaining */}
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Remaining"
|
||||
value="₹49.0 L"
|
||||
icon={Activity}
|
||||
badgeText="26% left"
|
||||
badgeClassName="text-slate-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-amber-950/40 border-amber-800/30 text-amber-400"
|
||||
/>
|
||||
|
||||
{/* Overrun lines */}
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Overrun lines"
|
||||
value="1"
|
||||
icon={AlertTriangle}
|
||||
badgeText="review"
|
||||
badgeClassName="text-rose-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-rose-950/40 border-rose-900/30 text-rose-400"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* --- BUDGET DETAILS & APPROVAL QUEUE SECTION --- */}
|
||||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8">
|
||||
{/* Planned vs Actual Table (Left 2 Columns) */}
|
||||
<Card className="lg:col-span-2 justify-start">
|
||||
<CardHeader
|
||||
title="Planned vs actual · by category"
|
||||
subtitle="CAPEX ₹35.0 L • OPEX ₹1.56 Cr"
|
||||
/>
|
||||
|
||||
<div className="overflow-x-auto mt-2">
|
||||
<table className="w-full text-left border-collapse">
|
||||
<thead>
|
||||
<tr className="border-b border-[#162942]/60 text-[11px] font-mono font-bold text-slate-500 uppercase tracking-wider">
|
||||
<th className="py-2.5 px-2">Category</th>
|
||||
<th className="py-2.5 px-2">Type</th>
|
||||
<th className="py-2.5 px-2 font-mono">Planned</th>
|
||||
<th className="py-2.5 px-2 font-mono">Actual</th>
|
||||
<th className="py-2.5 px-2 font-mono">Variance</th>
|
||||
<th className="py-2.5 px-2 font-mono min-w-[120px]">Utilization</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y divide-[#162942]/40 text-xs">
|
||||
{categoryData.map((row, idx) => (
|
||||
<tr key={idx} className="hover:bg-slate-900/30 transition-colors">
|
||||
<td className="py-3 px-2 font-semibold text-slate-100">
|
||||
{row.category}
|
||||
</td>
|
||||
<td className="py-3 px-2">
|
||||
<span className="bg-[#12233a] border border-[#1d3554] text-slate-300 font-mono text-[10px] px-2 py-0.5 rounded">
|
||||
{row.type}
|
||||
</span>
|
||||
</td>
|
||||
<td className="py-3 px-2 font-mono text-slate-300">
|
||||
{row.planned}
|
||||
</td>
|
||||
<td className="py-3 px-2 font-mono text-slate-300">
|
||||
{row.actual}
|
||||
</td>
|
||||
<td className={`py-3 px-2 font-mono font-semibold ${row.varianceColor}`}>
|
||||
{row.variance}
|
||||
</td>
|
||||
<td className="py-3 px-2">
|
||||
<div className="w-full bg-[#12233a] h-1.5 rounded-full overflow-hidden mb-1">
|
||||
<div
|
||||
className={`h-full ${row.barColor}`}
|
||||
style={{ width: `${Math.min(row.utilization, 100)}%` }}
|
||||
/>
|
||||
</div>
|
||||
<span className="text-[10px] font-mono text-slate-400">
|
||||
{row.utilization}%
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
{/* Approval Queue Panel (Right 1 Column) */}
|
||||
<Card className="justify-start">
|
||||
<CardHeader title="Approval queue" subtitle="multi-level" />
|
||||
|
||||
<div className="divide-y divide-[#162942]/60 mt-1">
|
||||
{approvalQueueData.map((item) => (
|
||||
<div key={item.id} className="py-3.5 flex items-center justify-between gap-3">
|
||||
<div>
|
||||
<h4 className="text-xs font-semibold text-white leading-snug">
|
||||
{item.title}
|
||||
</h4>
|
||||
<p className="text-[11px] font-mono text-slate-500 mt-1">
|
||||
{item.id} · {item.meta}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{item.status === "pending" ? (
|
||||
<button className="bg-[#12233a] hover:bg-[#1a3252] border border-[#1d3554] text-slate-200 text-xs font-semibold px-3 py-1 rounded transition-colors whitespace-nowrap">
|
||||
Approve
|
||||
</button>
|
||||
) : (
|
||||
<span className="flex items-center gap-1.5 bg-emerald-950/40 border border-emerald-800/30 text-emerald-400 text-[10px] font-mono font-bold px-2.5 py-1 rounded-full whitespace-nowrap">
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-emerald-400" />
|
||||
COMPLETED
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
{/* Info Banner */}
|
||||
<div className="my-8">
|
||||
<InfoBanner
|
||||
boldText="Utilization %"
|
||||
normalText=" per category = Actual ÷ Planned × 100 (the bar turns amber past 90%, red on overrun); categories & types are configured in Master Data → Finance. Integration: budget lines link to work orders, purchase orders and vendor invoices — actuals post back automatically and overruns raise an alert to the approver."
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
298
components/dashboard/finance/costInvoice.tsx
Normal file
298
components/dashboard/finance/costInvoice.tsx
Normal file
@@ -0,0 +1,298 @@
|
||||
import {
|
||||
FileText,
|
||||
Database,
|
||||
AlertTriangle,
|
||||
Activity,
|
||||
Sparkles,
|
||||
Plus
|
||||
} from "lucide-react";
|
||||
|
||||
import InfoBanner from "@/components/common/infoBanner";
|
||||
import Button from "@/components/common/button";
|
||||
import StatCard from "@/components/common/dashStatCard";
|
||||
import Table from "@/components/common/dataTable";
|
||||
|
||||
const StatusBadge = ({
|
||||
text,
|
||||
color,
|
||||
}: {
|
||||
text: string;
|
||||
color: string;
|
||||
}) => (
|
||||
<span
|
||||
className={`inline-flex items-center gap-1 rounded-full px-3 py-1 text-[10px] font-semibold uppercase tracking-wider whitespace-nowrap ${color}`}
|
||||
>
|
||||
<span className="h-1.5 w-1.5 rounded-full bg-current" />
|
||||
{text}
|
||||
</span>
|
||||
);
|
||||
|
||||
const ActionButton = ({ text }: { text: string }) => (
|
||||
<Button className="rounded-lg border border-slate-700/60 bg-[#16243a] px-3 py-1.5 text-sm font-semibold text-slate-300 hover:bg-slate-700 transition">
|
||||
{text}
|
||||
</Button>
|
||||
);
|
||||
|
||||
const headers = [
|
||||
"Invoice",
|
||||
"Client",
|
||||
"Period",
|
||||
"Amount",
|
||||
"Raised",
|
||||
"Due",
|
||||
"Status",
|
||||
"",
|
||||
];
|
||||
|
||||
const rows = [
|
||||
[
|
||||
<span className="font-semibold text-[#2EE6C5]">INV-9040</span>,
|
||||
<span className="font-semibold text-slate-100">Apple One Corp</span>,
|
||||
"Jun 2026",
|
||||
<span className="font-semibold">₹12.4 L</span>,
|
||||
<span className="font-mono">Jun 5, 2026</span>,
|
||||
<span className="font-mono">Jul 5, 2026</span>,
|
||||
<StatusBadge
|
||||
text="Paid"
|
||||
color="bg-emerald-500/15 text-emerald-400"
|
||||
/>,
|
||||
<span className="text-slate-500">—</span>,
|
||||
],
|
||||
|
||||
[
|
||||
<span className="font-semibold text-[#2EE6C5]">INV-9041</span>,
|
||||
<span className="font-semibold text-slate-100">Novotel F&B</span>,
|
||||
"Jun 2026",
|
||||
<span className="font-semibold">₹8.6 L</span>,
|
||||
<span className="font-mono">Jun 9, 2026</span>,
|
||||
<span className="font-mono">Jul 9, 2026</span>,
|
||||
<StatusBadge
|
||||
text="Sent"
|
||||
color="bg-amber-500/15 text-amber-400"
|
||||
/>,
|
||||
<ActionButton text="Mark paid" />,
|
||||
],
|
||||
|
||||
[
|
||||
<span className="font-semibold text-[#2EE6C5]">INV-9042</span>,
|
||||
<span className="font-semibold text-slate-100">SRM Estates</span>,
|
||||
"Jun 2026",
|
||||
<span className="font-semibold">₹4.3 L</span>,
|
||||
<span className="font-mono">Jun 13, 2026</span>,
|
||||
<span className="font-mono">Jul 13, 2026</span>,
|
||||
<StatusBadge
|
||||
text="Overdue"
|
||||
color="bg-red-500/15 text-red-400"
|
||||
/>,
|
||||
<ActionButton text="Mark paid" />,
|
||||
],
|
||||
|
||||
[
|
||||
<span className="font-semibold text-[#2EE6C5]">INV-9043</span>,
|
||||
<span className="font-semibold text-slate-100">Local Mart</span>,
|
||||
"Jun 2026",
|
||||
<span className="font-semibold">₹21.0 L</span>,
|
||||
<span className="font-mono">Jun 17, 2026</span>,
|
||||
<span className="font-mono">Jul 17, 2026</span>,
|
||||
<StatusBadge
|
||||
text="Paid"
|
||||
color="bg-emerald-500/15 text-emerald-400"
|
||||
/>,
|
||||
<span className="text-slate-500">—</span>,
|
||||
],
|
||||
|
||||
[
|
||||
<span className="font-semibold text-[#2EE6C5]">INV-9044</span>,
|
||||
<span className="font-semibold text-slate-100">Regus Spaces</span>,
|
||||
"Jun 2026",
|
||||
<span className="font-semibold">₹6.8 L</span>,
|
||||
<span className="font-mono">Jun 21, 2026</span>,
|
||||
<span className="font-mono">Jul 21, 2026</span>,
|
||||
<StatusBadge
|
||||
text="Draft"
|
||||
color="bg-slate-700/60 text-slate-400"
|
||||
/>,
|
||||
<ActionButton text="Send" />,
|
||||
],
|
||||
|
||||
[
|
||||
<span className="font-semibold text-[#2EE6C5]">INV-9105</span>,
|
||||
<span className="font-semibold text-slate-100">Apple One Corp</span>,
|
||||
"Jun 2026",
|
||||
<span className="font-semibold">₹12.4 L</span>,
|
||||
<span className="font-mono">Jun 5, 2026</span>,
|
||||
<span className="font-mono">Jul 5, 2026</span>,
|
||||
<StatusBadge
|
||||
text="Sent"
|
||||
color="bg-amber-500/15 text-amber-400"
|
||||
/>,
|
||||
<ActionButton text="Mark paid" />,
|
||||
],
|
||||
|
||||
[
|
||||
<span className="font-semibold text-[#2EE6C5]">INV-9106</span>,
|
||||
<span className="font-semibold text-slate-100">Novotel F&B</span>,
|
||||
"Jun 2026",
|
||||
<span className="font-semibold">₹8.6 L</span>,
|
||||
<span className="font-mono">Jun 9, 2026</span>,
|
||||
<span className="font-mono">Jul 9, 2026</span>,
|
||||
<StatusBadge
|
||||
text="Draft"
|
||||
color="bg-slate-700/60 text-slate-400"
|
||||
/>,
|
||||
<ActionButton text="Send" />,
|
||||
],
|
||||
|
||||
[
|
||||
<span className="font-semibold text-[#2EE6C5]">INV-9107</span>,
|
||||
<span className="font-semibold text-slate-100">SRM Estates</span>,
|
||||
"Jun 2026",
|
||||
<span className="font-semibold">₹4.3 L</span>,
|
||||
<span className="font-mono">Jun 13, 2026</span>,
|
||||
<span className="font-mono">Jul 13, 2026</span>,
|
||||
<StatusBadge
|
||||
text="Draft"
|
||||
color="bg-slate-700/60 text-slate-400"
|
||||
/>,
|
||||
<ActionButton text="Send" />,
|
||||
],
|
||||
|
||||
[
|
||||
<span className="font-semibold text-[#2EE6C5]">INV-9108</span>,
|
||||
<span className="font-semibold text-slate-100">Local Mart</span>,
|
||||
"Jun 2026",
|
||||
<span className="font-semibold">₹21.0 L</span>,
|
||||
<span className="font-mono">Jun 17, 2026</span>,
|
||||
<span className="font-mono">Jul 17, 2026</span>,
|
||||
<StatusBadge
|
||||
text="Paid"
|
||||
color="bg-emerald-500/15 text-emerald-400"
|
||||
/>,
|
||||
<span className="text-slate-500">—</span>,
|
||||
],
|
||||
[
|
||||
<span className="font-semibold text-[#2EE6C5]">INV-9107</span>,
|
||||
<span className="font-semibold text-slate-100">SRM Estates</span>,
|
||||
"Jun 2026",
|
||||
<span className="font-semibold">₹4.3 L</span>,
|
||||
<span className="font-mono">Jun 13, 2026</span>,
|
||||
<span className="font-mono">Jul 13, 2026</span>,
|
||||
<StatusBadge
|
||||
text="Draft"
|
||||
color="bg-slate-700/60 text-slate-400"
|
||||
/>,
|
||||
<ActionButton text="Send" />,
|
||||
],
|
||||
|
||||
[
|
||||
<span className="font-semibold text-[#2EE6C5]">INV-9108</span>,
|
||||
<span className="font-semibold text-slate-100">Local Mart</span>,
|
||||
"Jun 2026",
|
||||
<span className="font-semibold">₹21.0 L</span>,
|
||||
<span className="font-mono">Jun 17, 2026</span>,
|
||||
<span className="font-mono">Jul 17, 2026</span>,
|
||||
<StatusBadge
|
||||
text="Paid"
|
||||
color="bg-emerald-500/15 text-emerald-400"
|
||||
/>,
|
||||
<span className="text-slate-500">—</span>,
|
||||
],
|
||||
];
|
||||
export default function CostInvoicePortal() {
|
||||
return (
|
||||
<div className="my-15 text-slate-100 font-sans">
|
||||
{/* --- HEADER SECTION WITH BUTTONS --- */}
|
||||
<div className="flex flex-col md:flex-row md:items-start md:justify-between gap-4 mb-6">
|
||||
<div>
|
||||
<div className="flex items-center gap-2 text-[10px] font-bold tracking-widest text-slate-500 uppercase font-mono">
|
||||
<span className="text-teal-400">Apple One — HQ Tower</span>
|
||||
<span>•</span>
|
||||
<span>FINANCE</span>
|
||||
<span>•</span>
|
||||
<span>COSTING & INVOICING</span>
|
||||
</div>
|
||||
|
||||
<h1 className="text-2xl font-bold text-white tracking-tight mt-2">
|
||||
Client costing & auto-invoicing
|
||||
</h1>
|
||||
|
||||
<p className="text-sm font-medium text-slate-400 mt-2 max-w-xl leading-relaxed">
|
||||
Client-wise costing setup, automatic project approval and invoice generation — fully native, no external dependency.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* --- HEADER BUTTONS --- */}
|
||||
<div className="flex items-center gap-2.5 self-start md:mt-6">
|
||||
<Button className="bg-[#0b1727] hover:bg-slate-800/60 text-slate-200 border border-slate-800 text-xs px-3.5 py-2 rounded-lg flex items-center gap-2 font-semibold transition-colors">
|
||||
<Sparkles className="w-4 h-4 text-slate-300" />
|
||||
<span>Costing rules</span>
|
||||
</Button>
|
||||
|
||||
<Button className="bg-teal-400 hover:bg-teal-300 text-slate-950 font-bold text-xs px-4 py-2 rounded-lg flex items-center gap-1.5 transition-colors">
|
||||
<Plus className="w-4 h-4 stroke-[3]" />
|
||||
<span>Generate invoice</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* --- STAT CARDS --- */}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
|
||||
{/* Billed */}
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Billed"
|
||||
value="₹99.4 L"
|
||||
icon={FileText}
|
||||
badgeText="this month"
|
||||
badgeClassName="text-slate-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-blue-950/40 border-blue-800/30 text-blue-400"
|
||||
/>
|
||||
|
||||
{/* Outstanding */}
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Outstanding"
|
||||
value="₹45.0 L"
|
||||
icon={Database}
|
||||
badgeText="receivable"
|
||||
badgeClassName="text-amber-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-amber-950/40 border-amber-800/30 text-amber-400"
|
||||
/>
|
||||
|
||||
{/* Overdue */}
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Overdue"
|
||||
value="₹4.3 L"
|
||||
icon={AlertTriangle}
|
||||
badgeText="follow up"
|
||||
badgeClassName="text-rose-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-rose-950/40 border-rose-900/30 text-rose-400"
|
||||
|
||||
/>
|
||||
|
||||
{/* Collection rate */}
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Collection rate"
|
||||
value="55%"
|
||||
icon={Activity}
|
||||
badgeText="MTD"
|
||||
badgeClassName="text-slate-400 font-mono uppercase"
|
||||
iconContainerClassName="bg-emerald-950/40 border-emerald-800/30 text-emerald-400"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-5">
|
||||
<Table headers={headers} rows={rows}/>
|
||||
</div>
|
||||
{/* Info Banner */}
|
||||
<div className="my-8">
|
||||
<InfoBanner
|
||||
boldText="Auto-invoicing:"
|
||||
normalText=" completed work orders and AMC visits roll up into client costing by contract rate → invoice drafts are generated, approved, and dispatched without manual re-entry."
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user