extendedPlan
This commit is contained in:
commit
ea03af404f
|
|
@ -22,6 +22,7 @@
|
||||||
"@reduxjs/toolkit": "^1.9.5",
|
"@reduxjs/toolkit": "^1.9.5",
|
||||||
"@tanstack/react-query": "^5.90.11",
|
"@tanstack/react-query": "^5.90.11",
|
||||||
"@tanstack/react-query-devtools": "^5.91.1",
|
"@tanstack/react-query-devtools": "^5.91.1",
|
||||||
|
"@tanstack/react-virtual": "^3.13.18",
|
||||||
"antd": "^5.17.4",
|
"antd": "^5.17.4",
|
||||||
"antd-img-crop": "^4.22.0",
|
"antd-img-crop": "^4.22.0",
|
||||||
"aos": "^2.3.4",
|
"aos": "^2.3.4",
|
||||||
|
|
|
||||||
358
src/App.jsx
358
src/App.jsx
|
|
@ -1,52 +1,36 @@
|
||||||
// AppRoutes.jsx
|
import { useEffect, lazy, Suspense } from 'react';
|
||||||
import React, { useEffect, useState, useRef, lazy, } from 'react';
|
|
||||||
import { Routes, Route } from 'react-router-dom';
|
import { Routes, Route } from 'react-router-dom';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useSelector } from 'react-redux';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
|
||||||
import ProtectedRoutes from './ProtectedRoutes';
|
import ProtectedRoutes from './ProtectedRoutes';
|
||||||
|
import SelfBooking from './Pages/SelfBooking/SelfBooking.jsx';
|
||||||
import SelfBooking from './Pages/SelfBooking/SelfBooking.jsx'
|
import { isMobile, isIOS } from 'react-device-detect';
|
||||||
import { isMobile, isIOS } from "react-device-detect";
|
|
||||||
// const { routesConfig } = lazy(() => import('./routesConfig'));
|
|
||||||
import { routesConfig } from './routesConfig';
|
import { routesConfig } from './routesConfig';
|
||||||
import {
|
import { GlobalItemCard } from './Features/BookingScreen/BookingData/BookingData.js';
|
||||||
ChangeAppExpDateData,
|
import { clearSession, getSession } from './Services/Others.js';
|
||||||
changeHeightforExpDate,
|
|
||||||
getAppSubscriptionDate,
|
|
||||||
GlobalItemCard,
|
|
||||||
} from './Features/BookingScreen/BookingData/BookingData.js';
|
|
||||||
import {
|
|
||||||
checkSession,
|
|
||||||
GenerateLogout,
|
|
||||||
} from './Features/BrachLogin/BranchLogin.js';
|
|
||||||
import {
|
|
||||||
clearSession,
|
|
||||||
getSession,
|
|
||||||
TokendecryptedValuesFun,
|
|
||||||
} from './Services/Others.js';
|
|
||||||
import devtools from 'devtools-detect';
|
import devtools from 'devtools-detect';
|
||||||
import KisokSelBooking from './Pages/SelfBooking/KisokSelBooking.jsx';
|
const KisokSelBooking = lazy(
|
||||||
import IndividualBooking from './Pages/SelfBooking/IndividualBooking.jsx';
|
() => import('./Pages/SelfBooking/KisokSelBooking')
|
||||||
|
);
|
||||||
|
|
||||||
|
const IndividualBooking = lazy(
|
||||||
|
() => import('./Pages/SelfBooking/IndividualBooking')
|
||||||
|
);
|
||||||
const commonSubDir = import.meta.env.ENV_COMMON_BASE_URL;
|
const commonSubDir = import.meta.env.ENV_COMMON_BASE_URL;
|
||||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
import "../ownLib/my-ui-lib.css"
|
import '../ownLib/my-ui-lib.css';
|
||||||
import CustomerMenuPage from './Pages/Reports/MenuQRCode/CustomerMenuPage.jsx';
|
import CustomerMenuPage from './Pages/Reports/MenuQRCode/CustomerMenuPage.jsx';
|
||||||
import WeightScaleApp from './Pages/BookingScreen/WeightscaleApp.jsx';
|
import WeightScaleApp from './Pages/BookingScreen/WeightscaleApp.jsx';
|
||||||
|
import useSubscriptionManager from './useSubscriptionManager.js';
|
||||||
import { getPurchasedAppDetails, postInvoice } from './Features/BookingScreen/Pricing/Pricing.js';
|
import useSessionManager from './useSessionManager.js';
|
||||||
import { sendSms } from './Features/Payment/PaymentDetails/PaymentDetails.js';
|
|
||||||
import ExtendSubscriptionModal from './Pages/ExtentedModal/ExtendSubscriptionModal.jsx';
|
import ExtendSubscriptionModal from './Pages/ExtentedModal/ExtendSubscriptionModal.jsx';
|
||||||
|
|
||||||
const AppRoutes = () => {
|
const AppRoutes = () => {
|
||||||
const navigate = useNavigate();
|
|
||||||
const dispatch = useDispatch();
|
|
||||||
const ItemCard = useSelector(GlobalItemCard);
|
const ItemCard = useSelector(GlobalItemCard);
|
||||||
const [remainingDays, setRemainingDays] = useState(null);
|
const { sessionData, logout } = useSessionManager(ItemCard);
|
||||||
const prevRemainingDays = useRef(null);
|
const { remainingDays, handleCancel, handlePay, freeExtend, extendModel } = useSubscriptionManager(sessionData, logout);
|
||||||
const [sessionData, setSessionData] = useState(null);
|
|
||||||
const [devToolsOpen, setDevToolsOpen] = useState(false);
|
|
||||||
const [extendModel, setExtendModel] = useState(false);
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handlePopState = (e) => {
|
const handlePopState = () => {
|
||||||
const SessionId = getSession('SessionId');
|
const SessionId = getSession('SessionId');
|
||||||
if (!SessionId) {
|
if (!SessionId) {
|
||||||
alert(
|
alert(
|
||||||
|
|
@ -68,296 +52,18 @@ const AppRoutes = () => {
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
//cmd it start
|
|
||||||
// useEffect(() => {
|
|
||||||
// sessionCheckFun()
|
|
||||||
// }, [navigate, ItemCard]);
|
|
||||||
|
|
||||||
//cmd it End
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const loadSessionData = () => {
|
if (isMobile || isIOS) return;
|
||||||
const CompId = getSession('CompId');
|
const timer = setInterval(() => {
|
||||||
const AppId = getSession('AppId');
|
if (devtools.isOpen) {
|
||||||
const BranchId = getSession('BranchId');
|
document.body.innerHTML =
|
||||||
const UserType = getSession('UserType');
|
"<h1 style='color:red;text-align:center'>Close Inspect to continue</h1>";
|
||||||
console.log('loadSessionData:', CompId, AppId, BranchId, UserType);
|
|
||||||
|
|
||||||
if (CompId && AppId && BranchId) {
|
|
||||||
setSessionData({ CompId, AppId, BranchId, UserType });
|
|
||||||
return true; // Indicate that session data is available
|
|
||||||
}
|
|
||||||
return false; // Indicate that session data is not yet available
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!loadSessionData()) {
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
if (loadSessionData()) {
|
|
||||||
clearInterval(interval); // Stop checking once data is available
|
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
return () => clearInterval(interval); // Cleanup interval on unmount
|
return () => clearInterval(timer);
|
||||||
}
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const fetchExpDate = async () => {
|
|
||||||
if (!sessionData) {
|
|
||||||
console.log('Session data not available, skipping API call...');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const { CompId, AppId, BranchId, UserType } = sessionData;
|
|
||||||
const data = { CompId, BranchId, AppId };
|
|
||||||
|
|
||||||
let res = await dispatch(getAppSubscriptionDate(data)).unwrap();
|
|
||||||
|
|
||||||
if (res?.data?.statusCode === 1 && res?.data?.data?.length > 0) {
|
|
||||||
const expData = res?.data?.data?.[0];
|
|
||||||
|
|
||||||
if (prevRemainingDays.current !== expData.RemainingDays) {
|
|
||||||
prevRemainingDays.current = expData.RemainingDays;
|
|
||||||
setRemainingDays(expData.RemainingDays);
|
|
||||||
dispatch(ChangeAppExpDateData(expData));
|
|
||||||
dispatch(changeHeightforExpDate(expData.RemainingDays));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (
|
|
||||||
expData.RemainingDays < 1 &&
|
|
||||||
expData.RemainingHours < 1 &&
|
|
||||||
expData.RemainingMinutes < 1 &&
|
|
||||||
expData.RemainingSeconds < 1
|
|
||||||
) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (
|
|
||||||
(UserType !== 'Super Admin' ||
|
|
||||||
UserType !== 'Super Admin User') && (expData?.PlanType?.toLowerCase() == "extend expired")
|
|
||||||
) {
|
|
||||||
console.log('Subscription expired, logging out...');
|
|
||||||
alert(
|
|
||||||
'Subscription expired, logging out. Redirecting to login...'
|
|
||||||
);
|
|
||||||
Logout();
|
|
||||||
}
|
|
||||||
else if (
|
|
||||||
(UserType !== 'Super Admin' ||
|
|
||||||
UserType !== 'Super Admin User') && (expData?.PlanType?.toLowerCase() == "plan expired")
|
|
||||||
) {
|
|
||||||
setExtendModel(true)
|
|
||||||
// "Extend Expired"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// alert(
|
|
||||||
// 'Subscription expired, logging out. Redirecting to login...'
|
|
||||||
// );
|
|
||||||
// Logout();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
console.log('No subscription data found, logging out...');
|
|
||||||
alert(
|
|
||||||
'No subscription data found, logging out. Redirecting to login...'
|
|
||||||
);
|
|
||||||
Logout();
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error fetching subscription data:', error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (remainingDays === null) {
|
|
||||||
fetchExpDate();
|
|
||||||
}
|
|
||||||
|
|
||||||
const interval = setInterval(fetchExpDate, 60 * 60 * 1000);
|
|
||||||
|
|
||||||
return () => clearInterval(interval);
|
|
||||||
}, [sessionData, remainingDays]);
|
|
||||||
|
|
||||||
const Logout = async () => {
|
|
||||||
const UserId = getSession('UserId');
|
|
||||||
const status = 'N';
|
|
||||||
try {
|
|
||||||
const res = await dispatch(GenerateLogout({ UserId, status })).unwrap();
|
|
||||||
if (res?.data?.statusCode === 1) {
|
|
||||||
sessionStorage.clear();
|
|
||||||
window.location.replace(`${commonSubDir}`);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Logout failed:', error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// mohan
|
|
||||||
// useEffect(() => {
|
|
||||||
// if (isMobile || isIOS) {
|
|
||||||
// console.log("📱 Mobile/iOS device → skipping DevTools detection");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// const checkDevTools = setInterval(() => {
|
|
||||||
// if (devtools.isOpen && !devToolsOpen) {
|
|
||||||
// setDevToolsOpen(true);
|
|
||||||
// document.body.innerHTML =
|
|
||||||
// "<h1 style='color: red; text-align: center;'>Close Inspect to continue using the application.</h1>";
|
|
||||||
// }
|
|
||||||
// else if (!devtools.isOpen && devToolsOpen) {
|
|
||||||
// setDevToolsOpen(false);
|
|
||||||
|
|
||||||
// setTimeout(() => {
|
|
||||||
// window.location.reload();
|
|
||||||
// }, 100);
|
|
||||||
|
|
||||||
// clearInterval(checkDevTools);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (!devtools.isOpen) {
|
|
||||||
// let before = performance.now();
|
|
||||||
|
|
||||||
// let after = performance.now();
|
|
||||||
|
|
||||||
// let executionDelay = after - before;
|
|
||||||
|
|
||||||
// if (executionDelay > 100) {
|
|
||||||
// setDevToolsOpen(true);
|
|
||||||
// document.body.innerHTML =
|
|
||||||
// "<h1 style='color: red; text-align: center;'>Close Inspect to continue using the application.</h1>";
|
|
||||||
// } else {
|
|
||||||
// setDevToolsOpen(false);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }, 1000);
|
|
||||||
|
|
||||||
// return () => clearInterval(checkDevTools);
|
|
||||||
// }, [devToolsOpen]);
|
|
||||||
|
|
||||||
const sessionCheckFun = async () => {
|
|
||||||
const UserId = getSession('UserId');
|
|
||||||
const sessionId = getSession('SessionId');
|
|
||||||
const IsLogout = getSession('Mode');
|
|
||||||
let encryptedLoginType = TokendecryptedValuesFun(
|
|
||||||
sessionStorage.getItem('LoginType')
|
|
||||||
);
|
|
||||||
if (encryptedLoginType != 'Kiosk') {
|
|
||||||
const res = await dispatch(checkSession({ UserId, sessionId })).unwrap();
|
|
||||||
if (res?.data?.statusCode === 1) {
|
|
||||||
if (res?.data?.response === 'False') {
|
|
||||||
if (IsLogout !== 'Logout') {
|
|
||||||
alert('Session invalid. Redirecting to login...');
|
|
||||||
}
|
|
||||||
clearSession();
|
|
||||||
window.location.replace(commonSubDir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// ---------------- DATE UTILS ----------------
|
|
||||||
function formatDate(date) {
|
|
||||||
const year = date.getFullYear();
|
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
||||||
const day = String(date.getDate()).padStart(2, '0');
|
|
||||||
const hours = String(date.getHours()).padStart(2, '0');
|
|
||||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
||||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
||||||
const milliseconds = String(date.getMilliseconds()).padStart(3, '0');
|
|
||||||
|
|
||||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}.${milliseconds}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
function addDays(dateString, days) {
|
|
||||||
// Make it ISO-safe for iOS / WebView
|
|
||||||
const isoDate = dateString.replace(' ', 'T');
|
|
||||||
const currentDate = new Date(isoDate);
|
|
||||||
|
|
||||||
currentDate.setDate(currentDate.getDate() + Number(days));
|
|
||||||
|
|
||||||
return formatDate(currentDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------- MAIN FUNCTION ----------------
|
|
||||||
const freeExtend = async () => {
|
|
||||||
try {
|
|
||||||
const { CompId, AppId, BranchId, UserType } = sessionData;
|
|
||||||
const UserId = getSession('UserId');
|
|
||||||
|
|
||||||
// Current date
|
|
||||||
const now = new Date();
|
|
||||||
const currentDate = formatDate(now);
|
|
||||||
|
|
||||||
// 1️⃣ Get purchased app details
|
|
||||||
const response1 = await dispatch(
|
|
||||||
getPurchasedAppDetails({ AppId, UserId })
|
|
||||||
).unwrap();
|
|
||||||
|
|
||||||
const PurchasedDetails = response1?.data?.data;
|
|
||||||
|
|
||||||
if (!PurchasedDetails || !PurchasedDetails.length) {
|
|
||||||
console.error('No purchased details found');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2️⃣ Prepare post data
|
|
||||||
const postData = {
|
|
||||||
UserId: UserId,
|
|
||||||
AppId: AppId,
|
|
||||||
PricingId: PurchasedDetails[0]?.PricingId,
|
|
||||||
PurDate: currentDate,
|
|
||||||
NoofDays: 30,
|
|
||||||
PaymentMode: 27,
|
|
||||||
PaymentStatus: 'S',
|
|
||||||
LicenseStatus: PurchasedDetails[0]?.LicenseStatus,
|
|
||||||
Price: PurchasedDetails[0]?.Price ?? 0,
|
|
||||||
TaxId: PurchasedDetails[0]?.TaxId ?? 0,
|
|
||||||
NetPrice: PurchasedDetails[0]?.ExistingPlanNetPrice ?? 0,
|
|
||||||
ValidityStart: currentDate,
|
|
||||||
ValidityEnd: addDays(
|
|
||||||
currentDate,
|
|
||||||
PurchasedDetails[0]?.NoOfDays
|
|
||||||
),
|
|
||||||
CreatedBy: UserId,
|
|
||||||
TaxAmount: PurchasedDetails[0]?.TaxAmount ?? 0,
|
|
||||||
MobileNo: getSession('MobileNo'),
|
|
||||||
MailId: 'ts@gmmail.com',
|
|
||||||
Type: "FreeExtend"
|
|
||||||
};
|
|
||||||
|
|
||||||
// 3️⃣ Post invoice
|
|
||||||
const response = await dispatch(postInvoice(postData)).unwrap();
|
|
||||||
|
|
||||||
// 4️⃣ Send SMS if required
|
|
||||||
if (response?.data?.statusCode === 1 && response?.data?.SMSbody) {
|
|
||||||
await dispatch(
|
|
||||||
sendSms({ body: response.data.SMSbody })
|
|
||||||
);
|
|
||||||
setExtendModel(false)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
console.error('freeExtend error:', error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const handleCancel = () => {
|
|
||||||
Logout();
|
|
||||||
setExtendModel(false)
|
|
||||||
|
|
||||||
}
|
|
||||||
const handlePay = () => {
|
|
||||||
setExtendModel(false)
|
|
||||||
let AppName = getSession("AppName")
|
|
||||||
navigate(`${subDirectory}PricingPage`, { state: { AppName: AppName } });
|
|
||||||
}
|
|
||||||
|
|
||||||
if (extendModel) {
|
if (extendModel) {
|
||||||
return (
|
return (
|
||||||
|
|
@ -368,9 +74,8 @@ const AppRoutes = () => {
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Suspense fallback={<div>Loading…</div>}>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route
|
<Route
|
||||||
path={`${subDirectory}selfBooking/:SelfBookingId`}
|
path={`${subDirectory}selfBooking/:SelfBookingId`}
|
||||||
|
|
@ -384,7 +89,10 @@ const AppRoutes = () => {
|
||||||
path={`${subDirectory}weightscaleapp`}
|
path={`${subDirectory}weightscaleapp`}
|
||||||
element={<WeightScaleApp />}
|
element={<WeightScaleApp />}
|
||||||
/>
|
/>
|
||||||
<Route path={`${subDirectory}kioskSelfBooking`} element={<KisokSelBooking />} />
|
<Route
|
||||||
|
path={`${subDirectory}kioskSelfBooking`}
|
||||||
|
element={<KisokSelBooking />}
|
||||||
|
/>
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path={`${subDirectory}kiosk-individual-self-booking`}
|
path={`${subDirectory}kiosk-individual-self-booking`}
|
||||||
|
|
@ -395,7 +103,7 @@ const AppRoutes = () => {
|
||||||
element={<ProtectedRoutes routesConfig={routesConfig} />}
|
element={<ProtectedRoutes routesConfig={routesConfig} />}
|
||||||
/>
|
/>
|
||||||
</Routes>
|
</Routes>
|
||||||
</>
|
</Suspense>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// AuthContext.jsx
|
// AuthContext.jsx
|
||||||
import React, { createContext, useContext, useState, useEffect } from 'react';
|
import { createContext, useContext, useState, useEffect } from 'react';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch } from 'react-redux';
|
||||||
import { getSession } from './Services/Others';
|
import { getSession } from './Services/Others';
|
||||||
import {
|
import {
|
||||||
|
|
@ -64,7 +64,8 @@ export const AuthProvider = ({ children }) => {
|
||||||
);
|
);
|
||||||
setAdvance(hasAdvance);
|
setAdvance(hasAdvance);
|
||||||
const hasProOrAdvance =
|
const hasProOrAdvance =
|
||||||
hasAdvance || pricingData.some((item) => item.PricingName === 'Customized');
|
hasAdvance ||
|
||||||
|
pricingData.some((item) => item.PricingName === 'Customized');
|
||||||
setProORAdvance(hasProOrAdvance);
|
setProORAdvance(hasProOrAdvance);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching pricing name:', error);
|
console.error('Error fetching pricing name:', error);
|
||||||
|
|
|
||||||
|
|
@ -564,7 +564,7 @@ Button[disabled] {
|
||||||
.ant-table-cell {
|
.ant-table-cell {
|
||||||
background: #fafafa7a;
|
background: #fafafa7a;
|
||||||
//vicky
|
//vicky
|
||||||
padding: 1px 8px !important;
|
padding: 6px 6px !important;
|
||||||
border: 0.5px solid rgb(235, 235, 235);
|
border: 0.5px solid rgb(235, 235, 235);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,9 @@ const Loader = () => {
|
||||||
<p>Loading</p>
|
<p>Loading</p>
|
||||||
<div className="words">
|
<div className="words">
|
||||||
<span className="word">PozoApp</span>
|
<span className="word">PozoApp</span>
|
||||||
<span className="word">BillingApp</span>
|
|
||||||
<span className="word">PozoApp</span>
|
<span className="word">PozoApp</span>
|
||||||
<span className="word">BillingApp</span>
|
<span className="word">PozoApp</span>
|
||||||
|
<span className="word">PozoApp</span>
|
||||||
<span className="word">PozoApp</span>
|
<span className="word">PozoApp</span>
|
||||||
</div>
|
</div>
|
||||||
<p></p>
|
<p></p>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import { Menu } from 'antd';
|
||||||
import {
|
import {
|
||||||
changePreviewComponents,
|
changePreviewComponents,
|
||||||
changeSelectedPrintdummyData,
|
changeSelectedPrintdummyData,
|
||||||
getTemplate,
|
|
||||||
} from '../../Features/ThemeChange/ThemeChange';
|
} from '../../Features/ThemeChange/ThemeChange';
|
||||||
import {
|
import {
|
||||||
changeBookingType,
|
changeBookingType,
|
||||||
|
|
@ -69,9 +68,6 @@ const SideMenu = ({ mode, theme, items }) => {
|
||||||
const [clickedKeys, setClickedKeys] = useState([]);
|
const [clickedKeys, setClickedKeys] = useState([]);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const CompId = getSession('CompId');
|
|
||||||
const BranchId = getSession('BranchId');
|
|
||||||
const AppId = getSession('AppId');
|
|
||||||
const DineinDefault = useSelector(GlobalDineinDefault);
|
const DineinDefault = useSelector(GlobalDineinDefault);
|
||||||
|
|
||||||
const handleMouseEnter = (e) => {
|
const handleMouseEnter = (e) => {
|
||||||
|
|
@ -187,28 +183,7 @@ const SideMenu = ({ mode, theme, items }) => {
|
||||||
if (e == `${subDirectory}saleslayouts/print-selection`) {
|
if (e == `${subDirectory}saleslayouts/print-selection`) {
|
||||||
dispatch(changeSelectedPrintdummyData(true));
|
dispatch(changeSelectedPrintdummyData(true));
|
||||||
}
|
}
|
||||||
// if(e==`${subDirectory}kiosksales`){
|
|
||||||
// const elem = document.documentElement;
|
|
||||||
// if (elem.requestFullscreen) {
|
|
||||||
// elem.requestFullscreen();
|
|
||||||
// } else if (elem.mozRequestFullScreen) { // Firefox
|
|
||||||
// elem.mozRequestFullScreen();
|
|
||||||
// } else if (elem.webkitRequestFullscreen) { // Chrome, Safari and Opera
|
|
||||||
// elem.webkitRequestFullscreen();
|
|
||||||
// } else if (elem.msRequestFullscreen) { // IE/Edge
|
|
||||||
// elem.msRequestFullscreen();
|
|
||||||
// }
|
|
||||||
// }else{
|
|
||||||
// if (document.exitFullscreen) {
|
|
||||||
// document.exitFullscreen();
|
|
||||||
// } else if (document.mozCancelFullScreen) { // Firefox
|
|
||||||
// document.mozCancelFullScreen();
|
|
||||||
// } else if (document.webkitExitFullscreen) { // Chrome, Safari and Opera
|
|
||||||
// document.webkitExitFullscreen();
|
|
||||||
// } else if (document.msExitFullscreen) { // IE/Edge
|
|
||||||
// document.msExitFullscreen();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
navigate(e);
|
navigate(e);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
|
|
@ -1,45 +1,15 @@
|
||||||
import React, { useState, useEffect, useRef } from 'react';
|
import { useState, useEffect, useRef } from 'react';
|
||||||
import { useNavigate, useLocation } from 'react-router-dom';
|
import { useNavigate, useLocation } from 'react-router-dom';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import {
|
|
||||||
FaBars,
|
|
||||||
FaThLarge,
|
|
||||||
FaHome,
|
|
||||||
FaCog,
|
|
||||||
FaChartBar,
|
|
||||||
FaFileAlt,
|
|
||||||
FaMobileAlt,
|
|
||||||
FaSignOutAlt,
|
|
||||||
FaSignInAlt,
|
|
||||||
FaArrowRight,
|
|
||||||
FaCaretRight,
|
|
||||||
} from 'react-icons/fa';
|
|
||||||
import {
|
|
||||||
MdSettings,
|
|
||||||
MdOutlineReport,
|
|
||||||
MdOutlineHome,
|
|
||||||
MdOutlineKeyboardArrowDown,
|
|
||||||
MdOutlineKeyboardArrowRight,
|
|
||||||
} from 'react-icons/md';
|
|
||||||
import { BiLogOut, BiLogIn } from 'react-icons/bi';
|
|
||||||
import {
|
|
||||||
AiOutlineAppstore,
|
|
||||||
AiOutlineSetting,
|
|
||||||
AiOutlineBarChart,
|
|
||||||
AiOutlineFileText,
|
|
||||||
} from 'react-icons/ai';
|
|
||||||
import { GiHamburgerMenu } from 'react-icons/gi';
|
|
||||||
import './SideMenuPozo.scss';
|
import './SideMenuPozo.scss';
|
||||||
import { FaCaretDown } from 'react-icons/fa';
|
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch } from 'react-redux';
|
||||||
import { useContext } from 'react';
|
import { useContext } from 'react';
|
||||||
import { AuthContext } from '../../AuthContext';
|
import { AuthContext } from '../../AuthContext';
|
||||||
import PozoMenu from './PozoMenu';
|
import PozoMenu from './PozoMenu';
|
||||||
import { getSession } from '../../Services/Others';
|
|
||||||
import {
|
import {
|
||||||
changePreviewComponents,
|
changePreviewComponents,
|
||||||
changeSelectedPrintdummyData,
|
changeSelectedPrintdummyData
|
||||||
getTemplate,
|
|
||||||
} from '../../Features/ThemeChange/ThemeChange';
|
} from '../../Features/ThemeChange/ThemeChange';
|
||||||
import {
|
import {
|
||||||
changeBookingType,
|
changeBookingType,
|
||||||
|
|
@ -67,7 +37,7 @@ import {
|
||||||
import { ChangeTotalAmount } from '../../Features/ExteraCharges/ExtraCharges';
|
import { ChangeTotalAmount } from '../../Features/ExteraCharges/ExtraCharges';
|
||||||
import * as Offer from '../../Features/Offer/Offer';
|
import * as Offer from '../../Features/Offer/Offer';
|
||||||
import { FiMenu } from 'react-icons/fi';
|
import { FiMenu } from 'react-icons/fi';
|
||||||
import POZOMIND from '../../Images/PozomindWLogo.png';
|
|
||||||
import {
|
import {
|
||||||
ChangeFullFreeProductList,
|
ChangeFullFreeProductList,
|
||||||
changeFullOfferAppliedProducts,
|
changeFullOfferAppliedProducts,
|
||||||
|
|
@ -165,9 +135,7 @@ const SideMenuPozo = ({ items = [] }) => {
|
||||||
const [collapsed, setCollapsed] = useState(window.innerWidth < 768);
|
const [collapsed, setCollapsed] = useState(window.innerWidth < 768);
|
||||||
const [dropdownPosition, setDropdownPosition] = useState({});
|
const [dropdownPosition, setDropdownPosition] = useState({});
|
||||||
const menuRef = useRef();
|
const menuRef = useRef();
|
||||||
const CompId = getSession('CompId');
|
|
||||||
const BranchId = getSession('BranchId');
|
|
||||||
const AppId = getSession('AppId');
|
|
||||||
const DineinDefault = useSelector(GlobalDineinDefault);
|
const DineinDefault = useSelector(GlobalDineinDefault);
|
||||||
const [collapse, setCollapse] = useState(false);
|
const [collapse, setCollapse] = useState(false);
|
||||||
|
|
||||||
|
|
@ -381,57 +349,7 @@ const SideMenuPozo = ({ items = [] }) => {
|
||||||
(item) => !bottomKeys.includes(item.label)
|
(item) => !bottomKeys.includes(item.label)
|
||||||
);
|
);
|
||||||
// Recursive render for menu and submenus
|
// Recursive render for menu and submenus
|
||||||
const renderMenuItems = (items, parentKeys = [], level = 0) => (
|
|
||||||
<div className={`side-menu-list${level > 0 ? ' nested-list' : ''}`}>
|
|
||||||
{(items || []).filter(Boolean).map((item) => (
|
|
||||||
<div key={item.key}>
|
|
||||||
<div
|
|
||||||
className={`${level > 0 ? 'dropdown-submenu-item' : 'menu-item'}${isSelected(item.key) || (level === 0 && hasSelectedChild(item)) ? ' selecteded' : ''}${isOpen(item.key) ? ' open' : ''}${item.children ? ' has-children' : ''}`}
|
|
||||||
onClick={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
handleMenuClick(item, parentKeys, e, level);
|
|
||||||
}}
|
|
||||||
// style={{ paddingLeft: `${level * 10 + 1}px` }}
|
|
||||||
>
|
|
||||||
{item.icon && level === 0 && (
|
|
||||||
<span
|
|
||||||
className="menu-icon"
|
|
||||||
style={{
|
|
||||||
fontSize: collapse ? '1.5rem' : '',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{item.icon}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
{!collapse && <span className="menu-label">{item.label}</span>}
|
|
||||||
{!collapse && (
|
|
||||||
<span className="menu-labelDot">
|
|
||||||
{isDropdownItemSelected(item) ? '●' : ''}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
{item.children && !collapse && (
|
|
||||||
<span className="menu-arrow">
|
|
||||||
{level === 0 ? (
|
|
||||||
<FaCaretRight size={14} />
|
|
||||||
) : (
|
|
||||||
<MdOutlineKeyboardArrowRight />
|
|
||||||
)}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
{item.children && isOpen(item.key) && !collapse && (
|
|
||||||
<div className={`dropdown-submenu${level > 0 ? ' nested' : ''}`}>
|
|
||||||
{renderMenuItems(
|
|
||||||
item.children,
|
|
||||||
[...parentKeys, item.key],
|
|
||||||
level + 1
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
// Custom onClick handler for PozoMenu
|
// Custom onClick handler for PozoMenu
|
||||||
const handlePozoMenuClick = (e) => {
|
const handlePozoMenuClick = (e) => {
|
||||||
|
|
|
||||||
|
|
@ -70,13 +70,15 @@ export const postStockAdjustment = createAsyncThunk(
|
||||||
export const getPurchaseSupplierAndWareHouseData = createAsyncThunk(
|
export const getPurchaseSupplierAndWareHouseData = createAsyncThunk(
|
||||||
'PurchaseOrder/getPurchaseSupplierAndWareHouseData',
|
'PurchaseOrder/getPurchaseSupplierAndWareHouseData',
|
||||||
async (ProdData, { rejectWithValue }) => {
|
async (ProdData, { rejectWithValue }) => {
|
||||||
const { AppId, CompId, BranchId } = ProdData;
|
const { AppId, CompId, BranchId, Type } = ProdData;
|
||||||
|
|
||||||
if (AppId && CompId && BranchId) {
|
if (AppId && CompId && BranchId) {
|
||||||
try {
|
try {
|
||||||
const response = await axiosRetailInstanceData.get(
|
let url = `/Supplier/AllSupplierBranchDropdown?appId=${AppId}&compId=${CompId}&branchId=${BranchId}`;
|
||||||
`/Supplier/AllSupplierBranchDropdown?appId=${AppId}&compId=${CompId}&branchId=${BranchId}`
|
if (Type) {
|
||||||
);
|
url += `&Type=${Type}`;
|
||||||
|
}
|
||||||
|
const response = await axiosRetailInstanceData.get(url);
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return rejectWithValue(error.response?.data || error.message);
|
return rejectWithValue(error.response?.data || error.message);
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import { DefaultModal } from "../../Components/Modal/DefaultModal";
|
||||||
import { FaRegEye } from "react-icons/fa";
|
import { FaRegEye } from "react-icons/fa";
|
||||||
import { render } from "react-dom";
|
import { render } from "react-dom";
|
||||||
import { useAuth } from "../../AuthContext";
|
import { useAuth } from "../../AuthContext";
|
||||||
|
import "./AutomatedReorder.scss";
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3393,19 +3393,19 @@ const [RadioBtnSelection, setRadioBtnSelection] = useState(() => {
|
||||||
const enteredDiscount = parseFloat(data?.target.value);
|
const enteredDiscount = parseFloat(data?.target.value);
|
||||||
|
|
||||||
if (limit === null || limit === undefined || limit === 0) {
|
if (limit === null || limit === undefined || limit === 0) {
|
||||||
if (
|
// if (
|
||||||
parseFloat(enteredDiscount) < parseFloat(sellingPrice) ||
|
// parseFloat(enteredDiscount) < parseFloat(sellingPrice) ||
|
||||||
parseFloat(enteredDiscount) === parseFloat(sellingPrice)
|
// parseFloat(enteredDiscount) === parseFloat(sellingPrice)
|
||||||
) {
|
// ) {
|
||||||
setEditedPrice(enteredDiscount);
|
setEditedPrice(enteredDiscount);
|
||||||
setDisableSubmitButton(true);
|
setDisableSubmitButton(true);
|
||||||
} else {
|
// } else {
|
||||||
setMessageType('error');
|
// setMessageType('error');
|
||||||
setMessageData('Please Give less than value for sell price');
|
// setMessageData('Please Give less than value for sell price');
|
||||||
setDisableSubmitButton(false);
|
// setDisableSubmitButton(false);
|
||||||
setEditedPrice(0);
|
// setEditedPrice(0);
|
||||||
formRef.current?.resetFields();
|
// formRef.current?.resetFields();
|
||||||
}
|
// }
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ const WeightCalculatePrice = ({ itemData, CartOrderDetails, onSubmit }) => {
|
||||||
const [enteredPrice, setEnteredPrice] = useState('');
|
const [enteredPrice, setEnteredPrice] = useState('');
|
||||||
const [enteredQty, setEnteredQty] = useState('');
|
const [enteredQty, setEnteredQty] = useState('');
|
||||||
const [calculatedQty, setCalculatedQty] = useState(0);
|
const [calculatedQty, setCalculatedQty] = useState(0);
|
||||||
const [calcMode, setCalcMode] = useState('amt');
|
const [calcMode, setCalcMode] = useState('kgs');
|
||||||
|
|
||||||
const priceInputRef = useRef(null);
|
const priceInputRef = useRef(null);
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
@ -82,8 +82,8 @@ const WeightCalculatePrice = ({ itemData, CartOrderDetails, onSubmit }) => {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Radio.Button value="amt">AMT</Radio.Button>
|
|
||||||
<Radio.Button value="kgs">KGS</Radio.Button>
|
<Radio.Button value="kgs">KGS</Radio.Button>
|
||||||
|
<Radio.Button value="amt">AMT</Radio.Button>
|
||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
|
|
@ -305,12 +305,17 @@ const BSBillingTable1 = () => {
|
||||||
if (key === 'q') {
|
if (key === 'q') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('qty');
|
handleShortcut('qty');
|
||||||
}
|
} else if (key === 'e') {
|
||||||
|
|
||||||
if (key === 'e') {
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('price');
|
handleShortcut('price');
|
||||||
|
} else if (key === 'y') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('Parcel');
|
||||||
|
} else if (key === 'b') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('weightAmount');
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
window.addEventListener('keydown', handleKeyDown);
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -244,12 +244,17 @@ const BSBillingTable3 = () => {
|
||||||
if (key === 'q') {
|
if (key === 'q') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('qty');
|
handleShortcut('qty');
|
||||||
}
|
} else if (key === 'e') {
|
||||||
|
|
||||||
if (key === 'e') {
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('price');
|
handleShortcut('price');
|
||||||
|
} else if (key === 'y') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('Parcel');
|
||||||
|
} else if (key === 'b') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('weightAmount');
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
window.addEventListener('keydown', handleKeyDown);
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -297,12 +297,17 @@ const BSBillingTable4 = () => {
|
||||||
if (key === 'q') {
|
if (key === 'q') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('qty');
|
handleShortcut('qty');
|
||||||
}
|
} else if (key === 'e') {
|
||||||
|
|
||||||
if (key === 'e') {
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('price');
|
handleShortcut('price');
|
||||||
|
} else if (key === 'y') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('Parcel');
|
||||||
|
} else if (key === 'b') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('weightAmount');
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener('keydown', handleKeyDown);
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
|
||||||
|
|
@ -1943,12 +1943,17 @@ const BsBill = () => {
|
||||||
if (key === 'q') {
|
if (key === 'q') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('qty');
|
handleShortcut('qty');
|
||||||
}
|
} else if (key === 'e') {
|
||||||
|
|
||||||
if (key === 'e') {
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('price');
|
handleShortcut('price');
|
||||||
|
} else if (key === 'y') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('Parcel');
|
||||||
|
} else if (key === 'b') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('weightAmount');
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
window.addEventListener('keydown', handleKeyDown);
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -267,16 +267,20 @@ const BSBillingTable6 = () => {
|
||||||
}
|
}
|
||||||
// 👉 CTRL shortcuts
|
// 👉 CTRL shortcuts
|
||||||
if (!event.ctrlKey) return;
|
if (!event.ctrlKey) return;
|
||||||
|
|
||||||
if (key === 'q') {
|
if (key === 'q') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('qty');
|
handleShortcut('qty');
|
||||||
}
|
} else if (key === 'e') {
|
||||||
|
|
||||||
if (key === 'e') {
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('price');
|
handleShortcut('price');
|
||||||
|
} else if (key === 'y') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('Parcel');
|
||||||
|
} else if (key === 'b') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('weightAmount');
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
window.addEventListener('keydown', handleKeyDown);
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -263,11 +263,17 @@ const BSBillingTable7 = () => {
|
||||||
if (key === 'q') {
|
if (key === 'q') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('qty');
|
handleShortcut('qty');
|
||||||
}
|
} else if (key === 'e') {
|
||||||
if (key === 'e') {
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('price');
|
handleShortcut('price');
|
||||||
|
} else if (key === 'y') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('Parcel');
|
||||||
|
} else if (key === 'b') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('weightAmount');
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
window.addEventListener('keydown', handleKeyDown);
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -73,9 +73,9 @@ import {
|
||||||
} from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
|
} from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
|
||||||
import { useRemoveProducts } from '../BSBillingTable3/RemoveCartWithOffer.jsx';
|
import { useRemoveProducts } from '../BSBillingTable3/RemoveCartWithOffer.jsx';
|
||||||
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
||||||
import ComboEditQty from '../ComboBillTableEdit/ComboEditQty.jsx';
|
|
||||||
import ComboEditRate from '../ComboBillTableEdit/ComboEditRate.jsx';
|
import ComboEditRate from '../ComboBillTableEdit/ComboEditRate.jsx';
|
||||||
import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx';
|
import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx';
|
||||||
|
import ComboEditQtyAndRate from '../ComboBillTableEdit/ComboEditQtyAndRate.jsx';
|
||||||
|
|
||||||
const ComboSalesBillTable = () => {
|
const ComboSalesBillTable = () => {
|
||||||
const { removeExtraCharge } = useUtilsComponent();
|
const { removeExtraCharge } = useUtilsComponent();
|
||||||
|
|
@ -177,6 +177,10 @@ const ComboSalesBillTable = () => {
|
||||||
const [qtyEdit, setQtyEdit] = useState(false);
|
const [qtyEdit, setQtyEdit] = useState(false);
|
||||||
const qtyTdRef = useRef(null);
|
const qtyTdRef = useRef(null);
|
||||||
const qtyInputRef = useRef(null);
|
const qtyInputRef = useRef(null);
|
||||||
|
const [shortKeyMethod, setshortKeyMethod] = useState(null);
|
||||||
|
const [activeRowIndex, setActiveRowIndex] = useState(null);
|
||||||
|
const [activeColIndex, setActiveColIndex] = useState(null);
|
||||||
|
const tableRef = useRef(null);
|
||||||
|
|
||||||
const handleEditQTYcombo = () => {
|
const handleEditQTYcombo = () => {
|
||||||
if (!qtyEdit) {
|
if (!qtyEdit) {
|
||||||
|
|
@ -268,7 +272,7 @@ const ComboSalesBillTable = () => {
|
||||||
const item = getSelectedItem();
|
const item = getSelectedItem();
|
||||||
if (!item) return;
|
if (!item) return;
|
||||||
|
|
||||||
handleEditQuantity(item);
|
handleEditQuantityCombo(item);
|
||||||
setshortKeyMethod(method);
|
setshortKeyMethod(method);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -288,12 +292,17 @@ const ComboSalesBillTable = () => {
|
||||||
if (key === 'q') {
|
if (key === 'q') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('qty');
|
handleShortcut('qty');
|
||||||
}
|
} else if (key === 'e') {
|
||||||
|
|
||||||
if (key === 'e') {
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('price');
|
handleShortcut('price');
|
||||||
|
} else if (key === 'y') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('Parcel');
|
||||||
|
} else if (key === 'b') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('weightAmount');
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
window.addEventListener('keydown', handleKeyDown);
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
|
@ -2074,6 +2083,95 @@ const ComboSalesBillTable = () => {
|
||||||
...(tableDataDinein || []),
|
...(tableDataDinein || []),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Set last row as active when data changes
|
||||||
|
useEffect(() => {
|
||||||
|
if (combinedTableData?.length > 0 && activeRowIndex === null) {
|
||||||
|
setActiveRowIndex(combinedTableData.length - 1);
|
||||||
|
}
|
||||||
|
}, [combinedTableData?.length]);
|
||||||
|
|
||||||
|
// Table navigation
|
||||||
|
useEffect(() => {
|
||||||
|
const handleTableNav = (e) => {
|
||||||
|
if (EditQtyCombo || EditRateCombo) return;
|
||||||
|
if (!combinedTableData?.length || activeRowIndex === null) return;
|
||||||
|
|
||||||
|
const visibleCols =
|
||||||
|
tableOptions?.filter((opt) =>
|
||||||
|
['Item', 'Quantity', 'Rate', 'Total'].includes(opt.OptionName)
|
||||||
|
) || [];
|
||||||
|
|
||||||
|
// Arrow Up/Down - Row navigation
|
||||||
|
if (e.key === 'ArrowUp') {
|
||||||
|
e.preventDefault();
|
||||||
|
setActiveRowIndex((prev) => Math.max(0, prev - 1));
|
||||||
|
setActiveColIndex(null);
|
||||||
|
} else if (e.key === 'ArrowDown') {
|
||||||
|
e.preventDefault();
|
||||||
|
setActiveRowIndex((prev) =>
|
||||||
|
Math.min(combinedTableData.length - 1, prev + 1)
|
||||||
|
);
|
||||||
|
setActiveColIndex(null);
|
||||||
|
}
|
||||||
|
// Arrow Left/Right - Column navigation
|
||||||
|
else if (e.key === 'ArrowLeft') {
|
||||||
|
e.preventDefault();
|
||||||
|
if (activeColIndex === null) {
|
||||||
|
setActiveColIndex(visibleCols.length - 1);
|
||||||
|
} else {
|
||||||
|
setActiveColIndex((prev) => Math.max(0, prev - 1));
|
||||||
|
}
|
||||||
|
} else if (e.key === 'ArrowRight') {
|
||||||
|
e.preventDefault();
|
||||||
|
if (activeColIndex === null) {
|
||||||
|
setActiveColIndex(0);
|
||||||
|
} else {
|
||||||
|
setActiveColIndex((prev) =>
|
||||||
|
Math.min(visibleCols.length - 1, prev + 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Tab - Move to next column
|
||||||
|
else if (e.key === 'Tab') {
|
||||||
|
e.preventDefault();
|
||||||
|
if (activeColIndex === null) {
|
||||||
|
setActiveColIndex(0);
|
||||||
|
} else {
|
||||||
|
const nextCol = activeColIndex + 1;
|
||||||
|
if (nextCol >= visibleCols.length) {
|
||||||
|
setActiveColIndex(0);
|
||||||
|
if (activeRowIndex < combinedTableData.length - 1) {
|
||||||
|
setActiveRowIndex((prev) => prev + 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setActiveColIndex(nextCol);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Enter - Trigger cell action
|
||||||
|
else if (e.key === 'Enter' && activeColIndex !== null) {
|
||||||
|
e.preventDefault();
|
||||||
|
const row = combinedTableData[activeRowIndex];
|
||||||
|
const col = visibleCols[activeColIndex];
|
||||||
|
if (row && col && editField) {
|
||||||
|
if (col.OptionName === 'Quantity') handleEditQuantityCombo(row);
|
||||||
|
else if (col.OptionName === 'Rate') handleEditRateCombo(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('keydown', handleTableNav);
|
||||||
|
return () => window.removeEventListener('keydown', handleTableNav);
|
||||||
|
}, [
|
||||||
|
activeRowIndex,
|
||||||
|
activeColIndex,
|
||||||
|
combinedTableData,
|
||||||
|
EditQtyCombo,
|
||||||
|
EditRateCombo,
|
||||||
|
editField,
|
||||||
|
tableOptions,
|
||||||
|
]);
|
||||||
|
|
||||||
console.log(combinedTableData, 'combinedTableData', tableData);
|
console.log(combinedTableData, 'combinedTableData', tableData);
|
||||||
const displayTableData =
|
const displayTableData =
|
||||||
BillOrderPre === 'N' ? [...combinedTableData].reverse() : combinedTableData;
|
BillOrderPre === 'N' ? [...combinedTableData].reverse() : combinedTableData;
|
||||||
|
|
@ -2261,7 +2359,7 @@ const ComboSalesBillTable = () => {
|
||||||
return (
|
return (
|
||||||
<tr
|
<tr
|
||||||
key={`${row?.InwardDtlId || index}-${row?.BookingTypeName || ''}-${row?.SalesId || ''}-${index}`}
|
key={`${row?.InwardDtlId || index}-${row?.BookingTypeName || ''}-${row?.SalesId || ''}-${index}`}
|
||||||
className={row.highlighted ? 'highlighted-row' : ''}
|
className={`${row.highlighted ? 'highlighted-row' : ''} ${activeRowIndex === index ? 'active-row' : ''}`}
|
||||||
style={{
|
style={{
|
||||||
fontFamily: SelectedFont,
|
fontFamily: SelectedFont,
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
|
|
@ -2305,7 +2403,15 @@ const ComboSalesBillTable = () => {
|
||||||
: 'none',
|
: 'none',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{tableOptions?.map((item) => (
|
{tableOptions?.map((item, colIdx) => {
|
||||||
|
const isActiveCell =
|
||||||
|
activeRowIndex === index &&
|
||||||
|
activeColIndex !== null &&
|
||||||
|
['Item', 'Quantity', 'Rate', 'Total'].indexOf(
|
||||||
|
item.OptionName
|
||||||
|
) === activeColIndex;
|
||||||
|
|
||||||
|
return (
|
||||||
<>
|
<>
|
||||||
{/* HSN Code */}
|
{/* HSN Code */}
|
||||||
{item.OptionName === 'HSNCode' && (
|
{item.OptionName === 'HSNCode' && (
|
||||||
|
|
@ -2323,7 +2429,7 @@ const ComboSalesBillTable = () => {
|
||||||
item.OptionName === 'Product Name') && (
|
item.OptionName === 'Product Name') && (
|
||||||
<td
|
<td
|
||||||
key={`prod-${index}`}
|
key={`prod-${index}`}
|
||||||
className="productNameTd"
|
className={`productNameTd ${isActiveCell ? 'active-cell' : ''}`}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
row.FullProductIdentifierDtls?.length > 0 ||
|
row.FullProductIdentifierDtls?.length > 0 ||
|
||||||
row.ProductIdentifierDtls?.length > 0
|
row.ProductIdentifierDtls?.length > 0
|
||||||
|
|
@ -2367,24 +2473,30 @@ const ComboSalesBillTable = () => {
|
||||||
{/* Quantity */}
|
{/* Quantity */}
|
||||||
{item.OptionName === 'Quantity' && (
|
{item.OptionName === 'Quantity' && (
|
||||||
<td
|
<td
|
||||||
ref={qtyTdRef}
|
ref={(el) => {
|
||||||
|
if (
|
||||||
|
shortKeyMethod === 'qty' &&
|
||||||
|
row?.localId === Index
|
||||||
|
) {
|
||||||
|
el?.focus();
|
||||||
|
el?.click();
|
||||||
|
}
|
||||||
|
}}
|
||||||
key={`qty-${index}`}
|
key={`qty-${index}`}
|
||||||
// className="qtyTd"
|
tabIndex={0}
|
||||||
className={
|
className={`${EditQtyCombo && row?.localId === Index
|
||||||
EditQtyCombo && row?.localId === Index
|
|
||||||
? 'EditQTYcomboTD'
|
? 'EditQTYcomboTD'
|
||||||
: 'qtyTd'
|
: 'qtyTd'
|
||||||
}
|
} ${isActiveCell ? 'active-cell' : ''}`}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
editField && handleEditQuantityCombo(row)
|
editField && handleEditQuantityCombo(row)
|
||||||
}
|
}
|
||||||
// onClick={() => handleEditQTYcombo()}
|
|
||||||
>
|
>
|
||||||
{(!EditQtyCombo || row?.localId !== Index) && (
|
{(!EditQtyCombo || row?.localId !== Index) && (
|
||||||
<>{row.OrderQty}</>
|
<>{row.OrderQty}</>
|
||||||
)}
|
)}
|
||||||
{EditQtyCombo && row?.localId === Index && (
|
{EditQtyCombo && row?.localId === Index && (
|
||||||
<ComboEditQty
|
<ComboEditQtyAndRate
|
||||||
key={`edit-qty-${Index}`}
|
key={`edit-qty-${Index}`}
|
||||||
handleEditQuantityCancel={
|
handleEditQuantityCancel={
|
||||||
handleEditQuantityComboCancel
|
handleEditQuantityComboCancel
|
||||||
|
|
@ -2394,7 +2506,6 @@ const ComboSalesBillTable = () => {
|
||||||
Index={Index}
|
Index={Index}
|
||||||
setIndex={setIndex}
|
setIndex={setIndex}
|
||||||
setEditQtyCombo={setEditQtyCombo}
|
setEditQtyCombo={setEditQtyCombo}
|
||||||
// id={`qty-${index}`}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -2404,9 +2515,7 @@ const ComboSalesBillTable = () => {
|
||||||
{item.OptionName === 'Rate' && (
|
{item.OptionName === 'Rate' && (
|
||||||
<td
|
<td
|
||||||
key={`rate-${index}`}
|
key={`rate-${index}`}
|
||||||
// className="rateTd"
|
className={`${EditRateCombo ? 'rateTdEditRate' : 'rateTd'} ${isActiveCell ? 'active-cell' : ''}`}
|
||||||
className={EditRateCombo ? 'rateTdEditRate' : 'rateTd'}
|
|
||||||
// onClick={() => editField && handleEditQuantity(row)}
|
|
||||||
onClick={() => editField && handleEditRateCombo(row)}
|
onClick={() => editField && handleEditRateCombo(row)}
|
||||||
>
|
>
|
||||||
{!EditRateCombo || row?.localId !== Index ? (
|
{!EditRateCombo || row?.localId !== Index ? (
|
||||||
|
|
@ -2417,7 +2526,7 @@ const ComboSalesBillTable = () => {
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
{EditRateCombo && row?.localId === Index && (
|
{EditRateCombo && row?.localId === Index && (
|
||||||
<ComboEditRate
|
<ComboEditQtyAndRate
|
||||||
key={`edit-rate-${Index}`}
|
key={`edit-rate-${Index}`}
|
||||||
handleEditRateComboCancel={
|
handleEditRateComboCancel={
|
||||||
handleEditRateComboCancel
|
handleEditRateComboCancel
|
||||||
|
|
@ -2463,7 +2572,7 @@ const ComboSalesBillTable = () => {
|
||||||
{item.OptionName === 'Total' && (
|
{item.OptionName === 'Total' && (
|
||||||
<td
|
<td
|
||||||
key={`total-${index}`}
|
key={`total-${index}`}
|
||||||
className="totalTd"
|
className={`totalTd ${isActiveCell ? 'active-cell' : ''}`}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// if (editField) {
|
// if (editField) {
|
||||||
// handleEditQuantity(row)
|
// handleEditQuantity(row)
|
||||||
|
|
@ -2474,7 +2583,9 @@ const ComboSalesBillTable = () => {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{allowDecimal
|
{allowDecimal
|
||||||
? Number(row.TotalAmt - (row?.Offer || 0)).toFixed(2)
|
? Number(row.TotalAmt - (row?.Offer || 0)).toFixed(
|
||||||
|
2
|
||||||
|
)
|
||||||
: Number(row.TotalAmt - (row?.Offer || 0))}
|
: Number(row.TotalAmt - (row?.Offer || 0))}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
@ -2486,12 +2597,18 @@ const ComboSalesBillTable = () => {
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{item.OptionName === '%' && (
|
{item.OptionName === '%' && (
|
||||||
<td key={`percentage-${index}`} className="percentageTd">
|
<td
|
||||||
|
key={`percentage-${index}`}
|
||||||
|
className="percentageTd"
|
||||||
|
>
|
||||||
{row.percentage || '-'}
|
{row.percentage || '-'}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{item.OptionName === 'Commission' && (
|
{item.OptionName === 'Commission' && (
|
||||||
<td key={`commission-${index}`} className="commissionTd">
|
<td
|
||||||
|
key={`commission-${index}`}
|
||||||
|
className="commissionTd"
|
||||||
|
>
|
||||||
{row.commission || '-'}
|
{row.commission || '-'}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
@ -2521,7 +2638,8 @@ const ComboSalesBillTable = () => {
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,16 @@
|
||||||
background-color: #e5d434;
|
background-color: #e5d434;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.active-row {
|
||||||
|
outline: 2px solid #1292ee;
|
||||||
|
outline-offset: -2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.active-cell {
|
||||||
|
background-color: #1292ee !important;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
td {
|
td {
|
||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
border: 1px solid #9c9c9c;
|
border: 1px solid #9c9c9c;
|
||||||
|
|
@ -189,3 +199,14 @@
|
||||||
padding: 1px !important;
|
padding: 1px !important;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.focused-cell {
|
||||||
|
background-color: #fff3cd !important;
|
||||||
|
border: 2px solid #ffc107 !important;
|
||||||
|
box-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
:where(.css-dev-only-do-not-override-mncuj7).ant-select-dropdown .ant-select-item-option-active:not(.ant-select-item-option-disabled) {
|
||||||
|
background-color: rgba(116, 107, 107, 0.356);
|
||||||
|
}
|
||||||
|
|
@ -274,18 +274,28 @@ const StandardTable = () => {
|
||||||
}
|
}
|
||||||
// 👉 CTRL shortcuts
|
// 👉 CTRL shortcuts
|
||||||
if (!event.ctrlKey) return;
|
if (!event.ctrlKey) return;
|
||||||
|
// if (key === 'q') {
|
||||||
|
// event.preventDefault();
|
||||||
|
// handleShortcut('qty');
|
||||||
|
// }
|
||||||
|
// if (key === 'e') {
|
||||||
|
// event.preventDefault();
|
||||||
|
// handleShortcut('price');
|
||||||
|
// }
|
||||||
if (key === 'q') {
|
if (key === 'q') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('qty');
|
handleShortcut('qty');
|
||||||
}
|
} else if (key === 'e') {
|
||||||
|
|
||||||
if (key === 'e') {
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
handleShortcut('price');
|
handleShortcut('price');
|
||||||
|
} else if (key === 'y') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('Parcel');
|
||||||
|
} else if (key === 'b') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('weightAmount');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener('keydown', handleKeyDown);
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,12 +1,10 @@
|
||||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { Badge, Modal, Tooltip } from 'antd';
|
import { Badge, Tooltip } from 'antd';
|
||||||
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
|
||||||
import defaultimage from '../../../../Images/defaultItemImg.png';
|
import defaultimage from '../../../../Images/defaultItemImg.png';
|
||||||
import FormHeader from '../../../PageComponents/FormHeader';
|
import FormHeader from '../../../PageComponents/FormHeader';
|
||||||
import {
|
import {
|
||||||
GlobalPricingAppPricingName,
|
|
||||||
SelectedGlobalCardColorDetail,
|
SelectedGlobalCardColorDetail,
|
||||||
SelectedGlobalCardFont,
|
SelectedGlobalCardFont,
|
||||||
StoredSessionData,
|
StoredSessionData,
|
||||||
|
|
@ -44,15 +42,12 @@ import {
|
||||||
GlobalReorderHoldDetails,
|
GlobalReorderHoldDetails,
|
||||||
GlobalWeightScalePort,
|
GlobalWeightScalePort,
|
||||||
GlobalWeightScaleWeight,
|
GlobalWeightScaleWeight,
|
||||||
changeWeightScaleWeight,
|
|
||||||
GlobalExpDateforHeight,
|
GlobalExpDateforHeight,
|
||||||
GlobalBookingTypeBoth,
|
|
||||||
GlobalOrderType,
|
GlobalOrderType,
|
||||||
GlobalReorderProductDetails,
|
GlobalReorderProductDetails,
|
||||||
getConfigType,
|
getConfigType,
|
||||||
GlobalPayementloader,
|
GlobalPayementloader,
|
||||||
GlobalPaymentTransactionNumber,
|
GlobalPaymentTransactionNumber,
|
||||||
GlobalSelOption,
|
|
||||||
PreferenceData,
|
PreferenceData,
|
||||||
changeCardData,
|
changeCardData,
|
||||||
GlobaldraggingComponent,
|
GlobaldraggingComponent,
|
||||||
|
|
@ -127,6 +122,7 @@ import AddProduct from '../../../../Components/AddProduct/AddProduct.jsx';
|
||||||
import { MdOutlineAddShoppingCart } from 'react-icons/md';
|
import { MdOutlineAddShoppingCart } from 'react-icons/md';
|
||||||
import { bulkpostdata } from '../../../../Features/ProductPage/ProductPage.js';
|
import { bulkpostdata } from '../../../../Features/ProductPage/ProductPage.js';
|
||||||
import ProductPriceChange from '../UtillComponents/ProductPriceChange.jsx';
|
import ProductPriceChange from '../UtillComponents/ProductPriceChange.jsx';
|
||||||
|
import ExpireConfirmModal from '../BookingFunctionality/ExpireConfirmModal.jsx';
|
||||||
|
|
||||||
export function SortableCard({ id, children, item }) {
|
export function SortableCard({ id, children, item }) {
|
||||||
const {
|
const {
|
||||||
|
|
@ -193,18 +189,14 @@ const BSItemCard = (props) => {
|
||||||
const AllCategoryDatas = useSelector(GlobalCategorieData, shallowEqual);
|
const AllCategoryDatas = useSelector(GlobalCategorieData, shallowEqual);
|
||||||
const AllsubcatgoryDatas = useSelector(GlobalSubcategorieData, shallowEqual);
|
const AllsubcatgoryDatas = useSelector(GlobalSubcategorieData, shallowEqual);
|
||||||
const RetailWSSalesType = useSelector(GlobalRetailWSSalesType, shallowEqual);
|
const RetailWSSalesType = useSelector(GlobalRetailWSSalesType, shallowEqual);
|
||||||
// const CustDetails = SelectedCust ? SelectedCust : AddCustomerDetails?.[0];
|
|
||||||
const BookingTypeBoth = useSelector(GlobalBookingTypeBoth);
|
|
||||||
const GPreOrderList = useSelector(GlobalPreOrderList, shallowEqual);
|
const GPreOrderList = useSelector(GlobalPreOrderList, shallowEqual);
|
||||||
const [modelQty, setModelQty] = useState(false);
|
const [modelQty, setModelQty] = useState(false);
|
||||||
const [modelstock, setModelstock] = useState(false);
|
const [modelstock, setModelstock] = useState(false);
|
||||||
const [ModalVarient, setModalVarient] = useState(false);
|
const [ModalVarient, setModalVarient] = useState(false);
|
||||||
const [QtyIndex, setQtyIndex] = useState(0);
|
const [QtyIndex, setQtyIndex] = useState(0);
|
||||||
const [VarientIndex, setVarientIndex] = useState(0);
|
const [VarientIndex, setVarientIndex] = useState(0);
|
||||||
const [expModel, setexpModel] = useState(false);
|
|
||||||
const [prodexpir, setProdexpir] = useState(false);
|
const [prodexpir, setProdexpir] = useState(false);
|
||||||
const [expVarModel, setexpVarModel] = useState(false);
|
|
||||||
const [expStockModel, setexpStockModel] = useState(false);
|
|
||||||
const [initialRun, setInitialRun] = useState(false);
|
const [initialRun, setInitialRun] = useState(false);
|
||||||
const [Item, setItem] = useState();
|
const [Item, setItem] = useState();
|
||||||
const [VarItem, setVarItem] = useState(0);
|
const [VarItem, setVarItem] = useState(0);
|
||||||
|
|
@ -246,7 +238,10 @@ const BSItemCard = (props) => {
|
||||||
SelectedGlobalCardColorDetail,
|
SelectedGlobalCardColorDetail,
|
||||||
shallowEqual
|
shallowEqual
|
||||||
);
|
);
|
||||||
const GetmultipleSearchDatas = useSelector(GlobalGetmultipleSearchDatas, shallowEqual)
|
const GetmultipleSearchDatas = useSelector(
|
||||||
|
GlobalGetmultipleSearchDatas,
|
||||||
|
shallowEqual
|
||||||
|
);
|
||||||
const SelectedCardFont = useSelector(SelectedGlobalCardFont, shallowEqual);
|
const SelectedCardFont = useSelector(SelectedGlobalCardFont, shallowEqual);
|
||||||
const CartOrderDetails = useSelector(GlobalOrderCardDetails, shallowEqual);
|
const CartOrderDetails = useSelector(GlobalOrderCardDetails, shallowEqual);
|
||||||
const SelectedDatas = useSelector(GlobalSelectedDatas, shallowEqual);
|
const SelectedDatas = useSelector(GlobalSelectedDatas, shallowEqual);
|
||||||
|
|
@ -254,7 +249,7 @@ const BSItemCard = (props) => {
|
||||||
const WSProductdata = useSelector(GlobalWSProduct, shallowEqual);
|
const WSProductdata = useSelector(GlobalWSProduct, shallowEqual);
|
||||||
const NewQrProductData = useSelector(GlobalNewQrProduct, shallowEqual);
|
const NewQrProductData = useSelector(GlobalNewQrProduct, shallowEqual);
|
||||||
const ReportholdData = useSelector(GlobalReorderHoldDetails, shallowEqual);
|
const ReportholdData = useSelector(GlobalReorderHoldDetails, shallowEqual);
|
||||||
console.log(GetmultipleSearchDatas, "GetmultipleSearchDatas")
|
console.log(GetmultipleSearchDatas, 'GetmultipleSearchDatas');
|
||||||
const ReorderProductData = useSelector(
|
const ReorderProductData = useSelector(
|
||||||
GlobalReorderProductDetails,
|
GlobalReorderProductDetails,
|
||||||
shallowEqual
|
shallowEqual
|
||||||
|
|
@ -285,12 +280,11 @@ const BSItemCard = (props) => {
|
||||||
const [QuickAdd, setQuickAdd] = useState(true);
|
const [QuickAdd, setQuickAdd] = useState(true);
|
||||||
const [onePeiceFlow, setOnePeiceFlow] = useState(false);
|
const [onePeiceFlow, setOnePeiceFlow] = useState(false);
|
||||||
const [BillOrderPre, setBillOrderPre] = useState();
|
const [BillOrderPre, setBillOrderPre] = useState();
|
||||||
const [expQtyModel, setExpQtyModel] = useState(false);
|
|
||||||
const [qtyExpData, setQtyExpData] = useState();
|
const [qtyExpData, setQtyExpData] = useState();
|
||||||
const OrderOfferDetail = useSelector(Global_OrderOfferDetail);
|
const OrderOfferDetail = useSelector(Global_OrderOfferDetail);
|
||||||
const [freeProductsOffers, setfreeProductsOffers] = useState([]);
|
// const [freeProductsOffers, setfreeProductsOffers] = useState([]);
|
||||||
const [screenWidth, setScreenWidth] = useState(window.innerWidth);
|
const [screenWidth, setScreenWidth] = useState(window.innerWidth);
|
||||||
const [screenHeight, setScreenHeight] = useState(window.innerHeight);
|
// const [screenHeight, setScreenHeight] = useState(window.innerHeight);
|
||||||
const ProdCat = useSelector(GlobalProductCategorie, shallowEqual);
|
const ProdCat = useSelector(GlobalProductCategorie, shallowEqual);
|
||||||
const paymentloader = useSelector(GlobalPayementloader, shallowEqual);
|
const paymentloader = useSelector(GlobalPayementloader, shallowEqual);
|
||||||
const SessionData = useSelector(StoredSessionData, shallowEqual);
|
const SessionData = useSelector(StoredSessionData, shallowEqual);
|
||||||
|
|
@ -318,6 +312,13 @@ const BSItemCard = (props) => {
|
||||||
const triggerOfferFree = useSelector(GlobalTriggerOfferFree);
|
const triggerOfferFree = useSelector(GlobalTriggerOfferFree);
|
||||||
const productCardTrigger = useSelector(GlobalProductCardTrigger);
|
const productCardTrigger = useSelector(GlobalProductCardTrigger);
|
||||||
const appPreferences = useSelector(ApplicationPreferences);
|
const appPreferences = useSelector(ApplicationPreferences);
|
||||||
|
const [expireModal, setExpireModal] = useState({
|
||||||
|
open: false,
|
||||||
|
title: '',
|
||||||
|
onOk: null,
|
||||||
|
onCancel: null,
|
||||||
|
});
|
||||||
|
|
||||||
const salespagefields = appPreferences?.find(
|
const salespagefields = appPreferences?.find(
|
||||||
(pref) => pref?.PreferredCatName === 'Sales Page Fields'
|
(pref) => pref?.PreferredCatName === 'Sales Page Fields'
|
||||||
)?.PreferenceCatDetails;
|
)?.PreferenceCatDetails;
|
||||||
|
|
@ -326,7 +327,7 @@ const BSItemCard = (props) => {
|
||||||
type?.PreferredSubCatName?.toLowerCase() === 'available date' &&
|
type?.PreferredSubCatName?.toLowerCase() === 'available date' &&
|
||||||
type?.PreferredStatus === 'Y'
|
type?.PreferredStatus === 'Y'
|
||||||
);
|
);
|
||||||
console.log(AvailableDate, salespagefields, 'Available Date');
|
|
||||||
const SingleMember = salespagefields?.find(
|
const SingleMember = salespagefields?.find(
|
||||||
(type) =>
|
(type) =>
|
||||||
type?.PreferredSubCatName?.toLowerCase() === 'single member' &&
|
type?.PreferredSubCatName?.toLowerCase() === 'single member' &&
|
||||||
|
|
@ -934,6 +935,19 @@ const BSItemCard = (props) => {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const openExpireModal = ({ title, onOk, onCancel }) => {
|
||||||
|
setExpireModal({
|
||||||
|
open: true,
|
||||||
|
title,
|
||||||
|
onOk,
|
||||||
|
onCancel,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeExpireModal = () => {
|
||||||
|
setExpireModal((prev) => ({ ...prev, open: false }));
|
||||||
|
};
|
||||||
|
|
||||||
// Usage example:
|
// Usage example:
|
||||||
// const result = handleLoyaltyFreeProducts(orderCardDtls, freeProdDtls);
|
// const result = handleLoyaltyFreeProducts(orderCardDtls, freeProdDtls);
|
||||||
// console.log(result.ModifiedData);
|
// console.log(result.ModifiedData);
|
||||||
|
|
@ -941,13 +955,9 @@ const BSItemCard = (props) => {
|
||||||
// console.log(result.AppliedOffers);
|
// console.log(result.AppliedOffers);
|
||||||
|
|
||||||
async function getOffers() {
|
async function getOffers() {
|
||||||
let response = await dispatch(
|
await dispatch(
|
||||||
getOfferinBooking({ AppId: AppId, CompId: CompId, BranchId: BranchId })
|
getOfferinBooking({ AppId: AppId, CompId: CompId, BranchId: BranchId })
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
if (response?.data?.statusCode == 1) {
|
|
||||||
let expiredProd = response?.data?.data;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -968,7 +978,7 @@ const BSItemCard = (props) => {
|
||||||
if (TableName === 'BuyXGetXOffers') return true;
|
if (TableName === 'BuyXGetXOffers') return true;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
setfreeProductsOffers(filteredOffers);
|
// setfreeProductsOffers(filteredOffers);
|
||||||
|
|
||||||
getOffers();
|
getOffers();
|
||||||
}, [OrderOfferDetail]);
|
}, [OrderOfferDetail]);
|
||||||
|
|
@ -982,12 +992,7 @@ const BSItemCard = (props) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [SelectedCardFont]);
|
}, [SelectedCardFont]);
|
||||||
// const cardData = !globalAccessForOthers
|
|
||||||
// ? CardAccess
|
|
||||||
// ? SelectedDatas
|
|
||||||
// : ItemCard?.length == 0 ? noSubcatCardData : ItemCard
|
|
||||||
// : "";
|
|
||||||
//mohan 18-04-2025
|
|
||||||
const cardData = !globalAccessForOthers
|
const cardData = !globalAccessForOthers
|
||||||
? CardAccess
|
? CardAccess
|
||||||
? SelectedDatas?.length > 1
|
? SelectedDatas?.length > 1
|
||||||
|
|
@ -1029,7 +1034,7 @@ const BSItemCard = (props) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (AppId && CompId && BranchId) {
|
if (AppId && CompId && BranchId) {
|
||||||
fetchedit();
|
fetchedit();
|
||||||
GetmultipleSearchData()
|
GetmultipleSearchData();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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
|
||||||
|
|
@ -1043,10 +1048,9 @@ const BSItemCard = (props) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await dispatch(getmultipleSearch(data))
|
const response = await dispatch(getmultipleSearch(data));
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Get Search Terms Error:", error);
|
console.error('Get Search Terms Error:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1065,9 +1069,10 @@ const BSItemCard = (props) => {
|
||||||
setNoSubcatCardData();
|
setNoSubcatCardData();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ProductSearch?.length > 5 && GetmultipleSearchDatas.some(
|
if (
|
||||||
e => e.toLowerCase() === "qrcode"
|
ProductSearch?.length > 5 &&
|
||||||
)) {
|
GetmultipleSearchDatas.some((e) => e.toLowerCase() === 'qrcode')
|
||||||
|
) {
|
||||||
setQuickAdd(true);
|
setQuickAdd(true);
|
||||||
}
|
}
|
||||||
}, [ProductSearch, GetmultipleSearchDatas]);
|
}, [ProductSearch, GetmultipleSearchDatas]);
|
||||||
|
|
@ -1180,13 +1185,6 @@ const BSItemCard = (props) => {
|
||||||
|
|
||||||
if (tempconfigdata?.data?.statusCode == 1) {
|
if (tempconfigdata?.data?.statusCode == 1) {
|
||||||
setConfigDataList(tempconfigdata?.data?.data);
|
setConfigDataList(tempconfigdata?.data?.data);
|
||||||
let configdata = tempconfigdata?.data?.data;
|
|
||||||
let checkName = BookingTypeBoth ? 'DineIn,TakeAway' : BookingType;
|
|
||||||
|
|
||||||
let filterconfigdata = configdata?.find(
|
|
||||||
(a) => a?.ConfigName === checkName
|
|
||||||
);
|
|
||||||
// setSelectedBookingType(filterconfigdata?.ConfigId);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1220,7 +1218,10 @@ const BSItemCard = (props) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (ItemCard?.[0]?.QrBasedSearch === 'Y') {
|
if (ItemCard?.[0]?.QrBasedSearch === 'Y') {
|
||||||
if (ItemCard?.[0]?.OverAllExpStatus == 'Y' && ExpiredProduct) {
|
if (ItemCard?.[0]?.OverAllExpStatus == 'Y' && ExpiredProduct) {
|
||||||
setexpModel(true);
|
openExpireModal({
|
||||||
|
title: 'Product Expires',
|
||||||
|
onOk: () => expFun(Item),
|
||||||
|
});
|
||||||
setItem(ItemCard?.[0]);
|
setItem(ItemCard?.[0]);
|
||||||
} else {
|
} else {
|
||||||
setQtydata(ItemCard?.[0]);
|
setQtydata(ItemCard?.[0]);
|
||||||
|
|
@ -1228,7 +1229,10 @@ const BSItemCard = (props) => {
|
||||||
}
|
}
|
||||||
} else if (ItemCard?.[0]?.OnePcQRBased === 'Y') {
|
} else if (ItemCard?.[0]?.OnePcQRBased === 'Y') {
|
||||||
if (ItemCard?.[0]?.OverAllExpStatus == 'Y' && ExpiredProduct) {
|
if (ItemCard?.[0]?.OverAllExpStatus == 'Y' && ExpiredProduct) {
|
||||||
setexpModel(true);
|
openExpireModal({
|
||||||
|
title: 'Product Expires',
|
||||||
|
onOk: () => expFun(Item),
|
||||||
|
});
|
||||||
setItem(ItemCard?.[0]);
|
setItem(ItemCard?.[0]);
|
||||||
setOnePeiceFlow(true);
|
setOnePeiceFlow(true);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1320,14 +1324,6 @@ const BSItemCard = (props) => {
|
||||||
)?.SettingValue === 'Y';
|
)?.SettingValue === 'Y';
|
||||||
setExpiredProduct(expiredDate);
|
setExpiredProduct(expiredDate);
|
||||||
};
|
};
|
||||||
const to12Hour = (timeStr) => {
|
|
||||||
if (!timeStr) return '';
|
|
||||||
let [h, m] = timeStr.split(':');
|
|
||||||
h = parseInt(h, 10);
|
|
||||||
const suffix = h >= 12 ? 'PM' : 'AM';
|
|
||||||
h = h % 12 || 12; // 0 → 12
|
|
||||||
return `${h}${suffix}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
const CloseModal = () => {
|
const CloseModal = () => {
|
||||||
setModelQty(false);
|
setModelQty(false);
|
||||||
|
|
@ -1489,55 +1485,6 @@ const BSItemCard = (props) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// const Stockfun = (index) => {
|
|
||||||
// setVarientIndex(index.key)
|
|
||||||
// let count = qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[index.key]?.StockDetails?.length;
|
|
||||||
// if (StockPreferenceDetail?.SettingValue === "Y") {
|
|
||||||
// if (count > 1) {
|
|
||||||
// if (qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[index.key]?.OverAllExpStatus == 'N') {
|
|
||||||
// setModalVarient(false)
|
|
||||||
// setModelstock(true)
|
|
||||||
// setVarItem(index.key)
|
|
||||||
// }
|
|
||||||
// else if (qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[index.key]?.OverAllExpStatus == 'Y') {
|
|
||||||
// if (prodexpir) {
|
|
||||||
// setRepeatedModel(true)
|
|
||||||
// setModalVarient(false)
|
|
||||||
// setModelstock(true)
|
|
||||||
// setVarItem(index.key)
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// setexpVarModel(true);
|
|
||||||
// setVarItem(index.key)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // setVarientIndex(index.key)
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// if (qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[index.key]?.OverAllExpStatus == 'N') {
|
|
||||||
// dataTransfer(qtydata, QtyIndex, index.key, 0);
|
|
||||||
// setModelQty(false)
|
|
||||||
// setVarItem(index.key)
|
|
||||||
// }
|
|
||||||
// else if (qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[index.key]?.OverAllExpStatus == 'Y') {
|
|
||||||
// if (prodexpir) {
|
|
||||||
// setProdexpir(false)
|
|
||||||
// setRepeatedModel(true)
|
|
||||||
// dataTransfer(qtydata, QtyIndex, index.key, 0);
|
|
||||||
// setModelQty(false)
|
|
||||||
// setVarItem(index.key)
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// setexpVarModel(true);
|
|
||||||
// setVarItem(index.key)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// dataTransfer(qtydata, QtyIndex, index.key, 0);
|
|
||||||
// setModelQty(false)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
const Stockfun = (index) => {
|
const Stockfun = (index) => {
|
||||||
setVarientIndex(index.key);
|
setVarientIndex(index.key);
|
||||||
const variantDetails =
|
const variantDetails =
|
||||||
|
|
@ -1562,7 +1509,14 @@ const BSItemCard = (props) => {
|
||||||
}
|
}
|
||||||
} else if (overallExpStatus === 'Y' && ExpiredProduct) {
|
} else if (overallExpStatus === 'Y' && ExpiredProduct) {
|
||||||
setVarItem(index.key);
|
setVarItem(index.key);
|
||||||
setexpVarModel(true);
|
openExpireModal({
|
||||||
|
title: 'Variant Expires',
|
||||||
|
onOk: () => expVerFun(VarItem),
|
||||||
|
onCancel: () => {
|
||||||
|
setRepeatedModel(false);
|
||||||
|
setProdexpir(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (
|
if (
|
||||||
|
|
@ -1638,7 +1592,14 @@ const BSItemCard = (props) => {
|
||||||
}
|
}
|
||||||
} else if (overallExpStatus === 'Y' && ExpiredProduct) {
|
} else if (overallExpStatus === 'Y' && ExpiredProduct) {
|
||||||
setVarItem(index.key);
|
setVarItem(index.key);
|
||||||
setexpVarModel(true);
|
openExpireModal({
|
||||||
|
title: 'Variant Expires',
|
||||||
|
onOk: () => expVerFun(VarItem),
|
||||||
|
onCancel: () => {
|
||||||
|
setRepeatedModel(false);
|
||||||
|
setProdexpir(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1695,16 +1656,6 @@ const BSItemCard = (props) => {
|
||||||
dataTransfer(qtydata, QtyIndex, index.key, 0, onePeiceFlow);
|
dataTransfer(qtydata, QtyIndex, index.key, 0, onePeiceFlow);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// if (Isincart && Isincart?.StockAvailable === 'Y') {
|
|
||||||
// if (Isincart?.BalanceQty > Isincart?.OrderQty) {
|
|
||||||
// dataTransfer(qtydata, QtyIndex, index.key, 0, onePeiceFlow);
|
|
||||||
// } else {
|
|
||||||
// dataTransfer(qtydata, QtyIndex, index.key, 1, onePeiceFlow);
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// dataTransfer(qtydata, QtyIndex, index.key, 0, onePeiceFlow);
|
|
||||||
// }
|
|
||||||
|
|
||||||
const findNextAvailableStockIndex = (
|
const findNextAvailableStockIndex = (
|
||||||
stockDetails,
|
stockDetails,
|
||||||
CartOrderDetails,
|
CartOrderDetails,
|
||||||
|
|
@ -1770,7 +1721,14 @@ const BSItemCard = (props) => {
|
||||||
}
|
}
|
||||||
} else if (overallExpStatus === 'Y' && ExpiredProduct) {
|
} else if (overallExpStatus === 'Y' && ExpiredProduct) {
|
||||||
setVarItem(index.key);
|
setVarItem(index.key);
|
||||||
setexpVarModel(true);
|
openExpireModal({
|
||||||
|
title: 'Variant Expires',
|
||||||
|
onOk: () => expVerFun(VarItem),
|
||||||
|
onCancel: () => {
|
||||||
|
setRepeatedModel(false);
|
||||||
|
setProdexpir(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setModelQty(false);
|
setModelQty(false);
|
||||||
|
|
@ -1782,7 +1740,14 @@ const BSItemCard = (props) => {
|
||||||
(item) => item.OverAllExpStatus === 'Y'
|
(item) => item.OverAllExpStatus === 'Y'
|
||||||
);
|
);
|
||||||
if (QtyExpire && ExpiredProduct) {
|
if (QtyExpire && ExpiredProduct) {
|
||||||
setExpQtyModel(true);
|
openExpireModal({
|
||||||
|
title: 'Quantity Expires',
|
||||||
|
onOk: () => expQtyFun(qtyExpData),
|
||||||
|
onCancel: () => {
|
||||||
|
setRepeatedModel(false);
|
||||||
|
(setProdexpir(false), closeExpireModal());
|
||||||
|
},
|
||||||
|
});
|
||||||
setQtyExpData(index);
|
setQtyExpData(index);
|
||||||
} else {
|
} else {
|
||||||
const selectedProIndex = qtydata?.ProductDetail?.findIndex(
|
const selectedProIndex = qtydata?.ProductDetail?.findIndex(
|
||||||
|
|
@ -2048,7 +2013,14 @@ const BSItemCard = (props) => {
|
||||||
} else if (overallExpStatus === 'Y' && repeatedModel) {
|
} else if (overallExpStatus === 'Y' && repeatedModel) {
|
||||||
dataTransfer(qtydata, QtyIndex, VarientIndex, item.key, onePeiceFlow);
|
dataTransfer(qtydata, QtyIndex, VarientIndex, item.key, onePeiceFlow);
|
||||||
} else {
|
} else {
|
||||||
setexpStockModel(true);
|
openExpireModal({
|
||||||
|
title: 'Stock Expires',
|
||||||
|
onOk: () => expStockFun(StockItem),
|
||||||
|
onCancel: () => {
|
||||||
|
setRepeatedModel(false);
|
||||||
|
setProdexpir(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
setStockItem(item.key);
|
setStockItem(item.key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2057,178 +2029,9 @@ const BSItemCard = (props) => {
|
||||||
setRepeatedModel(false);
|
setRepeatedModel(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const pressTimer = useRef(null);
|
|
||||||
const isLongPress = useRef(false);
|
|
||||||
const [priceChangeProduct, setPriceChangeProduct] = useState([]);
|
const [priceChangeProduct, setPriceChangeProduct] = useState([]);
|
||||||
const [productPriceChange, setProductPriceChange] = useState(false);
|
const [productPriceChange, setProductPriceChange] = useState(false);
|
||||||
|
|
||||||
const handleMouseDownItemCard = (e, item) => {
|
|
||||||
isLongPress.current = false;
|
|
||||||
|
|
||||||
pressTimer.current = setTimeout(() => {
|
|
||||||
if (
|
|
||||||
!(
|
|
||||||
(item?.OverAllQty !== undefined && !preferenceSingleSales
|
|
||||||
? returnCount(
|
|
||||||
item?.ProductDetail?.[0]?.ProdName,
|
|
||||||
item?.OverAllQty,
|
|
||||||
CartOrderDetails
|
|
||||||
)
|
|
||||||
: returnOnepcCount(
|
|
||||||
item?.ProductDetail?.[0]?.ProdName,
|
|
||||||
item?.OverAllPcs,
|
|
||||||
CartOrderDetails
|
|
||||||
)) > 0 ||
|
|
||||||
item?.ProductDetail?.some((item) => item?.StockAvailable !== 'Y')
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
e.stopPropagation();
|
|
||||||
} else {
|
|
||||||
isLongPress.current = true;
|
|
||||||
handleLongPress(item);
|
|
||||||
}
|
|
||||||
}, 1000); // Adjust duration as needed
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleMouseUpItemCard = (e, item, check) => {
|
|
||||||
clearTimeout(pressTimer.current);
|
|
||||||
|
|
||||||
if (!isLongPress.current) {
|
|
||||||
// Your existing onClick logic
|
|
||||||
if (
|
|
||||||
!(
|
|
||||||
(item?.OverAllQty !== undefined && !preferenceSingleSales
|
|
||||||
? returnCount(
|
|
||||||
item?.ProductDetail?.[0]?.ProdName,
|
|
||||||
item?.OverAllQty,
|
|
||||||
CartOrderDetails
|
|
||||||
)
|
|
||||||
: returnOnepcCount(
|
|
||||||
item?.ProductDetail?.[0]?.ProdName,
|
|
||||||
item?.OverAllPcs,
|
|
||||||
CartOrderDetails
|
|
||||||
)) > 0 ||
|
|
||||||
item?.ProductDetail?.some((item) => item?.StockAvailable !== 'Y')
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
e.stopPropagation();
|
|
||||||
} else {
|
|
||||||
if (check && !e.target.closest('.card4Main-onepiece')) {
|
|
||||||
CardOnclick(
|
|
||||||
item,
|
|
||||||
item?.OnePcsAvailable === 'Y' &&
|
|
||||||
preferenceSingleSales &&
|
|
||||||
'OnePeiceProduct'
|
|
||||||
);
|
|
||||||
} else if (!check) {
|
|
||||||
CardOnclick(
|
|
||||||
item,
|
|
||||||
item?.OnePcsAvailable === 'Y' &&
|
|
||||||
preferenceSingleSales &&
|
|
||||||
'OnePeiceProduct'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
isLongPress.current = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleMouseLeave = () => {
|
|
||||||
clearTimeout(pressTimer.current);
|
|
||||||
isLongPress.current = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Mobile - Touch Start
|
|
||||||
const handleTouchStartItemCard = (e, item) => {
|
|
||||||
e.preventDefault();
|
|
||||||
isLongPress.current = false;
|
|
||||||
|
|
||||||
pressTimer.current = setTimeout(() => {
|
|
||||||
if (
|
|
||||||
!(
|
|
||||||
(item?.OverAllQty !== undefined && !preferenceSingleSales
|
|
||||||
? returnCount(
|
|
||||||
item?.ProductDetail?.[0]?.ProdName,
|
|
||||||
item?.OverAllQty,
|
|
||||||
CartOrderDetails
|
|
||||||
)
|
|
||||||
: returnOnepcCount(
|
|
||||||
item?.ProductDetail?.[0]?.ProdName,
|
|
||||||
item?.OverAllPcs,
|
|
||||||
CartOrderDetails
|
|
||||||
)) > 0 ||
|
|
||||||
item?.ProductDetail?.some((item) => item?.StockAvailable !== 'Y')
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
e.stopPropagation();
|
|
||||||
} else {
|
|
||||||
isLongPress.current = true;
|
|
||||||
handleLongPress(item);
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Mobile - Touch End
|
|
||||||
const handleTouchEndItemCard = (e, item, check = false) => {
|
|
||||||
e.preventDefault();
|
|
||||||
clearTimeout(pressTimer.current);
|
|
||||||
|
|
||||||
if (!isLongPress.current) {
|
|
||||||
// Same logic as mouse up
|
|
||||||
if (
|
|
||||||
!(
|
|
||||||
(item?.OverAllQty !== undefined && !preferenceSingleSales
|
|
||||||
? returnCount(
|
|
||||||
item?.ProductDetail?.[0]?.ProdName,
|
|
||||||
item?.OverAllQty,
|
|
||||||
CartOrderDetails
|
|
||||||
)
|
|
||||||
: returnOnepcCount(
|
|
||||||
item?.ProductDetail?.[0]?.ProdName,
|
|
||||||
item?.OverAllPcs,
|
|
||||||
CartOrderDetails
|
|
||||||
)) > 0 ||
|
|
||||||
item?.ProductDetail?.some((item) => item?.StockAvailable !== 'Y')
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
e.stopPropagation();
|
|
||||||
} else {
|
|
||||||
if (check && !e.target.closest('.card4Main-onepiece')) {
|
|
||||||
CardOnclick(
|
|
||||||
item,
|
|
||||||
item?.OnePcsAvailable === 'Y' &&
|
|
||||||
preferenceSingleSales &&
|
|
||||||
'OnePeiceProduct'
|
|
||||||
);
|
|
||||||
} else if (!check) {
|
|
||||||
CardOnclick(
|
|
||||||
item,
|
|
||||||
item?.OnePcsAvailable === 'Y' &&
|
|
||||||
preferenceSingleSales &&
|
|
||||||
'OnePeiceProduct'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
isLongPress.current = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Mobile - Touch Cancel (when interrupted)
|
|
||||||
const handleTouchCancelItemCard = () => {
|
|
||||||
clearTimeout(pressTimer.current);
|
|
||||||
isLongPress.current = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleLongPress = (item) => {
|
|
||||||
console.log('Long press triggered for:', item);
|
|
||||||
setPriceChangeProduct([item]);
|
|
||||||
setProductPriceChange(true);
|
|
||||||
// Add your long press logic here
|
|
||||||
// For example: open a context menu, show options, etc.
|
|
||||||
};
|
|
||||||
|
|
||||||
const CardOnclick = async (item, Parameter) => {
|
const CardOnclick = async (item, Parameter) => {
|
||||||
setOnePeiceFlow(Parameter === 'OnePeiceProduct');
|
setOnePeiceFlow(Parameter === 'OnePeiceProduct');
|
||||||
|
|
||||||
|
|
@ -2248,7 +2051,10 @@ const BSItemCard = (props) => {
|
||||||
Parameter === 'OnePeiceProduct' ? transformedItem : item;
|
Parameter === 'OnePeiceProduct' ? transformedItem : item;
|
||||||
setQtydata(modiffiedData);
|
setQtydata(modiffiedData);
|
||||||
if (modiffiedData.OverAllExpStatus === 'Y' && ExpiredProduct) {
|
if (modiffiedData.OverAllExpStatus === 'Y' && ExpiredProduct) {
|
||||||
setexpModel(true);
|
openExpireModal({
|
||||||
|
title: 'Product Expires',
|
||||||
|
onOk: () => expFun(modiffiedData),
|
||||||
|
});
|
||||||
setItem(modiffiedData);
|
setItem(modiffiedData);
|
||||||
} else if (modiffiedData) {
|
} else if (modiffiedData) {
|
||||||
setQtydata(modiffiedData);
|
setQtydata(modiffiedData);
|
||||||
|
|
@ -2370,19 +2176,6 @@ const BSItemCard = (props) => {
|
||||||
)
|
)
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const freeProductAvailableForThisItem = hasOffer
|
|
||||||
? OverAllproductBasedOfferDatas?.ProdDtl?.filter(
|
|
||||||
(o) =>
|
|
||||||
o?.ProdId === item?.ProdId &&
|
|
||||||
o?.ProdVariantDetails?.some((variant) =>
|
|
||||||
variant?.StockDetails?.some(
|
|
||||||
(stock) =>
|
|
||||||
stock?.InwardDtlId === item?.InwardDtlId && o?.MinQty > 0
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
: [];
|
|
||||||
|
|
||||||
const calculateTaxAmounts = (qty, rate, taxPercentage) => {
|
const calculateTaxAmounts = (qty, rate, taxPercentage) => {
|
||||||
const totalAmount = qty * rate;
|
const totalAmount = qty * rate;
|
||||||
const taxAmount = (
|
const taxAmount = (
|
||||||
|
|
@ -2447,7 +2240,8 @@ const BSItemCard = (props) => {
|
||||||
((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
|
((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
|
||||||
? true
|
? true
|
||||||
: cartItem?.OfferMode !== 'B') &&
|
: cartItem?.OfferMode !== 'B') &&
|
||||||
cartItem?.OfferMode !== 'P' && cartItem?.OfferMode !== 'C' &&
|
cartItem?.OfferMode !== 'P' &&
|
||||||
|
cartItem?.OfferMode !== 'C' &&
|
||||||
cartItem?.OfferMode !== 'O' &&
|
cartItem?.OfferMode !== 'O' &&
|
||||||
cartItem?.OfferMode !== 'L'
|
cartItem?.OfferMode !== 'L'
|
||||||
? true
|
? true
|
||||||
|
|
@ -2460,7 +2254,8 @@ const BSItemCard = (props) => {
|
||||||
((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
|
((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
|
||||||
? true
|
? true
|
||||||
: cartItem?.OfferMode !== 'B') &&
|
: cartItem?.OfferMode !== 'B') &&
|
||||||
cartItem?.OfferMode !== 'P' && cartItem?.OfferMode !== 'C' &&
|
cartItem?.OfferMode !== 'P' &&
|
||||||
|
cartItem?.OfferMode !== 'C' &&
|
||||||
cartItem?.OfferMode !== 'O' &&
|
cartItem?.OfferMode !== 'O' &&
|
||||||
cartItem?.OfferMode !== 'L'
|
cartItem?.OfferMode !== 'L'
|
||||||
? true
|
? true
|
||||||
|
|
@ -2476,7 +2271,8 @@ const BSItemCard = (props) => {
|
||||||
((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
|
((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
|
||||||
? true
|
? true
|
||||||
: cartItem?.OfferMode !== 'B') &&
|
: cartItem?.OfferMode !== 'B') &&
|
||||||
cartItem?.OfferMode !== 'P' && cartItem?.OfferMode !== 'C' &&
|
cartItem?.OfferMode !== 'P' &&
|
||||||
|
cartItem?.OfferMode !== 'C' &&
|
||||||
cartItem?.OfferMode !== 'O' &&
|
cartItem?.OfferMode !== 'O' &&
|
||||||
cartItem?.OfferMode !== 'L'
|
cartItem?.OfferMode !== 'L'
|
||||||
? true
|
? true
|
||||||
|
|
@ -2491,7 +2287,8 @@ const BSItemCard = (props) => {
|
||||||
((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
|
((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
|
||||||
? true
|
? true
|
||||||
: cartItem?.OfferMode !== 'B') &&
|
: cartItem?.OfferMode !== 'B') &&
|
||||||
cartItem?.OfferMode !== 'P' && cartItem?.OfferMode !== 'C' &&
|
cartItem?.OfferMode !== 'P' &&
|
||||||
|
cartItem?.OfferMode !== 'C' &&
|
||||||
cartItem?.OfferMode !== 'O' &&
|
cartItem?.OfferMode !== 'O' &&
|
||||||
cartItem?.OfferMode !== 'L'
|
cartItem?.OfferMode !== 'L'
|
||||||
? true
|
? true
|
||||||
|
|
@ -2825,9 +2622,12 @@ const BSItemCard = (props) => {
|
||||||
|
|
||||||
const UpdatedCartItemWithOffer = {
|
const UpdatedCartItemWithOffer = {
|
||||||
...item,
|
...item,
|
||||||
Offer: (sameProduct || bestOffer?.OfferMode === 'I' || bestOffer?.OfferMode === 'Q')
|
Offer:
|
||||||
? (bestOffer?.OfferAmount || item.Offer)
|
sameProduct ||
|
||||||
: (item.Offer || bestOffer?.OfferAmount),
|
bestOffer?.OfferMode === 'I' ||
|
||||||
|
bestOffer?.OfferMode === 'Q'
|
||||||
|
? bestOffer?.OfferAmount || item.Offer
|
||||||
|
: item.Offer || bestOffer?.OfferAmount,
|
||||||
OfferType: item?.OfferType || bestOffer?.OfferType,
|
OfferType: item?.OfferType || bestOffer?.OfferType,
|
||||||
OfferMessage: item?.OfferMessage || bestOffer?.OfferMessage,
|
OfferMessage: item?.OfferMessage || bestOffer?.OfferMessage,
|
||||||
OfferMode: item?.OfferMode || bestOffer?.OfferMode,
|
OfferMode: item?.OfferMode || bestOffer?.OfferMode,
|
||||||
|
|
@ -2842,7 +2642,8 @@ const BSItemCard = (props) => {
|
||||||
((c?.OfferModeType && c?.OfferMode === 'B'
|
((c?.OfferModeType && c?.OfferMode === 'B'
|
||||||
? true
|
? true
|
||||||
: c?.OfferMode !== 'B') &&
|
: c?.OfferMode !== 'B') &&
|
||||||
c?.OfferMode !== 'P' && c?.OfferMode !== 'C' &&
|
c?.OfferMode !== 'P' &&
|
||||||
|
c?.OfferMode !== 'C' &&
|
||||||
c?.OfferMode !== 'O' &&
|
c?.OfferMode !== 'O' &&
|
||||||
c?.OfferMode !== 'L'
|
c?.OfferMode !== 'L'
|
||||||
? true
|
? true
|
||||||
|
|
@ -3159,7 +2960,6 @@ const BSItemCard = (props) => {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(Postdata, 'Postdata');
|
|
||||||
const response = await dispatch(
|
const response = await dispatch(
|
||||||
bulkpostdata({ ProdDetails: Postdata })
|
bulkpostdata({ ProdDetails: Postdata })
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
@ -5321,6 +5121,7 @@ const BSItemCard = (props) => {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const expFun = (item) => {
|
const expFun = (item) => {
|
||||||
|
console.log(item, 'itemitemitemitemitemitemitemitem');
|
||||||
let count = item?.ProductDetail?.length;
|
let count = item?.ProductDetail?.length;
|
||||||
if (count > 1) {
|
if (count > 1) {
|
||||||
Quantity();
|
Quantity();
|
||||||
|
|
@ -5328,7 +5129,8 @@ const BSItemCard = (props) => {
|
||||||
setVarItem(0);
|
setVarItem(0);
|
||||||
SingleQuantity(item, onePeiceFlow);
|
SingleQuantity(item, onePeiceFlow);
|
||||||
}
|
}
|
||||||
setexpModel(false);
|
|
||||||
|
closeExpireModal();
|
||||||
setProdexpir(true);
|
setProdexpir(true);
|
||||||
setQtydata(item);
|
setQtydata(item);
|
||||||
};
|
};
|
||||||
|
|
@ -5434,7 +5236,7 @@ const BSItemCard = (props) => {
|
||||||
|
|
||||||
setQtyIndex(selectedProIndex);
|
setQtyIndex(selectedProIndex);
|
||||||
setRepeatedModel(true);
|
setRepeatedModel(true);
|
||||||
setExpQtyModel(false);
|
closeExpireModal();
|
||||||
};
|
};
|
||||||
|
|
||||||
const expVerFun = (item) => {
|
const expVerFun = (item) => {
|
||||||
|
|
@ -5451,12 +5253,12 @@ const BSItemCard = (props) => {
|
||||||
setModelQty(false);
|
setModelQty(false);
|
||||||
setSelectedBrand('Others');
|
setSelectedBrand('Others');
|
||||||
}
|
}
|
||||||
setexpVarModel(false);
|
closeExpireModal();
|
||||||
};
|
};
|
||||||
|
|
||||||
const expStockFun = (item) => {
|
const expStockFun = (item) => {
|
||||||
dataTransfer(qtydata, QtyIndex, VarientIndex, item, onePeiceFlow);
|
dataTransfer(qtydata, QtyIndex, VarientIndex, item, onePeiceFlow);
|
||||||
setexpStockModel(false);
|
closeExpireModal();
|
||||||
};
|
};
|
||||||
|
|
||||||
const getMaxBrandWidth = () => {
|
const getMaxBrandWidth = () => {
|
||||||
|
|
@ -5488,18 +5290,6 @@ const BSItemCard = (props) => {
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
function handleResize() {
|
|
||||||
setScreenHeight(window.innerHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener('resize', handleResize);
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
window.removeEventListener('resize', handleResize);
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// Example usage for checking the length of 'ProdVariantDetails'
|
// Example usage for checking the length of 'ProdVariantDetails'
|
||||||
const widthBasedOnProdVariantDetails = getMaxBrandWidth();
|
const widthBasedOnProdVariantDetails = getMaxBrandWidth();
|
||||||
const ExpDate = useSelector(GlobalExpDateforHeight);
|
const ExpDate = useSelector(GlobalExpDateforHeight);
|
||||||
|
|
@ -7458,11 +7248,9 @@ const BSItemCard = (props) => {
|
||||||
</SortableContext>
|
</SortableContext>
|
||||||
</DndContext>
|
</DndContext>
|
||||||
</>
|
</>
|
||||||
)
|
) : ProductSearch?.length > 5 &&
|
||||||
|
GetmultipleSearchDatas.some(
|
||||||
|
(e) => e.toLowerCase() === 'qrcode'
|
||||||
: ProductSearch?.length > 5 && GetmultipleSearchDatas.some(
|
|
||||||
e => e.toLowerCase() === "qrcode"
|
|
||||||
) &&
|
) &&
|
||||||
(cardData?.length == 0 || cardData == undefined) ? (
|
(cardData?.length == 0 || cardData == undefined) ? (
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -7483,19 +7271,19 @@ const BSItemCard = (props) => {
|
||||||
display: globalAccessForOthers && 'none',
|
display: globalAccessForOthers && 'none',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div align="center" class="fond">
|
<div align="center" className="fond">
|
||||||
<div class="contener_general">
|
<div className="contener_general">
|
||||||
<div class="contener_mixte">
|
<div className="contener_mixte">
|
||||||
<div class="ballcolor ball_1"> </div>
|
<div className="ballcolor ball_1"> </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="contener_mixte">
|
<div className="contener_mixte">
|
||||||
<div class="ballcolor ball_2"> </div>
|
<div className="ballcolor ball_2"> </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="contener_mixte">
|
<div className="contener_mixte">
|
||||||
<div class="ballcolor ball_3"> </div>
|
<div className="ballcolor ball_3"> </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="contener_mixte">
|
<div className="contener_mixte">
|
||||||
<div class="ballcolor ball_4"> </div>
|
<div className="ballcolor ball_4"> </div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -7503,19 +7291,19 @@ const BSItemCard = (props) => {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{paymentloader === true && (
|
{paymentloader === true && (
|
||||||
<div class="Payment-loader1">
|
<div className="Payment-loader1">
|
||||||
<div class="Payment-loader">
|
<div className="Payment-loader">
|
||||||
<div class="contener_mixte">
|
<div className="contener_mixte">
|
||||||
<div class="ballcolor ball_1"> </div>
|
<div className="ballcolor ball_1"> </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="contener_mixte">
|
<div className="contener_mixte">
|
||||||
<div class="ballcolor ball_2"> </div>
|
<div className="ballcolor ball_2"> </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="contener_mixte">
|
<div className="contener_mixte">
|
||||||
<div class="ballcolor ball_3"> </div>
|
<div className="ballcolor ball_3"> </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="contener_mixte">
|
<div className="contener_mixte">
|
||||||
<div class="ballcolor ball_4"> </div>
|
<div className="ballcolor ball_4"> </div>
|
||||||
</div>
|
</div>
|
||||||
<p style={{ marginTop: '2rem' }}>
|
<p style={{ marginTop: '2rem' }}>
|
||||||
{' '}
|
{' '}
|
||||||
|
|
@ -7532,107 +7320,19 @@ const BSItemCard = (props) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{expModel && (
|
{expireModal?.open && (
|
||||||
<Modal
|
<ExpireConfirmModal
|
||||||
title={
|
open={expireModal?.open}
|
||||||
<div
|
title={expireModal?.title}
|
||||||
style={{ display: 'flex', gap: '1rem', flexDirection: 'row' }}
|
onOk={() => {
|
||||||
>
|
expireModal.onOk?.();
|
||||||
<div>
|
closeExpireModal();
|
||||||
<ExclamationCircleOutlined
|
|
||||||
style={{ color: 'rgb(231 176 12)', fontSize: '30px' }}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h4>Product Expires</h4>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
open={expModel}
|
|
||||||
onOk={() => expFun(Item)}
|
|
||||||
onCancel={() => setexpModel(false)}
|
|
||||||
okText="Submit"
|
|
||||||
cancelText="Don't Submit"
|
|
||||||
maskTransitionName="" // Remove animation for the mask
|
|
||||||
transitionName=""
|
|
||||||
></Modal>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{expQtyModel && (
|
|
||||||
<Modal
|
|
||||||
title={
|
|
||||||
<div
|
|
||||||
style={{ display: 'flex', gap: '1rem', flexDirection: 'row' }}
|
|
||||||
>
|
|
||||||
<ExclamationCircleOutlined
|
|
||||||
style={{ color: 'rgb(231 176 12)', fontSize: '30px' }}
|
|
||||||
/>
|
|
||||||
<h3>Quantity Expires</h3>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
open={expQtyModel}
|
|
||||||
onOk={() => expQtyFun(qtyExpData)}
|
|
||||||
onCancel={() => {
|
|
||||||
(setRepeatedModel(false),
|
|
||||||
setProdexpir(false),
|
|
||||||
setExpQtyModel(false));
|
|
||||||
}}
|
}}
|
||||||
okText="Submit"
|
|
||||||
cancelText="Don't Submit"
|
|
||||||
maskTransitionName=""
|
|
||||||
transitionName=""
|
|
||||||
></Modal>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{expVarModel && (
|
|
||||||
<Modal
|
|
||||||
title={
|
|
||||||
<div
|
|
||||||
style={{ display: 'flex', gap: '1rem', flexDirection: 'row' }}
|
|
||||||
>
|
|
||||||
<ExclamationCircleOutlined
|
|
||||||
style={{ color: 'rgb(231 176 12)', fontSize: '30px' }}
|
|
||||||
/>
|
|
||||||
<h3>Variant Expires</h3>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
open={expVarModel}
|
|
||||||
onOk={() => expVerFun(VarItem)}
|
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
(setexpVarModel(false),
|
expireModal.onCancel?.();
|
||||||
setRepeatedModel(false),
|
closeExpireModal();
|
||||||
setProdexpir(false));
|
|
||||||
}}
|
}}
|
||||||
okText="Submit"
|
|
||||||
cancelText="Don't Submit"
|
|
||||||
maskTransitionName=""
|
|
||||||
transitionName=""
|
|
||||||
></Modal>
|
|
||||||
)}
|
|
||||||
{expStockModel && (
|
|
||||||
<Modal
|
|
||||||
title={
|
|
||||||
<div
|
|
||||||
style={{ display: 'flex', gap: '1rem', flexDirection: 'row' }}
|
|
||||||
>
|
|
||||||
<ExclamationCircleOutlined
|
|
||||||
style={{ color: 'rgb(231 176 12)', fontSize: '30px' }}
|
|
||||||
/>
|
/>
|
||||||
<h3>Stock Expires</h3>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
open={expStockModel}
|
|
||||||
onOk={() => expStockFun(StockItem)}
|
|
||||||
onCancel={() => {
|
|
||||||
(setexpStockModel(false),
|
|
||||||
setRepeatedModel(false),
|
|
||||||
setProdexpir(false));
|
|
||||||
}}
|
|
||||||
okText="Submit"
|
|
||||||
cancelText="Don't Submit"
|
|
||||||
maskTransitionName=""
|
|
||||||
transitionName=""
|
|
||||||
></Modal>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{modelQty && (
|
{modelQty && (
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,15 @@
|
||||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
||||||
import moment from 'moment';
|
import { Badge, DatePicker, Modal, Tooltip, message } from 'antd';
|
||||||
import { App, Badge, DatePicker, Modal, Tooltip, Form, message } from 'antd';
|
|
||||||
import { GoTriangleRight } from 'react-icons/go';
|
|
||||||
import { ExclamationCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
import { ExclamationCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
||||||
import defaultimage from '../../../../Images/defaultItemImg.png';
|
import defaultimage from '../../../../Images/defaultItemImg.png';
|
||||||
import FormHeader from '../../../PageComponents/FormHeader';
|
import FormHeader from '../../../PageComponents/FormHeader';
|
||||||
import {
|
import {
|
||||||
GlobalPricingAppPricingName,
|
|
||||||
SelectedGlobalCardColorDetail,
|
SelectedGlobalCardColorDetail,
|
||||||
SelectedGlobalCardFont,
|
SelectedGlobalCardFont,
|
||||||
StoredSessionData,
|
StoredSessionData,
|
||||||
getTemplateData,
|
getTemplateData,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import { Tables } from '../../../../Components/Tables/Table';
|
|
||||||
import {
|
import {
|
||||||
GlobalProductSubCategorie,
|
GlobalProductSubCategorie,
|
||||||
GlobalItemCard,
|
GlobalItemCard,
|
||||||
|
|
@ -107,26 +103,13 @@ import { v4 as uuidv4 } from 'uuid';
|
||||||
// Dummy SortableCard component
|
// Dummy SortableCard component
|
||||||
import { useSortable } from '@dnd-kit/sortable';
|
import { useSortable } from '@dnd-kit/sortable';
|
||||||
import { CSS } from '@dnd-kit/utilities';
|
import { CSS } from '@dnd-kit/utilities';
|
||||||
import HuggingFaceVoiceForm from '../../../VoiceToText/VoiceToText.jsx';
|
|
||||||
import VoiceToTextItemCard from '../../../VoiceToText/VoiceToTextItemCard.jsx';
|
import VoiceToTextItemCard from '../../../VoiceToText/VoiceToTextItemCard.jsx';
|
||||||
import { ExtractDateFormate } from '../../../../Services/Others.js';
|
import { ExtractDateFormate } from '../../../../Services/Others.js';
|
||||||
import {
|
import {
|
||||||
changeFreeProductForLoyalty,
|
|
||||||
ChangeFreeProductList,
|
|
||||||
ChangeFullFreeProductList,
|
|
||||||
changeFullOfferAppliedProducts,
|
changeFullOfferAppliedProducts,
|
||||||
ChangeOfferAppliedProducts,
|
|
||||||
changeOfferAppliedProductsForLoyalty,
|
|
||||||
changeOfferAppliedProductsForMembership,
|
changeOfferAppliedProductsForMembership,
|
||||||
changeTriggerOfferFree,
|
GlobalOfferAppliedProducts
|
||||||
getOfferinBooking,
|
|
||||||
GlobalFreeProdList,
|
|
||||||
GlobalOfferAppliedProducts,
|
|
||||||
GlobalOverAllOfferAmt,
|
|
||||||
GlobalTriggerOfferFree,
|
|
||||||
RemoveOfferAppliedProduct,
|
|
||||||
} from '../../../../Features/Offer/Offernew/BookingOffernew.js';
|
} from '../../../../Features/Offer/Offernew/BookingOffernew.js';
|
||||||
import { validateOffers } from './ValidateOffer.jsx';
|
|
||||||
import { useSaleswiseOfferWatcher } from './SalesWiseOffer.jsx';
|
import { useSaleswiseOfferWatcher } from './SalesWiseOffer.jsx';
|
||||||
import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin.js';
|
import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin.js';
|
||||||
import { useDateStore } from '../../../../Features/BookingScreen/BookingData/DateStore.js';
|
import { useDateStore } from '../../../../Features/BookingScreen/BookingData/DateStore.js';
|
||||||
|
|
@ -137,10 +120,7 @@ import dayjs from 'dayjs';
|
||||||
import BSCustomerSelect from '../UtillComponents/BSSelectCustomer.jsx';
|
import BSCustomerSelect from '../UtillComponents/BSSelectCustomer.jsx';
|
||||||
import BSNavBarAddUser from '../UtillComponents/BSNavBarAddUser.jsx';
|
import BSNavBarAddUser from '../UtillComponents/BSNavBarAddUser.jsx';
|
||||||
import { FaAngleLeft, FaAngleRight } from 'react-icons/fa';
|
import { FaAngleLeft, FaAngleRight } from 'react-icons/fa';
|
||||||
|
|
||||||
import useRemoveFromCart from './RemoveFromCartFunction.jsx';
|
import useRemoveFromCart from './RemoveFromCartFunction.jsx';
|
||||||
|
|
||||||
import { IoIosAdd } from 'react-icons/io';
|
|
||||||
import { LuMinus } from 'react-icons/lu';
|
import { LuMinus } from 'react-icons/lu';
|
||||||
import BranchName from '../../Template/BranchName.jsx';
|
import BranchName from '../../Template/BranchName.jsx';
|
||||||
import { FiPlus } from 'react-icons/fi';
|
import { FiPlus } from 'react-icons/fi';
|
||||||
|
|
@ -179,7 +159,7 @@ export function SortableCard({ id, children, item }) {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const { RangePicker } = DatePicker;
|
|
||||||
const BsBookingitemCard = (props) => {
|
const BsBookingitemCard = (props) => {
|
||||||
const voiceTriggerRef = useRef(null);
|
const voiceTriggerRef = useRef(null);
|
||||||
const unsubscribeRef = useRef(null);
|
const unsubscribeRef = useRef(null);
|
||||||
|
|
@ -191,14 +171,10 @@ const BsBookingitemCard = (props) => {
|
||||||
const handleDecline = async (item) => {
|
const handleDecline = async (item) => {
|
||||||
await decline(item, setPreviousdataLength);
|
await decline(item, setPreviousdataLength);
|
||||||
};
|
};
|
||||||
const handleClearAll = async () => {
|
|
||||||
await clearAllItems();
|
|
||||||
};
|
|
||||||
|
|
||||||
const Clearall = async () => {
|
|
||||||
await handleClearAll();
|
|
||||||
};
|
|
||||||
const [form] = Form.useForm();
|
|
||||||
const cardFunction = props?.cardFunctionality;
|
const cardFunction = props?.cardFunctionality;
|
||||||
// const applyOffer = useApplyOfferto_CardDetail();
|
// const applyOffer = useApplyOfferto_CardDetail();
|
||||||
const preferenceDatas = useSelector(PreferenceData, shallowEqual);
|
const preferenceDatas = useSelector(PreferenceData, shallowEqual);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
import { Modal } from 'antd';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
|
const ExpireConfirmModal = ({
|
||||||
|
open,
|
||||||
|
title,
|
||||||
|
onOk,
|
||||||
|
onCancel,
|
||||||
|
okText = 'Submit',
|
||||||
|
cancelText = "Don't Submit",
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
open={open}
|
||||||
|
onOk={onOk}
|
||||||
|
onCancel={onCancel}
|
||||||
|
okText={okText}
|
||||||
|
cancelText={cancelText}
|
||||||
|
>
|
||||||
|
<div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
|
||||||
|
<ExclamationCircleOutlined
|
||||||
|
style={{ color: 'rgb(231 176 12)', fontSize: 30 }}
|
||||||
|
/>
|
||||||
|
<h3 style={{ margin: 0 }}>{title}</h3>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ExpireConfirmModal;
|
||||||
|
|
@ -1,30 +1,56 @@
|
||||||
import { Switch, Tooltip } from "antd"
|
import { Switch, Tooltip } from 'antd';
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from 'react-redux';
|
||||||
import { changeBillName, changeNotes, changeSelectedAmount, changeSelectedDiscount, changeSelectedHsnCode, changeSelectedItem, changeSelectedMRP, changeSelectedprintStyle, changeSelectedQrcode, changeSelectedQuantity, changeSelectedRate, changeSelectedSignature, changeSelectedSlNo, changeSelectedtermsAndConditions, changeSignatureImage, changethemeFormat, getPrintSelectionComponentData, putPrintSelectionComponentData, changeSelectedPrintdummyData } from "../../../../Features/ThemeChange/ThemeChange";
|
import {
|
||||||
import { useEffect, useState, useMemo, useCallback } from "react";
|
changeBillName,
|
||||||
import { InfoCircleOutlined, UploadOutlined, PlusOutlined, MinusCircleOutlined, ArrowRightOutlined, EditFilled, DeleteFilled } from '@ant-design/icons';
|
changeNotes,
|
||||||
import { getSession } from "../../../../Services/Others";
|
changeSelectedAmount,
|
||||||
import Buttons from "../../../../Components/Forms/Buttons";
|
changeSelectedDiscount,
|
||||||
import { Messages } from "../../../../Components/Notifications/Messages";
|
changeSelectedHsnCode,
|
||||||
|
changeSelectedItem,
|
||||||
|
changeSelectedMRP,
|
||||||
|
changeSelectedprintStyle,
|
||||||
|
changeSelectedQrcode,
|
||||||
|
changeSelectedQuantity,
|
||||||
|
changeSelectedRate,
|
||||||
|
changeSelectedSignature,
|
||||||
|
changeSelectedSlNo,
|
||||||
|
changeSelectedtermsAndConditions,
|
||||||
|
changeSignatureImage,
|
||||||
|
changethemeFormat,
|
||||||
|
getPrintSelectionComponentData,
|
||||||
|
putPrintSelectionComponentData,
|
||||||
|
changeSelectedPrintdummyData,
|
||||||
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
|
import { useEffect, useState, useMemo, useCallback } from 'react';
|
||||||
|
import {
|
||||||
|
InfoCircleOutlined,
|
||||||
|
UploadOutlined,
|
||||||
|
PlusOutlined,
|
||||||
|
MinusCircleOutlined,
|
||||||
|
ArrowRightOutlined,
|
||||||
|
EditFilled,
|
||||||
|
DeleteFilled,
|
||||||
|
} from '@ant-design/icons';
|
||||||
|
import { getSession } from '../../../../Services/Others';
|
||||||
|
import Buttons from '../../../../Components/Forms/Buttons';
|
||||||
|
import { Messages } from '../../../../Components/Notifications/Messages';
|
||||||
|
|
||||||
const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
const CompId = getSession("CompId")
|
const CompId = getSession('CompId');
|
||||||
const BranchId = getSession("BranchId")
|
const BranchId = getSession('BranchId');
|
||||||
const AppId = getSession("AppId")
|
const AppId = getSession('AppId');
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const [PrintType, setPrintType] = useState(false);
|
const [PrintType, setPrintType] = useState(false);
|
||||||
const [PageSize, setPageSize] = useState(false);
|
const [PageSize, setPageSize] = useState(false);
|
||||||
// const [PrintTemplates, setPrintTemplates] = useState([])
|
// const [PrintTemplates, setPrintTemplates] = useState([])
|
||||||
const [SizeOptionData, setSizeOptionData] = useState([])
|
const [SizeOptionData, setSizeOptionData] = useState([]);
|
||||||
const [selectedTemplate, setSelectedTemplate] = useState(null)
|
const [selectedTemplate, setSelectedTemplate] = useState(null);
|
||||||
const [messageType, setMessageType] = useState('')
|
const [messageType, setMessageType] = useState('');
|
||||||
const [messageData, setMessageData] = useState('')
|
const [messageData, setMessageData] = useState('');
|
||||||
console.log(selectedTemplate, 'selectedTemplate');
|
console.log(selectedTemplate, 'selectedTemplate');
|
||||||
|
|
||||||
|
|
||||||
// Memoized values for better performance
|
// Memoized values for better performance
|
||||||
const currentPrintType = useMemo(() => {
|
const currentPrintType = useMemo(() => {
|
||||||
if (selectedTemplate) {
|
if (selectedTemplate) {
|
||||||
|
|
@ -56,13 +82,15 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
printsyleget()
|
printsyleget();
|
||||||
}, [])
|
}, []);
|
||||||
|
|
||||||
// Auto-select default template when data loads
|
// Auto-select default template when data loads
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (SizeOptionData.length > 0) {
|
if (SizeOptionData.length > 0) {
|
||||||
const defaultTemplate = SizeOptionData.find(template => template.SetasDefault === "Y");
|
const defaultTemplate = SizeOptionData.find(
|
||||||
|
(template) => template.SetasDefault === 'Y'
|
||||||
|
);
|
||||||
if (defaultTemplate) {
|
if (defaultTemplate) {
|
||||||
handleTemplateSelect(defaultTemplate);
|
handleTemplateSelect(defaultTemplate);
|
||||||
}
|
}
|
||||||
|
|
@ -80,7 +108,7 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
const currentSettings = {
|
const currentSettings = {
|
||||||
PrintType: template.PrintType,
|
PrintType: template.PrintType,
|
||||||
PageSize: template.PageSize,
|
PageSize: template.PageSize,
|
||||||
selectedTemplate: template
|
selectedTemplate: template,
|
||||||
};
|
};
|
||||||
console.log('Template Selected - Settings:', currentSettings);
|
console.log('Template Selected - Settings:', currentSettings);
|
||||||
onSettingsChange(currentSettings);
|
onSettingsChange(currentSettings);
|
||||||
|
|
@ -95,7 +123,7 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
if (selectedTemplate) {
|
if (selectedTemplate) {
|
||||||
const updatedTemplate = {
|
const updatedTemplate = {
|
||||||
...selectedTemplate,
|
...selectedTemplate,
|
||||||
PrintType: e ? 'S' : 'C'
|
PrintType: e ? 'S' : 'C',
|
||||||
};
|
};
|
||||||
setSelectedTemplate(updatedTemplate);
|
setSelectedTemplate(updatedTemplate);
|
||||||
|
|
||||||
|
|
@ -104,7 +132,7 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
const currentSettings = {
|
const currentSettings = {
|
||||||
PrintType: updatedTemplate.PrintType,
|
PrintType: updatedTemplate.PrintType,
|
||||||
PageSize: updatedTemplate.PageSize,
|
PageSize: updatedTemplate.PageSize,
|
||||||
selectedTemplate: updatedTemplate
|
selectedTemplate: updatedTemplate,
|
||||||
};
|
};
|
||||||
onSettingsChange(currentSettings);
|
onSettingsChange(currentSettings);
|
||||||
}
|
}
|
||||||
|
|
@ -118,14 +146,14 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
if (selectedTemplate) {
|
if (selectedTemplate) {
|
||||||
const updatedTemplate = {
|
const updatedTemplate = {
|
||||||
...selectedTemplate,
|
...selectedTemplate,
|
||||||
PageSize: e ? 'A5' : 'A4'
|
PageSize: e ? 'A5' : 'A4',
|
||||||
};
|
};
|
||||||
setSelectedTemplate(updatedTemplate);
|
setSelectedTemplate(updatedTemplate);
|
||||||
if (onSettingsChange && typeof onSettingsChange === 'function') {
|
if (onSettingsChange && typeof onSettingsChange === 'function') {
|
||||||
const currentSettings = {
|
const currentSettings = {
|
||||||
PrintType: updatedTemplate.PrintType,
|
PrintType: updatedTemplate.PrintType,
|
||||||
PageSize: updatedTemplate.PageSize,
|
PageSize: updatedTemplate.PageSize,
|
||||||
selectedTemplate: updatedTemplate
|
selectedTemplate: updatedTemplate,
|
||||||
};
|
};
|
||||||
onSettingsChange(currentSettings);
|
onSettingsChange(currentSettings);
|
||||||
}
|
}
|
||||||
|
|
@ -135,13 +163,21 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
const stylePreview = async (template) => {
|
const stylePreview = async (template) => {
|
||||||
if (!template) return;
|
if (!template) return;
|
||||||
|
|
||||||
const { StyleId, StyleName, PrintType: printType, PageSize, Notes, PrintHdrName, Signature, TermsandConditions, OptionDetails } = template;
|
const {
|
||||||
|
StyleId,
|
||||||
|
StyleName,
|
||||||
|
PrintType: printType,
|
||||||
|
PageSize,
|
||||||
|
Notes,
|
||||||
|
PrintHdrName,
|
||||||
|
Signature,
|
||||||
|
TermsandConditions,
|
||||||
|
OptionDetails,
|
||||||
|
} = template;
|
||||||
|
|
||||||
const helperFunction = (param) => {
|
const helperFunction = (param) => {
|
||||||
return OptionDetails.some(
|
return OptionDetails.some((item) => item.ConfigName === param);
|
||||||
(item) => item.ConfigName === param
|
};
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
dispatch(changeSelectedSlNo(helperFunction('Sl.No')));
|
dispatch(changeSelectedSlNo(helperFunction('Sl.No')));
|
||||||
dispatch(changeSelectedItem(helperFunction('Item')));
|
dispatch(changeSelectedItem(helperFunction('Item')));
|
||||||
|
|
@ -153,20 +189,26 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
dispatch(changeSelectedHsnCode(helperFunction('HsnCode')));
|
dispatch(changeSelectedHsnCode(helperFunction('HsnCode')));
|
||||||
dispatch(changeSelectedQrcode(helperFunction('Qrcode')));
|
dispatch(changeSelectedQrcode(helperFunction('Qrcode')));
|
||||||
dispatch(changeSelectedSignature(helperFunction('signature')));
|
dispatch(changeSelectedSignature(helperFunction('signature')));
|
||||||
dispatch(changeSelectedtermsAndConditions(helperFunction('terms&conditions')));
|
dispatch(
|
||||||
|
changeSelectedtermsAndConditions(helperFunction('terms&conditions'))
|
||||||
|
);
|
||||||
dispatch(changeNotes(helperFunction('Notes')));
|
dispatch(changeNotes(helperFunction('Notes')));
|
||||||
dispatch(changeSignatureImage(Signature));
|
dispatch(changeSignatureImage(Signature));
|
||||||
dispatch(changeBillName(PrintHdrName));
|
dispatch(changeBillName(PrintHdrName));
|
||||||
dispatch(changeSelectedprintStyle({
|
dispatch(
|
||||||
|
changeSelectedprintStyle({
|
||||||
ConfigId: StyleId,
|
ConfigId: StyleId,
|
||||||
ConfigName: StyleName,
|
ConfigName: StyleName,
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const printsyleget = async () => {
|
const printsyleget = async () => {
|
||||||
try {
|
try {
|
||||||
const Data = { AppId, CompId, BranchId };
|
const Data = { AppId, CompId, BranchId };
|
||||||
let response = await dispatch(getPrintSelectionComponentData(Data)).unwrap();
|
let response = await dispatch(
|
||||||
|
getPrintSelectionComponentData(Data)
|
||||||
|
).unwrap();
|
||||||
|
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
// const salesTemplates = response.data.data?.flatMap(template =>
|
// const salesTemplates = response.data.data?.flatMap(template =>
|
||||||
|
|
@ -221,7 +263,7 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
const currentSettings = {
|
const currentSettings = {
|
||||||
PrintType: getPrintTypeValue(),
|
PrintType: getPrintTypeValue(),
|
||||||
PageSize: getPageSizeValue(),
|
PageSize: getPageSizeValue(),
|
||||||
selectedTemplate
|
selectedTemplate,
|
||||||
};
|
};
|
||||||
console.log('Current Print Settings:', currentSettings);
|
console.log('Current Print Settings:', currentSettings);
|
||||||
|
|
||||||
|
|
@ -233,11 +275,15 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
|
|
||||||
// Also pass data when component mounts and when selectedTemplate changes
|
// Also pass data when component mounts and when selectedTemplate changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectedTemplate && onSettingsChange && typeof onSettingsChange === 'function') {
|
if (
|
||||||
|
selectedTemplate &&
|
||||||
|
onSettingsChange &&
|
||||||
|
typeof onSettingsChange === 'function'
|
||||||
|
) {
|
||||||
const currentSettings = {
|
const currentSettings = {
|
||||||
PrintType: selectedTemplate.PrintType,
|
PrintType: selectedTemplate.PrintType,
|
||||||
PageSize: selectedTemplate.PageSize,
|
PageSize: selectedTemplate.PageSize,
|
||||||
selectedTemplate
|
selectedTemplate,
|
||||||
};
|
};
|
||||||
console.log('Template-based Print Settings:', currentSettings);
|
console.log('Template-based Print Settings:', currentSettings);
|
||||||
onSettingsChange(currentSettings);
|
onSettingsChange(currentSettings);
|
||||||
|
|
@ -258,19 +304,15 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const currentPrintType = getPrintTypeValue(); // 'S' or 'C'
|
const currentPrintType = getPrintTypeValue(); // 'S' or 'C'
|
||||||
const currentPageSize = getPageSizeValue(); // 'A4' or 'A5'
|
const currentPageSize = getPageSizeValue(); // 'A4' or 'A5'
|
||||||
|
|
||||||
// Only one "Sales" style should have SetasDefault: "Y"
|
// Only one "Sales" style should have SetasDefault: "Y"
|
||||||
const updatedTemplates = SizeOptionData.map((item) => {
|
const updatedTemplates = SizeOptionData.map((item) => {
|
||||||
if (
|
if (item.PrintType === 'Sales' || item.PrintType === 'S') {
|
||||||
(item.PrintType === "Sales" || item.PrintType === "S")
|
|
||||||
) {
|
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
SetasDefault:
|
SetasDefault: item.StyleId === selectedTemplate.StyleId ? 'Y' : 'N',
|
||||||
item.StyleId === selectedTemplate.StyleId ? "Y" : "N",
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
|
|
@ -342,7 +384,15 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
gap: '1rem',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Messages
|
<Messages
|
||||||
messageType={messageType}
|
messageType={messageType}
|
||||||
messageData={messageData}
|
messageData={messageData}
|
||||||
|
|
@ -353,7 +403,7 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display: 'flex', gap: '1rem' }}>
|
<div style={{ display: 'flex', gap: '1rem' }}>
|
||||||
<div>
|
<div>
|
||||||
{(
|
{
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
@ -394,7 +444,7 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -420,7 +470,9 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'flex-end', width: '100%' }}>
|
<div
|
||||||
|
style={{ display: 'flex', justifyContent: 'flex-end', width: '100%' }}
|
||||||
|
>
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText="Save"
|
buttonText="Save"
|
||||||
color="901D77"
|
color="901D77"
|
||||||
|
|
@ -430,7 +482,7 @@ const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
export default SalesPrintSize
|
export default SalesPrintSize;
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,21 @@
|
||||||
import { ArrowRightOutlined } from "@ant-design/icons";
|
import { ArrowRightOutlined } from '@ant-design/icons';
|
||||||
import Buttons from "../../../../Components/Forms/Buttons";
|
import Buttons from '../../../../Components/Forms/Buttons';
|
||||||
import { gettableData, postPreferenceAppNames } from "../../../../Features/PreferenceMaster/PreferenceMaster";
|
import {
|
||||||
import { getSession } from "../../../../Services/Others";
|
gettableData,
|
||||||
import { useDispatch } from "react-redux";
|
postPreferenceAppNames,
|
||||||
import { useEffect, useState } from "react";
|
} from '../../../../Features/PreferenceMaster/PreferenceMaster';
|
||||||
import { getPreferenceData } from "../../../../Features/BookingScreen/BookingData/BookingData";
|
import { getSession } from '../../../../Services/Others';
|
||||||
import { Messages } from "../../../../Components/Notifications/Messages";
|
import { useDispatch } from 'react-redux';
|
||||||
import { changeSelectedPrintdummyData } from "../../../../Features/ThemeChange/ThemeChange";
|
import { useEffect, useState } from 'react';
|
||||||
|
import { getPreferenceData } from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
|
import { Messages } from '../../../../Components/Notifications/Messages';
|
||||||
|
import { changeSelectedPrintdummyData } from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
|
|
||||||
const SelectPrintMode = ({ closeModel }) => {
|
const SelectPrintMode = ({ closeModel }) => {
|
||||||
const CompId = getSession("CompId");
|
const CompId = getSession('CompId');
|
||||||
const BranchId = getSession("BranchId");
|
const BranchId = getSession('BranchId');
|
||||||
const AppId = getSession("AppId");
|
const AppId = getSession('AppId');
|
||||||
const UserId = getSession("UserId");
|
const UserId = getSession('UserId');
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const [modes, setModes] = useState([]);
|
const [modes, setModes] = useState([]);
|
||||||
|
|
@ -20,20 +23,18 @@ const SelectPrintMode = ({ closeModel }) => {
|
||||||
whatsapp: false,
|
whatsapp: false,
|
||||||
sms: false,
|
sms: false,
|
||||||
print: false,
|
print: false,
|
||||||
email: false
|
email: false,
|
||||||
});
|
});
|
||||||
const [messageType, setMessageType] = useState("");
|
const [messageType, setMessageType] = useState('');
|
||||||
const [messageData, setMessageData] = useState("");
|
const [messageData, setMessageData] = useState('');
|
||||||
|
|
||||||
console.log(selected, 'selected');
|
console.log(selected, 'selected');
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchTableData();
|
fetchTableData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const fetchTableData = async () => {
|
const fetchTableData = async () => {
|
||||||
|
|
||||||
const response = await dispatch(
|
const response = await dispatch(
|
||||||
gettableData({ CompId, BranchId, AppId })
|
gettableData({ CompId, BranchId, AppId })
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
@ -47,40 +48,36 @@ const SelectPrintMode = ({ closeModel }) => {
|
||||||
setSelected({
|
setSelected({
|
||||||
whatsapp: !!data.find(
|
whatsapp: !!data.find(
|
||||||
(i) =>
|
(i) =>
|
||||||
i.SettingIdName?.trim()?.toLowerCase() === "whatsapp" &&
|
i.SettingIdName?.trim()?.toLowerCase() === 'whatsapp' &&
|
||||||
i.SettingValue === "Y"
|
i.SettingValue === 'Y'
|
||||||
),
|
),
|
||||||
sms: !!data.find(
|
sms: !!data.find(
|
||||||
(i) =>
|
(i) =>
|
||||||
i.SettingIdName?.trim()?.toLowerCase() === "sms" &&
|
i.SettingIdName?.trim()?.toLowerCase() === 'sms' &&
|
||||||
i.SettingValue === "Y"
|
i.SettingValue === 'Y'
|
||||||
),
|
),
|
||||||
print: !!data.find(
|
print: !!data.find(
|
||||||
(i) =>
|
(i) =>
|
||||||
i.SettingIdName?.trim()?.toLowerCase() === "print" &&
|
i.SettingIdName?.trim()?.toLowerCase() === 'print' &&
|
||||||
i.SettingValue === "Y"
|
i.SettingValue === 'Y'
|
||||||
),
|
),
|
||||||
email: !!data.find(
|
email: !!data.find(
|
||||||
(i) =>
|
(i) =>
|
||||||
i.SettingIdName?.trim()?.toLowerCase() === "email" &&
|
i.SettingIdName?.trim()?.toLowerCase() === 'email' &&
|
||||||
i.SettingValue === "Y"
|
i.SettingValue === 'Y'
|
||||||
)
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleChange = (key) => {
|
const handleChange = (key) => {
|
||||||
setSelected((prev) => ({
|
setSelected((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
[key]: !prev[key]
|
[key]: !prev[key],
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const handleSave = async () => {
|
const handleSave = async () => {
|
||||||
const allowed = ["whatsapp", "sms", "print", "email"];
|
const allowed = ['whatsapp', 'sms', 'print', 'email'];
|
||||||
|
|
||||||
const updatedSettings = modes.map((item) => {
|
const updatedSettings = modes.map((item) => {
|
||||||
const name = item.SettingIdName?.trim()?.toLowerCase();
|
const name = item.SettingIdName?.trim()?.toLowerCase();
|
||||||
|
|
@ -88,12 +85,11 @@ const SelectPrintMode = ({ closeModel }) => {
|
||||||
if (allowed?.includes(name)) {
|
if (allowed?.includes(name)) {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
SettingValue: selected[name] ? "Y" : "N"
|
SettingValue: selected[name] ? 'Y' : 'N',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
|
|
@ -101,40 +97,45 @@ const SelectPrintMode = ({ closeModel }) => {
|
||||||
BranchId,
|
BranchId,
|
||||||
CreatedBy: UserId,
|
CreatedBy: UserId,
|
||||||
AppId,
|
AppId,
|
||||||
SettingDtlDetails: updatedSettings
|
SettingDtlDetails: updatedSettings,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(payload, "payload to send");
|
console.log(payload, 'payload to send');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await dispatch(postPreferenceAppNames(payload)).unwrap();
|
const response = await dispatch(postPreferenceAppNames(payload)).unwrap();
|
||||||
|
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
setMessageType("success");
|
setMessageType('success');
|
||||||
setMessageData("Printer settings saved successfully.");
|
setMessageData('Printer settings saved successfully.');
|
||||||
dispatch(changeSelectedPrintdummyData(false));
|
dispatch(changeSelectedPrintdummyData(false));
|
||||||
await updatePreference();
|
await updatePreference();
|
||||||
closeModel()
|
closeModel();
|
||||||
} else {
|
} else {
|
||||||
setMessageType("error");
|
setMessageType('error');
|
||||||
setMessageData(response?.data?.message || "Failed to save printer settings.");
|
setMessageData(
|
||||||
|
response?.data?.message || 'Failed to save printer settings.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error while saving:", error);
|
console.error('Error while saving:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const updatePreference = async () => {
|
const updatePreference = async () => {
|
||||||
await dispatch(getPreferenceData({ CompId, BranchId, AppId }));
|
await dispatch(getPreferenceData({ CompId, BranchId, AppId }));
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
flexDirection: "column",
|
flexDirection: 'column',
|
||||||
alignItems: "center",
|
alignItems: 'center',
|
||||||
justifyContent: "center",
|
justifyContent: 'center',
|
||||||
|
backgroundColor:"#c4c4c4",
|
||||||
|
padding:"16px",
|
||||||
|
borderRadius:"8px"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Messages
|
<Messages
|
||||||
|
|
@ -145,17 +146,17 @@ const SelectPrintMode = ({ closeModel }) => {
|
||||||
setMessageType(null);
|
setMessageType(null);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<p style={{ fontSize: "18px", marginBottom: "10px" }}>
|
<p style={{ fontSize: '18px', marginBottom: '10px' }}>
|
||||||
Select Print Mode
|
Select Print Mode
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div style={{ display: "flex", gap: "1rem", padding: "10px" }}>
|
<div style={{ display: 'flex', gap: '1rem', padding: '10px' }}>
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
style={{ marginRight: "0.5rem" }}
|
style={{ marginRight: '0.5rem' }}
|
||||||
checked={selected.whatsapp}
|
checked={selected.whatsapp}
|
||||||
onChange={() => handleChange("whatsapp")}
|
onChange={() => handleChange('whatsapp')}
|
||||||
/>
|
/>
|
||||||
WhatsApp
|
WhatsApp
|
||||||
</label>
|
</label>
|
||||||
|
|
@ -163,9 +164,9 @@ const SelectPrintMode = ({ closeModel }) => {
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
style={{ marginRight: "0.5rem" }}
|
style={{ marginRight: '0.5rem' }}
|
||||||
checked={selected.sms}
|
checked={selected.sms}
|
||||||
onChange={() => handleChange("sms")}
|
onChange={() => handleChange('sms')}
|
||||||
/>
|
/>
|
||||||
SMS
|
SMS
|
||||||
</label>
|
</label>
|
||||||
|
|
@ -173,9 +174,9 @@ const SelectPrintMode = ({ closeModel }) => {
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
style={{ marginRight: "0.5rem" }}
|
style={{ marginRight: '0.5rem' }}
|
||||||
checked={selected.print}
|
checked={selected.print}
|
||||||
onChange={() => handleChange("print")}
|
onChange={() => handleChange('print')}
|
||||||
/>
|
/>
|
||||||
Print
|
Print
|
||||||
</label>
|
</label>
|
||||||
|
|
@ -183,20 +184,19 @@ const SelectPrintMode = ({ closeModel }) => {
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
style={{ marginRight: "0.5rem" }}
|
style={{ marginRight: '0.5rem' }}
|
||||||
checked={selected.email}
|
checked={selected.email}
|
||||||
onChange={() => handleChange("email")}
|
onChange={() => handleChange('email')}
|
||||||
/>
|
/>
|
||||||
Email
|
Email
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
width: "100%",
|
width: '100%',
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
justifyContent: "flex-end",
|
justifyContent: 'flex-end',
|
||||||
marginTop: 24,
|
marginTop: 24,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -282,6 +282,7 @@ const TaxInvoice = ({
|
||||||
paginatedChunks.push(chunk);
|
paginatedChunks.push(chunk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log(paginatedChunks, "paginatedChunks")
|
||||||
|
|
||||||
const lastChunkRows =
|
const lastChunkRows =
|
||||||
paginatedChunks.length > 0
|
paginatedChunks.length > 0
|
||||||
|
|
@ -878,7 +879,7 @@ const TaxInvoice = ({
|
||||||
>
|
>
|
||||||
{Number(
|
{Number(
|
||||||
table2Data?.OrderType !== 'E'
|
table2Data?.OrderType !== 'E'
|
||||||
? item.Rate - item.ProdTaxAmt
|
? item.Rate - (item?.SinglePc === 'Y' ? (item?.TaxAmt / item?.SalesQty) : item.ProdTaxAmt)
|
||||||
: item.Rate || 0
|
: item.Rate || 0
|
||||||
).toLocaleString('en-IN', {
|
).toLocaleString('en-IN', {
|
||||||
minimumFractionDigits: 2,
|
minimumFractionDigits: 2,
|
||||||
|
|
|
||||||
|
|
@ -1,120 +1,47 @@
|
||||||
import React from "react";
|
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import {
|
import {
|
||||||
dateFormatChange1,
|
dateFormatChange1
|
||||||
extractLastNumber,
|
|
||||||
extractLastNumberOrderId,
|
|
||||||
} from "../../../../Services/Others";
|
} from "../../../../Services/Others";
|
||||||
import {
|
import {
|
||||||
GlobalprintSlNo,
|
|
||||||
GlobalprintItem,
|
|
||||||
GlobalprintMRP,
|
|
||||||
GlobalprintDiscount,
|
|
||||||
GlobalprintQuantity,
|
|
||||||
GlobalprintRate,
|
|
||||||
GlobalprintAmount,
|
|
||||||
GlobalprintHsnCode,
|
|
||||||
GlobalprintQrcodet,
|
|
||||||
GlobalPritdummyData,
|
GlobalPritdummyData,
|
||||||
changeReprintDataFound,
|
changeReprintDataFound,
|
||||||
GloabalFieldDetails,
|
|
||||||
GlobalprintSignature,
|
|
||||||
GlobalprinttermsAndConditions,
|
|
||||||
GlobalSignatureImage,
|
|
||||||
Globalnotes,
|
|
||||||
GlobalthemeFormat,
|
|
||||||
GlobalBillName,
|
|
||||||
} from "../../../../Features/ThemeChange/ThemeChange";
|
} from "../../../../Features/ThemeChange/ThemeChange";
|
||||||
import "../../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle1.scss";
|
import "../../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle1.scss";
|
||||||
import QRCode from "react-qr-code";
|
import QRCode from "react-qr-code";
|
||||||
import { GlobalUpiIDprint } from "../../../../Features/BookingScreen/BookingData/BookingData";
|
|
||||||
import signature from "../../../../Images/signatureimage.jpg"
|
|
||||||
import { ApplicationPreferences } from "../../../../Features/BrachLogin/BranchLogin";
|
import { ApplicationPreferences } from "../../../../Features/BrachLogin/BranchLogin";
|
||||||
|
|
||||||
const OtherServicePrintStyle1 = ({
|
const OtherServicePrintStyle1 = ({
|
||||||
index,
|
|
||||||
totalQuantityFilter,
|
|
||||||
Date1,
|
|
||||||
CashierName,
|
|
||||||
totalQuantity,
|
|
||||||
OrderDetailGST,
|
|
||||||
OrderDetailIGST,
|
|
||||||
OrderDetailVAT,
|
|
||||||
table2Data,
|
table2Data,
|
||||||
UpiId,
|
|
||||||
PaymentStatus,
|
PaymentStatus,
|
||||||
PrintLogo,
|
|
||||||
PrintGreeting,
|
|
||||||
printDatas,
|
printDatas,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const GlobalUpiID = useSelector(GlobalUpiIDprint);
|
|
||||||
const FieldDetails = useSelector(GloabalFieldDetails);
|
|
||||||
const SLNO = FieldDetails?.["Sl.No"];
|
|
||||||
const Item = FieldDetails?.["Item"];
|
|
||||||
const MRP = FieldDetails?.["MRP"];
|
|
||||||
const Discount = FieldDetails?.["Discount"];
|
|
||||||
const Quantity = FieldDetails?.["Quantity"];
|
|
||||||
const Rate = FieldDetails?.["Rate"];
|
|
||||||
const Amount = FieldDetails?.["Amount"];
|
|
||||||
const HsnCode = FieldDetails?.["HsnCode"];
|
|
||||||
const Qrcodet = FieldDetails?.["Qrcode"];
|
|
||||||
const GlobalSlNo = useSelector(GlobalprintSlNo);
|
|
||||||
const GlobalItem = useSelector(GlobalprintItem);
|
|
||||||
const GlobalMRP = useSelector(GlobalprintMRP);
|
|
||||||
const GlobalDiscount = useSelector(GlobalprintDiscount);
|
|
||||||
const GlobalQuantity = useSelector(GlobalprintQuantity);
|
|
||||||
const GlobalRate = useSelector(GlobalprintRate);
|
|
||||||
const GlobalAmount = useSelector(GlobalprintAmount);
|
|
||||||
const GlobalHsnCode = useSelector(GlobalprintHsnCode);
|
|
||||||
const GlobalQrcodet = useSelector(GlobalprintQrcodet);
|
|
||||||
const GlobaldummyData = useSelector(GlobalPritdummyData);
|
const GlobaldummyData = useSelector(GlobalPritdummyData);
|
||||||
const GlobalSignature = useSelector(GlobalprintSignature);
|
|
||||||
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
|
|
||||||
const GlobalSignatureImages = useSelector(GlobalSignatureImage);
|
|
||||||
const GlobalIsnotes = useSelector(Globalnotes);
|
|
||||||
const GlobalthemeFormatr = useSelector(GlobalthemeFormat)
|
|
||||||
const GlobalBilltext = useSelector(GlobalBillName)
|
|
||||||
const appPreferences = useSelector(ApplicationPreferences);
|
const appPreferences = useSelector(ApplicationPreferences);
|
||||||
const bookingTypePreference = appPreferences?.find((preference) => preference?.PreferredCatName === 'Booking Type')?.PreferenceCatDetails
|
const bookingTypePreference = appPreferences?.find((preference) => preference?.PreferredCatName === 'Booking Type')?.PreferenceCatDetails
|
||||||
const dinePreference = bookingTypePreference?.find((type) => type?.PreferredSubCatName?.toLowerCase() === "dine in" && type?.PreferredStatus === 'Y')
|
|
||||||
const takeAwayPreference = bookingTypePreference?.find((type) => type?.PreferredSubCatName?.toLowerCase() === "take away" && type?.PreferredStatus === 'Y')
|
const takeAwayPreference = bookingTypePreference?.find((type) => type?.PreferredSubCatName?.toLowerCase() === "take away" && type?.PreferredStatus === 'Y')
|
||||||
const keysLength = Object.keys(table2Data ?? {}).length;
|
const keysLength = Object.keys(table2Data ?? {}).length;
|
||||||
let TermsAndConditions = printDatas?.TermsandConditions
|
|
||||||
let SignatureImg = printDatas?.Signature
|
|
||||||
let Notestext = printDatas?.Notes
|
|
||||||
let BillName = printDatas?.PrintHdrName
|
|
||||||
let FormatTheme = printDatas?.PrintType == "S" ? true : false
|
let FormatTheme = printDatas?.PrintType == "S" ? true : false
|
||||||
let PageSize = printDatas?.PageSize
|
let PageSize = printDatas?.PageSize
|
||||||
const Signature = FieldDetails?.["signature"];
|
|
||||||
const TermsnAdCondition = FieldDetails?.["terms&conditions"];
|
|
||||||
|
|
||||||
console.log("table2Datatable2Datatable2Datatable2Data", table2Data,table2Data?.[0]?.BranchName );
|
console.log("table2Datatable2Datatable2Datatable2Data", table2Data,table2Data?.[0]?.BranchName );
|
||||||
|
|
||||||
if (keysLength > 0) {
|
if (keysLength > 0) {
|
||||||
dispatch(changeReprintDataFound(true));
|
dispatch(changeReprintDataFound(true));
|
||||||
}
|
}
|
||||||
const currentDate = new Date();
|
|
||||||
const day = currentDate.getDate().toString().padStart(2, "0");
|
|
||||||
const monthNames = [
|
|
||||||
"Jan",
|
|
||||||
"Feb",
|
|
||||||
"Mar",
|
|
||||||
"Apr",
|
|
||||||
"May",
|
|
||||||
"Jun",
|
|
||||||
"Jul",
|
|
||||||
"Aug",
|
|
||||||
"Sep",
|
|
||||||
"Oct",
|
|
||||||
"Nov",
|
|
||||||
"Dec",
|
|
||||||
];
|
|
||||||
const monthIndex = currentDate.getMonth();
|
|
||||||
const year = currentDate.getFullYear().toString().slice(-2);
|
|
||||||
|
|
||||||
const formattedDate =dateFormatChange1(table2Data?.[0]?.CreatedDate);
|
const formattedDate =dateFormatChange1(table2Data?.[0]?.CreatedDate);
|
||||||
// `${day}-${monthNames[monthIndex]}-${year}`;
|
// `${day}-${monthNames[monthIndex]}-${year}`;
|
||||||
|
|
@ -125,37 +52,13 @@ console.log("table2Datatable2Datatable2Datatable2Data", table2Data,table2Data?.[
|
||||||
const DineInData = table2Data?.productDetails?.filter(
|
const DineInData = table2Data?.productDetails?.filter(
|
||||||
(item) => item.BookingTypeName?.toLowerCase() === "dine in"
|
(item) => item.BookingTypeName?.toLowerCase() === "dine in"
|
||||||
);
|
);
|
||||||
let PaymentStatusSuccess = PaymentStatus?.filter(
|
|
||||||
(ps) => ps.PaymentStatus === "S"
|
|
||||||
);
|
|
||||||
const TakeawayTotal = TakeawayData?.reduce(
|
|
||||||
(accumulator, currentValue) => accumulator + currentValue.TotalAmt,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
const DineInTotal = DineInData?.reduce(
|
|
||||||
(accumulator, currentValue) => accumulator + currentValue.TotalAmt,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
const aggregatedPayments = PaymentStatusSuccess?.reduce(
|
|
||||||
(acc, paymentdata) => {
|
|
||||||
const paymentType = paymentdata?.PaymentTypeName;
|
|
||||||
const amount = Number(paymentdata?.Amount);
|
|
||||||
|
|
||||||
if (acc[paymentType]) {
|
|
||||||
acc[paymentType] += amount;
|
|
||||||
} else {
|
|
||||||
acc[paymentType] = amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
return acc;
|
|
||||||
},
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
|
|
||||||
const productsData = table2Data?.productDetails || [];
|
|
||||||
const offers = table2Data?.OrderOfferDetails || [];
|
const offers = table2Data?.OrderOfferDetails || [];
|
||||||
|
|
||||||
let TotalOfferAmount = 0;
|
|
||||||
|
|
||||||
// Calculate SalesWiseOffers total amount
|
// Calculate SalesWiseOffers total amount
|
||||||
offers.forEach(offer => {
|
offers.forEach(offer => {
|
||||||
|
|
@ -163,19 +66,9 @@ console.log("table2Datatable2Datatable2Datatable2Data", table2Data,table2Data?.[
|
||||||
TotalOfferAmount += offer.OfferAmount;
|
TotalOfferAmount += offer.OfferAmount;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const hasMappedOffer = offers.some(offer =>
|
|
||||||
["ItemWiseOffers", "BundleOffers", "QuantityWiseOffers"].includes(offer.TableName)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (hasMappedOffer) {
|
|
||||||
|
|
||||||
const productTotal = productsData?.reduce((acc, item) => acc + (item?.Type != "C" ? item.OfferAmt : item.OfferValue || 0), 0);
|
|
||||||
TotalOfferAmount += productTotal;
|
|
||||||
} else {
|
|
||||||
const Combothere = productsData?.filter(item => item?.Type == "C")
|
|
||||||
const CombothereTotal = Combothere?.reduce((acc, item) => acc + (item.OfferValue || 0), 0);
|
|
||||||
TotalOfferAmount += CombothereTotal;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const products = [
|
const products = [
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ import {
|
||||||
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import signature from '../../../../Images/signatureimage.jpg';
|
import signature from '../../../../Images/signatureimage.jpg';
|
||||||
import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin';
|
import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin';
|
||||||
import { settingDataSelector } from '../../../../Features/PreferenceMaster/PreferenceMaster';
|
|
||||||
import Logo from '../../../../Images/Logo.jpg';
|
import Logo from '../../../../Images/Logo.jpg';
|
||||||
const PrintStyle1 = ({
|
const PrintStyle1 = ({
|
||||||
index,
|
index,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { Tooltip } from 'antd';
|
import { Tooltip } from 'antd';
|
||||||
import './GraphChart.scss'; // For styling
|
import './GraphChart.scss'; // For styling
|
||||||
import TooltipWrapper from '../../../Components/Tooltip/Tooltip';
|
import TooltipWrapper from '../../../Components/Tooltip/Tooltip';
|
||||||
|
|
@ -206,36 +206,7 @@ const GraphChart = ({ datasets }) => {
|
||||||
.join(' ');
|
.join(' ');
|
||||||
};
|
};
|
||||||
|
|
||||||
// const renderDots = (data, color) => {
|
|
||||||
// const maxValue = Math.max(...data.map(item => item.value));
|
|
||||||
// const svgHeight = 200;
|
|
||||||
// const svgWidth = 400;
|
|
||||||
// const gap = svgWidth / (data.length - 1);
|
|
||||||
|
|
||||||
// return data.map((point, index) => {
|
|
||||||
// const x = index * gap;
|
|
||||||
// const y = svgHeight - (point.value / maxValue) * svgHeight;
|
|
||||||
|
|
||||||
// return (
|
|
||||||
// <g key={index}>
|
|
||||||
// <circle
|
|
||||||
// cx={x}
|
|
||||||
// cy={animate ? y : svgHeight}
|
|
||||||
// r={5}
|
|
||||||
// fill={color}
|
|
||||||
// stroke={color}
|
|
||||||
// strokeWidth="2"
|
|
||||||
// style={{ transition: 'cy 0.5s ease-in-out' }}
|
|
||||||
// onMouseOver={(e) => handleMouseOver(e, point)}
|
|
||||||
// onMouseOut={handleMouseOut}
|
|
||||||
// />
|
|
||||||
// <text x={x} y={y - 10} fill="black" fontSize="12" textAnchor="middle">
|
|
||||||
// {formatValue(point.value)} ({item.date})
|
|
||||||
// </text>
|
|
||||||
// </g>
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// };
|
|
||||||
|
|
||||||
const renderDots = (data, color) => {
|
const renderDots = (data, color) => {
|
||||||
const reversedData = [...data].reverse();
|
const reversedData = [...data].reverse();
|
||||||
|
|
@ -507,7 +478,7 @@ const GraphChart = ({ datasets }) => {
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
<div className="labels">
|
<div className="labels">
|
||||||
{Array.from({ length: 7 }, (_, i) => {
|
{Array.from({ length: 8 }, (_, i) => {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
date.setDate(date.getDate() - i);
|
date.setDate(date.getDate() - i);
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
width: inherit;
|
width: inherit;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
.labelss {
|
.labelss {
|
||||||
font-size: 11px;
|
font-size: 10px;
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
color: #000000;
|
color: #000000;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
|
||||||
|
|
@ -1,93 +1,4 @@
|
||||||
// import React, { useEffect, useRef, useState } from 'react';
|
import { useMemo } from 'react';
|
||||||
// import Highcharts from 'highcharts';
|
|
||||||
// import HighchartsReact from 'highcharts-react-official';
|
|
||||||
// import "./PieChart.scss"
|
|
||||||
// const DynamicPieChart = ({ chartData }) => {
|
|
||||||
// const [overallValue, setOverallValue] = useState(0);
|
|
||||||
// const chartRef = useRef();
|
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// if (chartRef.current && chartData) {
|
|
||||||
// const chart = chartRef.current.chart;
|
|
||||||
// chart.series[0].setData(chartData);
|
|
||||||
// const sum = chartData.reduce((total, dataPoint) => total + dataPoint.y, 0);
|
|
||||||
// setOverallValue(sum);
|
|
||||||
|
|
||||||
// // Update the chart title to include the overall value
|
|
||||||
// chart.setTitle({ text: `Overall Amount: ${sum}` });
|
|
||||||
// }
|
|
||||||
// }, [chartData]);
|
|
||||||
|
|
||||||
// return (
|
|
||||||
// <div style={{width:"inherit"}}>
|
|
||||||
// <HighchartsReact
|
|
||||||
// highcharts={Highcharts}
|
|
||||||
// options={{
|
|
||||||
// chart: {
|
|
||||||
// type: 'pie'
|
|
||||||
// },
|
|
||||||
// title: {
|
|
||||||
// text: `Overall Amount: ${overallValue}` // Initial title with overall value
|
|
||||||
// },
|
|
||||||
// series: [{
|
|
||||||
// name: 'Amount',
|
|
||||||
// data: chartData
|
|
||||||
// }]
|
|
||||||
// }}
|
|
||||||
// ref={chartRef}
|
|
||||||
// />
|
|
||||||
// </div>
|
|
||||||
// );
|
|
||||||
// };
|
|
||||||
|
|
||||||
// export default DynamicPieChart;
|
|
||||||
|
|
||||||
// import React, { useEffect, useRef, useState } from 'react';
|
|
||||||
// import Highcharts from 'highcharts';
|
|
||||||
// import HighchartsReact from 'highcharts-react-official';
|
|
||||||
// import "./PieChart.scss"
|
|
||||||
// const DynamicPieChart = ({ chartData }) => {
|
|
||||||
// const [overallValue, setOverallValue] = useState(0);
|
|
||||||
// const chartRef = useRef();
|
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// if (chartRef.current && chartData) {
|
|
||||||
// const chart = chartRef.current.chart;
|
|
||||||
// chart.series[0].setData(chartData);
|
|
||||||
// const sum = chartData.reduce((total, dataPoint) => total + dataPoint.y, 0);
|
|
||||||
// setOverallValue(sum);
|
|
||||||
|
|
||||||
// // Update the chart title to include the overall value
|
|
||||||
// chart.setTitle({ text: `Overall Amount: ${sum}` });
|
|
||||||
// }
|
|
||||||
// }, [chartData]);
|
|
||||||
|
|
||||||
// return (
|
|
||||||
// <div style={{ width: "inherit" }}>
|
|
||||||
// <HighchartsReact
|
|
||||||
// highcharts={Highcharts}
|
|
||||||
// options={{
|
|
||||||
// chart: {
|
|
||||||
// type: 'pie'
|
|
||||||
// },
|
|
||||||
// title: {
|
|
||||||
// text: `Overall Amount: ${overallValue}`
|
|
||||||
// },
|
|
||||||
// series: [{
|
|
||||||
// name: 'Amount',
|
|
||||||
// data: chartData
|
|
||||||
// }]
|
|
||||||
// }}
|
|
||||||
// ref={chartRef}
|
|
||||||
// />
|
|
||||||
// </div>
|
|
||||||
// );
|
|
||||||
// };
|
|
||||||
|
|
||||||
// export default DynamicPieChart;
|
|
||||||
|
|
||||||
// create by sree
|
|
||||||
import React, { useMemo } from 'react';
|
|
||||||
import Highcharts from 'highcharts';
|
import Highcharts from 'highcharts';
|
||||||
import HighchartsReact from 'highcharts-react-official';
|
import HighchartsReact from 'highcharts-react-official';
|
||||||
import './PieChart.scss';
|
import './PieChart.scss';
|
||||||
|
|
@ -105,7 +16,11 @@ const DynamicPieChart = ({ chartData }) => {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!chartData?.length) {
|
if (!chartData?.length) {
|
||||||
return <div style={{textAlign:"center",display: 'flex',
|
return (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
textAlign: 'center',
|
||||||
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
height: '250px',
|
height: '250px',
|
||||||
|
|
@ -114,7 +29,12 @@ const DynamicPieChart = ({ chartData }) => {
|
||||||
fontSize: '16px',
|
fontSize: '16px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
border: '1px dashed #d9d9d9',
|
border: '1px dashed #d9d9d9',
|
||||||
borderRadius: '8px',}}>No Data Found</div>;
|
borderRadius: '8px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
No Data Found
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,26 @@
|
||||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState,lazy, Suspense } from 'react';
|
||||||
import '../../Styles/DashBoard/RetailDashBoard.scss';
|
|
||||||
import GraphChart from './Chart/GraphChart';
|
|
||||||
import { DatePicker, Space, Tooltip } from 'antd';
|
|
||||||
import dayjs from 'dayjs';
|
|
||||||
import { IoMdRefresh } from 'react-icons/io';
|
|
||||||
import { CiShop } from 'react-icons/ci';
|
|
||||||
import { FiMenu } from 'react-icons/fi';
|
|
||||||
import PozoMind from '../../Images/pozologowhite.svg';
|
|
||||||
import { useNavigate, useOutletContext } from 'react-router-dom';
|
import { useNavigate, useOutletContext } from 'react-router-dom';
|
||||||
import CalendarDropdown from '../../Components/CalendarDropdown';
|
import { shallowEqual, useDispatch } from 'react-redux';
|
||||||
import { MdKeyboardArrowDown } from 'react-icons/md';
|
import { useSelector } from 'react-redux';
|
||||||
import { IoMdNotificationsOutline } from 'react-icons/io';
|
|
||||||
import {
|
import { DatePicker, Tooltip } from 'antd';
|
||||||
getdashboard,
|
import dayjs from 'dayjs';
|
||||||
getdashboarddate,
|
|
||||||
getpreOrderDashBoard,
|
import '../../Styles/DashBoard/RetailDashBoard.scss';
|
||||||
getSalesHdr,
|
|
||||||
getTopSellingCustomers,
|
const GraphChart = lazy(() => import('./Chart/GraphChart'));
|
||||||
} from '../../Features/RetailDashboard/Dashboard.js';
|
const TopSellingProductsChart = lazy(
|
||||||
import { FaTimesCircle } from 'react-icons/fa';
|
() => import('./TopSellingProductsChart.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
import sandClock from '../../Images/sandClock.png';
|
import sandClock from '../../Images/sandClock.png';
|
||||||
|
import Add from '../../Images/dashboard/Add.png';
|
||||||
|
import AddPurchase from '../../Images/dashboard/AddPurchase.png';
|
||||||
|
import invoice from '../../Images/dashboard/invoice.png';
|
||||||
|
import user from '../../Images/dashboard/user.jpg';
|
||||||
|
import report from '../../Images/dashboard/report.png';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
FeatureAddon,
|
|
||||||
getTemplate,
|
|
||||||
GlobalPricingAppPricingName,
|
GlobalPricingAppPricingName,
|
||||||
StoredSessionData,
|
StoredSessionData,
|
||||||
} from '../../Features/ThemeChange/ThemeChange.js';
|
} from '../../Features/ThemeChange/ThemeChange.js';
|
||||||
|
|
@ -31,15 +29,20 @@ import {
|
||||||
getAppSubscriptionDate,
|
getAppSubscriptionDate,
|
||||||
getPreferenceData,
|
getPreferenceData,
|
||||||
} from '../../Features/BookingScreen/BookingData/BookingData.js';
|
} from '../../Features/BookingScreen/BookingData/BookingData.js';
|
||||||
|
import {
|
||||||
|
getdashboard,
|
||||||
|
getdashboarddate,
|
||||||
|
getpreOrderDashBoard,
|
||||||
|
getSalesHdr,
|
||||||
|
getTopSellingCustomers,
|
||||||
|
} from '../../Features/RetailDashboard/Dashboard.js';
|
||||||
import {
|
import {
|
||||||
clearSession,
|
clearSession,
|
||||||
dateFormatChange,
|
|
||||||
encryptedValuesUrlFun,
|
encryptedValuesUrlFun,
|
||||||
ExtractDateFormate,
|
ExtractDateFormate,
|
||||||
getSession,
|
getSession,
|
||||||
} from '../../Services/Others';
|
} from '../../Services/Others';
|
||||||
import { shallowEqual, useDispatch } from 'react-redux';
|
|
||||||
import { useSelector } from 'react-redux';
|
|
||||||
import {
|
import {
|
||||||
getAllprodIds,
|
getAllprodIds,
|
||||||
getExpireProductsList,
|
getExpireProductsList,
|
||||||
|
|
@ -58,28 +61,36 @@ import {
|
||||||
PUTLoginuser,
|
PUTLoginuser,
|
||||||
} from '../../Features/BrachLogin/BranchLogin.js';
|
} from '../../Features/BrachLogin/BranchLogin.js';
|
||||||
import { getPurchasedAppDetails } from '../../Features/BookingScreen/Pricing/Pricing.js';
|
import { getPurchasedAppDetails } from '../../Features/BookingScreen/Pricing/Pricing.js';
|
||||||
import Add from '../../Images/dashboard/Add.png';
|
|
||||||
import AddPurchase from '../../Images/dashboard/AddPurchase.png';
|
|
||||||
import invoice from '../../Images/dashboard/invoice.png';
|
|
||||||
import user from '../../Images/dashboard/user.jpg';
|
|
||||||
import report from '../../Images/dashboard/report.png';
|
|
||||||
import Calendar from '../../Components/Calendar/Calendar';
|
|
||||||
import { PiSignOut } from 'react-icons/pi';
|
|
||||||
import BSNavBarUserInfo from '../BookingScreen/Components/BSNavbar/BSNavBarUserInfo';
|
|
||||||
import { DefaultModal } from '../../Components/Modal/DefaultModal';
|
|
||||||
|
|
||||||
import { RadioGrpButton } from '../../Components/Forms/RadioGroup.jsx';
|
|
||||||
import { DropDowns } from '../../Components/Forms/DropDown.jsx';
|
const BSNavBarUserInfo = lazy(() =>
|
||||||
|
import('../BookingScreen/Components/BSNavbar/BSNavBarUserInfo')
|
||||||
|
);
|
||||||
|
const DefaultModal = lazy(() =>
|
||||||
|
import('../../Components/Modal/DefaultModal').then((m) => ({
|
||||||
|
default: m.DefaultModal,
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
|
||||||
|
const RadioGrpButton = lazy(() =>
|
||||||
|
import('../../Components/Forms/RadioGroup.jsx').then((m) => ({
|
||||||
|
default: m.RadioGrpButton,
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
|
||||||
|
const DropDowns = lazy(() =>
|
||||||
|
import('../../Components/Forms/DropDown.jsx').then((m) => ({
|
||||||
|
default: m.DropDowns,
|
||||||
|
}))
|
||||||
|
);
|
||||||
import {
|
import {
|
||||||
ChangeRedirectStatus,
|
ChangeRedirectStatus,
|
||||||
getEmpAccess,
|
getEmpAccess,
|
||||||
GlobalRedirectStatus,
|
GlobalRedirectStatus,
|
||||||
} from '../../Features/AppPage/CenterPage.js';
|
} from '../../Features/AppPage/CenterPage.js';
|
||||||
import { UserDataBasedOnBranchId } from '../../Features/Reports/Reports.js';
|
import { UserDataBasedOnBranchId } from '../../Features/Reports/Reports.js';
|
||||||
import { gettableData } from '../../Features/PreferenceMaster/PreferenceMaster.js';
|
|
||||||
import Loader from '../../Components/Loader/Loader.jsx';
|
import Loader from '../../Components/Loader/Loader.jsx';
|
||||||
import { getUserProfile } from '../../Features/UserAccount/userData.js';
|
import { getUserProfile } from '../../Features/UserAccount/userData.js';
|
||||||
import TopSellingProductsChart from './TopSellingProductsChart.jsx';
|
|
||||||
import { Messages } from '../../Components/Notifications/Messages.jsx';
|
import { Messages } from '../../Components/Notifications/Messages.jsx';
|
||||||
|
|
||||||
const commonUrl = import.meta.env.ENV_COMMON_BASE_URL;
|
const commonUrl = import.meta.env.ENV_COMMON_BASE_URL;
|
||||||
|
|
@ -97,7 +108,6 @@ const RetailDashboard = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const [selectedTab, setSelectedTab] = useState('dashboard');
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{ value: 'dashboard', label: 'Dashboard' },
|
{ value: 'dashboard', label: 'Dashboard' },
|
||||||
{ value: 'top-selling-products', label: 'Top Selling Products' },
|
{ value: 'top-selling-products', label: 'Top Selling Products' },
|
||||||
|
|
@ -116,16 +126,7 @@ const RetailDashboard = () => {
|
||||||
]);
|
]);
|
||||||
const [ismounted, setIsmounted] = useState(true);
|
const [ismounted, setIsmounted] = useState(true);
|
||||||
const [customerPendingBalance, setcustomerPendingBalance] = useState([]);
|
const [customerPendingBalance, setcustomerPendingBalance] = useState([]);
|
||||||
console.log(PricingAppPricingName, 'PricingAppPricingName');
|
|
||||||
// const {
|
|
||||||
// AppId: appId,
|
|
||||||
// CompId: compId,
|
|
||||||
// BranchId: branchId,
|
|
||||||
// } = SessionData || {};
|
|
||||||
// console.log(appId, compId, branchId, 'SessionData');
|
|
||||||
const [range1, setRange1] = useState('today');
|
|
||||||
const [range2, setRange2] = useState('today');
|
|
||||||
const [range3, setRange3] = useState('today');
|
|
||||||
const [userprofile, setUserprofile] = useState(false);
|
const [userprofile, setUserprofile] = useState(false);
|
||||||
|
|
||||||
const userProfileRef = useRef(null);
|
const userProfileRef = useRef(null);
|
||||||
|
|
@ -142,7 +143,6 @@ const RetailDashboard = () => {
|
||||||
const [totalPages, setTotalPages] = useState(0);
|
const [totalPages, setTotalPages] = useState(0);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [products, setProducts] = useState([]);
|
const [products, setProducts] = useState([]);
|
||||||
console.log(selection, 'selection');
|
|
||||||
const [CompBranchData, setCompBranchData] = useState();
|
const [CompBranchData, setCompBranchData] = useState();
|
||||||
const [EmpAcces, setEmpAccess] = useState();
|
const [EmpAcces, setEmpAccess] = useState();
|
||||||
const [seletedBranchData, setseletedBranchData] = useState(BranchId);
|
const [seletedBranchData, setseletedBranchData] = useState(BranchId);
|
||||||
|
|
@ -151,7 +151,6 @@ const RetailDashboard = () => {
|
||||||
BrLength == 1 ? null : 'all'
|
BrLength == 1 ? null : 'all'
|
||||||
);
|
);
|
||||||
const [ApiData, setApiData] = useState([]);
|
const [ApiData, setApiData] = useState([]);
|
||||||
console.log(CompBranchData, 'CompBranchData');
|
|
||||||
const [Zero, SetZero] = useState(false);
|
const [Zero, SetZero] = useState(false);
|
||||||
const [ResponseData, setResponseData] = useState();
|
const [ResponseData, setResponseData] = useState();
|
||||||
const [DateApiData, setDateApiData] = useState([]);
|
const [DateApiData, setDateApiData] = useState([]);
|
||||||
|
|
@ -216,18 +215,7 @@ const RetailDashboard = () => {
|
||||||
type?.PreferredStatus === 'Y'
|
type?.PreferredStatus === 'Y'
|
||||||
);
|
);
|
||||||
const timerDuration = 30;
|
const timerDuration = 30;
|
||||||
let EndDate = AppDetails?.[0]?.ValidityEnd;
|
|
||||||
|
|
||||||
const isoDate = EndDate; // <-- July 24
|
|
||||||
const date = new Date(isoDate);
|
|
||||||
|
|
||||||
const options = { year: 'numeric', month: 'long', day: 'numeric' };
|
|
||||||
const formatted = date.toLocaleDateString('en-US', options);
|
|
||||||
|
|
||||||
// "July 24, 2025"
|
|
||||||
|
|
||||||
console.log(expiredList, lowStockList, 'lowStockList');
|
|
||||||
console.log(TopSellingCus, preorderData, 'preorderData');
|
|
||||||
let DineInData =
|
let DineInData =
|
||||||
ApiData?.[0]?.ChartDtl?.map((item) => {
|
ApiData?.[0]?.ChartDtl?.map((item) => {
|
||||||
return {
|
return {
|
||||||
|
|
@ -441,10 +429,6 @@ const RetailDashboard = () => {
|
||||||
|
|
||||||
if (res?.data?.statusCode === 1 && res?.data?.data?.length > 0) {
|
if (res?.data?.statusCode === 1 && res?.data?.data?.length > 0) {
|
||||||
const remaining = res?.data?.data?.[0];
|
const remaining = res?.data?.data?.[0];
|
||||||
// let RemainingDays = expData?.RemainingDays;
|
|
||||||
// let RemainingHours=expData?.RemainingHours;
|
|
||||||
// let RemainingMinutes=expData?.RemainingMinutes;
|
|
||||||
// let RemainingSeconds=expData?.RemainingSeconds
|
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
|
||||||
|
|
@ -1075,39 +1059,6 @@ const RetailDashboard = () => {
|
||||||
getSalesHdrFn();
|
getSalesHdrFn();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Function to aggregate data from multiple branches
|
|
||||||
const aggregateBranchData = (branchDataArray) => {
|
|
||||||
const aggregated = {
|
|
||||||
DineInOrderCount: 0,
|
|
||||||
TakeAwayOrderCount: 0,
|
|
||||||
SelfTakeAwayOrderCount: 0,
|
|
||||||
OverAllSalesAmt: 0,
|
|
||||||
OverAllDineInAmount: 0,
|
|
||||||
OverAllTakeAwayAmount: 0,
|
|
||||||
ChartDtl: [],
|
|
||||||
};
|
|
||||||
|
|
||||||
branchDataArray.forEach((branchData) => {
|
|
||||||
if (branchData) {
|
|
||||||
aggregated.DineInOrderCount += branchData.DineInOrderCount || 0;
|
|
||||||
aggregated.TakeAwayOrderCount += branchData.TakeAwayOrderCount || 0;
|
|
||||||
aggregated.SelfTakeAwayOrderCount +=
|
|
||||||
branchData.SelfTakeAwayOrderCount || 0;
|
|
||||||
aggregated.OverAllSalesAmt += branchData.OverAllSalesAmt || 0;
|
|
||||||
aggregated.OverAllDineInAmount += branchData.OverAllDineInAmount || 0;
|
|
||||||
aggregated.OverAllTakeAwayAmount +=
|
|
||||||
branchData.OverAllTakeAwayAmount || 0;
|
|
||||||
|
|
||||||
// Merge chart data (you might want to customize this based on your needs)
|
|
||||||
if (branchData.ChartDtl && branchData.ChartDtl.length > 0) {
|
|
||||||
aggregated.ChartDtl = aggregated.ChartDtl.concat(branchData.ChartDtl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return aggregated;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Helper functions for fetching data from all branches
|
// Helper functions for fetching data from all branches
|
||||||
const getpreOrderDashBoardFnAllBranches = async (FromDate, ToDate) => {
|
const getpreOrderDashBoardFnAllBranches = async (FromDate, ToDate) => {
|
||||||
if (!CompBranchData || CompBranchData.length === 0) return;
|
if (!CompBranchData || CompBranchData.length === 0) return;
|
||||||
|
|
@ -1284,14 +1235,6 @@ const RetailDashboard = () => {
|
||||||
setApiData([]);
|
setApiData([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// const allBranchData = await Promise.all(allBranchPromises);
|
|
||||||
|
|
||||||
// // Aggregate the data from all branches
|
|
||||||
// const aggregatedData = aggregateBranchData(allBranchData);
|
|
||||||
// setDateApiData([aggregatedData]);
|
|
||||||
// setApiData([aggregatedData]);
|
|
||||||
// setPiedat([aggregatedData]);
|
|
||||||
|
|
||||||
// Also refresh other data for all branches with date range
|
// Also refresh other data for all branches with date range
|
||||||
getpreOrderDashBoardFnAllBranches(fromDate, toDate);
|
getpreOrderDashBoardFnAllBranches(fromDate, toDate);
|
||||||
getTopBuyingCustomersAllBranches(fromDate, toDate);
|
getTopBuyingCustomersAllBranches(fromDate, toDate);
|
||||||
|
|
@ -1477,6 +1420,7 @@ const RetailDashboard = () => {
|
||||||
?.toUpperCase()}
|
?.toUpperCase()}
|
||||||
</div>
|
</div>
|
||||||
{userprofile && (
|
{userprofile && (
|
||||||
|
<Suspense fallback={null}>
|
||||||
<BSNavBarUserInfo
|
<BSNavBarUserInfo
|
||||||
isOpen={userprofile}
|
isOpen={userprofile}
|
||||||
divRef={userProfileRef}
|
divRef={userProfileRef}
|
||||||
|
|
@ -1487,6 +1431,7 @@ const RetailDashboard = () => {
|
||||||
}}
|
}}
|
||||||
Logout={Logout}
|
Logout={Logout}
|
||||||
/>
|
/>
|
||||||
|
</Suspense>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1511,6 +1456,7 @@ const RetailDashboard = () => {
|
||||||
{/* Branch Filter Dropdown */}
|
{/* Branch Filter Dropdown */}
|
||||||
{CompBranchData?.length > 1 && selection !== 'top-selling-products' && (
|
{CompBranchData?.length > 1 && selection !== 'top-selling-products' && (
|
||||||
<div className="branch-filter-dropdown">
|
<div className="branch-filter-dropdown">
|
||||||
|
<Suspense fallback={<div>Loading...</div>}>
|
||||||
<DropDowns
|
<DropDowns
|
||||||
options={[
|
options={[
|
||||||
{ value: 'all', label: 'All Branches' },
|
{ value: 'all', label: 'All Branches' },
|
||||||
|
|
@ -1525,6 +1471,7 @@ const RetailDashboard = () => {
|
||||||
defaultValue="all"
|
defaultValue="all"
|
||||||
placeholder="All Branches"
|
placeholder="All Branches"
|
||||||
/>
|
/>
|
||||||
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -1537,14 +1484,6 @@ const RetailDashboard = () => {
|
||||||
className="datepickerDashboardrange"
|
className="datepickerDashboardrange"
|
||||||
inputReadOnly={true}
|
inputReadOnly={true}
|
||||||
/>
|
/>
|
||||||
{/* <div className="refershdashboard">
|
|
||||||
<div>
|
|
||||||
{' '}
|
|
||||||
<IoMdRefresh />
|
|
||||||
Refresh
|
|
||||||
</div>
|
|
||||||
<span>10sec auto refresh</span>
|
|
||||||
</div> */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{selection === 'dashboard' ? (
|
{selection === 'dashboard' ? (
|
||||||
|
|
@ -1553,7 +1492,9 @@ const RetailDashboard = () => {
|
||||||
<div className="TotalRevenue">
|
<div className="TotalRevenue">
|
||||||
<div className="tlxHeader"></div>
|
<div className="tlxHeader"></div>
|
||||||
<div className="TotalRevenue-Graph">
|
<div className="TotalRevenue-Graph">
|
||||||
|
<Suspense fallback={<Loader />}>
|
||||||
<GraphChart datasets={datasets} />
|
<GraphChart datasets={datasets} />
|
||||||
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -2418,28 +2359,6 @@ const RetailDashboard = () => {
|
||||||
No Low Stock Product
|
No Low Stock Product
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* <div className="stockAlertsRow">
|
|
||||||
<div className="stockAlertsCol slno">2</div>
|
|
||||||
<div className="stockAlertsCol product">
|
|
||||||
<div className="stockAlertsProductLink">
|
|
||||||
Cotton Blend Mandarin Collar Self One Design Kurta
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="stockAlertsCol count">4</div>
|
|
||||||
</div>
|
|
||||||
<div className="stockAlertsRow">
|
|
||||||
<div className="stockAlertsCol slno">3</div>
|
|
||||||
<div className="stockAlertsCol product">
|
|
||||||
<div className="stockAlertsProductLink">
|
|
||||||
Cotton Blend Mandarin Collar Self One Design Kurta
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="stockAlertsCol count">1</div>
|
|
||||||
</div> */}
|
|
||||||
{/* <div className="stockAlertsViewAll">
|
|
||||||
<a href="#">View All</a>
|
|
||||||
</div> */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -2448,6 +2367,7 @@ const RetailDashboard = () => {
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
<Suspense fallback={<Loader />}>
|
||||||
<TopSellingProductsChart
|
<TopSellingProductsChart
|
||||||
dates={dates}
|
dates={dates}
|
||||||
products={products}
|
products={products}
|
||||||
|
|
@ -2458,16 +2378,17 @@ const RetailDashboard = () => {
|
||||||
fetchProducts={fetchProducts}
|
fetchProducts={fetchProducts}
|
||||||
initialDate={initialDate}
|
initialDate={initialDate}
|
||||||
/>
|
/>
|
||||||
|
</Suspense>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
<Suspense fallback={null}>
|
||||||
<DefaultModal
|
<DefaultModal
|
||||||
open={modal}
|
open={modal}
|
||||||
title="Authentication"
|
title="Authentication"
|
||||||
width={500}
|
width={500}
|
||||||
footer={false}
|
footer={false}
|
||||||
handleCancel={handlePageChange}
|
handleCancel={handlePageChange}
|
||||||
children={
|
>
|
||||||
<>
|
<>
|
||||||
<div className="modalContentsadminuser">
|
<div className="modalContentsadminuser">
|
||||||
<DropDowns
|
<DropDowns
|
||||||
|
|
@ -2475,7 +2396,7 @@ const RetailDashboard = () => {
|
||||||
value: option?.UserId,
|
value: option?.UserId,
|
||||||
label: option?.UserName,
|
label: option?.UserName,
|
||||||
}))}
|
}))}
|
||||||
label={<label class="required">User Name</label>}
|
label={<label className="required">User Name</label>}
|
||||||
className="field-DropDown"
|
className="field-DropDown"
|
||||||
onChangeFunction={(e) => UserDropDownChange(e)}
|
onChangeFunction={(e) => UserDropDownChange(e)}
|
||||||
isOnchanges={selectedUserData ? true : false}
|
isOnchanges={selectedUserData ? true : false}
|
||||||
|
|
@ -2484,6 +2405,7 @@ const RetailDashboard = () => {
|
||||||
/>
|
/>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||||
<div className="RadioButton">
|
<div className="RadioButton">
|
||||||
|
<Suspense fallback={<div>Loading...</div>}>
|
||||||
<RadioGrpButton
|
<RadioGrpButton
|
||||||
content={[
|
content={[
|
||||||
{ value: 'O', label: 'OTP' },
|
{ value: 'O', label: 'OTP' },
|
||||||
|
|
@ -2493,6 +2415,7 @@ const RetailDashboard = () => {
|
||||||
defaultSelect={SelectType}
|
defaultSelect={SelectType}
|
||||||
onSelectFuntion={(e) => ChangeMethod(e)}
|
onSelectFuntion={(e) => ChangeMethod(e)}
|
||||||
/>
|
/>
|
||||||
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -2546,8 +2469,8 @@ const RetailDashboard = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
}
|
</DefaultModal>
|
||||||
/>
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,26 @@
|
||||||
import { useState, useEffect, useRef, useLayoutEffect, useMemo } from 'react';
|
import {
|
||||||
import { BarChart, Bar, PieChart, Pie, Cell, XAxis, YAxis, CartesianGrid, Legend, Tooltip, ResponsiveContainer } from 'recharts';
|
useState,
|
||||||
import { TrendingUp, Package, IndianRupee, ChevronLeft, ChevronRight } from 'lucide-react';
|
useEffect,
|
||||||
|
useRef,
|
||||||
|
useLayoutEffect,
|
||||||
|
useMemo,
|
||||||
|
lazy,
|
||||||
|
Suspense,
|
||||||
|
} from 'react';
|
||||||
|
import { PieChart, Pie, Cell, Tooltip, ResponsiveContainer } from 'recharts';
|
||||||
|
import { TrendingUp, Package, IndianRupee } from 'lucide-react';
|
||||||
import './TopSellingProductsChart.scss';
|
import './TopSellingProductsChart.scss';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch } from 'react-redux';
|
||||||
import { getTopSellingProduct } from '../../Features/ProductPage/ProductPage';
|
|
||||||
import { getSession } from '../../Services/Others';
|
import { getSession } from '../../Services/Others';
|
||||||
import { changeBreadCrumb } from '../../Features/AppPage/CenterPage';
|
import { changeBreadCrumb } from '../../Features/AppPage/CenterPage';
|
||||||
import { Switch, DatePicker } from 'antd';
|
|
||||||
import moment from 'moment';
|
|
||||||
import dayjs from 'dayjs';
|
|
||||||
import { DropDowns } from '../../Components/Forms/DropDown';
|
|
||||||
|
|
||||||
const { RangePicker } = DatePicker;
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
|
const DropDowns = lazy(() =>
|
||||||
|
import('../../Components/Forms/DropDown').then((module) => ({
|
||||||
|
default: module.DropDowns,
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
|
|
||||||
|
|
@ -22,8 +31,16 @@ const items = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const TopSellingProducts = ({ dates = [null, null], products = [], loading = false, totalPages, page = 1, setPage = () => { }, fetchProducts = () => { }, initialDate = true }) => {
|
const TopSellingProducts = ({
|
||||||
|
dates = [null, null],
|
||||||
|
products = [],
|
||||||
|
loading = false,
|
||||||
|
totalPages,
|
||||||
|
page = 1,
|
||||||
|
setPage = () => {},
|
||||||
|
fetchProducts = () => {},
|
||||||
|
initialDate = true,
|
||||||
|
}) => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const year = today.getFullYear();
|
const year = today.getFullYear();
|
||||||
const month = today.getMonth();
|
const month = today.getMonth();
|
||||||
|
|
@ -47,9 +64,8 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
const [windowWidth, setWindowWidth] = useState(window.innerWidth);
|
const [windowWidth, setWindowWidth] = useState(window.innerWidth);
|
||||||
const [hoveredItem, setHoveredItem] = useState(null);
|
const [hoveredItem, setHoveredItem] = useState(null);
|
||||||
const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 });
|
const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 });
|
||||||
const startIndex = (page - 1) * 10;
|
|
||||||
|
|
||||||
console.log(products?.[0]?.TotalCount, "products")
|
console.log(products?.[0]?.TotalCount, 'products');
|
||||||
|
|
||||||
const options = useMemo(() => {
|
const options = useMemo(() => {
|
||||||
const total = products?.[0]?.TotalCount || 0;
|
const total = products?.[0]?.TotalCount || 0;
|
||||||
|
|
@ -65,7 +81,7 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
|
|
||||||
arr.push({
|
arr.push({
|
||||||
label: `${start}-${end}`,
|
label: `${start}-${end}`,
|
||||||
value: page
|
value: page,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -80,7 +96,7 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
setContainerWidth(el.clientWidth || 800);
|
setContainerWidth(el.clientWidth || 800);
|
||||||
|
|
||||||
// ResizeObserver to update container width precisely
|
// ResizeObserver to update container width precisely
|
||||||
const ro = new ResizeObserver(entries => {
|
const ro = new ResizeObserver((entries) => {
|
||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
const w = Math.floor(entry.contentRect.width);
|
const w = Math.floor(entry.contentRect.width);
|
||||||
if (w && w !== containerWidth) setContainerWidth(w);
|
if (w && w !== containerWidth) setContainerWidth(w);
|
||||||
|
|
@ -97,17 +113,22 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
|
|
||||||
// compute sizes based on actual container width
|
// compute sizes based on actual container width
|
||||||
// make pie fill a good portion of container (leave some padding)
|
// make pie fill a good portion of container (leave some padding)
|
||||||
const pieOuterRadius = Math.max(48, Math.floor(containerWidth * (isNarrow ? 0.36 : 0.28)));
|
const pieOuterRadius = Math.max(
|
||||||
|
48,
|
||||||
|
Math.floor(containerWidth * (isNarrow ? 0.36 : 0.28))
|
||||||
|
);
|
||||||
const pieInnerRadius = Math.floor(pieOuterRadius * (isNarrow ? 0.5 : 0.55));
|
const pieInnerRadius = Math.floor(pieOuterRadius * (isNarrow ? 0.5 : 0.55));
|
||||||
|
|
||||||
// height for ResponsiveContainer: tether to containerWidth so chart stays proportional
|
// height for ResponsiveContainer: tether to containerWidth so chart stays proportional
|
||||||
const responsiveHeight = Math.max(220, Math.floor(containerWidth * (isNarrow ? 0.62 : 0.5)));
|
const responsiveHeight = Math.max(
|
||||||
|
220,
|
||||||
|
Math.floor(containerWidth * (isNarrow ? 0.62 : 0.5))
|
||||||
|
);
|
||||||
|
|
||||||
// tweak minAngle: small screens should allow smaller minAngle so slices remain visible
|
// tweak minAngle: small screens should allow smaller minAngle so slices remain visible
|
||||||
const minAngle = isNarrow ? 4 : 8;
|
const minAngle = isNarrow ? 4 : 8;
|
||||||
|
|
||||||
|
console.log(pieOuterRadius, 'pieOuterRadius');
|
||||||
console.log(pieOuterRadius, "pieOuterRadius")
|
|
||||||
|
|
||||||
// const COLORS = ['#2563eb', '#7c3aed', '#db2777', '#ea580c', '#16a34a', '#0891b2', '#d97706', '#65a30d', '#4f46e5', '#0d9488'];
|
// const COLORS = ['#2563eb', '#7c3aed', '#db2777', '#ea580c', '#16a34a', '#0891b2', '#d97706', '#65a30d', '#4f46e5', '#0d9488'];
|
||||||
const COLORS = [
|
const COLORS = [
|
||||||
|
|
@ -120,7 +141,7 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
'#e39a1a', // lighter amber (was #d97706)
|
'#e39a1a', // lighter amber (was #d97706)
|
||||||
'#8bc329', // lighter lime (was #65a30d)
|
'#8bc329', // lighter lime (was #65a30d)
|
||||||
'#6d63ef', // lighter indigo (was #4f46e5)
|
'#6d63ef', // lighter indigo (was #4f46e5)
|
||||||
'#35bfa9' // lighter teal (was #0d9488)
|
'#35bfa9', // lighter teal (was #0d9488)
|
||||||
];
|
];
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -131,22 +152,24 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handlePageChange = (data) => {
|
|
||||||
setPage(prev => prev + data)
|
|
||||||
}
|
|
||||||
|
|
||||||
const CustomTooltip = ({ active, payload }) => {
|
const CustomTooltip = ({ active, payload }) => {
|
||||||
if (active && payload && payload?.[0]) {
|
if (active && payload && payload?.[0]) {
|
||||||
const product = payload?.[0]?.payload;
|
const product = payload?.[0]?.payload;
|
||||||
return (
|
return (
|
||||||
<div className="custom-tooltip">
|
<div className="custom-tooltip">
|
||||||
<p className="tooltip-title">{product?.ProdName} - {product?.UOMName}</p>
|
<p className="tooltip-title">
|
||||||
{(product?.BrandName) ? <p className="tooltip-brand">Brand: {product?.BrandName}</p> : null}
|
{product?.ProdName} - {product?.UOMName}
|
||||||
|
</p>
|
||||||
|
{product?.BrandName ? (
|
||||||
|
<p className="tooltip-brand">Brand: {product?.BrandName}</p>
|
||||||
|
) : null}
|
||||||
<div className="tooltip-divider">
|
<div className="tooltip-divider">
|
||||||
<p className="tooltip-subtitle">Variants:</p>
|
<p className="tooltip-subtitle">Variants:</p>
|
||||||
{product?.variantDetails?.map((variant, idx) => (
|
{product?.variantDetails?.map((variant, idx) => (
|
||||||
<div key={idx} className="tooltip-variant">
|
<div key={idx} className="tooltip-variant">
|
||||||
<span className="variant-name">{variant?.ProdVariantName}:</span>
|
<span className="variant-name">
|
||||||
|
{variant?.ProdVariantName}:
|
||||||
|
</span>
|
||||||
<span className="variant-data">
|
<span className="variant-data">
|
||||||
{variant?.SalesCount} sold | ₹{variant?.Revenue}
|
{variant?.SalesCount} sold | ₹{variant?.Revenue}
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -170,7 +193,13 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderPercentInside = ({
|
const renderPercentInside = ({
|
||||||
cx, cy, midAngle, innerRadius, outerRadius, percent, value
|
cx,
|
||||||
|
cy,
|
||||||
|
midAngle,
|
||||||
|
innerRadius,
|
||||||
|
outerRadius,
|
||||||
|
percent,
|
||||||
|
value,
|
||||||
}) => {
|
}) => {
|
||||||
const percentValue = Math.round(percent * 100);
|
const percentValue = Math.round(percent * 100);
|
||||||
// hide labels for very small percentages on narrow screens
|
// hide labels for very small percentages on narrow screens
|
||||||
|
|
@ -178,7 +207,8 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
|
|
||||||
const RADIAN = Math.PI / 180;
|
const RADIAN = Math.PI / 180;
|
||||||
// place label inside slice (closer to inner radius on narrow screens)
|
// place label inside slice (closer to inner radius on narrow screens)
|
||||||
const radius = innerRadius + (outerRadius - innerRadius) * (isNarrow ? 0.55 : 0.6);
|
const radius =
|
||||||
|
innerRadius + (outerRadius - innerRadius) * (isNarrow ? 0.55 : 0.6);
|
||||||
|
|
||||||
const x = cx + radius * Math.cos(-midAngle * RADIAN);
|
const x = cx + radius * Math.cos(-midAngle * RADIAN);
|
||||||
const y = cy + radius * Math.sin(-midAngle * RADIAN);
|
const y = cy + radius * Math.sin(-midAngle * RADIAN);
|
||||||
|
|
@ -196,7 +226,7 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
textAnchor="middle"
|
textAnchor="middle"
|
||||||
dominantBaseline="central"
|
dominantBaseline="central"
|
||||||
pointerEvents="none"
|
pointerEvents="none"
|
||||||
style={{ textShadow: "0px 1px 2px rgba(0,0,0,0.35)" }}
|
style={{ textShadow: '0px 1px 2px rgba(0,0,0,0.35)' }}
|
||||||
>
|
>
|
||||||
{/* {`${percentValue}%`} */}
|
{/* {`${percentValue}%`} */}
|
||||||
{value}
|
{value}
|
||||||
|
|
@ -208,54 +238,34 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
|
|
||||||
const benchmarks = [
|
const benchmarks = [
|
||||||
// Fine granularity for small numbers, coarser for large numbers
|
// Fine granularity for small numbers, coarser for large numbers
|
||||||
1, 2, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50,
|
1, 2, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100, 125,
|
||||||
60, 70, 80, 90, 100, 125, 150, 175, 200, 225, 250, 275, 300,
|
150, 175, 200, 225, 250, 275, 300, 350, 400, 450, 500, 600, 700, 800, 900,
|
||||||
350, 400, 450, 500, 600, 700, 800, 900, 1000,
|
1000, 1250, 1500, 1750, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 6000,
|
||||||
1250, 1500, 1750, 2000, 2500, 3000, 3500, 4000, 4500, 5000,
|
7000, 8000, 9000, 10000, 12500, 15000, 17500, 20000, 25000, 30000, 35000,
|
||||||
6000, 7000, 8000, 9000, 10000, 12500, 15000, 17500, 20000, 25000,
|
40000, 45000, 50000, 60000, 70000, 80000, 90000, 100000, 125000, 150000,
|
||||||
30000, 35000, 40000, 45000, 50000, 60000, 70000, 80000, 90000, 100000,
|
175000, 200000, 250000, 300000, 350000, 400000, 450000, 500000, 600000,
|
||||||
125000, 150000, 175000, 200000, 250000, 300000, 350000, 400000, 450000, 500000,
|
700000, 800000, 900000, 1000000,
|
||||||
600000, 700000, 800000, 900000, 1000000
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const benchmark = benchmarks.find(b => b >= maxValue);
|
const benchmark = benchmarks.find((b) => b >= maxValue);
|
||||||
return benchmark || Math.ceil(maxValue / 10000) * 10000;
|
return benchmark || Math.ceil(maxValue / 10000) * 10000;
|
||||||
};
|
};
|
||||||
|
|
||||||
const chartData = products?.map(p => ({
|
const chartData = products?.map((p) => ({
|
||||||
...p,
|
...p,
|
||||||
name: p?.ProdName,
|
name: p?.ProdName,
|
||||||
value: metric === 'sales' ? p?.TotalSoldQty : p?.TotalRevenue,
|
value: metric === 'sales' ? p?.TotalSoldQty : p?.TotalRevenue,
|
||||||
benchMarkValue: metric === 'sales' ? p?.TotalRevenueCount : p?.TotalRevenueAmount
|
benchMarkValue:
|
||||||
|
metric === 'sales' ? p?.TotalRevenueCount : p?.TotalRevenueAmount,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const benchmarkValue = getBenchmarkValue(Math.max(...(chartData?.map(d => d?.benchMarkValue) || [0])));
|
const benchmarkValue = getBenchmarkValue(
|
||||||
|
Math.max(...(chartData?.map((d) => d?.benchMarkValue) || [0]))
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="top-selling-container">
|
<div className="top-selling-container">
|
||||||
<div className="content-wrapper">
|
<div className="content-wrapper">
|
||||||
{/* Header */}
|
|
||||||
{/* <div className="header-title-wrapper">
|
|
||||||
<div className="header-title">Top Selling Products</div>
|
|
||||||
<div className="header-date-picker">
|
|
||||||
<div className="date-picker-label">Date Range :</div>
|
|
||||||
<RangePicker
|
|
||||||
format="DD MMM YYYY"
|
|
||||||
placeholder={['Start Date', 'End Date']}
|
|
||||||
disabledDate={(current) => current && current > moment().endOf('day')}
|
|
||||||
onChange={async (dates) => {
|
|
||||||
setDates(dates);
|
|
||||||
const FromDate = dates?.[0]?.format('YYYY-MM-DD') || intialFromDate;
|
|
||||||
const ToDate = dates?.[1]?.format('YYYY-MM-DD') || intialToDate;
|
|
||||||
await fetchProducts({ AppId, CompId, BranchId, FromDate, ToDate, pageNumber: 1 });
|
|
||||||
setPage(1);
|
|
||||||
}}
|
|
||||||
value={dates}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div> */}
|
|
||||||
|
|
||||||
|
|
||||||
{/* Stats Cards */}
|
{/* Stats Cards */}
|
||||||
<div className="stats-grid">
|
<div className="stats-grid">
|
||||||
<div className="stat-card1">
|
<div className="stat-card1">
|
||||||
|
|
@ -272,7 +282,10 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
<div className="stat-text">
|
<div className="stat-text">
|
||||||
<p className="stat-label">Total Sales</p>
|
<p className="stat-label">Total Sales</p>
|
||||||
<p className="stat-value">
|
<p className="stat-value">
|
||||||
{products?.reduce((sum, p) => sum + (p?.TotalSoldQty || 0), 0)}
|
{products?.reduce(
|
||||||
|
(sum, p) => sum + (p?.TotalSoldQty || 0),
|
||||||
|
0
|
||||||
|
)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<TrendingUp className="stat-icon" />
|
<TrendingUp className="stat-icon" />
|
||||||
|
|
@ -283,7 +296,10 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
<div className="stat-text">
|
<div className="stat-text">
|
||||||
<p className="stat-label">Total Revenue</p>
|
<p className="stat-label">Total Revenue</p>
|
||||||
<p className="stat-value">
|
<p className="stat-value">
|
||||||
₹{products?.reduce((sum, p) => sum + (p?.TotalRevenue || 0), 0)?.toFixed(2)}
|
₹
|
||||||
|
{products
|
||||||
|
?.reduce((sum, p) => sum + (p?.TotalRevenue || 0), 0)
|
||||||
|
?.toFixed(2)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<IndianRupee className="stat-icon" />
|
<IndianRupee className="stat-icon" />
|
||||||
|
|
@ -311,14 +327,6 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="chart-type-controls">
|
<div className="chart-type-controls">
|
||||||
{/* <Switch
|
|
||||||
checked={chartType === 'bar' ? true : false}
|
|
||||||
onChange={(checked) => setChartType(checked ? 'bar' : 'pie')}
|
|
||||||
checkedChildren="Bar Chart"
|
|
||||||
unCheckedChildren="Pie Chart"
|
|
||||||
className="bar-pie-switch"
|
|
||||||
value={chartType === 'bar' ? true : false}
|
|
||||||
/> */}
|
|
||||||
<div
|
<div
|
||||||
onClick={() => setChartType('bar')}
|
onClick={() => setChartType('bar')}
|
||||||
className={`btn-chart-type ${chartType === 'bar' ? 'active' : ''}`}
|
className={`btn-chart-type ${chartType === 'bar' ? 'active' : ''}`}
|
||||||
|
|
@ -332,19 +340,8 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
Pie Chart
|
Pie Chart
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* {(dates?.[0] && dates?.[1]) && (
|
|
||||||
<div className='date-wrapper-class' style={{
|
|
||||||
display: "flex",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "flex-end",
|
|
||||||
gap: "1rem",
|
|
||||||
flexWrap: "wrap"
|
|
||||||
}}>
|
|
||||||
|
|
||||||
<div className='date-range'>{`${dates[0]?.format('DD/MMM/YYYY') || intialFromDate} - ${dates[1]?.format('DD/MMM/YYYY') || intialToDate}`}</div>
|
|
||||||
</div>
|
|
||||||
)} */}
|
|
||||||
|
|
||||||
|
<Suspense fallback={<div>Loading...</div>}>
|
||||||
<DropDowns
|
<DropDowns
|
||||||
className={'item-range-dropdown'}
|
className={'item-range-dropdown'}
|
||||||
valueData={page}
|
valueData={page}
|
||||||
|
|
@ -352,38 +349,46 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
label={'Products'}
|
label={'Products'}
|
||||||
onChangeFunction={async (value) => {
|
onChangeFunction={async (value) => {
|
||||||
setPage(value);
|
setPage(value);
|
||||||
const FromDate = dates?.[0]?.format('YYYY-MM-DD') || intialFromDate;
|
const FromDate =
|
||||||
const ToDate = dates?.[1]?.format('YYYY-MM-DD') || intialToDate;
|
dates?.[0]?.format('YYYY-MM-DD') || intialFromDate;
|
||||||
await fetchProducts({ AppId, CompId, BranchId, FromDate, ToDate, pageNumber: value });
|
const ToDate =
|
||||||
|
dates?.[1]?.format('YYYY-MM-DD') || intialToDate;
|
||||||
|
await fetchProducts({
|
||||||
|
AppId,
|
||||||
|
CompId,
|
||||||
|
BranchId,
|
||||||
|
FromDate,
|
||||||
|
ToDate,
|
||||||
|
pageNumber: value,
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
isOnchanges={page ? true : false}
|
isOnchanges={page ? true : false}
|
||||||
/>
|
/>
|
||||||
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{((initialDate ? true : (!dates && !dates?.[0] && !dates?.[1])) && intialFromDate && intialToDate) && <div className='date-range'>{`${dayjs(intialFromDate)?.format('DD/MMM/YYYY')} - ${dayjs(intialToDate)?.format('DD/MMM/YYYY')}`}</div>}
|
{(initialDate ? true : !dates && !dates?.[0] && !dates?.[1]) &&
|
||||||
|
intialFromDate &&
|
||||||
<div className='chart-dtls'>
|
intialToDate && (
|
||||||
|
<div className="date-range">{`${dayjs(intialFromDate)?.format('DD/MMM/YYYY')} - ${dayjs(intialToDate)?.format('DD/MMM/YYYY')}`}</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="chart-dtls">
|
||||||
{/* Chart */}
|
{/* Chart */}
|
||||||
<div className='chart-section'>
|
<div className="chart-section">
|
||||||
|
|
||||||
|
|
||||||
<div className="chart-card" ref={chartWrapperRef}>
|
<div className="chart-card" ref={chartWrapperRef}>
|
||||||
{loading && products?.length === 0 ? (
|
{loading && products?.length === 0 ? (
|
||||||
<div className="loading-container">
|
<div className="loading-container">
|
||||||
<div className="loading-spinner"></div>
|
<div className="loading-spinner"></div>
|
||||||
</div>
|
</div>
|
||||||
) : chartData?.length === 0 ? (
|
) : chartData?.length === 0 ? (
|
||||||
<div className="no-data">
|
<div className="no-data">No data available</div>
|
||||||
No data available
|
|
||||||
</div>
|
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
{chartType === 'bar' ? (
|
{chartType === 'bar' ? (
|
||||||
<div className='chart-data'>
|
<div className="chart-data">
|
||||||
<div className='chart-axis'>
|
<div className="chart-axis">
|
||||||
<div></div>
|
<div></div>
|
||||||
<div className="axis-points">
|
<div className="axis-points">
|
||||||
{[
|
{[
|
||||||
|
|
@ -391,7 +396,7 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
Math.round(benchmarkValue * 0.25),
|
Math.round(benchmarkValue * 0.25),
|
||||||
Math.round(benchmarkValue * 0.5),
|
Math.round(benchmarkValue * 0.5),
|
||||||
Math.round(benchmarkValue * 0.75),
|
Math.round(benchmarkValue * 0.75),
|
||||||
benchmarkValue
|
benchmarkValue,
|
||||||
].map((num, i) => (
|
].map((num, i) => (
|
||||||
<div key={i} className="axis-label-wrapper">
|
<div key={i} className="axis-label-wrapper">
|
||||||
<div className="axis-tick"></div>
|
<div className="axis-tick"></div>
|
||||||
|
|
@ -406,40 +411,52 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
{chartData?.map((item, index) => (
|
{chartData?.map((item, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
className='chart-data-item'
|
className="chart-data-item"
|
||||||
onMouseEnter={(e) => {
|
onMouseEnter={(e) => {
|
||||||
setHoveredItem(item);
|
setHoveredItem(item);
|
||||||
setMousePosition({ x: e.clientX, y: e.clientY });
|
setMousePosition({
|
||||||
|
x: e.clientX,
|
||||||
|
y: e.clientY,
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
// style={{}}
|
// style={{}}
|
||||||
onMouseLeave={() => setHoveredItem(null)}
|
onMouseLeave={() => setHoveredItem(null)}
|
||||||
onMouseMove={(e) => setMousePosition({ x: e.clientX, y: e.clientY })}
|
onMouseMove={(e) =>
|
||||||
|
setMousePosition({ x: e.clientX, y: e.clientY })
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<div className='chart-data-item-name'><span>{`#${(index + 1) + ((page - 1) * 10)}`}</span><span>{item?.name}</span></div>
|
<div className="chart-data-item-name">
|
||||||
<div className='barcharLine' style={{ borderRadius: "1px" }}>
|
<span>{`#${index + 1 + (page - 1) * 10}`}</span>
|
||||||
|
<span>{item?.name}</span>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
className='barcharLineInside'
|
className="barcharLine"
|
||||||
|
style={{ borderRadius: '1px' }}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="barcharLineInside"
|
||||||
style={{
|
style={{
|
||||||
width: `${Math.max(5, (item?.value / benchmarkValue) * 100)}%`,
|
width: `${Math.max(5, (item?.value / benchmarkValue) * 100)}%`,
|
||||||
backgroundColor: COLORS[index % COLORS.length]
|
backgroundColor:
|
||||||
|
COLORS[index % COLORS.length],
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span className='bar-percentage'>
|
<span className="bar-percentage">
|
||||||
{/* {((item?.value / Math.max(...chartData.map(d => d?.value))) * 100).toFixed(1)}% */}
|
{/* {((item?.value / Math.max(...chartData.map(d => d?.value))) * 100).toFixed(1)}% */}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='chart-data-item-value'>{item?.value}</div>
|
<div className="chart-data-item-value">
|
||||||
|
{item?.value}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
|
|
||||||
) : (
|
) : (
|
||||||
<div className='chart-data'>
|
<div className="chart-data">
|
||||||
<div className='chart-data-item'>
|
<div className="chart-data-item">
|
||||||
<div className='chart-data-item-name'>No Data</div>
|
<div className="chart-data-item-name">No Data</div>
|
||||||
<div className='chart-data-item-value'>0</div>
|
<div className="chart-data-item-value">0</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
@ -449,14 +466,19 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
/* PIE + RIGHT-LEGEND: replace the existing pie rendering */
|
/* PIE + RIGHT-LEGEND: replace the existing pie rendering */
|
||||||
<div className="pie-with-legend">
|
<div className="pie-with-legend">
|
||||||
<div className="pie-wrapper">
|
<div className="pie-wrapper">
|
||||||
<ResponsiveContainer width="100%" height={responsiveHeight}>
|
<ResponsiveContainer
|
||||||
|
width="100%"
|
||||||
|
height={responsiveHeight}
|
||||||
|
>
|
||||||
<PieChart>
|
<PieChart>
|
||||||
<Pie
|
<Pie
|
||||||
data={chartData}
|
data={chartData}
|
||||||
cx="50%"
|
cx="50%"
|
||||||
cy="50%"
|
cy="50%"
|
||||||
labelLine={false}
|
labelLine={false}
|
||||||
label={windowWidth <= 600 ? false : renderPercentInside}
|
label={
|
||||||
|
windowWidth <= 600 ? false : renderPercentInside
|
||||||
|
}
|
||||||
// outerRadius={pieOuterRadius}
|
// outerRadius={pieOuterRadius}
|
||||||
innerRadius={pieInnerRadius - 50}
|
innerRadius={pieInnerRadius - 50}
|
||||||
paddingAngle={1}
|
paddingAngle={1}
|
||||||
|
|
@ -464,7 +486,10 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
dataKey="value"
|
dataKey="value"
|
||||||
>
|
>
|
||||||
{chartData.map((entry, index) => (
|
{chartData.map((entry, index) => (
|
||||||
<Cell key={`cell-${index}`} fill={COLORS[index % COLORS.length]} />
|
<Cell
|
||||||
|
key={`cell-${index}`}
|
||||||
|
fill={COLORS[index % COLORS.length]}
|
||||||
|
/>
|
||||||
))}
|
))}
|
||||||
</Pie>
|
</Pie>
|
||||||
<Tooltip content={<CustomTooltip />} />
|
<Tooltip content={<CustomTooltip />} />
|
||||||
|
|
@ -474,19 +499,33 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
|
|
||||||
<div className="pie-legend">
|
<div className="pie-legend">
|
||||||
{(() => {
|
{(() => {
|
||||||
const total = chartData.reduce((s, d) => s + (Number(d?.value || 0)), 0) || 1;
|
const total =
|
||||||
|
chartData.reduce(
|
||||||
|
(s, d) => s + Number(d?.value || 0),
|
||||||
|
0
|
||||||
|
) || 1;
|
||||||
return chartData.map((d, i) => {
|
return chartData.map((d, i) => {
|
||||||
const color = COLORS[i % COLORS.length];
|
const color = COLORS[i % COLORS.length];
|
||||||
const value = Number(d?.value || 0);
|
const value = Number(d?.value || 0);
|
||||||
const percent = total ? ((value / total) * 100) : 0;
|
const percent = total ? (value / total) * 100 : 0;
|
||||||
return (
|
return (
|
||||||
<div className="legend-row" key={i}>
|
<div className="legend-row" key={i}>
|
||||||
<span className="legend-color" style={{ backgroundColor: color }} />
|
<span
|
||||||
|
className="legend-color"
|
||||||
|
style={{ backgroundColor: color }}
|
||||||
|
/>
|
||||||
<div className="legend-text">
|
<div className="legend-text">
|
||||||
<div className="legend-title">{d?.name}</div>
|
<div className="legend-title">{d?.name}</div>
|
||||||
<div className="legend-sub">
|
<div className="legend-sub">
|
||||||
<span className="legend-value">{value}</span>
|
<span className="legend-value">
|
||||||
<span className="legend-percent" style={{ color: color }} >{percent.toFixed(2)}%</span>
|
{value}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
className="legend-percent"
|
||||||
|
style={{ color: color }}
|
||||||
|
>
|
||||||
|
{percent.toFixed(2)}%
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -495,13 +534,10 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
})()}
|
})()}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -512,7 +548,7 @@ const TopSellingProducts = ({ dates = [null, null], products = [], loading = fal
|
||||||
left: mousePosition.x + 10,
|
left: mousePosition.x + 10,
|
||||||
top: mousePosition.y - 10,
|
top: mousePosition.y - 10,
|
||||||
zIndex: 1000,
|
zIndex: 1000,
|
||||||
pointerEvents: 'none'
|
pointerEvents: 'none',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CustomTooltip active={true} payload={[{ payload: hoveredItem }]} />
|
<CustomTooltip active={true} payload={[{ payload: hoveredItem }]} />
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,10 @@
|
||||||
.DeliveryChallan-inputForm .ant-table-content {
|
.DeliveryChallan-inputForm .ant-table-content {
|
||||||
width: 70vw;
|
width: 70vw;
|
||||||
}
|
}
|
||||||
|
.DeliveryChallan-inputForm .ant-table-thead tr {
|
||||||
|
background-color: #2c88ee !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.DeliveryChallan-inputForm {
|
.DeliveryChallan-inputForm {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -129,7 +133,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.Deliverychallan-table {
|
.Deliverychallan-table {
|
||||||
|
|
||||||
// width: 70px;
|
// width: 70px;
|
||||||
.ant-table table {
|
.ant-table table {
|
||||||
border-spacing: 0px;
|
border-spacing: 0px;
|
||||||
|
|
@ -139,3 +142,7 @@
|
||||||
width: 84% !important;
|
width: 84% !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.product-scan .sales-quotation{
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -62,6 +62,7 @@ import { getPrintSelectionComponentData } from '../../Features/ThemeChange/Theme
|
||||||
import { DCPDFMobilePrint } from './DCPDFMobilePrint.js';
|
import { DCPDFMobilePrint } from './DCPDFMobilePrint.js';
|
||||||
import { isMobile } from 'react-device-detect';
|
import { isMobile } from 'react-device-detect';
|
||||||
|
|
||||||
|
|
||||||
const DeliveryChellanForm = () => {
|
const DeliveryChellanForm = () => {
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
height: 35px;
|
height: 35px;
|
||||||
}
|
}
|
||||||
|
.ant-table-thead tr {
|
||||||
|
background-color: #2c88ee !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dc-to-invoice-payment-mode {
|
.dc-to-invoice-payment-mode {
|
||||||
|
|
@ -47,3 +50,15 @@
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.delivery-challan-to-invoice-form {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.DCformDivAnt {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 1rem;
|
||||||
|
justify-content: flex-start;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -342,7 +342,7 @@ const DeliveryChallanToInvoiceForm = () => {
|
||||||
<Form
|
<Form
|
||||||
ref={formRef}
|
ref={formRef}
|
||||||
initialValues={editstate}
|
initialValues={editstate}
|
||||||
className="formDivAnt"
|
className="DCformDivAnt"
|
||||||
onFinish={onFinish}
|
onFinish={onFinish}
|
||||||
>
|
>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
|
@ -409,7 +409,7 @@ const DeliveryChallanToInvoiceForm = () => {
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</>}
|
</>}
|
||||||
<div className="submitButton">
|
|
||||||
<Form.Item>
|
<Form.Item>
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText="SUBMIT"
|
buttonText="SUBMIT"
|
||||||
|
|
@ -442,7 +442,7 @@ const DeliveryChallanToInvoiceForm = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
|
||||||
|
|
||||||
</Form>
|
</Form>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useSelector, useDispatch } from 'react-redux';
|
import { useSelector, useDispatch } from 'react-redux';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { Skeleton } from 'antd';
|
import { Skeleton } from 'antd';
|
||||||
|
|
@ -64,119 +64,7 @@ const KioskBookingPage = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// const fetchData = async () => {
|
|
||||||
|
|
||||||
// const queryParams = await getQueryParams();
|
|
||||||
|
|
||||||
// console.log("queryParams", queryParams)
|
|
||||||
// if (Object.keys(queryParams)?.length !== 0) {
|
|
||||||
|
|
||||||
// console.log("queryParams", queryParams)
|
|
||||||
// if(!sessionStorage.getItem('auth')){
|
|
||||||
// let data = {
|
|
||||||
// username: "1000000001",
|
|
||||||
// password: "1234"
|
|
||||||
// }
|
|
||||||
// const response = await axios.post(`${apiUrlToken}/jwtTokenGenerator`, data, {
|
|
||||||
// headers: {
|
|
||||||
// 'Content-Type': 'application/json',
|
|
||||||
// 'Accept': 'application/json',
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
|
|
||||||
// const { token } = response?.data;
|
|
||||||
// sessionStorage.setItem('auth', token)
|
|
||||||
// sessionStore("LoginType","Kiosk")
|
|
||||||
// }
|
|
||||||
// const MACAddress = queryParams?.MD
|
|
||||||
// if (MACAddress) {
|
|
||||||
// console.log("MACAddress", MACAddress)
|
|
||||||
// setDeviceAddress(MACAddress)
|
|
||||||
// setDevicePresent(true)
|
|
||||||
// let deviceMACResponse = await dispatch(getDeviceAccess({ DeviceAddress: MACAddress })).unwrap();
|
|
||||||
// if (deviceMACResponse?.data?.statusCode == 1 && deviceMACResponse?.data?.data?.length > 0 && deviceMACResponse?.data?.data?.[0]?.KioskStatus === 'Y') {
|
|
||||||
// setDeviceAccess(true)
|
|
||||||
// let responseData = deviceMACResponse?.data?.data?.[0]
|
|
||||||
// responseData?.MobileNo != null && responseData?.MobileNo != undefined && sessionStore("MobileNo", responseData?.MobileNo);
|
|
||||||
// responseData?.UserId != null && responseData?.UserId != undefined && sessionStore("UserId", responseData?.UserId);
|
|
||||||
// responseData?.UserType != null && responseData?.UserType != undefined && sessionStore("UserType", responseData?.UserType);
|
|
||||||
// responseData?.CompId != null && responseData?.CompId != undefined && sessionStore("CompId", responseData?.CompId);
|
|
||||||
// responseData?.CompName != null && responseData?.CompName != undefined && sessionStore("CompName", responseData?.CompName);
|
|
||||||
// responseData?.AppId != null && responseData?.AppId != undefined && sessionStore("AppId", responseData?.AppId);
|
|
||||||
// responseData?.AppName != null && responseData?.AppName != undefined && sessionStore("AppName", responseData?.AppName);
|
|
||||||
// responseData?.BranchId != null && responseData?.BranchId != undefined && sessionStore("BranchId", responseData?.BranchId);
|
|
||||||
// responseData?.userName != null && responseData?.userName != undefined && sessionStore("userName", responseData?.UserName);
|
|
||||||
// responseData?.SessionId != null && responseData?.SessionId != undefined && sessionStore("SessionId", responseData?.SessionId);
|
|
||||||
// sessionStore("hasRefreshed", true);
|
|
||||||
// dispatch(getKioskTemplate({ CompId: responseData?.CompId, BranchId: responseData?.BranchId, AppId: responseData?.AppId })).unwrap();
|
|
||||||
// dispatch(getProductCategories({ CompId: responseData?.CompId, BranchId: responseData?.BranchId, AppId: responseData?.AppId })).unwrap();
|
|
||||||
// } else {
|
|
||||||
// setDeviceAccess(false)
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// const MobileNoValue = decryptedValuesFun(queryParams?.MN);
|
|
||||||
// const UserIdValue = decryptedValuesFun(queryParams?.UD);
|
|
||||||
// const UserTypeValue = decryptedValuesFun(queryParams?.UT);
|
|
||||||
// const CompIdValue = decryptedValuesFun(queryParams?.CD);
|
|
||||||
// const AppIdValue = decryptedValuesFun(queryParams?.AD);
|
|
||||||
// const BranchIdValue = decryptedValuesFun(queryParams?.BD);
|
|
||||||
// const OrderIdValue = decryptedValuesFun(queryParams?.OD);
|
|
||||||
// const AmountValue = decryptedValuesFun(queryParams?.AM);
|
|
||||||
// let CompNameValue = null, AppNameValue = null;
|
|
||||||
// if (CompIdValue) {
|
|
||||||
// let response = await dispatch(getCompanyData({ CompId: CompIdValue })).unwrap();
|
|
||||||
// if (response?.data?.statusCode == 1) {
|
|
||||||
// CompNameValue = response?.data?.data?.[0]?.["CompName"];
|
|
||||||
// } else {
|
|
||||||
// CompNameValue = null;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (AppIdValue) {
|
|
||||||
// let appResponse = await dispatch(getAllApplications({ AppId: AppIdValue })).unwrap();
|
|
||||||
// if (appResponse?.data?.statusCode == 1) {
|
|
||||||
// AppNameValue = appResponse?.data?.data?.[0]?.["AppName"];
|
|
||||||
// } else {
|
|
||||||
// AppNameValue = null;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// let userNameValue = null;
|
|
||||||
// if (queryParams?.UN != null && queryParams?.UN != undefined) {
|
|
||||||
// userNameValue = decryptedValuesFun(queryParams?.UN);
|
|
||||||
// }
|
|
||||||
// console.log("queryParams", MobileNoValue, UserIdValue, UserTypeValue, CompIdValue, AppIdValue, BranchIdValue)
|
|
||||||
// if (MobileNoValue && UserIdValue && UserTypeValue && CompIdValue && AppIdValue && BranchIdValue) {
|
|
||||||
// sessionStore("MobileNo", MobileNoValue);
|
|
||||||
// sessionStore("UserId", UserIdValue);
|
|
||||||
// sessionStore("UserType", UserTypeValue);
|
|
||||||
// sessionStore("CompId", CompIdValue);
|
|
||||||
// sessionStore("CompName", CompNameValue);
|
|
||||||
// sessionStore("AppId", AppIdValue);
|
|
||||||
// sessionStore("AppName", AppNameValue);
|
|
||||||
// sessionStore("BranchId", BranchIdValue);
|
|
||||||
// if (userNameValue != null) {
|
|
||||||
// sessionStore("userName", userNameValue);
|
|
||||||
// }
|
|
||||||
// dispatch(getKioskTemplate({ CompId: CompIdValue, BranchId: BranchIdValue, AppId: AppIdValue })).unwrap();
|
|
||||||
// dispatch(getProductCategories({ CompId: CompIdValue, BranchId: BranchIdValue, AppId: AppIdValue })).unwrap();
|
|
||||||
// dispatch(changeKioskPageName('OrderView'))
|
|
||||||
// dispatch(changePaymentgatewayRedirect(true))
|
|
||||||
// dispatch(changeKioskCustomerMobileNo(MobileNoValue))
|
|
||||||
// dispatch(changePGFailedTransId(OrderIdValue))
|
|
||||||
// dispatch(changePGFailedAmt(AmountValue))
|
|
||||||
// const url = new URL(window.location);
|
|
||||||
// url.search = '';
|
|
||||||
// window.history.replaceState({}, document.title, url.toString());
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// console.error("One or more decrypted values are null.");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// } else {
|
|
||||||
// dispatch(getKioskTemplate({ CompId: CompId, BranchId: BranchId, AppId: AppId })).unwrap();
|
|
||||||
// dispatch(getProductCategories({ CompId: CompId, BranchId: BranchId, AppId: AppId })).unwrap();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
fetchData();
|
fetchData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
.OfferList-Master {
|
.OfferList-Master {
|
||||||
padding: 20px;
|
padding: 0;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0 0 1rem 1rem;
|
margin: 0 0 0 0;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
|
|
@ -477,6 +477,12 @@
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #878787;
|
color: #878787;
|
||||||
}
|
}
|
||||||
|
.ant-input-affix-wrapper {
|
||||||
|
width: 250px !important;
|
||||||
|
}
|
||||||
|
.ant-input {
|
||||||
|
padding: 3px 14px 9px 11px !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Table Styles
|
// Table Styles
|
||||||
|
|
|
||||||
|
|
@ -1156,6 +1156,7 @@ const PaymentDetailsList = () => {
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
alignItems: 'flex-start',
|
alignItems: 'flex-start',
|
||||||
gap: '1rem',
|
gap: '1rem',
|
||||||
|
display: 'flex',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ const PreferenceList = () => {
|
||||||
|
|
||||||
const buildInitialValues = () => ({
|
const buildInitialValues = () => ({
|
||||||
dashboard: allSettingsMap['dashboard'] === 'Y',
|
dashboard: allSettingsMap['dashboard'] === 'Y',
|
||||||
shortcutkeys:allSettingsMap['shortcutkeys']==="Y",
|
shortcutkeys: allSettingsMap['shortcutkeys'] === 'Y',
|
||||||
autoreceivestock: allSettingsMap['autoreceivestock'] === 'Y',
|
autoreceivestock: allSettingsMap['autoreceivestock'] === 'Y',
|
||||||
decimal: allSettingsMap['decimal'] === 'Y',
|
decimal: allSettingsMap['decimal'] === 'Y',
|
||||||
enabledModules: [
|
enabledModules: [
|
||||||
|
|
@ -749,7 +749,6 @@ const PreferenceList = () => {
|
||||||
'estimateprintheader',
|
'estimateprintheader',
|
||||||
'Do you want to include a header when printing Estimate bills?'
|
'Do you want to include a header when printing Estimate bills?'
|
||||||
)}
|
)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div className="PreferencesBTN">
|
<div className="PreferencesBTN">
|
||||||
<Buttons
|
<Buttons
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,14 @@
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: #c0cbf8;
|
background-color: #c0cbf8;
|
||||||
}
|
}
|
||||||
|
@media (max-width: 500px) {
|
||||||
|
border: none !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
font-style: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (max-width: 500px) {
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -537,9 +537,12 @@ const ProductForm = ({ formType }) => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
AppId !== undefined && AppId !== null &&
|
AppId !== undefined &&
|
||||||
CompId !== undefined && CompId !== null &&
|
AppId !== null &&
|
||||||
BranchId !== undefined && BranchId !== null
|
CompId !== undefined &&
|
||||||
|
CompId !== null &&
|
||||||
|
BranchId !== undefined &&
|
||||||
|
BranchId !== null
|
||||||
) {
|
) {
|
||||||
productFetchData();
|
productFetchData();
|
||||||
fetchRackData();
|
fetchRackData();
|
||||||
|
|
@ -2136,6 +2139,7 @@ const ProductForm = ({ formType }) => {
|
||||||
initialValues={
|
initialValues={
|
||||||
editstate || { LowStockCount: 0, ExpiryNotificationDays: 0 }
|
editstate || { LowStockCount: 0, ExpiryNotificationDays: 0 }
|
||||||
}
|
}
|
||||||
|
style={{ marginTop: '0' }}
|
||||||
>
|
>
|
||||||
<div className="formDivS">
|
<div className="formDivS">
|
||||||
<div className="productinputForm">
|
<div className="productinputForm">
|
||||||
|
|
@ -2174,26 +2178,12 @@ const ProductForm = ({ formType }) => {
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
</div>
|
||||||
{/* </Form> */}
|
|
||||||
|
|
||||||
{/* </div> */}
|
|
||||||
{/* <div className="formDiv">
|
|
||||||
|
|
||||||
<Form
|
|
||||||
ref={formRef}
|
|
||||||
className="formDivAnt"
|
|
||||||
onFinish={onFinish}
|
|
||||||
initialValues={
|
|
||||||
editstate || { LowStockCount: 0, ExpiryNotificationDays: 0 }
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div className="formDivS">
|
|
||||||
<div className="productinputForm"> */}
|
|
||||||
|
|
||||||
{/* dhana */}
|
{/* dhana */}
|
||||||
<div style={{ display: 'flex' }}>
|
<div className="ProductMainRowFlex">
|
||||||
{/* <div> */}
|
{/* <div> */}
|
||||||
<div className="subRowFlex">
|
<div className="ProSubRowFlex">
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="ProdName"
|
name="ProdName"
|
||||||
rules={[
|
rules={[
|
||||||
|
|
@ -2629,7 +2619,8 @@ const ProductForm = ({ formType }) => {
|
||||||
<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)}
|
||||||
|
|
@ -2977,7 +2968,7 @@ const ProductForm = ({ formType }) => {
|
||||||
<Collapse defaultActiveKey={expandCollapseActive}>
|
<Collapse defaultActiveKey={expandCollapseActive}>
|
||||||
<Panel header="Price" key="1">
|
<Panel header="Price" key="1">
|
||||||
<div className="subColumnFlex">
|
<div className="subColumnFlex">
|
||||||
<div className="subRowFlex">
|
<div className="ProSubRowFlex">
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="ProdType"
|
name="ProdType"
|
||||||
rules={[
|
rules={[
|
||||||
|
|
@ -3767,7 +3758,7 @@ const ProductForm = ({ formType }) => {
|
||||||
{openVariant && (
|
{openVariant && (
|
||||||
<Form ref={formVariantRef}>
|
<Form ref={formVariantRef}>
|
||||||
<div className="subColumnFlex">
|
<div className="subColumnFlex">
|
||||||
<div className="subRowFlex">
|
<div className="ProSubRowFlex">
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="ProdVariantName"
|
name="ProdVariantName"
|
||||||
rules={[
|
rules={[
|
||||||
|
|
@ -4053,7 +4044,7 @@ const ProductForm = ({ formType }) => {
|
||||||
buttonText="Submit"
|
buttonText="Submit"
|
||||||
children={
|
children={
|
||||||
<Form ref={formCategoryRef} className="formDivAnt">
|
<Form ref={formCategoryRef} className="formDivAnt">
|
||||||
<div className="subRowFlex">
|
<div className="ProSubRowFlex">
|
||||||
<div className="subColumnFlex">
|
<div className="subColumnFlex">
|
||||||
<div>
|
<div>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
|
@ -4116,7 +4107,7 @@ const ProductForm = ({ formType }) => {
|
||||||
handleCancel={handleSubCategory}
|
handleCancel={handleSubCategory}
|
||||||
children={
|
children={
|
||||||
<Form ref={formSubCategoryRef} className="formDivAnt">
|
<Form ref={formSubCategoryRef} className="formDivAnt">
|
||||||
<div className="subRowFlex">
|
<div className="ProSubRowFlex">
|
||||||
<div className="subColumnFlex">
|
<div className="subColumnFlex">
|
||||||
<div className="subProdCatData">
|
<div className="subProdCatData">
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
|
@ -4235,7 +4226,7 @@ const ProductForm = ({ formType }) => {
|
||||||
handleCancel={handleBrand}
|
handleCancel={handleBrand}
|
||||||
children={
|
children={
|
||||||
<Form ref={formBrandRef} className="formDivAnt">
|
<Form ref={formBrandRef} className="formDivAnt">
|
||||||
<div className="subRowFlex">
|
<div className="ProSubRowFlex">
|
||||||
<div className="subColumnFlex">
|
<div className="subColumnFlex">
|
||||||
<div className="subProdCatData">
|
<div className="subProdCatData">
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
|
@ -4315,7 +4306,7 @@ const ProductForm = ({ formType }) => {
|
||||||
buttonText="Submit"
|
buttonText="Submit"
|
||||||
children={
|
children={
|
||||||
<Form ref={formTaxRef} className="formDivAnt">
|
<Form ref={formTaxRef} className="formDivAnt">
|
||||||
<div className="subRowFlex">
|
<div className="ProSubRowFlex">
|
||||||
<Form.Item name="TaxName">
|
<Form.Item name="TaxName">
|
||||||
<DropDowns
|
<DropDowns
|
||||||
options={ProdTaxData?.map((option) => ({
|
options={ProdTaxData?.map((option) => ({
|
||||||
|
|
@ -4419,7 +4410,7 @@ const ProductForm = ({ formType }) => {
|
||||||
onOk={handleExistsData}
|
onOk={handleExistsData}
|
||||||
onCancel={handleExistsDataCancel}
|
onCancel={handleExistsDataCancel}
|
||||||
>
|
>
|
||||||
<div className="subRowFlex">
|
<div className="ProSubRowFlex">
|
||||||
<div className="qrExistsData">
|
<div className="qrExistsData">
|
||||||
<img
|
<img
|
||||||
src={QrcodeExistsData?.[0]?.ProdLogo}
|
src={QrcodeExistsData?.[0]?.ProdLogo}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import {
|
||||||
EditFilled,
|
EditFilled,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { Messages } from '../../Components/Notifications/Messages';
|
import { Messages } from '../../Components/Notifications/Messages';
|
||||||
import { Form, Tooltip, Space, Input, Button, AutoComplete } from 'antd';
|
import { Form, Tooltip, Space, Input, Button, AutoComplete, Checkbox } from 'antd';
|
||||||
import { IoWarningOutline } from 'react-icons/io5';
|
import { IoWarningOutline } from 'react-icons/io5';
|
||||||
import {
|
import {
|
||||||
getSession,
|
getSession,
|
||||||
|
|
@ -134,6 +134,7 @@ const PurchaseOrder = () => {
|
||||||
const [itemsPerPage] = useState(20);
|
const [itemsPerPage] = useState(20);
|
||||||
const [searchTerm, setSearchTerm] = useState('');
|
const [searchTerm, setSearchTerm] = useState('');
|
||||||
const [minQty, setMinQty] = useState('');
|
const [minQty, setMinQty] = useState('');
|
||||||
|
const [showAllSuppliers, setShowAllSuppliers] = useState(false);
|
||||||
|
|
||||||
// const filteredData = currentData.filter((item) => {
|
// const filteredData = currentData.filter((item) => {
|
||||||
// const matchesSearch =
|
// const matchesSearch =
|
||||||
|
|
@ -153,7 +154,7 @@ const PurchaseOrder = () => {
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'Purchase Order',
|
name: 'Purchase Order',
|
||||||
link: `${subDirectory}setting/purchase-order/new`,
|
link: `${subDirectory}setting/purchase-order`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'New',
|
name: 'New',
|
||||||
|
|
@ -301,20 +302,21 @@ console.log('hi');
|
||||||
let SelectSupDetails = Supplierdata?.filter(
|
let SelectSupDetails = Supplierdata?.filter(
|
||||||
(item) => item.SuppName?.toLowerCase() === 'self'
|
(item) => item.SuppName?.toLowerCase() === 'self'
|
||||||
); //naresh
|
); //naresh
|
||||||
|
setselecSuppDetails(SelectSupDetails?.[0]);
|
||||||
setselecPurSupplierDetails(SelectSupDetails);
|
setselecPurSupplierDetails(SelectSupDetails);
|
||||||
formRef.current?.setFieldsValue({ SuppId: SupplierId });
|
formRef.current?.setFieldsValue({ SuppId: SupplierId });
|
||||||
setselecPurSupplier(SupplierId);
|
setselecPurSupplier(SupplierId);
|
||||||
getProductDatas(SupplierId);
|
getProductDatas(SupplierId);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getSupplierData = async () => {
|
const getSupplierData = async (Type = null) => {
|
||||||
try {
|
try {
|
||||||
let Supplier = await dispatch(
|
let Supplier = await dispatch(
|
||||||
getPurchaseSupplierAndWareHouseData({
|
getPurchaseSupplierAndWareHouseData({
|
||||||
CompId,
|
CompId,
|
||||||
AppId,
|
AppId,
|
||||||
BranchId,
|
BranchId,
|
||||||
|
Type,
|
||||||
})
|
})
|
||||||
).unwrap();
|
).unwrap();
|
||||||
if (Supplier?.statusCode == 1) {
|
if (Supplier?.statusCode == 1) {
|
||||||
|
|
@ -1322,6 +1324,7 @@ console.log('hi');
|
||||||
style={{ paddingTop: '0px', rowGap: '0px' }}
|
style={{ paddingTop: '0px', rowGap: '0px' }}
|
||||||
>
|
>
|
||||||
<div className="inputForm">
|
<div className="inputForm">
|
||||||
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="SuppId"
|
name="SuppId"
|
||||||
rules={[
|
rules={[
|
||||||
|
|
@ -1379,10 +1382,29 @@ console.log('hi');
|
||||||
<PlusCircleOutlined onClick={addPurSupplier} />
|
<PlusCircleOutlined onClick={addPurSupplier} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name="showAll"
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Tooltip title="Show all branches and warehouses" placement="top">
|
||||||
|
<span>
|
||||||
|
<Checkbox
|
||||||
|
checked={showAllSuppliers}
|
||||||
|
onChange={(e) => {
|
||||||
|
const checked = e.target.checked;
|
||||||
|
setShowAllSuppliers(checked);
|
||||||
|
getSupplierData(checked ? 'Y' : null);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
All
|
||||||
|
</Checkbox>
|
||||||
|
</span>
|
||||||
|
</Tooltip>
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
<div className='deliveryaddress'>
|
|
||||||
{selecSuppDetails !== null &&
|
{selecSuppDetails !== null &&
|
||||||
(() => {
|
(<div className='deliveryaddress'>
|
||||||
|
{(() => {
|
||||||
const fields = [];
|
const fields = [];
|
||||||
if (selecSuppDetails?.SuppName) {
|
if (selecSuppDetails?.SuppName) {
|
||||||
fields.push(
|
fields.push(
|
||||||
|
|
@ -1456,7 +1478,8 @@ console.log('hi');
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})()}
|
})()}
|
||||||
</div>
|
</div>)
|
||||||
|
}
|
||||||
<div
|
<div
|
||||||
className="lowStock-button"
|
className="lowStock-button"
|
||||||
onClick={() => setisLowStockModel(true)}
|
onClick={() => setisLowStockModel(true)}
|
||||||
|
|
|
||||||
|
|
@ -71,20 +71,6 @@
|
||||||
font-size: 12px !important;
|
font-size: 12px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// .custom-table tbody tr {
|
|
||||||
// >td:nth-child(6) {
|
|
||||||
// display: flex;
|
|
||||||
// flex-direction: column;
|
|
||||||
// width: 100%;
|
|
||||||
// gap: 2rem;
|
|
||||||
// }
|
|
||||||
// >td:nth-child(7) {
|
|
||||||
// display: flex;
|
|
||||||
// flex-direction: column;
|
|
||||||
// width: 100%;
|
|
||||||
// gap: 2rem;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
.custom-table tbody tr td {
|
.custom-table tbody tr td {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
@ -138,11 +124,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.summaryContent2 {
|
|
||||||
.centerDivList {
|
|
||||||
// width: 50%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom-table {
|
.custom-table {
|
||||||
Button:disabled,
|
Button:disabled,
|
||||||
|
|
|
||||||
|
|
@ -4419,6 +4419,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.CustomerForm-Master {
|
.CustomerForm-Master {
|
||||||
|
width: 100%;
|
||||||
.inputForm {
|
.inputForm {
|
||||||
width: 50% !important;
|
width: 50% !important;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,25 +12,32 @@ import {
|
||||||
Row,
|
Row,
|
||||||
Col,
|
Col,
|
||||||
Form,
|
Form,
|
||||||
Modal
|
Modal,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import { SearchOutlined } from '@ant-design/icons';
|
import { SearchOutlined } from '@ant-design/icons';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch } from 'react-redux';
|
||||||
import { getAllTipAmountSettlementList, getTipAmountSettlementList, postTipSettle } from '../../../Features/TipAmountSettlementList/TipAmountSettlementList';
|
import {
|
||||||
|
getAllTipAmountSettlementList,
|
||||||
|
getTipAmountSettlementList,
|
||||||
|
postTipSettle,
|
||||||
|
} from '../../../Features/TipAmountSettlementList/TipAmountSettlementList';
|
||||||
import { getSession } from '../../../Services/Others';
|
import { getSession } from '../../../Services/Others';
|
||||||
import { WaiterNames } from '../../../Features/Reports/Reports';
|
import { WaiterNames } from '../../../Features/Reports/Reports';
|
||||||
import { Messages } from '../../../Components/Notifications/Messages';
|
import { Messages } from '../../../Components/Notifications/Messages';
|
||||||
import { getEmployeeSettlementList, getEmployeeSettlementListindIvidually, postEmployeeSettle } from '../../../Features/EmployeeSettlement/EmployeeSettlement';
|
import {
|
||||||
|
getEmployeeSettlementList,
|
||||||
|
getEmployeeSettlementListindIvidually,
|
||||||
|
postEmployeeSettle,
|
||||||
|
} from '../../../Features/EmployeeSettlement/EmployeeSettlement';
|
||||||
import FormHeader from '../../PageComponents/FormHeader';
|
import FormHeader from '../../PageComponents/FormHeader';
|
||||||
import { changeBreadCrumb } from '../../../Features/AppPage/CenterPage';
|
import { changeBreadCrumb } from '../../../Features/AppPage/CenterPage';
|
||||||
|
|
||||||
|
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
const EmployeeSettlement = () => {
|
const EmployeeSettlement = () => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch();
|
||||||
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [modalOpen, setModalOpen] = useState(false);
|
const [modalOpen, setModalOpen] = useState(false);
|
||||||
|
|
@ -45,21 +52,25 @@ const EmployeeSettlement = () => {
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
const [TableData, setTableData] = useState([]);
|
const [TableData, setTableData] = useState([]);
|
||||||
const [employeeList, setEmployee] = useState([]); // Add this state for employee dropdown
|
const [employeeList, setEmployee] = useState([]); // Add this state for employee dropdown
|
||||||
const checkedTotal = checkedRows.reduce((sum, row) => sum + (Number(row?.IncentiveDetails?.[0]?.IncentiveAmount) || 0), 0);
|
const checkedTotal = checkedRows.reduce(
|
||||||
|
(sum, row) =>
|
||||||
|
sum + (Number(row?.IncentiveDetails?.[0]?.IncentiveAmount) || 0),
|
||||||
|
0
|
||||||
|
);
|
||||||
const Paymentstatus = form.getFieldValue('status');
|
const Paymentstatus = form.getFieldValue('status');
|
||||||
|
|
||||||
console.log(checkedRowKeys, "checkedRowKeys")
|
console.log(checkedRowKeys, 'checkedRowKeys');
|
||||||
// const employeeOptions = [
|
// const employeeOptions = [
|
||||||
// ...new Set(TableData.map(item => item.Employee))
|
// ...new Set(TableData.map(item => item.Employee))
|
||||||
// ];
|
// ];
|
||||||
|
|
||||||
|
|
||||||
const [filteredData, setFilteredData] = useState(TableData);
|
const [filteredData, setFilteredData] = useState(TableData);
|
||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
link: `${subDirectory}app-page/home`,
|
link: `${subDirectory}app-page/home`,
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
name: 'Incentive Settlement',
|
name: 'Incentive Settlement',
|
||||||
link: `${subDirectory}report/EmployeeSettlement`,
|
link: `${subDirectory}report/EmployeeSettlement`,
|
||||||
},
|
},
|
||||||
|
|
@ -70,23 +81,20 @@ const EmployeeSettlement = () => {
|
||||||
dataIndex: 'SalesDate',
|
dataIndex: 'SalesDate',
|
||||||
key: 'SalesDate',
|
key: 'SalesDate',
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (date) => date ? dayjs(date).format('DD/MM/YYYY') : '',
|
render: (date) => (date ? dayjs(date).format('DD/MM/YYYY') : ''),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Tip Date',
|
title: 'Tip Date',
|
||||||
dataIndex: 'TipsAmount',
|
dataIndex: 'TipsAmount',
|
||||||
key: 'TipsAmount',
|
key: 'TipsAmount',
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (item) => (
|
render: (item) => <span style={{}}>{item}</span>,
|
||||||
<span style={{}}>{item}</span>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Add more columns as needed based on your TipsDetails structure
|
// Add more columns as needed based on your TipsDetails structure
|
||||||
];
|
];
|
||||||
|
|
||||||
const handleEyeClick = (record) => {
|
const handleEyeClick = (record) => {
|
||||||
|
|
||||||
// Assuming TipsDetails is an array inside WaiterDetails[0]
|
// Assuming TipsDetails is an array inside WaiterDetails[0]
|
||||||
setModalData(record);
|
setModalData(record);
|
||||||
setModalOpen(true);
|
setModalOpen(true);
|
||||||
|
|
@ -118,26 +126,31 @@ const EmployeeSettlement = () => {
|
||||||
dataIndex: 'TotalSalesAmount',
|
dataIndex: 'TotalSalesAmount',
|
||||||
key: 'TotalSalesAmount',
|
key: 'TotalSalesAmount',
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
const statusMap = { toBe: "N", already: "Y" };
|
const statusMap = { toBe: 'N', already: 'Y' };
|
||||||
const value = statusMap[form.getFieldValue('status')];
|
const value = statusMap[form.getFieldValue('status')];
|
||||||
const group = record?.StatusGroups?.find(e => e?.SettledStatus === value);
|
const group = record?.StatusGroups?.find(
|
||||||
|
(e) => e?.SettledStatus === value
|
||||||
|
);
|
||||||
return <span>{group?.TotalSalesAmount ?? 0}</span>;
|
return <span>{group?.TotalSalesAmount ?? 0}</span>;
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
,
|
|
||||||
{
|
{
|
||||||
title: 'IncentiveAmount',
|
title: 'IncentiveAmount',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
dataIndex: 'IncentiveAmount',
|
dataIndex: 'IncentiveAmount',
|
||||||
key: 'IncentiveAmount',
|
key: 'IncentiveAmount',
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
const statusMap = { toBe: "N", already: "Y" };
|
const statusMap = { toBe: 'N', already: 'Y' };
|
||||||
const value = statusMap[form.getFieldValue('status')];
|
const value = statusMap[form.getFieldValue('status')];
|
||||||
const group = record?.StatusGroups?.find(e => e?.SettledStatus === value);
|
const group = record?.StatusGroups?.find(
|
||||||
|
(e) => e?.SettledStatus === value
|
||||||
|
);
|
||||||
return <span>{group?.IncentiveAmount ?? 0}</span>;
|
return <span>{group?.IncentiveAmount ?? 0}</span>;
|
||||||
}
|
|
||||||
},
|
},
|
||||||
... (Paymentstatus !== "already") ? [{
|
},
|
||||||
|
...(Paymentstatus !== 'already'
|
||||||
|
? [
|
||||||
|
{
|
||||||
title: 'Settle',
|
title: 'Settle',
|
||||||
key: 'settle',
|
key: 'settle',
|
||||||
width: 80,
|
width: 80,
|
||||||
|
|
@ -150,30 +163,43 @@ const EmployeeSettlement = () => {
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={checkedRowKeys.includes(waiterId)}
|
checked={checkedRowKeys.includes(waiterId)}
|
||||||
disabled={isDisabled}
|
disabled={isDisabled}
|
||||||
onChange={e => {
|
onChange={(e) => {
|
||||||
if (e.target.checked) {
|
if (e.target.checked) {
|
||||||
setCheckedRowKeys(prev => prev.includes(waiterId) ? prev : [...prev, waiterId]);
|
setCheckedRowKeys((prev) =>
|
||||||
setCheckedRows(prev => prev.find(row => row?.EmployeeId === waiterId) ? prev : [...prev, record]);
|
prev.includes(waiterId) ? prev : [...prev, waiterId]
|
||||||
|
);
|
||||||
|
setCheckedRows((prev) =>
|
||||||
|
prev.find((row) => row?.EmployeeId === waiterId)
|
||||||
|
? prev
|
||||||
|
: [...prev, record]
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
setCheckedRowKeys(prev => prev.filter(key => key !== waiterId));
|
setCheckedRowKeys((prev) =>
|
||||||
setCheckedRows(prev => prev.filter(row => row?.EmployeeId !== waiterId));
|
prev.filter((key) => key !== waiterId)
|
||||||
|
);
|
||||||
|
setCheckedRows((prev) =>
|
||||||
|
prev.filter((row) => row?.EmployeeId !== waiterId)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
}] : [{}]
|
},
|
||||||
|
]
|
||||||
|
: [{}]),
|
||||||
];
|
];
|
||||||
|
|
||||||
// Handle select all checkboxes
|
// Handle select all checkboxes
|
||||||
const handleSelectAll = e => {
|
const handleSelectAll = (e) => {
|
||||||
if (e.target.checked) {
|
if (e.target.checked) {
|
||||||
const allWaiterIds = groupByEmployeeAndStatus(TableData)
|
const allWaiterIds = groupByEmployeeAndStatus(TableData)
|
||||||
.map(emp => ({
|
.map((emp) => ({
|
||||||
...emp,
|
...emp,
|
||||||
StatusGroups: emp.StatusGroups.filter(g => g.SettledStatus === "N")
|
StatusGroups: emp.StatusGroups.filter((g) => g.SettledStatus === 'N'),
|
||||||
}))
|
}))
|
||||||
.filter(emp => emp.StatusGroups.length > 0)?.map(row => row?.EmployeeId);
|
.filter((emp) => emp.StatusGroups.length > 0)
|
||||||
|
?.map((row) => row?.EmployeeId);
|
||||||
setCheckedRowKeys(allWaiterIds);
|
setCheckedRowKeys(allWaiterIds);
|
||||||
setCheckedRows(TableData.slice());
|
setCheckedRows(TableData.slice());
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -202,10 +228,10 @@ const EmployeeSettlement = () => {
|
||||||
};
|
};
|
||||||
let response = await dispatch(getEmployeeSettlementList(data)).unwrap();
|
let response = await dispatch(getEmployeeSettlementList(data)).unwrap();
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
setTableData(response?.data?.data?.EmployeeDetails)
|
setTableData(response?.data?.data?.EmployeeDetails);
|
||||||
}
|
}
|
||||||
// handle response as needed
|
// handle response as needed
|
||||||
}
|
};
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
let data = {
|
let data = {
|
||||||
activeStatus: 'A',
|
activeStatus: 'A',
|
||||||
|
|
@ -217,18 +243,13 @@ const EmployeeSettlement = () => {
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
setEmployee(response?.data?.data);
|
setEmployee(response?.data?.data);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
setSelectedRowKeys([]);
|
setSelectedRowKeys([]);
|
||||||
setFilteredData(TableData);
|
setFilteredData(TableData);
|
||||||
setTableData([])
|
setTableData([]);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFinish = async (values) => {
|
const onFinish = async (values) => {
|
||||||
|
|
@ -238,37 +259,41 @@ const EmployeeSettlement = () => {
|
||||||
BranchId,
|
BranchId,
|
||||||
AppId,
|
AppId,
|
||||||
...restValues,
|
...restValues,
|
||||||
...(Employee && Employee !== "all" && Employee !== "undefined" ? { employeeId: Employee } : {}),
|
...(Employee && Employee !== 'all' && Employee !== 'undefined'
|
||||||
|
? { employeeId: Employee }
|
||||||
|
: {}),
|
||||||
};
|
};
|
||||||
let response
|
let response;
|
||||||
Employee !== "all" ? response = await dispatch(getEmployeeSettlementListindIvidually(data)).unwrap() : response = await dispatch(getEmployeeSettlementList(data)).unwrap()
|
Employee !== 'all'
|
||||||
|
? (response = await dispatch(
|
||||||
|
getEmployeeSettlementListindIvidually(data)
|
||||||
|
).unwrap())
|
||||||
|
: (response = await dispatch(getEmployeeSettlementList(data)).unwrap());
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
setTableData(response?.data?.data?.EmployeeDetails)
|
setTableData(response?.data?.data?.EmployeeDetails);
|
||||||
|
|
||||||
const StatusValue = form.getFieldValue('status') === 'toBe' ? "N" : "Y";
|
const StatusValue = form.getFieldValue('status') === 'toBe' ? 'N' : 'Y';
|
||||||
|
|
||||||
const employees = response?.data?.data?.EmployeeDetails ?? [];
|
const employees = response?.data?.data?.EmployeeDetails ?? [];
|
||||||
const data = employees.some(e =>
|
const data = employees.some((e) =>
|
||||||
e?.IncentiveDetails?.some(a => a?.SettledStatus === StatusValue && a?.IncentiveAmount > 0)
|
e?.IncentiveDetails?.some(
|
||||||
|
(a) => a?.SettledStatus === StatusValue && a?.IncentiveAmount > 0
|
||||||
|
)
|
||||||
);
|
);
|
||||||
if (data) {
|
if (data) {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(response?.data?.response);
|
setMessageData(response?.data?.response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
setMessageType('error');
|
setMessageType('error');
|
||||||
setMessageData(response?.data?.response);
|
setMessageData(response?.data?.response);
|
||||||
setTableData([])
|
setTableData([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCheckedSubmit = async () => {
|
const handleCheckedSubmit = async () => {
|
||||||
const today = dayjs();
|
const today = dayjs();
|
||||||
const statusMap = { toBe: "N", already: "Y" };
|
const statusMap = { toBe: 'N', already: 'Y' };
|
||||||
const value = statusMap[form.getFieldValue('status')]; // "N" or "Y"
|
const value = statusMap[form.getFieldValue('status')]; // "N" or "Y"
|
||||||
|
|
||||||
const postData = {
|
const postData = {
|
||||||
|
|
@ -277,31 +302,31 @@ const EmployeeSettlement = () => {
|
||||||
AppId,
|
AppId,
|
||||||
CreatedBy: UserId,
|
CreatedBy: UserId,
|
||||||
EmployeeDetails: checkedRows.map((item) => {
|
EmployeeDetails: checkedRows.map((item) => {
|
||||||
const group = item?.StatusGroups?.find(g => g?.SettledStatus === value);
|
const group = item?.StatusGroups?.find(
|
||||||
|
(g) => g?.SettledStatus === value
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
SettlementAmount: group?.IncentiveAmount ?? 0,
|
SettlementAmount: group?.IncentiveAmount ?? 0,
|
||||||
EmployeeId: item?.EmployeeId,
|
EmployeeId: item?.EmployeeId,
|
||||||
SettledPeriodDate: formatToYYYYMMDD(today),
|
SettledPeriodDate: formatToYYYYMMDD(today),
|
||||||
IncentiveDetails: group?.items ?? []
|
IncentiveDetails: group?.items ?? [],
|
||||||
};
|
};
|
||||||
})
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log(postData);
|
||||||
|
|
||||||
console.log(postData)
|
|
||||||
|
|
||||||
let response = await dispatch(postEmployeeSettle(postData))?.unwrap();
|
let response = await dispatch(postEmployeeSettle(postData))?.unwrap();
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(response?.data?.response);
|
setMessageData(response?.data?.response);
|
||||||
handleReset()
|
handleReset();
|
||||||
setCheckedRows([])
|
setCheckedRows([]);
|
||||||
} else {
|
} else {
|
||||||
setMessageType('error');
|
setMessageType('error');
|
||||||
setMessageData(response?.data?.response);
|
setMessageData(response?.data?.response);
|
||||||
handleReset()
|
handleReset();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function formatToYYYYMMDD(dateString) {
|
function formatToYYYYMMDD(dateString) {
|
||||||
|
|
@ -331,7 +356,7 @@ const EmployeeSettlement = () => {
|
||||||
// }, [form, TableData]);
|
// }, [form, TableData]);
|
||||||
function groupByEmployeeAndStatus(tableData) {
|
function groupByEmployeeAndStatus(tableData) {
|
||||||
return tableData
|
return tableData
|
||||||
.map(emp => {
|
.map((emp) => {
|
||||||
const grouped = emp.IncentiveDetails.reduce((acc, curr) => {
|
const grouped = emp.IncentiveDetails.reduce((acc, curr) => {
|
||||||
if ((curr.IncentiveAmount || 0) === 0) {
|
if ((curr.IncentiveAmount || 0) === 0) {
|
||||||
return acc; // skip this detail entirely
|
return acc; // skip this detail entirely
|
||||||
|
|
@ -343,7 +368,7 @@ const EmployeeSettlement = () => {
|
||||||
SettledStatus: status,
|
SettledStatus: status,
|
||||||
TotalSalesAmount: 0,
|
TotalSalesAmount: 0,
|
||||||
IncentiveAmount: 0,
|
IncentiveAmount: 0,
|
||||||
items: []
|
items: [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
acc[status].TotalSalesAmount += curr.TotalSalesAmount || 0;
|
acc[status].TotalSalesAmount += curr.TotalSalesAmount || 0;
|
||||||
|
|
@ -355,16 +380,14 @@ const EmployeeSettlement = () => {
|
||||||
return {
|
return {
|
||||||
EmployeeId: emp?.EmployeeId,
|
EmployeeId: emp?.EmployeeId,
|
||||||
EmployeeName: emp.EmployeeName,
|
EmployeeName: emp.EmployeeName,
|
||||||
StatusGroups: Object.values(grouped)
|
StatusGroups: Object.values(grouped),
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter(emp => emp.StatusGroups.length > 0); // remove employees with no valid items
|
.filter((emp) => emp.StatusGroups.length > 0); // remove employees with no valid items
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let dataaaa = groupByEmployeeAndStatus(TableData);
|
||||||
|
console.log(dataaaa, 'dataaaa');
|
||||||
let dataaaa = groupByEmployeeAndStatus(TableData)
|
|
||||||
console.log(dataaaa, "dataaaa")
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCheckedRowKeys([]);
|
setCheckedRowKeys([]);
|
||||||
setCheckedRows([]);
|
setCheckedRows([]);
|
||||||
|
|
@ -376,51 +399,38 @@ const EmployeeSettlement = () => {
|
||||||
setFilteredData([]);
|
setFilteredData([]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{
|
<div
|
||||||
|
style={{
|
||||||
padding: '0',
|
padding: '0',
|
||||||
width: "100%", height: "90%", overflow: "scroll"
|
width: '99%',
|
||||||
}}>
|
height: '90%',
|
||||||
<div style={{ marginBottom: "10px" }}>
|
overflow: 'scroll',
|
||||||
<FormHeader title={"Incentive"} />
|
}}
|
||||||
|
>
|
||||||
|
<div style={{ marginBottom: '10px' }}>
|
||||||
|
<FormHeader title={'Incentive'} />
|
||||||
</div>
|
</div>
|
||||||
<Messages
|
<Messages
|
||||||
messageType={messageType}
|
messageType={messageType}
|
||||||
messageData={messageData}
|
messageData={messageData}
|
||||||
onComplete={onComplete}
|
onComplete={onComplete}
|
||||||
/>
|
/>
|
||||||
<Card
|
|
||||||
// title="Incentive"
|
|
||||||
style={{
|
|
||||||
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
|
||||||
borderRadius: '8px',
|
|
||||||
height: "100%"
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Card
|
|
||||||
size="small"
|
|
||||||
style={{
|
|
||||||
marginBottom: '20px',
|
|
||||||
backgroundColor: '#fafafa',
|
|
||||||
border: '1px solid #d9d9d9',
|
|
||||||
width: "72vw",
|
|
||||||
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Form
|
<Form
|
||||||
form={form}
|
form={form}
|
||||||
layout="inline"
|
layout="inline"
|
||||||
onFinish={onFinish}
|
onFinish={onFinish}
|
||||||
initialValues={{
|
initialValues={{
|
||||||
Employee: 'all',
|
Employee: 'all',
|
||||||
status: 'toBe'
|
status: 'toBe',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Row style={{ rowGap: "1rem", flexWrap: "wrap" }} wrap={true} gutter={16} >
|
<Row
|
||||||
|
style={{ rowGap: '1rem', flexWrap: 'wrap' }}
|
||||||
|
wrap={true}
|
||||||
|
gutter={16}
|
||||||
|
>
|
||||||
<Col>
|
<Col>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="Employee"
|
name="Employee"
|
||||||
|
|
@ -430,9 +440,12 @@ const EmployeeSettlement = () => {
|
||||||
>
|
>
|
||||||
<Select style={{ width: 180 }}>
|
<Select style={{ width: 180 }}>
|
||||||
<Option value="all">All</Option>
|
<Option value="all">All</Option>
|
||||||
{employeeList.map(emp => (
|
{employeeList.map((emp) => (
|
||||||
<Option key={emp.UniqueId} value={emp.UniqueId}>
|
<Option key={emp.UniqueId} value={emp.UniqueId}>
|
||||||
{emp.EmpFirstName ? emp.EmpFirstName + (emp.EmpLastName ? ' ' + emp.EmpLastName : '') : emp.MobileNo}
|
{emp.EmpFirstName
|
||||||
|
? emp.EmpFirstName +
|
||||||
|
(emp.EmpLastName ? ' ' + emp.EmpLastName : '')
|
||||||
|
: emp.MobileNo}
|
||||||
</Option>
|
</Option>
|
||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
|
|
@ -492,50 +505,67 @@ const EmployeeSettlement = () => {
|
||||||
>
|
>
|
||||||
Search
|
Search
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={handleReset}>
|
<Button onClick={handleReset}>Cancel</Button>
|
||||||
Cancel
|
|
||||||
</Button>
|
|
||||||
</Space>
|
</Space>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Form>
|
</Form>
|
||||||
</Card>
|
|
||||||
|
|
||||||
{/* Data Table */}
|
{/* Data Table */}
|
||||||
{Paymentstatus !== "already" && <div style={{ marginBottom: 8, float: "right" }}>
|
{Paymentstatus !== 'already' && (
|
||||||
|
<div style={{ marginBottom: 8, float: 'right' }}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
indeterminate={checkedRowKeys?.length > 0 && checkedRowKeys?.length < TableData?.length}
|
indeterminate={
|
||||||
checked={TableData?.length > 0 && checkedRowKeys?.length === TableData?.length}
|
checkedRowKeys?.length > 0 &&
|
||||||
|
checkedRowKeys?.length < TableData?.length
|
||||||
|
}
|
||||||
|
checked={
|
||||||
|
TableData?.length > 0 &&
|
||||||
|
checkedRowKeys?.length === TableData?.length
|
||||||
|
}
|
||||||
onChange={handleSelectAll}
|
onChange={handleSelectAll}
|
||||||
>
|
>
|
||||||
Select All
|
Select All
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
</div>}
|
</div>
|
||||||
|
)}
|
||||||
|
<div className="reportTable">
|
||||||
<Table
|
<Table
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={form.getFieldValue('status') == "toBe" ? groupByEmployeeAndStatus(TableData)
|
dataSource={
|
||||||
.map(emp => ({
|
form.getFieldValue('status') == 'toBe'
|
||||||
|
? groupByEmployeeAndStatus(TableData)
|
||||||
|
.map((emp) => ({
|
||||||
...emp,
|
...emp,
|
||||||
StatusGroups: emp.StatusGroups.filter(g => g.SettledStatus === "N")
|
StatusGroups: emp.StatusGroups.filter(
|
||||||
|
(g) => g.SettledStatus === 'N'
|
||||||
|
),
|
||||||
}))
|
}))
|
||||||
.filter(emp => emp.StatusGroups.length > 0) : groupByEmployeeAndStatus(TableData).map(emp => ({
|
.filter((emp) => emp.StatusGroups.length > 0)
|
||||||
|
: groupByEmployeeAndStatus(TableData)
|
||||||
|
.map((emp) => ({
|
||||||
...emp,
|
...emp,
|
||||||
StatusGroups: emp.StatusGroups.filter(g => g.SettledStatus === "Y")
|
StatusGroups: emp.StatusGroups.filter(
|
||||||
|
(g) => g.SettledStatus === 'Y'
|
||||||
|
),
|
||||||
}))
|
}))
|
||||||
.filter(emp => emp.StatusGroups.length > 0)
|
.filter((emp) => emp.StatusGroups.length > 0)
|
||||||
}
|
}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 'max-content' }}
|
||||||
size="middle"
|
size="middle"
|
||||||
style={{ backgroundColor: 'white' }}
|
style={{ backgroundColor: 'white' }}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Button to submit checked rows */}
|
{/* Button to submit checked rows */}
|
||||||
|
|
||||||
<div className='incenbtivepayBTN' style={{ marginTop: 16, float: "right" }}>
|
<div
|
||||||
<div style={{ display: "flex", gap: "1rem" }}>
|
className="incenbtivepayBTN"
|
||||||
|
style={{ marginTop: 16, float: 'right' }}
|
||||||
|
>
|
||||||
|
<div style={{ display: 'flex', gap: '1rem' }}>
|
||||||
{/* {checkedRowKeys.length !== 0 && (
|
{/* {checkedRowKeys.length !== 0 && (
|
||||||
<input
|
<input
|
||||||
disabled
|
disabled
|
||||||
|
|
@ -571,19 +601,20 @@ const EmployeeSettlement = () => {
|
||||||
|
|
||||||
{/* Selected Rows Info */}
|
{/* Selected Rows Info */}
|
||||||
{selectedRowKeys.length > 0 && (
|
{selectedRowKeys.length > 0 && (
|
||||||
<div style={{
|
<div
|
||||||
|
style={{
|
||||||
marginTop: '16px',
|
marginTop: '16px',
|
||||||
padding: '8px 16px',
|
padding: '8px 16px',
|
||||||
backgroundColor: '#e6f7ff',
|
backgroundColor: '#e6f7ff',
|
||||||
border: '1px solid #91d5ff',
|
border: '1px solid #91d5ff',
|
||||||
borderRadius: '4px'
|
borderRadius: '4px',
|
||||||
}}>
|
}}
|
||||||
|
>
|
||||||
<span style={{ color: '#1890ff' }}>
|
<span style={{ color: '#1890ff' }}>
|
||||||
Selected {selectedRowKeys.length} items
|
Selected {selectedRowKeys.length} items
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Card>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@ import { getProductStockDetails } from "../../../Features/PurchaseOrder/Purchase
|
||||||
import { dateFormatChange, ExtractDateFormate, getSession } from "../../../Services/Others";
|
import { dateFormatChange, ExtractDateFormate, getSession } from "../../../Services/Others";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { changeBreadCrumb } from "../../../Features/AppPage/CenterPage";
|
import { changeBreadCrumb } from "../../../Features/AppPage/CenterPage";
|
||||||
// import "./PurchaseOrderReport.css";
|
import "./PurchaseOrderReport.scss";
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
const PurchaseOrderReport = () => {
|
const PurchaseOrderReport = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,646 @@
|
||||||
|
.ItemWiseReport-table .ant-table table {
|
||||||
|
// height:60vh;
|
||||||
|
// overflow:scroll;
|
||||||
|
overflow: scroll;
|
||||||
|
// height: clamp(30vh , 85vh,95vh);
|
||||||
|
border-spacing: 0 0.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table .ant-table-thead {
|
||||||
|
position: sticky;
|
||||||
|
top: 0 !important;
|
||||||
|
background-color: #bad4f9;
|
||||||
|
z-index: 1;
|
||||||
|
border-spacing: 0 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table .ant-table-wrapper .ant-table-thead > tr > th,
|
||||||
|
.ant-table-wrapper .ant-table-thead > tr > td {
|
||||||
|
color: #000000;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
border-spacing: 0 0.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table .ant-table-row > td {
|
||||||
|
color: black !important;
|
||||||
|
font-weight: 500 !important;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-search {
|
||||||
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
column-gap: 1rem;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-search-button {
|
||||||
|
border: none;
|
||||||
|
background-color: #e167ff;
|
||||||
|
padding: 1rem 1.5rem;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Date-from-heading {
|
||||||
|
width: 7rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
row-gap: 0.5rem;
|
||||||
|
// padding: 10px 15px;
|
||||||
|
height: 88vh;
|
||||||
|
// overflow: hidden;
|
||||||
|
overflow: auto;
|
||||||
|
width: 100%;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table .ant-pagination {
|
||||||
|
position: sticky;
|
||||||
|
bottom: 0;
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0.5rem;
|
||||||
|
background-color: #fafafa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-header {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-heading {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-purchase {
|
||||||
|
input,
|
||||||
|
.ant-input {
|
||||||
|
border-start-end-radius: 6px !important;
|
||||||
|
border-end-end-radius: 6px !important;
|
||||||
|
padding-top: 6px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-input {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchDiv {
|
||||||
|
height: 42px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-submit-btn-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
width: max-content;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-PrinttAndSubmit {
|
||||||
|
display: flex;
|
||||||
|
column-gap: 3vw;
|
||||||
|
align-items: center;
|
||||||
|
// width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-left: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-dateaAnd-buttons {
|
||||||
|
display: flex;
|
||||||
|
column-gap: 2rem;
|
||||||
|
row-gap: 1rem;
|
||||||
|
// align-items: center;
|
||||||
|
// flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Date-picker {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
column-gap: 2rem;
|
||||||
|
|
||||||
|
// row-gap: 1rem;
|
||||||
|
.ant-form-item {
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Date .ant-picker {
|
||||||
|
width: 20rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-submit-btn {
|
||||||
|
padding: 0.6rem 1rem;
|
||||||
|
border: none;
|
||||||
|
background-color: var(--PRIMARY_BUTTON_BG_COLOR) !important;
|
||||||
|
margin-bottom: 2px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: "Gilroy";
|
||||||
|
color: #ffffff;
|
||||||
|
border-radius: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
// .ItemWiseReport-submit-btn:hover {
|
||||||
|
// background-color: #a8a8a8;
|
||||||
|
// }
|
||||||
|
.ItemWiseReport-PrinterIcon-Container {
|
||||||
|
cursor: pointer;
|
||||||
|
// position: absolute;
|
||||||
|
// top: 6rem;
|
||||||
|
// right: 5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-printerIcon {
|
||||||
|
font-size: 25px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-printerIcon:hover {
|
||||||
|
color: #414141;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Date {
|
||||||
|
display: flex;
|
||||||
|
column-gap: 1rem;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Details-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-right: 2rem;
|
||||||
|
column-gap: 1rem;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Details {
|
||||||
|
margin-left: 0.7rem;
|
||||||
|
display: flex;
|
||||||
|
column-gap: 1rem;
|
||||||
|
row-gap: 0.5rem;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Details-buttons {
|
||||||
|
border: none;
|
||||||
|
padding: 0.6rem 1rem;
|
||||||
|
width: max-content;
|
||||||
|
background-color: #006aff;
|
||||||
|
border-radius: 5px;
|
||||||
|
color: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-printerIcon {
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table-container {
|
||||||
|
margin: 1rem 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Date p {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #5a5a5a;
|
||||||
|
margin-left: 5px;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table {
|
||||||
|
overflow: auto;
|
||||||
|
height: clamp(50vh, 30vh, 95vh);
|
||||||
|
scrollbar-width: thin;
|
||||||
|
|
||||||
|
tr:nth-child(even) {
|
||||||
|
background-color: #e9e8e8 !important;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
//dhana
|
||||||
|
// height: clamp(30vh, 50vh, 95vh);
|
||||||
|
}
|
||||||
|
|
||||||
|
// writed by sree
|
||||||
|
.ItemWiseReport-table1 {
|
||||||
|
overflow: auto;
|
||||||
|
height: clamp(40vh, 30vh, 95vh);
|
||||||
|
width: 79vw !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table .ant-table-thead tr .ant-table-cell {
|
||||||
|
font-size: 25px;
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Amount-Collected-table {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-netAmount {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-search .ant-input {
|
||||||
|
border-radius: 10px !important;
|
||||||
|
padding: 0.35rem 0.5rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.BSitemwise-Search-icon {
|
||||||
|
font-size: 25px;
|
||||||
|
color: #1292ee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropDownandsumit {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
.ant-form-item {
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.Submit_Print {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 950px) {
|
||||||
|
.ItemWiseReport-PrinttAndSubmit {
|
||||||
|
display: flex;
|
||||||
|
column-gap: 3vw;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
// margin-left: 30px;
|
||||||
|
// margin-bottom: 23px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-PrinterIcon-Container {
|
||||||
|
margin-left: 30px;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
// position: absolute;
|
||||||
|
// top: 5rem;
|
||||||
|
// right: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table {
|
||||||
|
overflow: scroll;
|
||||||
|
height: 40vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-container {
|
||||||
|
padding: 15px 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-dateaAnd-buttons {
|
||||||
|
column-gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-netAmount {
|
||||||
|
justify-content: flex-start !important;
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdownUserid {
|
||||||
|
margin-top: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// .ItemWiseReport-dateaAnd-buttons {
|
||||||
|
// // flex-wrap: wrap;
|
||||||
|
// }
|
||||||
|
|
||||||
|
.ItemWiseReport-submit-btn-container {
|
||||||
|
margin-left: 4.5rem;
|
||||||
|
justify-content: flex-start !important;
|
||||||
|
flex-direction: row;
|
||||||
|
column-gap: 0.5rem;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
width: 83px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Date p {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table .ant-table-wrapper .ant-table-thead > tr > th,
|
||||||
|
.ant-table-wrapper .ant-table-thead > tr > td {
|
||||||
|
font-size: 10px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 768px) {
|
||||||
|
.ItemWiseReport-submit-btn-container {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table {
|
||||||
|
width: 80vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 499px) {
|
||||||
|
.ItemWiseReport-submit-btn-container {
|
||||||
|
font-size: 12px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.centerPageSub {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table {
|
||||||
|
overflow-x: scroll;
|
||||||
|
height: 26vh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 280px) {
|
||||||
|
// .ItemWiseReport-PrinttAndSubmit {
|
||||||
|
|
||||||
|
// position: absolute !important;
|
||||||
|
// top: 18rem !important;
|
||||||
|
// }
|
||||||
|
.ItemWiseReport-PrinterIcon-Container {
|
||||||
|
position: absolute;
|
||||||
|
top: 290px !important;
|
||||||
|
left: 200px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Submit_Print {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Date {
|
||||||
|
width: 3rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Date p {
|
||||||
|
font-size: 12px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropDownandsumit {
|
||||||
|
margin-top: 30px !important;
|
||||||
|
height: 160px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-search {
|
||||||
|
display: flex;
|
||||||
|
justify-content: start;
|
||||||
|
column-gap: 1rem;
|
||||||
|
width: 4rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-heading {
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-submit-btn-container {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-dateaAnd-buttons {
|
||||||
|
column-gap: 0.5rem;
|
||||||
|
width: 75vw !important;
|
||||||
|
overflow: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table {
|
||||||
|
overflow: scroll;
|
||||||
|
height: 30vh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table .ant-table-thead th.ant-table-column-has-sorters:hover {
|
||||||
|
background-color: #bad4f9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table .ant-table-wrapper .ant-table-thead > tr > th,
|
||||||
|
.ant-table-wrapper .ant-table-thead > tr > td {
|
||||||
|
background-color: #bad4f9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-printerIcon-disabled {
|
||||||
|
opacity: 0.5;
|
||||||
|
/* You can adjust the opacity to visually indicate it's disabled */
|
||||||
|
pointer-events: none;
|
||||||
|
/* Disable pointer events so it won't respond to clicks */
|
||||||
|
cursor: not-allowed;
|
||||||
|
/* Change cursor to indicate it's not clickable */
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdownUserid {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemwiseDropdown {
|
||||||
|
width: 9rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Date {
|
||||||
|
width: 8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-table .ant-table-content table {
|
||||||
|
table-layout: unset !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toggle {
|
||||||
|
display: flex;
|
||||||
|
width: inherit;
|
||||||
|
height: 2vw;
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
z-index: 1;
|
||||||
|
// padding-right: 93px;
|
||||||
|
padding-bottom: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// .ant-switch:hover:not(.ant-switch-disabled) {
|
||||||
|
// background:var(--SELECTED_COLOR) ;
|
||||||
|
// }
|
||||||
|
//nk
|
||||||
|
@media only screen and (max-width: 499px) {
|
||||||
|
.ItemWiseReport-Amount-Collected-table tr {
|
||||||
|
justify-content: flex-start;
|
||||||
|
column-gap: 5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-border-dashed {
|
||||||
|
width: 10rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Amount-Collected-table {
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.centerPageSub {
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-border-dashed {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-border-dashed {
|
||||||
|
width: 10rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 768px) {
|
||||||
|
.overalTotal {
|
||||||
|
width: 7rem;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Amount-Collected-table {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-Amount-Collected-table tr {
|
||||||
|
display: flex;
|
||||||
|
// width: 15rem;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-border-dashed {
|
||||||
|
border-bottom: 1px dashed rgb(46, 46, 46);
|
||||||
|
width: 17rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ItemWiseReport-border-dashed {
|
||||||
|
font-size: 23px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
border: 1px solid #909090;
|
||||||
|
font-family: "Poppins", sans-serif;
|
||||||
|
|
||||||
|
> thead {
|
||||||
|
position: sticky;
|
||||||
|
top: -1px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table th {
|
||||||
|
background-color: #a4c5f4;
|
||||||
|
color: #1e1e1e;
|
||||||
|
padding: 6px;
|
||||||
|
text-align: left;
|
||||||
|
border: 1px solid #909090;
|
||||||
|
-webkit-text-stroke-width: 0.2px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
font-family: VAR(--HEADING_FONT_FAMILY);
|
||||||
|
// text-transform: uppercase;
|
||||||
|
text-transform: capitalize;
|
||||||
|
letter-spacing: 0.2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.centerDivList {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
// width: 100%;
|
||||||
|
// height: 43vh;
|
||||||
|
overflow: scroll;
|
||||||
|
padding-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table td {
|
||||||
|
padding: 4px 6px;
|
||||||
|
border: 1px solid #909090;
|
||||||
|
text-align: left;
|
||||||
|
font-size: 12px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table tbody tr td {
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
.ant-select.ant-select-in-form-item {
|
||||||
|
width: 190px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table tbody tr td[colspan="7"] {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table tbody tr.additionalCharges-selected {
|
||||||
|
background-color: #dddddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table tbody tr.setAsDefault-selected {
|
||||||
|
background-color: #cceaf0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table {
|
||||||
|
.ant-form-item {
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-label {
|
||||||
|
margin-bottom: 8px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ChargesAddAndCancel {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 5px 10px;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 600 !important;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
> div:nth-child(1) {
|
||||||
|
background-color: #28aa3a;
|
||||||
|
}
|
||||||
|
|
||||||
|
> div:nth-child(2) {
|
||||||
|
background-color: #ff0000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table {
|
||||||
|
Button:disabled,
|
||||||
|
Button[disabled] {
|
||||||
|
width: unset !important;
|
||||||
|
height: unset !important;
|
||||||
|
border-radius: 50px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -21,6 +21,7 @@ import { getSession, validateSafeInput } from '../../Services/Others';
|
||||||
import { postshift, putshift } from '../../Features/ShiftMaster/ShiftMaster.js';
|
import { postshift, putshift } from '../../Features/ShiftMaster/ShiftMaster.js';
|
||||||
import './ShiftMaster.scss';
|
import './ShiftMaster.scss';
|
||||||
import { FaPlus } from 'react-icons/fa6';
|
import { FaPlus } from 'react-icons/fa6';
|
||||||
|
import "../../Styles/OverAllStyle/OverAllStyle.scss";
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -254,8 +254,128 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.stockAdjustListMaster {
|
.custom-table {
|
||||||
.primary_Button {
|
width: 100%;
|
||||||
width: 290px !important;
|
border-collapse: collapse;
|
||||||
|
border: 1px solid #909090;
|
||||||
|
font-family: 'Poppins', sans-serif;
|
||||||
|
|
||||||
|
> thead {
|
||||||
|
position: sticky;
|
||||||
|
top: -1px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.custom-table th {
|
||||||
|
background-color: #a4c5f4;
|
||||||
|
color: #1e1e1e;
|
||||||
|
padding: 6px;
|
||||||
|
text-align: left;
|
||||||
|
border: 1px solid #909090;
|
||||||
|
-webkit-text-stroke-width: 0.2px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
font-family: VAR(--HEADING_FONT_FAMILY);
|
||||||
|
// text-transform: uppercase;
|
||||||
|
text-transform: capitalize;
|
||||||
|
letter-spacing: 0.2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.centerDivList {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
// width: 100%;
|
||||||
|
// height: 43vh;
|
||||||
|
overflow: scroll;
|
||||||
|
padding-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table td {
|
||||||
|
padding: 4px 6px;
|
||||||
|
border: 1px solid #909090;
|
||||||
|
text-align: left;
|
||||||
|
font-size: 12px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.custom-table tbody tr td {
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
.ant-select.ant-select-in-form-item {
|
||||||
|
width: 190px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table tbody tr td[colspan='7'] {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table tbody tr.additionalCharges-selected {
|
||||||
|
background-color: #dddddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table tbody tr.setAsDefault-selected {
|
||||||
|
background-color: #cceaf0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table {
|
||||||
|
.ant-form-item {
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-label {
|
||||||
|
margin-bottom: 8px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ChargesAddAndCancel {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 5px 10px;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 600 !important;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
> div:nth-child(1) {
|
||||||
|
background-color: #28aa3a;
|
||||||
|
}
|
||||||
|
|
||||||
|
> div:nth-child(2) {
|
||||||
|
background-color: #ff0000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.custom-table {
|
||||||
|
Button:disabled,
|
||||||
|
Button[disabled] {
|
||||||
|
width: unset !important;
|
||||||
|
height: unset !important;
|
||||||
|
border-radius: 50px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.openingStock-ignoreProductBTN {
|
||||||
|
width: max-content;
|
||||||
|
white-space: nowrap;
|
||||||
|
height: max-content;
|
||||||
|
padding: 10px 16px;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
border: none;
|
||||||
|
background-color: #e42006;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
font-family: "Poppins";
|
||||||
|
margin-left: 6px;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ const StockadjustmentList = () => {
|
||||||
<div>
|
<div>
|
||||||
<FormHeader title={'Stock Adjustment'} />
|
<FormHeader title={'Stock Adjustment'} />
|
||||||
</div>
|
</div>
|
||||||
<div className="searchAddDiv">
|
|
||||||
<div className="formSearch">
|
<div className="formSearch">
|
||||||
<Search
|
<Search
|
||||||
placeholder="Search"
|
placeholder="Search"
|
||||||
|
|
@ -211,7 +211,7 @@ const StockadjustmentList = () => {
|
||||||
onSearchChange={onSearchChange}
|
onSearchChange={onSearchChange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText={'Stock Adjustment'}
|
buttonText={'Stock Adjustment'}
|
||||||
handleSubmit={() => handelAddButton()}
|
handleSubmit={() => handelAddButton()}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import {
|
||||||
PlusCircleOutlined,
|
PlusCircleOutlined,
|
||||||
SearchOutlined,
|
SearchOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { Form, Tooltip, Table, Input, AutoComplete, Switch } from 'antd';
|
import { Form, Tooltip, Table, Input, AutoComplete, Switch, Checkbox } from 'antd';
|
||||||
import { IoAddCircleSharp } from 'react-icons/io5';
|
import { IoAddCircleSharp } from 'react-icons/io5';
|
||||||
import { InputField } from '../../Components/Forms/InputField.jsx';
|
import { InputField } from '../../Components/Forms/InputField.jsx';
|
||||||
import Buttons from '../../Components/Forms/Buttons.jsx';
|
import Buttons from '../../Components/Forms/Buttons.jsx';
|
||||||
|
|
@ -268,6 +268,7 @@ const StockForm = ({ formType }) => {
|
||||||
// const [filteredPurchaseData, setFilteredPurchaseData] = useState([]);
|
// const [filteredPurchaseData, setFilteredPurchaseData] = useState([]);
|
||||||
const [searchValue, setSearchValue] = useState('');
|
const [searchValue, setSearchValue] = useState('');
|
||||||
const isSearching = Boolean(searchValue?.trim());
|
const isSearching = Boolean(searchValue?.trim());
|
||||||
|
const [showAllSuppliers, setShowAllSuppliers] = useState(false);
|
||||||
|
|
||||||
const SelInvoiceAmount = useMemo(() => {
|
const SelInvoiceAmount = useMemo(() => {
|
||||||
const total = PurchaseData?.reduce(
|
const total = PurchaseData?.reduce(
|
||||||
|
|
@ -324,7 +325,7 @@ const StockForm = ({ formType }) => {
|
||||||
deliveryPerformance();
|
deliveryPerformance();
|
||||||
discountLevel();
|
discountLevel();
|
||||||
qualityofSupp();
|
qualityofSupp();
|
||||||
getSuplaierApi({});
|
getSuplaierApi({ Type: null });
|
||||||
|
|
||||||
if (formType == 'add') {
|
if (formType == 'add') {
|
||||||
formRef.current?.setFieldsValue({ SuppInvoiceDate: new Date().toJSON() });
|
formRef.current?.setFieldsValue({ SuppInvoiceDate: new Date().toJSON() });
|
||||||
|
|
@ -416,9 +417,9 @@ const StockForm = ({ formType }) => {
|
||||||
: setSelectedSupplierName(true);
|
: setSelectedSupplierName(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getSuplaierApi = async ({ dataReturn = false }) => {
|
const getSuplaierApi = async ({ dataReturn = false, Type = null }) => {
|
||||||
const response = await dispatch(
|
const response = await dispatch(
|
||||||
getPurchaseSupplierAndWareHouseData({ CompId, AppId, BranchId })
|
getPurchaseSupplierAndWareHouseData({ CompId, AppId, BranchId, Type })
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
if (response?.statusCode === 1) {
|
if (response?.statusCode === 1) {
|
||||||
|
|
@ -3381,6 +3382,8 @@ const StockForm = ({ formType }) => {
|
||||||
</FloatLabel>
|
</FloatLabel>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
<div className={`${orderType ? 'div-flex' : ''}`}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="CustSuppId"
|
name="CustSuppId"
|
||||||
rules={[
|
rules={[
|
||||||
|
|
@ -3430,8 +3433,32 @@ const StockForm = ({ formType }) => {
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
{orderType && <Form.Item
|
||||||
|
name="showAll"
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Tooltip title="Show all branches and warehouses" placement="top">
|
||||||
|
<span>
|
||||||
|
<Checkbox
|
||||||
|
checked={showAllSuppliers}
|
||||||
|
onChange={(e) => {
|
||||||
|
const checked = e.target.checked;
|
||||||
|
setShowAllSuppliers(checked);
|
||||||
|
setInitialLoad(true);
|
||||||
|
getSuplaierApi({ Type: checked ? 'Y' : null });
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
All
|
||||||
|
</Checkbox>
|
||||||
|
</span>
|
||||||
|
</Tooltip>
|
||||||
|
</Form.Item>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
{!selectedSupplierName && (
|
{!selectedSupplierName && (
|
||||||
<RadioGrpButton
|
<RadioGrpButton
|
||||||
|
|
||||||
content={[
|
content={[
|
||||||
{ value: 'own', label: 'Own' },
|
{ value: 'own', label: 'Own' },
|
||||||
{ value: 'paid', label: 'With paid' },
|
{ value: 'paid', label: 'With paid' },
|
||||||
|
|
@ -3443,6 +3470,7 @@ const StockForm = ({ formType }) => {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
||||||
<div className="pe-inward-date">
|
<div className="pe-inward-date">
|
||||||
<label className="required">Inward Date</label>
|
<label className="required">Inward Date</label>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -241,7 +241,6 @@ const StockList = () => {
|
||||||
if (Response?.data?.statusCode === 1) {
|
if (Response?.data?.statusCode === 1) {
|
||||||
return Response?.data?.data;
|
return Response?.data?.data;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -295,7 +294,6 @@ const StockList = () => {
|
||||||
setpage(1);
|
setpage(1);
|
||||||
return Response?.data?.data;
|
return Response?.data?.data;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -991,7 +989,6 @@ const StockList = () => {
|
||||||
(e) => `${e.ProdName} (${e.Size} ${e.UomName})`
|
(e) => `${e.ProdName} (${e.Size} ${e.UomName})`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const SupplierNames = SupplierData?.map((e) => e.SuppName);
|
const SupplierNames = SupplierData?.map((e) => e.SuppName);
|
||||||
|
|
||||||
const TaxDatas = TaxData.map((e) => e.TaxIdName);
|
const TaxDatas = TaxData.map((e) => e.TaxIdName);
|
||||||
|
|
@ -1006,9 +1003,6 @@ const StockList = () => {
|
||||||
const InwardDtlIds = Varientdata?.map((e) => e.InwardDtlId);
|
const InwardDtlIds = Varientdata?.map((e) => e.InwardDtlId);
|
||||||
const StockProductId = Varientdata?.map((e) => e.ProdId);
|
const StockProductId = Varientdata?.map((e) => e.ProdId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const onFinish = async () => {
|
const onFinish = async () => {
|
||||||
const template = barcodeTemplateDetails?.find(
|
const template = barcodeTemplateDetails?.find(
|
||||||
(find) => find.SessionName === dropdownValue
|
(find) => find.SessionName === dropdownValue
|
||||||
|
|
@ -1164,7 +1158,7 @@ const StockList = () => {
|
||||||
? countData?.length
|
? countData?.length
|
||||||
: 0
|
: 0
|
||||||
: data?.[0]?.TotalCount;
|
: data?.[0]?.TotalCount;
|
||||||
console.log(debouncedSearchText, countData, data, "kkkk", countOfProduct)
|
console.log(debouncedSearchText, countData, data, 'kkkk', countOfProduct);
|
||||||
return (
|
return (
|
||||||
<div className="userPageTable">
|
<div className="userPageTable">
|
||||||
<div className="userPageContent">
|
<div className="userPageContent">
|
||||||
|
|
@ -1178,9 +1172,10 @@ const StockList = () => {
|
||||||
<FormHeader title={'Product Receipt'} />
|
<FormHeader title={'Product Receipt'} />
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="searchAddDiv"
|
className="StocklistsearchAddDiv"
|
||||||
style={{ justifyContent: 'flex-start' }}
|
style={{ justifyContent: 'flex-start', flexWrap: 'wrap' }}
|
||||||
><Tooltip title="Search using Invoice No,Supp Name">
|
>
|
||||||
|
<Tooltip title="Search using Invoice No,Supp Name">
|
||||||
<div className="formSearch" style={{ Width: '200px' }}>
|
<div className="formSearch" style={{ Width: '200px' }}>
|
||||||
<Search
|
<Search
|
||||||
placeholder="Search by Invoice No"
|
placeholder="Search by Invoice No"
|
||||||
|
|
@ -1393,7 +1388,9 @@ const StockList = () => {
|
||||||
generateQRCodeCopy={(code) =>
|
generateQRCodeCopy={(code) =>
|
||||||
generateQRCodeCopy(QrandbarcodeDatas, code)
|
generateQRCodeCopy(QrandbarcodeDatas, code)
|
||||||
}
|
}
|
||||||
generateCodeImage={(code, codeType = 'Q') => generateCodeImage(code, codeType, QrandbarcodeDatas)}
|
generateCodeImage={(code, codeType = 'Q') =>
|
||||||
|
generateCodeImage(code, codeType, QrandbarcodeDatas)
|
||||||
|
}
|
||||||
imageTagBarcodeAndQR={imageTagBarcodeAndQR}
|
imageTagBarcodeAndQR={imageTagBarcodeAndQR}
|
||||||
dropdownValue={dropdownValue}
|
dropdownValue={dropdownValue}
|
||||||
barcodeTemplateDetails={barcodeTemplateDetails}
|
barcodeTemplateDetails={barcodeTemplateDetails}
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ const KitechenFinishform = ({ formType }) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Proddatas();
|
Proddatas();
|
||||||
dispatch(changeBreadCrumb({ items: items }));
|
dispatch(changeBreadCrumb({ items: items }));
|
||||||
getPreference()
|
getPreference();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const Empchanges = async (e) => {
|
const Empchanges = async (e) => {
|
||||||
|
|
@ -982,12 +982,16 @@ const KitechenFinishform = ({ formType }) => {
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
|
(setting) =>
|
||||||
|
setting?.SettingIdName?.toLowerCase() === 'decimal' &&
|
||||||
|
setting?.SettingValue === 'Y'
|
||||||
|
);
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
setAllowDecimal(true)
|
setAllowDecimal(true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function safeRound(amountStr) {
|
function safeRound(amountStr) {
|
||||||
if (amountStr == null) return allowDecimal ? '0.00' : '0';
|
if (amountStr == null) return allowDecimal ? '0.00' : '0';
|
||||||
|
|
|
||||||
|
|
@ -275,3 +275,26 @@
|
||||||
color: #1292ee;
|
color: #1292ee;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.purchase-entry-fh {
|
||||||
|
@media (max-width: 600px) {
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formName {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
// .formHeader {
|
||||||
|
// width: -webkit-fill-available;
|
||||||
|
// }
|
||||||
|
|
||||||
|
.header-buttons {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
flex-direction: row;
|
||||||
|
width: 100%;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { Routes, Route, useNavigate } from 'react-router-dom';
|
import { Routes, Route, useNavigate } from 'react-router-dom';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch } from 'react-redux';
|
||||||
import {
|
import {
|
||||||
|
|
@ -29,20 +29,14 @@ const ProtectedRoutes = ({ routesConfig }) => {
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
const sessionId = getSession('SessionId');
|
const sessionId = getSession('SessionId');
|
||||||
const [accessCheckComplete, setAccessCheckComplete] = useState(false);
|
const [accessCheckComplete, setAccessCheckComplete] = useState(false);
|
||||||
const[AppPreference,setAppPreference]= useState([]);
|
|
||||||
const kioskPath = `${subDirectory}kiosksales`; // or your actual path
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getApplicationPreference()
|
getApplicationPreference();
|
||||||
},[])
|
}, []);
|
||||||
|
|
||||||
const getApplicationPreference = async () => {
|
const getApplicationPreference = async () => {
|
||||||
|
await dispatch(getCommonAppPreference(AppId)).unwrap();
|
||||||
const response = await dispatch(getCommonAppPreference(AppId)).unwrap();
|
};
|
||||||
if (response?.data?.statusCode === 1) {
|
|
||||||
setAppPreference(response?.data?.data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const getEmpAccess = async () => {
|
const getEmpAccess = async () => {
|
||||||
let data = {
|
let data = {
|
||||||
|
|
@ -90,7 +84,7 @@ const ProtectedRoutes = ({ routesConfig }) => {
|
||||||
?.SettingDtlDetails?.some(
|
?.SettingDtlDetails?.some(
|
||||||
(e) => e.SettingIdName === 'Estimation' && e.SettingValue === 'Y'
|
(e) => e.SettingIdName === 'Estimation' && e.SettingValue === 'Y'
|
||||||
);
|
);
|
||||||
return SettingValueData, EstimateValueData;
|
return (SettingValueData, EstimateValueData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -123,10 +117,10 @@ const ProtectedRoutes = ({ routesConfig }) => {
|
||||||
const hasAdvance = pricingData?.some(
|
const hasAdvance = pricingData?.some(
|
||||||
(item) => item.PricingName === 'Premium'
|
(item) => item.PricingName === 'Premium'
|
||||||
);
|
);
|
||||||
console.log(pricingData,"pricingDatapricingData")
|
|
||||||
const hasProOrAdvance =
|
const hasProOrAdvance =
|
||||||
hasAdvance || pricingData.some((item) => item.PricingName === 'Customized');
|
hasAdvance ||
|
||||||
return hasAdvance, hasProOrAdvance;
|
pricingData.some((item) => item.PricingName === 'Customized');
|
||||||
|
return (hasAdvance, hasProOrAdvance);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching pricing name:', error);
|
console.error('Error fetching pricing name:', error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -168,6 +168,7 @@
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
row-gap: 0.5rem;
|
row-gap: 0.5rem;
|
||||||
gap: 2rem;
|
gap: 2rem;
|
||||||
|
padding-bottom: 4px;
|
||||||
// flex-wrap: wrap;
|
// flex-wrap: wrap;
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
@ -458,3 +459,8 @@
|
||||||
background-color: #2c88ee1c !important;
|
background-color: #2c88ee1c !important;
|
||||||
font-weight: unset;
|
font-weight: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.ant-table-thead tr {
|
||||||
|
background-color: #2c88ee !important;
|
||||||
|
}
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-family: 'Poppins', sans-serif;
|
font-family: "Poppins", sans-serif;
|
||||||
float: right;
|
float: right;
|
||||||
background-color: #000;
|
background-color: #000;
|
||||||
font-size: x-small;
|
font-size: x-small;
|
||||||
|
|
@ -178,6 +178,9 @@
|
||||||
height: 70vh;
|
height: 70vh;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
|
.ant-table-thead tr {
|
||||||
|
background-color: #2c88ee !important;
|
||||||
|
}
|
||||||
|
|
||||||
.ant-table-cell {
|
.ant-table-cell {
|
||||||
padding: 8px 8px !important;
|
padding: 8px 8px !important;
|
||||||
|
|
@ -191,7 +194,7 @@
|
||||||
background-color: #fafafa;
|
background-color: #fafafa;
|
||||||
}
|
}
|
||||||
.ant-table-content {
|
.ant-table-content {
|
||||||
font-family: 'Poppins';
|
font-family: "Poppins";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -208,7 +211,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.bsreprintmodaltable-search input {
|
.bsreprintmodaltable-search input {
|
||||||
font-family: 'Poppins';
|
font-family: "Poppins";
|
||||||
width: 250px;
|
width: 250px;
|
||||||
padding: 4px 14px;
|
padding: 4px 14px;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
.receipt-reprint {
|
.receipt-reprint {
|
||||||
|
font-family: "Poppins";
|
||||||
font-family: 'Poppins';
|
|
||||||
|
|
||||||
.ant-table {
|
.ant-table {
|
||||||
font-family: 'Poppins', sans-serif !important;
|
font-family: "Poppins", sans-serif !important;
|
||||||
font-weight: 400 !important;
|
font-weight: 400 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -17,6 +16,9 @@
|
||||||
|
|
||||||
.receipt-reprint-body {
|
.receipt-reprint-body {
|
||||||
height: 70vh;
|
height: 70vh;
|
||||||
|
.ant-table-thead tr {
|
||||||
|
background-color: #2c88ee !important;
|
||||||
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
tbody {
|
tbody {
|
||||||
|
|
@ -38,29 +40,23 @@
|
||||||
|
|
||||||
.search-input {
|
.search-input {
|
||||||
width: 280px !important;
|
width: 280px !important;
|
||||||
padding: 4px 12px;
|
padding: 5px 12px;
|
||||||
border: 1px solid rgb(204, 204, 204) !important;
|
border: 1px solid rgb(204, 204, 204) !important;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
outline: none;
|
outline: none;
|
||||||
transition: 0.2s;
|
transition: 0.2s;
|
||||||
font-family: 'Poppins';
|
font-family: "Poppins";
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
border: 1px solid #1677ff !important;
|
border: 1px solid #1677ff !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.reprint-reason-header {
|
.reprint-reason-header {
|
||||||
font-size: 3rem !important;
|
font-size: 3rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@media (max-width: 567px) {
|
@media (max-width: 567px) {
|
||||||
.search-input {
|
.search-input {
|
||||||
width: unset !important;
|
width: unset !important;
|
||||||
|
|
@ -73,20 +69,18 @@
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.reprint-reason-modal {
|
.reprint-reason-modal {
|
||||||
font-family: 'Poppins' !important;
|
font-family: "Poppins" !important;
|
||||||
|
|
||||||
.ant-table-cell {
|
.ant-table-cell {
|
||||||
font-weight: 400 !important;
|
font-weight: 400 !important;
|
||||||
font-family: 'Poppins' !important;
|
font-family: "Poppins" !important;
|
||||||
font-size: 14px !important;
|
font-size: 14px !important;
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
font-family: 'Poppins' !important;
|
font-family: "Poppins" !important;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,10 +90,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.original-duplicate-switch {
|
.original-duplicate-switch {
|
||||||
|
|
||||||
.ant-switch-inner-checked,
|
.ant-switch-inner-checked,
|
||||||
.ant-switch-inner-unchecked {
|
.ant-switch-inner-unchecked {
|
||||||
font-family: 'Poppins';
|
font-family: "Poppins";
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -118,7 +111,6 @@
|
||||||
.ant-select-arrow {
|
.ant-select-arrow {
|
||||||
top: 75%;
|
top: 75%;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-icons-reprint {
|
.action-icons-reprint {
|
||||||
|
|
@ -151,12 +143,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-email {
|
.icon-email {
|
||||||
|
|
||||||
background-color: #f59e0b;
|
background-color: #f59e0b;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-whatsapp {
|
.icon-whatsapp {
|
||||||
|
|
||||||
background-color: #076e26ff;
|
background-color: #076e26ff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -13,7 +13,6 @@ input::-webkit-inner-spin-button {
|
||||||
.Dinein-Form-Structure {
|
.Dinein-Form-Structure {
|
||||||
width: 80vw;
|
width: 80vw;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 0rem 2rem;
|
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
}
|
}
|
||||||
.Dinein-Form {
|
.Dinein-Form {
|
||||||
|
|
@ -21,7 +20,8 @@ input::-webkit-inner-spin-button {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
padding-top: 2rem;
|
padding-top: 2rem;
|
||||||
gap: 1rem;
|
gap: 0;
|
||||||
|
column-gap: 1rem;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.required:after {
|
.required:after {
|
||||||
content: ' *';
|
content: " *";
|
||||||
color: #ff4d4f;
|
color: #ff4d4f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,7 +96,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.image-preview__content {
|
.image-preview__content {
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
margin: 1rem;
|
margin: 1rem;
|
||||||
|
|
@ -144,8 +143,6 @@
|
||||||
&:active {
|
&:active {
|
||||||
background-color: #5e5e5e;
|
background-color: #5e5e5e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.padding-less-modal {
|
.padding-less-modal {
|
||||||
|
|
@ -153,3 +150,17 @@
|
||||||
padding: 34px !important;
|
padding: 34px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.StocklistsearchAddDiv {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1rem;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stockAdjustListMaster {
|
||||||
|
.primary_Button {
|
||||||
|
width: max-content !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
.productListBrowseImageButton2 {
|
.productListBrowseImageButton2 {
|
||||||
width: 65px;
|
width: 65px;
|
||||||
background-color: #dbd1d1;
|
background-color: #dbd1d1;
|
||||||
border: 0.5px solid gray;
|
border: 0.5px solid #808080;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
|
|
||||||
.samplereportTableButton {
|
.samplereportTableButton {
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
margin: 1rem 0;
|
margin: 10px 0;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -754,6 +754,7 @@
|
||||||
.StorekitchenlistTable {
|
.StorekitchenlistTable {
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
padding-right: 8px;
|
padding-right: 8px;
|
||||||
|
margin-top: 10px;
|
||||||
|
|
||||||
@media (max-width: 600px) {
|
@media (max-width: 600px) {
|
||||||
}
|
}
|
||||||
|
|
@ -1538,6 +1539,9 @@ table {
|
||||||
padding: 3px 14px 4px 11px !important;
|
padding: 3px 14px 4px 11px !important;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.ant-table-thead tr {
|
||||||
|
background-color: #2c88ee !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.PriChangeUpper {
|
.PriChangeUpper {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -1561,3 +1565,44 @@ table {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pruchaseCatBTN {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 7px;
|
||||||
|
padding: 8px 16px;
|
||||||
|
background-color: #0bad77;
|
||||||
|
border-radius: 7px;
|
||||||
|
color: white;
|
||||||
|
cursor: pointer;
|
||||||
|
font-family: "Poppins";
|
||||||
|
font-weight: 400;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 13.5px;
|
||||||
|
transition: all 0.2s;
|
||||||
|
&:hover {
|
||||||
|
background-color: #069666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.scan-receipt-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 7px;
|
||||||
|
padding: 8px 16px;
|
||||||
|
background-color: #1292ee;
|
||||||
|
border-radius: 7px;
|
||||||
|
color: white;
|
||||||
|
cursor: pointer;
|
||||||
|
font-family: "Poppins";
|
||||||
|
font-weight: 400;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 13.5px;
|
||||||
|
transition: all 0.2s;
|
||||||
|
&:hover {
|
||||||
|
background-color: #0985be;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.CustomerForm-Master {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
.productinputForm {
|
.productinputForm {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
gap: 6px;
|
||||||
|
|
||||||
& .field-DropDown {
|
& .field-DropDown {
|
||||||
width: 200px !important;
|
width: 200px !important;
|
||||||
|
|
@ -124,6 +125,24 @@
|
||||||
left: 2px;
|
left: 2px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.ProSubRowFlex {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: 1.5rem;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.ant-form-item,
|
||||||
|
.float-label {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-form-item-explain-error {
|
||||||
|
position: relative;
|
||||||
|
top: 16px;
|
||||||
|
left: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.scannerdiv {
|
.scannerdiv {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -469,10 +488,12 @@
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
|
flex-direction: row !important;
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -488,7 +509,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.productFormproductImg {
|
.productFormproductImg {
|
||||||
width: 350px;
|
width: 250px;
|
||||||
|
height: 190px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -510,3 +532,13 @@
|
||||||
bottom: 8px;
|
bottom: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ProductMainRowFlex {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 1rem;
|
||||||
|
width: 100%;
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,9 @@
|
||||||
overflow: auto !important;
|
overflow: auto !important;
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
}
|
}
|
||||||
|
.ant-table-thead tr {
|
||||||
|
background-color: #2c88ee !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.purchaseQuoaDetails {
|
.purchaseQuoaDetails {
|
||||||
|
|
@ -102,7 +105,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.Quotation-table {
|
.Quotation-table {
|
||||||
|
|
||||||
// width: 70px;
|
// width: 70px;
|
||||||
.ant-table table {
|
.ant-table table {
|
||||||
border-spacing: 0px;
|
border-spacing: 0px;
|
||||||
|
|
@ -122,7 +124,7 @@
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-family: 'Poppins', sans-serif;
|
font-family: "Poppins", sans-serif;
|
||||||
padding: 6px 12px;
|
padding: 6px 12px;
|
||||||
border: 1px solid #d1d1d1;
|
border: 1px solid #d1d1d1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@
|
||||||
background-color: var(--PRIMARY_BUTTON_BG_COLOR) !important;
|
background-color: var(--PRIMARY_BUTTON_BG_COLOR) !important;
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-family: 'Gilroy';
|
font-family: "Gilroy";
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
@ -436,51 +436,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @media screen and (max-width: 620px) {
|
|
||||||
// .ItemWiseReport-table{
|
|
||||||
// height: 41vh !important;
|
|
||||||
// }
|
|
||||||
// .ItemWiseReport-dateaAnd-buttons{
|
|
||||||
// display: flex;
|
|
||||||
// flex-direction: column;
|
|
||||||
// column-gap: 0.5rem;
|
|
||||||
// row-gap: 0.5rem;
|
|
||||||
// // align-items: center;
|
|
||||||
// flex-wrap: wrap;
|
|
||||||
// }
|
|
||||||
// .ItemWiseReport-Date-picker {
|
|
||||||
// display: flex;
|
|
||||||
// // flex-wrap: wrap;
|
|
||||||
|
|
||||||
// column-gap: 0.3rem;
|
|
||||||
// row-gap: 0rem;
|
|
||||||
// }
|
|
||||||
// .dropdownUserid{
|
|
||||||
// .ant-select-single:not(.ant-select-customize-input) .ant-select-selector
|
|
||||||
// {
|
|
||||||
// width: 10rem;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// .ItemWiseReport-netAmount {
|
|
||||||
// display: flex;
|
|
||||||
// justify-content: flex-start;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
// @media only screen and (min-width: 450px) and (max-width: 640px){
|
|
||||||
// .ItemWiseReport-table{
|
|
||||||
// width: 500px;
|
|
||||||
|
|
||||||
// }
|
|
||||||
// .ItemWiseReport-dateaAnd-buttons{
|
|
||||||
// display: flex;
|
|
||||||
// column-gap: 1rem;
|
|
||||||
// row-gap: 1rem;
|
|
||||||
// align-items: center;
|
|
||||||
// flex-wrap: wrap;
|
|
||||||
// justify-content: space-between;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
.ItemWiseReport-table .ant-table-thead th.ant-table-column-has-sorters:hover {
|
.ItemWiseReport-table .ant-table-thead th.ant-table-column-has-sorters:hover {
|
||||||
background-color: #bad4f9;
|
background-color: #bad4f9;
|
||||||
}
|
}
|
||||||
|
|
@ -585,29 +540,107 @@
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
// .ItemWiseReport-table {
|
.custom-table {
|
||||||
// overflow-y: auto;
|
width: 100%;
|
||||||
// scrollbar-width: unset;
|
border-collapse: collapse;
|
||||||
// scrollbar-color: #c1c1c1 transparent;
|
border: 1px solid #909090;
|
||||||
// }
|
font-family: "Poppins", sans-serif;
|
||||||
|
|
||||||
// .ItemWiseReport-table::-webkit-scrollbar {
|
> thead {
|
||||||
// width: 25px;
|
position: sticky;
|
||||||
// }
|
top: -1px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// .ItemWiseReport-table::-webkit-scrollbar-track {
|
.custom-table th {
|
||||||
// background: #f0f0f0;
|
background-color: #a4c5f4;
|
||||||
// border-radius: 10px;
|
color: #1e1e1e;
|
||||||
// }
|
padding: 6px;
|
||||||
|
text-align: left;
|
||||||
|
border: 1px solid #909090;
|
||||||
|
-webkit-text-stroke-width: 0.2px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
font-family: VAR(--HEADING_FONT_FAMILY);
|
||||||
|
// text-transform: uppercase;
|
||||||
|
text-transform: capitalize;
|
||||||
|
letter-spacing: 0.2px;
|
||||||
|
}
|
||||||
|
|
||||||
// .ItemWiseReport-table::-webkit-scrollbar-thumb {
|
.centerDivList {
|
||||||
// background-color: #c1c1c1;
|
display: flex;
|
||||||
// border-radius: 10px;
|
flex-direction: column;
|
||||||
// border: 6px solid transparent;
|
gap: 4px;
|
||||||
// background-clip: content-box;
|
// width: 100%;
|
||||||
// transition: background-color 0.3s ease;
|
// height: 43vh;
|
||||||
// }
|
overflow: scroll;
|
||||||
|
padding-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
// .ItemWiseReport-table::-webkit-scrollbar-thumb:hover {
|
.custom-table td {
|
||||||
// background-color: #a0a0a0;
|
padding: 4px 6px;
|
||||||
// }
|
border: 1px solid #909090;
|
||||||
|
text-align: left;
|
||||||
|
font-size: 12px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table tbody tr td {
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
.ant-select.ant-select-in-form-item {
|
||||||
|
width: 190px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table tbody tr td[colspan="7"] {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table tbody tr.additionalCharges-selected {
|
||||||
|
background-color: #dddddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table tbody tr.setAsDefault-selected {
|
||||||
|
background-color: #cceaf0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table {
|
||||||
|
.ant-form-item {
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-label {
|
||||||
|
margin-bottom: 8px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ChargesAddAndCancel {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 5px 10px;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 600 !important;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
> div:nth-child(1) {
|
||||||
|
background-color: #28aa3a;
|
||||||
|
}
|
||||||
|
|
||||||
|
> div:nth-child(2) {
|
||||||
|
background-color: #ff0000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table {
|
||||||
|
Button:disabled,
|
||||||
|
Button[disabled] {
|
||||||
|
width: unset !important;
|
||||||
|
height: unset !important;
|
||||||
|
border-radius: 50px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -833,9 +833,36 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 500px) {
|
@media (max-width: 500px) {
|
||||||
|
|
||||||
.tdProductrecipt,
|
.tdProductrecipt,
|
||||||
.proReceiptTD {
|
.proReceiptTD {
|
||||||
font-size: 12px !important;
|
font-size: 12px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.div-flex{
|
||||||
|
padding-bottom: 18px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.div-flex {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
background-color: rgb(218, 218, 218);
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 4px 4px 8px 4px;
|
||||||
|
|
||||||
|
.ant-form-item {
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 400px) {
|
||||||
|
.div-flex {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding-bottom: 8px !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -101,11 +101,6 @@ a {
|
||||||
background: #999999;
|
background: #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle on hover */
|
|
||||||
::-webkit-scrollbar-thumb:hover {
|
|
||||||
/* background: #8F1E78; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.samplereportTable {
|
.samplereportTable {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
width: 80vw;
|
width: 80vw;
|
||||||
|
|
@ -178,8 +173,6 @@ a {
|
||||||
/* Position the tooltip */
|
/* Position the tooltip */
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar-top {
|
.navbar-top {
|
||||||
|
|
@ -331,3 +324,7 @@ a {
|
||||||
.ant-table table {
|
.ant-table table {
|
||||||
border-spacing: 0 0 !important;
|
border-spacing: 0 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ant-table-tbody .ant-table-cell {
|
||||||
|
font-family: 'Poppins' !important;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import React from 'react';
|
|
||||||
import ReactDOM from 'react-dom/client';
|
import ReactDOM from 'react-dom/client';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { BrowserRouter } from 'react-router-dom';
|
import { BrowserRouter } from 'react-router-dom';
|
||||||
|
|
@ -7,23 +6,20 @@ import './Fonts/Gilroy/stylesheet.css';
|
||||||
import './index.css';
|
import './index.css';
|
||||||
import AppRoutes from './App.jsx';
|
import AppRoutes from './App.jsx';
|
||||||
import { AuthProvider } from './AuthContext';
|
import { AuthProvider } from './AuthContext';
|
||||||
import GlobalErrorHandler from './GlobalErrorHandler';
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||||
import {QueryClient, QueryClientProvider,} from '@tanstack/react-query';
|
|
||||||
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById('root')).render(
|
ReactDOM.createRoot(document.getElementById('root')).render(
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
|
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<AuthProvider>
|
<AuthProvider>
|
||||||
<AppRoutes />
|
<AppRoutes />
|
||||||
|
|
||||||
</AuthProvider>
|
</AuthProvider>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</Provider>
|
</Provider>
|
||||||
{process.env.NODE_ENV == "development" && (
|
{process.env.NODE_ENV == 'development' && (
|
||||||
<ReactQueryDevtools initialIsOpen={false} />
|
<ReactQueryDevtools initialIsOpen={false} />
|
||||||
)}
|
)}
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
|
|
|
||||||
|
|
@ -1,209 +1,673 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import AppPage from './Pages/AppPage/AppPage.jsx';
|
import { lazy } from 'react';
|
||||||
import WholesaleAppPage from './Pages/AppPage/WholesaleAppPage.jsx';
|
const CommonMaster = lazy(
|
||||||
import Home from './Pages/DashBoard/RetailDashboard.jsx';
|
() => import('./Pages/CommonMaster/CommonMaster.jsx')
|
||||||
import CommonMaster from './Pages/CommonMaster/CommonMaster.jsx';
|
);
|
||||||
import ConfigType from './Pages/ConfigType/ConfigTypeForm.jsx';
|
const ConfigType = lazy(() => import('./Pages/ConfigType/ConfigTypeForm.jsx'));
|
||||||
import AdminTax from './Pages/AdminTax/AdminTaxForm.jsx';
|
const AdminTax = lazy(() => import('./Pages/AdminTax/AdminTaxForm.jsx'));
|
||||||
import ProductForm from './Pages/Product/ProductForm.jsx';
|
const ProductForm = lazy(() => import('./Pages/Product/ProductForm.jsx'));
|
||||||
import Sport_ProductForm from './Pages/Product/SportsMaster.jsx';
|
const Sport_ProductForm = lazy(
|
||||||
import ProductList from './Pages/Product/ProductList.jsx';
|
() => import('./Pages/Product/SportsMaster.jsx')
|
||||||
import ShiftMasterList from './Pages/ShiftMaster/ShiftMasterList.jsx';
|
);
|
||||||
import ShiftMasterForm from './Pages/ShiftMaster/ShiftMasterForm.jsx';
|
const ShiftMasterList = lazy(
|
||||||
import EmployeeMasterList from './Pages/EmpMaster/EmpMasterList.jsx';
|
() => import('./Pages/ShiftMaster/ShiftMasterList.jsx')
|
||||||
import EmployeeMasterForm from './Pages/EmpMaster/EmpMasterForm.jsx';
|
);
|
||||||
import SupplierMasterList from './Pages/SupplierMaster/SupplierMasterList.jsx';
|
const ShiftMasterForm = lazy(
|
||||||
import SupplierMasterForm from './Pages/SupplierMaster/SupplierMasterForm.jsx';
|
() => import('./Pages/ShiftMaster/ShiftMasterForm.jsx')
|
||||||
import ComponentMasterForm from './Pages/UiComponentPage/ComponentForm.jsx';
|
);
|
||||||
import ComponentMasterList from './Pages/UiComponentPage/ComponentList.jsx';
|
const EmployeeMasterList = lazy(
|
||||||
import CustomerForm from './Pages/CustomerMaster/CustMasterForm.jsx';
|
() => import('./Pages/EmpMaster/EmpMasterList.jsx')
|
||||||
import CustomerMasterList from './Pages/CustomerMaster/CustMasterList.jsx';
|
);
|
||||||
import DateWiseReport from './Pages/Reports/DateWiseReport/DateWiseReport.jsx';
|
const EmployeeMasterForm = lazy(
|
||||||
import ItemWiseReport from './Pages/Reports/ItemWiseReport/ItemWiseReport.jsx';
|
() => import('./Pages/EmpMaster/EmpMasterForm.jsx')
|
||||||
import Reprint from './Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx';
|
);
|
||||||
import BookingSelectionPage from './Pages/BookingScreen/Components/MainPage/MainPage.jsx';
|
|
||||||
import PrintSelectionPage from './Pages/BookingScreen/Components/PrintMainPage/MainPage.jsx';
|
|
||||||
import KioskMainPage from './Pages/BookingScreen/Components/Kiosk/KioskMainPage.jsx';
|
|
||||||
import BookingPage from './Pages/BookingScreen/BookingPage.jsx';
|
|
||||||
import StockForm from './Pages/StockMaster/StockForm.jsx';
|
|
||||||
import StockList from './Pages/StockMaster/StockList.jsx';
|
|
||||||
import DiningMasterList from './Pages/Dining/DiningList.jsx';
|
|
||||||
import DiningMasterForm from './Pages/Dining/DiningForm.jsx';
|
|
||||||
import TableBooking from './Pages/Tablebooking/TableBooking.jsx';
|
|
||||||
import ComboMaster from './Pages/ComboPack/ComboMaster.jsx';
|
|
||||||
import ComboList from './Pages/ComboPack/ComboMasterlist.jsx';
|
|
||||||
import EmpAccessForm from './Pages/EmpAccess/EmpAccessForm.jsx';
|
|
||||||
import EmpAccessList from './Pages/EmpAccess/EmpAccessList.jsx';
|
|
||||||
import EmpScreenAccessList from './Pages/EmpScreenAccess/EmpScreenAccessList.jsx';
|
|
||||||
import EmpScreenRightsAccess from './Pages/EmpScreenAccess/EmpScreenRightsAccess.jsx';
|
|
||||||
import PreferenceList from './Pages/Preference/PreferenceList.jsx';
|
|
||||||
import PaymentOptions from './Pages/Payment/PaymentOptions/PaymentOptions.jsx';
|
|
||||||
import PaymentDetails from './Pages/Payment/PaymentDetails/PaymentDetailsForm.jsx';
|
|
||||||
import PaymentDetailsList from './Pages/Payment/PaymentDetails/PaymentDetailsList.jsx';
|
|
||||||
import PaymentReceivedRetail from './Pages/Payment/PaymentReceivedRetail/PaymentReceivedRetail.jsx';
|
|
||||||
import ExtraChargesList from './Pages/ExtraCharges/ExtraChargesList.jsx';
|
|
||||||
import BranchLogin from './Pages/BranchLogin/BranchLogin.jsx';
|
|
||||||
import BackToBranchLogin from './Pages/BranchLogin/BackToBranchLogin.jsx';
|
|
||||||
import Logout from './Pages/Logout.jsx';
|
|
||||||
import BacktoLogin from './Pages/BranchLogin/BacktoLogin.jsx';
|
|
||||||
import StockPriceUpdate from './Pages/StockPriceUpdate/StockPriceUpdate.jsx';
|
|
||||||
import ProductCatalogueList from './Pages/ProductCatlogue/ProductcatlogueList.jsx';
|
|
||||||
import KOT from './Pages/Reports/KOT/kot.jsx';
|
|
||||||
import CustomerKOTDisplay from './Pages/Reports/KOT/CustomerKOTDisplay.jsx';
|
|
||||||
import RedirectApps from './Pages/RedirectApps.jsx';
|
|
||||||
import WSTransaction from './Pages/WholeSaleTransaction/WSSalesTransaction.jsx';
|
|
||||||
import LedgerReport from './Pages/Reports/LedgerReport/LedgerReport.jsx';
|
|
||||||
import PaymentDetailsPage from './Pages/BookingScreen/Components/BookingFunctionality/PaymentDetailsPage.jsx';
|
|
||||||
import CreditCustomerPrint from './Pages/BookingScreen/Components/BookingFunctionality/CreditDownloadpage.jsx';
|
|
||||||
import Cancellation from './Pages/CancelReschedule/Cancellation.jsx';
|
|
||||||
import ChangePaymentmode from './Pages/CancelReschedule/ChangePaymentmode.jsx';
|
|
||||||
import CancellationList from './Pages/CancelReschedule/CancellationList.jsx';
|
|
||||||
import CancelApplicableProd from './Pages/CancelReschedule/CancelApplicableProd.jsx';
|
|
||||||
import CancellationListPending from './Pages/CancelReschedule/CancelPendingPayment.jsx';
|
|
||||||
import AndroidApp from './Pages/AndroidApp/AndroidApp.jsx';
|
|
||||||
import EstimateItemWiseReport from './Pages/Reports/Estimate/EstimateItemWiseReport.jsx';
|
|
||||||
import EstimateDateWiseReport from './Pages/Reports/Estimate/EstimateDateWiseReport.jsx';
|
|
||||||
import OfferForm from './Pages/Offer/Offer/OfferFormNew.jsx';
|
|
||||||
import OfferList from './Pages/Offer/Offer/OfferListNew.jsx';
|
|
||||||
import ItemWise from './Pages/Offer/ItemOffer/ItemWiseForm.jsx';
|
|
||||||
import SalesWiseForm from './Pages/Offer/SalesOffer/SalesWiseForm.jsx';
|
|
||||||
import SalesWiseList from './Pages/Offer/SalesOffer/SalesWiseList.jsx';
|
|
||||||
import QuantityWise from './Pages/Offer/QuantityOffer/QuantityWiseForm.jsx';
|
|
||||||
import BuyOneGetOneForm from './Pages/Offer/BuyOneGetOneOffer/BuyOneGetOneForm.jsx';
|
|
||||||
// import LoyaltyPointsForm from "./Pages/Offer/LoyaltyPoints/LoyaltyPointsForm.jsx";
|
|
||||||
import LoyaltyPointsList from './Pages/Offer/LoyaltyPoints/LoyaltyPointsList.jsx';
|
|
||||||
import BundleOfferForm from './Pages/Offer/BundleOffer/BundleOfferForm.jsx';
|
|
||||||
import BundleOfferList from './Pages/Offer/BundleOffer/BundleOfferList.jsx';
|
|
||||||
// import CouponWiseOffer from "./Pages/Offer/CouponOffer/CouponWiseOfferForm.jsx"
|
|
||||||
import CouponWiseOfferlist from './Pages/Offer/CouponOffer/CouponWiseOfferlist.jsx';
|
|
||||||
import PromocodeList from './Pages/Offer/PromoCode/PromocodeList.jsx';
|
|
||||||
// import PromocodeForm from "./Pages/Offer/PromoCode/PromocodeForm.jsx";
|
|
||||||
import OfferCodeList from './Pages/Offer/OfferCode/OfferCodeList.jsx';
|
|
||||||
// import OfferCodeForm from "./Pages/Offer/OfferCode/OfferCodeForm.jsx";
|
|
||||||
import PricingPage from './Pages/BookingScreen/Components/UtillComponents/PricingPage.jsx';
|
|
||||||
import PurchaseOrder from './Pages/PurchaseOrder/PurchaseOrder.jsx';
|
|
||||||
import PurchaseOrderMail from './Pages/PurchaseOrder/PurchaseOrderMail.jsx';
|
|
||||||
import PurchaseOrderList from './Pages/PurchaseOrder/PurchaseOrderList.jsx';
|
|
||||||
import StockReceivedList from './Pages/StockTransfer/StockReceivedList.jsx';
|
|
||||||
import GstInvoiceSetUpForm from './Pages/GstInvoiceSetup/GstInvoiceSetUpForm.jsx';
|
|
||||||
import gstInvoiceSetUpList from './Pages/GstInvoiceSetup/GstInvoiceSetupList.jsx';
|
|
||||||
import StockinHand from './Pages/StockinHand/StockinHand.jsx';
|
|
||||||
|
|
||||||
import PurchaseReturn from './Pages/PurchaseReturn/purchaseReturn.jsx';
|
const SupplierMasterList = lazy(
|
||||||
import PurchaseReturnget from './Pages/PurchaseReturn/PurchaseReturnGet.jsx';
|
() => import('./Pages/SupplierMaster/SupplierMasterList.jsx')
|
||||||
import KioskBookingPage from './Pages/Kiosk/KioskBookingPage.jsx';
|
);
|
||||||
import KioskBookingReceipt from './Pages/Kiosk/PaymentGateway/PaymentGatewayReceipt.jsx';
|
const SupplierMasterForm = lazy(
|
||||||
import KioskComponentList from './Pages/KioskComponent/KioskComponentList.jsx';
|
() => import('./Pages/SupplierMaster/SupplierMasterForm.jsx')
|
||||||
import CustomerDisplay from './Pages/CustomerDisplay/CustomerDisplay.jsx';
|
);
|
||||||
import PurchaseQuotationForm from './Pages/PurchaseQuotation/PurchaseQuotationForm.jsx';
|
|
||||||
import DeliveryChallanForm from './Pages/DeliveryChallan/Deliverychallan.jsx';
|
const ComponentMasterForm = lazy(
|
||||||
import DeliveryChallanList from './Pages/DeliveryChallan/DeliverychallanList.jsx';
|
() => import('./Pages/UiComponentPage/ComponentForm.jsx')
|
||||||
import ComboOfferMaster from './Pages/Offer/ComboOfferPack/ComboOfferForm.jsx';
|
);
|
||||||
import PaymentDeviceForm from './Pages/Payment/PaymentDevice/PaymentDeviceForm.jsx';
|
const ComponentMasterList = lazy(
|
||||||
import PaymentFailedDetailsList from './Pages/Payment/PaymentFailedDetails/PaymentFailedDetailsList.jsx';
|
() => import('./Pages/UiComponentPage/ComponentList.jsx')
|
||||||
import CounterCategoryMappingForm from './Pages/CounterCategoryMapping/CounterCategoryMappingForm.jsx';
|
);
|
||||||
import ImageBulkUpload from './Pages/ImageBulkUpload/ImageBulkUpload.jsx';
|
|
||||||
import WholesaleBookingPage from './Pages/PurchaseScreen/LayoutScreen8/LayoutScreen8.jsx';
|
const CustomerForm = lazy(
|
||||||
import WholeSaleProductList from './Pages/Wholesale/ProductList.jsx';
|
() => import('./Pages/CustomerMaster/CustMasterForm.jsx')
|
||||||
import ProductEntry from './Pages/Wholesale/ProductEntry.jsx';
|
);
|
||||||
import ProductEntryList from './Pages/Wholesale/ProductEntryList.jsx';
|
const CustomerMasterList = lazy(
|
||||||
import ItemEntry from './Pages/Wholesale/ItemEntry/ItemEntry.jsx';
|
() => import('./Pages/CustomerMaster/CustMasterList.jsx')
|
||||||
import WsPreorder from './Pages/Wholesalespreorder/WholesalePreorderList.jsx';
|
);
|
||||||
import WsPreorderForm from './Pages/Wholesalespreorder/WholesalePreorderForm.jsx';
|
|
||||||
import ExtraChrgesList from './Pages/Wholesale/ItemEntry/ExtraChrgesList.jsx';
|
const DateWiseReport = lazy(
|
||||||
import SalesBillCancel from './Pages/SalesRemoval/SalesBillCancelList.jsx';
|
() => import('./Pages/Reports/DateWiseReport/DateWiseReport.jsx')
|
||||||
import WholeSaleAbstract from './Pages/WholeSaleAbstract/WholeSaleAbstract.jsx';
|
);
|
||||||
import WholeSaleSellerAbstract from './Pages/WholeSaleAbstract/WholeSaleSellerAbstract.jsx';
|
|
||||||
import PaymentReceived from './Pages/WholeSaleTransaction/PaymentReceived.jsx';
|
const ItemWiseReport = lazy(
|
||||||
import WholeSaleSalesReport from './Pages/WholeSaleReport/WholeSalesSalesReport.jsx';
|
() => import('./Pages/Reports/ItemWiseReport/ItemWiseReport.jsx')
|
||||||
import WholeSalePurchaseReport from './Pages/WholeSaleReport/WholeSalePurchaseReport.jsx';
|
);
|
||||||
import WholeSalePaymentPurchaseReport from './Pages/WholesalePaymentReport/WholeSalePaymentPurchaseReport.jsx';
|
|
||||||
import WholeSalePaymentSalesReport from './Pages/WholesalePaymentReport/WholeSalePaymementSaleReport.jsx';
|
const Reprint = lazy(
|
||||||
import SpeechLanguagesList from './Pages/SpeechLanguages/SpeechLanguagesList.jsx';
|
() =>
|
||||||
import LegderList from './Pages/WholeSaleLedger/WholeSaleLedger.jsx';
|
import('./Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx')
|
||||||
import SellerMasterTran from './Pages/WholeSaleTransaction/SellerMasterTransaction.jsx';
|
);
|
||||||
import TicketForm from './Pages/Ticket/TicketForm.jsx';
|
|
||||||
import ThemeCreation from './Pages/BookingScreen/Components/ThemeCreation/ThemeList.jsx';
|
const BookingSelectionPage = lazy(
|
||||||
import ThemeSelection from './Pages/BookingScreen/Components/ThemeCreation/ThemePreview.jsx';
|
() => import('./Pages/BookingScreen/Components/MainPage/MainPage.jsx')
|
||||||
import BarcodeTemplateSetup from './Pages/BarcodeSetup/BarcodeTemplateSetup.jsx';
|
);
|
||||||
import BarcodeComponentList from './Pages/BarcodeComponent/BarcodeComponentList.jsx';
|
|
||||||
import StoreRecipelist from './Pages/StoreKitchen/StoreRecipe/StoreRecipelist.jsx';
|
const PrintSelectionPage = lazy(
|
||||||
import StoreRecipeform from './Pages/StoreKitchen/StoreRecipe/StoreRecipeform.jsx';
|
() => import('./Pages/BookingScreen/Components/PrintMainPage/MainPage.jsx')
|
||||||
import Storekitchenlist from './Pages/StoreKitchen/StoretoKitchen/StoretoKitchenlist.jsx';
|
);
|
||||||
import StoreKitchenform from './Pages/StoreKitchen/StoretoKitchen/Storetokitchenform.jsx';
|
const KioskMainPage = lazy(
|
||||||
import { axiosCommonInstanceData } from './Features/AuthenicationToken/AuthenticationToken';
|
() => import('./Pages/BookingScreen/Components/Kiosk/KioskMainPage.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const BookingPage = lazy(() => import('./Pages/BookingScreen/BookingPage.jsx'));
|
||||||
|
|
||||||
|
const StockForm = lazy(() => import('./Pages/StockMaster/StockForm.jsx'));
|
||||||
|
|
||||||
|
const StockList = lazy(() => import('./Pages/StockMaster/StockList.jsx'));
|
||||||
|
|
||||||
|
const DiningMasterList = lazy(() => import('./Pages/Dining/DiningList.jsx'));
|
||||||
|
|
||||||
|
const DiningMasterForm = lazy(() => import('./Pages/Dining/DiningForm.jsx'));
|
||||||
|
|
||||||
|
const TableBooking = lazy(
|
||||||
|
() => import('./Pages/Tablebooking/TableBooking.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const ComboMaster = lazy(() => import('./Pages/ComboPack/ComboMaster.jsx'));
|
||||||
|
|
||||||
|
const ComboList = lazy(() => import('./Pages/ComboPack/ComboMasterlist.jsx'));
|
||||||
|
const EmpAccessForm = lazy(() => import('./Pages/EmpAccess/EmpAccessForm.jsx'));
|
||||||
|
const EmpAccessList = lazy(() => import('./Pages/EmpAccess/EmpAccessList.jsx'));
|
||||||
|
|
||||||
|
const EmpScreenAccessList = lazy(
|
||||||
|
() => import('./Pages/EmpScreenAccess/EmpScreenAccessList.jsx')
|
||||||
|
);
|
||||||
|
const EmpScreenRightsAccess = lazy(
|
||||||
|
() => import('./Pages/EmpScreenAccess/EmpScreenRightsAccess.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const PreferenceList = lazy(
|
||||||
|
() => import('./Pages/Preference/PreferenceList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const PaymentOptions = lazy(
|
||||||
|
() => import('./Pages/Payment/PaymentOptions/PaymentOptions.jsx')
|
||||||
|
);
|
||||||
|
const PaymentDetails = lazy(
|
||||||
|
() => import('./Pages/Payment/PaymentDetails/PaymentDetailsForm.jsx')
|
||||||
|
);
|
||||||
|
const PaymentDetailsList = lazy(
|
||||||
|
() => import('./Pages/Payment/PaymentDetails/PaymentDetailsList.jsx')
|
||||||
|
);
|
||||||
|
const PaymentReceivedRetail = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/Payment/PaymentReceivedRetail/PaymentReceivedRetail.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const ExtraChargesList = lazy(
|
||||||
|
() => import('./Pages/ExtraCharges/ExtraChargesList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const BranchLogin = lazy(() => import('./Pages/BranchLogin/BranchLogin.jsx'));
|
||||||
|
const BackToBranchLogin = lazy(
|
||||||
|
() => import('./Pages/BranchLogin/BackToBranchLogin.jsx')
|
||||||
|
);
|
||||||
|
const Logout = lazy(() => import('./Pages/Logout.jsx'));
|
||||||
|
|
||||||
|
const BacktoLogin = lazy(() => import('./Pages/BranchLogin/BacktoLogin.jsx'));
|
||||||
|
|
||||||
|
const StockPriceUpdate = lazy(
|
||||||
|
() => import('./Pages/StockPriceUpdate/StockPriceUpdate.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const ProductCatalogueList = lazy(
|
||||||
|
() => import('./Pages/ProductCatlogue/ProductcatlogueList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const KOT = lazy(() => import('./Pages/Reports/KOT/kot.jsx'));
|
||||||
|
|
||||||
|
const CustomerKOTDisplay = lazy(
|
||||||
|
() => import('./Pages/Reports/KOT/CustomerKOTDisplay.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const RedirectApps = lazy(() => import('./Pages/RedirectApps.jsx'));
|
||||||
|
|
||||||
|
const WSTransaction = lazy(
|
||||||
|
() => import('./Pages/WholeSaleTransaction/WSSalesTransaction.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const LedgerReport = lazy(
|
||||||
|
() => import('./Pages/Reports/LedgerReport/LedgerReport.jsx')
|
||||||
|
);
|
||||||
|
const PaymentDetailsPage = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/BookingScreen/Components/BookingFunctionality/PaymentDetailsPage.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const CreditCustomerPrint = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/BookingScreen/Components/BookingFunctionality/CreditDownloadpage.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const Cancellation = lazy(
|
||||||
|
() => import('./Pages/CancelReschedule/Cancellation.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const ChangePaymentmode = lazy(
|
||||||
|
() => import('./Pages/CancelReschedule/ChangePaymentmode.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const CancellationList = lazy(
|
||||||
|
() => import('./Pages/CancelReschedule/CancellationList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const CancelApplicableProd = lazy(
|
||||||
|
() => import('./Pages/CancelReschedule/CancelApplicableProd.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const CancellationListPending = lazy(
|
||||||
|
() => import('./Pages/CancelReschedule/CancelPendingPayment.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const AndroidApp = lazy(() => import('./Pages/AndroidApp/AndroidApp.jsx'));
|
||||||
|
|
||||||
|
const EstimateItemWiseReport = lazy(
|
||||||
|
() => import('./Pages/Reports/Estimate/EstimateItemWiseReport.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const EstimateDateWiseReport = lazy(
|
||||||
|
() => import('./Pages/Reports/Estimate/EstimateDateWiseReport.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const OfferForm = lazy(() => import('./Pages/Offer/Offer/OfferFormNew.jsx'));
|
||||||
|
|
||||||
|
const OfferList = lazy(() => import('./Pages/Offer/Offer/OfferListNew.jsx'));
|
||||||
|
|
||||||
|
const ItemWise = lazy(() => import('./Pages/Offer/ItemOffer/ItemWiseForm.jsx'));
|
||||||
|
const SalesWiseForm = lazy(
|
||||||
|
() => import('./Pages/Offer/SalesOffer/SalesWiseForm.jsx')
|
||||||
|
);
|
||||||
|
const SalesWiseList = lazy(
|
||||||
|
() => import('./Pages/Offer/SalesOffer/SalesWiseList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const QuantityWise = lazy(
|
||||||
|
() => import('./Pages/Offer/QuantityOffer/QuantityWiseForm.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const BuyOneGetOneForm = lazy(
|
||||||
|
() => import('./Pages/Offer/BuyOneGetOneOffer/BuyOneGetOneForm.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const LoyaltyPointsList = lazy(
|
||||||
|
() => import('./Pages/Offer/LoyaltyPoints/LoyaltyPointsList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const BundleOfferForm = lazy(
|
||||||
|
() => import('./Pages/Offer/BundleOffer/BundleOfferForm.jsx')
|
||||||
|
);
|
||||||
|
const BundleOfferList = lazy(
|
||||||
|
() => import('./Pages/Offer/BundleOffer/BundleOfferList.jsx')
|
||||||
|
);
|
||||||
|
const CouponWiseOfferlist = lazy(
|
||||||
|
() => import('./Pages/Offer/CouponOffer/CouponWiseOfferlist.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const PromocodeList = lazy(
|
||||||
|
() => import('./Pages/Offer/PromoCode/PromocodeList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const OfferCodeList = lazy(
|
||||||
|
() => import('./Pages/Offer/OfferCode/OfferCodeList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const PricingPage = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/BookingScreen/Components/UtillComponents/PricingPage.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const PurchaseOrder = lazy(
|
||||||
|
() => import('./Pages/PurchaseOrder/PurchaseOrder.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const PurchaseOrderMail = lazy(
|
||||||
|
() => import('./Pages/PurchaseOrder/PurchaseOrderMail.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const PurchaseOrderList = lazy(
|
||||||
|
() => import('./Pages/PurchaseOrder/PurchaseOrderList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const StockReceivedList = lazy(
|
||||||
|
() => import('./Pages/StockTransfer/StockReceivedList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const GstInvoiceSetUpForm = lazy(
|
||||||
|
() => import('./Pages/GstInvoiceSetup/GstInvoiceSetUpForm.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const gstInvoiceSetUpList = lazy(
|
||||||
|
() => import('./Pages/GstInvoiceSetup/GstInvoiceSetupList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const StockinHand = lazy(() => import('./Pages/StockinHand/StockinHand.jsx'));
|
||||||
|
|
||||||
|
const PurchaseReturn = lazy(
|
||||||
|
() => import('./Pages/PurchaseReturn/purchaseReturn.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const PurchaseReturnget = lazy(
|
||||||
|
() => import('./Pages/PurchaseReturn/PurchaseReturnGet.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const KioskBookingPage = lazy(
|
||||||
|
() => import('./Pages/Kiosk/KioskBookingPage.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const KioskBookingReceipt = lazy(
|
||||||
|
() => import('./Pages/Kiosk/PaymentGateway/PaymentGatewayReceipt.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const KioskComponentList = lazy(
|
||||||
|
() => import('./Pages/KioskComponent/KioskComponentList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const CustomerDisplay = lazy(
|
||||||
|
() => import('./Pages/CustomerDisplay/CustomerDisplay.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const PurchaseQuotationForm = lazy(
|
||||||
|
() => import('./Pages/PurchaseQuotation/PurchaseQuotationForm.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const DeliveryChallanForm = lazy(
|
||||||
|
() => import('./Pages/DeliveryChallan/Deliverychallan.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const DeliveryChallanList = lazy(
|
||||||
|
() => import('./Pages/DeliveryChallan/DeliverychallanList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const ComboOfferMaster = lazy(
|
||||||
|
() => import('./Pages/Offer/ComboOfferPack/ComboOfferForm.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const PaymentDeviceForm = lazy(
|
||||||
|
() => import('./Pages/Payment/PaymentDevice/PaymentDeviceForm.jsx')
|
||||||
|
);
|
||||||
|
const PaymentFailedDetailsList = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/Payment/PaymentFailedDetails/PaymentFailedDetailsList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const CounterCategoryMappingForm = lazy(
|
||||||
|
() => import('./Pages/CounterCategoryMapping/CounterCategoryMappingForm.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const ImageBulkUpload = lazy(
|
||||||
|
() => import('./Pages/ImageBulkUpload/ImageBulkUpload.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const WholesaleBookingPage = lazy(
|
||||||
|
() => import('./Pages/PurchaseScreen/LayoutScreen8/LayoutScreen8.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const WholeSaleProductList = lazy(
|
||||||
|
() => import('./Pages/Wholesale/ProductList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const ProductEntry = lazy(() => import('./Pages/Wholesale/ProductEntry.jsx'));
|
||||||
|
|
||||||
|
const ProductEntryList = lazy(
|
||||||
|
() => import('./Pages/Wholesale/ProductEntryList.jsx')
|
||||||
|
);
|
||||||
|
const ItemEntry = lazy(
|
||||||
|
() => import('./Pages/Wholesale/ItemEntry/ItemEntry.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const WsPreorder = lazy(
|
||||||
|
() => import('./Pages/Wholesalespreorder/WholesalePreorderList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const WsPreorderForm = lazy(
|
||||||
|
() => import('./Pages/Wholesalespreorder/WholesalePreorderForm.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const ExtraChrgesList = lazy(
|
||||||
|
() => import('./Pages/Wholesale/ItemEntry/ExtraChrgesList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const SalesBillCancel = lazy(
|
||||||
|
() => import('./Pages/SalesRemoval/SalesBillCancelList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const WholeSaleAbstract = lazy(
|
||||||
|
() => import('./Pages/WholeSaleAbstract/WholeSaleAbstract.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const WholeSaleSellerAbstract = lazy(
|
||||||
|
() => import('./Pages/WholeSaleAbstract/WholeSaleSellerAbstract.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const PaymentReceived = lazy(
|
||||||
|
() => import('./Pages/WholeSaleTransaction/PaymentReceived.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const WholeSaleSalesReport = lazy(
|
||||||
|
() => import('./Pages/WholeSaleReport/WholeSalesSalesReport.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const WholeSalePurchaseReport = lazy(
|
||||||
|
() => import('./Pages/WholeSaleReport/WholeSalePurchaseReport.jsx')
|
||||||
|
);
|
||||||
|
const WholeSalePaymentPurchaseReport = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/WholesalePaymentReport/WholeSalePaymentPurchaseReport.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const WholeSalePaymentSalesReport = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/WholesalePaymentReport/WholeSalePaymementSaleReport.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const SpeechLanguagesList = lazy(
|
||||||
|
() => import('./Pages/SpeechLanguages/SpeechLanguagesList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const LegderList = lazy(
|
||||||
|
() => import('./Pages/WholeSaleLedger/WholeSaleLedger.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const SellerMasterTran = lazy(
|
||||||
|
() => import('./Pages/WholeSaleTransaction/SellerMasterTransaction.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const TicketForm = lazy(() => import('./Pages/Ticket/TicketForm.jsx'));
|
||||||
|
|
||||||
|
const ThemeCreation = lazy(
|
||||||
|
() => import('./Pages/BookingScreen/Components/ThemeCreation/ThemeList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const ThemeSelection = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/BookingScreen/Components/ThemeCreation/ThemePreview.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const BarcodeTemplateSetup = lazy(
|
||||||
|
() => import('./Pages/BarcodeSetup/BarcodeTemplateSetup.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const BarcodeComponentList = lazy(
|
||||||
|
() => import('./Pages/BarcodeComponent/BarcodeComponentList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const StoreRecipelist = lazy(
|
||||||
|
() => import('./Pages/StoreKitchen/StoreRecipe/StoreRecipelist.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const StoreRecipeform = lazy(
|
||||||
|
() => import('./Pages/StoreKitchen/StoreRecipe/StoreRecipeform.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const Storekitchenlist = lazy(
|
||||||
|
() => import('./Pages/StoreKitchen/StoretoKitchen/StoretoKitchenlist.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const StoreKitchenform = lazy(
|
||||||
|
() => import('./Pages/StoreKitchen/StoretoKitchen/Storetokitchenform.jsx')
|
||||||
|
);
|
||||||
import { getSession, sessionStore } from './Services/Others';
|
import { getSession, sessionStore } from './Services/Others';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import KitchenFinishlist from './Pages/StoreKitchen/StoreKitchenFinish/KitchenFinishlist.jsx';
|
const KitchenFinishlist = lazy(
|
||||||
import KitechenFinishform from './Pages/StoreKitchen/StoreKitchenFinish/KitechenFinishform.jsx';
|
() => import('./Pages/StoreKitchen/StoreKitchenFinish/KitchenFinishlist.jsx')
|
||||||
|
);
|
||||||
|
const KitechenFinishform = lazy(
|
||||||
|
() => import('./Pages/StoreKitchen/StoreKitchenFinish/KitechenFinishform.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
import FreeProductList from './Pages/FreeProducts/FreeProduct/FreeProductList.jsx';
|
const FreeProductList = lazy(
|
||||||
import FreePurchaseEnteryForm from './Pages/FreeProducts/FreePurchase/FreePurchaseEntery/FreePurchaseEnteryForm.jsx';
|
() => import('./Pages/FreeProducts/FreeProduct/FreeProductList.jsx')
|
||||||
import FreePurchaseEnteryList from './Pages/FreeProducts/FreePurchase/FreePurchaseEntery/FreePurchaseEnteryList.jsx';
|
);
|
||||||
import FreePurchaseOrderList from './Pages/FreeProducts/FreePurchase/FreePurchaseOrder/FreePurchaseOrderList.jsx';
|
|
||||||
import FreePurchaseOrderForm from './Pages/FreeProducts/FreePurchase/FreePurchaseOrder/FreePurchaseOrderForm.jsx';
|
const FreePurchaseEnteryForm = lazy(
|
||||||
import FreePurchaseReturnList from './Pages/FreeProducts/FreePurchase/FreePurchaseReturn/FreePurchaseReturnList.jsx';
|
() =>
|
||||||
import FreePurchaseReturnForm from './Pages/FreeProducts/FreePurchase/FreePurchaseReturn/FreePurchaseReturnForm.jsx';
|
import('./Pages/FreeProducts/FreePurchase/FreePurchaseEntery/FreePurchaseEnteryForm.jsx')
|
||||||
import CommonForm from './Pages/Offer/LoyaltyPoints/CommonForm.jsx';
|
);
|
||||||
import ReprintReasonReportList from './Pages/Reports/ReprintReasonReport/ReprintReasonReportList.jsx';
|
const FreePurchaseEnteryList = lazy(
|
||||||
import RevenueItemWiseReport from './Pages/Reports/Revenue/RevenueItemWiseReport.jsx';
|
() =>
|
||||||
import LinkUrlCreate from './Pages/paymentpdfPage/LinkUrlCreate.jsx';
|
import('./Pages/FreeProducts/FreePurchase/FreePurchaseEntery/FreePurchaseEnteryList.jsx')
|
||||||
import SupplierProductMapping from './Pages/SupplierProductMapping/SupplierProductMapping.jsx';
|
);
|
||||||
import RedirectUserProfile from './Pages/RedirectUserProfile.jsx';
|
|
||||||
import RelieveRequestForm from './Pages/EmpMaster/EmpRelieve.jsx';
|
const FreePurchaseOrderList = lazy(
|
||||||
import PurchaseQuotationList from './Pages/PurchaseQuotation/PurchaseQuotationList.jsx';
|
() =>
|
||||||
import ExchangeAndReplacementList from './Pages/ExchangeAndReplacement/ExchangeAndReplacementList.jsx';
|
import('./Pages/FreeProducts/FreePurchase/FreePurchaseOrder/FreePurchaseOrderList.jsx')
|
||||||
import ExchangeAndReplacementForm from './Pages/ExchangeAndReplacement/ExchangeAndReplacementForm.jsx';
|
);
|
||||||
import ExchangeReturnMapForm from './Pages/ExchangeReturnMap/ExchangeReturnMapForm.jsx';
|
const FreePurchaseOrderForm = lazy(
|
||||||
import ExchangeReturnMapList from './Pages/ExchangeReturnMap/ExchangeReturnMapList.jsx';
|
() =>
|
||||||
import OtherServicesForm from './Pages/OtherServices/OtherServicesForm.jsx';
|
import('./Pages/FreeProducts/FreePurchase/FreePurchaseOrder/FreePurchaseOrderForm.jsx')
|
||||||
import OtherServicesList from './Pages/OtherServices/OtherServicesList.jsx';
|
);
|
||||||
import EmpCommisionOrIncentiveForm from './Pages/EmpCommissionOrIncentive/EmpCommisionOrIncentiveForm.jsx';
|
|
||||||
import EmpCommisionOrIncentiveList from './Pages/EmpCommissionOrIncentive/EmpCommisionOrIncentiveList.jsx';
|
const FreePurchaseReturnList = lazy(
|
||||||
import SalesBillProductsReturnList from './Pages/CancelReschedule/SalesBillProductReturnList.jsx';
|
() =>
|
||||||
import SalesBillProductsReturn from './Pages/CancelReschedule/SalesBillProductsReturn.jsx';
|
import('./Pages/FreeProducts/FreePurchase/FreePurchaseReturn/FreePurchaseReturnList.jsx')
|
||||||
import DeliveryChallanToInvoiceForm from './Pages/DeliveryChallanToInvoice/DeliveryChallanToInvoiceForm.jsx';
|
);
|
||||||
import DeliveryChallanToInvoiceList from './Pages/DeliveryChallanToInvoice/DeliveryChallanToInvoiceList.jsx';
|
const FreePurchaseReturnForm = lazy(
|
||||||
import TipAmountSettlementList from './Pages/Reports/TipAmountSettlement/TipAmountSettlementList.jsx';
|
() =>
|
||||||
import EmployeeSettlement from './Pages/Reports/EmployeeSettlement/EmployeeSettlement.jsx';
|
import('./Pages/FreeProducts/FreePurchase/FreePurchaseReturn/FreePurchaseReturnForm.jsx')
|
||||||
import PublicQrCode from './Pages/Reports/PublicQrCode.jsx';
|
);
|
||||||
import TableMapping from './Pages/TableMapping/TableMapping.jsx';
|
const CommonForm = lazy(
|
||||||
import TableMAppingList from './Pages/TableMapping/TableMAppingList.jsx';
|
() => import('./Pages/Offer/LoyaltyPoints/CommonForm.jsx')
|
||||||
import PurchaseOrderReport from './Pages/Reports/PurchaseReport/PurchaseOrderReport.jsx';
|
);
|
||||||
import SalesOrder from './Pages/SalesOrder/SalesOrder.jsx';
|
|
||||||
import LoyaltyBased from './Pages/Offer/LoyaltyBased/LoyaltyBased.jsx';
|
const ReprintReasonReportList = lazy(
|
||||||
import LoyaltyBasedList from './Pages/Offer/LoyaltyBased/LoyaltyBasedList.jsx';
|
() =>
|
||||||
import CodeBase from './Pages/Offer/CodeBase/CodeBase.jsx';
|
import('./Pages/Reports/ReprintReasonReport/ReprintReasonReportList.jsx')
|
||||||
import CodeBaseList from './Pages/Offer/CodeBase/CodeBaseList.jsx';
|
);
|
||||||
import TurboAddForm from './Pages/Product/TurboAddForm.jsx';
|
|
||||||
import ProductMaster from './Pages/Product/ProductMaster.jsx';
|
const RevenueItemWiseReport = lazy(
|
||||||
import GatewayMasterConfiguration from './Pages/GatewayMasterConfiguration/GatewayMasterConfiguration.jsx';
|
() => import('./Pages/Reports/Revenue/RevenueItemWiseReport.jsx')
|
||||||
import GatewayMasterConfigurationList from './Pages/GatewayMasterConfiguration/GatewayMasterConfigurationList.jsx';
|
);
|
||||||
import MembershipForm from './Pages/Membership/MembershipForm.jsx';
|
|
||||||
import MembershipList from './Pages/Membership/MembershipList.jsx';
|
const LinkUrlCreate = lazy(
|
||||||
import SlotManagementForm from './Pages/SlotManagement/SlotManagement.jsx';
|
() => import('./Pages/paymentpdfPage/LinkUrlCreate.jsx')
|
||||||
import SlotManagementList from './Pages/SlotManagement/SlotManagementList.jsx';
|
);
|
||||||
import BookingReScedule from './Pages/CancelReschedule/BookingReScedule.jsx';
|
|
||||||
import BookingReSceduleList from './Pages/CancelReschedule/BookingReSceduleList.jsx';
|
const SupplierProductMapping = lazy(
|
||||||
import MembershipReport from './Pages/Reports/Membership/MembershipReport.jsx';
|
() => import('./Pages/SupplierProductMapping/SupplierProductMapping.jsx')
|
||||||
import OpeningStock from './Pages/openingStock/openingstockForm.jsx';
|
);
|
||||||
import OpeningStockList from './Pages/openingStock/OpeningStockList.jsx';
|
|
||||||
import StockAdjustment from './Pages/StockAdjustment/StockAdjustment.jsx';
|
const RedirectUserProfile = lazy(
|
||||||
import StockAdjustmentList from './Pages/StockAdjustment/StockAdjustmentList.jsx';
|
() => import('./Pages/RedirectUserProfile.jsx')
|
||||||
import TopSellingProducts from './Pages/DashBoard/TopSellingProductsChart.jsx';
|
);
|
||||||
import AutomatedReorder from './Pages/Automated Reorder/AutomatedReorder.jsx';
|
|
||||||
import AutomatedReorderList from './Pages/Automated Reorder/AutomatedReorderList.jsx';
|
const RelieveRequestForm = lazy(
|
||||||
import CustomerPurchaseConfirm from './Pages/PurchaseOrder/CustomerPurchaseConfirm/CustomerPurchaseConfirm.jsx';
|
() => import('./Pages/EmpMaster/EmpRelieve.jsx')
|
||||||
import MenuQRCode from './Pages/Reports/MenuQRCode/MenuQRCode.jsx';
|
);
|
||||||
import CustomerMenuPage from './Pages/Reports/MenuQRCode/CustomerMenuPage.jsx';
|
|
||||||
import PurchaseLink from './Pages/PurchaseOrder/CustomerPurchaseConfirm/PurchaseLink.jsx';
|
const PurchaseQuotationList = lazy(
|
||||||
import RackForm from './Pages/Rack/RackForm.jsx';
|
() => import('./Pages/PurchaseQuotation/PurchaseQuotationList.jsx')
|
||||||
import RackList from './Pages/Rack/RackList.jsx';
|
);
|
||||||
import CreateTransfer from './Pages/StockTransfer/CreateTransfer.jsx';
|
|
||||||
import Dispatch from './Pages/StockTransfer/Dispatch.jsx';
|
const ExchangeAndReplacementList = lazy(
|
||||||
import ComboLayout3 from './Pages/BookingScreen/Template/ComboLayout3/ComboLayout3.jsx';
|
() => import('./Pages/ExchangeAndReplacement/ExchangeAndReplacementList.jsx')
|
||||||
import StockTransferList from './Pages/StockTransfer/TransferList.jsx';
|
);
|
||||||
import Productcatlogue from './Pages/ProductCatlogue/Productcatalogue.jsx';
|
const ExchangeAndReplacementForm = lazy(
|
||||||
|
() => import('./Pages/ExchangeAndReplacement/ExchangeAndReplacementForm.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const ExchangeReturnMapForm = lazy(
|
||||||
|
() => import('./Pages/ExchangeReturnMap/ExchangeReturnMapForm.jsx')
|
||||||
|
);
|
||||||
|
const ExchangeReturnMapList = lazy(
|
||||||
|
() => import('./Pages/ExchangeReturnMap/ExchangeReturnMapList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const OtherServicesForm = lazy(
|
||||||
|
() => import('./Pages/OtherServices/OtherServicesForm.jsx')
|
||||||
|
);
|
||||||
|
const OtherServicesList = lazy(
|
||||||
|
() => import('./Pages/OtherServices/OtherServicesList.jsx')
|
||||||
|
);
|
||||||
|
const EmpCommisionOrIncentiveForm = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/EmpCommissionOrIncentive/EmpCommisionOrIncentiveForm.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const EmpCommisionOrIncentiveList = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/EmpCommissionOrIncentive/EmpCommisionOrIncentiveList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const SalesBillProductsReturnList = lazy(
|
||||||
|
() => import('./Pages/CancelReschedule/SalesBillProductReturnList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const SalesBillProductsReturn = lazy(
|
||||||
|
() => import('./Pages/CancelReschedule/SalesBillProductsReturn.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const DeliveryChallanToInvoiceForm = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/DeliveryChallanToInvoice/DeliveryChallanToInvoiceForm.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const DeliveryChallanToInvoiceList = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/DeliveryChallanToInvoice/DeliveryChallanToInvoiceList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const TipAmountSettlementList = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/Reports/TipAmountSettlement/TipAmountSettlementList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const EmployeeSettlement = lazy(
|
||||||
|
() => import('./Pages/Reports/EmployeeSettlement/EmployeeSettlement.jsx')
|
||||||
|
);
|
||||||
|
const PublicQrCode = lazy(() => import('./Pages/Reports/PublicQrCode.jsx'));
|
||||||
|
|
||||||
|
const TableMapping = lazy(
|
||||||
|
() => import('./Pages/TableMapping/TableMapping.jsx')
|
||||||
|
);
|
||||||
|
const TableMAppingList = lazy(
|
||||||
|
() => import('./Pages/TableMapping/TableMAppingList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const PurchaseOrderReport = lazy(
|
||||||
|
() => import('./Pages/Reports/PurchaseReport/PurchaseOrderReport.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const SalesOrder = lazy(() => import('./Pages/SalesOrder/SalesOrder.jsx'));
|
||||||
|
|
||||||
|
const LoyaltyBased = lazy(
|
||||||
|
() => import('./Pages/Offer/LoyaltyBased/LoyaltyBased.jsx')
|
||||||
|
);
|
||||||
|
const LoyaltyBasedList = lazy(
|
||||||
|
() => import('./Pages/Offer/LoyaltyBased/LoyaltyBasedList.jsx')
|
||||||
|
);
|
||||||
|
const CodeBase = lazy(() => import('./Pages/Offer/CodeBase/CodeBase.jsx'));
|
||||||
|
const CodeBaseList = lazy(
|
||||||
|
() => import('./Pages/Offer/CodeBase/CodeBaseList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const TurboAddForm = lazy(() => import('./Pages/Product/TurboAddForm.jsx'));
|
||||||
|
|
||||||
|
const ProductMaster = lazy(() => import('./Pages/Product/ProductMaster.jsx'));
|
||||||
|
|
||||||
|
const GatewayMasterConfiguration = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/GatewayMasterConfiguration/GatewayMasterConfiguration.jsx')
|
||||||
|
);
|
||||||
|
const GatewayMasterConfigurationList = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/GatewayMasterConfiguration/GatewayMasterConfigurationList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const MembershipForm = lazy(
|
||||||
|
() => import('./Pages/Membership/MembershipForm.jsx')
|
||||||
|
);
|
||||||
|
const MembershipList = lazy(
|
||||||
|
() => import('./Pages/Membership/MembershipList.jsx')
|
||||||
|
);
|
||||||
|
const SlotManagementForm = lazy(
|
||||||
|
() => import('./Pages/SlotManagement/SlotManagement.jsx')
|
||||||
|
);
|
||||||
|
const SlotManagementList = lazy(
|
||||||
|
() => import('./Pages/SlotManagement/SlotManagementList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const BookingReScedule = lazy(
|
||||||
|
() => import('./Pages/CancelReschedule/BookingReScedule.jsx')
|
||||||
|
);
|
||||||
|
const BookingReSceduleList = lazy(
|
||||||
|
() => import('./Pages/CancelReschedule/BookingReSceduleList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const MembershipReport = lazy(
|
||||||
|
() => import('./Pages/Reports/Membership/MembershipReport.jsx')
|
||||||
|
);
|
||||||
|
const OpeningStock = lazy(
|
||||||
|
() => import('./Pages/openingStock/openingstockForm.jsx')
|
||||||
|
);
|
||||||
|
const OpeningStockList = lazy(
|
||||||
|
() => import('./Pages/openingStock/OpeningStockList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const StockAdjustment = lazy(
|
||||||
|
() => import('./Pages/StockAdjustment/StockAdjustment.jsx')
|
||||||
|
);
|
||||||
|
const StockAdjustmentList = lazy(
|
||||||
|
() => import('./Pages/StockAdjustment/StockAdjustmentList.jsx')
|
||||||
|
);
|
||||||
|
const TopSellingProducts = lazy(
|
||||||
|
() => import('./Pages/DashBoard/TopSellingProductsChart.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const AutomatedReorder = lazy(
|
||||||
|
() => import('./Pages/Automated Reorder/AutomatedReorder.jsx')
|
||||||
|
);
|
||||||
|
const AutomatedReorderList = lazy(
|
||||||
|
() => import('./Pages/Automated Reorder/AutomatedReorderList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const CustomerPurchaseConfirm = lazy(
|
||||||
|
() =>
|
||||||
|
import('./Pages/PurchaseOrder/CustomerPurchaseConfirm/CustomerPurchaseConfirm.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const MenuQRCode = lazy(
|
||||||
|
() => import('./Pages/Reports/MenuQRCode/MenuQRCode.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const PurchaseLink = lazy(
|
||||||
|
() => import('./Pages/PurchaseOrder/CustomerPurchaseConfirm/PurchaseLink.jsx')
|
||||||
|
);
|
||||||
|
const RackForm = lazy(() => import('./Pages/Rack/RackForm.jsx'));
|
||||||
|
const RackList = lazy(() => import('./Pages/Rack/RackList.jsx'));
|
||||||
|
|
||||||
|
const CreateTransfer = lazy(
|
||||||
|
() => import('./Pages/StockTransfer/CreateTransfer.jsx')
|
||||||
|
);
|
||||||
|
const Dispatch = lazy(() => import('./Pages/StockTransfer/Dispatch.jsx'));
|
||||||
|
const StockTransferList = lazy(
|
||||||
|
() => import('./Pages/StockTransfer/TransferList.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const ComboLayout3 = lazy(
|
||||||
|
() => import('./Pages/BookingScreen/Template/ComboLayout3/ComboLayout3.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
|
const Productcatlogue = lazy(
|
||||||
|
() => import('./Pages/ProductCatlogue/Productcatalogue.jsx')
|
||||||
|
);
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
const apiCommonUrl = import.meta.env.ENV_API_URL_COMMON;
|
const apiCommonUrl = import.meta.env.ENV_API_URL_COMMON;
|
||||||
|
|
@ -268,7 +732,7 @@ const fetchComponent = async () => {
|
||||||
sessionStore('userName', 'Karthiga');
|
sessionStore('userName', 'Karthiga');
|
||||||
sessionStorage.setItem(
|
sessionStorage.setItem(
|
||||||
'auth',
|
'auth',
|
||||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiOTM2MDY0MjI0NCIsIlBhc3N3b3JkIjoiWkB6MTIzNCIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTIiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTQiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiXSwiZXhwIjoxNzcwMjMzMDA3LCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMDEifQ.y6ZLDB3qz1nJk68XY13jXxHKd99LVX2GhzhtE5eGXqI'
|
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiOTM2MDY0MjI0NCIsIlBhc3N3b3JkIjoiWkB6MTIzNCIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTIiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTQiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiXSwiZXhwIjoxNzcwNzQ5MjkxLCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMDEifQ.aXnhbA3ReRVyt8denDX_LK_ecVBiG5KdeHsurVR7iwQ'
|
||||||
);
|
);
|
||||||
|
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
|
|
@ -373,7 +837,7 @@ const fetchHomeComponent = async () => {
|
||||||
sessionStore('userName', 'Karthiga');
|
sessionStore('userName', 'Karthiga');
|
||||||
sessionStorage.setItem(
|
sessionStorage.setItem(
|
||||||
'auth',
|
'auth',
|
||||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiOTM2MDY0MjI0NCIsIlBhc3N3b3JkIjoiWkB6MTIzNCIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTIiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTQiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiXSwiZXhwIjoxNzcwMjMzMDA3LCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMDEifQ.y6ZLDB3qz1nJk68XY13jXxHKd99LVX2GhzhtE5eGXqI'
|
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiOTM2MDY0MjI0NCIsIlBhc3N3b3JkIjoiWkB6MTIzNCIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTIiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTQiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiXSwiZXhwIjoxNzcwNzQ5MjkxLCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMDEifQ.aXnhbA3ReRVyt8denDX_LK_ecVBiG5KdeHsurVR7iwQ'
|
||||||
);
|
);
|
||||||
|
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
|
|
@ -1087,8 +1551,6 @@ export const routesConfig = [
|
||||||
empAccess: 'Product Receipt',
|
empAccess: 'Product Receipt',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
path: 'receive-stocks',
|
path: 'receive-stocks',
|
||||||
component: StockReceivedList,
|
component: StockReceivedList,
|
||||||
|
|
@ -1228,7 +1690,6 @@ export const routesConfig = [
|
||||||
empAccess: 'DC to Invoice',
|
empAccess: 'DC to Invoice',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{ path: 'shift-master', component: ShiftMasterList, empAccess: 'Shift' },
|
{ path: 'shift-master', component: ShiftMasterList, empAccess: 'Shift' },
|
||||||
{
|
{
|
||||||
path: 'shift-master/new',
|
path: 'shift-master/new',
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import {
|
||||||
|
checkSession,
|
||||||
|
GenerateLogout,
|
||||||
|
} from './Features/BrachLogin/BranchLogin.js';
|
||||||
|
import {
|
||||||
|
clearSession,
|
||||||
|
getSession,
|
||||||
|
TokendecryptedValuesFun,
|
||||||
|
} from './Services/Others.js';
|
||||||
|
const commonSubDir = import.meta.env.ENV_COMMON_BASE_URL;
|
||||||
|
|
||||||
|
const useSessionManager = (dependencyTrigger) => {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const [sessionData, setSessionData] = useState(null);
|
||||||
|
|
||||||
|
// 🔹 Load session
|
||||||
|
useEffect(() => {
|
||||||
|
const CompId = getSession('CompId');
|
||||||
|
const AppId = getSession('AppId');
|
||||||
|
const BranchId = getSession('BranchId');
|
||||||
|
const UserType = getSession('UserType');
|
||||||
|
|
||||||
|
if (CompId && AppId && BranchId) {
|
||||||
|
setSessionData({ CompId, AppId, BranchId, UserType });
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// 🔹 Session validity check (same logic, centralized)
|
||||||
|
useEffect(() => {
|
||||||
|
const sessionCheckFun = async () => {
|
||||||
|
const UserId = getSession('UserId');
|
||||||
|
const sessionId = getSession('SessionId');
|
||||||
|
const IsLogout = getSession('Mode');
|
||||||
|
|
||||||
|
let encryptedLoginType = TokendecryptedValuesFun(
|
||||||
|
sessionStorage.getItem('LoginType')
|
||||||
|
);
|
||||||
|
|
||||||
|
if (encryptedLoginType !== 'Kiosk') {
|
||||||
|
const res = await dispatch(
|
||||||
|
checkSession({ UserId, sessionId })
|
||||||
|
).unwrap();
|
||||||
|
if (res?.data?.statusCode === 1 && res?.data?.response === 'False') {
|
||||||
|
if (IsLogout !== 'Logout') {
|
||||||
|
alert('Session invalid. Redirecting to login...');
|
||||||
|
}
|
||||||
|
clearSession();
|
||||||
|
window.location.replace(commonSubDir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
sessionCheckFun();
|
||||||
|
}, [dependencyTrigger]);
|
||||||
|
|
||||||
|
// 🔹 Logout (shared everywhere)
|
||||||
|
const logout = async () => {
|
||||||
|
const UserId = getSession('UserId');
|
||||||
|
try {
|
||||||
|
await dispatch(GenerateLogout({ UserId, status: 'N' })).unwrap();
|
||||||
|
} finally {
|
||||||
|
sessionStorage.clear();
|
||||||
|
window.location.replace(commonSubDir);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return { sessionData, logout };
|
||||||
|
};
|
||||||
|
|
||||||
|
export default useSessionManager;
|
||||||
|
|
@ -0,0 +1,155 @@
|
||||||
|
import { useEffect, useRef, useState } from 'react';
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import {
|
||||||
|
ChangeAppExpDateData,
|
||||||
|
changeHeightforExpDate,
|
||||||
|
getAppSubscriptionDate,
|
||||||
|
} from './Features/BookingScreen/BookingData/BookingData.js';
|
||||||
|
import { sendSms } from './Features/Payment/PaymentDetails/PaymentDetails.js';
|
||||||
|
import { getPurchasedAppDetails, postInvoice } from './Features/BookingScreen/Pricing/Pricing.js';
|
||||||
|
import { getSession } from './Services/Others.js';
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
|
const useSubscriptionManager = (sessionData, logout) => {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const prevRemainingDays = useRef(null);
|
||||||
|
const [remainingDays, setRemainingDays] = useState(null);
|
||||||
|
const [extendModel, setExtendModel] = useState(false);
|
||||||
|
const handleCancel = () => {
|
||||||
|
logout();
|
||||||
|
setExtendModel(false)
|
||||||
|
|
||||||
|
}
|
||||||
|
const handlePay = () => {
|
||||||
|
setExtendModel(false)
|
||||||
|
let AppName = getSession("AppName")
|
||||||
|
navigate(`${subDirectory}PricingPage`, { state: { AppName: AppName } });
|
||||||
|
}
|
||||||
|
function formatDate(date) {
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0');
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||||
|
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||||
|
const milliseconds = String(date.getMilliseconds()).padStart(3, '0');
|
||||||
|
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}.${milliseconds}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function addDays(dateString, days) {
|
||||||
|
// Make it ISO-safe for iOS / WebView
|
||||||
|
const isoDate = dateString.replace(' ', 'T');
|
||||||
|
const currentDate = new Date(isoDate);
|
||||||
|
|
||||||
|
currentDate.setDate(currentDate.getDate() + Number(days));
|
||||||
|
|
||||||
|
return formatDate(currentDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------- MAIN FUNCTION ----------------
|
||||||
|
const freeExtend = async () => {
|
||||||
|
try {
|
||||||
|
|
||||||
|
const UserId = getSession('UserId');
|
||||||
|
const AppId = getSession('UserId')
|
||||||
|
// Current date
|
||||||
|
const now = new Date();
|
||||||
|
const currentDate = formatDate(now);
|
||||||
|
|
||||||
|
// 1️⃣ Get purchased app details
|
||||||
|
const response1 = await dispatch(
|
||||||
|
getPurchasedAppDetails({ AppId, UserId })
|
||||||
|
).unwrap();
|
||||||
|
|
||||||
|
const PurchasedDetails = response1?.data?.data;
|
||||||
|
|
||||||
|
if (!PurchasedDetails || !PurchasedDetails.length) {
|
||||||
|
console.error('No purchased details found');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2️⃣ Prepare post data
|
||||||
|
const postData = {
|
||||||
|
UserId: UserId,
|
||||||
|
AppId: AppId,
|
||||||
|
PricingId: PurchasedDetails[0]?.PricingId,
|
||||||
|
PurDate: currentDate,
|
||||||
|
NoofDays: 30,
|
||||||
|
PaymentMode: 27,
|
||||||
|
PaymentStatus: 'S',
|
||||||
|
LicenseStatus: PurchasedDetails[0]?.LicenseStatus,
|
||||||
|
Price: PurchasedDetails[0]?.Price ?? 0,
|
||||||
|
TaxId: PurchasedDetails[0]?.TaxId ?? 0,
|
||||||
|
NetPrice: PurchasedDetails[0]?.ExistingPlanNetPrice ?? 0,
|
||||||
|
ValidityStart: currentDate,
|
||||||
|
ValidityEnd: addDays(
|
||||||
|
currentDate,
|
||||||
|
PurchasedDetails[0]?.NoOfDays
|
||||||
|
),
|
||||||
|
CreatedBy: UserId,
|
||||||
|
TaxAmount: PurchasedDetails[0]?.TaxAmount ?? 0,
|
||||||
|
MobileNo: getSession('MobileNo'),
|
||||||
|
MailId: 'ts@gmmail.com',
|
||||||
|
Type: "FreeExtend"
|
||||||
|
};
|
||||||
|
|
||||||
|
// 3️⃣ Post invoice
|
||||||
|
const response = await dispatch(postInvoice(postData)).unwrap();
|
||||||
|
|
||||||
|
// 4️⃣ Send SMS if required
|
||||||
|
if (response?.data?.statusCode === 1 && response?.data?.SMSbody) {
|
||||||
|
await dispatch(
|
||||||
|
sendSms({ body: response.data.SMSbody })
|
||||||
|
);
|
||||||
|
setExtendModel(false)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('freeExtend error:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
if (!sessionData) return;
|
||||||
|
|
||||||
|
const fetchExpDate = async () => {
|
||||||
|
const { CompId, AppId, BranchId, UserType } = sessionData;
|
||||||
|
|
||||||
|
const res = await dispatch(
|
||||||
|
getAppSubscriptionDate({ CompId, BranchId, AppId })
|
||||||
|
).unwrap();
|
||||||
|
|
||||||
|
const expData = res?.data?.data?.[0];
|
||||||
|
if (!expData) return logout();
|
||||||
|
|
||||||
|
if (prevRemainingDays.current !== expData.RemainingDays) {
|
||||||
|
prevRemainingDays.current = expData.RemainingDays;
|
||||||
|
|
||||||
|
setRemainingDays(expData.RemainingDays);
|
||||||
|
dispatch(ChangeAppExpDateData(expData));
|
||||||
|
dispatch(changeHeightforExpDate(expData.RemainingDays));
|
||||||
|
|
||||||
|
if (
|
||||||
|
expData.RemainingDays < 1 &&
|
||||||
|
expData.RemainingHours < 1 &&
|
||||||
|
expData.RemainingMinutes < 1 &&
|
||||||
|
expData.RemainingSeconds < 1 &&
|
||||||
|
UserType !== 'Super Admin'
|
||||||
|
) {
|
||||||
|
alert('Subscription expired');
|
||||||
|
logout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
fetchExpDate();
|
||||||
|
const interval = setInterval(fetchExpDate, 60 * 60 * 1000);
|
||||||
|
return () => clearInterval(interval);
|
||||||
|
}, [sessionData]);
|
||||||
|
|
||||||
|
return { remainingDays, handleCancel, handlePay, freeExtend, extendModel };
|
||||||
|
};
|
||||||
|
|
||||||
|
export default useSubscriptionManager;
|
||||||
Loading…
Reference in New Issue