Image png to webp

This commit is contained in:
mohan 2026-02-12 11:52:39 +05:30
parent 2dd53ac6ac
commit 4cc5974275
21 changed files with 536 additions and 531 deletions

View File

@ -8,7 +8,11 @@ import {
PricingAppPricingName, PricingAppPricingName,
} from './Features/BrachLogin/BranchLogin.js'; } from './Features/BrachLogin/BranchLogin.js';
import { changePricingAppPricingName } from './Features/ThemeChange/ThemeChange.js'; import { changePricingAppPricingName } from './Features/ThemeChange/ThemeChange.js';
import { FeatureAddon } from './Features/BookingScreen/BookingData/BookingData.js'; import {
FeatureAddon,
GlobalFeatAddOnData,
} from './Features/BookingScreen/BookingData/BookingData.js';
import { useSelector } from 'react-redux';
export const AuthContext = createContext(); export const AuthContext = createContext();
@ -21,10 +25,10 @@ export const AuthProvider = ({ children }) => {
const UserId = getSession('UserId'); const UserId = getSession('UserId');
const UserType = getSession('UserType'); const UserType = getSession('UserType');
const dispatch = useDispatch(); const dispatch = useDispatch();
const FeatureAddonData = useSelector(GlobalFeatAddOnData);
const [Access, setAccess] = useState([]); const [Access, setAccess] = useState([]);
const [SadminuserAccess, setSadminuserAccess] = useState([]); const [SadminuserAccess, setSadminuserAccess] = useState([]);
const [FeatureAddonData, setFeatureAddonData] = useState([]);
const [ProORAdvance, setProORAdvance] = useState(false); const [ProORAdvance, setProORAdvance] = useState(false);
const [Advance, setAdvance] = useState(false); const [Advance, setAdvance] = useState(false);
const [freeProductsCount, setFreeProductsCount] = useState(0); const [freeProductsCount, setFreeProductsCount] = useState(0);
@ -33,9 +37,6 @@ export const AuthProvider = ({ children }) => {
useEffect(() => { useEffect(() => {
getPricingName(); getPricingName();
if (UserType !== 'Super Admin' && UserType !== 'Super Admin User') {
getFeatureAddonData();
}
}, []); }, []);
useEffect(() => { useEffect(() => {
@ -94,18 +95,6 @@ export const AuthProvider = ({ children }) => {
setSadminuserAccess(response?.data?.data?.[0]?.AppMenuAccessDetails); setSadminuserAccess(response?.data?.data?.[0]?.AppMenuAccessDetails);
} }
}; };
const getFeatureAddonData = async () => {
let featureAddon = await dispatch(
FeatureAddon({ AppId: AppId, UserId: UserId })
).unwrap();
if (featureAddon?.data?.statusCode === 1) {
await setFeatureAddonData(
featureAddon?.data?.data?.[0]?.FeatAddonHdr?.[0]
);
} else {
await setFeatureAddonData([]);
}
};
return ( return (
<AuthContext.Provider <AuthContext.Provider

View File

@ -1,6 +1,19 @@
import { createAsyncThunk } from '@reduxjs/toolkit'; import { createAsyncThunk } from '@reduxjs/toolkit';
import { axiosRetailInstanceData } from '../AuthenicationToken/AuthenticationToken'; import { axiosRetailInstanceData } from '../AuthenicationToken/AuthenticationToken';
import { createSlice } from '@reduxjs/toolkit';
const initialState = {
activeTab: 'dashboard',
};
const DashBoard = createSlice({
name: 'DashBoard',
initialState,
reducers: {
setActiveTab: (state, action) => {
state.activeTab = action.payload;
},
},
});
export const getdashboard = createAsyncThunk('getdashboard', async (data) => { export const getdashboard = createAsyncThunk('getdashboard', async (data) => {
if ( if (
data?.CompId != null && data?.CompId != null &&
@ -15,8 +28,7 @@ export const getdashboard = createAsyncThunk('getdashboard', async (data) => {
return await axiosRetailInstanceData.get( return await axiosRetailInstanceData.get(
`/DashBoardReport?AppId=${data?.AppId}&CompId=${data?.CompId}&BranchId=${data?.BranchId}&UserId=${data?.UserId}` `/DashBoardReport?AppId=${data?.AppId}&CompId=${data?.CompId}&BranchId=${data?.BranchId}&UserId=${data?.UserId}`
); );
} } else if (
else if (
data?.CompId != null && data?.CompId != null &&
data?.CompId != undefined && data?.CompId != undefined &&
data?.BranchId != null && data?.BranchId != null &&
@ -27,8 +39,7 @@ export const getdashboard = createAsyncThunk('getdashboard', async (data) => {
return await axiosRetailInstanceData.get( return await axiosRetailInstanceData.get(
`/DashBoardReport?AppId=${data?.AppId}&CompId=${data?.CompId}&BranchId=${data?.BranchId}` `/DashBoardReport?AppId=${data?.AppId}&CompId=${data?.CompId}&BranchId=${data?.BranchId}`
); );
} } else if (
else if (
data?.CompId != null && data?.CompId != null &&
data?.CompId != undefined && data?.CompId != undefined &&
data?.AppId != null && data?.AppId != null &&
@ -109,8 +120,7 @@ export const getpreOrderDashBoard = createAsyncThunk(
return await axiosRetailInstanceData.get( return await axiosRetailInstanceData.get(
`/PreOrder/DashboardReportDtl?appId=${data?.AppId}&compId=${data?.CompId}&branchId=${data?.BranchId}&fromDate=${data?.FromDate}&toDate=${data?.ToDate}` `/PreOrder/DashboardReportDtl?appId=${data?.AppId}&compId=${data?.CompId}&branchId=${data?.BranchId}&fromDate=${data?.FromDate}&toDate=${data?.ToDate}`
); );
} } else if (
else if (
data?.CompId != null && data?.CompId != null &&
data?.CompId != undefined && data?.CompId != undefined &&
data?.AppId != null && data?.AppId != null &&
@ -184,8 +194,7 @@ export const getSalesHdr = createAsyncThunk(
return await axiosRetailInstanceData.get( return await axiosRetailInstanceData.get(
`/SalesHdr/DashboardDtl?appId=${data?.AppId}&compId=${data?.CompId}&branchId=${data?.BranchId}&fromDate=${data?.FromDate}&toDate=${data?.ToDate}` `/SalesHdr/DashboardDtl?appId=${data?.AppId}&compId=${data?.CompId}&branchId=${data?.BranchId}&fromDate=${data?.FromDate}&toDate=${data?.ToDate}`
); );
} } else if (
else if (
data?.CompId != null && data?.CompId != null &&
data?.CompId != undefined && data?.CompId != undefined &&
data?.AppId != null && data?.AppId != null &&
@ -198,8 +207,7 @@ export const getSalesHdr = createAsyncThunk(
return await axiosRetailInstanceData.get( return await axiosRetailInstanceData.get(
`/SalesHdr/DashboardDtl?appId=${data?.AppId}&compId=${data?.CompId}&fromDate=${data?.FromDate}&toDate=${data?.ToDate}` `/SalesHdr/DashboardDtl?appId=${data?.AppId}&compId=${data?.CompId}&fromDate=${data?.FromDate}&toDate=${data?.ToDate}`
); );
} } else {
else {
return await axiosRetailInstanceData.get( return await axiosRetailInstanceData.get(
`/SalesHdr/DashboardDtl?appId=${data?.AppId}&compId=${data?.CompId}` `/SalesHdr/DashboardDtl?appId=${data?.AppId}&compId=${data?.CompId}`
); );
@ -207,5 +215,5 @@ export const getSalesHdr = createAsyncThunk(
} }
); );
export const { setActiveTab } = DashBoard.actions;
export default DashBoard.reducer;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

BIN
src/Images/sandClock.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

View File

@ -26,6 +26,7 @@ import {
ApplicationPreferences, ApplicationPreferences,
globalBranchType, globalBranchType,
changeWarehouse, changeWarehouse,
GlobalCompBranchData,
} from '../../Features/BrachLogin/BranchLogin.js'; } from '../../Features/BrachLogin/BranchLogin.js';
import { useLocation } from 'react-router-dom'; import { useLocation } from 'react-router-dom';
import { Messages } from '../../Components/Notifications/Messages.jsx'; import { Messages } from '../../Components/Notifications/Messages.jsx';
@ -62,14 +63,14 @@ const AppPage = () => {
UserType, UserType,
Access, Access,
SadminuserAccess, SadminuserAccess,
Advance,
ProORAdvance, ProORAdvance,
featureaddDetails, featureaddDetails,
} = useAuth(); } = useAuth();
// Retrieve user details // Retrieve user details
const DineInStatus = useSelector(preferencechangeStatus); const DineInStatus = useSelector(preferencechangeStatus);
const iswarehouse = useSelector(globalBranchType); const iswarehouse = useSelector(globalBranchType);
console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse'); const CompBranchDataGlobal = useSelector(GlobalCompBranchData);
const SettingData = useSelector(PreferenceData); const SettingData = useSelector(PreferenceData);
const appPreferences = useSelector(ApplicationPreferences); const appPreferences = useSelector(ApplicationPreferences);
const defaultBookingType = useSelector(GlobalDefaultBookingType); const defaultBookingType = useSelector(GlobalDefaultBookingType);
@ -91,11 +92,10 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
type?.PreferredStatus === 'Y' type?.PreferredStatus === 'Y'
); );
const [CompBranchData, setCompBranchData] = useState(); const [CompBranchData, setCompBranchData] = useState(CompBranchDataGlobal);
const [messageType, setMessageType] = useState(null); const [messageType, setMessageType] = useState(null);
const [messageData, setMessageData] = useState(null); const [messageData, setMessageData] = useState(null);
const [EmpSettingMenu, setEmpSettingMenu] = useState([]); const [EmpSettingMenu, setEmpSettingMenu] = useState([]);
console.log(EmpSettingMenu, 'EmpSettingMenu');
const [EmpMaster, setEmpMaster] = useState([]); const [EmpMaster, setEmpMaster] = useState([]);
const [EmpPurshase, setEmpPurshase] = useState([]); const [EmpPurshase, setEmpPurshase] = useState([]);
const [EmpProduction, setEmpProduction] = useState([]); const [EmpProduction, setEmpProduction] = useState([]);
@ -111,7 +111,6 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
const [offemenu, setofferMenu] = useState([]); const [offemenu, setofferMenu] = useState([]);
const [payMenu, setPayMenu] = useState([]); const [payMenu, setPayMenu] = useState([]);
const [CancelMenu, setCancelMenu] = useState([]); const [CancelMenu, setCancelMenu] = useState([]);
const [SalesMenu, setSalesMenu] = useState([]);
const [AndroidApp, setAndroidApp] = useState([]); const [AndroidApp, setAndroidApp] = useState([]);
const [Empprodmenu, setEmpprodmenu] = useState([]); const [Empprodmenu, setEmpprodmenu] = useState([]);
@ -154,7 +153,6 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
}, []); }, []);
useEffect(() => { useEffect(() => {
fetchBranchData();
clearCustomerDisplay(); clearCustomerDisplay();
}, []); }, []);
@ -312,36 +310,57 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
getSession('UserType') === 'Super Admin' || getSession('UserType') === 'Super Admin' ||
getSession('UserType') === 'Super Admin User' getSession('UserType') === 'Super Admin User'
) { ) {
const response = await dispatch( if (CompBranchData?.length > 0) {
getCompBranchData({ CompId: CompId, AppId: AppId }) await sessionStore('BranchLength', CompBranchData?.length);
).unwrap(); if (CompBranchData?.length == 1) {
if (response?.data?.statusCode === 1) { await sessionStore('BranchId', CompBranchData?.[0]?.BrId);
setCompBranchData(response?.data?.data); await dispatch(changeSelectedBranchId(CompBranchData?.[0]?.BrId));
await sessionStore('BranchLength', response?.data?.data?.length); }
if (response?.data?.data?.length == 1) { } else {
await sessionStore('BranchId', response?.data?.data?.[0]?.BrId); const response = await dispatch(
await dispatch( getCompBranchData({ CompId: CompId, AppId: AppId })
changeSelectedBranchId(response?.data?.data?.[0]?.BrId) ).unwrap();
); if (response?.data?.statusCode === 1) {
setCompBranchData(response?.data?.data);
if (response?.data?.data?.length == 1) {
await sessionStore('BranchId', response?.data?.data?.[0]?.BrId);
await dispatch(
changeSelectedBranchId(response?.data?.data?.[0]?.BrId)
);
}
} }
} }
} else if ( } else if (
getSession('UserType') === 'Admin' || getSession('UserType') === 'Admin' ||
getSession('UserType') === 'Admin User' getSession('UserType') === 'Admin User' ||
|| getSession('UserType') === 'Employee' getSession('UserType') === 'Employee'
) { ) {
const response = await dispatch( if (CompBranchData?.length > 0) {
getCompBranchData({ AppId: AppId, UserId: UserId, CompId: CompId }) await sessionStore('BranchLength', CompBranchData?.length);
).unwrap(); if (CompBranchData?.length == 1) {
if (response?.data?.statusCode === 1) { await sessionStore('BranchId', CompBranchData?.[0]?.BrId);
await sessionStore('BranchLength', response?.data?.data?.length); await dispatch(changeSelectedBranchId(CompBranchData?.[0]?.BrId));
setCompBranchData(response?.data?.data); if (CompBranchData?.[0]?.LocationType == 'W') {
if (response?.data?.data?.length == 1) { await dispatch(changeWarehouse(true));
await sessionStore('BranchId', response?.data?.data?.[0]?.BrId); }
if(response?.data?.data?.[0]?.LocationType == 'W') await dispatch(changeWarehouse(true)); }
await dispatch( } else {
changeSelectedBranchId(response?.data?.data?.[0]?.BrId) const response = await dispatch(
); getCompBranchData({ AppId: AppId, UserId: UserId, CompId: CompId })
).unwrap();
if (response?.data?.statusCode === 1) {
await sessionStore('BranchLength', response?.data?.data?.length);
setCompBranchData(response?.data?.data);
if (response?.data?.data?.length == 1) {
await sessionStore('BranchId', response?.data?.data?.[0]?.BrId);
if (response?.data?.data?.[0]?.LocationType == 'W') {
await dispatch(changeWarehouse(true));
}
await dispatch(
changeSelectedBranchId(response?.data?.data?.[0]?.BrId)
);
}
} }
} }
} }
@ -398,12 +417,12 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
] ]
), ),
getsubItem('Employee', `${subDirectory}employee`, null, [ getsubItem('Employee', `${subDirectory}employee`, null, [
getsubItem('Add Employee', `${subDirectory}setting/employee-master`), getsubItem('Add Employee', `${subDirectory}setting/employee-master`),
getsubItem('Employee Access', `${subDirectory}setting/employee-access`), getsubItem('Employee Access', `${subDirectory}setting/employee-access`),
]), ]),
getsubItem('Common Master', `${subDirectory}setting/common-master`), getsubItem('Common Master', `${subDirectory}setting/common-master`),
getsubItem('Tax', `${subDirectory}setting/admin-tax`), getsubItem('Tax', `${subDirectory}setting/admin-tax`),
!iswarehouse && !iswarehouse &&
getsubItem('Other Services', `${subDirectory}setting/other-services`), getsubItem('Other Services', `${subDirectory}setting/other-services`),
@ -477,18 +496,24 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
`${subDirectory}setting/supplierproductmapping-master` `${subDirectory}setting/supplierproductmapping-master`
), ),
]), ]),
!sportsAppPreference && getsubItem('Stock Transfer', `${subDirectory}setting/stocktransfer`, null, [ !sportsAppPreference &&
getsubItem( getsubItem(
'Create Transfer', 'Stock Transfer',
`${subDirectory}setting/stock-transferlist` `${subDirectory}setting/stocktransfer`,
), null,
[
getsubItem(
'Create Transfer',
`${subDirectory}setting/stock-transferlist`
),
getsubItem( getsubItem('Stock Dispatch', `${subDirectory}setting/stock-dispatch`),
'Stock Dispatch', getsubItem(
`${subDirectory}setting/stock-dispatch` 'Received Stocks',
), `${subDirectory}setting/receive-stocks`
getsubItem('Received Stocks', `${subDirectory}setting/receive-stocks`), ),
]), ]
),
getsubItem('Price Change', `${subDirectory}setting/price-change`), getsubItem('Price Change', `${subDirectory}setting/price-change`),
!sportsAppPreference && !sportsAppPreference &&
!iswarehouse && !iswarehouse &&
@ -580,38 +605,37 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
'GST Invoice Setup', 'GST Invoice Setup',
`${subDirectory}setting/gst-invoice-setup` `${subDirectory}setting/gst-invoice-setup`
), ),
(!iswarehouse) && !iswarehouse &&
getsubItem('Customization', `${subDirectory}setting/Customize`, null, [ getsubItem('Customization', `${subDirectory}setting/Customize`, null, [
!iswarehouse
? getsubItem(
'Sales Screen',
`${subDirectory}saleslayouts/sales-selection`
)
: '',
!iswarehouse !iswarehouse
? getsubItem( ? getsubItem(
'Sales Screen', 'Print Forms',
`${subDirectory}saleslayouts/sales-selection` `${subDirectory}saleslayouts/print-selection`
) )
: '', : '',
featureaddDetails?.find(
(item) => item?.FeatureAddonName?.toLowerCase() === 'kiosk sales'
) && !iswarehouse
? getsubItem(
'Kiosk Screen',
`${subDirectory}saleslayouts/kiosk-selection`
)
: '',
!iswarehouse !iswarehouse
? getsubItem( ? getsubItem(
'Print Forms', 'Barcode / QR',
`${subDirectory}saleslayouts/print-selection` `${subDirectory}saleslayouts/barcode-qr-selection`
) )
: '', : '',
featureaddDetails?.find( ]),
(item) => item?.FeatureAddonName?.toLowerCase() === 'kiosk sales'
) && !iswarehouse
? getsubItem(
'Kiosk Screen',
`${subDirectory}saleslayouts/kiosk-selection`
)
: '',
!iswarehouse
? getsubItem(
'Barcode / QR',
`${subDirectory}saleslayouts/barcode-qr-selection`
)
: '',
]),
//sree //sree
getsubItem('Shift', `${subDirectory}setting/shift-master`), getsubItem('Shift', `${subDirectory}setting/shift-master`),
getsubItem( getsubItem(
@ -1010,14 +1034,13 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
sportsAppPreference && sportsAppPreference &&
getsubItem('Membership', `${subDirectory}setting/membership-master/list`), getsubItem('Membership', `${subDirectory}setting/membership-master/list`),
getsubItem('Employee', `${subDirectory}employee`, null, [
getsubItem('Add Employee', `${subDirectory}setting/employee-master`),
getsubItem('Employee Access', `${subDirectory}setting/employee-access`),
]),
getsubItem('Employee', `${subDirectory}employee`, null, [ getsubItem('Common Master', `${subDirectory}setting/common-master`),
getsubItem('Add Employee', `${subDirectory}setting/employee-master`), getsubItem('Tax', `${subDirectory}setting/admin-tax`),
getsubItem('Employee Access', `${subDirectory}setting/employee-access`),
]),
getsubItem('Common Master', `${subDirectory}setting/common-master`),
getsubItem('Tax', `${subDirectory}setting/admin-tax`),
!iswarehouse && !iswarehouse &&
getsubItem('Other Services', `${subDirectory}setting/other-services`), getsubItem('Other Services', `${subDirectory}setting/other-services`),
@ -1030,32 +1053,38 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
]; ];
const Purchase = [ const Purchase = [
getsubItem('Automated Reorder', `${subDirectory}setting/automated-reorder`), getsubItem('Automated Reorder', `${subDirectory}setting/automated-reorder`),
getsubItem('Purchase Order', `${subDirectory}setting/purchase-order`), getsubItem('Purchase Order', `${subDirectory}setting/purchase-order`),
getsubItem('Product Receipt', `${subDirectory}setting/purchase-entry`), getsubItem('Product Receipt', `${subDirectory}setting/purchase-entry`),
getsubItem('Product Return', `${subDirectory}setting/purchase-return/list`), getsubItem('Product Return', `${subDirectory}setting/purchase-return/list`),
getsubItem( getsubItem(
'Stock Adjustment', 'Stock Adjustment',
`${subDirectory}setting/stock-adjustment-list` `${subDirectory}setting/stock-adjustment-list`
), ),
getsubItem('Supplier', `${subDirectory}setting/supplier`, null, [ getsubItem('Supplier', `${subDirectory}setting/supplier`, null, [
getsubItem('Add Supplier', `${subDirectory}setting/supplier-master`), getsubItem('Add Supplier', `${subDirectory}setting/supplier-master`),
getsubItem(
'Product Mapping',
`${subDirectory}setting/supplierproductmapping-master`
),
]),
!sportsAppPreference &&
getsubItem(
'Stock Transfer',
`${subDirectory}setting/stocktransfer`,
null,
[
getsubItem( getsubItem(
'Product Mapping', 'Create Transfer',
`${subDirectory}setting/supplierproductmapping-master` `${subDirectory}setting/stock-transferlist`
), ),
]), getsubItem('Stock Dispatch', `${subDirectory}setting/stock-dispatch`),
!sportsAppPreference && getsubItem('Stock Transfer', `${subDirectory}setting/stocktransfer`, null, [
getsubItem( getsubItem(
'Create Transfer', 'Received Stocks',
`${subDirectory}setting/stock-transferlist` `${subDirectory}setting/receive-stocks`
), ),
getsubItem( ]
'Stock Dispatch', ),
`${subDirectory}setting/stock-dispatch`
),
getsubItem('Received Stocks', `${subDirectory}setting/receive-stocks`),
]),
]; ];
const productions = [ const productions = [
getsubItem('Bill Of Material', `${subDirectory}setting/custom-product`), getsubItem('Bill Of Material', `${subDirectory}setting/custom-product`),
@ -1137,17 +1166,23 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
`${subDirectory}setting/supplierproductmapping-master` `${subDirectory}setting/supplierproductmapping-master`
), ),
]), ]),
!sportsAppPreference && getsubItem('Stock Transfer', `${subDirectory}setting/stocktransfer`, null, [ !sportsAppPreference &&
getsubItem( getsubItem(
'Create Transfer', 'Stock Transfer',
`${subDirectory}setting/stock-transferlist` `${subDirectory}setting/stocktransfer`,
), null,
getsubItem( [
'Stock Dispatch', getsubItem(
`${subDirectory}setting/stock-dispatch` 'Create Transfer',
), `${subDirectory}setting/stock-transferlist`
getsubItem('Received Stocks', `${subDirectory}setting/receive-stocks`), ),
]), getsubItem('Stock Dispatch', `${subDirectory}setting/stock-dispatch`),
getsubItem(
'Received Stocks',
`${subDirectory}setting/receive-stocks`
),
]
),
]; ];
const prodMenu = [ const prodMenu = [
@ -1302,10 +1337,8 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
'GST Invoice Setup', 'GST Invoice Setup',
`${subDirectory}setting/gst-invoice-setup` `${subDirectory}setting/gst-invoice-setup`
), ),
( !iswarehouse &&
!iswarehouse) &&
getsubItem('Customization', `${subDirectory}setting/Customize`, null, [ getsubItem('Customization', `${subDirectory}setting/Customize`, null, [
!iswarehouse !iswarehouse
? getsubItem( ? getsubItem(
'Sales Screen', 'Sales Screen',
@ -1424,7 +1457,7 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
) )
: '', : '',
]; ];
const customizedmenuitem = [] const customizedmenuitem = [];
const AndroidAppMenuItem = [ const AndroidAppMenuItem = [
getItem( getItem(
'Download', 'Download',
@ -1661,26 +1694,22 @@ const customizedmenuitem = []
`${subDirectory}setting/membership-master/list` `${subDirectory}setting/membership-master/list`
), ),
getsubItem('Employee', `${subDirectory}employee`, null, [
getsubItem('Employee', `${subDirectory}employee`, null, [ // getsubItem('Shift', `${subDirectory}setting/shift-master`),
// getsubItem('Shift', `${subDirectory}setting/shift-master`), getsubItem('Add Employee', `${subDirectory}setting/employee-master`),
getsubItem( getsubItem(
'Add Employee', 'Employee Access',
`${subDirectory}setting/employee-master` `${subDirectory}setting/employee-access`
), ),
getsubItem( // getsubItem(
'Employee Access', // 'Commission / Incentive',
`${subDirectory}setting/employee-access` // `${subDirectory}setting/commission-or-incentive-master`
), // ),
// getsubItem( ]),
// 'Commission / Incentive',
// `${subDirectory}setting/commission-or-incentive-master`
// ),
]),
getsubItem('Config Type', `${subDirectory}setting/config-type`), getsubItem('Config Type', `${subDirectory}setting/config-type`),
getsubItem('Common Master', `${subDirectory}setting/common-master`), getsubItem('Common Master', `${subDirectory}setting/common-master`),
getsubItem('Tax', `${subDirectory}setting/admin-tax`), getsubItem('Tax', `${subDirectory}setting/admin-tax`),
!iswarehouse && !iswarehouse &&
getsubItem('Other Services', `${subDirectory}setting/other-services`), getsubItem('Other Services', `${subDirectory}setting/other-services`),
@ -1718,22 +1747,26 @@ const customizedmenuitem = []
`${subDirectory}setting/supplierproductmapping-master` `${subDirectory}setting/supplierproductmapping-master`
), ),
]), ]),
!sportsAppPreference && getsubItem( !sportsAppPreference &&
'Stock Transfer', getsubItem(
`${subDirectory}setting/stocktransfer`, 'Stock Transfer',
null, `${subDirectory}setting/stocktransfer`,
[ null,
getsubItem( [
'Create Transfer',
`${subDirectory}setting/stock-transferlist`
),
getsubItem( getsubItem(
'Stock Dispatch', 'Create Transfer',
`${subDirectory}setting/stock-dispatch` `${subDirectory}setting/stock-transferlist`
), ),
getsubItem('Received Stocks', `${subDirectory}setting/receive-stocks`), getsubItem(
] 'Stock Dispatch',
), `${subDirectory}setting/stock-dispatch`
),
getsubItem(
'Received Stocks',
`${subDirectory}setting/receive-stocks`
),
]
),
]), ]),
// Production // Production
getsubItem( getsubItem(
@ -2220,30 +2253,25 @@ const customizedmenuitem = []
] ]
), ),
getsubItem('Employee', `${subDirectory}employee`, null, [
getsubItem('Employee', `${subDirectory}employee`, null, [ // getsubItem('Shift', `${subDirectory}setting/shift-master`),
// getsubItem('Shift', `${subDirectory}setting/shift-master`), getsubItem('Add Employee', `${subDirectory}setting/employee-master`),
getsubItem( getsubItem(
'Add Employee', 'Employee Access',
`${subDirectory}setting/employee-master` `${subDirectory}setting/employee-access`
), ),
getsubItem( // getsubItem(
'Employee Access', // 'Commission / Incentive',
`${subDirectory}setting/employee-access` // `${subDirectory}setting/commission-or-incentive-master`
), // ),
// getsubItem( ]),
// 'Commission / Incentive',
// `${subDirectory}setting/commission-or-incentive-master`
// ),
]),
sportsAppPreference && sportsAppPreference &&
getsubItem( getsubItem(
'Membership', 'Membership',
`${subDirectory}setting/membership-master/list` `${subDirectory}setting/membership-master/list`
), ),
getsubItem('Common Master', `${subDirectory}setting/common-master`),
getsubItem('Common Master', `${subDirectory}setting/common-master`),
getsubItem('Tax', `${subDirectory}setting/admin-tax`), getsubItem('Tax', `${subDirectory}setting/admin-tax`),
!iswarehouse && !iswarehouse &&
@ -2289,22 +2317,26 @@ const customizedmenuitem = []
`${subDirectory}setting/supplierproductmapping-master` `${subDirectory}setting/supplierproductmapping-master`
), ),
]), ]),
!sportsAppPreference && getsubItem( !sportsAppPreference &&
'Stock Transfer', getsubItem(
`${subDirectory}setting/stocktransfer`, 'Stock Transfer',
null, `${subDirectory}setting/stocktransfer`,
[ null,
getsubItem( [
'Create Transfer',
`${subDirectory}setting/stock-transferlist`
),
getsubItem( getsubItem(
'Stock Dispatch', 'Create Transfer',
`${subDirectory}setting/stock-dispatch` `${subDirectory}setting/stock-transferlist`
), ),
getsubItem('Received Stocks', `${subDirectory}setting/receive-stocks`), getsubItem(
] 'Stock Dispatch',
), `${subDirectory}setting/stock-dispatch`
),
getsubItem(
'Received Stocks',
`${subDirectory}setting/receive-stocks`
),
]
),
]), ]),
!iswarehouse && !iswarehouse &&
@ -2532,15 +2564,13 @@ const customizedmenuitem = []
`${subDirectory}setting/gst-invoice-setup` `${subDirectory}setting/gst-invoice-setup`
), ),
!sportsAppPreference && !sportsAppPreference &&
getsubItem( getsubItem(
'Customization', 'Customization',
`${subDirectory}setting/Customized`, `${subDirectory}setting/Customized`,
null, null,
[ [
!sportsAppPreference && !iswarehouse
!sportsAppPreference &&
!iswarehouse
? getsubItem( ? getsubItem(
'Sales Screen', 'Sales Screen',
`${subDirectory}saleslayouts/sales-selection` `${subDirectory}saleslayouts/sales-selection`
@ -2563,8 +2593,7 @@ const customizedmenuitem = []
) )
: '', : '',
!iswarehouse && !iswarehouse && !sportsAppPreference
!sportsAppPreference
? getsubItem( ? getsubItem(
'Barcode / QR', 'Barcode / QR',
`${subDirectory}saleslayouts/barcode-qr-selection` `${subDirectory}saleslayouts/barcode-qr-selection`
@ -2696,8 +2725,8 @@ const customizedmenuitem = []
<IoIosConstruct className="iconsize" />, <IoIosConstruct className="iconsize" />,
EmpProduction EmpProduction
), ),
(EmpSales?.length > 0 && EmpSales?.length > 0 &&
!iswarehouse) && !iswarehouse &&
getItem( getItem(
'Sales', 'Sales',
`${subDirectory}saleslist`, `${subDirectory}saleslist`,
@ -2706,26 +2735,27 @@ const customizedmenuitem = []
), ),
// EmpfilterReportMenu?.length > 0 && // EmpfilterReportMenu?.length > 0 &&
!iswarehouse && !iswarehouse &&
getItem( getItem(
'KOT', 'KOT',
`${subDirectory}kitchen`, `${subDirectory}kitchen`,
<MdOutlineRestaurantMenu className="iconsize" />, <MdOutlineRestaurantMenu className="iconsize" />,
empFilteredKOTMenu empFilteredKOTMenu
), ),
(EmpfilterReportMenu ?.length > 0 ) && EmpfilterReportMenu?.length > 0 &&
getItem( getItem(
'REPORTS', 'REPORTS',
`${subDirectory}reports`, `${subDirectory}reports`,
<TbReportAnalytics className="iconsize" />, <TbReportAnalytics className="iconsize" />,
EmpfilterReportMenu EmpfilterReportMenu
), ),
(EmpSuport?.length > 0 && !iswarehouse) && EmpSuport?.length > 0 &&
getsubItem( !iswarehouse &&
'Support', getsubItem(
`${subDirectory}setting/create-tickets`, 'Support',
<MdOutlineSupportAgent />, `${subDirectory}setting/create-tickets`,
EmpSuport <MdOutlineSupportAgent />,
), EmpSuport
),
EmpSettingMenu?.length > 0 && EmpSettingMenu?.length > 0 &&
EmpSettingMenu?.[0]?.children?.length > 0 && EmpSettingMenu?.[0]?.children?.length > 0 &&
getItem( getItem(

View File

@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useSelector, useDispatch } from 'react-redux'; import { useSelector, useDispatch } from 'react-redux';
import BSLayout1 from '../../Pages/BookingScreen/Template/BSLayout1/BSLayout1.jsx'; import BSLayout1 from '../../Pages/BookingScreen/Template/BSLayout1/BSLayout1.jsx';
import BSLayout2 from '../../Pages/BookingScreen/Template/BSLayout2/BSLayout2.jsx'; import BSLayout2 from '../../Pages/BookingScreen/Template/BSLayout2/BSLayout2.jsx';
@ -19,14 +19,11 @@ import {
changeScanTemplate, changeScanTemplate,
} from '../../Features/ThemeChange/ThemeChange'; } from '../../Features/ThemeChange/ThemeChange';
import { import {
ChangeBranchFinancialStatus,
changeProductSubCategorie, changeProductSubCategorie,
ChangeScreenSize, ChangeScreenSize,
FeatureAddon,
getConfigType, getConfigType,
getLayoutCategories, getLayoutCategories,
getLayoutSubCategories, getLayoutSubCategories,
getPreferenceData,
getUnpaidData, getUnpaidData,
GlobalFeatAddOnData, GlobalFeatAddOnData,
GlobalProductCategorie, GlobalProductCategorie,
@ -35,36 +32,36 @@ import { getSession } from '../../Services/Others';
import { usePaymentOptions } from '../../Pages/BookingScreen/Template/PaymentOptions.js'; import { usePaymentOptions } from '../../Pages/BookingScreen/Template/PaymentOptions.js';
import { getCustomerDisplayWindow } from '../../Features/customerDisplayWindow/customerDisplayWindow.js'; import { getCustomerDisplayWindow } from '../../Features/customerDisplayWindow/customerDisplayWindow.js';
import { ChangeRedirectStatus } from '../../Features/AppPage/CenterPage.js'; import { ChangeRedirectStatus } from '../../Features/AppPage/CenterPage.js';
import { WithoutSalesSetup } from './WithoutSalesSetup.jsx';
import { import {
changeholddata, changeholddata,
gettinghold, gettinghold,
} from '../../Features/BookingScreen/HoldOption/HoldOption.js'; } from '../../Features/BookingScreen/HoldOption/HoldOption.js';
import { getBranchDetail } from '../../Features/BrachLogin/BranchLogin.js';
import Loader from '../../Components/Loader/Loader.jsx'; import Loader from '../../Components/Loader/Loader.jsx';
const BookingPage = () => { const BookingPage = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const templateData = useSelector(getTemplateData); const templateData = useSelector(getTemplateData);
const ProdCat = useSelector(GlobalProductCategorie); const ProdCat = useSelector(GlobalProductCategorie);
console.log(templateData, "templateData") console.log(templateData, 'templateData');
const BookingLayout = templateData?.BookingLayout?.[0]; const BookingLayout = templateData?.BookingLayout?.[0];
const [ismounted, setIsmounted] = useState(false) const [ismounted, setIsmounted] = useState(false);
const [templateLoaded, setTemplateLoaded] = useState(false); const [templateLoaded, setTemplateLoaded] = useState(false);
const PricingAppPricingName = useSelector(GlobalPricingAppPricingName); const PricingAppPricingName = useSelector(GlobalPricingAppPricingName);
// const Advance = PricingAppPricingName?.some(item => item.PricingName === "Advance"); // const Advance = PricingAppPricingName?.some(item => item.PricingName === "Advance");
const Pro = PricingAppPricingName?.some((item) => item.PricingName === 'Customized'); // const Pro = PricingAppPricingName?.some(
// (item) => item.PricingName === 'Customized'
// );
const CompId = getSession('CompId'); const CompId = getSession('CompId');
const BranchId = getSession('BranchId'); const BranchId = getSession('BranchId');
const AppId = getSession('AppId'); const AppId = getSession('AppId');
const UserId = getSession('UserId'); const UserId = getSession('UserId');
const AppName = getSession('AppName'); const AppName = getSession('AppName');
const UserType = getSession('UserType'); const UserType = getSession('UserType');
const AuthToken = sessionStorage.getItem("auth"); const AuthToken = sessionStorage.getItem('auth');
const SessionMobileNo = getSession("MobileNo"); const SessionMobileNo = getSession('MobileNo');
// const [FeatureAddonData, setFeatureAddonData] = useState([]); // const [FeatureAddonData, setFeatureAddonData] = useState([]);
const FeatureAddonData = useSelector(GlobalFeatAddOnData) const FeatureAddonData = useSelector(GlobalFeatAddOnData);
const Scantemplatedata = useSelector(GlobalScanTemplate) const Scantemplatedata = useSelector(GlobalScanTemplate);
// useEffect(() => { // useEffect(() => {
// dispatch( // dispatch(
// getPreferenceData({ CompId: CompId, AppId: AppId, BranchId: BranchId }) // getPreferenceData({ CompId: CompId, AppId: AppId, BranchId: BranchId })
@ -166,7 +163,6 @@ const BookingPage = () => {
UserId: UserId, UserId: UserId,
}); });
useEffect(() => { useEffect(() => {
ProdCat && ProdCat &&
dispatch( dispatch(
@ -180,7 +176,6 @@ const BookingPage = () => {
}, [ProdCat]); }, [ProdCat]);
useEffect(() => { useEffect(() => {
dispatch(getConfigType({ TypeName: 'Booking Type' })).unwrap(); dispatch(getConfigType({ TypeName: 'Booking Type' })).unwrap();
dispatch(ChangeRedirectStatus(true)); dispatch(ChangeRedirectStatus(true));
dispatch(changeProductSubCategorie('NaN')); dispatch(changeProductSubCategorie('NaN'));
@ -215,15 +210,19 @@ const BookingPage = () => {
useEffect(() => { useEffect(() => {
const fetchData = async (Plan) => { const fetchData = async (Plan) => {
if (templateLoaded) return; // STOP duplicate calls if (templateLoaded) return; // STOP duplicate calls
const Data = { AppId, CompId, BranchId }; const Data = { AppId, CompId, BranchId };
if (Scantemplatedata?.Scantemplate && (Scantemplatedata?.changetemp == 'Combo')) { if (
console.log("dont want any changes") Scantemplatedata?.Scantemplate &&
} else Scantemplatedata?.changetemp == 'Combo'
if (Scantemplatedata?.changetemp == 'Layout' && (Scantemplatedata?.OldTemp == 'Combo1' || ) {
Scantemplatedata?.OldTemp == 'Combo2')) { console.log('dont want any changes');
} else if (
Scantemplatedata?.changetemp == 'Layout' &&
(Scantemplatedata?.OldTemp == 'Combo1' ||
Scantemplatedata?.OldTemp == 'Combo2')
) {
let tempdata = { let tempdata = {
BookingLayout: [ BookingLayout: [
'Layout2', 'Layout2',
@ -397,13 +396,21 @@ const BookingPage = () => {
], ],
], ],
}; };
await dispatch(changeScanTemplate({ Scantemplate: false, changetemp: Scantemplatedata?.changetemp, Template: tempdata, OldTemp: Scantemplatedata?.OldTemp })) await dispatch(
changeScanTemplate({
Scantemplate: false,
changetemp: Scantemplatedata?.changetemp,
Template: tempdata,
OldTemp: Scantemplatedata?.OldTemp,
})
);
// setIsmounted(false) // setIsmounted(false)
} } else {
else { const templateResponse = await dispatch(
const templateResponse = await dispatch(getTemplate({ CompId, BranchId, AppId })).unwrap(); getTemplate({ CompId, BranchId, AppId })
).unwrap();
dispatch(getPrintSelectionComponentData(Data)).unwrap(); dispatch(getPrintSelectionComponentData(Data)).unwrap();
setTemplateLoaded(true) setTemplateLoaded(true);
if ( if (
!templateResponse?.data?.data || !templateResponse?.data?.data ||
templateResponse.data.data.length === 0 templateResponse.data.data.length === 0
@ -417,7 +424,6 @@ const BookingPage = () => {
// } // }
} }
// Check if template data is empty or not // Check if template data is empty or not
}; };
const Advance = PricingAppPricingName?.some( const Advance = PricingAppPricingName?.some(
(item) => item.PricingName === 'Premium' (item) => item.PricingName === 'Premium'
@ -428,8 +434,12 @@ const BookingPage = () => {
const hasCustomizedTemplate = FeatureAddonData?.FeatureDtls?.some( const hasCustomizedTemplate = FeatureAddonData?.FeatureDtls?.some(
(item) => item?.FeatureAddonName?.toLowerCase() === 'customized template' (item) => item?.FeatureAddonName?.toLowerCase() === 'customized template'
); );
if (PricingAppPricingName?.length === 0) return; if (PricingAppPricingName?.length === 0) return;
console.log(PricingAppPricingName,FeatureAddonData,"FeatureAddonDataFeatureAddonData") console.log(
PricingAppPricingName,
FeatureAddonData,
'FeatureAddonDataFeatureAddonData'
);
if (PricingAppPricingName?.length > 0) { if (PricingAppPricingName?.length > 0) {
if (Advance) { if (Advance) {
fetchData('Advance'); fetchData('Advance');
@ -445,8 +455,8 @@ const BookingPage = () => {
// if (hasCustomizedTemplate) { // if (hasCustomizedTemplate) {
// fetchData('Standard'); // fetchData('Standard');
// } else { // } else {
fetchData('Standard'); fetchData('Standard');
// Professional('Standard'); // Professional('Standard');
// } // }
} }
// setIsmounted(false) // setIsmounted(false)
@ -493,19 +503,21 @@ const BookingPage = () => {
// }; // };
if (ismounted) if (ismounted)
return ( return (
<div style={{ <div
position: "fixed", style={{
top: "0", position: 'fixed',
left: "0", top: '0',
right: "0", left: '0',
bottom: "0", right: '0',
height: "100vh", bottom: '0',
width: "100vw", height: '100vh',
backgroundColor: "#fff" width: '100vw',
}}> backgroundColor: '#fff',
}}
>
<Loader /> <Loader />
</div> </div>
) );
return ( return (
<div style={{ backgroundColor: '#fff !important' }}> <div style={{ backgroundColor: '#fff !important' }}>
{Object.keys(templateData)?.length > 0 ? ( {Object.keys(templateData)?.length > 0 ? (

View File

@ -361,7 +361,7 @@ const BSC1NavBar = (props) => {
)} )}
{!isMobile && ( {!isMobile && (
<div ClassName="comboPrinterIcon"> <div className="comboPrinterIcon">
<BSPrinterSetting /> <BSPrinterSetting />
</div> </div>
)} )}

View File

@ -1,21 +1,19 @@
import React, { useState, useEffect } from 'react'; import { useState, useEffect } from 'react';
import './BSTImer.scss'; import './BSTImer.scss';
import { FaCalendar } from "react-icons/fa";
import { GoClockFill } from "react-icons/go";
import { ExtractDateFormate } from '../../../../Services/Others'; import { ExtractDateFormate } from '../../../../Services/Others';
const useCurrentTime = () => { const useCurrentTime = () => {
const [currentTime, setCurrentTime] = useState(new Date()); const [currentTime, setCurrentTime] = useState(new Date());
useEffect(() => { useEffect(() => {
const timer = setInterval(() => setCurrentTime(new Date()), 1000); const timer = setInterval(() => setCurrentTime(new Date()), 1000);
return () => clearInterval(timer); return () => clearInterval(timer);
}, []); }, []);
return currentTime; return currentTime;
}; };
const LiveTimer = () => { const LiveTimer = () => {
// Initialize state for current time // Initialize state for current time
const [currentTime, setCurrentTime] = useState(new Date()); const [currentTime, setCurrentTime] = useState(new Date());
@ -52,43 +50,22 @@ const LiveTimer = () => {
export default LiveTimer; export default LiveTimer;
export const TimeDisplay = () => { export const TimeDisplay = () => {
const currentTime = useCurrentTime(); const currentTime = useCurrentTime();
const formatTime = (date) => const formatTime = (date) =>
date.toLocaleTimeString("en-US", { date.toLocaleTimeString('en-US', {
hour12: true, hour12: true,
hour: "2-digit", hour: '2-digit',
minute: "2-digit", minute: '2-digit',
second: "2-digit", second: '2-digit',
}); });
return ( return <div className="timedate">{formatTime(currentTime)}</div>;
<div className="timedate">
{formatTime(currentTime)}
</div>
);
}; };
export const DateDisplay = () => { export const DateDisplay = () => {
const currentDate = useCurrentTime(); const currentDate = useCurrentTime();
// const formatDate = (date) => { return <div className="datesNew">{ExtractDateFormate(currentDate)}</div>;
// const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
// const months = [
// "Jan", "Feb", "Mar", "Apr", "May", "Jun",
// "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
// ];
// return `${days[date.getDay()]} ${date.getDate()} ${months[date.getMonth()]}`;
// };
return (
<div className="datesNew">
{ExtractDateFormate(currentDate)}
</div>
);
}; };

View File

@ -108,7 +108,7 @@ import { BiSolidPhoneCall } from 'react-icons/bi';
import { PiSignOutLight } from 'react-icons/pi'; import { PiSignOutLight } from 'react-icons/pi';
import PozoSwapIcon from '../UtillComponents/Pozo retail icons/PozoSwapIcon.jsx'; import PozoSwapIcon from '../UtillComponents/Pozo retail icons/PozoSwapIcon.jsx';
import { MdEdit } from 'react-icons/md'; import { MdEdit } from 'react-icons/md';
import { CgSearchLoading } from "react-icons/cg"; import { CgSearchLoading } from 'react-icons/cg';
import UserRelieveManager from '../../Template/RealivingUser.jsx'; import UserRelieveManager from '../../Template/RealivingUser.jsx';
import user from '../../../../Images/dashboard/user.jpg'; import user from '../../../../Images/dashboard/user.jpg';
import BSNavBarUserInfo from './BSNavBarUserInfo'; import BSNavBarUserInfo from './BSNavBarUserInfo';
@ -132,6 +132,7 @@ const BSNavbar1 = (props) => {
const [Navmenu, setNavmenu] = useState(false); const [Navmenu, setNavmenu] = useState(false);
const [isAccOpen, setAccIsOpen] = useState(false); const [isAccOpen, setAccIsOpen] = useState(false);
const [formattedDate, setFormattedDate] = useState(''); const [formattedDate, setFormattedDate] = useState('');
// const [FeatureAddonData, setFeatureAddonData] = useState([]); // const [FeatureAddonData, setFeatureAddonData] = useState([]);
const [paymentfeataddon, setpaymentfeataddon] = useState(false); const [paymentfeataddon, setpaymentfeataddon] = useState(false);
const [addcustomer, setAddCustomer] = useState(false); const [addcustomer, setAddCustomer] = useState(false);
@ -314,11 +315,6 @@ const BSNavbar1 = (props) => {
getFeatureAddonData(); getFeatureAddonData();
} }
}, [FeatureAddonData]); }, [FeatureAddonData]);
// useEffect(() => {
// if (BranchId) {
// Combodata();
// }
// }, [BranchId, AppId, CompId]);
const fetchBranchData = async () => { const fetchBranchData = async () => {
if (UserType === 'Super Admin' || UserType === 'Super Admin User') { if (UserType === 'Super Admin' || UserType === 'Super Admin User') {
@ -390,7 +386,6 @@ const BSNavbar1 = (props) => {
navigate(`${subDirectory}app-page/branch-login`); navigate(`${subDirectory}app-page/branch-login`);
}; };
const notificationView = () => {};
//mohan //mohan
const Logout = async () => { const Logout = async () => {
const status = 'N'; // replace with your actual status const status = 'N'; // replace with your actual status
@ -456,14 +451,6 @@ const BSNavbar1 = (props) => {
} }
}; };
const handleClick = async () => {
if (Comboglobal == false) {
await dispatch(changeCombosearch(true));
} else {
await dispatch(changeCombosearch(false));
}
};
// const Combodata = async () => { // const Combodata = async () => {
// let data = { // let data = {
// AppId: AppId, // AppId: AppId,
@ -638,16 +625,13 @@ const BSNavbar1 = (props) => {
position: 'relative', position: 'relative',
}} }}
> >
{/* Multiple search */} {/* Multiple search */}
<Tooltip title={'Multiple Search'}> <Tooltip title={'Multiple Search'}>
<div className='MultiSearchIconDiv'> <div className="MultiSearchIconDiv">
<CgSearchLoading onClick={() => setMultiple(true)} /> <CgSearchLoading onClick={() => setMultiple(true)} />
</div> </div>
</Tooltip> </Tooltip>
{!OtherServicesglobal && ( {!OtherServicesglobal && (
<> <>
{navbarOptions?.map((item) => ( {navbarOptions?.map((item) => (
@ -672,27 +656,6 @@ const BSNavbar1 = (props) => {
<BSNavBarComboSearch SessionData={SessionData} /> <BSNavBarComboSearch SessionData={SessionData} />
</div> </div>
)} )}
{/* {ComboDropDown?.length >= 1 && (
<div style={{ fontSize: '1.5rem', color: 'rgb(18, 146, 238)' }}>
<TooltipWrapper title="Combo Product" isMobile={isMobile}>
<div
onClick={handleClick}
className="BSBillingNavBar1-AllIcons"
style={{
width: '1.49rem',
margin: '10px',
pointerEvents: OrderType === 'Failed' ? 'none' : 'auto',
cursor: 'pointer',
}}
>
<PozoComboProductIcon
fill={Comboglobal === true ? '#52C41A' : '#1292EE'}
/>
</div>
</TooltipWrapper>
</div>
)} */}
</> </>
)} )}
</div> </div>
@ -1316,9 +1279,7 @@ const BSNavbar1 = (props) => {
destroyOnClose={true} destroyOnClose={true}
children={ children={
<> <>
<MultipleSearch <MultipleSearch close={setMultiple} />
close={setMultiple}
/>
</> </>
} }
/> />

View File

@ -503,7 +503,7 @@ const BranchLogin = () => {
value: option?.UserId, value: option?.UserId,
label: option?.UserName, label: option?.UserName,
}))} }))}
label={<label class="required">User Name</label>} label={<label className="required">User Name</label>}
className="field-DropDown" className="field-DropDown"
onChangeFunction={(e) => UserDropDownChange(e)} onChangeFunction={(e) => UserDropDownChange(e)}
isOnchanges={selectedUserData ? true : false} isOnchanges={selectedUserData ? true : false}

View File

@ -1,4 +1,11 @@
import { useCallback, useEffect, useRef, useState,lazy, Suspense } from 'react'; import {
useCallback,
useEffect,
useRef,
useState,
lazy,
Suspense,
} from 'react';
import { useNavigate, useOutletContext } from 'react-router-dom'; import { useNavigate, useOutletContext } from 'react-router-dom';
import { shallowEqual, useDispatch } from 'react-redux'; import { shallowEqual, useDispatch } from 'react-redux';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
@ -13,12 +20,12 @@ const TopSellingProductsChart = lazy(
() => import('./TopSellingProductsChart.jsx') () => import('./TopSellingProductsChart.jsx')
); );
import sandClock from '../../Images/sandClock.png'; import sandClock from '../../Images/sandClock.webp';
import Add from '../../Images/dashboard/Add.png'; import Add from '../../Images/dashboard/Add.webp';
import AddPurchase from '../../Images/dashboard/AddPurchase.png'; import AddPurchase from '../../Images/dashboard/AddPurchase.webp';
import invoice from '../../Images/dashboard/invoice.png'; import invoice from '../../Images/dashboard/invoice.webp';
import user from '../../Images/dashboard/user.jpg'; import user from '../../Images/dashboard/user.webp';
import report from '../../Images/dashboard/report.png'; import report from '../../Images/dashboard/report.webp';
import { import {
GlobalPricingAppPricingName, GlobalPricingAppPricingName,
@ -55,6 +62,7 @@ import {
GenerateLogout, GenerateLogout,
getCompBranchData, getCompBranchData,
getEmpAccesData, getEmpAccesData,
GlobalCompBranchData,
GLobalSadminUserData, GLobalSadminUserData,
GlobalSelectedBranchId, GlobalSelectedBranchId,
PostLoginSuser, PostLoginSuser,
@ -62,9 +70,8 @@ import {
} from '../../Features/BrachLogin/BranchLogin.js'; } from '../../Features/BrachLogin/BranchLogin.js';
import { getPurchasedAppDetails } from '../../Features/BookingScreen/Pricing/Pricing.js'; import { getPurchasedAppDetails } from '../../Features/BookingScreen/Pricing/Pricing.js';
const BSNavBarUserInfo = lazy(
const BSNavBarUserInfo = lazy(() => () => import('../BookingScreen/Components/BSNavbar/BSNavBarUserInfo')
import('../BookingScreen/Components/BSNavbar/BSNavBarUserInfo')
); );
const DefaultModal = lazy(() => const DefaultModal = lazy(() =>
import('../../Components/Modal/DefaultModal').then((m) => ({ import('../../Components/Modal/DefaultModal').then((m) => ({
@ -92,10 +99,12 @@ import { UserDataBasedOnBranchId } from '../../Features/Reports/Reports.js';
import Loader from '../../Components/Loader/Loader.jsx'; import Loader from '../../Components/Loader/Loader.jsx';
import { getUserProfile } from '../../Features/UserAccount/userData.js'; import { getUserProfile } from '../../Features/UserAccount/userData.js';
import { Messages } from '../../Components/Notifications/Messages.jsx'; import { Messages } from '../../Components/Notifications/Messages.jsx';
import TabSwitcher from './TabSwitcher.jsx';
const commonUrl = import.meta.env.ENV_COMMON_BASE_URL; const commonUrl = import.meta.env.ENV_COMMON_BASE_URL;
const subDirectory = import.meta.env.ENV_BASE_URL; const subDirectory = import.meta.env.ENV_BASE_URL;
const RetailDashboard = () => { const RetailDashboard = () => {
const selection = useSelector((state) => state.DashBoard.activeTab);
const today = new Date(); const today = new Date();
const year = today.getFullYear(); const year = today.getFullYear();
const month = today.getMonth(); const month = today.getMonth();
@ -107,11 +116,9 @@ const RetailDashboard = () => {
const intialToDate = formatDate(today); const intialToDate = formatDate(today);
const navigate = useNavigate(); const navigate = useNavigate();
const dispatch = useDispatch(); const dispatch = useDispatch();
const CompBranchDataGlobal = useSelector(GlobalCompBranchData);
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const tabs = [
{ value: 'dashboard', label: 'Dashboard' },
{ value: 'top-selling-products', label: 'Top Selling Products' },
];
const { setCollapse } = useOutletContext(); const { setCollapse } = useOutletContext();
const SessionData = useSelector(StoredSessionData, shallowEqual); const SessionData = useSelector(StoredSessionData, shallowEqual);
const PricingAppPricingName = useSelector( const PricingAppPricingName = useSelector(
@ -138,7 +145,6 @@ const RetailDashboard = () => {
const UserType = getSession('UserType'); const UserType = getSession('UserType');
const sessionId = getSession('SessionId'); const sessionId = getSession('SessionId');
const BrLength = getSession('BranchLength'); const BrLength = getSession('BranchLength');
const [selection, setSelection] = useState('dashboard');
const [page, setPage] = useState(1); const [page, setPage] = useState(1);
const [totalPages, setTotalPages] = useState(0); const [totalPages, setTotalPages] = useState(0);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
@ -244,7 +250,6 @@ const RetailDashboard = () => {
date: item?.SalesDate, date: item?.SalesDate,
}; };
}) || []; }) || [];
console.log(DineInData, 'DineInData');
useEffect(() => { useEffect(() => {
dispatch(getUserProfile({ UserId: UserId, ActiveStatus: 'A' })).unwrap(); dispatch(getUserProfile({ UserId: UserId, ActiveStatus: 'A' })).unwrap();
@ -258,6 +263,7 @@ const RetailDashboard = () => {
dates?.[1]?.format('DD-MM-YYYY'), dates?.[1]?.format('DD-MM-YYYY'),
]); ]);
} else { } else {
// alert
setIsInitialLoad(false); setIsInitialLoad(false);
initializeData(); initializeData();
getInitialdataForPendingBills(); getInitialdataForPendingBills();
@ -294,7 +300,7 @@ const RetailDashboard = () => {
// First fetch branch data as other calls depend on it // First fetch branch data as other calls depend on it
await fetchBranchData(); await fetchBranchData();
// Then fetch other data that doesn't depend on branch selection // Then fetch other data that doesn't depend on branch
await Promise.all([ await Promise.all([
fetchData(), fetchData(),
getAllProdId(), getAllProdId(),
@ -560,7 +566,7 @@ const RetailDashboard = () => {
).unwrap(); ).unwrap();
setEmpAccess(EmpAcessRepsonse?.data?.data); setEmpAccess(EmpAcessRepsonse?.data?.data);
} }
console.log(CompBranchDataGlobal, 'CompBranchDataGlobal', branchName);
const response = await dispatch( const response = await dispatch(
getCompBranchData({ AppId: AppId, UserId: UserId, CompId: CompId }) getCompBranchData({ AppId: AppId, UserId: UserId, CompId: CompId })
).unwrap(); ).unwrap();
@ -980,6 +986,7 @@ const RetailDashboard = () => {
setIsLoadingDashboard(false); setIsLoadingDashboard(false);
} }
}; };
const dateFormat = 'DD-MM-YYYY'; const dateFormat = 'DD-MM-YYYY';
const onChangeBranchFilter = async (branchId) => { const onChangeBranchFilter = async (branchId) => {
@ -1370,9 +1377,9 @@ const RetailDashboard = () => {
</div> </div>
); );
const handleSelectChange = (value) => { // const handleSelectChange = (value) => {
setSelection(value); // setSelection(value);
}; // };
return ( return (
<div className="RetailDashboard-Master"> <div className="RetailDashboard-Master">
@ -1421,16 +1428,16 @@ const RetailDashboard = () => {
</div> </div>
{userprofile && ( {userprofile && (
<Suspense fallback={null}> <Suspense fallback={null}>
<BSNavBarUserInfo <BSNavBarUserInfo
isOpen={userprofile} isOpen={userprofile}
divRef={userProfileRef} divRef={userProfileRef}
userProfileData={{ userProfileData={{
UserImage: user, UserImage: user,
UserName: AppDetails?.[0]?.UserName, UserName: AppDetails?.[0]?.UserName,
MobileNo: AppDetails?.[0]?.MobileNo, MobileNo: AppDetails?.[0]?.MobileNo,
}} }}
Logout={Logout} Logout={Logout}
/> />
</Suspense> </Suspense>
)} )}
</div> </div>
@ -1442,35 +1449,27 @@ const RetailDashboard = () => {
{/* <div style={{ fontSize: '18px', fontWeight: '500' }}>Dashboard</div> */} {/* <div style={{ fontSize: '18px', fontWeight: '500' }}>Dashboard</div> */}
{/* public Login dashboard*/} {/* public Login dashboard*/}
<div className="tab-switcher"> <div className="tab-switcher">
{tabs?.map((tab) => ( <TabSwitcher />
<button
key={tab.value}
className={`tab-button ${selection === tab?.value ? 'active' : ''}`}
onClick={() => handleSelectChange(tab?.value)}
>
{tab.label}
</button>
))}
</div> </div>
{/* Branch Filter Dropdown */} {/* Branch Filter Dropdown */}
{CompBranchData?.length > 1 && selection !== 'top-selling-products' && ( {CompBranchData?.length > 1 && selection !== 'top-selling-products' && (
<div className="branch-filter-dropdown"> <div className="branch-filter-dropdown">
<Suspense fallback={<div>Loading...</div>}> <Suspense fallback={<div>Loading...</div>}>
<DropDowns <DropDowns
options={[ options={[
{ value: 'all', label: 'All Branches' }, { value: 'all', label: 'All Branches' },
...CompBranchData?.map((option) => ({ ...CompBranchData?.map((option) => ({
value: option.BrId, value: option.BrId,
label: option.BrName, label: option.BrName,
})), })),
]} ]}
className="branch-filter-select" className="branch-filter-select"
onChangeFunction={onChangeBranchFilter} onChangeFunction={onChangeBranchFilter}
valueData={selectedBranchForFilter} valueData={selectedBranchForFilter}
defaultValue="all" defaultValue="all"
placeholder="All Branches" placeholder="All Branches"
/> />
</Suspense> </Suspense>
</div> </div>
)} )}
@ -2381,95 +2380,95 @@ const RetailDashboard = () => {
</Suspense> </Suspense>
</> </>
)} )}
<Suspense fallback={null}> <Suspense fallback={null}>
<DefaultModal <DefaultModal
open={modal} open={modal}
title="Authentication" title="Authentication"
width={500} width={500}
footer={false} footer={false}
handleCancel={handlePageChange} handleCancel={handlePageChange}
> >
<> <>
<div className="modalContentsadminuser"> <div className="modalContentsadminuser">
<DropDowns <DropDowns
options={userDropDown?.map((option) => ({ options={userDropDown?.map((option) => ({
value: option?.UserId, value: option?.UserId,
label: option?.UserName, label: option?.UserName,
}))} }))}
label={<label className="required">User Name</label>} label={<label className="required">User Name</label>}
className="field-DropDown" className="field-DropDown"
onChangeFunction={(e) => UserDropDownChange(e)} onChangeFunction={(e) => UserDropDownChange(e)}
isOnchanges={selectedUserData ? true : false} isOnchanges={selectedUserData ? true : false}
valueData={selectedUserData} valueData={selectedUserData}
disabled={disabled}
/>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div className="RadioButton">
<Suspense fallback={<div>Loading...</div>}>
<RadioGrpButton
content={[
{ value: 'O', label: 'OTP' },
{ value: 'P', label: 'PIN' },
]}
fieldState={true}
defaultSelect={SelectType}
onSelectFuntion={(e) => ChangeMethod(e)}
/>
</Suspense>
</div>
</div>
{pinInput && (
<div className="otpInputsadminuser">
{[0, 1, 2, 3].map((i) => (
<input
key={i}
ref={(el) => (inputRefs.current[i] = el)}
className="inputNumber"
type="text"
inputMode="numeric"
pattern="[0-9]"
maxLength={1}
onChange={(e) => handleChange(i, e)}
onKeyDown={(e) => handleKeyDown(i, e)}
style={{
textAlign: 'center',
width: '40px',
fontSize: '20px',
}}
/>
))}
</div>
)}
<div
style={{
width: '100%',
display: 'flex',
justifyContent: 'flex-end',
}}
>
<button
className="size-save-button-retail"
onClick={handleClick}
disabled={disabled} disabled={disabled}
/>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div className="RadioButton">
<Suspense fallback={<div>Loading...</div>}>
<RadioGrpButton
content={[
{ value: 'O', label: 'OTP' },
{ value: 'P', label: 'PIN' },
]}
fieldState={true}
defaultSelect={SelectType}
onSelectFuntion={(e) => ChangeMethod(e)}
/>
</Suspense>
</div>
</div>
{pinInput && (
<div className="otpInputsadminuser">
{[0, 1, 2, 3].map((i) => (
<input
key={i}
ref={(el) => (inputRefs.current[i] = el)}
className="inputNumber"
type="text"
inputMode="numeric"
pattern="[0-9]"
maxLength={1}
onChange={(e) => handleChange(i, e)}
onKeyDown={(e) => handleKeyDown(i, e)}
style={{
textAlign: 'center',
width: '40px',
fontSize: '20px',
}}
/>
))}
</div>
)}
<div
style={{
width: '100%',
display: 'flex',
justifyContent: 'flex-end',
}}
> >
{SelectTypeName === 'OTP' <button
? !FirstTimeOtp className="size-save-button-retail"
? `send ${SelectTypeName.toLocaleLowerCase()}` onClick={handleClick}
: `resend ${SelectTypeName.toLocaleLowerCase()}${ disabled={disabled}
seconds > 0 ? ` in ${seconds}s` : '' >
}` {SelectTypeName === 'OTP'
: !FirstTimePin ? !FirstTimeOtp
? `send ${SelectTypeName.toLocaleLowerCase()}` ? `send ${SelectTypeName.toLocaleLowerCase()}`
: `resend ${SelectTypeName.toLocaleLowerCase()}${ : `resend ${SelectTypeName.toLocaleLowerCase()}${
seconds > 0 ? ` in ${seconds}s` : '' seconds > 0 ? ` in ${seconds}s` : ''
}`} }`
</button> : !FirstTimePin
? `send ${SelectTypeName.toLocaleLowerCase()}`
: `resend ${SelectTypeName.toLocaleLowerCase()}${
seconds > 0 ? ` in ${seconds}s` : ''
}`}
</button>
</div>
</div> </div>
</div> </>
</> </DefaultModal>
</DefaultModal>
</Suspense> </Suspense>
</div> </div>
); );

View File

@ -0,0 +1,27 @@
import { useDispatch, useSelector } from 'react-redux';
import { setActiveTab } from '../../Features/RetailDashboard/Dashboard';
const TabSwitcher = ({ className = '' }) => {
const dispatch = useDispatch();
const activeTab = useSelector((state) => state.DashBoard.activeTab);
const tabs = [
{ value: 'dashboard', label: 'Dashboard' },
{ value: 'top-selling-products', label: 'Top Selling Products' },
];
return (
<div className={`tab-switcher ${className}`}>
{tabs.map((tab) => (
<button
key={tab.value}
className={`tab-button ${activeTab === tab.value ? 'active' : ''}`}
onClick={() => dispatch(setActiveTab(tab.value))}
>
{tab.label}
</button>
))}
</div>
);
};
export default TabSwitcher;

View File

@ -25,10 +25,11 @@ import Pricing from '../Features/BookingScreen/Pricing/Pricing';
import StockPriceUpdate from '../Features/StockPriceUpdate/StockPriceUpdateMaster'; import StockPriceUpdate from '../Features/StockPriceUpdate/StockPriceUpdateMaster';
import taxSlice from '../Features/Tax/Tax'; import taxSlice from '../Features/Tax/Tax';
import Paymentoptions from '../Features/Payment/Paymentoptions/Paymentoptions'; import Paymentoptions from '../Features/Payment/Paymentoptions/Paymentoptions';
import userAccount from '../Features/UserAccount/userData.js'; import userAccount from '../Features/UserAccount/userData';
import OtherServices from "../Features/OtherServices/OtherServices.js" import OtherServices from '../Features/OtherServices/OtherServices';
import BookingOFferNew from '../Features/Offer/Offernew/BookingOffernew.js'; import BookingOFferNew from '../Features/Offer/Offernew/BookingOffernew';
import SlotManagement from '../Features/SlotManagement/SlotManagement.js'; import SlotManagement from '../Features/SlotManagement/SlotManagement';
import DashBoard from '../Features/RetailDashboard/Dashboard';
const store = configureStore({ const store = configureStore({
reducer: { reducer: {
Paymentoptions: Paymentoptions, Paymentoptions: Paymentoptions,
@ -61,6 +62,7 @@ const store = configureStore({
OtherServices: OtherServices, OtherServices: OtherServices,
BookingOFferNew: BookingOFferNew, BookingOFferNew: BookingOFferNew,
SlotManagement: SlotManagement, SlotManagement: SlotManagement,
DashBoard:DashBoard,
}, },
middleware: (getDefaultMiddleware) => middleware: (getDefaultMiddleware) =>
getDefaultMiddleware({ getDefaultMiddleware({