conflict Fixed

This commit is contained in:
Tamilselvan 2026-03-27 02:00:54 +05:30
commit 592098e672
43 changed files with 5732 additions and 5516 deletions

View File

@ -8,7 +8,7 @@ import SelfBooking from './Pages/SelfBooking/SelfBooking.jsx';
import { isMobile, isIOS } from 'react-device-detect'; import { isMobile, isIOS } from 'react-device-detect';
import { routesConfig } from './routesConfig'; import { routesConfig } from './routesConfig';
import { GlobalItemCard } from './Features/BookingScreen/BookingData/BookingData.js'; import { GlobalItemCard } from './Features/BookingScreen/BookingData/BookingData.js';
import { clearSession, getSession } from './Services/Others.js'; import { clearSession, getSession, sessionStore } from './Services/Others.js';
const KisokSelBooking = lazy( const KisokSelBooking = lazy(
() => import('./Pages/SelfBooking/KisokSelBooking') () => import('./Pages/SelfBooking/KisokSelBooking')
@ -27,9 +27,10 @@ import useSessionManager from './useSessionManager.js';
import ExtendSubscriptionModal from './Pages/ExtentedModal/ExtendSubscriptionModal.jsx'; import ExtendSubscriptionModal from './Pages/ExtentedModal/ExtendSubscriptionModal.jsx';
import devtools from 'devtools-detect'; import devtools from 'devtools-detect';
import { useDevToolsDetection } from './utils/useDevToolsDetection.js'; import { useDevToolsDetection } from './utils/useDevToolsDetection.js';
import { Capacitor } from '@capacitor/core';
const isCapacitor = () => !!window.Capacitor?.isNativePlatform?.(); // const isCapacitor = () => !!window.Capacitor?.isNativePlatform?.();
const isCapacitor = () => Capacitor.isNativePlatform();
// Define your home/exit pages here // Define your home/exit pages here
const HOME_PAGES = [ const HOME_PAGES = [
'/app-page/home', // android minimize '/app-page/home', // android minimize
@ -55,7 +56,7 @@ const AppRoutes = () => {
const [devToolsOpen, setDevToolsOpen] = useState(false); const [devToolsOpen, setDevToolsOpen] = useState(false);
// Flag to prevent stack push when back button navigates // Flag to prevent stack push when back button navigates
const isBackNav = useRef(false); const isBackNav = useRef(false);
console.log(isCapacitor(), 'Is Capacitor');
// Build navigation stack // Build navigation stack
useEffect(() => { useEffect(() => {
// Skip pushing to stack when back button caused this navigation // Skip pushing to stack when back button caused this navigation
@ -70,13 +71,14 @@ const AppRoutes = () => {
// Don't track login pages // Don't track login pages
if (LOGIN_PAGES.some((p) => path.includes(p))) return; if (LOGIN_PAGES.some((p) => path.includes(p))) return;
const raw = sessionStorage.getItem('navStack'); const raw = getSession('navStack');
console.log('🎯 Current path:', path);
let stack = raw ? JSON.parse(raw) : []; let stack = raw ? JSON.parse(raw) : [];
if (stack.length === 0 || stack[stack.length - 1] !== path) { if (stack.length === 0 || stack[stack.length - 1] !== path) {
stack.push(path); stack.push(path);
if (stack.length > 50) stack = stack.slice(-50); if (stack.length > 50) stack = stack.slice(-50);
sessionStorage.setItem('navStack', JSON.stringify(stack)); sessionStore('navStack', JSON.stringify(stack));
console.log('📍 Stack:', stack); console.log('📍 Stack:', stack);
} }
} catch (e) { } } catch (e) { }
@ -90,7 +92,7 @@ const AppRoutes = () => {
const currentPath = location.pathname; const currentPath = location.pathname;
const SessionId = getSession('SessionId'); const SessionId = getSession('SessionId');
console.log('SessionId:', SessionId, 'CurrentPath:', currentPath)
// 🟢 If session exists allow navigation // 🟢 If session exists allow navigation
if (SessionId) { if (SessionId) {
console.log('Browser back allowed'); console.log('Browser back allowed');
@ -117,60 +119,48 @@ const AppRoutes = () => {
const handler = async () => { const handler = async () => {
try { try {
const currentPath = location.pathname + (location.search || ''); const currentPath = window.location.pathname + window.location.search; // Bug 2 fix
console.log('🔙 Back pressed:', currentPath);
const raw = sessionStorage.getItem('navStack'); const raw = getSession('navStack');
let stack = raw ? JSON.parse(raw) : []; let stack = raw ? JSON.parse(raw) : [];
// Remove current path from stack if it's at the end
while (stack.length && stack[stack.length - 1] === currentPath) { while (stack.length && stack[stack.length - 1] === currentPath) {
stack.pop(); stack.pop();
} }
// If there are pages in history, go back to previous page
if (stack.length > 0) { if (stack.length > 0) {
const previous = stack[stack.length - 1]; const previous = stack[stack.length - 1];
sessionStorage.setItem('navStack', JSON.stringify(stack)); sessionStore('navStack', JSON.stringify(stack));
isBackNav.current = true; isBackNav.current = true; // Bug 3 fix BEFORE navigate
navigate(previous); navigate(previous);
console.log('Navigate to previous:', previous);
return; return;
} }
// Stack is empty - check where we are
// 🏠 Home page minimize
if (HOME_PAGES?.some((p) => currentPath?.includes(p))) { if (HOME_PAGES?.some((p) => currentPath?.includes(p))) {
console.log('Home page & empty stack → minimizing app');
await CapacitorApp.minimizeApp(); await CapacitorApp.minimizeApp();
return; return;
} }
// 🚪 Login page minimize
if (LOGIN_PAGES?.some((p) => currentPath?.includes(p))) { if (LOGIN_PAGES?.some((p) => currentPath?.includes(p))) {
console.log('Login page & empty stack → minimizing app');
await CapacitorApp.minimizeApp(); await CapacitorApp.minimizeApp();
return; return;
} }
// Anywhere else with empty stack go to home
const home = '/app-page/home'; const home = '/app-page/home';
sessionStorage.setItem('navStack', JSON.stringify([home])); isBackNav.current = true; // Bug 3 fix here too
isBackNav.current = true; sessionStore('navStack', JSON.stringify([home]));
navigate(home); navigate(home);
console.log('Empty stack, navigate to home');
} catch (e) { } catch (e) {
console.error('Back handler error:', e); console.error('Back handler error:', e);
await CapacitorApp.minimizeApp(); await CapacitorApp.minimizeApp();
} }
}; };
const listener = CapacitorApp.addListener('backButton', handler); const listenerPromise = CapacitorApp.addListener('backButton', handler); // Bug 1 fix
return () => { return () => {
listener.remove(); listenerPromise.then(({ remove }) => remove());
}; };
}, [navigate, location.pathname, location.search]); }, [navigate,location.pathname, location.search]);
// mohan // mohan
// useEffect(() => { // useEffect(() => {
// if (isMobile || isIOS) { // if (isMobile || isIOS) {
@ -211,27 +201,27 @@ const AppRoutes = () => {
// return () => clearInterval(checkDevTools); // return () => clearInterval(checkDevTools);
// }, [devToolsOpen]); // }, [devToolsOpen]);
const isBlocked = useDevToolsDetection(() => { // const isBlocked = useDevToolsDetection(() => {
// optional: log, notify, etc. // // optional: log, notify, etc.
console.warn('DevTools detected'); // console.warn('DevTools detected');
}); // });
if (isBlocked) { // if (isBlocked) {
return ( // return (
<div style={{ // <div style={{
display: 'flex', // display: 'flex',
justifyContent: 'center', // justifyContent: 'center',
alignItems: 'center', // alignItems: 'center',
height: '100vh', // height: '100vh',
flexDirection: 'column', // flexDirection: 'column',
gap: '1rem' // gap: '1rem'
}}> // }}>
<h1 style={{ color: 'red' }}> // <h1 style={{ color: 'red' }}>
DevTools detected. Please close it to continue. // DevTools detected. Please close it to continue.
</h1> // </h1>
</div> // </div>
); // );
} // }
if (extendModel) { if (extendModel) {
return ( return (
<ExtendSubscriptionModal <ExtendSubscriptionModal

View File

@ -139,6 +139,18 @@ const SideMenuPozo = ({ items = [] }) => {
const DineinDefault = useSelector(GlobalDineinDefault); const DineinDefault = useSelector(GlobalDineinDefault);
const [collapse, setCollapse] = useState(false); const [collapse, setCollapse] = useState(false);
const [isLandscape, setIsLandscape] = useState(
window.matchMedia('(orientation: landscape)').matches
);
useEffect(() => {
const handleResize = () => {
setIsLandscape(window.matchMedia('(orientation: landscape)').matches);
};
window.addEventListener('resize', handleResize);
return () => window.removeEventListener('resize', handleResize);
}, []);
useEffect(() => { useEffect(() => {
const handleResize = () => { const handleResize = () => {
setCollapse(window.innerWidth < 768); setCollapse(window.innerWidth < 768);
@ -368,7 +380,10 @@ const SideMenuPozo = ({ items = [] }) => {
<div <div
className={`SideMenuPozo-Master${collapse ? ' collapsed' : ''}`} className={`SideMenuPozo-Master${collapse ? ' collapsed' : ''}`}
ref={menuRef} ref={menuRef}
style={{ height: isMobile ? '88%' : '' }} // style={{ height: isMobile ? '88%' : '' }}
style={{
height: isMobile ? (isLandscape ? '100%' : '100%') : '100%',
}}
> >
<div <div
style={{ style={{

View File

@ -262,7 +262,7 @@ const styles = {
status: { status: {
marginTop: '6px', marginTop: '6px',
fontSize: '0.7rem', fontSize: '0.6rem',
fontWeight: 600, fontWeight: 600,
letterSpacing: '4px', letterSpacing: '4px',
textTransform: 'uppercase', textTransform: 'uppercase',

View File

@ -56,11 +56,6 @@ const addAuthHeader = async (config) => {
let encryptedLoginType = let encryptedLoginType =
getSession('LoginType') getSession('LoginType')
console.log(
'encryptedLoginType',
encryptedLoginType,
TokendecryptedValuesFun(encryptedMobileno)
);
// let Mobileno = encryptedUserId && encryptedLoginType != "Kiosk" ? TokendecryptedValuesFun(encryptedMobileno) : '1000000001'; // let Mobileno = encryptedUserId && encryptedLoginType != "Kiosk" ? TokendecryptedValuesFun(encryptedMobileno) : '1000000001';
let Mobileno = encryptedUserId let Mobileno = encryptedUserId

View File

@ -1416,6 +1416,13 @@ export const getOtherServiceTicket = createAsyncThunk(
} }
} }
); );
// post /cancelPayment
export const PostCancelPayment = createAsyncThunk(
'BookingData/cancelPayment',
async (postData) => {
return await axiosRetailInstanceData.post(`/cancelPayment`, postData);
}
);
export const PostBlockSlots = createAsyncThunk( export const PostBlockSlots = createAsyncThunk(
'BookingData/PostBlockSlots', 'BookingData/PostBlockSlots',
async (postData) => { async (postData) => {
@ -1444,6 +1451,7 @@ export const getPaymentStatusForBusinessUPI = createAsyncThunk(
} }
); );
export const getCurrentOrderid = createAsyncThunk( export const getCurrentOrderid = createAsyncThunk(
'BookingData/getcurrentorderid', 'BookingData/getcurrentorderid',
@ -2163,7 +2171,7 @@ const BookingData = createSlice({
builder.addCase(getAppSubscriptionDate.fulfilled, (state, action) => { builder.addCase(getAppSubscriptionDate.fulfilled, (state, action) => {
if (action?.payload?.data?.statusCode === 1) { if (action?.payload?.data?.statusCode === 1) {
state.AppExpDateData = state.AppExpDateData =
action?.payload?.data?.data?.[0]|| {}; action?.payload?.data?.data?.[0] || {};
} else { } else {
state.AppExpDateData = {}; state.AppExpDateData = {};
} }

View File

@ -3,7 +3,7 @@
height: 90vh; height: 90vh;
overflow: auto; overflow: auto;
scrollbar-width: thin; scrollbar-width: thin;
font-family: 'Poppins'; font-family: "Poppins";
.automated-reorder-content { .automated-reorder-content {
padding-top: 18px; padding-top: 18px;
@ -52,3 +52,11 @@
} }
} }
} }
.automated-reorder-list-content {
.eyeopenShow {
display: flex;
align-items: center;
justify-content: center;
}
}

View File

@ -1,26 +1,32 @@
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from 'react';
import { useDispatch } from "react-redux"; import { useDispatch } from 'react-redux';
import { getSession } from "../../Services/Others"; import { getSession } from '../../Services/Others';
import { changeBreadCrumb, getEmpAccess } from "../../Features/AppPage/CenterPage"; import {
import { Messages } from "../../Components/Notifications/Messages"; changeBreadCrumb,
import { Tables } from "../../Components/Tables/Table"; getEmpAccess,
import FormHeader from "../PageComponents/FormHeader"; } from '../../Features/AppPage/CenterPage';
import Search from "../../Components/Forms/Search"; import { Messages } from '../../Components/Notifications/Messages';
import Buttons from "../../Components/Forms/Buttons"; import { Tables } from '../../Components/Tables/Table';
import FormHeader from '../PageComponents/FormHeader';
import Search from '../../Components/Forms/Search';
import Buttons from '../../Components/Forms/Buttons';
import { import {
EditFilled, EditFilled,
DeleteFilled, DeleteFilled,
PlusOutlined, PlusOutlined,
ReloadOutlined, ReloadOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import { useLocation, useNavigate } from "react-router-dom"; import { useLocation, useNavigate } from 'react-router-dom';
import { Space, Tooltip } from "antd"; import { Space, Tooltip } from 'antd';
import { deleteAutomatedReorder, getAutomatedReorderList } from "../../Features/PurchaseOrder/PurchaseOrder"; import {
import { DefaultModal } from "../../Components/Modal/DefaultModal"; deleteAutomatedReorder,
import { FaRegEye } from "react-icons/fa"; getAutomatedReorderList,
import { render } from "react-dom"; } from '../../Features/PurchaseOrder/PurchaseOrder';
import { useAuth } from "../../AuthContext"; import { DefaultModal } from '../../Components/Modal/DefaultModal';
import "./AutomatedReorder.scss"; import { FaRegEye } from 'react-icons/fa';
import { render } from 'react-dom';
import { useAuth } from '../../AuthContext';
import './AutomatedReorder.scss';
const subDirectory = import.meta.env.BASE_URL; const subDirectory = import.meta.env.BASE_URL;
@ -35,8 +41,6 @@ const items = [
}, },
]; ];
const AutomatedReorderList = () => { const AutomatedReorderList = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const navigate = useNavigate(); const navigate = useNavigate();
@ -62,7 +66,6 @@ const AutomatedReorderList = () => {
const [supplierRecordIndex, setSupplierRecordIndex] = useState(null); const [supplierRecordIndex, setSupplierRecordIndex] = useState(null);
const [page, setPage] = useState(1); const [page, setPage] = useState(1);
const [searchedText, setSearchedText] = useState(''); const [searchedText, setSearchedText] = useState('');
const [tableData, setTableData] = useState([]); const [tableData, setTableData] = useState([]);
@ -79,9 +82,7 @@ const AutomatedReorderList = () => {
title: 'Product Name', title: 'Product Name',
dataIndex: 'ProdName', dataIndex: 'ProdName',
key: 'ProdName', key: 'ProdName',
render: (_, record) => ( render: (_, record) => `${record.ProdName} (${record.UOMName})`,
`${record.ProdName} (${record.UOMName})`
)
}, },
{ {
title: 'Supplier', title: 'Supplier',
@ -91,7 +92,7 @@ const AutomatedReorderList = () => {
render: (_, record, index) => ( render: (_, record, index) => (
// <div className="productMasterImageUpload"> // <div className="productMasterImageUpload">
<Tooltip title={record.SupplierDetails ? 'View Image' : 'Upload Image'}> <Tooltip title={record.SupplierDetails ? 'View Image' : 'Upload Image'}>
<div> <div className="eyeopenShow">
<FaRegEye <FaRegEye
style={{ background: 'none', cursor: 'pointer' }} style={{ background: 'none', cursor: 'pointer' }}
size={22} size={22}
@ -110,17 +111,15 @@ const AutomatedReorderList = () => {
title: 'Order Type', title: 'Order Type',
dataIndex: 'OrderType', dataIndex: 'OrderType',
key: 'OrderType', key: 'OrderType',
render: (_, record, index) => ( render: (_, record, index) =>
record.OrderType === 'E' ? 'End of Day (EOD)' : 'Immediate' record.OrderType === 'E' ? 'End of Day (EOD)' : 'Immediate',
)
}, },
{ {
title: 'Confirmation Type', title: 'Confirmation Type',
dataIndex: 'OrderProcessing', dataIndex: 'OrderProcessing',
key: 'OrderProcessing', key: 'OrderProcessing',
render: (_, record, index) => ( render: (_, record, index) =>
record.OrderProcessing === 'Y' ? 'Need Confirmation' : 'Auto' record.OrderProcessing === 'Y' ? 'Need Confirmation' : 'Auto',
)
}, },
{ {
title: 'Reorder Quantity', title: 'Reorder Quantity',
@ -134,10 +133,17 @@ const AutomatedReorderList = () => {
key: 'Action', key: 'Action',
width: '100px', width: '100px',
align: 'center', align: 'center',
render: (_, record, index) => ( render: (_, record, index) =>
record.ActiveStatus === 'A' ? ( record.ActiveStatus === 'A' ? (
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%', gap: '10px' }}> <div
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
width: '100%',
gap: '10px',
}}
>
<EditFilled <EditFilled
style={{ color: '#1292EE' }} style={{ color: '#1292EE' }}
onClick={() => handleEdit(record)} onClick={() => handleEdit(record)}
@ -152,7 +158,6 @@ const AutomatedReorderList = () => {
style={{ color: '#52C41A' }} style={{ color: '#52C41A' }}
onClick={() => handleActiveAndDeactive(record)} onClick={() => handleActiveAndDeactive(record)}
/> />
)
), ),
}, },
]; ];
@ -163,21 +168,21 @@ const AutomatedReorderList = () => {
dataIndex: 'SLNO', dataIndex: 'SLNO',
key: 'SLNO', key: 'SLNO',
width: '10%', width: '10%',
render: (_, record, index) => index + 1 render: (_, record, index) => index + 1,
}, },
{ {
title: 'Supplier Name', title: 'Supplier Name',
dataIndex: 'SuppName', dataIndex: 'SuppName',
key: 'SuppName', key: 'SuppName',
width: '20%', width: '20%',
} },
]; ];
useEffect(() => { useEffect(() => {
try { try {
if (AppId && CompId && BranchId) { if (AppId && CompId && BranchId) {
dispatch(changeBreadCrumb({ items: items })); dispatch(changeBreadCrumb({ items: items }));
fetchData() fetchData();
if (state?.Notify) { if (state?.Notify) {
setMessageType(state?.Notify.messageType); setMessageType(state?.Notify.messageType);
setMessageData(state?.Notify.messageData); setMessageData(state?.Notify.messageData);
@ -224,16 +229,18 @@ const AutomatedReorderList = () => {
const fetchData = async () => { const fetchData = async () => {
try { try {
const res = await dispatch(getAutomatedReorderList({ AppId, CompId, BranchId }))?.unwrap(); const res = await dispatch(
getAutomatedReorderList({ AppId, CompId, BranchId })
)?.unwrap();
if (res?.data?.statusCode === 1 && res?.data?.data?.length > 0) { if (res?.data?.statusCode === 1 && res?.data?.data?.length > 0) {
setTableData(res?.data?.data) setTableData(res?.data?.data);
} else { } else {
setTableData([]) setTableData([]);
} }
} catch (error) { } catch (error) {
console.error(error, 'error: getAutomatedReorderList'); console.error(error, 'error: getAutomatedReorderList');
} }
} };
const onSearch = (value) => { const onSearch = (value) => {
setSearchedText(value); setSearchedText(value);
@ -244,26 +251,36 @@ const AutomatedReorderList = () => {
const handleAdd = () => { const handleAdd = () => {
navigate(`${subDirectory}setting/automated-reorder/new`); navigate(`${subDirectory}setting/automated-reorder/new`);
} };
const handleEdit = (record) => { const handleEdit = (record) => {
navigate(`${subDirectory}setting/automated-reorder/update`, { navigate(`${subDirectory}setting/automated-reorder/update`, {
state: { state: {
editstate: record, editstate: record,
} },
}); });
} };
const handleActiveAndDeactive = async (record) => { const handleActiveAndDeactive = async (record) => {
const res = await dispatch(deleteAutomatedReorder({ UniqueId: record?.UniqueId, UpdatedBy: UserId, ActiveStatus: record?.ActiveStatus === 'A' ? 'D' : 'A' }))?.unwrap(); const res = await dispatch(
deleteAutomatedReorder({
UniqueId: record?.UniqueId,
UpdatedBy: UserId,
ActiveStatus: record?.ActiveStatus === 'A' ? 'D' : 'A',
})
)?.unwrap();
if (res?.data?.statusCode === 1) { if (res?.data?.statusCode === 1) {
setMessageType('success'); setMessageType('success');
setMessageData(record?.ActiveStatus === 'A' ? 'Deactivated Successfully' : 'Activated Successfully'); setMessageData(
record?.ActiveStatus === 'A'
? 'Deactivated Successfully'
: 'Activated Successfully'
);
fetchData(); fetchData();
} else { } else {
setMessageType('error'); setMessageType('error');
setMessageData(res?.data?.message); setMessageData(res?.data?.message);
} }
} };
const onComplete = useCallback(() => { const onComplete = useCallback(() => {
setMessageType(null); setMessageType(null);
@ -314,7 +331,7 @@ const AutomatedReorderList = () => {
onChange: handlePageChange, onChange: handlePageChange,
defaultPageSize: 10, defaultPageSize: 10,
showSizeChanger: false, showSizeChanger: false,
hideOnSinglePage: true hideOnSinglePage: true,
}} }}
/> />
</div> </div>
@ -331,15 +348,12 @@ const AutomatedReorderList = () => {
}} }}
children={ children={
<div className="automated-reorder-list-content"> <div className="automated-reorder-list-content">
<Tables <Tables columns={supplierColumns} data={supplierRecords} />
columns={supplierColumns}
data={supplierRecords}
/>
</div> </div>
} }
/> />
</section> </section>
) );
} };
export default AutomatedReorderList export default AutomatedReorderList;

View File

@ -54,7 +54,7 @@ const BSBillingEditQuantity = (props) => {
const quantityInputRef = useRef(null); const quantityInputRef = useRef(null);
const priceChangeInputRef = useRef(null); const priceChangeInputRef = useRef(null);
const reductionInputRef = useRef(null); const reductionInputRef = useRef(null);
const { setIndex = () => {} } = props; const { setIndex = () => { } } = props;
const [disableSubmitButton, setDisableSubmitButton] = useState(false); const [disableSubmitButton, setDisableSubmitButton] = useState(false);
console.log(disableSubmitButton, 'disableSubmitButton'); console.log(disableSubmitButton, 'disableSubmitButton');
@ -522,7 +522,15 @@ const BSBillingEditQuantity = (props) => {
cartItem?.InwardDtlId === editedProduct?.InwardDtlId && cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
cartItem?.OrderRate === editedProduct?.OrderRate && cartItem?.OrderRate === editedProduct?.OrderRate &&
cartItem?.BookingTypeName === editedProduct?.BookingTypeName && cartItem?.BookingTypeName === editedProduct?.BookingTypeName &&
!cartItem?.SalesId !cartItem?.SalesId && ((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
? true
: cartItem?.OfferMode !== 'B') &&
cartItem?.OfferMode !== 'P' &&
cartItem?.OfferMode !== 'C' &&
cartItem?.OfferMode !== 'O' &&
cartItem?.OfferMode !== 'L'
? true
: cartItem?.Offer === 0)
); );
// changing for one piece stock checking // changing for one piece stock checking
const isItemInCartfilter = CartOrderDetails?.filter( const isItemInCartfilter = CartOrderDetails?.filter(
@ -530,7 +538,15 @@ const BSBillingEditQuantity = (props) => {
cartItem?.ProdId === editedProduct?.ProdId && cartItem?.ProdId === editedProduct?.ProdId &&
cartItem?.InwardDtlId === editedProduct?.InwardDtlId && cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
cartItem?.OrderRate !== editedProduct?.OrderRate && cartItem?.OrderRate !== editedProduct?.OrderRate &&
!cartItem?.SalesId !cartItem?.SalesId && ((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
? true
: cartItem?.OfferMode !== 'B') &&
cartItem?.OfferMode !== 'P' &&
cartItem?.OfferMode !== 'C' &&
cartItem?.OfferMode !== 'O' &&
cartItem?.OfferMode !== 'L'
? true
: cartItem?.Offer === 0)
); );
const isItemInCartHold = CartOrderDetails?.find( const isItemInCartHold = CartOrderDetails?.find(
@ -538,7 +554,15 @@ const BSBillingEditQuantity = (props) => {
cartItem?.ProdId === editedProduct?.ProdId && cartItem?.ProdId === editedProduct?.ProdId &&
cartItem?.InwardDtlId === editedProduct.InwardDtlId && cartItem?.InwardDtlId === editedProduct.InwardDtlId &&
cartItem?.OrderRate === editedProduct?.OrderRate && cartItem?.OrderRate === editedProduct?.OrderRate &&
cartItem?.BookingTypeName === editedProduct?.BookingTypeName cartItem?.BookingTypeName === editedProduct?.BookingTypeName && ((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
? true
: cartItem?.OfferMode !== 'B') &&
cartItem?.OfferMode !== 'P' &&
cartItem?.OfferMode !== 'C' &&
cartItem?.OfferMode !== 'O' &&
cartItem?.OfferMode !== 'L'
? true
: cartItem?.Offer === 0)
); // check if the item is already in the cart ); // check if the item is already in the cart
const isItemInCartHoldfilter = CartOrderDetails?.filter( const isItemInCartHoldfilter = CartOrderDetails?.filter(
(cartItem) => (cartItem) =>
@ -547,7 +571,15 @@ const BSBillingEditQuantity = (props) => {
!( !(
(cartItem?.OrderRate === editedProduct?.OrderRate) (cartItem?.OrderRate === editedProduct?.OrderRate)
// && cartItem?.BookingTypeName === editedProduct?.BookingTypeName // && cartItem?.BookingTypeName === editedProduct?.BookingTypeName
) ) && ((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
? true
: cartItem?.OfferMode !== 'B') &&
cartItem?.OfferMode !== 'P' &&
cartItem?.OfferMode !== 'C' &&
cartItem?.OfferMode !== 'O' &&
cartItem?.OfferMode !== 'L'
? true
: cartItem?.Offer === 0)
); );
if ( if (

View File

@ -127,6 +127,7 @@ import {
changeSearchedData, changeSearchedData,
GlobalSelectedCustDisable, GlobalSelectedCustDisable,
GlobalOrderStatus, GlobalOrderStatus,
PostCancelPayment,
} from '../../../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../../../Features/BookingScreen/BookingData/BookingData';
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities'; import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
import { import {
@ -1392,6 +1393,15 @@ export default function BST1Payment() {
: AddBookingDetails(BookingType, true); : AddBookingDetails(BookingType, true);
} }
}; };
// PostCancelPayment
const CancelPayment = async () => {
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
if (response?.data?.statusCode) {
ClearAllGlobalStateDatas();
CustomerDisplay();
setBusinessUPI(false);
}
}
const financialYearError = async () => { const financialYearError = async () => {
setMessageType('error'); setMessageType('error');
setMessageData('Financial Year-Based Sales Not Yet Started'); setMessageData('Financial Year-Based Sales Not Yet Started');
@ -4728,6 +4738,7 @@ export default function BST1Payment() {
handleCancel={() => setShowCancelConfirm(true)} handleCancel={() => setShowCancelConfirm(true)}
footer={false} footer={false}
width={500} width={500}
destroyOnClose={true}
children={ children={
<> <>
<PaymentGatewayEmbedded <PaymentGatewayEmbedded
@ -4744,14 +4755,27 @@ export default function BST1Payment() {
} }
/> />
{showCancelConfirm && ( {showCancelConfirm && (
// <Modal
// open={showCancelConfirm}
// title="Cancel Payment"
// onOk={() => {
// setBusinessUPI(false);
// setShowCancelConfirm(false);
// ClearAllGlobalStateDatas();
// CustomerDisplay();
// }}
// onCancel={() => setShowCancelConfirm(false)}
// okText="Yes"
// cancelText="No"
// >
// Do you want to cancel the payment?
// </Modal>
<Modal <Modal
open={showCancelConfirm} open={showCancelConfirm}
title="Cancel Payment" title="Cancel Payment"
onOk={() => { onOk={() => {
setBusinessUPI(false);
setShowCancelConfirm(false); setShowCancelConfirm(false);
ClearAllGlobalStateDatas(); CancelPayment()
CustomerDisplay();
}} }}
onCancel={() => setShowCancelConfirm(false)} onCancel={() => setShowCancelConfirm(false)}
okText="Yes" okText="Yes"

View File

@ -3155,7 +3155,7 @@ const BSBillingTable3 = (Props) => {
} = section; } = section;
if (!data?.length) return null; if (!data?.length) return null;
console.log(data, "OrderCart")
// Disabled check // Disabled check
const isDisabled = (item) => { const isDisabled = (item) => {
if (isOld) { if (isOld) {
@ -3427,7 +3427,7 @@ const BSBillingTable3 = (Props) => {
<p <p
className={`offermessageTag ${!isMobile ? 'desktop' : ''}`} className={`offermessageTag ${!isMobile ? 'desktop' : ''}`}
> >
{item.OfferMessage?.split('>')?.[0] + {item?.OfferModeType === true ? item.OfferMessage : item.OfferMessage?.split('>')?.[0] +
`> ${item?.OrderQty} Eligible Free`} `> ${item?.OrderQty} Eligible Free`}
</p> </p>
)} )}

View File

@ -21,6 +21,18 @@ const BSBillingTable3overall = () => {
const [isSmallScreen, setIsSmallScreen] = useState(window.innerWidth <= 768); const [isSmallScreen, setIsSmallScreen] = useState(window.innerWidth <= 768);
const [isCartOpen, setIsCartOpen] = useState(window.innerWidth > 768); const [isCartOpen, setIsCartOpen] = useState(window.innerWidth > 768);
const [isLandscape, setIsLandscape] = useState(
window.matchMedia('(orientation: landscape)').matches
);
useEffect(() => {
const handleResize = () => {
setIsLandscape(window.matchMedia('(orientation: landscape)').matches);
};
window.addEventListener('resize', handleResize);
return () => window.removeEventListener('resize', handleResize);
}, []);
// Handle resize properly // Handle resize properly
useEffect(() => { useEffect(() => {
const handleResize = () => { const handleResize = () => {
@ -106,7 +118,7 @@ const BSBillingTable3overall = () => {
} }
// style={{ height: containerHeight }} // style={{ height: containerHeight }}
style={{ style={{
height: isMobile ? '75vh' : '85vh', height: isMobile ? (isLandscape ? '75vh' : '83vh') : '85vh',
}} }}
> >
{/* ✅ Cart/Table */} {/* ✅ Cart/Table */}

View File

@ -141,6 +141,7 @@ import {
changePreviousOrderOfferDetail, changePreviousOrderOfferDetail,
GlobalAllBookingType, GlobalAllBookingType,
changeSearchedData, changeSearchedData,
PostCancelPayment,
} from '../../../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../../../Features/BookingScreen/BookingData/BookingData';
import { PrintStyleFunction } from '../../../../paymentpdfPage/PrintStyleFunction.js'; import { PrintStyleFunction } from '../../../../paymentpdfPage/PrintStyleFunction.js';
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities'; import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
@ -1574,7 +1575,15 @@ const BSBillingTable3Pay = () => {
: AddBookingDetails(BookingType, true); : AddBookingDetails(BookingType, true);
} }
}; };
// PostCancelPayment
const CancelPayment = async () => {
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
if (response?.data?.statusCode) {
ClearAllGlobalStateDatas();
CustomerDisplay();
setBusinessUPI(false);
}
}
const financialYearError = async () => { const financialYearError = async () => {
setMessageType('error'); setMessageType('error');
setMessageData('Financial Year-Based Sales Not Yet Started'); setMessageData('Financial Year-Based Sales Not Yet Started');
@ -4919,6 +4928,7 @@ const BSBillingTable3Pay = () => {
open={businessUPI} open={businessUPI}
handleCancel={() => setShowCancelConfirm(true)} handleCancel={() => setShowCancelConfirm(true)}
footer={false} footer={false}
destroyOnClose={true}
width={500} width={500}
children={ children={
<> <>
@ -4936,14 +4946,27 @@ const BSBillingTable3Pay = () => {
} }
/> />
{showCancelConfirm && ( {showCancelConfirm && (
// <Modal
// open={showCancelConfirm}
// title="Cancel Payment"
// onOk={() => {
// setBusinessUPI(false);
// setShowCancelConfirm(false);
// ClearAllGlobalStateDatas();
// CustomerDisplay();
// }}
// onCancel={() => setShowCancelConfirm(false)}
// okText="Yes"
// cancelText="No"
// >
// Do you want to cancel the payment?
// </Modal>
<Modal <Modal
open={showCancelConfirm} open={showCancelConfirm}
title="Cancel Payment" title="Cancel Payment"
onOk={() => { onOk={() => {
setBusinessUPI(false);
setShowCancelConfirm(false); setShowCancelConfirm(false);
ClearAllGlobalStateDatas(); CancelPayment()
CustomerDisplay();
}} }}
onCancel={() => setShowCancelConfirm(false)} onCancel={() => setShowCancelConfirm(false)}
okText="Yes" okText="Yes"

View File

@ -109,6 +109,7 @@ import {
GlobalUnpaidListData, GlobalUnpaidListData,
PaymentGatewayGetdetail, PaymentGatewayGetdetail,
PostBookingData, PostBookingData,
PostCancelPayment,
PostPaymentdevice, PostPaymentdevice,
PreferenceData, PreferenceData,
PutBookingData, PutBookingData,
@ -1214,6 +1215,15 @@ const StandardTablePayment = () => {
} }
}; };
// PostCancelPayment
const CancelPayment = async () => {
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
if (response?.data?.statusCode) {
ClearAllGlobalStateDatas();
CustomerDisplay();
setBusinessUPI(false);
}
}
const Otherserviceprint = async () => { const Otherserviceprint = async () => {
if (OtherServicesPrintDetails?.length > 0) { if (OtherServicesPrintDetails?.length > 0) {
const style = await PrintStyleFunction('OtherServices1'); const style = await PrintStyleFunction('OtherServices1');
@ -4191,6 +4201,7 @@ const StandardTablePayment = () => {
handleCancel={() => setShowCancelConfirm(true)} handleCancel={() => setShowCancelConfirm(true)}
footer={false} footer={false}
width={600} width={600}
destroyOnClose={true}
className={'ModalPaymentGatewayEmbedded'} className={'ModalPaymentGatewayEmbedded'}
children={ children={
<> <>
@ -4209,15 +4220,28 @@ const StandardTablePayment = () => {
} }
/> />
{showCancelConfirm && ( {showCancelConfirm && (
// <Modal
// open={showCancelConfirm}
// title="Cancel Payment"
// onOk={() => {
// paymentGatewayRef.current?.clearPolling();
// setBusinessUPI(false);
// setShowCancelConfirm(false);
// ClearAllGlobalStateDatas();
// CustomerDisplay();
// }}
// onCancel={() => setShowCancelConfirm(false)}
// okText="Yes"
// cancelText="No"
// >
// Do you want to cancel the payment?
// </Modal>
<Modal <Modal
open={showCancelConfirm} open={showCancelConfirm}
title="Cancel Payment" title="Cancel Payment"
onOk={() => { onOk={() => {
paymentGatewayRef.current?.clearPolling();
setBusinessUPI(false);
setShowCancelConfirm(false); setShowCancelConfirm(false);
ClearAllGlobalStateDatas(); CancelPayment()
CustomerDisplay();
}} }}
onCancel={() => setShowCancelConfirm(false)} onCancel={() => setShowCancelConfirm(false)}
okText="Yes" okText="Yes"

View File

@ -534,10 +534,14 @@ function BSCategoryHorizontal(props) {
} }
} else { } else {
// 2 or more items, always show // 2 or more items, always show
if (FavSelected) {
setSubCat(false);
} else {
setSubCat(true); setSubCat(true);
} }
} }
}, [SubcategorieData, templateData]); }
}, [SubcategorieData, templateData, FavSelected]);
useEffect(() => { useEffect(() => {
if (typeof searchData === 'string' && categoryData?.length > 0) { if (typeof searchData === 'string' && categoryData?.length > 0) {

View File

@ -128,6 +128,7 @@ import {
changePreviousOrderOfferDetail, changePreviousOrderOfferDetail,
GlobalPaymentTrigger, GlobalPaymentTrigger,
changeSearchedData, changeSearchedData,
PostCancelPayment,
} from '../../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../../Features/BookingScreen/BookingData/BookingData';
import { PrintStyleFunction } from '../../../paymentpdfPage/PrintStyleFunction.js'; import { PrintStyleFunction } from '../../../paymentpdfPage/PrintStyleFunction.js';
import { import {
@ -1294,6 +1295,16 @@ const BSC1Payment = (props) => {
} }
}; };
// PostCancelPayment
const CancelPayment = async () => {
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
if (response?.data?.statusCode) {
ClearAllGlobalStateDatas();
CustomerDisplay();
setBusinessUPI(false);
}
}
useEffect(() => { useEffect(() => {
const handleKeyPress = (event) => { const handleKeyPress = (event) => {
if (event.key === 'F4' && isButtonActive() && !isF4Pressed.current) { if (event.key === 'F4' && isButtonActive() && !isF4Pressed.current) {
@ -4993,6 +5004,7 @@ const BSC1Payment = (props) => {
handleCancel={() => setShowCancelConfirm(true)} handleCancel={() => setShowCancelConfirm(true)}
footer={false} footer={false}
width={500} width={500}
destroyOnClose={true}
children={ children={
<> <>
<PaymentGatewayEmbedded <PaymentGatewayEmbedded
@ -5009,14 +5021,27 @@ const BSC1Payment = (props) => {
} }
/> />
{showCancelConfirm && ( {showCancelConfirm && (
// <Modal
// open={showCancelConfirm}
// title="Cancel Payment"
// onOk={() => {
// setBusinessUPI(false);
// setShowCancelConfirm(false);
// ClearAllGlobalStateDatas();
// CustomerDisplay();
// }}
// onCancel={() => setShowCancelConfirm(false)}
// okText="Yes"
// cancelText="No"
// >
// Do you want to cancel the payment?
// </Modal>
<Modal <Modal
open={showCancelConfirm} open={showCancelConfirm}
title="Cancel Payment" title="Cancel Payment"
onOk={() => { onOk={() => {
setBusinessUPI(false);
setShowCancelConfirm(false); setShowCancelConfirm(false);
ClearAllGlobalStateDatas(); CancelPayment()
CustomerDisplay();
}} }}
onCancel={() => setShowCancelConfirm(false)} onCancel={() => setShowCancelConfirm(false)}
okText="Yes" okText="Yes"

View File

@ -120,7 +120,10 @@ import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLo
import { useDateStore } from '../../../../Features/BookingScreen/BookingData/DateStore.js'; import { useDateStore } from '../../../../Features/BookingScreen/BookingData/DateStore.js';
import AddProduct from '../../../../Components/AddProduct/AddProduct.jsx'; import AddProduct from '../../../../Components/AddProduct/AddProduct.jsx';
import { MdOutlineAddShoppingCart } from 'react-icons/md'; import { MdOutlineAddShoppingCart } from 'react-icons/md';
import { bulkpostdata, getUomData } from '../../../../Features/ProductPage/ProductPage.js'; import {
bulkpostdata,
getUomData,
} from '../../../../Features/ProductPage/ProductPage.js';
import ProductPriceChange from '../UtillComponents/ProductPriceChange.jsx'; import ProductPriceChange from '../UtillComponents/ProductPriceChange.jsx';
import ExpireConfirmModal from '../BookingFunctionality/ExpireConfirmModal.jsx'; import ExpireConfirmModal from '../BookingFunctionality/ExpireConfirmModal.jsx';
import { calculateOverAllQtyLimit } from '../../../../utils/calculations.js'; import { calculateOverAllQtyLimit } from '../../../../utils/calculations.js';
@ -162,7 +165,7 @@ export function SortableCard({ id, children, item }) {
const BSItemCard = (props) => { const BSItemCard = (props) => {
const cardFunction = props?.cardFunctionality; const cardFunction = props?.cardFunctionality;
const { connectingState = null, setConnectingState = () => { } } = props; const { connectingState = null, setConnectingState = () => {} } = props;
console.log(connectingState?.positionChange, 'positionChange'); console.log(connectingState?.positionChange, 'positionChange');
// const applyOffer = useApplyOfferto_CardDetail(); // const applyOffer = useApplyOfferto_CardDetail();
const preferenceDatas = useSelector(PreferenceData, shallowEqual); const preferenceDatas = useSelector(PreferenceData, shallowEqual);
@ -978,7 +981,6 @@ const BSItemCard = (props) => {
await dispatch( await dispatch(
getOfferinBooking({ AppId: AppId, CompId: CompId, BranchId: BranchId }) getOfferinBooking({ AppId: AppId, CompId: CompId, BranchId: BranchId })
).unwrap(); ).unwrap();
} }
useEffect(() => { useEffect(() => {
@ -1056,8 +1058,7 @@ const BSItemCard = (props) => {
if (AppId && CompId && BranchId) { if (AppId && CompId && BranchId) {
fetchedit(); fetchedit();
GetmultipleSearchData(); GetmultipleSearchData();
getUom() getUom();
} }
// dispatch(changepreOrder(false)); Commented to Add Normal Produts After Adding the Combo Pack !!!!!! Dont Touch Without Shifayath Permission // dispatch(changepreOrder(false)); Commented to Add Normal Produts After Adding the Combo Pack !!!!!! Dont Touch Without Shifayath Permission
@ -1065,7 +1066,7 @@ const BSItemCard = (props) => {
const getUom = () => { const getUom = () => {
dispatch(getUomData()); dispatch(getUomData());
} };
const GetmultipleSearchData = async () => { const GetmultipleSearchData = async () => {
const data = { const data = {
@ -2671,6 +2672,7 @@ const BSItemCard = (props) => {
let OfferNeedToApply = true; let OfferNeedToApply = true;
let updatedFreeProductList = []; let updatedFreeProductList = [];
let sameProduct = false; let sameProduct = false;
let TotalDiscount = 0;
for (const offer of offers) { for (const offer of offers) {
if (offer.OfferMode === 'B') { if (offer.OfferMode === 'B') {
const { const {
@ -2679,6 +2681,7 @@ const BSItemCard = (props) => {
OfferApply, OfferApply,
updatedFreeProdList, updatedFreeProdList,
ProductOfferType, ProductOfferType,
otherTotalDiscount
} = applyBuyNGetFreeOffer(cartData, offer, item); } = applyBuyNGetFreeOffer(cartData, offer, item);
offer.OfferAmount = OfferAmount; offer.OfferAmount = OfferAmount;
@ -2686,6 +2689,7 @@ const BSItemCard = (props) => {
OfferNeedToApply = OfferApply; OfferNeedToApply = OfferApply;
updatedFreeProductList = updatedFreeProdList; updatedFreeProductList = updatedFreeProdList;
sameProduct = ProductOfferType; sameProduct = ProductOfferType;
TotalDiscount = otherTotalDiscount;
} }
if (!bestOffer || offer.OfferAmount > bestOffer.OfferAmount) { if (!bestOffer || offer.OfferAmount > bestOffer.OfferAmount) {
bestOffer = offer; bestOffer = offer;
@ -2701,9 +2705,9 @@ const BSItemCard = (props) => {
? bestOffer?.OfferAmount || item.Offer ? bestOffer?.OfferAmount || item.Offer
: item.Offer || bestOffer?.OfferAmount, : item.Offer || bestOffer?.OfferAmount,
OfferType: item?.OfferType || bestOffer?.OfferType, OfferType: item?.OfferType || bestOffer?.OfferType,
OfferMessage: item?.OfferMessage || bestOffer?.OfferMessage, OfferMessage: sameProduct ? (bestOffer?.OfferMessage || item?.OfferMessage) : (item?.OfferMessage || bestOffer?.OfferMessage),
OfferMode: item?.OfferMode || bestOffer?.OfferMode, OfferMode: item?.OfferMode || bestOffer?.OfferMode,
OfferModeType: sameProduct, OfferModeType: sameProduct
}; };
const shouldRemove = (c) => const shouldRemove = (c) =>
@ -2728,6 +2732,12 @@ const BSItemCard = (props) => {
: [...filteredCart, UpdatedCartItemWithOffer]; : [...filteredCart, UpdatedCartItemWithOffer];
if (bestOffer && OfferNeedToApply) { if (bestOffer && OfferNeedToApply) {
if (TotalDiscount > 0) {
bestOffer = {
...bestOffer,
OfferAmount: TotalDiscount
}
}
dispatch(ChangeOfferAppliedProducts(bestOffer)); dispatch(ChangeOfferAppliedProducts(bestOffer));
} }
@ -3117,6 +3127,7 @@ const BSItemCard = (props) => {
function applyBuyNGetFreeOffer(cartItem, offer, item) { function applyBuyNGetFreeOffer(cartItem, offer, item) {
const freeList = offer.FreeProductsList || []; const freeList = offer.FreeProductsList || [];
let otherTotalDiscount = 0;
let totalDiscount = 0; let totalDiscount = 0;
let offerMessage = ''; let offerMessage = '';
let OfferApply = true; let OfferApply = true;
@ -3170,20 +3181,45 @@ const BSItemCard = (props) => {
0.5; 0.5;
sameProductOffer = true; sameProductOffer = true;
} else if (isSameProduct) { } else if (isSameProduct) {
// 🔥 Buy N Get M (same product) // 🔥 Buy N Get N (same product)
const buyQty = offer.BuyQty || 1; const totalQty = freeCartItem?.reduce(
(acc, fc) => acc + (fc?.OrderQty || 0),
0
);
const buyQty = offer.MinQty || 1;
const getQty = freeProd.FreeQty || 0; const getQty = freeProd.FreeQty || 0;
const cycleSize = buyQty + getQty; const groupSize = buyQty + getQty;
const fullCycles = Math.floor(
freeCartItem?.reduce((acc, fc) => acc + (fc?.OrderQty || 0), 0) / // Discount logic (your existing correct logic)
cycleSize const paidQty = Math.ceil(totalQty / groupSize);
); const totalFreeQty = totalQty - paidQty;
const totalFreeQty = fullCycles * getQty;
totalDiscount += totalFreeQty * freeCartItem?.[0].OrderRate; totalDiscount += totalFreeQty * freeCartItem?.[0].OrderRate;
// check the offer applied for same product in different booking type
const differentBookTypeProd = freeCartItem?.filter((prod) => prod?.BookingTypeName !== item?.BookingTypeName && (prod?.Offer || 0) > 0 && prod?.OfferMode === offer?.OfferMode);
if (differentBookTypeProd?.length > 0) {
const diffBookTypeDis = differentBookTypeProd?.reduce(
(acc, fc) => acc + (fc?.Offer || 0),
0
);
otherTotalDiscount = totalDiscount;
totalDiscount = totalDiscount - diffBookTypeDis;
}
sameProductOffer = true; sameProductOffer = true;
// offerMessage = `${freeProd.FreeProdName} -> ${Math.ceil(totalFreeQty / 2)} qty Free Eligible`;
// Message logic (NEW)
const messageGroups = Math.ceil(totalQty / groupSize);
const eligibleFreeQty = messageGroups * getQty;
offerMessage = `${freeProd.FreeProdName} -> ${eligibleFreeQty} Eligible Free`;
// offerMessage = `${freeProd.FreeProdName} ->
// ( ${paidQty} Paid + ${eligibleFreeQty} Free Eligible ). \n
// saved ${otherTotalDiscount > 0 ? otherTotalDiscount : totalDiscount}`;
} else { } else {
// 🔥 Different product free // 🔥 Different product free
const buyQty = offer.BuyQty || 1; const buyQty = offer.BuyQty || 1;
@ -3283,6 +3319,7 @@ const BSItemCard = (props) => {
OfferApply: OfferApply, OfferApply: OfferApply,
updatedFreeProdList: updatedFreeProdList, updatedFreeProdList: updatedFreeProdList,
ProductOfferType: sameProductOffer ? true : false, ProductOfferType: sameProductOffer ? true : false,
otherTotalDiscount: otherTotalDiscount,
}; };
} }
@ -3735,7 +3772,7 @@ const BSItemCard = (props) => {
parseInt(totalSelectedProductQty || 0) + parseInt(totalSelectedProductQty || 0) +
parseInt(reorderComboConsumed || 0); parseInt(reorderComboConsumed || 0);
} }
} catch (_) { } } catch (_) {}
let getCurrentProdDtl = orderDetails?.filter( let getCurrentProdDtl = orderDetails?.filter(
(a) => a?.ProdName === ProdName (a) => a?.ProdName === ProdName
); );
@ -3936,7 +3973,7 @@ const BSItemCard = (props) => {
parseInt(totalSelectedProductQty || 0) + parseInt(totalSelectedProductQty || 0) +
parseInt(reorderComboConsumed || 0); parseInt(reorderComboConsumed || 0);
} }
} catch (_) { } } catch (_) {}
let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId); let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId);
let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => { let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => {
return ( return (
@ -3972,7 +4009,7 @@ const BSItemCard = (props) => {
}, 0); }, 0);
totalOrderQty = totalOrderQty =
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0); parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
} catch (_) { } } catch (_) {}
let OverallProdQty = totalOrderQty - totalSelectedProductQty; let OverallProdQty = totalOrderQty - totalSelectedProductQty;
if ( if (
parseInt(ItemQuantity) > parseInt(ItemQuantity) >
@ -4058,7 +4095,7 @@ const BSItemCard = (props) => {
parseInt(totalSelectedProductQty || 0) + parseInt(totalSelectedProductQty || 0) +
parseInt(reorderComboConsumed || 0); parseInt(reorderComboConsumed || 0);
} }
} catch (_) { } } catch (_) {}
let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId); let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId);
let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => { let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => {
return ( return (
@ -4097,7 +4134,7 @@ const BSItemCard = (props) => {
}, 0); }, 0);
totalOrderQty = totalOrderQty =
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0); parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
} catch (_) { } } catch (_) {}
let OverallProdQty = totalOrderQty - totalSelectedProductQty; let OverallProdQty = totalOrderQty - totalSelectedProductQty;
if ( if (
parseInt(ItemQuantity) > parseInt(ItemQuantity) >
@ -4189,7 +4226,7 @@ const BSItemCard = (props) => {
parseInt(totalSelectedProductQty || 0) + parseInt(totalSelectedProductQty || 0) +
parseInt(reorderComboConsumed || 0); parseInt(reorderComboConsumed || 0);
} }
} catch (_) { } } catch (_) {}
let getCurrentProdDtl = orderDetails?.filter( let getCurrentProdDtl = orderDetails?.filter(
(a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId (a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId
); );
@ -4232,7 +4269,7 @@ const BSItemCard = (props) => {
}, 0); }, 0);
totalOrderQty = totalOrderQty =
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0); parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
} catch (_) { } } catch (_) {}
let OverallProdQty = totalOrderQty - totalSelectedProductQty; let OverallProdQty = totalOrderQty - totalSelectedProductQty;
if ( if (
@ -4316,7 +4353,7 @@ const BSItemCard = (props) => {
parseInt(totalSelectedProductQty || 0) + parseInt(totalSelectedProductQty || 0) +
parseInt(reorderComboConsumed || 0); parseInt(reorderComboConsumed || 0);
} }
} catch (_) { } } catch (_) {}
let getCurrentProdDtl = orderDetails?.filter( let getCurrentProdDtl = orderDetails?.filter(
(a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId (a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId
); );
@ -4363,7 +4400,7 @@ const BSItemCard = (props) => {
}, 0); }, 0);
totalOrderQty = totalOrderQty =
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0); parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
} catch (_) { } } catch (_) {}
let OverallProdQty = totalOrderQty - totalSelectedProductQty; let OverallProdQty = totalOrderQty - totalSelectedProductQty;
if ( if (
@ -6533,7 +6570,6 @@ const BSItemCard = (props) => {
'12px' '12px'
: '12px', : '12px',
textAlign: 'center', textAlign: 'center',
lineHeight: '2',
fontFamily: SelectedCardFont fontFamily: SelectedCardFont
? SelectedCardFont ? SelectedCardFont
: '', : '',
@ -6568,7 +6604,6 @@ const BSItemCard = (props) => {
'12px' '12px'
: '12px', : '12px',
textAlign: 'center', textAlign: 'center',
lineHeight: '2',
fontFamily: SelectedCardFont fontFamily: SelectedCardFont
? SelectedCardFont ? SelectedCardFont
: '', : '',
@ -6981,7 +7016,6 @@ const BSItemCard = (props) => {
'12px' '12px'
: '12px', : '12px',
textAlign: 'center', textAlign: 'center',
lineHeight: '2',
fontFamily: SelectedCardFont fontFamily: SelectedCardFont
? SelectedCardFont ? SelectedCardFont
: '', : '',
@ -7016,7 +7050,6 @@ const BSItemCard = (props) => {
'12px' '12px'
: '12px', : '12px',
textAlign: 'center', textAlign: 'center',
lineHeight: '2',
fontFamily: SelectedCardFont fontFamily: SelectedCardFont
? SelectedCardFont ? SelectedCardFont
: '', : '',

View File

@ -1223,7 +1223,7 @@ const BSNavbar1 = (props, BookingNavbar) => {
pointerEvents: OrderType === 'Failed' ? 'none' : 'auto', pointerEvents: OrderType === 'Failed' ? 'none' : 'auto',
}} }}
> >
<BSNavBarFavItems /> <BSNavBarFavItems setNavmenu={setNavmenu} />
</div> </div>
)} )}
{/* DragItem */} {/* DragItem */}

View File

@ -1,7 +1,11 @@
import { useEffect, useRef, useState } from 'react'; import { useEffect, useRef, useState } from 'react';
import { useSelector, useDispatch } from 'react-redux'; import { useSelector, useDispatch } from 'react-redux';
import { Button, Carousel, Skeleton } from 'antd'; import { Button, Carousel, Skeleton } from 'antd';
import { ArrowRightOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons'; import {
ArrowRightOutlined,
LeftOutlined,
RightOutlined,
} from '@ant-design/icons';
import SelectionComponent from './SelectionComponent'; import SelectionComponent from './SelectionComponent';
import PreviewLayout1 from '../PreviewLayouts/PreviewLayout1'; import PreviewLayout1 from '../PreviewLayouts/PreviewLayout1';
import PreviewLayout2 from '../PreviewLayouts/PreviewLayout2'; import PreviewLayout2 from '../PreviewLayouts/PreviewLayout2';
@ -10,17 +14,28 @@ import PreViewLayout4 from '../PreviewLayouts/PreViewLayout4';
import PreviewLayout5 from '../PreviewLayouts/PreviewLayout5'; import PreviewLayout5 from '../PreviewLayouts/PreviewLayout5';
import PreViewLayout6 from '../PreviewLayouts/PreViewLayout6'; import PreViewLayout6 from '../PreviewLayouts/PreViewLayout6';
import ComboLayout1 from '../PreviewLayouts/ComboLayout1'; import ComboLayout1 from '../PreviewLayouts/ComboLayout1';
import { changeActiveTheme, changeOthersTheme, changeSelectedTheme, changeThemeCreation, getOthersTemplate, getPreviewData, getTemplate, GlobalActiveTheme, GlobalDefaultTheme, GlobalOthersTheme, GlobalSelectedTheme } from '../../../../Features/ThemeChange/ThemeChange'; import {
changeActiveTheme,
changeOthersTheme,
changeSelectedTheme,
changeThemeCreation,
getOthersTemplate,
getPreviewData,
getTemplate,
GlobalActiveTheme,
GlobalDefaultTheme,
GlobalOthersTheme,
GlobalSelectedTheme,
} from '../../../../Features/ThemeChange/ThemeChange';
import '../../../../Styles/BookingScreen/Components/SelectionComponent/MainPage.scss'; import '../../../../Styles/BookingScreen/Components/SelectionComponent/MainPage.scss';
import { HiOutlineSquares2X2, HiSquaresPlus } from 'react-icons/hi2'; import { HiOutlineSquares2X2, HiSquaresPlus } from 'react-icons/hi2';
import { getSession } from '../../../../Services/Others'; import { getSession } from '../../../../Services/Others';
import Buttons from '../../../../Components/Forms/Buttons'; import Buttons from '../../../../Components/Forms/Buttons';
import { BiSkipNext, BiSkipPrevious } from 'react-icons/bi'; import { BiSkipNext, BiSkipPrevious } from 'react-icons/bi';
import { MdOutlineDisplaySettings } from "react-icons/md"; import { MdOutlineDisplaySettings } from 'react-icons/md';
import { useAuth } from '../../../../AuthContext'; import { useAuth } from '../../../../AuthContext';
import { getEmpAccess } from '../../../../Features/AppPage/CenterPage'; import { getEmpAccess } from '../../../../Features/AppPage/CenterPage';
const BookingSelectionPage = (props) => { const BookingSelectionPage = (props) => {
const { SadminuserAccess } = useAuth(); const { SadminuserAccess } = useAuth();
let SAAccessCommonMaster = SadminuserAccess?.find( let SAAccessCommonMaster = SadminuserAccess?.find(
@ -39,12 +54,12 @@ const BookingSelectionPage = (props) => {
// const [activeTheme, setActiveTheme] = useState( // const [activeTheme, setActiveTheme] = useState(
// 'default' // 'default'
// ); // );
const activeTheme = useSelector(GlobalActiveTheme) const activeTheme = useSelector(GlobalActiveTheme);
const SelectedTheme = useSelector(GlobalSelectedTheme) const SelectedTheme = useSelector(GlobalSelectedTheme);
const mergedThemes = DefaultThemes.concat(OthersTheme) const mergedThemes = DefaultThemes.concat(OthersTheme);
const [currentSlide, setCurrentSlide] = useState(0); const [currentSlide, setCurrentSlide] = useState(0);
console.log(SelectedTheme, "currentSlide") console.log(SelectedTheme, 'currentSlide');
const [OthersCount, setOthersCount] = useState(1); const [OthersCount, setOthersCount] = useState(1);
const [isNext, isSetNext] = useState(true); const [isNext, isSetNext] = useState(true);
const [empData, setEmpData] = useState(); const [empData, setEmpData] = useState();
@ -68,9 +83,9 @@ const BookingSelectionPage = (props) => {
: useSelector(getPreviewData); : useSelector(getPreviewData);
console.log(previewData, 'previewDatapreviewData'); console.log(previewData, 'previewDatapreviewData');
useEffect(() => { useEffect(() => {
GetOthersTemplate() GetOthersTemplate();
// gettemplatedetail() // gettemplatedetail()
}, []) }, []);
useEffect(() => { useEffect(() => {
if (UserType === 'Employee') { if (UserType === 'Employee') {
fetchApi(); fetchApi();
@ -111,7 +126,7 @@ const BookingSelectionPage = (props) => {
).unwrap(); ).unwrap();
if (tempdetail?.data?.statusCode == 1) { if (tempdetail?.data?.statusCode == 1) {
dispatch(changeActiveTheme("customised")); dispatch(changeActiveTheme('customised'));
} }
}; };
@ -149,7 +164,12 @@ const BookingSelectionPage = (props) => {
setCurrentSlide(pendingSlide); setCurrentSlide(pendingSlide);
let seltheme = updatedThemes[pendingSlide]; let seltheme = updatedThemes[pendingSlide];
dispatch(changeThemeCreation({ formtype: 'edit', editdata: seltheme })); dispatch(changeThemeCreation({ formtype: 'edit', editdata: seltheme }));
dispatch(changeSelectedTheme({ ThemeId: seltheme?.TemplatePreferenceId, ThemeName: seltheme?.ThemeName })); dispatch(
changeSelectedTheme({
ThemeId: seltheme?.TemplatePreferenceId,
ThemeName: seltheme?.ThemeName,
})
);
} }
setPendingSlide(null); // Reset setPendingSlide(null); // Reset
} }
@ -205,7 +225,12 @@ const BookingSelectionPage = (props) => {
setCurrentSlide(newIndex); setCurrentSlide(newIndex);
let seltheme = mergedThemes[newIndex]; let seltheme = mergedThemes[newIndex];
dispatch(changeThemeCreation({ formtype: 'edit', editdata: seltheme })); dispatch(changeThemeCreation({ formtype: 'edit', editdata: seltheme }));
dispatch(changeSelectedTheme({ ThemeId: seltheme?.TemplatePreferenceId, ThemeName: seltheme?.ThemeName })); dispatch(
changeSelectedTheme({
ThemeId: seltheme?.TemplatePreferenceId,
ThemeName: seltheme?.ThemeName,
})
);
} }
}; };
@ -214,12 +239,18 @@ const BookingSelectionPage = (props) => {
await GetLessTemplate(); await GetLessTemplate();
setPendingSlide(DefaultThemes.concat(OthersTheme).length - 1); // Ask to jump to last slide after fetch setPendingSlide(DefaultThemes.concat(OthersTheme).length - 1); // Ask to jump to last slide after fetch
} else { } else {
const newIndex = (currentSlide - 1 + mergedThemes.length) % mergedThemes.length; const newIndex =
(currentSlide - 1 + mergedThemes.length) % mergedThemes.length;
carouselRef.current.goTo(newIndex); carouselRef.current.goTo(newIndex);
setCurrentSlide(newIndex); setCurrentSlide(newIndex);
let seltheme = mergedThemes[newIndex]; let seltheme = mergedThemes[newIndex];
dispatch(changeThemeCreation({ formtype: 'edit', editdata: seltheme })); dispatch(changeThemeCreation({ formtype: 'edit', editdata: seltheme }));
dispatch(changeSelectedTheme({ ThemeId: seltheme?.TemplatePreferenceId, ThemeName: seltheme?.ThemeName })); dispatch(
changeSelectedTheme({
ThemeId: seltheme?.TemplatePreferenceId,
ThemeName: seltheme?.ThemeName,
})
);
} }
}; };
const CustomisedthemeSelection = async (seltheme) => { const CustomisedthemeSelection = async (seltheme) => {
@ -236,16 +267,25 @@ const BookingSelectionPage = (props) => {
} }
} else { } else {
if (Object.keys(DefaultThemes)?.length > 0) { if (Object.keys(DefaultThemes)?.length > 0) {
dispatch(changeSelectedTheme({ ThemeId: DefaultThemes?.[0]?.TemplatePreferenceId, ThemeName: DefaultThemes?.[0]?.ThemeName })); dispatch(
changeSelectedTheme({
ThemeId: DefaultThemes?.[0]?.TemplatePreferenceId,
ThemeName: DefaultThemes?.[0]?.ThemeName,
})
);
// settemplateData(DefaultThemes?.[0]); // settemplateData(DefaultThemes?.[0]);
dispatch(changeThemeCreation({ formtype: 'edit', editdata: DefaultThemes?.[0] })); dispatch(
changeThemeCreation({
formtype: 'edit',
editdata: DefaultThemes?.[0],
})
);
} else { } else {
dispatch(changeSelectedTheme({})); dispatch(changeSelectedTheme({}));
dispatch(changeThemeCreation({ formtype: 'new' })); dispatch(changeThemeCreation({ formtype: 'new' }));
}
} }
} }
};
const handlesubmit = () => { const handlesubmit = () => {
const PostData = {}; const PostData = {};
@ -256,7 +296,7 @@ const BookingSelectionPage = (props) => {
PostData['ColorId'] = colorFilteredArray; PostData['ColorId'] = colorFilteredArray;
PostData['FontId'] = fontFilteredArray; PostData['FontId'] = fontFilteredArray;
PostData['CreatedBy'] = UserId; PostData['CreatedBy'] = UserId;
} };
const GetOthersTemplate = async () => { const GetOthersTemplate = async () => {
let OtherTemp = await dispatch( let OtherTemp = await dispatch(
getOthersTemplate({ pagenumber: OthersCount }) getOthersTemplate({ pagenumber: OthersCount })
@ -266,7 +306,7 @@ const BookingSelectionPage = (props) => {
...temp, ...temp,
ThemeName: `Theme ${index + 1 + OthersCount * 10 - 10}`, ThemeName: `Theme ${index + 1 + OthersCount * 10 - 10}`,
})); }));
dispatch(changeOthersTheme(withname)) dispatch(changeOthersTheme(withname));
} else { } else {
} }
}; };
@ -288,8 +328,7 @@ const BookingSelectionPage = (props) => {
...temp, ...temp,
ThemeName: `Theme ${index + 1 + (tempcount - 1) * 10}`, ThemeName: `Theme ${index + 1 + (tempcount - 1) * 10}`,
})); }));
dispatch(changeOthersTheme(withname)) dispatch(changeOthersTheme(withname));
} else { } else {
setMessageType('warning'); setMessageType('warning');
setMessageData('No more templates'); setMessageData('No more templates');
@ -306,22 +345,24 @@ const BookingSelectionPage = (props) => {
...temp, ...temp,
ThemeName: `Theme ${index + 1 + (tempcount - 1) * 10}`, ThemeName: `Theme ${index + 1 + (tempcount - 1) * 10}`,
})); }));
dispatch(changeOthersTheme(withname)) dispatch(changeOthersTheme(withname));
isSetNext(true); isSetNext(true);
} else { } else {
} }
}; };
const clearOtherTemplate = async () => { const clearOtherTemplate = async () => {
dispatch(changeOthersTheme([])) dispatch(changeOthersTheme([]));
setOthersCount(1); setOthersCount(1);
}; };
return ( return (
<div className='SalesSetupMaster'> <div className="SalesSetupMaster">
<div className="Salessetup-header"> <div className="Salessetup-header">
<h1 className="formHeader"> <h1 className="formHeader">
<p> <MdOutlineDisplaySettings size={30} color='#2563eb' /> Sales Setup</p> <p>
{' '}
<MdOutlineDisplaySettings size={30} color="#2563eb" /> Sales Setup
</p>
<div>Customize your sales screen here </div> <div>Customize your sales screen here </div>
</h1> </h1>
<div className="defaultandCustomisedThemeSales"> <div className="defaultandCustomisedThemeSales">
@ -338,29 +379,24 @@ const BookingSelectionPage = (props) => {
> >
<HiSquaresPlus size={16} /> Customized Theme <HiSquaresPlus size={16} /> Customized Theme
</div> </div>
</div> </div>
{activeTheme === 'default' && {activeTheme === 'default' && (
<div className="Default-SubmitButton"> <div className="Default-SubmitButton">
<Buttons <Buttons
buttonText="Save" buttonText="Save"
color="901D77" color="901D77"
disabled = {addnewAccess} disabled={addnewAccess}
handleSubmit={handleMainSubmit} handleSubmit={handleMainSubmit}
icon={<ArrowRightOutlined />} icon={<ArrowRightOutlined />}
/> />
</div> </div>
} )}
</div> </div>
<div className='salesScreenView' <div className="salesScreenView">
> {activeTheme === 'default' ? (
{activeTheme === 'default' ?
<> <>
<div <div className="default-Sales-dotted-box">
className="default-Sales-dotted-box"
>
<Button <Button
icon={<LeftOutlined />} icon={<LeftOutlined />}
onClick={() => leftOnclick()} onClick={() => leftOnclick()}
@ -406,20 +442,18 @@ const BookingSelectionPage = (props) => {
</div> </div>
)} )}
</Carousel> </Carousel>
</div> </div>
<div style={{ display: 'none' }}> <div style={{ display: 'none' }}>
<SelectionComponent ref={childRef} /> <SelectionComponent ref={childRef} />
</div> </div>
</> </>
: ) : (
<> <>
<div <div
className="Sales-dotted-box" className="Sales-dotted-box"
style={{ width: '55%', height: '85%', position: 'relative' }} style={{ width: '55%', height: '85%', position: 'relative' }}
> >
<Carousel <Carousel
ref={carouselRef} ref={carouselRef}
dots={false} dots={false}
@ -436,16 +470,14 @@ const BookingSelectionPage = (props) => {
)} )}
</Carousel> </Carousel>
</div> </div>
<div className='SelectionComponentImport'> <div className="SelectionComponentImport">
<SelectionComponent ref={childRef} /> <SelectionComponent ref={childRef} />
</div> </div>
</> </>
} )}
</div> </div>
</div> </div>
); );
}; };
export default BookingSelectionPage; export default BookingSelectionPage;

View File

@ -118,7 +118,7 @@ const PreviewLayout1 = (props) => {
)} )}
/>{' '} />{' '}
</div> </div>
<div style={{ backgroundColor: '#fff'}}> <div style={{ backgroundColor: '#fff' }}>
{Preview1Data?.BookingLayout?.[1] && {Preview1Data?.BookingLayout?.[1] &&
Preview1Data?.BookingBilling?.[0] != 'Billing1' && Preview1Data?.BookingBilling?.[0] != 'Billing1' &&
Preview1Data?.BookingBilling?.[0] != 'Billing2' && Preview1Data?.BookingBilling?.[0] != 'Billing2' &&

View File

@ -26,9 +26,14 @@ import { SlArrowDown } from 'react-icons/sl';
import { IoCloseSharp } from 'react-icons/io5'; import { IoCloseSharp } from 'react-icons/io5';
import TooltipWrapper from '../../../../Components/Tooltip/Tooltip'; import TooltipWrapper from '../../../../Components/Tooltip/Tooltip';
import { isMobile } from 'react-device-detect'; import { isMobile } from 'react-device-detect';
import "./BSNavBarFavItems.scss" import './BSNavBarFavItems.scss';
const BSNavBarFavItems = ({ type, fill, drawerOpen = false }) => { const BSNavBarFavItems = ({
type,
fill,
drawerOpen = false,
setNavmenu = () => {},
}) => {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const [favopen, setFavopen] = useState(false); const [favopen, setFavopen] = useState(false);
const globalAllItemdata = useSelector(GlobalAllItemData); const globalAllItemdata = useSelector(GlobalAllItemData);

View File

@ -85,13 +85,13 @@
.AddFavList { .AddFavList {
position: fixed; position: fixed;
left: 0; left: 0;
top: 17rem; top: 15rem;
width: 100vw !important; width: 100vw !important;
padding: 1rem 1rem !important; padding: 1rem 1rem !important;
} }
.AddFavItemListCont { .AddFavItemListCont {
height: 34vh; height: 30vh;
overflow: auto; overflow: auto;
} }
@ -104,7 +104,7 @@
.AddFavList { .AddFavList {
position: fixed; position: fixed;
left: 0; left: 0;
top: 17rem; top: 15rem;
width: 100vw !important; width: 100vw !important;
padding: 1rem 1rem !important; padding: 1rem 1rem !important;
} }

View File

@ -1,6 +1,6 @@
import { useEffect, useRef, useState, useImperativeHandle, forwardRef } from 'react'; import { useEffect, useRef, useState, useImperativeHandle, forwardRef } from 'react';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { getPaymentStatusForBusinessUPI } from '../../../../Features/BookingScreen/BookingData/BookingData'; import { getPaymentStatusForBusinessUPI, PostCancelPayment } from '../../../../Features/BookingScreen/BookingData/BookingData';
const PaymentGatewayEmbedded = forwardRef(({ const PaymentGatewayEmbedded = forwardRef(({
orderId, orderId,
@ -65,6 +65,7 @@ const PaymentGatewayEmbedded = forwardRef(({
if (data.status === 'TIMEOUT') { if (data.status === 'TIMEOUT') {
// Stop polling and mark as timed out // Stop polling and mark as timed out
dispatch(PostCancelPayment({OrderId: orderId})).unwrap()
setTimedOut(true); setTimedOut(true);
setShowTimeout(true); setShowTimeout(true);
if (intervalRef.current) { if (intervalRef.current) {

View File

@ -1,7 +1,9 @@
import { useEffect } from 'react'; import { useEffect } from 'react';
import { useSelector, useDispatch, shallowEqual } from 'react-redux'; import { useSelector, useDispatch, shallowEqual } from 'react-redux';
import { import {
ChangeSubcategoryData,
getLayoutSubCategories, getLayoutSubCategories,
GlobalisFavClicked,
GlobalProductCategorie, GlobalProductCategorie,
} from '../../Features/BookingScreen/BookingData/BookingData'; } from '../../Features/BookingScreen/BookingData/BookingData';
import { getTemplateData } from '../../Features/ThemeChange/ThemeChange'; import { getTemplateData } from '../../Features/ThemeChange/ThemeChange';
@ -12,6 +14,7 @@ const LayoutSubCategoryFetcher = () => {
const ProdCat = useSelector(GlobalProductCategorie, shallowEqual); const ProdCat = useSelector(GlobalProductCategorie, shallowEqual);
const templateData = useSelector(getTemplateData, shallowEqual); const templateData = useSelector(getTemplateData, shallowEqual);
const favSelected = useSelector(GlobalisFavClicked);
const CompId = getSession('CompId'); const CompId = getSession('CompId');
const BranchId = getSession('BranchId'); const BranchId = getSession('BranchId');
@ -23,6 +26,11 @@ const LayoutSubCategoryFetcher = () => {
const isCategory5 = templateData?.BookingCategory?.[0] === 'Category5'; const isCategory5 = templateData?.BookingCategory?.[0] === 'Category5';
const isLayout2 = templateData?.BookingLayout?.[0] === 'Layout2'; const isLayout2 = templateData?.BookingLayout?.[0] === 'Layout2';
if (favSelected) {
dispatch(ChangeSubcategoryData([]));
return
}
if (isCategory5 && isLayout2) { if (isCategory5 && isLayout2) {
dispatch( dispatch(
getLayoutSubCategories({ getLayoutSubCategories({
@ -37,6 +45,7 @@ const LayoutSubCategoryFetcher = () => {
ProdCat, ProdCat,
templateData?.BookingCategory?.[0], templateData?.BookingCategory?.[0],
templateData?.BookingLayout?.[0], templateData?.BookingLayout?.[0],
favSelected
]); ]);
return null; // this component renders nothing return null; // this component renders nothing

View File

@ -5,7 +5,7 @@ import { Tooltip, Badge, Popconfirm } from 'antd';
import { isMobile } from 'react-device-detect'; import { isMobile } from 'react-device-detect';
import BookingCloseIcon from '../../Components/UtillComponents/BookingCloseIcon.jsx'; import BookingCloseIcon from '../../Components/UtillComponents/BookingCloseIcon.jsx';
const BSNavbar1 = lazy(() => import('../../Components/BSNavbar/BSNavbar1')); const BSNavbar1 = lazy(() => import('../../Components/BSNavbar/BSNavbar1'));
const CategoryHorizontal = lazy( const CategoryHorizontal = lazy(
() => import('../../Components/BSCategories/BSCategoryHorizontal') () => import('../../Components/BSCategories/BSCategoryHorizontal')
); );
const BSItemCard = lazy( const BSItemCard = lazy(
@ -16,10 +16,8 @@ const BSBillingTable2 = lazy(
() => () =>
import('../../Components/BSBillingTables/BSBillingTable2/BSBillingTable2') import('../../Components/BSBillingTables/BSBillingTable2/BSBillingTable2')
); );
const BSBillingTable3 = lazy(
() => import BSBillingTable3 from '../../Components/BSBillingTables/BSBillingTable3/BSBillingTable3overall';
import('../../Components/BSBillingTables/BSBillingTable3/BSBillingTable3overall')
);
import { dynamicComponentProps } from '../DynamicComponentProps.js'; import { dynamicComponentProps } from '../DynamicComponentProps.js';
import { import {
@ -95,16 +93,10 @@ const BSOtherServicesVerticalcat = lazy(
() => import('../../Components/BSCategories/BSOtherServicesVerticalcat.jsx') () => import('../../Components/BSCategories/BSOtherServicesVerticalcat.jsx')
); );
const SalesCountForStandard = lazy( const SalesCountForStandard = lazy(
() => import('../SalesCountForStandard.jsx') () => import('../SalesCountForStandard.jsx')
); );
const StandardTable = lazy(
() =>
import('../../Components/BSBillingTables/StandardTable/StandardTable.jsx')
);
const ComboSalesBillTable = lazy( const ComboSalesBillTable = lazy(
() => () =>
import('../../Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx') import('../../Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx')

View File

@ -17,6 +17,7 @@ import { DatePicProd } from "../../Components/Forms/DatePickerProduct";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { FaEye, FaPlus } from "react-icons/fa"; import { FaEye, FaPlus } from "react-icons/fa";
import { DefaultModal } from "../../Components/Modal/DefaultModal"; import { DefaultModal } from "../../Components/Modal/DefaultModal";
import { IoEye } from "react-icons/io5";
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const SEARCH_OPTIONS = [ const SEARCH_OPTIONS = [
@ -70,6 +71,8 @@ const SalesBillProductsReturn = () => {
const [currentEditingItem, setCurrentEditingItem] = useState(null); const [currentEditingItem, setCurrentEditingItem] = useState(null);
const [modalDescription, setModalDescription] = useState(''); const [modalDescription, setModalDescription] = useState('');
const [modalImageUrl, setModalImageUrl] = useState(''); const [modalImageUrl, setModalImageUrl] = useState('');
const [policyDeatilModal, setPolicyDeatilModal] = useState(false);
const [selectedPolicyDetails, setSelectedPolicyDetails] = useState(null);
console.log(selectedItems, "selectedItemsselectedItemsselectedItems") console.log(selectedItems, "selectedItemsselectedItemsselectedItems")
@ -77,7 +80,7 @@ const SalesBillProductsReturn = () => {
navigateTo(`${subDirectory}setting/sales-bill-product-return/list`); navigateTo(`${subDirectory}setting/sales-bill-product-return/list`);
}; };
const handleCheckboxChange = (item, checked) => { const handleCheckboxChange = (item, checked) => {
const { ProdId, InwardDtlId, Type, SalesQty, Rate, TotalAmt, TaxAmt, SinglePc, ProdNameQty,IsWarrantyEligible } = item; const { ProdId, InwardDtlId, Type, SalesQty, Rate, TotalAmt, TaxAmt, SinglePc, ProdNameQty, IsWarrantyEligible } = item;
if (checked) { if (checked) {
const data = { const data = {
ProdId, ProdId,
@ -108,7 +111,15 @@ const SalesBillProductsReturn = () => {
const description = product?.Description || "" const description = product?.Description || ""
return { ReturnEligible: eligible, Description: description }; return { ReturnEligible: eligible, Description: description };
}; };
const handleOrdermodalCancel = () => {
setPolicyDeatilModal(false);
setSelectedPolicyDetails(null);
};
const Viewdetails = (item) => {
const policy = policybasedprodcuts?.find(p => p.ProdId === item.ProdId) || null;
setSelectedPolicyDetails(policy);
setPolicyDeatilModal(true);
};
useEffect(() => { useEffect(() => {
const fetchPaymentOptions = async () => { const fetchPaymentOptions = async () => {
try { try {
@ -192,12 +203,11 @@ const SalesBillProductsReturn = () => {
try { try {
const res = await dispatch(getReturnBill(data)).unwrap(); const res = await dispatch(getReturnBill(data)).unwrap();
if (res?.data?.statusCode === 1) { if (res?.data?.statusCode === 1) {
const modifiedData = res?.data?.data?.map(item => { const modifiedData = res?.data?.data?.map(item => {
return { return {
...item, ...item,
productDetails: item?.productDetails.map(product => { productDetails: item?.productDetails?.map(product => {
return { return {
...product, ...product,
ExchangeQty: 0, ExchangeQty: 0,
@ -577,8 +587,9 @@ const SalesBillProductsReturn = () => {
<table className="custom-product-table"> <table className="custom-product-table">
<thead> <thead>
<tr> <tr>
<th></th> <th>Select</th>
<th style={{ width: "30px", whiteSpace: "normal", wordWrap: "break-word" }}>Sl.No</th> <th style={{ width: "30px", whiteSpace: "normal", wordWrap: "break-word" }}>Sl.No</th>
<th style={{ width: "100px", whiteSpace: "normal", wordWrap: "break-word" }}>Policy Details</th>
<th style={{ width: "100px", whiteSpace: "normal", wordWrap: "break-word" }}>Product Name</th> <th style={{ width: "100px", whiteSpace: "normal", wordWrap: "break-word" }}>Product Name</th>
<th style={{ width: "70px", whiteSpace: "normal", wordWrap: "break-word" }}>Sales-Qty</th> <th style={{ width: "70px", whiteSpace: "normal", wordWrap: "break-word" }}>Sales-Qty</th>
<th style={{ width: "80px", whiteSpace: "normal", wordWrap: "break-word" }}>Rate</th> <th style={{ width: "80px", whiteSpace: "normal", wordWrap: "break-word" }}>Rate</th>
@ -597,17 +608,23 @@ const SalesBillProductsReturn = () => {
disabled={!ReturnEligible} disabled={!ReturnEligible}
onChange={(e) => handleCheckboxChange(item, e.target.checked)} onChange={(e) => handleCheckboxChange(item, e.target.checked)}
/> />
{!ReturnEligible && ( {/* {(
<span style={{ marginLeft: 4 }}> <span style={{ marginLeft: 4 }}>
<Tooltip title={Description}> <Tooltip title={Description}>
{/* <span style={{ color: '#faad14', cursor: 'pointer', fontSize: 18, verticalAlign: 'middle' }}> */} <IoEye
<RiErrorWarningLine /> style={{ color: '#1292EE', fontSize: '25px', cursor: 'pointer' }}
{/* </span> */} onClick={() => Viewdetails(item)}
/>
</Tooltip> </Tooltip>
</span> </span>
)} )} */}
</td> </td>
<td style={{ textAlignLast: "center", width: "30px", whiteSpace: "normal", wordWrap: "break-word" }}>{index + 1}</td> <td style={{ textAlignLast: "center", width: "30px", whiteSpace: "normal", wordWrap: "break-word" }}>{index + 1}</td>
<td style={{ width: "100px", wordWrap: "break-word" }}>
<IoEye
style={{ color: '#1292EE', fontSize: '25px', cursor: 'pointer' }}
onClick={() => Viewdetails(item)}
/></td>
<td style={{ width: "100px", wordWrap: "break-word" }}>{item.ProdNameQty}</td> <td style={{ width: "100px", wordWrap: "break-word" }}>{item.ProdNameQty}</td>
<td style={{ textAlignLast: "center" }}>{item.SalesQty}</td> <td style={{ textAlignLast: "center" }}>{item.SalesQty}</td>
<td style={{ textAlignLast: "end" }}>{item.Rate}</td> <td style={{ textAlignLast: "end" }}>{item.Rate}</td>
@ -634,11 +651,11 @@ const SalesBillProductsReturn = () => {
<th>Sales-Qty</th> <th>Sales-Qty</th>
<th>Return-Qty</th> <th>Return-Qty</th>
<th>More</th> <th>More</th>
<th>Details</th> {/* <th>Details</th> */}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{selectedItems.map((item, index) => { {selectedItems?.map((item, index) => {
return ( return (
<tr key={item.ProdId} > <tr key={item.ProdId} >
<td>{index + 1}</td> <td>{index + 1}</td>
@ -706,7 +723,7 @@ const SalesBillProductsReturn = () => {
<FaPlus /> <FaPlus />
</button> </button>
</td> </td>
<td style={{ textAlign: "center", maxWidth: "150px" }}> {/* <td style={{ textAlign: "center", maxWidth: "150px" }}>
{item.description && ( {item.description && (
<Tooltip title={item.description}> <Tooltip title={item.description}>
<div style={{ <div style={{
@ -724,7 +741,7 @@ const SalesBillProductsReturn = () => {
<div>🖼</div> <div>🖼</div>
</Tooltip> </Tooltip>
)} )}
</td> </td> */}
</tr> </tr>
); );
})} })}
@ -816,6 +833,43 @@ const SalesBillProductsReturn = () => {
handleCancel={handleCancel} handleCancel={handleCancel}
handleSubmit={handleModalSubmit} handleSubmit={handleModalSubmit}
/> />
<DefaultModal
open={policyDeatilModal}
title="Product Policy Details"
handleCancel={handleOrdermodalCancel}
footer={false}
children={
<div style={{ padding: '8px' }}>
{selectedPolicyDetails ? (
<table style={{ width: '100%', borderCollapse: 'collapse', fontSize: '14px' }}>
<tbody>
{[
['Product Name', selectedPolicyDetails.ProdName],
['Policy Name', selectedPolicyDetails.PolicyName],
['Description', selectedPolicyDetails.Description],
['Return Allowed', selectedPolicyDetails.IsReturnAllowed === 'Y' ? 'Yes' : 'No'],
['Exchange Allowed', selectedPolicyDetails.IsExchangeAllowed === 'Y' ? 'Yes' : 'No'],
['Return Window (Days)', selectedPolicyDetails.ReturnWindowDays],
['Exchange Window (Days)', selectedPolicyDetails.ExchangeWindowDays],
['Exchange Limit Count', selectedPolicyDetails.ExchangeLimitCount ?? 'N/A'],
['Return Eligible', selectedPolicyDetails.ReturnEligible ? 'Yes' : 'No'],
// ['Effective From', selectedPolicyDetails.EffectiveFrom ? dayjs(selectedPolicyDetails.EffectiveFrom).format('DD-MM-YYYY') : 'N/A'],
// ['Effective To', selectedPolicyDetails.EffectiveTo ? dayjs(selectedPolicyDetails.EffectiveTo).format('DD-MM-YYYY') : 'N/A'],
].map(([label, value]) => (
<tr key={label} style={{ borderBottom: '1px solid #f0f0f0' }}>
<td style={{ padding: '8px', fontWeight: 600, color: '#555', width: '45%' }}>{label}</td>
<td style={{ padding: '8px', color: '#222' }}>{value}</td>
</tr>
))}
</tbody>
</table>
) : (
<p style={{ textAlign: 'center', color: '#888' }}>No policy found for this product.</p>
)}
</div>
}
/>
</div> </div>
</div> </div>
</div> </div>

View File

@ -25,8 +25,7 @@ import { Messages } from '../../Components/Notifications/Messages';
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx'; import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
import { useAuth } from '../../AuthContext.jsx'; import { useAuth } from '../../AuthContext.jsx';
import { getPreferenceData } from '../../Features/BookingScreen/BookingData/BookingData.js'; import { getPreferenceData } from '../../Features/BookingScreen/BookingData/BookingData.js';
const subDirectory = import.meta.env.ENV_BASE_URL;
const subDirectory = import.meta.env.BASE_URL;
const items = [ const items = [
{ {
@ -71,7 +70,6 @@ const CustomerMaster = () => {
const [addnewAccess, setaddnewAccess] = useState(true); const [addnewAccess, setaddnewAccess] = useState(true);
const [allowDecimal, setAllowDecimal] = useState(false); const [allowDecimal, setAllowDecimal] = useState(false);
async function fetchData() { async function fetchData() {
if (location?.state?.Notiffy) { if (location?.state?.Notiffy) {
setMessageType(location?.state?.Notiffy.messageType); setMessageType(location?.state?.Notiffy.messageType);
@ -155,13 +153,22 @@ const CustomerMaster = () => {
} }
}; };
const getPreference = async () => { const getPreference = async () => {
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId, UserId: UserId }; const data = {
const { data: res } = await dispatch(getPreferenceData(data)).unwrap() AppId: AppId,
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y'); CompId: CompId,
BranchId: BranchId,
UserId: UserId,
};
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'decimal' &&
setting?.SettingValue === 'Y'
);
if (decimalSetting) { if (decimalSetting) {
setAllowDecimal(true) setAllowDecimal(true);
}
} }
};
//Delete //Delete
const statusFormatter = async (row) => { const statusFormatter = async (row) => {
@ -251,7 +258,8 @@ const CustomerMaster = () => {
width: '100px', width: '100px',
render: (text, row) => ( render: (text, row) => (
<a style={{ color: 'black', width: '200px' }}> <a style={{ color: 'black', width: '200px' }}>
{(row?.CustName ? (row?.CustName + ' ') : '') + (row?.CustShortName || "") || row?.CustMobile} {(row?.CustName ? row?.CustName + ' ' : '') +
(row?.CustShortName || '') || row?.CustMobile}
</a> </a>
), ),
filteredValue: [searchedText], filteredValue: [searchedText],
@ -260,8 +268,12 @@ const CustomerMaster = () => {
String(record.CustShortName) String(record.CustShortName)
?.toLowerCase() ?.toLowerCase()
?.includes(value?.toLowerCase()) || ?.includes(value?.toLowerCase()) ||
String(record.CustName)?.toLowerCase()?.includes(value?.toLowerCase()) || String(record.CustName)
String(record.CustMobile)?.toLowerCase()?.includes(value?.toLowerCase()) ?.toLowerCase()
?.includes(value?.toLowerCase()) ||
String(record.CustMobile)
?.toLowerCase()
?.includes(value?.toLowerCase())
); );
}, },
sorter: (a, b) => a?.CustName?.length - b?.CustName?.length, sorter: (a, b) => a?.CustName?.length - b?.CustName?.length,

View File

@ -1775,11 +1775,6 @@ const RetailDashboard = () => {
UserType === 'Super Admin' || UserType === 'Super Admin' ||
UserType === 'Super Admin User' UserType === 'Super Admin User'
) { ) {
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen().catch((err) => {
console.error('Error attempting to enable fullscreen:', err);
});
}
navigate(`${subDirectory}sales`); navigate(`${subDirectory}sales`);
} }
}} }}

View File

@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useState } from 'react'; import React, { useCallback, useEffect, useState } from 'react';
import { Popconfirm, Drawer, Badge } from 'antd'; import { Popconfirm, Drawer, Badge, Modal } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons'; import { QuestionCircleOutlined } from '@ant-design/icons';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { IoIosArrowForward } from 'react-icons/io'; import { IoIosArrowForward } from 'react-icons/io';
@ -43,7 +43,7 @@ import KioskPayment from '../Payment/KioskPaymentWithModal';
import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin'; import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin';
import { FaAngleUp, FaCircleCheck } from 'react-icons/fa6'; import { FaAngleUp, FaCircleCheck } from 'react-icons/fa6';
import { FaAngleDown } from 'react-icons/fa'; import { FaAngleDown } from 'react-icons/fa';
import { PostBookingData } from '../../../Features/BookingScreen/BookingData/BookingData'; import { PostBookingData, PostCancelPayment } from '../../../Features/BookingScreen/BookingData/BookingData';
import { import {
generateRandomKey, generateRandomKey,
getSession, getSession,
@ -129,6 +129,7 @@ const selfKioskFooter = (props) => {
const [chairInformation, setChairInformation] = useState(); const [chairInformation, setChairInformation] = useState();
const [TableINformation, setTableINformation] = useState(); const [TableINformation, setTableINformation] = useState();
const [paymentUrl, setpaymentUrl] = useState(null); const [paymentUrl, setpaymentUrl] = useState(null);
const [showCancelConfirm, setShowCancelConfirm] = useState(null);
const [TransctionId, setTransctionId] = useState(null); const [TransctionId, setTransctionId] = useState(null);
const [paymentGatewayAccess, setPaymentGatewayAccess] = useState([]); const [paymentGatewayAccess, setPaymentGatewayAccess] = useState([]);
// let chairInformation = getSession('table'); // let chairInformation = getSession('table');
@ -939,6 +940,15 @@ const selfKioskFooter = (props) => {
setMessageType(null); setMessageType(null);
}, []); }, []);
// PostCancelPayment
const CancelPayment = async () => {
const response = await dispatch(PostCancelPayment({OrderId: TransctionId})).unwrap()
if (response?.data?.statusCode) {
// setBusinessUPI(false);
setpaymentUrl(null)
}
}
return ( return (
<div> <div>
<Messages <Messages
@ -1462,7 +1472,8 @@ const selfKioskFooter = (props) => {
<button <button
className="paymentclose-btn" className="paymentclose-btn"
onClick={() => { onClick={() => {
setpaymentUrl(null); // setpaymentUrl(null);
setShowCancelConfirm(true);
}} }}
> >
@ -1476,6 +1487,21 @@ const selfKioskFooter = (props) => {
></iframe> ></iframe>
</div> </div>
)} )}
{showCancelConfirm && (
<Modal
open={showCancelConfirm}
title="Cancel Payment"
onOk={() => {
setShowCancelConfirm(false);
CancelPayment()
}}
onCancel={() => setShowCancelConfirm(false)}
okText="Yes"
cancelText="No"
>
Do you want to cancel the payment?
</Modal>
)}
</div> </div>
); );
}; };

View File

@ -61,6 +61,7 @@ import {
import { import {
getConfigType, getConfigType,
getPreferenceData, getPreferenceData,
PostCancelPayment,
PreferenceData, PreferenceData,
PutPendingPaymentList, PutPendingPaymentList,
} from '../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../Features/BookingScreen/BookingData/BookingData';
@ -1092,6 +1093,15 @@ const KioskPayment = (props) => {
}, 2000); }, 2000);
} }
}; };
// PostCancelPayment
const CancelPayment = async () => {
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
if (response?.data?.statusCode) {
ClearAllGlobalStateDatas();
CustomerDisplay();
setBusinessUPI(false);
}
}
const handleDevice = async (paymentDetails, option) => { const handleDevice = async (paymentDetails, option) => {
const paymentDeviceDetails = await dispatch( const paymentDeviceDetails = await dispatch(
@ -2342,6 +2352,7 @@ const KioskPayment = (props) => {
handleCancel={() => setShowCancelConfirm(true)} handleCancel={() => setShowCancelConfirm(true)}
footer={false} footer={false}
width={500} width={500}
destroyOnClose={true}
children={ children={
<> <>
<PaymentGatewayEmbedded <PaymentGatewayEmbedded
@ -2359,14 +2370,27 @@ const KioskPayment = (props) => {
} }
/> />
{showCancelConfirm && ( {showCancelConfirm && (
// <Modal
// open={showCancelConfirm}
// title="Cancel Payment"
// onOk={() => {
// paymentGatewayRef.current?.clearPolling();
// setBusinessUPI(false);
// setShowCancelConfirm(false);
// ClearAllGlobalStateDatas();
// }}
// onCancel={() => setShowCancelConfirm(false)}
// okText="Yes"
// cancelText="No"
// >
// Do you want to cancel the payment?
// </Modal>
<Modal <Modal
open={showCancelConfirm} open={showCancelConfirm}
title="Cancel Payment" title="Cancel Payment"
onOk={() => { onOk={() => {
paymentGatewayRef.current?.clearPolling();
setBusinessUPI(false);
setShowCancelConfirm(false); setShowCancelConfirm(false);
ClearAllGlobalStateDatas(); CancelPayment()
}} }}
onCancel={() => setShowCancelConfirm(false)} onCancel={() => setShowCancelConfirm(false)}
okText="Yes" okText="Yes"

View File

@ -49,7 +49,7 @@ const OtherServices = ({ formType }) => {
const AppId = getSession('AppId'); const AppId = getSession('AppId');
const UserId = getSession('UserId'); const UserId = getSession('UserId');
console.log(SelectedCategory, 'SelectedCategory'); console.log(TaxData, 'TaxData');
const items = [ const items = [
{ {
name: 'Home', name: 'Home',
@ -435,8 +435,8 @@ const OtherServices = ({ formType }) => {
<DropDowns <DropDowns
options={[ options={[
...TaxData?.map((option) => ({ ...TaxData?.map((option) => ({
value: option.TaxId, value: option?.TaxId,
label: option.TaxIdName, label: `${option?.TaxIdName} - ${option?.TaxPercentage}%`,
})), })),
]} ]}
label="Tax" label="Tax"

View File

@ -1,6 +1,5 @@
import React, { useState, useRef, useEffect, useContext } from 'react'; import React, { useState, useRef, useEffect, useContext } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
// import { read, utils } from 'xlsx';
import ExcelJS from 'exceljs'; import ExcelJS from 'exceljs';
import { Table, Form, Input, Tooltip, Modal, Select } from 'antd'; import { Table, Form, Input, Tooltip, Modal, Select } from 'antd';
import { import {
@ -18,7 +17,6 @@ import {
getFieldSetupData, getFieldSetupData,
} from '../../Features/ProductPage/ProductPage.js'; } from '../../Features/ProductPage/ProductPage.js';
import Imageupload from '../../Components/Forms/Upload.jsx'; import Imageupload from '../../Components/Forms/Upload.jsx';
import { BiSolidFileExport } from 'react-icons/bi';
import { CiExport } from 'react-icons/ci'; import { CiExport } from 'react-icons/ci';
import { uploadImage } from '../../Features/upload/upload.js'; import { uploadImage } from '../../Features/upload/upload.js';
@ -618,15 +616,20 @@ const ProductExcel = ({
}; };
console.log(tableFieldPreferences, 'tableFieldPreferences'); console.log(tableFieldPreferences, 'tableFieldPreferences');
useEffect(() => { useEffect(() => {
if (excelData && excelData?.length > 0) { if (excelData && excelData?.length > 0) {
let ExecelToJsConvertion = []; let ExecelToJsConvertion = [];
let slicedData = excelData?.slice(1); let slicedData = excelData?.slice(1);
let filteredData = slicedData?.filter( let filteredData = slicedData?.filter((item) => {
(item) => item?.[item?.length - 1]?.trim() !== 'sample row' const values = Object.values(item || {});
); const lastVal = values[values.length - 1];
return typeof lastVal === 'string'
? lastVal.trim() !== 'sample row'
: true;
});
filteredData?.map((item, index) => { filteredData?.map((item, index) => {
ExecelToJsConvertion.push({ ExecelToJsConvertion?.push({
key: index, key: index,
ProductName: item?.['0'], ProductName: item?.['0'],
Quantity: item?.['1'], Quantity: item?.['1'],
@ -1006,112 +1009,6 @@ const ProductExcel = ({
reader.readAsArrayBuffer(file); reader.readAsArrayBuffer(file);
}; };
// const uploadAndProcessExcel = (file) => {
// const reader = new FileReader();
// reader.onload = (e) => {
// const data = new Uint8Array(e.target.result);
// const workbook = read(data, { type: 'array' });
// const worksheet = workbook.Sheets[workbook.SheetNames[0]];
// const jsonData = utils.sheet_to_json(worksheet, {
// header: 1,
// raw: false,
// dateNF: 'DD/MM/YY',
// });
// const nonEmptyRows = jsonData.filter((row) =>
// row.some((cell) => cell !== '')
// );
// const header = nonEmptyRows[0];
// const rows = nonEmptyRows.slice(1);
// const dateFields = [
// 'Available From',
// 'Available To',
// 'Manufacture Date',
// 'Expire Date',
// 'Stock Date',
// ];
// function convertToDisplayFormat(dateString) {
// const date = new Date(dateString);
// const day = date.getDate().toString().padStart(2, '0');
// const month = (date.getMonth() + 1).toString().padStart(2, '0');
// const year = date.getFullYear().toString();
// return `${day}-${month}-${year}`;
// }
// const formattedData = rows.map((row) => {
// let rowData = header.reduce((acc, col, columnIndex) => {
// if (dateFields?.includes(col)) {
// acc[col] = convertToDisplayFormat(row[columnIndex]);
// } else {
// acc[col] = row[columnIndex];
// }
// return acc;
// }, {});
// return rowData;
// });
// if (jsonData.length > 0) {
// const extractedHeaders = Object.keys(formattedData[0]);
// const filteredData = formattedData.filter(
// (item) => !Object.values(item)?.includes('sample row')
// );
// // Add default variant name if missing
// const updatedData = filteredData.map((item) => ({
// ...item,
// 'Product Varient Name':
// item['Product Varient Name'] === undefined
// ? 'Variant 1'
// : item['Product Varient Name'],
// 'Available To':
// item['Available To'] == 'NaN-NaN-NaN' ? '' : item['Available To'],
// ProdId: item['ProdId'] || null,
// }));
// // Detect modified products
// const modifiedProducts = findModifiedProducts(OrginalData, updatedData);
// const modifiedIds = new Set(modifiedProducts.map((p) => p.ProdId));
// const originalIds = new Set(OrginalData?.map((p) => p.ProdId) || []);
// const markedData = updatedData
// .map((item) => ({
// ...item,
// isModified:
// modifiedIds.has(item.ProdId) || !originalIds.has(item.ProdId),
// }))
// .sort((a, b) => b.isModified - a.isModified);
// setUploadedRawData(markedData);
// console.log(modifiedProducts, 'modifiedProducts');
// // Set only once with final data
// setHeaders(extractedHeaders);
// autoMapFields(extractedHeaders);
// dispatch(uploadExcel({ file, jsonData: nonEmptyRows }));
// setWorksheet(worksheet);
// setDatas([]); // Clear mapped state initially
// setExcelData([]);
// }
// // setMappingOpen(true);
// dispatch(uploadExcel({ file, jsonData: nonEmptyRows }));
// setWorksheet(worksheet);
// setWorksheet1(worksheet1);
// setDatas(formattedData); // Update Datas state here
// // setExcelData(formattedData);
// };
// reader.readAsArrayBuffer(file);
// };
useEffect(() => { useEffect(() => {
imagecall(); imagecall();
addOnlineImage(); addOnlineImage();
@ -1876,24 +1773,6 @@ const ProductExcel = ({
} }
}); });
// // Now set protection for all rows
// // First, unlock ALL cells in the worksheet
// for (let rowNum = 1; rowNum <= worksheet.rowCount; rowNum++) {
// const row = worksheet.getRow(rowNum);
// row.eachCell({ includeEmpty: true }, (cell, colNumber) => {
// const config = selectedColumns[colNumber - 1];
// cell.protection = { locked: config?.locked || false };
// });
// }
// // Then lock ONLY the header row (row 1) and sample row (row 2)
// worksheet.getRow(1).eachCell({ includeEmpty: true }, (cell) => {
// cell.protection = { locked: true };
// });
// worksheet.getRow(2).eachCell({ includeEmpty: true }, (cell) => {
// cell.protection = { locked: true };
// });
// Add empty rows for data entry // Add empty rows for data entry
for (let i = 1; i <= 1000; i++) { for (let i = 1; i <= 1000; i++) {
worksheet.addRow({}); worksheet.addRow({});
@ -2479,24 +2358,6 @@ const ProductExcel = ({
} }
}); });
// Generate and download the file
// const buffer = await workbook.xlsx.writeBuffer();
// const blob = new Blob([buffer], {
// type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
// });
// const filename = 'Product Data.xlsx';
// if (typeof window !== 'undefined') {
// if (window.navigator && window.navigator.msSaveOrOpenBlob) {
// window.navigator.msSaveOrOpenBlob(blob, filename);
// } else {
// const downloadLink = document.createElement('a');
// downloadLink.href = window.URL.createObjectURL(blob);
// downloadLink.download = filename;
// downloadLink.click();
// }
// }
const buffer = await workbook.xlsx.writeBuffer(); const buffer = await workbook.xlsx.writeBuffer();
downloadFile( downloadFile(
@ -2514,18 +2375,6 @@ const ProductExcel = ({
}; };
// Usage examples:
// Download only specific fields:
// handleDownload(['ProdName', 'Size']); // Only Product Name and Quantity
// handleDownload(['ProdName', 'Size', 'UOM', 'SellPrice']); // Multiple fields
// handleDownload(['ProdName', 'Size', 'UOM', 'SellPrice', 'ProdCat', 'Brand']); // More fields
// Available field names:
// 'ProdName', 'Size', 'UOM', 'SellPrice', 'ProdCat', 'ProdSubCat', 'Brand',
// 'ProdVarientName', 'MRP', 'StockAvailable', 'OfferPrice', 'Supplier', 'TaxId',
// 'AutoGenerateQr', 'AddQrCode', 'SpecialPrice', 'OnePiecePrice', 'AutoGenOnePieceQr',
// 'AutoGenOnePieceQrNum', 'CESS', 'HSNCode', 'PartNumber', 'Rack', 'ManufDate',
// 'ExpDate', 'AvailableFrom', 'AvailableTo'
const handleFileSubmit = (e) => { const handleFileSubmit = (e) => {
e.preventDefault(); e.preventDefault();
if (excelFile === null) { if (excelFile === null) {
@ -2881,7 +2730,7 @@ const ProductExcel = ({
...record, ...record,
...values, ...values,
}); });
} catch (errInfo) { } } catch (errInfo) {}
}; };
let childNode = children; let childNode = children;
@ -2900,7 +2749,7 @@ const ProductExcel = ({
<div <div
className="editable-cell-value-wrap" className="editable-cell-value-wrap"
style={{ style={{
paddingRight: 24, textAlign: 'right',
}} }}
onClick={toggleEdit} onClick={toggleEdit}
> >
@ -3185,13 +3034,24 @@ const ProductExcel = ({
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
justifyContent: 'space-between', justifyContent: 'space-between',
height: '80%', alignItems: 'center',
height: '60%',
}} }}
> >
<div style={{ display: 'flex', flexDirection: 'column' }}> <div style={{ display: 'flex', flexDirection: 'column' }}>
<span>{col.title}</span> <span
style={{
whiteSpace: 'nowrap',
fontWeight: '500',
fontFamily: 'Poppins',
}}
>
{col.title}
</span>
{!isMapped && ( {!isMapped && (
<span style={{ color: 'red', fontSize: '11px' }}>Not mapped</span> <span style={{ color: '#f7a0a0', fontSize: '11px' }}>
Not mapped
</span>
)} )}
</div> </div>
@ -3240,7 +3100,7 @@ const ProductExcel = ({
style={{ style={{
position: 'absolute', position: 'absolute',
right: '-17px', right: '-17px',
top: '80%', top: '90%',
transform: 'translateY(-50%)', transform: 'translateY(-50%)',
color: 'red', color: 'red',
fontSize: 14, fontSize: 14,
@ -3370,14 +3230,15 @@ const ProductExcel = ({
autoComplete="off" autoComplete="off"
onSubmit={handleFileSubmit} onSubmit={handleFileSubmit}
> >
<div <div className="download-linkMain">
<div className="HeadingUploadExl">
<p
style={{ style={{
display: 'flex', fontSize: '16px',
justifyContent: 'space-between', fontWeight: '500',
flexWrap: 'wrap', whiteSpace: 'nowrap',
}} }}
> >
<p style={{ fontSize: '20px', fontWeight: '500' }}>
Upload Your Excel Upload Your Excel
</p> </p>
@ -3386,7 +3247,6 @@ const ProductExcel = ({
display: 'flex', display: 'flex',
flexDirection: 'row', flexDirection: 'row',
gap: '0.5rem', gap: '0.5rem',
margin: '1rem 0',
}} }}
> >
<Tooltip title="Field Setup"> <Tooltip title="Field Setup">
@ -3417,18 +3277,10 @@ const ProductExcel = ({
Export Excel Export Excel
</div> </div>
</div> </div>
{/* {excelData?.length > 0 && excelData &&
<div className="export-excel-div" onClick={() => setMappingOpen(true)}> {message && (
<div> <div style={{ color: '#ff4d4f' }}>No Data Found</div>
<CiBoxList /> )}
</div>
<div>
Map Your Fields
</div>
</div>
} */}
{loading && <div style={{ color: '#ff4d4f' }}>Loading...</div>}
{message && <div style={{ color: '#ff4d4f' }}>No Data Found</div>}
</div> </div>
{excelData?.length > 0 && excelData && ( {excelData?.length > 0 && excelData && (
@ -3449,11 +3301,9 @@ const ProductExcel = ({
className="download-link" className="download-link"
style={{ style={{
display: 'flex', display: 'flex',
alignItems: 'flex-end',
// justifyContent: "space-between",
justifyContent: justifyContent:
excelData?.length > 0 ? 'space-between' : 'flex-end', excelData?.length > 0 ? 'space-between' : 'flex-end',
width: '100%', gap: '1rem',
}} }}
> >
{excelData?.length > 0 && ( {excelData?.length > 0 && (
@ -3476,6 +3326,7 @@ const ProductExcel = ({
</button> </button>
</Tooltip> </Tooltip>
</div> </div>
</div>
{(!excelData || excelData?.length === 0) && ( {(!excelData || excelData?.length === 0) && (
<> <>
@ -3565,13 +3416,6 @@ const ProductExcel = ({
margin: '1rem 0rem', margin: '1rem 0rem',
}} }}
> >
{/* <Tooltip title="Format Sheet" placement="bottom">
<div className="download-link" onClick={handleDownload} style={{ display: 'flex', alignItems: 'center', gap: '.5rem', padding: '0.3rem 0.4rem', borderRadius: '6px', backgroundColor: 'ghostwhite' }} >
<FiDownload style={{ fontSize: '20px', }} />
<a style={{ color: '#000' }}> Download</a>
</div>
</Tooltip> */}
{excelData && excelData?.length > 0 && ( {excelData && excelData?.length > 0 && (
<div <div
className="cancel-link" className="cancel-link"
@ -3602,7 +3446,11 @@ const ProductExcel = ({
/> />
</div> </div>
<div className="field-setup-content"> <div className="field-setup-content">
<Form onFinish={handleFieldSetupSubmit} ref={formRef}> <Form
onFinish={handleFieldSetupSubmit}
ref={formRef}
style={{ marginTop: '1rem' }}
>
<Form.Item name="fields"> <Form.Item name="fields">
<DropDowns <DropDowns
label="Select fields" label="Select fields"
@ -3657,7 +3505,8 @@ const ProductExcel = ({
<div className="productonlineImg"> <div className="productonlineImg">
{imagedata?.map((item, index) => ( {imagedata?.map((item, index) => (
<div <div
className={`singleimg ${selectedImage === item ? 'selected' : '' className={`singleimg ${
selectedImage === item ? 'selected' : ''
}`} }`}
key={index} key={index}
onClick={() => setSelectedImage(item)} onClick={() => setSelectedImage(item)}
@ -3680,7 +3529,6 @@ const ProductExcel = ({
<Modal <Modal
title="Map Your Fields" title="Map Your Fields"
open={MappingOpen} open={MappingOpen}
// onOk={handleMappingConfirm}
onCancel={() => setMappingOpen(false)} onCancel={() => setMappingOpen(false)}
> >
{requiredFields.map((field) => { {requiredFields.map((field) => {

View File

@ -2714,7 +2714,7 @@ const ProductList = () => {
open={openExcel} open={openExcel}
title="Bulk Upload" title="Bulk Upload"
footer={true} footer={true}
width={excelDataValues?.length > 0 ? 2500 : 600} width={excelDataValues?.length > 0 ? 2500 : 700}
className={'bulkuploadmodal'} className={'bulkuploadmodal'}
children={ children={
<> <>

View File

@ -18,14 +18,14 @@ function RedirectApps() {
const SessionId = encryptedValuesUrlFun(getSession('SessionId')); const SessionId = encryptedValuesUrlFun(getSession('SessionId'));
// const AuthToken = sessionStorage.getItem('auth'); // const AuthToken = sessionStorage.getItem('auth');
if (sessionStorage.getItem('BranchId') !== null) { if (getSession('BranchId') !== null) {
clearSession('BranchId'); clearSession('BranchId');
} }
if (sessionStorage.getItem('AppId') !== null) { if (getSession('AppId') !== null) {
clearSession('AppId'); clearSession('AppId');
} }
if (sessionStorage.getItem('hasRefreshed') !== null) { if (getSession('hasRefreshed') !== null) {
sessionStorage.removeItem('hasRefreshed'); clearSession('hasRefreshed');
} }
const param = { const param = {
MN: MobileNo, MN: MobileNo,

View File

@ -41,6 +41,7 @@ const DateWiseReport = () => {
getSession('AppType')?.toLowerCase() == 'wholesale' ? true : false; getSession('AppType')?.toLowerCase() == 'wholesale' ? true : false;
const [OrderFromDate, setOrderFromDate] = useState(); const [OrderFromDate, setOrderFromDate] = useState();
const [OrderToDate, setOrderToDate] = useState(); const [OrderToDate, setOrderToDate] = useState();
const sessionuserid = getSession('UserId')
const [UserId, setUserId] = useState( const [UserId, setUserId] = useState(
UserRole != 'Employee' ? 0 : getSession('UserId') UserRole != 'Employee' ? 0 : getSession('UserId')
); );
@ -63,7 +64,7 @@ const DateWiseReport = () => {
setting?.SettingIdName?.toLowerCase() === 'mobilea4' && setting?.SettingIdName?.toLowerCase() === 'mobilea4' &&
setting?.SettingValue === 'Y' setting?.SettingValue === 'Y'
); );
console.log(MobileA4Print, 'MobileA4PrintMobileA4Print'); console.log(MobileA4Print,SettingDataSelector, 'MobileA4PrintMobileA4Print');
useEffect(() => { useEffect(() => {
if (dataSource?.length > 0) { if (dataSource?.length > 0) {
@ -368,7 +369,7 @@ const DateWiseReport = () => {
}, []); }, []);
const getPreference = async () => { const getPreference = async () => {
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId }; const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: sessionuserid };
const { data: res } = await dispatch(getPreferenceData(data)).unwrap(); const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find( const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
(setting) => (setting) =>
@ -545,12 +546,12 @@ const DateWiseReport = () => {
let TokenData = ''; let TokenData = '';
let FooterPrint = ''; let FooterPrint = '';
if (isMobile) { if (isMobile) {
if (MobileA4Print) { // if (MobileA4Print) {
ReportMobilePDFPrint({ // ReportMobilePDFPrint({
printId: 'RePrint', // printId: 'RePrint',
printStyle: style, // printStyle: style,
}); // });
} else { // } else {
var textEncoded = encodeURI(receiptText); var textEncoded = encodeURI(receiptText);
var TypeCheck = 'PrintReceipt'; var TypeCheck = 'PrintReceipt';
var scheme = 'pozoprinter'; var scheme = 'pozoprinter';
@ -578,7 +579,7 @@ const DateWiseReport = () => {
FooterPrint + FooterPrint +
'HasFooterTextE' + 'HasFooterTextE' +
';end;'; ';end;';
} // }
} else { } else {
await printDiv('RePrint', style); await printDiv('RePrint', style);
} }

View File

@ -69,6 +69,7 @@ const ItemWiseReport = () => {
const BranchId = getSession('BranchId'); const BranchId = getSession('BranchId');
const AppId = getSession('AppId'); const AppId = getSession('AppId');
const UserRole = getSession('UserType'); const UserRole = getSession('UserType');
const sessionuserid = getSession('UserId')
const [UserId, setUserId] = useState( const [UserId, setUserId] = useState(
UserRole != 'Employee' ? 0 : getSession('UserId') UserRole != 'Employee' ? 0 : getSession('UserId')
); );
@ -79,7 +80,7 @@ const ItemWiseReport = () => {
setting?.SettingIdName?.toLowerCase() === 'mobilea4' && setting?.SettingIdName?.toLowerCase() === 'mobilea4' &&
setting?.SettingValue === 'Y' setting?.SettingValue === 'Y'
); );
console.log(MobileA4Print,SettingDataSelector, 'MobileA4PrintMobileA4Print')
useEffect(() => { useEffect(() => {
getPreference(); getPreference();
}, []); }, []);
@ -210,7 +211,7 @@ const ItemWiseReport = () => {
} }
}, [apiCall]); }, [apiCall]);
const getPreference = async () => { const getPreference = async () => {
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId }; const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: sessionuserid };
const { data: res } = await dispatch(getPreferenceData(data)).unwrap(); const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find( const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
(setting) => (setting) =>
@ -310,12 +311,12 @@ const ItemWiseReport = () => {
}; };
const Print = async () => { const Print = async () => {
if (isMobile) { if (isMobile) {
if (MobileA4Print) { // if (MobileA4Print) {
ReportMobilePDFPrint({ // ReportMobilePDFPrint({
printId: 'RePrint', // printId: 'RePrint',
printStyle: style, // printStyle: style,
}); // });
} else { // } else {
let LogoImage = ''; let LogoImage = '';
let TokenData = ''; let TokenData = '';
let FooterPrint = ''; let FooterPrint = '';
@ -346,7 +347,7 @@ const ItemWiseReport = () => {
FooterPrint + FooterPrint +
'HasFooterTextE' + 'HasFooterTextE' +
';end;'; ';end;';
} // }
} else { } else {
await printDiv('RePrint', style); await printDiv('RePrint', style);
} }

View File

@ -4,6 +4,7 @@
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
gap: 10px; gap: 10px;
margin-top: 4px;
} }
.BST1-Payment-onlypay { .BST1-Payment-onlypay {

View File

@ -78,7 +78,7 @@
} }
.BSItemCard-content { .BSItemCard-content {
padding: 1px 0; padding: 3px 0;
background-color: rgba(255, 255, 255, 0.8); background-color: rgba(255, 255, 255, 0.8);
position: absolute; position: absolute;
display: flex; display: flex;
@ -96,7 +96,8 @@
font-weight: 500; font-weight: 500;
max-width: 130px; max-width: 130px;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 3; -webkit-line-clamp: 2;
line-height: 1;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
} }

View File

@ -635,11 +635,10 @@
// //
.resNavbarMain { .resNavbarMain {
width: 100vw; width: max-content;
max-width: 250px;
height: 100vh; height: 100vh;
background-color: #00000056;
position: fixed; position: fixed;
left: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
right: 0; right: 0;
@ -648,7 +647,7 @@
align-items: flex-start; align-items: flex-start;
justify-content: flex-end; justify-content: flex-end;
overflow: visible; overflow: visible;
backdrop-filter: blur(6px); box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
animation: fadeInRes 0.3s ease; animation: fadeInRes 0.3s ease;
&.closing { &.closing {

View File

@ -85,7 +85,7 @@
} }
.AddFavItemListCont { .AddFavItemListCont {
height: 34vh; height: 30vh;
padding-bottom: 4rem; padding-bottom: 4rem;
} }
} }

View File

@ -1721,3 +1721,17 @@ table {
right: 2rem; right: 2rem;
} }
} }
.addVariant {
background: #23378a29;
color: #23378a;
padding: 12px 24px;
border: none;
font-family: "Poppins", sans-serif;
font-size: 14px;
font-weight: 500;
cursor: pointer;
border-radius: 6px;
outline: none;
height: max-content;
}

View File

@ -8,12 +8,7 @@
font-weight: bold !important; font-weight: bold !important;
} }
// .viewerExcelupload table {
// // table-layout: auto !important;
// }
.viewerExcelupload::-webkit-scrollbar { .viewerExcelupload::-webkit-scrollbar {
// display: block !important;
width: 0rem; width: 0rem;
height: 0.5rem; height: 0.5rem;
} }
@ -28,7 +23,7 @@
background-color: #1292ee; background-color: #1292ee;
color: #fff; color: #fff;
border-radius: 4px; border-radius: 4px;
font-family: 'Poppins'; font-family: "Poppins";
font-size: 16px; font-size: 16px;
svg { svg {
@ -48,6 +43,8 @@
.tableExcelUpload { .tableExcelUpload {
.ant-table-cell { .ant-table-cell {
padding: 0 8px !important; padding: 0 8px !important;
font-family: "Poppins";
font-weight: 500 !important;
} }
.ant-select-selection-placeholder { .ant-select-selection-placeholder {
@ -129,16 +126,16 @@
} }
.mdsheet { .mdsheet {
width: 25px; width: 20px;
height: 25px; height: 20px;
border: 1px solid #5bff73; border: 1px solid #5bff73;
background-color: #b3ffbf; background-color: #b3ffbf;
border-radius: 4px; border-radius: 4px;
} }
.mdsheet2 { .mdsheet2 {
width: 25px; width: 20px;
height: 20px;
border-radius: 4px; border-radius: 4px;
height: 25px;
background-color: #ffc7f8; background-color: #ffc7f8;
border: 1px solid #ff74ec; border: 1px solid #ff74ec;
} }
@ -148,5 +145,88 @@
font-family: "Poppins"; font-family: "Poppins";
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
@media (max-width: 500px) {
font-size: 10px;
}
} }
} }
.field-setup-selected-fields {
display: flex;
flex-wrap: wrap;
gap: 4px;
margin-bottom: 50px;
height: max-content;
max-height: 50vh;
overflow: auto;
.selected-field {
display: flex;
align-items: center;
gap: 4px;
background: #0bad77;
padding: 6px 10px;
border-radius: 6px;
font-size: 13px;
font-weight: 600;
color: #fff;
.close-icon {
display: flex;
align-items: center;
cursor: pointer;
> svg {
color: #ffffffff !important;
}
}
}
}
.HeadingUploadExl {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
width: 50%;
@media (max-width: 950px) {
width: 100%;
}
}
.download-linkMain {
display: flex;
align-items: center;
gap: 1rem;
justify-content: space-between;
margin-bottom: 10px;
@media (max-width: 950px) {
flex-wrap: wrap;
}
}
.download-link {
width: 50%;
justify-content: space-between;
align-items: center;
@media (max-width: 950px) {
width: 100%;
}
}
.viewerExcelupload {
.ant-select-selection-item {
margin-top: 0 !important ;
padding-top: 0 !important;
}
}
.download-link span {
font-size: 12px;
font-weight: 400;
}
.imgUpldr {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
}

View File

@ -705,7 +705,7 @@
color: #fff; color: #fff;
top: 0; top: 0;
} }
.optionnew:selection { .optionnew::selection {
background-color: #ff4d4f; background-color: #ff4d4f;
} }
.ovrly-icos { .ovrly-icos {

View File

@ -1,86 +0,0 @@
const DevToolsDetector = {
checkWindowSize() {
const threshold = 160;
return (
window.outerWidth - window.innerWidth > threshold ||
window.outerHeight - window.innerHeight > threshold
);
},
checkConsole() {
let detected = false;
const element = new Image();
Object.defineProperty(element, 'id', {
get: () => { detected = true; }
});
console.log('%c', element);
console.clear();
return detected;
},
checkDebugger() {
if (import.meta.env.DEV) return false;
const start = performance.now();
// eslint-disable-next-line no-debugger
debugger;
const end = performance.now();
return end - start > 100;
},
checkToString() {
let detected = false;
const div = document.createElement('div');
Object.defineProperty(div, 'id', {
get: function () {
detected = true;
return 'id';
}
});
console.log(div);
console.clear();
return detected;
},
detect() {
return (
this.checkWindowSize() ||
this.checkConsole() ||
this.checkDebugger() ||
this.checkToString()
);
}
};
export default DevToolsDetector;
import { useEffect, useState } from 'react';
const isMobileOrIOS = () =>
/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
export const useDevToolsDetection = (onDetected) => {
const [isBlocked, setIsBlocked] = useState(false);
useEffect(() => {
if (isMobileOrIOS()) return;
const interval = setInterval(() => {
const detected = DevToolsDetector.detect();
if (detected && !isBlocked) {
setIsBlocked(true);
onDetected?.();
} else if (!detected && isBlocked) {
setIsBlocked(false);
clearInterval(interval);
setTimeout(() => window.location.reload(), 100);
}
}, 1000);
return () => clearInterval(interval);
}, [isBlocked]);
return isBlocked;
};