diff --git a/src/app/[lang]/(dashboard)/(private)/apps/report/cash-flow/page.tsx b/src/app/[lang]/(dashboard)/(private)/apps/report/cash-flow/page.tsx new file mode 100644 index 0000000..41d04bf --- /dev/null +++ b/src/app/[lang]/(dashboard)/(private)/apps/report/cash-flow/page.tsx @@ -0,0 +1,22 @@ +import ReportTitle from '@/components/report/ReportTitle' +import ReportCashCard from '@/views/apps/report/cash-flow/ReportCashCard' +import ReportCashFlowContent from '@/views/apps/report/cash-flow/ReportCashFlowContent' +import Grid from '@mui/material/Grid2' + +const CashFlowPage = () => { + return ( + + + + + + + + + + + + ) +} + +export default CashFlowPage diff --git a/src/components/report/ReportItem.tsx b/src/components/report/ReportItem.tsx new file mode 100644 index 0000000..bfa61ec --- /dev/null +++ b/src/components/report/ReportItem.tsx @@ -0,0 +1,101 @@ +import React from 'react' +import { Box, Typography, Paper } from '@mui/material' + +// Types +type ReportItemHeaderProps = { + title: string + date: string +} + +type ReportItemSubheaderProps = { + title: string +} + +type ReportItemProps = { + accountCode: string + accountName: string + amount: number + onClick?: () => void + isSubtitle?: boolean +} + +type ReportItemFooterProps = { + title: string + amount: number + children?: React.ReactNode +} + +// Helper function to format currency +const formatCurrency = (amount: number) => { + return new Intl.NumberFormat('id-ID', { + minimumFractionDigits: 0, + maximumFractionDigits: 0 + }).format(amount) +} + +// ReportItemHeader Component +export const ReportItemHeader: React.FC = ({ title, date }) => { + return ( + + + {title} + + + {date} + + + ) +} + +// ReportItemSubheader Component +export const ReportItemSubheader: React.FC = ({ title }) => { + return ( + + + {title} + + + ) +} + +// ReportItem Component +export const ReportItem: React.FC = ({ + accountCode, + accountName, + amount, + onClick, + isSubtitle = true +}) => { + return ( + + + {accountCode} {accountName} + + + {formatCurrency(amount)} + + + ) +} + +// ReportItemFooter Component +export const ReportItemFooter: React.FC = ({ title, amount, children }) => { + return ( + + + + {title} + + + {formatCurrency(amount)} + + + {children && {children}} + + ) +} diff --git a/src/components/report/ReportTitle.tsx b/src/components/report/ReportTitle.tsx new file mode 100644 index 0000000..534f107 --- /dev/null +++ b/src/components/report/ReportTitle.tsx @@ -0,0 +1,27 @@ +'use client' + +// MUI Imports +import Button from '@mui/material/Button' +import Typography from '@mui/material/Typography' + +interface Props { + title: string +} + +const ReportTitle = ({ title }: Props) => { + return ( + + + + {title} + + + + ) +} + +interface Props { + title: string +} + +export default ReportTitle diff --git a/src/views/apps/report/ReportFinancialList.tsx b/src/views/apps/report/ReportFinancialList.tsx index 1dd7385..0851ed9 100644 --- a/src/views/apps/report/ReportFinancialList.tsx +++ b/src/views/apps/report/ReportFinancialList.tsx @@ -1,20 +1,30 @@ +'use client' + import { Container, Typography } from '@mui/material' import Grid from '@mui/material/Grid2' import ReportCard from './ReportCard' +import { getLocalizedUrl } from '@/utils/i18n' +import { Locale } from '@/configs/i18n' +import { useParams } from 'next/navigation' const ReportFinancialList: React.FC = () => { + const { lang: locale } = useParams() + const financialReports = [ { title: 'Arus Kas', - iconClass: 'tabler-cash' + iconClass: 'tabler-cash', + link: getLocalizedUrl(`/apps/report/cash-flow`, locale as Locale) }, { title: 'Laba Rugi', - iconClass: 'tabler-cash' + iconClass: 'tabler-cash', + link: getLocalizedUrl(`/apps/report/profit-loss`, locale as Locale) }, { title: 'Neraca', - iconClass: 'tabler-cash' + iconClass: 'tabler-cash', + link: getLocalizedUrl(`/apps/report/nerace`, locale as Locale) } ] @@ -27,7 +37,7 @@ const ReportFinancialList: React.FC = () => { {financialReports.map((report, index) => ( - + ))} diff --git a/src/views/apps/report/cash-flow/ReportCashCard.tsx b/src/views/apps/report/cash-flow/ReportCashCard.tsx new file mode 100644 index 0000000..b44195f --- /dev/null +++ b/src/views/apps/report/cash-flow/ReportCashCard.tsx @@ -0,0 +1,62 @@ +// MUI Imports +import Grid from '@mui/material/Grid2' + +// Type Imports +import type { UserDataType } from '@components/card-statistics/HorizontalWithSubtitle' + +// Component Imports +import HorizontalWithSubtitle from '@components/card-statistics/HorizontalWithSubtitle' + +// Vars +const data: UserDataType[] = [ + { + title: 'Quick Ratio', + stats: '2,4', + avatarIcon: 'tabler-gauge', + avatarColor: 'success', + trend: 'positive', + trendNumber: 'Target 0,2', + subtitle: 'Hari Ini' + }, + { + title: 'Current Ratio', + stats: '1,09', + avatarIcon: 'tabler-trending-down', + avatarColor: 'error', + trend: 'negative', + trendNumber: '7,6%', + subtitle: 'vs bulan sebelumnya' + }, + { + title: 'Debt Equity Ratio', + stats: '0', + avatarIcon: 'tabler-trending-up', + avatarColor: 'success', + trend: 'positive', + trendNumber: '0%', + subtitle: 'vs bulan sebelumnya' + }, + { + title: 'Equity Ratio', + stats: '0,65', + avatarIcon: 'tabler-trending-down', + avatarColor: 'error', + trend: 'negative', + trendNumber: '4,4%', + subtitle: 'vs bulan sebelumnya' + } +] + +const ReportCashCard = () => { + return ( + + {data.map((item, i) => ( + + + + ))} + + ) +} + +export default ReportCashCard diff --git a/src/views/apps/report/cash-flow/ReportCashFlowContent.tsx b/src/views/apps/report/cash-flow/ReportCashFlowContent.tsx new file mode 100644 index 0000000..5606849 --- /dev/null +++ b/src/views/apps/report/cash-flow/ReportCashFlowContent.tsx @@ -0,0 +1,113 @@ +'use client' + +import DateRangePicker from '@/components/RangeDatePicker' +import { ReportItem, ReportItemFooter, ReportItemHeader, ReportItemSubheader } from '@/components/report/ReportItem' +import { Button, Card, CardContent, Paper } from '@mui/material' +import { useState } from 'react' + +const ReportCashFlowContent = () => { + const [startDate, setStartDate] = useState(new Date()) + const [endDate, setEndDate] = useState(new Date()) + + return ( + + + + } + className='max-sm:is-full' + > + Ekspor + + + + + + + + {}} /> + {}} /> + {}} /> + {}} /> + + + + + {}} /> + {}} /> + {}} /> + {}} /> + {}} /> + {}} + /> + + + + + {}} /> + {}} /> + + + + + {}} + /> + {}} /> + + + + + + + + + + + + + {}} /> + {}} /> + {}} /> + + + + + + + + + {}} /> + {}} + /> + {}} /> + {}} /> + + + + + + + + ) +} + +export default ReportCashFlowContent