import { useState } from "react"; import { Card, CardContent, CardHeader, CardTitle } from "./ui/card"; import { Button } from "./ui/button"; import { Badge } from "./ui/badge"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "./ui/tabs"; import { DollarSign, TrendingUp, TrendingDown, CreditCard, Banknote, PieChart, Calculator, FileText, AlertCircle, CheckCircle, ArrowUpRight, ArrowDownRight, Building2, Calendar } from "lucide-react"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "./ui/table"; import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, LineChart, Line, PieChart as RechartsPieChart, Cell, Pie } from "recharts"; export function AccountingManagement() { const [selectedPeriod, setSelectedPeriod] = useState("month"); // 매출/매입 데이터 const salesPurchaseData = [ { month: "1월", sales: 450, purchase: 280, profit: 170 }, { month: "2월", sales: 520, purchase: 310, profit: 210 }, { month: "3월", sales: 480, purchase: 295, profit: 185 }, { month: "4월", sales: 610, purchase: 350, profit: 260 }, { month: "5월", sales: 580, purchase: 340, profit: 240 }, { month: "6월", sales: 650, purchase: 380, profit: 270 } ]; // 거래처별 미수금 const receivables = [ { company: "삼성전자", amount: 45000000, days: 45, status: "위험" }, { company: "LG전자", amount: 32000000, days: 28, status: "주의" }, { company: "현대자동차", amount: 28000000, days: 15, status: "정상" }, { company: "SK하이닉스", amount: 25000000, days: 52, status: "위험" }, { company: "네이버", amount: 18000000, days: 22, status: "정상" } ]; // 건별 원가 분석 const costAnalysis = [ { orderNo: "ORD-2024-001", product: "방화셔터 3000×3000", salesAmount: 15000000, materialCost: 6500000, laborCost: 3500000, overheadCost: 2000000, totalCost: 12000000, profit: 3000000, profitRate: 20.0 }, { orderNo: "ORD-2024-002", product: "일반셔터 2500×2500", salesAmount: 8500000, materialCost: 3200000, laborCost: 2100000, overheadCost: 1200000, totalCost: 6500000, profit: 2000000, profitRate: 23.5 }, { orderNo: "ORD-2024-003", product: "특수셔터 4000×3500", salesAmount: 22000000, materialCost: 9500000, laborCost: 5200000, overheadCost: 2800000, totalCost: 17500000, profit: 4500000, profitRate: 20.5 } ]; // 원가 구성 비율 const costComposition = [ { name: "자재비", value: 54, color: "#3B82F6" }, { name: "인건비", value: 29, color: "#10B981" }, { name: "경비", value: 17, color: "#F59E0B" } ]; return (
{/* 헤더 */}

회계 관리

매출/매입, 미수금, 원가 분석 및 손익 현황

{/* 주요 지표 */}
당월 매출
6,500만원
전월 대비 +12.1%
당월 매입
3,800만원
전월 대비 +11.8%
당월 순이익
2,700만원
이익률: 41.5%
총 미수금
1,480만원
30일 초과: 700만원
{/* 탭 메뉴 */} 매출/매입 미수금 관리 원가 분석 손익 현황 입출금 {/* 매출/매입 관리 */} 매출/매입 추이
{/* 미수금 관리 */} 거래처별 미수금 현황 거래처 미수금액 경과일수 상태 관리 {receivables.map((item, index) => ( {item.company} {item.amount.toLocaleString()}원 {item.days}일 {item.status} ))}
{/* 원가 분석 */}
원가 구성 비율
`${name} ${(percent * 100).toFixed(0)}%`} outerRadius={80} fill="#8884d8" dataKey="value" > {costComposition.map((entry, index) => ( ))}
{costComposition.map((item, index) => (
{item.name}
{item.value}%
))}
건별 원가 분석
{costAnalysis.slice(0, 3).map((item, index) => (
{item.orderNo}

{item.product}

= 25 ? "bg-green-500 text-white" : item.profitRate >= 20 ? "bg-blue-500 text-white" : "bg-yellow-500 text-white" } > {item.profitRate}%
매출: {(item.salesAmount / 1000000).toFixed(1)}M
원가: {(item.totalCost / 1000000).toFixed(1)}M
이익: {(item.profit / 1000000).toFixed(1)}M
))}
{/* 손익 현황 */} 월별 손익 현황
{/* 입출금 내역 */} 거래처 입출금 내역
입금

삼성전자

2024-10-13 14:30

+25,000,000원

제품 출하대금

출금

포스코

2024-10-13 11:20

-15,000,000원

원자재 구매비

); }