Compare commits
3 Commits
dfa6b4be75
...
dfa8218017
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dfa8218017 | ||
|
|
849013a08a | ||
|
|
5dc62b8390 |
@ -0,0 +1,86 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import Grid from '@mui/material/Grid2'
|
||||||
|
|
||||||
|
import { TextField, Typography, useTheme } from '@mui/material'
|
||||||
|
import { useState } from 'react'
|
||||||
|
import { formatDateDDMMYYYY, formatForInputDate } from '@/utils/transform'
|
||||||
|
import PurchaseOverviewLeft from '@/views/apps/purchase/overview/overview-left'
|
||||||
|
import PurchaseOverviewRight from '@/views/apps/purchase/overview/overview-right'
|
||||||
|
|
||||||
|
const PurchaseOverviewPage = () => {
|
||||||
|
const theme = useTheme()
|
||||||
|
|
||||||
|
const today = new Date()
|
||||||
|
const monthAgo = new Date()
|
||||||
|
monthAgo.setDate(today.getDate() - 30)
|
||||||
|
|
||||||
|
const [filter, setFilter] = useState({
|
||||||
|
date_from: formatDateDDMMYYYY(monthAgo),
|
||||||
|
date_to: formatDateDDMMYYYY(today)
|
||||||
|
})
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Grid container spacing={6}>
|
||||||
|
<Grid size={{ xs: 12 }}>
|
||||||
|
<div className='flex gap-4 items-center justify-between'>
|
||||||
|
<Typography variant='h1' className='text-3xl font-bold text-gray-900 mb-2'>
|
||||||
|
Overview Pembelian
|
||||||
|
</Typography>
|
||||||
|
<div className='flex items-center gap-4'>
|
||||||
|
<TextField
|
||||||
|
type='date'
|
||||||
|
value={formatForInputDate(today || new Date())}
|
||||||
|
onChange={e => {
|
||||||
|
setFilter({
|
||||||
|
...filter,
|
||||||
|
date_from: formatDateDDMMYYYY(new Date(e.target.value))
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
size='small'
|
||||||
|
sx={{
|
||||||
|
'& .MuiOutlinedInput-root': {
|
||||||
|
'&.Mui-focused fieldset': {
|
||||||
|
borderColor: 'primary.main'
|
||||||
|
},
|
||||||
|
'& fieldset': {
|
||||||
|
borderColor: theme.palette.mode === 'dark' ? 'rgba(231, 227, 252, 0.22)' : theme.palette.divider
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Typography>-</Typography>
|
||||||
|
<TextField
|
||||||
|
type='date'
|
||||||
|
value={today}
|
||||||
|
onChange={e => {}}
|
||||||
|
size='small'
|
||||||
|
sx={{
|
||||||
|
'& .MuiOutlinedInput-root': {
|
||||||
|
'&.Mui-focused fieldset': {
|
||||||
|
borderColor: 'primary.main'
|
||||||
|
},
|
||||||
|
'& fieldset': {
|
||||||
|
borderColor: theme.palette.mode === 'dark' ? 'rgba(231, 227, 252, 0.22)' : theme.palette.divider
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
<Grid container spacing={6} className='mt-5'>
|
||||||
|
<Grid size={{ xs: 12, lg: 8, md: 7 }}>
|
||||||
|
<PurchaseOverviewRight />
|
||||||
|
</Grid>
|
||||||
|
<Grid size={{ xs: 12, lg: 4, md: 5 }}>
|
||||||
|
<PurchaseOverviewLeft />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PurchaseOverviewPage
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
import PurchaseOrderList from '@/views/apps/purchase/purchase-orders/list'
|
||||||
|
|
||||||
|
const PurchaseOrdersPage = () => {
|
||||||
|
return <PurchaseOrderList />
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PurchaseOrdersPage
|
||||||
@ -0,0 +1,86 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import Grid from '@mui/material/Grid2'
|
||||||
|
|
||||||
|
import { TextField, Typography, useTheme } from '@mui/material'
|
||||||
|
import { useState } from 'react'
|
||||||
|
import { formatDateDDMMYYYY, formatForInputDate } from '@/utils/transform'
|
||||||
|
import SalesOverviewRight from '@/views/apps/sales/overview/overview-right'
|
||||||
|
import SalesOverviewLeft from '@/views/apps/sales/overview/overview-left'
|
||||||
|
|
||||||
|
const SalesOverviewPage = () => {
|
||||||
|
const theme = useTheme()
|
||||||
|
|
||||||
|
const today = new Date()
|
||||||
|
const monthAgo = new Date()
|
||||||
|
monthAgo.setDate(today.getDate() - 30)
|
||||||
|
|
||||||
|
const [filter, setFilter] = useState({
|
||||||
|
date_from: formatDateDDMMYYYY(monthAgo),
|
||||||
|
date_to: formatDateDDMMYYYY(today)
|
||||||
|
})
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Grid container spacing={6}>
|
||||||
|
<Grid size={{ xs: 12 }}>
|
||||||
|
<div className='flex gap-4 items-center justify-between'>
|
||||||
|
<Typography variant='h1' className='text-3xl font-bold text-gray-900 mb-2'>
|
||||||
|
Overview Penjualan
|
||||||
|
</Typography>
|
||||||
|
<div className='flex items-center gap-4'>
|
||||||
|
<TextField
|
||||||
|
type='date'
|
||||||
|
value={formatForInputDate(today || new Date())}
|
||||||
|
onChange={e => {
|
||||||
|
setFilter({
|
||||||
|
...filter,
|
||||||
|
date_from: formatDateDDMMYYYY(new Date(e.target.value))
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
size='small'
|
||||||
|
sx={{
|
||||||
|
'& .MuiOutlinedInput-root': {
|
||||||
|
'&.Mui-focused fieldset': {
|
||||||
|
borderColor: 'primary.main'
|
||||||
|
},
|
||||||
|
'& fieldset': {
|
||||||
|
borderColor: theme.palette.mode === 'dark' ? 'rgba(231, 227, 252, 0.22)' : theme.palette.divider
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Typography>-</Typography>
|
||||||
|
<TextField
|
||||||
|
type='date'
|
||||||
|
value={today}
|
||||||
|
onChange={e => {}}
|
||||||
|
size='small'
|
||||||
|
sx={{
|
||||||
|
'& .MuiOutlinedInput-root': {
|
||||||
|
'&.Mui-focused fieldset': {
|
||||||
|
borderColor: 'primary.main'
|
||||||
|
},
|
||||||
|
'& fieldset': {
|
||||||
|
borderColor: theme.palette.mode === 'dark' ? 'rgba(231, 227, 252, 0.22)' : theme.palette.divider
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
<Grid container spacing={6} className='mt-5'>
|
||||||
|
<Grid size={{ xs: 12, lg: 8, md: 7 }}>
|
||||||
|
<SalesOverviewRight />
|
||||||
|
</Grid>
|
||||||
|
<Grid size={{ xs: 12, lg: 4, md: 5 }}>
|
||||||
|
<SalesOverviewLeft />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SalesOverviewPage
|
||||||
@ -91,6 +91,16 @@ const VerticalMenu = ({ dictionary, scrollMenu }: Props) => {
|
|||||||
<MenuItem href={`/${locale}/dashboards/daily-report`}>{dictionary['navigation'].dailyReport}</MenuItem>
|
<MenuItem href={`/${locale}/dashboards/daily-report`}>{dictionary['navigation'].dailyReport}</MenuItem>
|
||||||
</SubMenu>
|
</SubMenu>
|
||||||
<MenuSection label={dictionary['navigation'].appsPages}>
|
<MenuSection label={dictionary['navigation'].appsPages}>
|
||||||
|
<SubMenu label={dictionary['navigation'].sales} icon={<i className='tabler-user' />}>
|
||||||
|
<MenuItem href={`/${locale}/apps/sales/overview`}>{dictionary['navigation'].overview}</MenuItem>
|
||||||
|
{/* <MenuItem href={`/${locale}/apps/user/view`}>{dictionary['navigation'].view}</MenuItem> */}
|
||||||
|
</SubMenu>
|
||||||
|
<SubMenu label={dictionary['navigation'].purchase_text} icon={<i className='tabler-user' />}>
|
||||||
|
<MenuItem href={`/${locale}/apps/purchase/overview`}>{dictionary['navigation'].overview}</MenuItem>
|
||||||
|
<MenuItem href={`/${locale}/apps/purchase/purchase-orders`}>
|
||||||
|
{dictionary['navigation'].purchase_orders}
|
||||||
|
</MenuItem>
|
||||||
|
</SubMenu>
|
||||||
<SubMenu label={dictionary['navigation'].inventory} icon={<i className='tabler-salad' />}>
|
<SubMenu label={dictionary['navigation'].inventory} icon={<i className='tabler-salad' />}>
|
||||||
<SubMenu label={dictionary['navigation'].products}>
|
<SubMenu label={dictionary['navigation'].products}>
|
||||||
<MenuItem href={`/${locale}/apps/inventory/products/list`}>{dictionary['navigation'].list}</MenuItem>
|
<MenuItem href={`/${locale}/apps/inventory/products/list`}>{dictionary['navigation'].list}</MenuItem>
|
||||||
|
|||||||
@ -112,6 +112,9 @@
|
|||||||
"menuLevel3": "Menu Level 3",
|
"menuLevel3": "Menu Level 3",
|
||||||
"disabledMenu": "Disabled Menu",
|
"disabledMenu": "Disabled Menu",
|
||||||
"dailyReport": "Daily Report",
|
"dailyReport": "Daily Report",
|
||||||
"vendor": "Vendor"
|
"vendor": "Vendor",
|
||||||
|
"sales": "Sales",
|
||||||
|
"purchase_text": "Purchase",
|
||||||
|
"purchase_orders": "Purchase Orders"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,6 +112,9 @@
|
|||||||
"menuLevel3": "Level Menu 3",
|
"menuLevel3": "Level Menu 3",
|
||||||
"disabledMenu": "Menu Nonaktif",
|
"disabledMenu": "Menu Nonaktif",
|
||||||
"dailyReport": "Laporan Harian",
|
"dailyReport": "Laporan Harian",
|
||||||
"vendor": "Vendor"
|
"vendor": "Vendor",
|
||||||
|
"sales": "Penjualan",
|
||||||
|
"purchase_text": "Pembelian",
|
||||||
|
"purchase_orders": "Pesanan Pembelian"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
224
src/data/dummy/purchase-order.ts
Normal file
224
src/data/dummy/purchase-order.ts
Normal file
@ -0,0 +1,224 @@
|
|||||||
|
import { PurchaseOrderType } from '@/types/apps/purchaseOrderTypes'
|
||||||
|
|
||||||
|
export const purchaseOrdersData: PurchaseOrderType[] = [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
number: 'PO/00040',
|
||||||
|
vendorName: 'Kairav Wijaya Nababan',
|
||||||
|
vendorCompany: 'Yayasan Haryanto Tbk',
|
||||||
|
reference: '',
|
||||||
|
date: '05/09/2025',
|
||||||
|
dueDate: '19/09/2025',
|
||||||
|
status: 'Disetujui',
|
||||||
|
total: 2037170
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
number: 'PO/00041',
|
||||||
|
vendorName: 'Sari Melani Hutapea',
|
||||||
|
vendorCompany: 'PT Santoso Jaya',
|
||||||
|
reference: 'REF-2025-001',
|
||||||
|
date: '03/09/2025',
|
||||||
|
dueDate: '17/09/2025',
|
||||||
|
status: 'Draft',
|
||||||
|
total: 1875500
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
number: 'PO/00042',
|
||||||
|
vendorName: 'Budi Prasetyo Manullang',
|
||||||
|
vendorCompany: 'CV Wijaya Makmur',
|
||||||
|
reference: 'REF-2025-002',
|
||||||
|
date: '07/09/2025',
|
||||||
|
dueDate: '21/09/2025',
|
||||||
|
status: 'Dikirim Sebagian',
|
||||||
|
total: 3250750
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
number: 'PO/00043',
|
||||||
|
vendorName: 'Maya Sari Lumban Gaol',
|
||||||
|
vendorCompany: 'PT Indah Permata',
|
||||||
|
reference: '',
|
||||||
|
date: '02/09/2025',
|
||||||
|
dueDate: '16/09/2025',
|
||||||
|
status: 'Selesai',
|
||||||
|
total: 980250
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
number: 'PO/00044',
|
||||||
|
vendorName: 'Rahman Hakim Siahaan',
|
||||||
|
vendorCompany: 'Toko Bahagia Sejahtera',
|
||||||
|
reference: 'REF-2025-003',
|
||||||
|
date: '08/09/2025',
|
||||||
|
dueDate: '22/09/2025',
|
||||||
|
status: 'Draft',
|
||||||
|
total: 4125890
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 6,
|
||||||
|
number: 'PO/00045',
|
||||||
|
vendorName: 'Dewi Anggraini Panjaitan',
|
||||||
|
vendorCompany: 'PT Maju Bersama',
|
||||||
|
reference: 'REF-2025-004',
|
||||||
|
date: '01/09/2025',
|
||||||
|
dueDate: '15/09/2025',
|
||||||
|
status: 'Selesai',
|
||||||
|
total: 2678300
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 7,
|
||||||
|
number: 'PO/00046',
|
||||||
|
vendorName: 'Agung Wijaya Simbolon',
|
||||||
|
vendorCompany: 'CV Karya Mandiri',
|
||||||
|
reference: '',
|
||||||
|
date: '06/09/2025',
|
||||||
|
dueDate: '20/09/2025',
|
||||||
|
status: 'Disetujui',
|
||||||
|
total: 1456780
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 8,
|
||||||
|
number: 'PO/00047',
|
||||||
|
vendorName: 'Fitri Handayani Sitorus',
|
||||||
|
vendorCompany: 'PT Global Nusantara',
|
||||||
|
reference: 'REF-2025-005',
|
||||||
|
date: '04/09/2025',
|
||||||
|
dueDate: '18/09/2025',
|
||||||
|
status: 'Dikirim Sebagian',
|
||||||
|
total: 5892450
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 9,
|
||||||
|
number: 'PO/00048',
|
||||||
|
vendorName: 'Andi Setiawan Tampubolon',
|
||||||
|
vendorCompany: 'Yayasan Pembangunan Tbk',
|
||||||
|
reference: 'REF-2025-006',
|
||||||
|
date: '09/09/2025',
|
||||||
|
dueDate: '23/09/2025',
|
||||||
|
status: 'Draft',
|
||||||
|
total: 3567120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 10,
|
||||||
|
number: 'PO/00049',
|
||||||
|
vendorName: 'Rina Maharani Hutasoit',
|
||||||
|
vendorCompany: 'PT Sejahtera Abadi',
|
||||||
|
reference: '',
|
||||||
|
date: '05/09/2025',
|
||||||
|
dueDate: '19/09/2025',
|
||||||
|
status: 'Disetujui',
|
||||||
|
total: 2234680
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 11,
|
||||||
|
number: 'PO/00050',
|
||||||
|
vendorName: 'Joko Santoso Nainggolan',
|
||||||
|
vendorCompany: 'CV Berkah Jaya',
|
||||||
|
reference: 'REF-2025-007',
|
||||||
|
date: '03/09/2025',
|
||||||
|
dueDate: '17/09/2025',
|
||||||
|
status: 'Selesai',
|
||||||
|
total: 1789560
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 12,
|
||||||
|
number: 'PO/00051',
|
||||||
|
vendorName: 'Linda Safitri Simanjuntak',
|
||||||
|
vendorCompany: 'PT Harapan Bangsa',
|
||||||
|
reference: 'REF-2025-008',
|
||||||
|
date: '07/09/2025',
|
||||||
|
dueDate: '21/09/2025',
|
||||||
|
status: 'Dikirim Sebagian',
|
||||||
|
total: 4321870
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 13,
|
||||||
|
number: 'PO/00052',
|
||||||
|
vendorName: 'Irfan Maulana Pasaribu',
|
||||||
|
vendorCompany: 'CV Sumber Rejeki',
|
||||||
|
reference: 'REF-2025-009',
|
||||||
|
date: '10/09/2025',
|
||||||
|
dueDate: '24/09/2025',
|
||||||
|
status: 'Draft',
|
||||||
|
total: 2567890
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 14,
|
||||||
|
number: 'PO/00053',
|
||||||
|
vendorName: 'Siska Permata Sinaga',
|
||||||
|
vendorCompany: 'PT Mitra Sukses',
|
||||||
|
reference: '',
|
||||||
|
date: '11/09/2025',
|
||||||
|
dueDate: '25/09/2025',
|
||||||
|
status: 'Disetujui',
|
||||||
|
total: 3456780
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 15,
|
||||||
|
number: 'PO/00054',
|
||||||
|
vendorName: 'Rizky Aditya Siregar',
|
||||||
|
vendorCompany: 'Toko Aman Sentosa',
|
||||||
|
reference: 'REF-2025-010',
|
||||||
|
date: '08/09/2025',
|
||||||
|
dueDate: '22/09/2025',
|
||||||
|
status: 'Selesai',
|
||||||
|
total: 1234567
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 16,
|
||||||
|
number: 'PO/00055',
|
||||||
|
vendorName: 'Nina Sari Hutabarat',
|
||||||
|
vendorCompany: 'PT Cahaya Terang',
|
||||||
|
reference: 'REF-2025-011',
|
||||||
|
date: '12/09/2025',
|
||||||
|
dueDate: '26/09/2025',
|
||||||
|
status: 'Dikirim Sebagian',
|
||||||
|
total: 5678900
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 17,
|
||||||
|
number: 'PO/00056',
|
||||||
|
vendorName: 'Doni Prasetya Situmorang',
|
||||||
|
vendorCompany: 'CV Barokah Makmur',
|
||||||
|
reference: '',
|
||||||
|
date: '09/09/2025',
|
||||||
|
dueDate: '23/09/2025',
|
||||||
|
status: 'Draft',
|
||||||
|
total: 987654
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 18,
|
||||||
|
number: 'PO/00057',
|
||||||
|
vendorName: 'Anita Dewi Marpaung',
|
||||||
|
vendorCompany: 'Yayasan Karya Bhakti',
|
||||||
|
reference: 'REF-2025-012',
|
||||||
|
date: '06/09/2025',
|
||||||
|
dueDate: '20/09/2025',
|
||||||
|
status: 'Disetujui',
|
||||||
|
total: 4567123
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 19,
|
||||||
|
number: 'PO/00058',
|
||||||
|
vendorName: 'Tommy Wijaya Samosir',
|
||||||
|
vendorCompany: 'PT Bintang Timur',
|
||||||
|
reference: 'REF-2025-013',
|
||||||
|
date: '13/09/2025',
|
||||||
|
dueDate: '27/09/2025',
|
||||||
|
status: 'Selesai',
|
||||||
|
total: 2345678
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 20,
|
||||||
|
number: 'PO/00059',
|
||||||
|
vendorName: 'Lestari Indah Pakpahan',
|
||||||
|
vendorCompany: 'CV Harmoni Jaya',
|
||||||
|
reference: '',
|
||||||
|
date: '05/09/2025',
|
||||||
|
dueDate: '19/09/2025',
|
||||||
|
status: 'Dikirim Sebagian',
|
||||||
|
total: 3789012
|
||||||
|
}
|
||||||
|
]
|
||||||
11
src/types/apps/purchaseOrderTypes.ts
Normal file
11
src/types/apps/purchaseOrderTypes.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
export type PurchaseOrderType = {
|
||||||
|
id: number
|
||||||
|
number: string
|
||||||
|
vendorName: string
|
||||||
|
vendorCompany: string
|
||||||
|
reference: string
|
||||||
|
date: string
|
||||||
|
dueDate: string
|
||||||
|
status: string
|
||||||
|
total: number
|
||||||
|
}
|
||||||
@ -0,0 +1,106 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
// Next Imports
|
||||||
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
|
// MUI Imports
|
||||||
|
import Card from '@mui/material/Card'
|
||||||
|
import CardHeader from '@mui/material/CardHeader'
|
||||||
|
import CardContent from '@mui/material/CardContent'
|
||||||
|
|
||||||
|
// Third Party Imports
|
||||||
|
import type { ApexOptions } from 'apexcharts'
|
||||||
|
|
||||||
|
// Components Imports
|
||||||
|
import OptionMenu from '@core/components/option-menu'
|
||||||
|
|
||||||
|
// Styled Component Imports
|
||||||
|
const AppReactApexCharts = dynamic(() => import('@/libs/styles/AppReactApexCharts'))
|
||||||
|
|
||||||
|
// Vars
|
||||||
|
const series = [52.2]
|
||||||
|
|
||||||
|
const PurchasePaymentRatioGaugeChart = () => {
|
||||||
|
const options: ApexOptions = {
|
||||||
|
chart: {
|
||||||
|
type: 'radialBar',
|
||||||
|
sparkline: {
|
||||||
|
enabled: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plotOptions: {
|
||||||
|
radialBar: {
|
||||||
|
startAngle: -90,
|
||||||
|
endAngle: 90,
|
||||||
|
track: {
|
||||||
|
background: '#e7e7e7',
|
||||||
|
strokeWidth: '97%',
|
||||||
|
margin: 5,
|
||||||
|
dropShadow: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
hollow: {
|
||||||
|
margin: 15,
|
||||||
|
size: '70%'
|
||||||
|
},
|
||||||
|
dataLabels: {
|
||||||
|
name: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
offsetY: -10,
|
||||||
|
fontSize: '32px',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
color: '#1f2937',
|
||||||
|
formatter: function (val) {
|
||||||
|
return val + '%'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
padding: {
|
||||||
|
top: -10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fill: {
|
||||||
|
type: 'gradient',
|
||||||
|
gradient: {
|
||||||
|
shade: 'light',
|
||||||
|
shadeIntensity: 0.4,
|
||||||
|
inverseColors: false,
|
||||||
|
opacityFrom: 1,
|
||||||
|
opacityTo: 1,
|
||||||
|
stops: [0, 50, 53, 91]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
colors: ['#3b82f6'],
|
||||||
|
stroke: {
|
||||||
|
dashArray: 4
|
||||||
|
},
|
||||||
|
labels: ['Rasio Lunas']
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card>
|
||||||
|
<CardHeader title='Rasio Lunas' action={<OptionMenu options={['View More', 'Delete']} />} />
|
||||||
|
<CardContent className='flex flex-col items-center pb-6'>
|
||||||
|
<AppReactApexCharts
|
||||||
|
id='rasio-lunas-gauge'
|
||||||
|
type='radialBar'
|
||||||
|
height={280}
|
||||||
|
width='100%'
|
||||||
|
series={series}
|
||||||
|
options={options}
|
||||||
|
/>
|
||||||
|
<div className='text-sm text-gray-500 text-center mt-4 max-w-xs'>
|
||||||
|
Tagihan Pembelian lunas vs total Tagihan Pembelian bulan ini
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PurchasePaymentRatioGaugeChart
|
||||||
@ -0,0 +1,218 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
// React Imports
|
||||||
|
import { useState } from 'react'
|
||||||
|
|
||||||
|
// Next Imports
|
||||||
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
|
// MUI Imports
|
||||||
|
import Card from '@mui/material/Card'
|
||||||
|
import CardHeader from '@mui/material/CardHeader'
|
||||||
|
import CardContent from '@mui/material/CardContent'
|
||||||
|
import Button from '@mui/material/Button'
|
||||||
|
import ButtonGroup from '@mui/material/ButtonGroup'
|
||||||
|
import Table from '@mui/material/Table'
|
||||||
|
import TableBody from '@mui/material/TableBody'
|
||||||
|
import TableCell from '@mui/material/TableCell'
|
||||||
|
import TableContainer from '@mui/material/TableContainer'
|
||||||
|
import TableHead from '@mui/material/TableHead'
|
||||||
|
import TableRow from '@mui/material/TableRow'
|
||||||
|
import TableFooter from '@mui/material/TableFooter'
|
||||||
|
import Typography from '@mui/material/Typography'
|
||||||
|
|
||||||
|
// Third Party Imports
|
||||||
|
import type { ApexOptions } from 'apexcharts'
|
||||||
|
|
||||||
|
// Components Imports
|
||||||
|
import OptionMenu from '@core/components/option-menu'
|
||||||
|
|
||||||
|
// Styled Component Imports
|
||||||
|
const AppReactApexCharts = dynamic(() => import('@/libs/styles/AppReactApexCharts'))
|
||||||
|
|
||||||
|
// Data
|
||||||
|
const productData = [
|
||||||
|
{ kategori: 'Dress', jumlah: 174, nilai: 70629279 },
|
||||||
|
{ kategori: 'Tshirt', jumlah: 163, nilai: 31667892 },
|
||||||
|
{ kategori: 'Shoes', jumlah: 27, nilai: 13473000 },
|
||||||
|
{ kategori: 'Misc', jumlah: 128, nilai: 123937 }
|
||||||
|
]
|
||||||
|
|
||||||
|
const totalJumlah = productData.reduce((sum, item) => sum + item.jumlah, 0)
|
||||||
|
const totalNilai = productData.reduce((sum, item) => sum + item.nilai, 0)
|
||||||
|
|
||||||
|
// Chart series and colors
|
||||||
|
const series = productData.map(item => item.nilai)
|
||||||
|
const colors = ['#FF6B9D', '#FFD93D', '#6BCF7F', '#4D96FF']
|
||||||
|
|
||||||
|
const PurchaseProductSalesChart = () => {
|
||||||
|
const [activeView, setActiveView] = useState<'chart' | 'table'>('chart')
|
||||||
|
|
||||||
|
const options: ApexOptions = {
|
||||||
|
chart: {
|
||||||
|
type: 'donut'
|
||||||
|
},
|
||||||
|
labels: productData.map(item => item.kategori),
|
||||||
|
colors: colors,
|
||||||
|
legend: {
|
||||||
|
position: 'bottom',
|
||||||
|
horizontalAlign: 'center',
|
||||||
|
fontSize: '14px',
|
||||||
|
markers: {
|
||||||
|
width: 12,
|
||||||
|
height: 12,
|
||||||
|
radius: 2
|
||||||
|
},
|
||||||
|
itemMargin: {
|
||||||
|
horizontal: 15,
|
||||||
|
vertical: 5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plotOptions: {
|
||||||
|
pie: {
|
||||||
|
donut: {
|
||||||
|
size: '70%'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataLabels: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
y: {
|
||||||
|
formatter: function (val) {
|
||||||
|
return 'Rp ' + val.toLocaleString('id-ID')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
stroke: {
|
||||||
|
width: 2,
|
||||||
|
colors: ['#fff']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatCurrency = (amount: number): string => {
|
||||||
|
return amount.toLocaleString('id-ID')
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card className='mt-5'>
|
||||||
|
<CardHeader
|
||||||
|
title='Total Pembelian Bulan Ini'
|
||||||
|
action={
|
||||||
|
<div className='flex items-center gap-2'>
|
||||||
|
<div className='w-4 h-4 bg-gray-300 rounded cursor-pointer'></div>
|
||||||
|
<OptionMenu options={['View More', 'Delete']} />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<CardContent>
|
||||||
|
{/* Toggle Buttons */}
|
||||||
|
<div className='flex justify-center mb-6'>
|
||||||
|
<ButtonGroup size='small'>
|
||||||
|
<Button
|
||||||
|
variant={activeView === 'chart' ? 'contained' : 'outlined'}
|
||||||
|
onClick={() => setActiveView('chart')}
|
||||||
|
sx={{
|
||||||
|
minWidth: '120px',
|
||||||
|
backgroundColor: activeView === 'chart' ? '#36175e' : 'transparent',
|
||||||
|
color: activeView === 'chart' ? 'white' : '#36175e',
|
||||||
|
borderColor: '#36175e',
|
||||||
|
'&:hover': {
|
||||||
|
backgroundColor: activeView === 'chart' ? '#36175e' : 'rgba(25, 118, 210, 0.04)'
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Jenis Produk
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant={activeView === 'table' ? 'contained' : 'outlined'}
|
||||||
|
onClick={() => setActiveView('table')}
|
||||||
|
sx={{
|
||||||
|
minWidth: '120px',
|
||||||
|
backgroundColor: activeView === 'table' ? '#36175e' : 'transparent',
|
||||||
|
color: activeView === 'table' ? 'white' : '#36175e',
|
||||||
|
borderColor: '#36175e',
|
||||||
|
'&:hover': {
|
||||||
|
backgroundColor: activeView === 'table' ? '#36175e' : 'rgba(25, 118, 210, 0.04)'
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Kategori
|
||||||
|
</Button>
|
||||||
|
</ButtonGroup>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Content based on active view */}
|
||||||
|
{activeView === 'chart' ? (
|
||||||
|
// Donut Chart View (Slide 1)
|
||||||
|
<div className='flex flex-col items-center'>
|
||||||
|
<AppReactApexCharts
|
||||||
|
id='product-sales-donut'
|
||||||
|
type='donut'
|
||||||
|
height={350}
|
||||||
|
width='100%'
|
||||||
|
series={series}
|
||||||
|
options={options}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
// Table View (Slide 2)
|
||||||
|
<TableContainer>
|
||||||
|
<Table>
|
||||||
|
<TableHead>
|
||||||
|
<TableRow>
|
||||||
|
<TableCell sx={{ fontWeight: 600 }}>Kategori</TableCell>
|
||||||
|
<TableCell align='center' sx={{ fontWeight: 600 }}>
|
||||||
|
Jml
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align='right' sx={{ fontWeight: 600 }}>
|
||||||
|
Nilai
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
</TableHead>
|
||||||
|
<TableBody>
|
||||||
|
{productData.map((row, index) => (
|
||||||
|
<TableRow key={index}>
|
||||||
|
<TableCell>{row.kategori}</TableCell>
|
||||||
|
<TableCell align='center'>{row.jumlah}</TableCell>
|
||||||
|
<TableCell align='right'>{formatCurrency(row.nilai)}</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
</TableBody>
|
||||||
|
<TableFooter>
|
||||||
|
<TableRow sx={{ backgroundColor: '#f5f5f5' }}>
|
||||||
|
<TableCell sx={{ fontWeight: 700, fontSize: '14px' }}>Total</TableCell>
|
||||||
|
<TableCell align='center' sx={{ fontWeight: 700, fontSize: '14px' }}>
|
||||||
|
{totalJumlah}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align='right' sx={{ fontWeight: 700, fontSize: '14px' }}>
|
||||||
|
{formatCurrency(totalNilai)}
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
</TableFooter>
|
||||||
|
</Table>
|
||||||
|
</TableContainer>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Two dot indicators at bottom */}
|
||||||
|
<div className='flex justify-center items-center gap-2 mt-6'>
|
||||||
|
<div
|
||||||
|
className={`w-3 h-3 rounded-full cursor-pointer transition-colors ${
|
||||||
|
activeView === 'chart' ? 'bg-primary' : 'bg-gray-300'
|
||||||
|
}`}
|
||||||
|
onClick={() => setActiveView('chart')}
|
||||||
|
></div>
|
||||||
|
<div
|
||||||
|
className={`w-3 h-3 rounded-full cursor-pointer transition-colors ${
|
||||||
|
activeView === 'table' ? 'bg-primary' : 'bg-gray-300'
|
||||||
|
}`}
|
||||||
|
onClick={() => setActiveView('table')}
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PurchaseProductSalesChart
|
||||||
@ -0,0 +1,187 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
// React Imports
|
||||||
|
import { useState } from 'react'
|
||||||
|
|
||||||
|
// Next Imports
|
||||||
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
|
// MUI Imports
|
||||||
|
import Card from '@mui/material/Card'
|
||||||
|
import CardHeader from '@mui/material/CardHeader'
|
||||||
|
import CardContent from '@mui/material/CardContent'
|
||||||
|
import Button from '@mui/material/Button'
|
||||||
|
import ButtonGroup from '@mui/material/ButtonGroup'
|
||||||
|
import Table from '@mui/material/Table'
|
||||||
|
import TableBody from '@mui/material/TableBody'
|
||||||
|
import TableCell from '@mui/material/TableCell'
|
||||||
|
import TableContainer from '@mui/material/TableContainer'
|
||||||
|
import TableHead from '@mui/material/TableHead'
|
||||||
|
import TableRow from '@mui/material/TableRow'
|
||||||
|
import TableFooter from '@mui/material/TableFooter'
|
||||||
|
import Typography from '@mui/material/Typography'
|
||||||
|
|
||||||
|
// Third Party Imports
|
||||||
|
import type { ApexOptions } from 'apexcharts'
|
||||||
|
|
||||||
|
// Components Imports
|
||||||
|
import OptionMenu from '@core/components/option-menu'
|
||||||
|
|
||||||
|
// Styled Component Imports
|
||||||
|
const AppReactApexCharts = dynamic(() => import('@/libs/styles/AppReactApexCharts'))
|
||||||
|
|
||||||
|
// Data
|
||||||
|
const customerData = [
|
||||||
|
{ pelanggan: 'Mumpuni Imam Rajata...', perusahaan: 'Fa Hassanah', nilai: 14117300 },
|
||||||
|
{ pelanggan: 'Balangga Saefullah M...', perusahaan: 'CV Siregar Prasetya Tbk', nilai: 12520640 },
|
||||||
|
{ pelanggan: 'Jais Mursita Adrians...', perusahaan: 'UD Sinaga Waluyo', nilai: 12174120 },
|
||||||
|
{ pelanggan: 'Paramita Wijayanti M...', perusahaan: 'PD Waluyo Yuniar', nilai: 11001060 },
|
||||||
|
{ pelanggan: 'Putri Puji Pertiwi S...', perusahaan: 'CV Wahyudin Tbk', nilai: 9175560 },
|
||||||
|
{ pelanggan: 'Lainnya', perusahaan: '', nilai: 63285770 }
|
||||||
|
]
|
||||||
|
|
||||||
|
const totalNilai = customerData.reduce((sum, item) => sum + item.nilai, 0)
|
||||||
|
|
||||||
|
// Chart series and colors
|
||||||
|
const series = customerData.map(item => item.nilai)
|
||||||
|
const colors = ['#FF6B9D', '#FFD93D', '#6BCF7F', '#4D96FF', '#B39DDB', '#E91E63']
|
||||||
|
|
||||||
|
const PurchaseVendorSalesChart = () => {
|
||||||
|
const [activeView, setActiveView] = useState<'chart' | 'table'>('chart')
|
||||||
|
|
||||||
|
const options: ApexOptions = {
|
||||||
|
chart: {
|
||||||
|
type: 'donut'
|
||||||
|
},
|
||||||
|
labels: customerData.map(item => item.pelanggan),
|
||||||
|
colors: colors,
|
||||||
|
legend: {
|
||||||
|
position: 'bottom',
|
||||||
|
horizontalAlign: 'center',
|
||||||
|
fontSize: '14px',
|
||||||
|
markers: {
|
||||||
|
width: 12,
|
||||||
|
height: 12,
|
||||||
|
radius: 2
|
||||||
|
},
|
||||||
|
itemMargin: {
|
||||||
|
horizontal: 15,
|
||||||
|
vertical: 5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plotOptions: {
|
||||||
|
pie: {
|
||||||
|
donut: {
|
||||||
|
size: '70%'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataLabels: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
y: {
|
||||||
|
formatter: function (val) {
|
||||||
|
return 'Rp ' + val.toLocaleString('id-ID')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
stroke: {
|
||||||
|
width: 2,
|
||||||
|
colors: ['#fff']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatCurrency = (amount: number): string => {
|
||||||
|
return amount.toLocaleString('id-ID')
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card className='mt-5'>
|
||||||
|
<CardHeader
|
||||||
|
title='Pembelian Per Vendor Bulan Ini'
|
||||||
|
action={
|
||||||
|
<div className='flex items-center gap-2'>
|
||||||
|
<div className='w-4 h-4 bg-gray-300 rounded cursor-pointer'></div>
|
||||||
|
<OptionMenu options={['View More', 'Delete']} />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<CardContent>
|
||||||
|
{/* Content based on active view */}
|
||||||
|
{activeView === 'chart' ? (
|
||||||
|
// Donut Chart View (Slide 1)
|
||||||
|
<div className='flex flex-col items-center'>
|
||||||
|
<AppReactApexCharts
|
||||||
|
id='customer-sales-donut'
|
||||||
|
type='donut'
|
||||||
|
height={350}
|
||||||
|
width='100%'
|
||||||
|
series={series}
|
||||||
|
options={options}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
// Table View (Slide 2)
|
||||||
|
<TableContainer>
|
||||||
|
<Table>
|
||||||
|
<TableHead>
|
||||||
|
<TableRow>
|
||||||
|
<TableCell sx={{ fontWeight: 600 }}>Vendor</TableCell>
|
||||||
|
<TableCell align='right' sx={{ fontWeight: 600 }}>
|
||||||
|
Nilai
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
</TableHead>
|
||||||
|
<TableBody>
|
||||||
|
{customerData.map((row, index) => (
|
||||||
|
<TableRow key={index}>
|
||||||
|
<TableCell>
|
||||||
|
<div>
|
||||||
|
<Typography variant='body2' sx={{ fontWeight: 500 }}>
|
||||||
|
{row.pelanggan}
|
||||||
|
</Typography>
|
||||||
|
{row.perusahaan && (
|
||||||
|
<Typography variant='caption' color='text.secondary'>
|
||||||
|
{row.perusahaan}
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align='right'>{formatCurrency(row.nilai)}</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
</TableBody>
|
||||||
|
<TableFooter>
|
||||||
|
<TableRow sx={{ backgroundColor: '#f5f5f5' }}>
|
||||||
|
<TableCell sx={{ fontWeight: 700, fontSize: '14px' }}>Total</TableCell>
|
||||||
|
<TableCell align='right' sx={{ fontWeight: 700, fontSize: '14px' }}>
|
||||||
|
{formatCurrency(totalNilai)}
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
</TableFooter>
|
||||||
|
</Table>
|
||||||
|
</TableContainer>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Two dot indicators at bottom */}
|
||||||
|
<div className='flex justify-center items-center gap-2 mt-6'>
|
||||||
|
<div
|
||||||
|
className={`w-3 h-3 rounded-full cursor-pointer transition-colors ${
|
||||||
|
activeView === 'chart' ? 'bg-blue-500' : 'bg-gray-300'
|
||||||
|
}`}
|
||||||
|
onClick={() => setActiveView('chart')}
|
||||||
|
></div>
|
||||||
|
<div
|
||||||
|
className={`w-3 h-3 rounded-full cursor-pointer transition-colors ${
|
||||||
|
activeView === 'table' ? 'bg-blue-500' : 'bg-gray-300'
|
||||||
|
}`}
|
||||||
|
onClick={() => setActiveView('table')}
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PurchaseVendorSalesChart
|
||||||
15
src/views/apps/purchase/overview/overview-left/index.tsx
Normal file
15
src/views/apps/purchase/overview/overview-left/index.tsx
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import PurchasePaymentRatioGaugeChart from './PurchasePaymentRatioGaugeChart'
|
||||||
|
import PurchaseProductSalesChart from './PurchaseProductChart'
|
||||||
|
import PurchaseVendorSalesChart from './PurchaseVendorSalesChart'
|
||||||
|
|
||||||
|
const PurchaseOverviewLeft = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PurchasePaymentRatioGaugeChart />
|
||||||
|
<PurchaseProductSalesChart />
|
||||||
|
<PurchaseVendorSalesChart />
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PurchaseOverviewLeft
|
||||||
@ -0,0 +1,160 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
// Next Imports
|
||||||
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
|
// MUI Imports
|
||||||
|
import Card from '@mui/material/Card'
|
||||||
|
import CardHeader from '@mui/material/CardHeader'
|
||||||
|
import CardContent from '@mui/material/CardContent'
|
||||||
|
|
||||||
|
// Third Party Imports
|
||||||
|
import type { ApexOptions } from 'apexcharts'
|
||||||
|
|
||||||
|
// Components Imports
|
||||||
|
import OptionMenu from '@core/components/option-menu'
|
||||||
|
|
||||||
|
// Styled Component Imports
|
||||||
|
const AppReactApexCharts = dynamic(() => import('@/libs/styles/AppReactApexCharts'))
|
||||||
|
|
||||||
|
// Styles Imports
|
||||||
|
import './styles.css'
|
||||||
|
|
||||||
|
// Vars
|
||||||
|
const colors = {
|
||||||
|
tagihanPembelian: '#28C76F',
|
||||||
|
pembayaranPembelian: '#EA5455'
|
||||||
|
}
|
||||||
|
|
||||||
|
const labelColor = 'var(--mui-palette-text-disabled)'
|
||||||
|
const bodyColor = 'var(--mui-palette-text-secondary)'
|
||||||
|
const borderColor = 'var(--mui-palette-divider)'
|
||||||
|
|
||||||
|
const series = [
|
||||||
|
{
|
||||||
|
name: 'Tagihan Pembelian',
|
||||||
|
type: 'column',
|
||||||
|
data: [1250, 1180, 1350, 1450, 1200, 1520, 1380, 1150, 1650, 1400, 1290, 1700]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Pembayaran Pembelian',
|
||||||
|
type: 'column',
|
||||||
|
data: [950, 880, 1050, 1150, 900, 1220, 1080, 850, 1350, 1100, 990, 1400]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const PurchaseBillPaymentChart = () => {
|
||||||
|
const options: ApexOptions = {
|
||||||
|
chart: {
|
||||||
|
parentHeightOffset: 0,
|
||||||
|
stacked: false,
|
||||||
|
toolbar: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
zoom: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
enabled: true,
|
||||||
|
y: {
|
||||||
|
formatter: function (val) {
|
||||||
|
return 'Rp ' + val.toLocaleString('id-ID') + '.000'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plotOptions: {
|
||||||
|
bar: {
|
||||||
|
horizontal: false,
|
||||||
|
columnWidth: '60%',
|
||||||
|
borderRadius: 4
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataLabels: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
xaxis: {
|
||||||
|
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agu', 'Sep', 'Okt', 'Nov', 'Des'],
|
||||||
|
labels: {
|
||||||
|
style: {
|
||||||
|
colors: labelColor,
|
||||||
|
fontSize: '13px',
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
fontWeight: 400
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisBorder: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
axisTicks: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yaxis: {
|
||||||
|
tickAmount: 5,
|
||||||
|
max: 1800,
|
||||||
|
min: 0,
|
||||||
|
labels: {
|
||||||
|
style: {
|
||||||
|
colors: labelColor,
|
||||||
|
fontSize: '13px',
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
fontWeight: 400
|
||||||
|
},
|
||||||
|
formatter(val: number) {
|
||||||
|
return 'Rp ' + val + 'rb'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
markers: {
|
||||||
|
width: 8,
|
||||||
|
height: 8,
|
||||||
|
offsetX: -3,
|
||||||
|
radius: 12
|
||||||
|
},
|
||||||
|
height: 33,
|
||||||
|
offsetY: 10,
|
||||||
|
itemMargin: {
|
||||||
|
horizontal: 10,
|
||||||
|
vertical: 0
|
||||||
|
},
|
||||||
|
fontSize: '13px',
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
fontWeight: 400,
|
||||||
|
labels: {
|
||||||
|
colors: bodyColor,
|
||||||
|
useSeriesColors: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
borderColor,
|
||||||
|
strokeDashArray: 6
|
||||||
|
},
|
||||||
|
colors: [colors.tagihanPembelian, colors.pembayaranPembelian],
|
||||||
|
fill: {
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card className='mt-5'>
|
||||||
|
<CardHeader
|
||||||
|
title='Tagihan Pembelian & Pembayaran Pembelian'
|
||||||
|
action={<OptionMenu options={['View More', 'Delete']} />}
|
||||||
|
/>
|
||||||
|
<CardContent>
|
||||||
|
<AppReactApexCharts
|
||||||
|
id='tagihan-pembayaran-pembelian'
|
||||||
|
type='bar'
|
||||||
|
height={360}
|
||||||
|
width='100%'
|
||||||
|
series={series}
|
||||||
|
options={options}
|
||||||
|
/>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PurchaseBillPaymentChart
|
||||||
@ -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: 'PEMBELIAN',
|
||||||
|
stats: '12.932.460',
|
||||||
|
avatarIcon: 'tabler-trending-up',
|
||||||
|
avatarColor: 'success',
|
||||||
|
trend: 'positive',
|
||||||
|
trendNumber: '114,7%',
|
||||||
|
subtitle: '15 Tagihan Pembelian Bulan Ini'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'PEMBAYARAN PEMBELIAN DIKIRIM',
|
||||||
|
stats: '2.573.790',
|
||||||
|
avatarIcon: 'tabler-trending-down',
|
||||||
|
avatarColor: 'error',
|
||||||
|
trend: 'negative',
|
||||||
|
trendNumber: '34,0%',
|
||||||
|
subtitle: '5 Tagihan Pembelian Bulan Ini'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'MENUNGGU PEMBAYARAN PEMBELIAN',
|
||||||
|
stats: '10.358.670',
|
||||||
|
avatarIcon: 'tabler-trending-up',
|
||||||
|
avatarColor: 'success',
|
||||||
|
trend: 'positive',
|
||||||
|
trendNumber: '380,6%',
|
||||||
|
subtitle: '10 Tagihan Pembelian'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'JATUH TEMPO TAGIHAN PEMBELIAN',
|
||||||
|
stats: '6.033.000',
|
||||||
|
avatarIcon: 'tabler-clock-exclamation',
|
||||||
|
avatarColor: 'error',
|
||||||
|
trend: 'neutral',
|
||||||
|
trendNumber: '100%',
|
||||||
|
subtitle: '6 Tagihan Pembelian'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const PurchaseOverviewCards = () => {
|
||||||
|
return (
|
||||||
|
<Grid container spacing={6}>
|
||||||
|
{data.map((item, i) => (
|
||||||
|
<Grid key={i} size={{ xs: 12, sm: 6 }}>
|
||||||
|
<HorizontalWithSubtitle {...item} />
|
||||||
|
</Grid>
|
||||||
|
))}
|
||||||
|
</Grid>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PurchaseOverviewCards
|
||||||
@ -0,0 +1,152 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
// Next Imports
|
||||||
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
|
// MUI Imports
|
||||||
|
import Card from '@mui/material/Card'
|
||||||
|
import CardHeader from '@mui/material/CardHeader'
|
||||||
|
import CardContent from '@mui/material/CardContent'
|
||||||
|
|
||||||
|
// Third Party Imports
|
||||||
|
import type { ApexOptions } from 'apexcharts'
|
||||||
|
|
||||||
|
// Components Imports
|
||||||
|
import OptionMenu from '@core/components/option-menu'
|
||||||
|
|
||||||
|
// Styled Component Imports
|
||||||
|
const AppReactApexCharts = dynamic(() => import('@/libs/styles/AppReactApexCharts'))
|
||||||
|
|
||||||
|
// Styles Imports
|
||||||
|
import './styles.css'
|
||||||
|
|
||||||
|
// Vars
|
||||||
|
const labelColor = 'var(--mui-palette-text-disabled)'
|
||||||
|
const bodyColor = 'var(--mui-palette-text-secondary)'
|
||||||
|
const borderColor = 'var(--mui-palette-divider)'
|
||||||
|
|
||||||
|
const series = [
|
||||||
|
{
|
||||||
|
name: 'Pembayaran Diterima',
|
||||||
|
data: [0, 0, 0, 0, 0, 67000000]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const PurchasePaymentReceivedChart = () => {
|
||||||
|
const options: ApexOptions = {
|
||||||
|
chart: {
|
||||||
|
parentHeightOffset: 0,
|
||||||
|
toolbar: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
zoom: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
stroke: {
|
||||||
|
width: 3,
|
||||||
|
curve: 'smooth'
|
||||||
|
},
|
||||||
|
markers: {
|
||||||
|
size: 6,
|
||||||
|
colors: ['#00CFE8'],
|
||||||
|
strokeColors: '#fff',
|
||||||
|
strokeWidth: 2,
|
||||||
|
hover: {
|
||||||
|
size: 8
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
enabled: true,
|
||||||
|
y: {
|
||||||
|
formatter: function (val) {
|
||||||
|
return 'Rp ' + val.toLocaleString('id-ID')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataLabels: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
xaxis: {
|
||||||
|
categories: ['2020', '2021', '2022', '2023', '2024', '2025'],
|
||||||
|
labels: {
|
||||||
|
style: {
|
||||||
|
colors: labelColor,
|
||||||
|
fontSize: '13px',
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
fontWeight: 400
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisBorder: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
axisTicks: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yaxis: {
|
||||||
|
tickAmount: 7,
|
||||||
|
max: 70000000,
|
||||||
|
min: 0,
|
||||||
|
labels: {
|
||||||
|
style: {
|
||||||
|
colors: labelColor,
|
||||||
|
fontSize: '13px',
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
fontWeight: 400
|
||||||
|
},
|
||||||
|
formatter(val: number) {
|
||||||
|
if (val === 0) return '0'
|
||||||
|
return (val / 1000000).toFixed(0) + '.000.000'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
borderColor,
|
||||||
|
strokeDashArray: 6,
|
||||||
|
xaxis: {
|
||||||
|
lines: {
|
||||||
|
show: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yaxis: {
|
||||||
|
lines: {
|
||||||
|
show: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
colors: ['#00CFE8'],
|
||||||
|
fill: {
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card className='mt-5'>
|
||||||
|
<CardHeader
|
||||||
|
title='Pembayaran'
|
||||||
|
action={
|
||||||
|
<div className='flex items-center gap-2'>
|
||||||
|
<div className='w-4 h-4 bg-gray-300 rounded cursor-pointer'></div>
|
||||||
|
<OptionMenu options={['View More', 'Delete']} />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<CardContent>
|
||||||
|
<AppReactApexCharts
|
||||||
|
id='pembayaran-diterima'
|
||||||
|
type='line'
|
||||||
|
height={360}
|
||||||
|
width='100%'
|
||||||
|
series={series}
|
||||||
|
options={options}
|
||||||
|
/>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PurchasePaymentReceivedChart
|
||||||
15
src/views/apps/purchase/overview/overview-right/index.tsx
Normal file
15
src/views/apps/purchase/overview/overview-right/index.tsx
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import PurchaseBillPaymentChart from './PurchaseBillPaymentChart'
|
||||||
|
import PurchaseOverviewCards from './PurchaseOverviewCards'
|
||||||
|
import PurchasePaymentReceivedChart from './PurchasePaymentReceivedChart'
|
||||||
|
|
||||||
|
const PurchaseOverviewRight = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PurchaseOverviewCards />
|
||||||
|
<PurchaseBillPaymentChart />
|
||||||
|
<PurchasePaymentReceivedChart />
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PurchaseOverviewRight
|
||||||
15
src/views/apps/purchase/overview/overview-right/styles.css
Normal file
15
src/views/apps/purchase/overview/overview-right/styles.css
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#tagihan-pembayaran-pembelian .apexcharts-legend .apexcharts-legend-series {
|
||||||
|
border: 1px solid var(--mui-palette-divider);
|
||||||
|
border-radius: var(--mui-shape-borderRadius);
|
||||||
|
block-size: 83%;
|
||||||
|
padding-block: 4px;
|
||||||
|
padding-inline: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pembayaran-diterima .apexcharts-legend .apexcharts-legend-series {
|
||||||
|
border: 1px solid var(--mui-palette-divider);
|
||||||
|
border-radius: var(--mui-shape-borderRadius);
|
||||||
|
block-size: 83%;
|
||||||
|
padding-block: 4px;
|
||||||
|
padding-inline: 16px;
|
||||||
|
}
|
||||||
@ -0,0 +1,452 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
// React Imports
|
||||||
|
import { useCallback, useEffect, useMemo, useState } from 'react'
|
||||||
|
|
||||||
|
// Next Imports
|
||||||
|
import Link from 'next/link'
|
||||||
|
import { useParams } from 'next/navigation'
|
||||||
|
|
||||||
|
// MUI Imports
|
||||||
|
import Button from '@mui/material/Button'
|
||||||
|
import Card from '@mui/material/Card'
|
||||||
|
import CardHeader from '@mui/material/CardHeader'
|
||||||
|
import Checkbox from '@mui/material/Checkbox'
|
||||||
|
import Chip from '@mui/material/Chip'
|
||||||
|
import IconButton from '@mui/material/IconButton'
|
||||||
|
import MenuItem from '@mui/material/MenuItem'
|
||||||
|
import { styled } from '@mui/material/styles'
|
||||||
|
import type { TextFieldProps } from '@mui/material/TextField'
|
||||||
|
import Typography from '@mui/material/Typography'
|
||||||
|
|
||||||
|
// Third-party Imports
|
||||||
|
import type { RankingInfo } from '@tanstack/match-sorter-utils'
|
||||||
|
import { rankItem } from '@tanstack/match-sorter-utils'
|
||||||
|
import type { ColumnDef, FilterFn } from '@tanstack/react-table'
|
||||||
|
import { createColumnHelper, flexRender, getCoreRowModel, useReactTable } from '@tanstack/react-table'
|
||||||
|
import classnames from 'classnames'
|
||||||
|
|
||||||
|
// Type Imports
|
||||||
|
import type { Locale } from '@configs/i18n'
|
||||||
|
|
||||||
|
// Component Imports
|
||||||
|
import CustomTextField from '@core/components/mui/TextField'
|
||||||
|
import OptionMenu from '@core/components/option-menu'
|
||||||
|
|
||||||
|
// Style Imports
|
||||||
|
import tableStyles from '@core/styles/table.module.css'
|
||||||
|
import { Box, CircularProgress, TablePagination } from '@mui/material'
|
||||||
|
import { useDispatch } from 'react-redux'
|
||||||
|
import TablePaginationComponent from '@/components/TablePaginationComponent'
|
||||||
|
import Loading from '@/components/layout/shared/Loading'
|
||||||
|
import { PurchaseOrderType } from '@/types/apps/purchaseOrderTypes'
|
||||||
|
import { purchaseOrdersData } from '@/data/dummy/purchase-order'
|
||||||
|
|
||||||
|
declare module '@tanstack/table-core' {
|
||||||
|
interface FilterFns {
|
||||||
|
fuzzy: FilterFn<unknown>
|
||||||
|
}
|
||||||
|
interface FilterMeta {
|
||||||
|
itemRank: RankingInfo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type PurchaseOrderTypeWithAction = PurchaseOrderType & {
|
||||||
|
actions?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// Styled Components
|
||||||
|
const Icon = styled('i')({})
|
||||||
|
|
||||||
|
const fuzzyFilter: FilterFn<any> = (row, columnId, value, addMeta) => {
|
||||||
|
// Rank the item
|
||||||
|
const itemRank = rankItem(row.getValue(columnId), value)
|
||||||
|
|
||||||
|
// Store the itemRank info
|
||||||
|
addMeta({
|
||||||
|
itemRank
|
||||||
|
})
|
||||||
|
|
||||||
|
// Return if the item should be filtered in/out
|
||||||
|
return itemRank.passed
|
||||||
|
}
|
||||||
|
|
||||||
|
const DebouncedInput = ({
|
||||||
|
value: initialValue,
|
||||||
|
onChange,
|
||||||
|
debounce = 500,
|
||||||
|
...props
|
||||||
|
}: {
|
||||||
|
value: string | number
|
||||||
|
onChange: (value: string | number) => void
|
||||||
|
debounce?: number
|
||||||
|
} & Omit<TextFieldProps, 'onChange'>) => {
|
||||||
|
// States
|
||||||
|
const [value, setValue] = useState(initialValue)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setValue(initialValue)
|
||||||
|
}, [initialValue])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const timeout = setTimeout(() => {
|
||||||
|
onChange(value)
|
||||||
|
}, debounce)
|
||||||
|
|
||||||
|
return () => clearTimeout(timeout)
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [value])
|
||||||
|
|
||||||
|
return <CustomTextField {...props} value={value} onChange={e => setValue(e.target.value)} />
|
||||||
|
}
|
||||||
|
|
||||||
|
// Status color mapping
|
||||||
|
const getStatusColor = (status: string) => {
|
||||||
|
switch (status) {
|
||||||
|
case 'Draft':
|
||||||
|
return 'secondary'
|
||||||
|
case 'Disetujui':
|
||||||
|
return 'primary'
|
||||||
|
case 'Dikirim Sebagian':
|
||||||
|
return 'warning'
|
||||||
|
case 'Selesai':
|
||||||
|
return 'success'
|
||||||
|
default:
|
||||||
|
return 'default'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Format currency
|
||||||
|
const formatCurrency = (amount: number) => {
|
||||||
|
return new Intl.NumberFormat('id-ID', {
|
||||||
|
style: 'currency',
|
||||||
|
currency: 'IDR',
|
||||||
|
minimumFractionDigits: 0
|
||||||
|
}).format(amount)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Column Definitions
|
||||||
|
const columnHelper = createColumnHelper<PurchaseOrderTypeWithAction>()
|
||||||
|
|
||||||
|
const PurchaseOrderListTable = () => {
|
||||||
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
|
// States
|
||||||
|
const [addPOOpen, setAddPOOpen] = useState(false)
|
||||||
|
const [rowSelection, setRowSelection] = useState({})
|
||||||
|
const [currentPage, setCurrentPage] = useState(0)
|
||||||
|
const [pageSize, setPageSize] = useState(10)
|
||||||
|
const [openConfirm, setOpenConfirm] = useState(false)
|
||||||
|
const [poId, setPOId] = useState('')
|
||||||
|
const [search, setSearch] = useState('')
|
||||||
|
const [statusFilter, setStatusFilter] = useState<string>('Semua')
|
||||||
|
const [filteredData, setFilteredData] = useState<PurchaseOrderType[]>(purchaseOrdersData)
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
const { lang: locale } = useParams()
|
||||||
|
|
||||||
|
// Filter data based on search and status
|
||||||
|
useEffect(() => {
|
||||||
|
let filtered = purchaseOrdersData
|
||||||
|
|
||||||
|
// Filter by search
|
||||||
|
if (search) {
|
||||||
|
filtered = filtered.filter(
|
||||||
|
po =>
|
||||||
|
po.number.toLowerCase().includes(search.toLowerCase()) ||
|
||||||
|
po.vendorName.toLowerCase().includes(search.toLowerCase()) ||
|
||||||
|
po.vendorCompany.toLowerCase().includes(search.toLowerCase()) ||
|
||||||
|
po.status.toLowerCase().includes(search.toLowerCase())
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter by status
|
||||||
|
if (statusFilter !== 'Semua') {
|
||||||
|
filtered = filtered.filter(po => po.status === statusFilter)
|
||||||
|
}
|
||||||
|
|
||||||
|
setFilteredData(filtered)
|
||||||
|
setCurrentPage(0)
|
||||||
|
}, [search, statusFilter])
|
||||||
|
|
||||||
|
const totalCount = filteredData.length
|
||||||
|
const paginatedData = useMemo(() => {
|
||||||
|
const startIndex = currentPage * pageSize
|
||||||
|
return filteredData.slice(startIndex, startIndex + pageSize)
|
||||||
|
}, [filteredData, currentPage, pageSize])
|
||||||
|
|
||||||
|
const handlePageChange = useCallback((event: unknown, newPage: number) => {
|
||||||
|
setCurrentPage(newPage)
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
const handlePageSizeChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
const newPageSize = parseInt(event.target.value, 10)
|
||||||
|
setPageSize(newPageSize)
|
||||||
|
setCurrentPage(0)
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
const handleDelete = () => {
|
||||||
|
setOpenConfirm(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
const handlePOClick = (poId: string) => {
|
||||||
|
console.log('Navigasi ke detail PO:', poId)
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleStatusFilter = (status: string) => {
|
||||||
|
setStatusFilter(status)
|
||||||
|
}
|
||||||
|
|
||||||
|
const columns = useMemo<ColumnDef<PurchaseOrderTypeWithAction, any>[]>(
|
||||||
|
() => [
|
||||||
|
{
|
||||||
|
id: 'select',
|
||||||
|
header: ({ table }) => (
|
||||||
|
<Checkbox
|
||||||
|
{...{
|
||||||
|
checked: table.getIsAllRowsSelected(),
|
||||||
|
indeterminate: table.getIsSomeRowsSelected(),
|
||||||
|
onChange: table.getToggleAllRowsSelectedHandler()
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<Checkbox
|
||||||
|
{...{
|
||||||
|
checked: row.getIsSelected(),
|
||||||
|
disabled: !row.getCanSelect(),
|
||||||
|
indeterminate: row.getIsSomeSelected(),
|
||||||
|
onChange: row.getToggleSelectedHandler()
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
columnHelper.accessor('number', {
|
||||||
|
header: 'Nomor PO',
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<Button
|
||||||
|
variant='text'
|
||||||
|
color='primary'
|
||||||
|
className='p-0 min-w-0 font-medium normal-case justify-start'
|
||||||
|
onClick={() => handlePOClick(row.original.id.toString())}
|
||||||
|
sx={{
|
||||||
|
textTransform: 'none',
|
||||||
|
fontWeight: 500,
|
||||||
|
'&:hover': {
|
||||||
|
textDecoration: 'underline',
|
||||||
|
backgroundColor: 'transparent'
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{row.original.number}
|
||||||
|
</Button>
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
columnHelper.accessor('vendorName', {
|
||||||
|
header: 'Vendor',
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className='flex flex-col'>
|
||||||
|
<Typography color='text.primary' className='font-medium'>
|
||||||
|
{row.original.vendorName}
|
||||||
|
</Typography>
|
||||||
|
<Typography variant='body2' color='text.secondary'>
|
||||||
|
{row.original.vendorCompany}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
columnHelper.accessor('reference', {
|
||||||
|
header: 'Referensi',
|
||||||
|
cell: ({ row }) => <Typography color='text.secondary'>{row.original.reference || '-'}</Typography>
|
||||||
|
}),
|
||||||
|
columnHelper.accessor('date', {
|
||||||
|
header: 'Tanggal',
|
||||||
|
cell: ({ row }) => <Typography>{row.original.date}</Typography>
|
||||||
|
}),
|
||||||
|
columnHelper.accessor('dueDate', {
|
||||||
|
header: 'Tanggal Jatuh Tempo',
|
||||||
|
cell: ({ row }) => <Typography>{row.original.dueDate}</Typography>
|
||||||
|
}),
|
||||||
|
columnHelper.accessor('status', {
|
||||||
|
header: 'Status',
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className='flex items-center gap-3'>
|
||||||
|
<Chip
|
||||||
|
variant='tonal'
|
||||||
|
label={row.original.status}
|
||||||
|
size='small'
|
||||||
|
color={getStatusColor(row.original.status) as any}
|
||||||
|
className='capitalize'
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
columnHelper.accessor('total', {
|
||||||
|
header: 'Total',
|
||||||
|
cell: ({ row }) => <Typography className='font-medium'>{formatCurrency(row.original.total)}</Typography>
|
||||||
|
})
|
||||||
|
],
|
||||||
|
[]
|
||||||
|
)
|
||||||
|
|
||||||
|
const table = useReactTable({
|
||||||
|
data: paginatedData as PurchaseOrderType[],
|
||||||
|
columns,
|
||||||
|
filterFns: {
|
||||||
|
fuzzy: fuzzyFilter
|
||||||
|
},
|
||||||
|
state: {
|
||||||
|
rowSelection,
|
||||||
|
pagination: {
|
||||||
|
pageIndex: currentPage,
|
||||||
|
pageSize
|
||||||
|
}
|
||||||
|
},
|
||||||
|
enableRowSelection: true,
|
||||||
|
onRowSelectionChange: setRowSelection,
|
||||||
|
getCoreRowModel: getCoreRowModel(),
|
||||||
|
manualPagination: true,
|
||||||
|
pageCount: Math.ceil(totalCount / pageSize)
|
||||||
|
})
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Card>
|
||||||
|
{/* Filter Status Tabs */}
|
||||||
|
<div className='p-6 border-bs'>
|
||||||
|
<div className='flex flex-wrap gap-2'>
|
||||||
|
{['Semua', 'Draft', 'Disetujui', 'Dikirim Sebagian', 'Selesai', 'Lainnya'].map(status => (
|
||||||
|
<Button
|
||||||
|
key={status}
|
||||||
|
variant={statusFilter === status ? 'contained' : 'outlined'}
|
||||||
|
color={statusFilter === status ? 'primary' : 'inherit'}
|
||||||
|
onClick={() => handleStatusFilter(status)}
|
||||||
|
size='small'
|
||||||
|
className='rounded-lg'
|
||||||
|
sx={{
|
||||||
|
textTransform: 'none',
|
||||||
|
fontWeight: statusFilter === status ? 600 : 400,
|
||||||
|
borderRadius: '8px',
|
||||||
|
...(statusFilter !== status && {
|
||||||
|
borderColor: '#e0e0e0',
|
||||||
|
color: '#666'
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{status}
|
||||||
|
</Button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className='flex justify-between flex-col items-start md:flex-row md:items-center p-6 border-bs gap-4'>
|
||||||
|
<DebouncedInput
|
||||||
|
value={search}
|
||||||
|
onChange={value => setSearch(value as string)}
|
||||||
|
placeholder='Cari Purchase Order'
|
||||||
|
className='max-sm:is-full'
|
||||||
|
/>
|
||||||
|
<div className='flex flex-col sm:flex-row max-sm:is-full items-start sm:items-center gap-4'>
|
||||||
|
<CustomTextField
|
||||||
|
select
|
||||||
|
value={pageSize}
|
||||||
|
onChange={handlePageSizeChange}
|
||||||
|
className='max-sm:is-full sm:is-[70px]'
|
||||||
|
>
|
||||||
|
<MenuItem value={10}>10</MenuItem>
|
||||||
|
<MenuItem value={25}>25</MenuItem>
|
||||||
|
<MenuItem value={50}>50</MenuItem>
|
||||||
|
</CustomTextField>
|
||||||
|
<Button
|
||||||
|
color='secondary'
|
||||||
|
variant='tonal'
|
||||||
|
startIcon={<i className='tabler-upload' />}
|
||||||
|
className='max-sm:is-full'
|
||||||
|
>
|
||||||
|
Ekspor
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant='contained'
|
||||||
|
startIcon={<i className='tabler-plus' />}
|
||||||
|
onClick={() => setAddPOOpen(!addPOOpen)}
|
||||||
|
className='max-sm:is-full'
|
||||||
|
>
|
||||||
|
Tambah PO Baru
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className='overflow-x-auto'>
|
||||||
|
<table className={tableStyles.table}>
|
||||||
|
<thead>
|
||||||
|
{table.getHeaderGroups().map(headerGroup => (
|
||||||
|
<tr key={headerGroup.id}>
|
||||||
|
{headerGroup.headers.map(header => (
|
||||||
|
<th key={header.id}>
|
||||||
|
{header.isPlaceholder ? null : (
|
||||||
|
<>
|
||||||
|
<div
|
||||||
|
className={classnames({
|
||||||
|
'flex items-center': header.column.getIsSorted(),
|
||||||
|
'cursor-pointer select-none': header.column.getCanSort()
|
||||||
|
})}
|
||||||
|
onClick={header.column.getToggleSortingHandler()}
|
||||||
|
>
|
||||||
|
{flexRender(header.column.columnDef.header, header.getContext())}
|
||||||
|
{{
|
||||||
|
asc: <i className='tabler-chevron-up text-xl' />,
|
||||||
|
desc: <i className='tabler-chevron-down text-xl' />
|
||||||
|
}[header.column.getIsSorted() as 'asc' | 'desc'] ?? null}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</th>
|
||||||
|
))}
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</thead>
|
||||||
|
{filteredData.length === 0 ? (
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td colSpan={table.getVisibleFlatColumns().length} className='text-center'>
|
||||||
|
Tidak ada data tersedia
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
) : (
|
||||||
|
<tbody>
|
||||||
|
{table.getRowModel().rows.map(row => {
|
||||||
|
return (
|
||||||
|
<tr key={row.id} className={classnames({ selected: row.getIsSelected() })}>
|
||||||
|
{row.getVisibleCells().map(cell => (
|
||||||
|
<td key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</td>
|
||||||
|
))}
|
||||||
|
</tr>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</tbody>
|
||||||
|
)}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<TablePagination
|
||||||
|
component={() => (
|
||||||
|
<TablePaginationComponent
|
||||||
|
pageIndex={currentPage}
|
||||||
|
pageSize={pageSize}
|
||||||
|
totalCount={totalCount}
|
||||||
|
onPageChange={handlePageChange}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
count={totalCount}
|
||||||
|
rowsPerPage={pageSize}
|
||||||
|
page={currentPage}
|
||||||
|
onPageChange={handlePageChange}
|
||||||
|
onRowsPerPageChange={handlePageSizeChange}
|
||||||
|
rowsPerPageOptions={[10, 25, 50]}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PurchaseOrderListTable
|
||||||
19
src/views/apps/purchase/purchase-orders/list/index.tsx
Normal file
19
src/views/apps/purchase/purchase-orders/list/index.tsx
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// MUI Imports
|
||||||
|
import Grid from '@mui/material/Grid2'
|
||||||
|
|
||||||
|
// Type Imports
|
||||||
|
|
||||||
|
// Component Imports
|
||||||
|
import PurchaseOrderListTable from './PurchaseOrderListTable'
|
||||||
|
|
||||||
|
const PurchaseOrderList = () => {
|
||||||
|
return (
|
||||||
|
<Grid container spacing={6}>
|
||||||
|
<Grid size={{ xs: 12 }}>
|
||||||
|
<PurchaseOrderListTable />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PurchaseOrderList
|
||||||
@ -0,0 +1,187 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
// React Imports
|
||||||
|
import { useState } from 'react'
|
||||||
|
|
||||||
|
// Next Imports
|
||||||
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
|
// MUI Imports
|
||||||
|
import Card from '@mui/material/Card'
|
||||||
|
import CardHeader from '@mui/material/CardHeader'
|
||||||
|
import CardContent from '@mui/material/CardContent'
|
||||||
|
import Button from '@mui/material/Button'
|
||||||
|
import ButtonGroup from '@mui/material/ButtonGroup'
|
||||||
|
import Table from '@mui/material/Table'
|
||||||
|
import TableBody from '@mui/material/TableBody'
|
||||||
|
import TableCell from '@mui/material/TableCell'
|
||||||
|
import TableContainer from '@mui/material/TableContainer'
|
||||||
|
import TableHead from '@mui/material/TableHead'
|
||||||
|
import TableRow from '@mui/material/TableRow'
|
||||||
|
import TableFooter from '@mui/material/TableFooter'
|
||||||
|
import Typography from '@mui/material/Typography'
|
||||||
|
|
||||||
|
// Third Party Imports
|
||||||
|
import type { ApexOptions } from 'apexcharts'
|
||||||
|
|
||||||
|
// Components Imports
|
||||||
|
import OptionMenu from '@core/components/option-menu'
|
||||||
|
|
||||||
|
// Styled Component Imports
|
||||||
|
const AppReactApexCharts = dynamic(() => import('@/libs/styles/AppReactApexCharts'))
|
||||||
|
|
||||||
|
// Data
|
||||||
|
const customerData = [
|
||||||
|
{ pelanggan: 'Mumpuni Imam Rajata...', perusahaan: 'Fa Hassanah', nilai: 14117300 },
|
||||||
|
{ pelanggan: 'Balangga Saefullah M...', perusahaan: 'CV Siregar Prasetya Tbk', nilai: 12520640 },
|
||||||
|
{ pelanggan: 'Jais Mursita Adrians...', perusahaan: 'UD Sinaga Waluyo', nilai: 12174120 },
|
||||||
|
{ pelanggan: 'Paramita Wijayanti M...', perusahaan: 'PD Waluyo Yuniar', nilai: 11001060 },
|
||||||
|
{ pelanggan: 'Putri Puji Pertiwi S...', perusahaan: 'CV Wahyudin Tbk', nilai: 9175560 },
|
||||||
|
{ pelanggan: 'Lainnya', perusahaan: '', nilai: 63285770 }
|
||||||
|
]
|
||||||
|
|
||||||
|
const totalNilai = customerData.reduce((sum, item) => sum + item.nilai, 0)
|
||||||
|
|
||||||
|
// Chart series and colors
|
||||||
|
const series = customerData.map(item => item.nilai)
|
||||||
|
const colors = ['#FF6B9D', '#FFD93D', '#6BCF7F', '#4D96FF', '#B39DDB', '#E91E63']
|
||||||
|
|
||||||
|
const SalesCustomerSalesChart = () => {
|
||||||
|
const [activeView, setActiveView] = useState<'chart' | 'table'>('chart')
|
||||||
|
|
||||||
|
const options: ApexOptions = {
|
||||||
|
chart: {
|
||||||
|
type: 'donut'
|
||||||
|
},
|
||||||
|
labels: customerData.map(item => item.pelanggan),
|
||||||
|
colors: colors,
|
||||||
|
legend: {
|
||||||
|
position: 'bottom',
|
||||||
|
horizontalAlign: 'center',
|
||||||
|
fontSize: '14px',
|
||||||
|
markers: {
|
||||||
|
width: 12,
|
||||||
|
height: 12,
|
||||||
|
radius: 2
|
||||||
|
},
|
||||||
|
itemMargin: {
|
||||||
|
horizontal: 15,
|
||||||
|
vertical: 5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plotOptions: {
|
||||||
|
pie: {
|
||||||
|
donut: {
|
||||||
|
size: '70%'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataLabels: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
y: {
|
||||||
|
formatter: function (val) {
|
||||||
|
return 'Rp ' + val.toLocaleString('id-ID')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
stroke: {
|
||||||
|
width: 2,
|
||||||
|
colors: ['#fff']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatCurrency = (amount: number): string => {
|
||||||
|
return amount.toLocaleString('id-ID')
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card className='mt-5'>
|
||||||
|
<CardHeader
|
||||||
|
title='Penjualan Per Pelanggan Tahun Ini'
|
||||||
|
action={
|
||||||
|
<div className='flex items-center gap-2'>
|
||||||
|
<div className='w-4 h-4 bg-gray-300 rounded cursor-pointer'></div>
|
||||||
|
<OptionMenu options={['View More', 'Delete']} />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<CardContent>
|
||||||
|
{/* Content based on active view */}
|
||||||
|
{activeView === 'chart' ? (
|
||||||
|
// Donut Chart View (Slide 1)
|
||||||
|
<div className='flex flex-col items-center'>
|
||||||
|
<AppReactApexCharts
|
||||||
|
id='customer-sales-donut'
|
||||||
|
type='donut'
|
||||||
|
height={350}
|
||||||
|
width='100%'
|
||||||
|
series={series}
|
||||||
|
options={options}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
// Table View (Slide 2)
|
||||||
|
<TableContainer>
|
||||||
|
<Table>
|
||||||
|
<TableHead>
|
||||||
|
<TableRow>
|
||||||
|
<TableCell sx={{ fontWeight: 600 }}>Pelanggan</TableCell>
|
||||||
|
<TableCell align='right' sx={{ fontWeight: 600 }}>
|
||||||
|
Nilai
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
</TableHead>
|
||||||
|
<TableBody>
|
||||||
|
{customerData.map((row, index) => (
|
||||||
|
<TableRow key={index}>
|
||||||
|
<TableCell>
|
||||||
|
<div>
|
||||||
|
<Typography variant='body2' sx={{ fontWeight: 500 }}>
|
||||||
|
{row.pelanggan}
|
||||||
|
</Typography>
|
||||||
|
{row.perusahaan && (
|
||||||
|
<Typography variant='caption' color='text.secondary'>
|
||||||
|
{row.perusahaan}
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align='right'>{formatCurrency(row.nilai)}</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
</TableBody>
|
||||||
|
<TableFooter>
|
||||||
|
<TableRow sx={{ backgroundColor: '#f5f5f5' }}>
|
||||||
|
<TableCell sx={{ fontWeight: 700, fontSize: '14px' }}>Total</TableCell>
|
||||||
|
<TableCell align='right' sx={{ fontWeight: 700, fontSize: '14px' }}>
|
||||||
|
{formatCurrency(totalNilai)}
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
</TableFooter>
|
||||||
|
</Table>
|
||||||
|
</TableContainer>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Two dot indicators at bottom */}
|
||||||
|
<div className='flex justify-center items-center gap-2 mt-6'>
|
||||||
|
<div
|
||||||
|
className={`w-3 h-3 rounded-full cursor-pointer transition-colors ${
|
||||||
|
activeView === 'chart' ? 'bg-blue-500' : 'bg-gray-300'
|
||||||
|
}`}
|
||||||
|
onClick={() => setActiveView('chart')}
|
||||||
|
></div>
|
||||||
|
<div
|
||||||
|
className={`w-3 h-3 rounded-full cursor-pointer transition-colors ${
|
||||||
|
activeView === 'table' ? 'bg-blue-500' : 'bg-gray-300'
|
||||||
|
}`}
|
||||||
|
onClick={() => setActiveView('table')}
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SalesCustomerSalesChart
|
||||||
@ -0,0 +1,104 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
// Next Imports
|
||||||
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
|
// MUI Imports
|
||||||
|
import Card from '@mui/material/Card'
|
||||||
|
import CardHeader from '@mui/material/CardHeader'
|
||||||
|
import CardContent from '@mui/material/CardContent'
|
||||||
|
|
||||||
|
// Third Party Imports
|
||||||
|
import type { ApexOptions } from 'apexcharts'
|
||||||
|
|
||||||
|
// Components Imports
|
||||||
|
import OptionMenu from '@core/components/option-menu'
|
||||||
|
|
||||||
|
// Styled Component Imports
|
||||||
|
const AppReactApexCharts = dynamic(() => import('@/libs/styles/AppReactApexCharts'))
|
||||||
|
|
||||||
|
// Vars
|
||||||
|
const series = [52.2]
|
||||||
|
|
||||||
|
const SalesPaymentRatioGaugeChart = () => {
|
||||||
|
const options: ApexOptions = {
|
||||||
|
chart: {
|
||||||
|
type: 'radialBar',
|
||||||
|
sparkline: {
|
||||||
|
enabled: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plotOptions: {
|
||||||
|
radialBar: {
|
||||||
|
startAngle: -90,
|
||||||
|
endAngle: 90,
|
||||||
|
track: {
|
||||||
|
background: '#e7e7e7',
|
||||||
|
strokeWidth: '97%',
|
||||||
|
margin: 5,
|
||||||
|
dropShadow: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
hollow: {
|
||||||
|
margin: 15,
|
||||||
|
size: '70%'
|
||||||
|
},
|
||||||
|
dataLabels: {
|
||||||
|
name: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
offsetY: -10,
|
||||||
|
fontSize: '32px',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
color: '#1f2937',
|
||||||
|
formatter: function (val) {
|
||||||
|
return val + '%'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
padding: {
|
||||||
|
top: -10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fill: {
|
||||||
|
type: 'gradient',
|
||||||
|
gradient: {
|
||||||
|
shade: 'light',
|
||||||
|
shadeIntensity: 0.4,
|
||||||
|
inverseColors: false,
|
||||||
|
opacityFrom: 1,
|
||||||
|
opacityTo: 1,
|
||||||
|
stops: [0, 50, 53, 91]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
colors: ['#3b82f6'],
|
||||||
|
stroke: {
|
||||||
|
dashArray: 4
|
||||||
|
},
|
||||||
|
labels: ['Rasio Lunas']
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card>
|
||||||
|
<CardHeader title='Rasio Lunas' action={<OptionMenu options={['View More', 'Delete']} />} />
|
||||||
|
<CardContent className='flex flex-col items-center pb-6'>
|
||||||
|
<AppReactApexCharts
|
||||||
|
id='rasio-lunas-gauge'
|
||||||
|
type='radialBar'
|
||||||
|
height={280}
|
||||||
|
width='100%'
|
||||||
|
series={series}
|
||||||
|
options={options}
|
||||||
|
/>
|
||||||
|
<div className='text-sm text-gray-500 text-center mt-4 max-w-xs'>Tagihan lunas vs total Tagihan tahun ini</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SalesPaymentRatioGaugeChart
|
||||||
@ -0,0 +1,218 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
// React Imports
|
||||||
|
import { useState } from 'react'
|
||||||
|
|
||||||
|
// Next Imports
|
||||||
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
|
// MUI Imports
|
||||||
|
import Card from '@mui/material/Card'
|
||||||
|
import CardHeader from '@mui/material/CardHeader'
|
||||||
|
import CardContent from '@mui/material/CardContent'
|
||||||
|
import Button from '@mui/material/Button'
|
||||||
|
import ButtonGroup from '@mui/material/ButtonGroup'
|
||||||
|
import Table from '@mui/material/Table'
|
||||||
|
import TableBody from '@mui/material/TableBody'
|
||||||
|
import TableCell from '@mui/material/TableCell'
|
||||||
|
import TableContainer from '@mui/material/TableContainer'
|
||||||
|
import TableHead from '@mui/material/TableHead'
|
||||||
|
import TableRow from '@mui/material/TableRow'
|
||||||
|
import TableFooter from '@mui/material/TableFooter'
|
||||||
|
import Typography from '@mui/material/Typography'
|
||||||
|
|
||||||
|
// Third Party Imports
|
||||||
|
import type { ApexOptions } from 'apexcharts'
|
||||||
|
|
||||||
|
// Components Imports
|
||||||
|
import OptionMenu from '@core/components/option-menu'
|
||||||
|
|
||||||
|
// Styled Component Imports
|
||||||
|
const AppReactApexCharts = dynamic(() => import('@/libs/styles/AppReactApexCharts'))
|
||||||
|
|
||||||
|
// Data
|
||||||
|
const productData = [
|
||||||
|
{ kategori: 'Dress', jumlah: 174, nilai: 70629279 },
|
||||||
|
{ kategori: 'Tshirt', jumlah: 163, nilai: 31667892 },
|
||||||
|
{ kategori: 'Shoes', jumlah: 27, nilai: 13473000 },
|
||||||
|
{ kategori: 'Misc', jumlah: 128, nilai: 123937 }
|
||||||
|
]
|
||||||
|
|
||||||
|
const totalJumlah = productData.reduce((sum, item) => sum + item.jumlah, 0)
|
||||||
|
const totalNilai = productData.reduce((sum, item) => sum + item.nilai, 0)
|
||||||
|
|
||||||
|
// Chart series and colors
|
||||||
|
const series = productData.map(item => item.nilai)
|
||||||
|
const colors = ['#FF6B9D', '#FFD93D', '#6BCF7F', '#4D96FF']
|
||||||
|
|
||||||
|
const SalesProductSalesChart = () => {
|
||||||
|
const [activeView, setActiveView] = useState<'chart' | 'table'>('chart')
|
||||||
|
|
||||||
|
const options: ApexOptions = {
|
||||||
|
chart: {
|
||||||
|
type: 'donut'
|
||||||
|
},
|
||||||
|
labels: productData.map(item => item.kategori),
|
||||||
|
colors: colors,
|
||||||
|
legend: {
|
||||||
|
position: 'bottom',
|
||||||
|
horizontalAlign: 'center',
|
||||||
|
fontSize: '14px',
|
||||||
|
markers: {
|
||||||
|
width: 12,
|
||||||
|
height: 12,
|
||||||
|
radius: 2
|
||||||
|
},
|
||||||
|
itemMargin: {
|
||||||
|
horizontal: 15,
|
||||||
|
vertical: 5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plotOptions: {
|
||||||
|
pie: {
|
||||||
|
donut: {
|
||||||
|
size: '70%'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataLabels: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
y: {
|
||||||
|
formatter: function (val) {
|
||||||
|
return 'Rp ' + val.toLocaleString('id-ID')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
stroke: {
|
||||||
|
width: 2,
|
||||||
|
colors: ['#fff']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatCurrency = (amount: number): string => {
|
||||||
|
return amount.toLocaleString('id-ID')
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card className='mt-5'>
|
||||||
|
<CardHeader
|
||||||
|
title='Penjualan Per Produk Tahun Ini'
|
||||||
|
action={
|
||||||
|
<div className='flex items-center gap-2'>
|
||||||
|
<div className='w-4 h-4 bg-gray-300 rounded cursor-pointer'></div>
|
||||||
|
<OptionMenu options={['View More', 'Delete']} />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<CardContent>
|
||||||
|
{/* Toggle Buttons */}
|
||||||
|
<div className='flex justify-center mb-6'>
|
||||||
|
<ButtonGroup size='small'>
|
||||||
|
<Button
|
||||||
|
variant={activeView === 'chart' ? 'contained' : 'outlined'}
|
||||||
|
onClick={() => setActiveView('chart')}
|
||||||
|
sx={{
|
||||||
|
minWidth: '120px',
|
||||||
|
backgroundColor: activeView === 'chart' ? '#36175e' : 'transparent',
|
||||||
|
color: activeView === 'chart' ? 'white' : '#36175e',
|
||||||
|
borderColor: '#36175e',
|
||||||
|
'&:hover': {
|
||||||
|
backgroundColor: activeView === 'chart' ? '#36175e' : 'rgba(25, 118, 210, 0.04)'
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Jenis Produk
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant={activeView === 'table' ? 'contained' : 'outlined'}
|
||||||
|
onClick={() => setActiveView('table')}
|
||||||
|
sx={{
|
||||||
|
minWidth: '120px',
|
||||||
|
backgroundColor: activeView === 'table' ? '#36175e' : 'transparent',
|
||||||
|
color: activeView === 'table' ? 'white' : '#36175e',
|
||||||
|
borderColor: '#36175e',
|
||||||
|
'&:hover': {
|
||||||
|
backgroundColor: activeView === 'table' ? '#36175e' : 'rgba(25, 118, 210, 0.04)'
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Kategori
|
||||||
|
</Button>
|
||||||
|
</ButtonGroup>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Content based on active view */}
|
||||||
|
{activeView === 'chart' ? (
|
||||||
|
// Donut Chart View (Slide 1)
|
||||||
|
<div className='flex flex-col items-center'>
|
||||||
|
<AppReactApexCharts
|
||||||
|
id='product-sales-donut'
|
||||||
|
type='donut'
|
||||||
|
height={350}
|
||||||
|
width='100%'
|
||||||
|
series={series}
|
||||||
|
options={options}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
// Table View (Slide 2)
|
||||||
|
<TableContainer>
|
||||||
|
<Table>
|
||||||
|
<TableHead>
|
||||||
|
<TableRow>
|
||||||
|
<TableCell sx={{ fontWeight: 600 }}>Kategori</TableCell>
|
||||||
|
<TableCell align='center' sx={{ fontWeight: 600 }}>
|
||||||
|
Jml
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align='right' sx={{ fontWeight: 600 }}>
|
||||||
|
Nilai
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
</TableHead>
|
||||||
|
<TableBody>
|
||||||
|
{productData.map((row, index) => (
|
||||||
|
<TableRow key={index}>
|
||||||
|
<TableCell>{row.kategori}</TableCell>
|
||||||
|
<TableCell align='center'>{row.jumlah}</TableCell>
|
||||||
|
<TableCell align='right'>{formatCurrency(row.nilai)}</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
</TableBody>
|
||||||
|
<TableFooter>
|
||||||
|
<TableRow sx={{ backgroundColor: '#f5f5f5' }}>
|
||||||
|
<TableCell sx={{ fontWeight: 700, fontSize: '14px' }}>Total</TableCell>
|
||||||
|
<TableCell align='center' sx={{ fontWeight: 700, fontSize: '14px' }}>
|
||||||
|
{totalJumlah}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align='right' sx={{ fontWeight: 700, fontSize: '14px' }}>
|
||||||
|
{formatCurrency(totalNilai)}
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
</TableFooter>
|
||||||
|
</Table>
|
||||||
|
</TableContainer>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Two dot indicators at bottom */}
|
||||||
|
<div className='flex justify-center items-center gap-2 mt-6'>
|
||||||
|
<div
|
||||||
|
className={`w-3 h-3 rounded-full cursor-pointer transition-colors ${
|
||||||
|
activeView === 'chart' ? 'bg-primary' : 'bg-gray-300'
|
||||||
|
}`}
|
||||||
|
onClick={() => setActiveView('chart')}
|
||||||
|
></div>
|
||||||
|
<div
|
||||||
|
className={`w-3 h-3 rounded-full cursor-pointer transition-colors ${
|
||||||
|
activeView === 'table' ? 'bg-primary' : 'bg-gray-300'
|
||||||
|
}`}
|
||||||
|
onClick={() => setActiveView('table')}
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SalesProductSalesChart
|
||||||
15
src/views/apps/sales/overview/overview-left/index.tsx
Normal file
15
src/views/apps/sales/overview/overview-left/index.tsx
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import SalesCustomerSalesChart from './SalesCustomerSalesChart'
|
||||||
|
import SalesPaymentRatioGaugeChart from './SalesPaymentRatioGaugeChart'
|
||||||
|
import SalesProductSalesChart from './SalesProductChart'
|
||||||
|
|
||||||
|
const SalesOverviewLeft = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<SalesPaymentRatioGaugeChart />
|
||||||
|
<SalesProductSalesChart />
|
||||||
|
<SalesCustomerSalesChart />
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SalesOverviewLeft
|
||||||
@ -0,0 +1,157 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
// Next Imports
|
||||||
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
|
// MUI Imports
|
||||||
|
import Card from '@mui/material/Card'
|
||||||
|
import CardHeader from '@mui/material/CardHeader'
|
||||||
|
import CardContent from '@mui/material/CardContent'
|
||||||
|
|
||||||
|
// Third Party Imports
|
||||||
|
import type { ApexOptions } from 'apexcharts'
|
||||||
|
|
||||||
|
// Components Imports
|
||||||
|
import OptionMenu from '@core/components/option-menu'
|
||||||
|
|
||||||
|
// Styled Component Imports
|
||||||
|
const AppReactApexCharts = dynamic(() => import('@/libs/styles/AppReactApexCharts'))
|
||||||
|
|
||||||
|
// Styles Imports
|
||||||
|
import './styles.css'
|
||||||
|
|
||||||
|
// Vars
|
||||||
|
const colors = {
|
||||||
|
tagihan: '#28C76F',
|
||||||
|
pembayaran: '#EA5455'
|
||||||
|
}
|
||||||
|
|
||||||
|
const labelColor = 'var(--mui-palette-text-disabled)'
|
||||||
|
const bodyColor = 'var(--mui-palette-text-secondary)'
|
||||||
|
const borderColor = 'var(--mui-palette-divider)'
|
||||||
|
|
||||||
|
const series = [
|
||||||
|
{
|
||||||
|
name: 'Tagihan',
|
||||||
|
type: 'column',
|
||||||
|
data: [1250, 1180, 1350, 1450, 1200, 1520, 1380, 1150, 1650, 1400, 1290, 1700]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Pembayaran',
|
||||||
|
type: 'column',
|
||||||
|
data: [950, 880, 1050, 1150, 900, 1220, 1080, 850, 1350, 1100, 990, 1400]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const SalesBillPaymentChart = () => {
|
||||||
|
const options: ApexOptions = {
|
||||||
|
chart: {
|
||||||
|
parentHeightOffset: 0,
|
||||||
|
stacked: false,
|
||||||
|
toolbar: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
zoom: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
enabled: true,
|
||||||
|
y: {
|
||||||
|
formatter: function (val) {
|
||||||
|
return 'Rp ' + val.toLocaleString('id-ID') + '.000'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plotOptions: {
|
||||||
|
bar: {
|
||||||
|
horizontal: false,
|
||||||
|
columnWidth: '60%',
|
||||||
|
borderRadius: 4
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataLabels: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
xaxis: {
|
||||||
|
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agu', 'Sep', 'Okt', 'Nov', 'Des'],
|
||||||
|
labels: {
|
||||||
|
style: {
|
||||||
|
colors: labelColor,
|
||||||
|
fontSize: '13px',
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
fontWeight: 400
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisBorder: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
axisTicks: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yaxis: {
|
||||||
|
tickAmount: 5,
|
||||||
|
max: 1800,
|
||||||
|
min: 0,
|
||||||
|
labels: {
|
||||||
|
style: {
|
||||||
|
colors: labelColor,
|
||||||
|
fontSize: '13px',
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
fontWeight: 400
|
||||||
|
},
|
||||||
|
formatter(val: number) {
|
||||||
|
return 'Rp ' + val + 'rb'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
markers: {
|
||||||
|
width: 8,
|
||||||
|
height: 8,
|
||||||
|
offsetX: -3,
|
||||||
|
radius: 12
|
||||||
|
},
|
||||||
|
height: 33,
|
||||||
|
offsetY: 10,
|
||||||
|
itemMargin: {
|
||||||
|
horizontal: 10,
|
||||||
|
vertical: 0
|
||||||
|
},
|
||||||
|
fontSize: '13px',
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
fontWeight: 400,
|
||||||
|
labels: {
|
||||||
|
colors: bodyColor,
|
||||||
|
useSeriesColors: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
borderColor,
|
||||||
|
strokeDashArray: 6
|
||||||
|
},
|
||||||
|
colors: [colors.tagihan, colors.pembayaran],
|
||||||
|
fill: {
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card className='mt-5'>
|
||||||
|
<CardHeader title='Tagihan & Pembayaran' action={<OptionMenu options={['View More', 'Delete']} />} />
|
||||||
|
<CardContent>
|
||||||
|
<AppReactApexCharts
|
||||||
|
id='tagihan-pembayaran'
|
||||||
|
type='bar'
|
||||||
|
height={360}
|
||||||
|
width='100%'
|
||||||
|
series={series}
|
||||||
|
options={options}
|
||||||
|
/>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SalesBillPaymentChart
|
||||||
@ -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: 'PENJUALAN',
|
||||||
|
stats: '122.274.450',
|
||||||
|
avatarIcon: 'tabler-trending-up',
|
||||||
|
avatarColor: 'success',
|
||||||
|
trend: 'positive',
|
||||||
|
trendNumber: '162,3%',
|
||||||
|
subtitle: '46 Tagihan Tahun Ini'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'PEMBAYARAN DITERIMA',
|
||||||
|
stats: '66.742.440',
|
||||||
|
avatarIcon: 'tabler-trending-up',
|
||||||
|
avatarColor: 'success',
|
||||||
|
trend: 'positive',
|
||||||
|
trendNumber: '175,6%',
|
||||||
|
subtitle: '27 Tagihan Tahun Ini'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'MENUNGGU PEMBAYARAN',
|
||||||
|
stats: '55.532.009',
|
||||||
|
avatarIcon: 'tabler-trending-up',
|
||||||
|
avatarColor: 'success',
|
||||||
|
trend: 'positive',
|
||||||
|
trendNumber: '149,6%',
|
||||||
|
subtitle: '22 Tagihan'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'JATUH TEMPO',
|
||||||
|
stats: '48.246.990',
|
||||||
|
avatarIcon: 'tabler-clock-exclamation',
|
||||||
|
avatarColor: 'error',
|
||||||
|
trend: 'negative',
|
||||||
|
trendNumber: '89,9%',
|
||||||
|
subtitle: '16 Tagihan'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const SalesOverviewCards = () => {
|
||||||
|
return (
|
||||||
|
<Grid container spacing={6}>
|
||||||
|
{data.map((item, i) => (
|
||||||
|
<Grid key={i} size={{ xs: 12, sm: 6 }}>
|
||||||
|
<HorizontalWithSubtitle {...item} />
|
||||||
|
</Grid>
|
||||||
|
))}
|
||||||
|
</Grid>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SalesOverviewCards
|
||||||
@ -0,0 +1,152 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
// Next Imports
|
||||||
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
|
// MUI Imports
|
||||||
|
import Card from '@mui/material/Card'
|
||||||
|
import CardHeader from '@mui/material/CardHeader'
|
||||||
|
import CardContent from '@mui/material/CardContent'
|
||||||
|
|
||||||
|
// Third Party Imports
|
||||||
|
import type { ApexOptions } from 'apexcharts'
|
||||||
|
|
||||||
|
// Components Imports
|
||||||
|
import OptionMenu from '@core/components/option-menu'
|
||||||
|
|
||||||
|
// Styled Component Imports
|
||||||
|
const AppReactApexCharts = dynamic(() => import('@/libs/styles/AppReactApexCharts'))
|
||||||
|
|
||||||
|
// Styles Imports
|
||||||
|
import './styles.css'
|
||||||
|
|
||||||
|
// Vars
|
||||||
|
const labelColor = 'var(--mui-palette-text-disabled)'
|
||||||
|
const bodyColor = 'var(--mui-palette-text-secondary)'
|
||||||
|
const borderColor = 'var(--mui-palette-divider)'
|
||||||
|
|
||||||
|
const series = [
|
||||||
|
{
|
||||||
|
name: 'Pembayaran Diterima',
|
||||||
|
data: [0, 0, 0, 0, 0, 67000000]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const SalesPaymentReceivedChart = () => {
|
||||||
|
const options: ApexOptions = {
|
||||||
|
chart: {
|
||||||
|
parentHeightOffset: 0,
|
||||||
|
toolbar: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
zoom: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
stroke: {
|
||||||
|
width: 3,
|
||||||
|
curve: 'smooth'
|
||||||
|
},
|
||||||
|
markers: {
|
||||||
|
size: 6,
|
||||||
|
colors: ['#00CFE8'],
|
||||||
|
strokeColors: '#fff',
|
||||||
|
strokeWidth: 2,
|
||||||
|
hover: {
|
||||||
|
size: 8
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
enabled: true,
|
||||||
|
y: {
|
||||||
|
formatter: function (val) {
|
||||||
|
return 'Rp ' + val.toLocaleString('id-ID')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataLabels: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
xaxis: {
|
||||||
|
categories: ['2020', '2021', '2022', '2023', '2024', '2025'],
|
||||||
|
labels: {
|
||||||
|
style: {
|
||||||
|
colors: labelColor,
|
||||||
|
fontSize: '13px',
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
fontWeight: 400
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisBorder: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
axisTicks: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yaxis: {
|
||||||
|
tickAmount: 7,
|
||||||
|
max: 70000000,
|
||||||
|
min: 0,
|
||||||
|
labels: {
|
||||||
|
style: {
|
||||||
|
colors: labelColor,
|
||||||
|
fontSize: '13px',
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
fontWeight: 400
|
||||||
|
},
|
||||||
|
formatter(val: number) {
|
||||||
|
if (val === 0) return '0'
|
||||||
|
return (val / 1000000).toFixed(0) + '.000.000'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
borderColor,
|
||||||
|
strokeDashArray: 6,
|
||||||
|
xaxis: {
|
||||||
|
lines: {
|
||||||
|
show: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yaxis: {
|
||||||
|
lines: {
|
||||||
|
show: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
colors: ['#00CFE8'],
|
||||||
|
fill: {
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card className='mt-5'>
|
||||||
|
<CardHeader
|
||||||
|
title='Pembayaran Diterima'
|
||||||
|
action={
|
||||||
|
<div className='flex items-center gap-2'>
|
||||||
|
<div className='w-4 h-4 bg-gray-300 rounded cursor-pointer'></div>
|
||||||
|
<OptionMenu options={['View More', 'Delete']} />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<CardContent>
|
||||||
|
<AppReactApexCharts
|
||||||
|
id='pembayaran-diterima'
|
||||||
|
type='line'
|
||||||
|
height={360}
|
||||||
|
width='100%'
|
||||||
|
series={series}
|
||||||
|
options={options}
|
||||||
|
/>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SalesPaymentReceivedChart
|
||||||
@ -0,0 +1,174 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
// Next Imports
|
||||||
|
import dynamic from 'next/dynamic'
|
||||||
|
|
||||||
|
// MUI Imports
|
||||||
|
import Card from '@mui/material/Card'
|
||||||
|
import CardHeader from '@mui/material/CardHeader'
|
||||||
|
import CardContent from '@mui/material/CardContent'
|
||||||
|
|
||||||
|
// Third Party Imports
|
||||||
|
import type { ApexOptions } from 'apexcharts'
|
||||||
|
|
||||||
|
// Components Imports
|
||||||
|
import OptionMenu from '@core/components/option-menu'
|
||||||
|
|
||||||
|
// Styled Component Imports
|
||||||
|
const AppReactApexCharts = dynamic(() => import('@/libs/styles/AppReactApexCharts'))
|
||||||
|
|
||||||
|
// Styles Imports
|
||||||
|
import './styles.css'
|
||||||
|
|
||||||
|
// Vars
|
||||||
|
const colors = ['#EA5455', '#FFB830', '#28C76F', '#00CFE8', '#795548', '#E91E63']
|
||||||
|
|
||||||
|
const labelColor = 'var(--mui-palette-text-disabled)'
|
||||||
|
const bodyColor = 'var(--mui-palette-text-secondary)'
|
||||||
|
const borderColor = 'var(--mui-palette-divider)'
|
||||||
|
|
||||||
|
const series = [
|
||||||
|
{
|
||||||
|
name: '2020',
|
||||||
|
data: [1850]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '2021',
|
||||||
|
data: [2150]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '2022',
|
||||||
|
data: [2450]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '2023',
|
||||||
|
data: [2750]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '2024',
|
||||||
|
data: [3050]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '2025',
|
||||||
|
data: [3350]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const SalesPerPersonChart = () => {
|
||||||
|
const options: ApexOptions = {
|
||||||
|
chart: {
|
||||||
|
parentHeightOffset: 0,
|
||||||
|
toolbar: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
zoom: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
enabled: true,
|
||||||
|
y: {
|
||||||
|
formatter: function (val) {
|
||||||
|
return 'Rp ' + val.toLocaleString('id-ID') + '.000'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plotOptions: {
|
||||||
|
bar: {
|
||||||
|
horizontal: false,
|
||||||
|
columnWidth: '60%',
|
||||||
|
borderRadius: 6,
|
||||||
|
dataLabels: {
|
||||||
|
position: 'top'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataLabels: {
|
||||||
|
enabled: false
|
||||||
|
},
|
||||||
|
xaxis: {
|
||||||
|
categories: ['Jason Marc'],
|
||||||
|
labels: {
|
||||||
|
style: {
|
||||||
|
colors: labelColor,
|
||||||
|
fontSize: '13px',
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
fontWeight: 400
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisBorder: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
axisTicks: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yaxis: {
|
||||||
|
labels: {
|
||||||
|
style: {
|
||||||
|
colors: labelColor,
|
||||||
|
fontSize: '13px',
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
fontWeight: 400
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
markers: {
|
||||||
|
width: 8,
|
||||||
|
height: 8,
|
||||||
|
offsetX: -3,
|
||||||
|
radius: 12
|
||||||
|
},
|
||||||
|
height: 40,
|
||||||
|
offsetY: 10,
|
||||||
|
itemMargin: {
|
||||||
|
horizontal: 10,
|
||||||
|
vertical: 0
|
||||||
|
},
|
||||||
|
fontSize: '13px',
|
||||||
|
fontFamily: 'Public Sans',
|
||||||
|
fontWeight: 400,
|
||||||
|
labels: {
|
||||||
|
colors: bodyColor,
|
||||||
|
useSeriesColors: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
borderColor,
|
||||||
|
strokeDashArray: 6,
|
||||||
|
xaxis: {
|
||||||
|
lines: {
|
||||||
|
show: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yaxis: {
|
||||||
|
lines: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
colors: colors,
|
||||||
|
fill: {
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card className='mt-5'>
|
||||||
|
<CardHeader title='Penjualan per Sales Person' action={<OptionMenu options={['View More', 'Delete']} />} />
|
||||||
|
<CardContent>
|
||||||
|
<AppReactApexCharts
|
||||||
|
id='penjualan-per-sales-person'
|
||||||
|
type='bar'
|
||||||
|
height={360}
|
||||||
|
width='100%'
|
||||||
|
series={series}
|
||||||
|
options={options}
|
||||||
|
/>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SalesPerPersonChart
|
||||||
17
src/views/apps/sales/overview/overview-right/index.tsx
Normal file
17
src/views/apps/sales/overview/overview-right/index.tsx
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import SalesBillPaymentChart from './SalesBillPaymentChart'
|
||||||
|
import SalesOverviewCards from './SalesOverviewCards'
|
||||||
|
import SalesPaymentReceivedChart from './SalesPaymentReceivedChart'
|
||||||
|
import SalesPerPersonChart from './SalesPerPersonChart'
|
||||||
|
|
||||||
|
const SalesOverviewRight = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<SalesOverviewCards />
|
||||||
|
<SalesBillPaymentChart />
|
||||||
|
<SalesPaymentReceivedChart />
|
||||||
|
<SalesPerPersonChart />
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SalesOverviewRight
|
||||||
15
src/views/apps/sales/overview/overview-right/styles.css
Normal file
15
src/views/apps/sales/overview/overview-right/styles.css
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#tagihan-pembayaran .apexcharts-legend .apexcharts-legend-series {
|
||||||
|
border: 1px solid var(--mui-palette-divider);
|
||||||
|
border-radius: var(--mui-shape-borderRadius);
|
||||||
|
block-size: 83%;
|
||||||
|
padding-block: 4px;
|
||||||
|
padding-inline: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#penjualan-per-sales-person .apexcharts-legend .apexcharts-legend-series {
|
||||||
|
border: 1px solid var(--mui-palette-divider);
|
||||||
|
border-radius: var(--mui-shape-borderRadius);
|
||||||
|
block-size: 83%;
|
||||||
|
padding-block: 4px;
|
||||||
|
padding-inline: 16px;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user