diff --git a/src/app/[lang]/(dashboard)/(private)/dashboards/daily-report/page.tsx b/src/app/[lang]/(dashboard)/(private)/dashboards/daily-report/page.tsx index ef07537..fd479ef 100644 --- a/src/app/[lang]/(dashboard)/(private)/dashboards/daily-report/page.tsx +++ b/src/app/[lang]/(dashboard)/(private)/dashboards/daily-report/page.tsx @@ -14,7 +14,7 @@ import ReportHeader from '@/views/dashboards/daily-report/report-header' import React, { useEffect, useRef, useState } from 'react' const DailyPOSReport = () => { - const reportRef = useRef(null) + const reportRef = useRef(null) const [now, setNow] = useState(new Date()) const [selectedDate, setSelectedDate] = useState(new Date()) @@ -22,7 +22,7 @@ const DailyPOSReport = () => { startDate: new Date(), endDate: new Date() }) - const [filterType, setFilterType] = useState('single') // 'single' or 'range' + const [filterType, setFilterType] = useState<'single' | 'range'>('single') // 'single' or 'range' // Use selectedDate for single date filter, or dateRange for range filter const getDateParams = () => { diff --git a/src/app/[lang]/(dashboard)/(private)/dashboards/profit-loss/page.tsx b/src/app/[lang]/(dashboard)/(private)/dashboards/profit-loss/page.tsx index 91fa3a0..1355d80 100644 --- a/src/app/[lang]/(dashboard)/(private)/dashboards/profit-loss/page.tsx +++ b/src/app/[lang]/(dashboard)/(private)/dashboards/profit-loss/page.tsx @@ -1,14 +1,25 @@ 'use client' -import React from 'react' +import React, { useState } from 'react' import { useProfitLossAnalytics } from '../../../../../../services/queries/analytics' -import { formatShortCurrency } from '../../../../../../utils/transform' +import { formatDateDDMMYYYY, formatShortCurrency } from '../../../../../../utils/transform' import MultipleSeries from '../../../../../../views/dashboards/profit-loss/EarningReportWithTabs' import { DailyData, ProfitLossReport } from '../../../../../../types/services/analytic' +import { TextField, Typography, useTheme } from '@mui/material' const DashboardProfitloss = () => { + const theme = useTheme() + + const [filter, setFilter] = useState({ + date_from: new Date().setDate(new Date().getDate() - 30).toString(), + date_to: new Date().toString() + }) + // Sample data - replace with your actual data - const { data: profitData, isLoading } = useProfitLossAnalytics() + const { data: profitData, isLoading } = useProfitLossAnalytics({ + date_from: formatDateDDMMYYYY(filter.date_from), + date_to: formatDateDDMMYYYY(filter.date_to) + }) const formatCurrency = (amount: any) => { return new Intl.NumberFormat('id-ID', { @@ -91,11 +102,45 @@ const DashboardProfitloss = () => { {profitData && (
{/* Header */} -
-

Profit Analysis Dashboard

-

- {formatDate(profitData.date_from)} - {formatDate(profitData.date_to)} -

+
+ + Profit Analysis Dashboard + +
+ {}} + 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 + } + } + }} + /> + - + {}} + 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 + } + } + }} + /> +
{/* Summary Metrics */} diff --git a/src/components/layout/vertical/VerticalMenu.tsx b/src/components/layout/vertical/VerticalMenu.tsx index 2241f37..e235783 100644 --- a/src/components/layout/vertical/VerticalMenu.tsx +++ b/src/components/layout/vertical/VerticalMenu.tsx @@ -92,40 +92,39 @@ const VerticalMenu = ({ dictionary, scrollMenu }: Props) => { }> - {/* {dictionary['navigation'].dashboard} */} - {dictionary['navigation'].list} - + {dictionary['navigation'].list} + {dictionary['navigation'].details} - + {dictionary['navigation'].edit} - {dictionary['navigation'].add} - + {dictionary['navigation'].add} + {dictionary['navigation'].category} - {dictionary['navigation'].units} - + {dictionary['navigation'].units} + {dictionary['navigation'].ingredients} - {dictionary['navigation'].list} - + {dictionary['navigation'].list} + {dictionary['navigation'].details} - {dictionary['navigation'].list} + {dictionary['navigation'].list} - {dictionary['navigation'].list} - - {dictionary['navigation'].adjustment} + {dictionary['navigation'].list} + + {dictionary['navigation'].restock} - {/* {dictionary['navigation'].settings} */} + {/* {dictionary['navigation'].settings} */} }> diff --git a/src/data/dictionaries/ar.json b/src/data/dictionaries/ar.json index b313afd..7e0b702 100644 --- a/src/data/dictionaries/ar.json +++ b/src/data/dictionaries/ar.json @@ -18,7 +18,7 @@ "products": "منتجات", "list": "قائمة", "add": "يضيف", - "adjustment": "تعديل", + "restock": "استرجاع", "category": "فئة", "overview": "نظرة عامة", "profitloss": "الربح والخسارة", diff --git a/src/data/dictionaries/en.json b/src/data/dictionaries/en.json index 4533801..2b821c4 100644 --- a/src/data/dictionaries/en.json +++ b/src/data/dictionaries/en.json @@ -18,7 +18,7 @@ "products": "Products", "list": "List", "add": "Add", - "adjustment": "Adjustment", + "restock": "Re stock", "category": "Category", "overview": "Overview", "profitloss": "Profit Loss", diff --git a/src/data/dictionaries/fr.json b/src/data/dictionaries/fr.json index 6ce77e7..a0ab0a6 100644 --- a/src/data/dictionaries/fr.json +++ b/src/data/dictionaries/fr.json @@ -18,7 +18,7 @@ "products": "Produits", "list": "Liste", "add": "Ajouter", - "adjustment": "Ajustement", + "restock": "Rapprocher", "category": "Catégorie", "overview": "Aperçu", "profitloss": "Profit et perte", diff --git a/src/views/apps/ecommerce/stock/adjustment/AdjustmentStockDrawer.tsx b/src/views/apps/ecommerce/stock/adjustment/AdjustmentStockDrawer.tsx index f3e7a46..fbc0800 100644 --- a/src/views/apps/ecommerce/stock/adjustment/AdjustmentStockDrawer.tsx +++ b/src/views/apps/ecommerce/stock/adjustment/AdjustmentStockDrawer.tsx @@ -96,7 +96,7 @@ const AdjustmentStockDrawer = (props: Props) => { sx={{ '& .MuiDrawer-paper': { width: { xs: 300, sm: 400 } } }} >
- Adjust Inventory + Re Stock diff --git a/src/views/apps/ecommerce/stock/adjustment/StockListTable.tsx b/src/views/apps/ecommerce/stock/adjustment/StockListTable.tsx index 44af958..3a1a668 100644 --- a/src/views/apps/ecommerce/stock/adjustment/StockListTable.tsx +++ b/src/views/apps/ecommerce/stock/adjustment/StockListTable.tsx @@ -237,7 +237,7 @@ const StockListTable = () => { onClick={() => setAddInventoryOpen(!addInventoryOpen)} startIcon={} > - Adjust Stock + Re Stock