conflict Fixed
This commit is contained in:
commit
592098e672
150
src/App.jsx
150
src/App.jsx
|
|
@ -8,7 +8,7 @@ import SelfBooking from './Pages/SelfBooking/SelfBooking.jsx';
|
||||||
import { isMobile, isIOS } from 'react-device-detect';
|
import { isMobile, isIOS } from 'react-device-detect';
|
||||||
import { routesConfig } from './routesConfig';
|
import { routesConfig } from './routesConfig';
|
||||||
import { GlobalItemCard } from './Features/BookingScreen/BookingData/BookingData.js';
|
import { GlobalItemCard } from './Features/BookingScreen/BookingData/BookingData.js';
|
||||||
import { clearSession, getSession } from './Services/Others.js';
|
import { clearSession, getSession, sessionStore } from './Services/Others.js';
|
||||||
|
|
||||||
const KisokSelBooking = lazy(
|
const KisokSelBooking = lazy(
|
||||||
() => import('./Pages/SelfBooking/KisokSelBooking')
|
() => import('./Pages/SelfBooking/KisokSelBooking')
|
||||||
|
|
@ -27,9 +27,10 @@ import useSessionManager from './useSessionManager.js';
|
||||||
import ExtendSubscriptionModal from './Pages/ExtentedModal/ExtendSubscriptionModal.jsx';
|
import ExtendSubscriptionModal from './Pages/ExtentedModal/ExtendSubscriptionModal.jsx';
|
||||||
import devtools from 'devtools-detect';
|
import devtools from 'devtools-detect';
|
||||||
import { useDevToolsDetection } from './utils/useDevToolsDetection.js';
|
import { useDevToolsDetection } from './utils/useDevToolsDetection.js';
|
||||||
|
import { Capacitor } from '@capacitor/core';
|
||||||
|
|
||||||
const isCapacitor = () => !!window.Capacitor?.isNativePlatform?.();
|
// const isCapacitor = () => !!window.Capacitor?.isNativePlatform?.();
|
||||||
|
const isCapacitor = () => Capacitor.isNativePlatform();
|
||||||
// ✅ Define your home/exit pages here
|
// ✅ Define your home/exit pages here
|
||||||
const HOME_PAGES = [
|
const HOME_PAGES = [
|
||||||
'/app-page/home', // android minimize
|
'/app-page/home', // android minimize
|
||||||
|
|
@ -55,7 +56,7 @@ const AppRoutes = () => {
|
||||||
const [devToolsOpen, setDevToolsOpen] = useState(false);
|
const [devToolsOpen, setDevToolsOpen] = useState(false);
|
||||||
// ✅ Flag to prevent stack push when back button navigates
|
// ✅ Flag to prevent stack push when back button navigates
|
||||||
const isBackNav = useRef(false);
|
const isBackNav = useRef(false);
|
||||||
|
console.log(isCapacitor(), 'Is Capacitor');
|
||||||
// ✅ Build navigation stack
|
// ✅ Build navigation stack
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Skip pushing to stack when back button caused this navigation
|
// Skip pushing to stack when back button caused this navigation
|
||||||
|
|
@ -70,13 +71,14 @@ const AppRoutes = () => {
|
||||||
// Don't track login pages
|
// Don't track login pages
|
||||||
if (LOGIN_PAGES.some((p) => path.includes(p))) return;
|
if (LOGIN_PAGES.some((p) => path.includes(p))) return;
|
||||||
|
|
||||||
const raw = sessionStorage.getItem('navStack');
|
const raw = getSession('navStack');
|
||||||
|
console.log('🎯 Current path:', path);
|
||||||
let stack = raw ? JSON.parse(raw) : [];
|
let stack = raw ? JSON.parse(raw) : [];
|
||||||
|
|
||||||
if (stack.length === 0 || stack[stack.length - 1] !== path) {
|
if (stack.length === 0 || stack[stack.length - 1] !== path) {
|
||||||
stack.push(path);
|
stack.push(path);
|
||||||
if (stack.length > 50) stack = stack.slice(-50);
|
if (stack.length > 50) stack = stack.slice(-50);
|
||||||
sessionStorage.setItem('navStack', JSON.stringify(stack));
|
sessionStore('navStack', JSON.stringify(stack));
|
||||||
console.log('📍 Stack:', stack);
|
console.log('📍 Stack:', stack);
|
||||||
}
|
}
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
|
|
@ -90,7 +92,7 @@ const AppRoutes = () => {
|
||||||
const currentPath = location.pathname;
|
const currentPath = location.pathname;
|
||||||
|
|
||||||
const SessionId = getSession('SessionId');
|
const SessionId = getSession('SessionId');
|
||||||
|
console.log('SessionId:', SessionId, 'CurrentPath:', currentPath)
|
||||||
// 🟢 If session exists → allow navigation
|
// 🟢 If session exists → allow navigation
|
||||||
if (SessionId) {
|
if (SessionId) {
|
||||||
console.log('Browser back allowed');
|
console.log('Browser back allowed');
|
||||||
|
|
@ -112,65 +114,53 @@ const AppRoutes = () => {
|
||||||
}, [location.pathname]);
|
}, [location.pathname]);
|
||||||
|
|
||||||
// ✅ Android — Capacitor back button
|
// ✅ Android — Capacitor back button
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isCapacitor()) return;
|
if (!isCapacitor()) return;
|
||||||
|
|
||||||
const handler = async () => {
|
const handler = async () => {
|
||||||
try {
|
try {
|
||||||
const currentPath = location.pathname + (location.search || '');
|
const currentPath = window.location.pathname + window.location.search; // Bug 2 fix
|
||||||
console.log('🔙 Back pressed:', currentPath);
|
|
||||||
|
|
||||||
const raw = sessionStorage.getItem('navStack');
|
const raw = getSession('navStack');
|
||||||
let stack = raw ? JSON.parse(raw) : [];
|
let stack = raw ? JSON.parse(raw) : [];
|
||||||
|
|
||||||
// Remove current path from stack if it's at the end
|
while (stack.length && stack[stack.length - 1] === currentPath) {
|
||||||
while (stack.length && stack[stack.length - 1] === currentPath) {
|
stack.pop();
|
||||||
stack.pop();
|
|
||||||
}
|
|
||||||
|
|
||||||
// If there are pages in history, go back to previous page
|
|
||||||
if (stack.length > 0) {
|
|
||||||
const previous = stack[stack.length - 1];
|
|
||||||
sessionStorage.setItem('navStack', JSON.stringify(stack));
|
|
||||||
isBackNav.current = true;
|
|
||||||
navigate(previous);
|
|
||||||
console.log('Navigate to previous:', previous);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Stack is empty - check where we are
|
|
||||||
// 🏠 Home page → minimize
|
|
||||||
if (HOME_PAGES?.some((p) => currentPath?.includes(p))) {
|
|
||||||
console.log('Home page & empty stack → minimizing app');
|
|
||||||
await CapacitorApp.minimizeApp();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 🚪 Login page → minimize
|
|
||||||
if (LOGIN_PAGES?.some((p) => currentPath?.includes(p))) {
|
|
||||||
console.log('Login page & empty stack → minimizing app');
|
|
||||||
await CapacitorApp.minimizeApp();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Anywhere else with empty stack → go to home
|
|
||||||
const home = '/app-page/home';
|
|
||||||
sessionStorage.setItem('navStack', JSON.stringify([home]));
|
|
||||||
isBackNav.current = true;
|
|
||||||
navigate(home);
|
|
||||||
console.log('Empty stack, navigate to home');
|
|
||||||
} catch (e) {
|
|
||||||
console.error('Back handler error:', e);
|
|
||||||
await CapacitorApp.minimizeApp();
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
const listener = CapacitorApp.addListener('backButton', handler);
|
if (stack.length > 0) {
|
||||||
|
const previous = stack[stack.length - 1];
|
||||||
|
sessionStore('navStack', JSON.stringify(stack));
|
||||||
|
isBackNav.current = true; // Bug 3 fix — BEFORE navigate
|
||||||
|
navigate(previous);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return () => {
|
if (HOME_PAGES?.some((p) => currentPath?.includes(p))) {
|
||||||
listener.remove();
|
await CapacitorApp.minimizeApp();
|
||||||
};
|
return;
|
||||||
}, [navigate, location.pathname, location.search]);
|
}
|
||||||
|
|
||||||
|
if (LOGIN_PAGES?.some((p) => currentPath?.includes(p))) {
|
||||||
|
await CapacitorApp.minimizeApp();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const home = '/app-page/home';
|
||||||
|
isBackNav.current = true; // Bug 3 fix here too
|
||||||
|
sessionStore('navStack', JSON.stringify([home]));
|
||||||
|
navigate(home);
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Back handler error:', e);
|
||||||
|
await CapacitorApp.minimizeApp();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const listenerPromise = CapacitorApp.addListener('backButton', handler); // Bug 1 fix
|
||||||
|
return () => {
|
||||||
|
listenerPromise.then(({ remove }) => remove());
|
||||||
|
};
|
||||||
|
}, [navigate,location.pathname, location.search]);
|
||||||
// mohan
|
// mohan
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// if (isMobile || isIOS) {
|
// if (isMobile || isIOS) {
|
||||||
|
|
@ -211,27 +201,27 @@ const AppRoutes = () => {
|
||||||
|
|
||||||
// return () => clearInterval(checkDevTools);
|
// return () => clearInterval(checkDevTools);
|
||||||
// }, [devToolsOpen]);
|
// }, [devToolsOpen]);
|
||||||
const isBlocked = useDevToolsDetection(() => {
|
// const isBlocked = useDevToolsDetection(() => {
|
||||||
// optional: log, notify, etc.
|
// // optional: log, notify, etc.
|
||||||
console.warn('DevTools detected');
|
// console.warn('DevTools detected');
|
||||||
});
|
// });
|
||||||
|
|
||||||
if (isBlocked) {
|
// if (isBlocked) {
|
||||||
return (
|
// return (
|
||||||
<div style={{
|
// <div style={{
|
||||||
display: 'flex',
|
// display: 'flex',
|
||||||
justifyContent: 'center',
|
// justifyContent: 'center',
|
||||||
alignItems: 'center',
|
// alignItems: 'center',
|
||||||
height: '100vh',
|
// height: '100vh',
|
||||||
flexDirection: 'column',
|
// flexDirection: 'column',
|
||||||
gap: '1rem'
|
// gap: '1rem'
|
||||||
}}>
|
// }}>
|
||||||
<h1 style={{ color: 'red' }}>
|
// <h1 style={{ color: 'red' }}>
|
||||||
DevTools detected. Please close it to continue.
|
// DevTools detected. Please close it to continue.
|
||||||
</h1>
|
// </h1>
|
||||||
</div>
|
// </div>
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
if (extendModel) {
|
if (extendModel) {
|
||||||
return (
|
return (
|
||||||
<ExtendSubscriptionModal
|
<ExtendSubscriptionModal
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,18 @@ const SideMenuPozo = ({ items = [] }) => {
|
||||||
const DineinDefault = useSelector(GlobalDineinDefault);
|
const DineinDefault = useSelector(GlobalDineinDefault);
|
||||||
const [collapse, setCollapse] = useState(false);
|
const [collapse, setCollapse] = useState(false);
|
||||||
|
|
||||||
|
const [isLandscape, setIsLandscape] = useState(
|
||||||
|
window.matchMedia('(orientation: landscape)').matches
|
||||||
|
);
|
||||||
|
useEffect(() => {
|
||||||
|
const handleResize = () => {
|
||||||
|
setIsLandscape(window.matchMedia('(orientation: landscape)').matches);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('resize', handleResize);
|
||||||
|
return () => window.removeEventListener('resize', handleResize);
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleResize = () => {
|
const handleResize = () => {
|
||||||
setCollapse(window.innerWidth < 768);
|
setCollapse(window.innerWidth < 768);
|
||||||
|
|
@ -368,7 +380,10 @@ const SideMenuPozo = ({ items = [] }) => {
|
||||||
<div
|
<div
|
||||||
className={`SideMenuPozo-Master${collapse ? ' collapsed' : ''}`}
|
className={`SideMenuPozo-Master${collapse ? ' collapsed' : ''}`}
|
||||||
ref={menuRef}
|
ref={menuRef}
|
||||||
style={{ height: isMobile ? '88%' : '' }}
|
// style={{ height: isMobile ? '88%' : '' }}
|
||||||
|
style={{
|
||||||
|
height: isMobile ? (isLandscape ? '100%' : '100%') : '100%',
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,7 @@ const styles = {
|
||||||
|
|
||||||
status: {
|
status: {
|
||||||
marginTop: '6px',
|
marginTop: '6px',
|
||||||
fontSize: '0.7rem',
|
fontSize: '0.6rem',
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
letterSpacing: '4px',
|
letterSpacing: '4px',
|
||||||
textTransform: 'uppercase',
|
textTransform: 'uppercase',
|
||||||
|
|
|
||||||
|
|
@ -56,11 +56,6 @@ const addAuthHeader = async (config) => {
|
||||||
let encryptedLoginType =
|
let encryptedLoginType =
|
||||||
getSession('LoginType')
|
getSession('LoginType')
|
||||||
|
|
||||||
console.log(
|
|
||||||
'encryptedLoginType',
|
|
||||||
encryptedLoginType,
|
|
||||||
TokendecryptedValuesFun(encryptedMobileno)
|
|
||||||
);
|
|
||||||
|
|
||||||
// let Mobileno = encryptedUserId && encryptedLoginType != "Kiosk" ? TokendecryptedValuesFun(encryptedMobileno) : '1000000001';
|
// let Mobileno = encryptedUserId && encryptedLoginType != "Kiosk" ? TokendecryptedValuesFun(encryptedMobileno) : '1000000001';
|
||||||
let Mobileno = encryptedUserId
|
let Mobileno = encryptedUserId
|
||||||
|
|
|
||||||
|
|
@ -1416,6 +1416,13 @@ export const getOtherServiceTicket = createAsyncThunk(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
// post /cancelPayment
|
||||||
|
export const PostCancelPayment = createAsyncThunk(
|
||||||
|
'BookingData/cancelPayment',
|
||||||
|
async (postData) => {
|
||||||
|
return await axiosRetailInstanceData.post(`/cancelPayment`, postData);
|
||||||
|
}
|
||||||
|
);
|
||||||
export const PostBlockSlots = createAsyncThunk(
|
export const PostBlockSlots = createAsyncThunk(
|
||||||
'BookingData/PostBlockSlots',
|
'BookingData/PostBlockSlots',
|
||||||
async (postData) => {
|
async (postData) => {
|
||||||
|
|
@ -1444,6 +1451,7 @@ export const getPaymentStatusForBusinessUPI = createAsyncThunk(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
export const getCurrentOrderid = createAsyncThunk(
|
export const getCurrentOrderid = createAsyncThunk(
|
||||||
'BookingData/getcurrentorderid',
|
'BookingData/getcurrentorderid',
|
||||||
|
|
||||||
|
|
@ -2160,13 +2168,13 @@ const BookingData = createSlice({
|
||||||
state.getmultipleSearchDatas = [];
|
state.getmultipleSearchDatas = [];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
builder.addCase(getAppSubscriptionDate.fulfilled, (state, action) => {
|
builder.addCase(getAppSubscriptionDate.fulfilled, (state, action) => {
|
||||||
if (action?.payload?.data?.statusCode === 1) {
|
if (action?.payload?.data?.statusCode === 1) {
|
||||||
state.AppExpDateData =
|
state.AppExpDateData =
|
||||||
action?.payload?.data?.data?.[0]|| {};
|
action?.payload?.data?.data?.[0] || {};
|
||||||
} else {
|
} else {
|
||||||
state.AppExpDateData = {};
|
state.AppExpDateData = {};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
height: 90vh;
|
height: 90vh;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
font-family: 'Poppins';
|
font-family: "Poppins";
|
||||||
|
|
||||||
.automated-reorder-content {
|
.automated-reorder-content {
|
||||||
padding-top: 18px;
|
padding-top: 18px;
|
||||||
|
|
@ -52,3 +52,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.automated-reorder-list-content {
|
||||||
|
.eyeopenShow {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,345 +1,359 @@
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from 'react-redux';
|
||||||
import { getSession } from "../../Services/Others";
|
import { getSession } from '../../Services/Others';
|
||||||
import { changeBreadCrumb, getEmpAccess } from "../../Features/AppPage/CenterPage";
|
|
||||||
import { Messages } from "../../Components/Notifications/Messages";
|
|
||||||
import { Tables } from "../../Components/Tables/Table";
|
|
||||||
import FormHeader from "../PageComponents/FormHeader";
|
|
||||||
import Search from "../../Components/Forms/Search";
|
|
||||||
import Buttons from "../../Components/Forms/Buttons";
|
|
||||||
import {
|
import {
|
||||||
EditFilled,
|
changeBreadCrumb,
|
||||||
DeleteFilled,
|
getEmpAccess,
|
||||||
PlusOutlined,
|
} from '../../Features/AppPage/CenterPage';
|
||||||
ReloadOutlined,
|
import { Messages } from '../../Components/Notifications/Messages';
|
||||||
|
import { Tables } from '../../Components/Tables/Table';
|
||||||
|
import FormHeader from '../PageComponents/FormHeader';
|
||||||
|
import Search from '../../Components/Forms/Search';
|
||||||
|
import Buttons from '../../Components/Forms/Buttons';
|
||||||
|
import {
|
||||||
|
EditFilled,
|
||||||
|
DeleteFilled,
|
||||||
|
PlusOutlined,
|
||||||
|
ReloadOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
import { useLocation, useNavigate } from 'react-router-dom';
|
||||||
import { Space, Tooltip } from "antd";
|
import { Space, Tooltip } from 'antd';
|
||||||
import { deleteAutomatedReorder, getAutomatedReorderList } from "../../Features/PurchaseOrder/PurchaseOrder";
|
import {
|
||||||
import { DefaultModal } from "../../Components/Modal/DefaultModal";
|
deleteAutomatedReorder,
|
||||||
import { FaRegEye } from "react-icons/fa";
|
getAutomatedReorderList,
|
||||||
import { render } from "react-dom";
|
} from '../../Features/PurchaseOrder/PurchaseOrder';
|
||||||
import { useAuth } from "../../AuthContext";
|
import { DefaultModal } from '../../Components/Modal/DefaultModal';
|
||||||
import "./AutomatedReorder.scss";
|
import { FaRegEye } from 'react-icons/fa';
|
||||||
|
import { render } from 'react-dom';
|
||||||
|
import { useAuth } from '../../AuthContext';
|
||||||
|
import './AutomatedReorder.scss';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
link: `${subDirectory}app-page/home`,
|
link: `${subDirectory}app-page/home`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Automated Reorder',
|
name: 'Automated Reorder',
|
||||||
link: `${subDirectory}setting/automated-reorder`,
|
link: `${subDirectory}setting/automated-reorder`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const AutomatedReorderList = () => {
|
const AutomatedReorderList = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const state = location?.state;
|
const state = location?.state;
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Product Receipt'
|
(e) => e?.MenuName === 'Product Receipt'
|
||||||
|
);
|
||||||
|
|
||||||
|
const AppId = getSession('AppId');
|
||||||
|
const CompId = getSession('CompId');
|
||||||
|
const BranchId = getSession('BranchId');
|
||||||
|
const UserId = getSession('UserId');
|
||||||
|
const UserType = getSession('UserType');
|
||||||
|
const [empData, setEmpData] = useState();
|
||||||
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
|
|
||||||
|
const [messageType, setMessageType] = useState(null);
|
||||||
|
const [messageData, setMessageData] = useState(null);
|
||||||
|
const [supplierModalOpen, setSupplierModalOpen] = useState(false);
|
||||||
|
const [supplierRecords, setSupplierRecords] = useState([]);
|
||||||
|
const [supplierRecordIndex, setSupplierRecordIndex] = useState(null);
|
||||||
|
const [page, setPage] = useState(1);
|
||||||
|
|
||||||
|
const [searchedText, setSearchedText] = useState('');
|
||||||
|
const [tableData, setTableData] = useState([]);
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: 'SL.NO',
|
||||||
|
dataIndex: 'SLNO',
|
||||||
|
key: 'SLNO',
|
||||||
|
width: '10%',
|
||||||
|
render: (_, record, index) => index + 1,
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Product Name',
|
||||||
|
dataIndex: 'ProdName',
|
||||||
|
key: 'ProdName',
|
||||||
|
render: (_, record) => `${record.ProdName} (${record.UOMName})`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Supplier',
|
||||||
|
dataIndex: 'Supplier',
|
||||||
|
key: 'Supplier',
|
||||||
|
align: 'center',
|
||||||
|
render: (_, record, index) => (
|
||||||
|
// <div className="productMasterImageUpload">
|
||||||
|
<Tooltip title={record.SupplierDetails ? 'View Image' : 'Upload Image'}>
|
||||||
|
<div className="eyeopenShow">
|
||||||
|
<FaRegEye
|
||||||
|
style={{ background: 'none', cursor: 'pointer' }}
|
||||||
|
size={22}
|
||||||
|
color={record.SupplierDetails && '#1F9B3A'}
|
||||||
|
onClick={() => {
|
||||||
|
setSupplierModalOpen(true);
|
||||||
|
setSupplierRecords(record.SupplierDetails);
|
||||||
|
setSupplierRecordIndex(index);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Order Type',
|
||||||
|
dataIndex: 'OrderType',
|
||||||
|
key: 'OrderType',
|
||||||
|
render: (_, record, index) =>
|
||||||
|
record.OrderType === 'E' ? 'End of Day (EOD)' : 'Immediate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Confirmation Type',
|
||||||
|
dataIndex: 'OrderProcessing',
|
||||||
|
key: 'OrderProcessing',
|
||||||
|
render: (_, record, index) =>
|
||||||
|
record.OrderProcessing === 'Y' ? 'Need Confirmation' : 'Auto',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Reorder Quantity',
|
||||||
|
dataIndex: 'OrderQty',
|
||||||
|
key: 'OrderQty',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Action',
|
||||||
|
dataIndex: 'Action',
|
||||||
|
key: 'Action',
|
||||||
|
width: '100px',
|
||||||
|
align: 'center',
|
||||||
|
render: (_, record, index) =>
|
||||||
|
record.ActiveStatus === 'A' ? (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
width: '100%',
|
||||||
|
gap: '10px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<EditFilled
|
||||||
|
style={{ color: '#1292EE' }}
|
||||||
|
onClick={() => handleEdit(record)}
|
||||||
|
/>
|
||||||
|
<DeleteFilled
|
||||||
|
style={{ color: '#FF4D4F' }}
|
||||||
|
onClick={() => handleActiveAndDeactive(record)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<ReloadOutlined
|
||||||
|
style={{ color: '#52C41A' }}
|
||||||
|
onClick={() => handleActiveAndDeactive(record)}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const supplierColumns = [
|
||||||
|
{
|
||||||
|
title: 'SL.NO',
|
||||||
|
dataIndex: 'SLNO',
|
||||||
|
key: 'SLNO',
|
||||||
|
width: '10%',
|
||||||
|
render: (_, record, index) => index + 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Supplier Name',
|
||||||
|
dataIndex: 'SuppName',
|
||||||
|
key: 'SuppName',
|
||||||
|
width: '20%',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
try {
|
||||||
|
if (AppId && CompId && BranchId) {
|
||||||
|
dispatch(changeBreadCrumb({ items: items }));
|
||||||
|
fetchData();
|
||||||
|
if (state?.Notify) {
|
||||||
|
setMessageType(state?.Notify.messageType);
|
||||||
|
setMessageData(state?.Notify.messageData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error, 'error: changeBreadCrumb');
|
||||||
|
}
|
||||||
|
}, [AppId, CompId, BranchId]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === 'Employee') {
|
||||||
|
fetchApi();
|
||||||
|
}
|
||||||
|
}, [UserType]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
|
||||||
|
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
||||||
|
hasAccess = true;
|
||||||
|
} else if (UserType === 'Employee') {
|
||||||
|
hasAccess = empData?.AddAccess === 'Y';
|
||||||
|
} else if (UserType === 'Super Admin User') {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
|
||||||
|
const fetchApi = async () => {
|
||||||
|
let data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
EmpId: UserId,
|
||||||
|
};
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
|
(item) => item.ConfigName === 'Automated Reorder'
|
||||||
);
|
);
|
||||||
|
setEmpData(datas?.[0]);
|
||||||
|
};
|
||||||
|
|
||||||
const AppId = getSession('AppId');
|
const fetchData = async () => {
|
||||||
const CompId = getSession('CompId');
|
try {
|
||||||
const BranchId = getSession('BranchId');
|
const res = await dispatch(
|
||||||
const UserId = getSession('UserId');
|
getAutomatedReorderList({ AppId, CompId, BranchId })
|
||||||
const UserType = getSession('UserType');
|
)?.unwrap();
|
||||||
const [empData, setEmpData] = useState();
|
if (res?.data?.statusCode === 1 && res?.data?.data?.length > 0) {
|
||||||
const [addnewAccess, setaddnewAccess] = useState(true);
|
setTableData(res?.data?.data);
|
||||||
|
} else {
|
||||||
const [messageType, setMessageType] = useState(null);
|
setTableData([]);
|
||||||
const [messageData, setMessageData] = useState(null);
|
}
|
||||||
const [supplierModalOpen, setSupplierModalOpen] = useState(false);
|
} catch (error) {
|
||||||
const [supplierRecords, setSupplierRecords] = useState([]);
|
console.error(error, 'error: getAutomatedReorderList');
|
||||||
const [supplierRecordIndex, setSupplierRecordIndex] = useState(null);
|
|
||||||
const [page, setPage] = useState(1);
|
|
||||||
|
|
||||||
|
|
||||||
const [searchedText, setSearchedText] = useState('');
|
|
||||||
const [tableData, setTableData] = useState([]);
|
|
||||||
|
|
||||||
const columns = [
|
|
||||||
{
|
|
||||||
title: 'SL.NO',
|
|
||||||
dataIndex: 'SLNO',
|
|
||||||
key: 'SLNO',
|
|
||||||
width: '10%',
|
|
||||||
render: (_, record, index) => index + 1,
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Product Name',
|
|
||||||
dataIndex: 'ProdName',
|
|
||||||
key: 'ProdName',
|
|
||||||
render: (_, record) => (
|
|
||||||
`${record.ProdName} (${record.UOMName})`
|
|
||||||
)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Supplier',
|
|
||||||
dataIndex: 'Supplier',
|
|
||||||
key: 'Supplier',
|
|
||||||
align: 'center',
|
|
||||||
render: (_, record, index) => (
|
|
||||||
// <div className="productMasterImageUpload">
|
|
||||||
<Tooltip title={record.SupplierDetails ? 'View Image' : 'Upload Image'}>
|
|
||||||
<div>
|
|
||||||
<FaRegEye
|
|
||||||
style={{ background: 'none', cursor: 'pointer' }}
|
|
||||||
size={22}
|
|
||||||
color={record.SupplierDetails && '#1F9B3A'}
|
|
||||||
onClick={() => {
|
|
||||||
setSupplierModalOpen(true);
|
|
||||||
setSupplierRecords(record.SupplierDetails);
|
|
||||||
setSupplierRecordIndex(index);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</Tooltip>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Order Type',
|
|
||||||
dataIndex: 'OrderType',
|
|
||||||
key: 'OrderType',
|
|
||||||
render: (_, record, index) => (
|
|
||||||
record.OrderType === 'E' ? 'End of Day (EOD)' : 'Immediate'
|
|
||||||
)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Confirmation Type',
|
|
||||||
dataIndex: 'OrderProcessing',
|
|
||||||
key: 'OrderProcessing',
|
|
||||||
render: (_, record, index) => (
|
|
||||||
record.OrderProcessing === 'Y' ? 'Need Confirmation' : 'Auto'
|
|
||||||
)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Reorder Quantity',
|
|
||||||
dataIndex: 'OrderQty',
|
|
||||||
key: 'OrderQty',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Action',
|
|
||||||
dataIndex: 'Action',
|
|
||||||
key: 'Action',
|
|
||||||
width: '100px',
|
|
||||||
align: 'center',
|
|
||||||
render: (_, record, index) => (
|
|
||||||
|
|
||||||
record.ActiveStatus === 'A' ? (
|
|
||||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%', gap: '10px' }}>
|
|
||||||
<EditFilled
|
|
||||||
style={{ color: '#1292EE' }}
|
|
||||||
onClick={() => handleEdit(record)}
|
|
||||||
/>
|
|
||||||
<DeleteFilled
|
|
||||||
style={{ color: '#FF4D4F' }}
|
|
||||||
onClick={() => handleActiveAndDeactive(record)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<ReloadOutlined
|
|
||||||
style={{ color: '#52C41A' }}
|
|
||||||
onClick={() => handleActiveAndDeactive(record)}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const supplierColumns = [
|
|
||||||
{
|
|
||||||
title: 'SL.NO',
|
|
||||||
dataIndex: 'SLNO',
|
|
||||||
key: 'SLNO',
|
|
||||||
width: '10%',
|
|
||||||
render: (_, record, index) => index + 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Supplier Name',
|
|
||||||
dataIndex: 'SuppName',
|
|
||||||
key: 'SuppName',
|
|
||||||
width: '20%',
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
try {
|
|
||||||
if (AppId && CompId && BranchId) {
|
|
||||||
dispatch(changeBreadCrumb({ items: items }));
|
|
||||||
fetchData()
|
|
||||||
if (state?.Notify) {
|
|
||||||
setMessageType(state?.Notify.messageType);
|
|
||||||
setMessageData(state?.Notify.messageData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error, 'error: changeBreadCrumb');
|
|
||||||
}
|
|
||||||
}, [AppId, CompId, BranchId]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (UserType === 'Employee') {
|
|
||||||
fetchApi();
|
|
||||||
}
|
|
||||||
}, [UserType]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
let hasAccess = false;
|
|
||||||
|
|
||||||
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
|
||||||
hasAccess = true;
|
|
||||||
} else if (UserType === 'Employee') {
|
|
||||||
hasAccess = empData?.AddAccess === 'Y';
|
|
||||||
} else if (UserType === 'Super Admin User') {
|
|
||||||
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
|
||||||
}
|
|
||||||
|
|
||||||
setaddnewAccess(!hasAccess);
|
|
||||||
}, [empData, SAAccessCommonMaster, UserType]);
|
|
||||||
|
|
||||||
const fetchApi = async () => {
|
|
||||||
let data = {
|
|
||||||
CompId: CompId,
|
|
||||||
BranchId: BranchId,
|
|
||||||
AppId: AppId,
|
|
||||||
EmpId: UserId,
|
|
||||||
};
|
|
||||||
let response = await dispatch(getEmpAccess(data)).unwrap();
|
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
|
||||||
(item) => item.ConfigName === 'Automated Reorder'
|
|
||||||
);
|
|
||||||
setEmpData(datas?.[0]);
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchData = async () => {
|
|
||||||
try {
|
|
||||||
const res = await dispatch(getAutomatedReorderList({ AppId, CompId, BranchId }))?.unwrap();
|
|
||||||
if (res?.data?.statusCode === 1 && res?.data?.data?.length > 0) {
|
|
||||||
setTableData(res?.data?.data)
|
|
||||||
} else {
|
|
||||||
setTableData([])
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error, 'error: getAutomatedReorderList');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const onSearch = (value) => {
|
const onSearch = (value) => {
|
||||||
setSearchedText(value);
|
setSearchedText(value);
|
||||||
};
|
};
|
||||||
const onSearchChange = (e) => {
|
const onSearchChange = (e) => {
|
||||||
setSearchedText(e?.target?.value);
|
setSearchedText(e?.target?.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
navigate(`${subDirectory}setting/automated-reorder/new`);
|
navigate(`${subDirectory}setting/automated-reorder/new`);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEdit = (record) => {
|
||||||
|
navigate(`${subDirectory}setting/automated-reorder/update`, {
|
||||||
|
state: {
|
||||||
|
editstate: record,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const handleActiveAndDeactive = async (record) => {
|
||||||
|
const res = await dispatch(
|
||||||
|
deleteAutomatedReorder({
|
||||||
|
UniqueId: record?.UniqueId,
|
||||||
|
UpdatedBy: UserId,
|
||||||
|
ActiveStatus: record?.ActiveStatus === 'A' ? 'D' : 'A',
|
||||||
|
})
|
||||||
|
)?.unwrap();
|
||||||
|
if (res?.data?.statusCode === 1) {
|
||||||
|
setMessageType('success');
|
||||||
|
setMessageData(
|
||||||
|
record?.ActiveStatus === 'A'
|
||||||
|
? 'Deactivated Successfully'
|
||||||
|
: 'Activated Successfully'
|
||||||
|
);
|
||||||
|
fetchData();
|
||||||
|
} else {
|
||||||
|
setMessageType('error');
|
||||||
|
setMessageData(res?.data?.message);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const handleEdit = (record) => {
|
const onComplete = useCallback(() => {
|
||||||
navigate(`${subDirectory}setting/automated-reorder/update`, {
|
setMessageType(null);
|
||||||
state: {
|
setMessageData(null);
|
||||||
editstate: record,
|
}, []);
|
||||||
}
|
const handlePageChange = (current) => {
|
||||||
});
|
setPage(current);
|
||||||
}
|
};
|
||||||
const handleActiveAndDeactive = async (record) => {
|
|
||||||
const res = await dispatch(deleteAutomatedReorder({ UniqueId: record?.UniqueId, UpdatedBy: UserId, ActiveStatus: record?.ActiveStatus === 'A' ? 'D' : 'A' }))?.unwrap();
|
|
||||||
if (res?.data?.statusCode === 1) {
|
|
||||||
setMessageType('success');
|
|
||||||
setMessageData(record?.ActiveStatus === 'A' ? 'Deactivated Successfully' : 'Activated Successfully');
|
|
||||||
fetchData();
|
|
||||||
} else {
|
|
||||||
setMessageType('error');
|
|
||||||
setMessageData(res?.data?.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const onComplete = useCallback(() => {
|
return (
|
||||||
setMessageType(null);
|
<section className="automated-reorder-list-container">
|
||||||
setMessageData(null);
|
<Messages
|
||||||
}, []);
|
messageType={messageType}
|
||||||
const handlePageChange = (current) => {
|
messageData={messageData}
|
||||||
setPage(current);
|
onComplete={onComplete}
|
||||||
};
|
/>
|
||||||
|
<div className="automated-reorder-list-wrapper">
|
||||||
return (
|
<div className="automated-reorder-list-header">
|
||||||
<section className="automated-reorder-list-container">
|
<div className="formAddNew">
|
||||||
<Messages
|
<div>
|
||||||
messageType={messageType}
|
<FormHeader title={'Automated Reorder'} />
|
||||||
messageData={messageData}
|
|
||||||
onComplete={onComplete}
|
|
||||||
/>
|
|
||||||
<div className="automated-reorder-list-wrapper">
|
|
||||||
<div className="automated-reorder-list-header">
|
|
||||||
<div className="formAddNew">
|
|
||||||
<div>
|
|
||||||
<FormHeader title={'Automated Reorder'} />
|
|
||||||
</div>
|
|
||||||
<div className="searchAddDiv">
|
|
||||||
<div className="formSearch">
|
|
||||||
<Search
|
|
||||||
placeholder="Search"
|
|
||||||
onSearch={onSearch}
|
|
||||||
onSearchChange={onSearchChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<Buttons
|
|
||||||
buttonText={'Add New'}
|
|
||||||
handleSubmit={handleAdd}
|
|
||||||
disabled={addnewAccess}
|
|
||||||
color="901D77"
|
|
||||||
icon={<PlusOutlined />}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="automated-reorder-list-content">
|
|
||||||
<Tables
|
|
||||||
columns={columns}
|
|
||||||
data={tableData}
|
|
||||||
ownPagination={true}
|
|
||||||
pagination={{
|
|
||||||
current: page,
|
|
||||||
onChange: handlePageChange,
|
|
||||||
defaultPageSize: 10,
|
|
||||||
showSizeChanger: false,
|
|
||||||
hideOnSinglePage: true
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<DefaultModal
|
<div className="searchAddDiv">
|
||||||
open={supplierModalOpen}
|
<div className="formSearch">
|
||||||
title={'Suppliers'}
|
<Search
|
||||||
width={500}
|
placeholder="Search"
|
||||||
footer={false}
|
onSearch={onSearch}
|
||||||
handleCancel={() => {
|
onSearchChange={onSearchChange}
|
||||||
setSupplierModalOpen(false);
|
/>
|
||||||
setSupplierRecords(null);
|
</div>
|
||||||
setSupplierRecordIndex(null);
|
<Buttons
|
||||||
}}
|
buttonText={'Add New'}
|
||||||
children={
|
handleSubmit={handleAdd}
|
||||||
<div className="automated-reorder-list-content">
|
disabled={addnewAccess}
|
||||||
<Tables
|
color="901D77"
|
||||||
columns={supplierColumns}
|
icon={<PlusOutlined />}
|
||||||
data={supplierRecords}
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
</div>
|
||||||
/>
|
<div className="automated-reorder-list-content">
|
||||||
</section>
|
<Tables
|
||||||
)
|
columns={columns}
|
||||||
}
|
data={tableData}
|
||||||
|
ownPagination={true}
|
||||||
|
pagination={{
|
||||||
|
current: page,
|
||||||
|
onChange: handlePageChange,
|
||||||
|
defaultPageSize: 10,
|
||||||
|
showSizeChanger: false,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<DefaultModal
|
||||||
|
open={supplierModalOpen}
|
||||||
|
title={'Suppliers'}
|
||||||
|
width={500}
|
||||||
|
footer={false}
|
||||||
|
handleCancel={() => {
|
||||||
|
setSupplierModalOpen(false);
|
||||||
|
setSupplierRecords(null);
|
||||||
|
setSupplierRecordIndex(null);
|
||||||
|
}}
|
||||||
|
children={
|
||||||
|
<div className="automated-reorder-list-content">
|
||||||
|
<Tables columns={supplierColumns} data={supplierRecords} />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export default AutomatedReorderList
|
export default AutomatedReorderList;
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
const quantityInputRef = useRef(null);
|
const quantityInputRef = useRef(null);
|
||||||
const priceChangeInputRef = useRef(null);
|
const priceChangeInputRef = useRef(null);
|
||||||
const reductionInputRef = useRef(null);
|
const reductionInputRef = useRef(null);
|
||||||
const { setIndex = () => {} } = props;
|
const { setIndex = () => { } } = props;
|
||||||
|
|
||||||
const [disableSubmitButton, setDisableSubmitButton] = useState(false);
|
const [disableSubmitButton, setDisableSubmitButton] = useState(false);
|
||||||
console.log(disableSubmitButton, 'disableSubmitButton');
|
console.log(disableSubmitButton, 'disableSubmitButton');
|
||||||
|
|
@ -522,7 +522,15 @@ const BSBillingEditQuantity = (props) => {
|
||||||
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
||||||
cartItem?.BookingTypeName === editedProduct?.BookingTypeName &&
|
cartItem?.BookingTypeName === editedProduct?.BookingTypeName &&
|
||||||
!cartItem?.SalesId
|
!cartItem?.SalesId && ((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
|
||||||
|
? true
|
||||||
|
: cartItem?.OfferMode !== 'B') &&
|
||||||
|
cartItem?.OfferMode !== 'P' &&
|
||||||
|
cartItem?.OfferMode !== 'C' &&
|
||||||
|
cartItem?.OfferMode !== 'O' &&
|
||||||
|
cartItem?.OfferMode !== 'L'
|
||||||
|
? true
|
||||||
|
: cartItem?.Offer === 0)
|
||||||
);
|
);
|
||||||
// changing for one piece stock checking
|
// changing for one piece stock checking
|
||||||
const isItemInCartfilter = CartOrderDetails?.filter(
|
const isItemInCartfilter = CartOrderDetails?.filter(
|
||||||
|
|
@ -530,7 +538,15 @@ const BSBillingEditQuantity = (props) => {
|
||||||
cartItem?.ProdId === editedProduct?.ProdId &&
|
cartItem?.ProdId === editedProduct?.ProdId &&
|
||||||
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
cartItem?.OrderRate !== editedProduct?.OrderRate &&
|
cartItem?.OrderRate !== editedProduct?.OrderRate &&
|
||||||
!cartItem?.SalesId
|
!cartItem?.SalesId && ((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
|
||||||
|
? true
|
||||||
|
: cartItem?.OfferMode !== 'B') &&
|
||||||
|
cartItem?.OfferMode !== 'P' &&
|
||||||
|
cartItem?.OfferMode !== 'C' &&
|
||||||
|
cartItem?.OfferMode !== 'O' &&
|
||||||
|
cartItem?.OfferMode !== 'L'
|
||||||
|
? true
|
||||||
|
: cartItem?.Offer === 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
const isItemInCartHold = CartOrderDetails?.find(
|
const isItemInCartHold = CartOrderDetails?.find(
|
||||||
|
|
@ -538,7 +554,15 @@ const BSBillingEditQuantity = (props) => {
|
||||||
cartItem?.ProdId === editedProduct?.ProdId &&
|
cartItem?.ProdId === editedProduct?.ProdId &&
|
||||||
cartItem?.InwardDtlId === editedProduct.InwardDtlId &&
|
cartItem?.InwardDtlId === editedProduct.InwardDtlId &&
|
||||||
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
||||||
cartItem?.BookingTypeName === editedProduct?.BookingTypeName
|
cartItem?.BookingTypeName === editedProduct?.BookingTypeName && ((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
|
||||||
|
? true
|
||||||
|
: cartItem?.OfferMode !== 'B') &&
|
||||||
|
cartItem?.OfferMode !== 'P' &&
|
||||||
|
cartItem?.OfferMode !== 'C' &&
|
||||||
|
cartItem?.OfferMode !== 'O' &&
|
||||||
|
cartItem?.OfferMode !== 'L'
|
||||||
|
? true
|
||||||
|
: cartItem?.Offer === 0)
|
||||||
); // check if the item is already in the cart
|
); // check if the item is already in the cart
|
||||||
const isItemInCartHoldfilter = CartOrderDetails?.filter(
|
const isItemInCartHoldfilter = CartOrderDetails?.filter(
|
||||||
(cartItem) =>
|
(cartItem) =>
|
||||||
|
|
@ -547,7 +571,15 @@ const BSBillingEditQuantity = (props) => {
|
||||||
!(
|
!(
|
||||||
(cartItem?.OrderRate === editedProduct?.OrderRate)
|
(cartItem?.OrderRate === editedProduct?.OrderRate)
|
||||||
// && cartItem?.BookingTypeName === editedProduct?.BookingTypeName
|
// && cartItem?.BookingTypeName === editedProduct?.BookingTypeName
|
||||||
)
|
) && ((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
|
||||||
|
? true
|
||||||
|
: cartItem?.OfferMode !== 'B') &&
|
||||||
|
cartItem?.OfferMode !== 'P' &&
|
||||||
|
cartItem?.OfferMode !== 'C' &&
|
||||||
|
cartItem?.OfferMode !== 'O' &&
|
||||||
|
cartItem?.OfferMode !== 'L'
|
||||||
|
? true
|
||||||
|
: cartItem?.Offer === 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
@ -809,7 +841,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
return (
|
return (
|
||||||
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
cartItem?.OfferMessage?.[0]?.OfferId ===
|
cartItem?.OfferMessage?.[0]?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
cartItem?.OfferMode === editedProduct?.OfferMode &&
|
cartItem?.OfferMode === editedProduct?.OfferMode &&
|
||||||
cartItem?.BookingTypeName !== editedProduct?.BookingTypeName
|
cartItem?.BookingTypeName !== editedProduct?.BookingTypeName
|
||||||
);
|
);
|
||||||
|
|
@ -943,7 +975,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
||||||
cartItem?.BookingTypeName !==
|
cartItem?.BookingTypeName !==
|
||||||
editedProduct?.BookingTypeName &&
|
editedProduct?.BookingTypeName &&
|
||||||
!cartItem?.OfferMode &&
|
!cartItem?.OfferMode &&
|
||||||
cartItem?.Offer === 0
|
cartItem?.Offer === 0
|
||||||
);
|
);
|
||||||
|
|
@ -957,7 +989,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
||||||
cartItem?.BookingTypeName !==
|
cartItem?.BookingTypeName !==
|
||||||
editedProduct?.BookingTypeName &&
|
editedProduct?.BookingTypeName &&
|
||||||
cartItem?.OfferMode === editedProduct?.OfferMode &&
|
cartItem?.OfferMode === editedProduct?.OfferMode &&
|
||||||
cartItem?.Offer > 0
|
cartItem?.Offer > 0
|
||||||
);
|
);
|
||||||
|
|
@ -1090,7 +1122,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
)
|
)
|
||||||
) &&
|
) &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
product?.OfferMode === editedProduct?.OfferMode
|
product?.OfferMode === editedProduct?.OfferMode
|
||||||
) {
|
) {
|
||||||
const freeQty =
|
const freeQty =
|
||||||
|
|
@ -1123,7 +1155,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
|
|
@ -1206,7 +1238,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
)
|
)
|
||||||
) &&
|
) &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
product?.OfferMode === editedProduct?.OfferMode
|
product?.OfferMode === editedProduct?.OfferMode
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
|
|
@ -1236,7 +1268,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
|
|
@ -1423,7 +1455,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
|
|
@ -1525,7 +1557,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
|
|
@ -1679,7 +1711,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
) &&
|
) &&
|
||||||
cartItem?.Offer &&
|
cartItem?.Offer &&
|
||||||
isFreeProductApplicable?.OfferId ===
|
isFreeProductApplicable?.OfferId ===
|
||||||
cartItem?.OfferMessage?.[0]?.OfferId
|
cartItem?.OfferMessage?.[0]?.OfferId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -1968,11 +2000,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
product?.ProdId === editedProduct?.ProdId &&
|
product?.ProdId === editedProduct?.ProdId &&
|
||||||
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) &&
|
otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) &&
|
||||||
product?.OfferMode ===
|
product?.OfferMode ===
|
||||||
(sameBookingTypeProduct?.OfferMode ||
|
(sameBookingTypeProduct?.OfferMode ||
|
||||||
otherBookingTypeProduct?.OfferMode)
|
otherBookingTypeProduct?.OfferMode)
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
...product,
|
...product,
|
||||||
|
|
@ -2006,11 +2038,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) &&
|
otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) &&
|
||||||
offerProduct?.OfferMode ===
|
offerProduct?.OfferMode ===
|
||||||
(sameBookingTypeProduct?.OfferMode ||
|
(sameBookingTypeProduct?.OfferMode ||
|
||||||
otherBookingTypeProduct?.OfferMode);
|
otherBookingTypeProduct?.OfferMode);
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
// Get loyalty points from the matching free product
|
// Get loyalty points from the matching free product
|
||||||
|
|
@ -2151,7 +2183,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
cartItem?.Offer > 0 &&
|
cartItem?.Offer > 0 &&
|
||||||
isFreeProductApplicable?.OfferMode === cartItem?.OfferMode &&
|
isFreeProductApplicable?.OfferMode === cartItem?.OfferMode &&
|
||||||
isFreeProductApplicable?.OfferId ===
|
isFreeProductApplicable?.OfferId ===
|
||||||
cartItem?.OfferMessage?.[0]?.OfferId
|
cartItem?.OfferMessage?.[0]?.OfferId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -2254,11 +2286,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2329,12 +2361,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
product?.ProdId === editedProduct?.ProdId &&
|
product?.ProdId === editedProduct?.ProdId &&
|
||||||
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
product?.OfferMode ===
|
product?.OfferMode ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMode ||
|
(sameBookingTypeFreeProduct?.OfferMode ||
|
||||||
otherBookingTypeFreeProduct?.OfferMode)
|
otherBookingTypeFreeProduct?.OfferMode)
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
...product,
|
...product,
|
||||||
|
|
@ -2368,13 +2400,13 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMessage?.[0]
|
(sameBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId ||
|
?.OfferId ||
|
||||||
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
offerProduct?.OfferMode ===
|
offerProduct?.OfferMode ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMode ||
|
(sameBookingTypeFreeProduct?.OfferMode ||
|
||||||
otherBookingTypeFreeProduct?.OfferMode);
|
otherBookingTypeFreeProduct?.OfferMode);
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
// Get loyalty points from the matching free product
|
// Get loyalty points from the matching free product
|
||||||
|
|
@ -2456,11 +2488,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
sameBookingTypeProduct.InwardDtlId &&
|
sameBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
sameBookingTypeProduct.BookingTypeName &&
|
sameBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
sameBookingTypeProduct.OrderRate &&
|
sameBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2513,11 +2545,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
sameBookingTypeProduct.InwardDtlId &&
|
sameBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
sameBookingTypeProduct.BookingTypeName &&
|
sameBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
sameBookingTypeProduct.OrderRate &&
|
sameBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2606,11 +2638,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem?.InwardDtlId ===
|
cartItem?.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem?.BookingTypeName ===
|
cartItem?.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem?.OrderRate ===
|
cartItem?.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem?.OfferMode &&
|
cartItem?.OfferMode &&
|
||||||
cartItem?.Offer > 0
|
cartItem?.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2639,11 +2671,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2673,11 +2705,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2776,12 +2808,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
product?.ProdId === editedProduct?.ProdId &&
|
product?.ProdId === editedProduct?.ProdId &&
|
||||||
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
product?.OfferMode ===
|
product?.OfferMode ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMode ||
|
(sameBookingTypeFreeProduct?.OfferMode ||
|
||||||
otherBookingTypeFreeProduct?.OfferMode)
|
otherBookingTypeFreeProduct?.OfferMode)
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
...product,
|
...product,
|
||||||
|
|
@ -2815,12 +2847,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeProduct?.OfferMessage?.[0]
|
otherBookingTypeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
offerProduct?.OfferMode ===
|
offerProduct?.OfferMode ===
|
||||||
(sameBookingTypeProduct?.OfferMode ||
|
(sameBookingTypeProduct?.OfferMode ||
|
||||||
otherBookingTypeProduct?.OfferMode);
|
otherBookingTypeProduct?.OfferMode);
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
// Get loyalty points from the matching free product
|
// Get loyalty points from the matching free product
|
||||||
|
|
@ -2899,11 +2931,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
sameBookingTypeProduct.InwardDtlId &&
|
sameBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
sameBookingTypeProduct.BookingTypeName &&
|
sameBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
sameBookingTypeProduct.OrderRate &&
|
sameBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2962,11 +2994,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -3038,12 +3070,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
product?.ProdId === editedProduct?.ProdId &&
|
product?.ProdId === editedProduct?.ProdId &&
|
||||||
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
product?.OfferMode ===
|
product?.OfferMode ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMode ||
|
(sameBookingTypeFreeProduct?.OfferMode ||
|
||||||
otherBookingTypeFreeProduct?.OfferMode)
|
otherBookingTypeFreeProduct?.OfferMode)
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
...product,
|
...product,
|
||||||
|
|
@ -3077,12 +3109,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeProduct?.OfferMessage?.[0]
|
otherBookingTypeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
offerProduct?.OfferMode ===
|
offerProduct?.OfferMode ===
|
||||||
(sameBookingTypeProduct?.OfferMode ||
|
(sameBookingTypeProduct?.OfferMode ||
|
||||||
otherBookingTypeProduct?.OfferMode);
|
otherBookingTypeProduct?.OfferMode);
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
// Get loyalty points from the matching free product
|
// Get loyalty points from the matching free product
|
||||||
|
|
@ -3217,21 +3249,21 @@ const BSBillingEditQuantity = (props) => {
|
||||||
}),
|
}),
|
||||||
...(!offerApply && itemDiscountPrice > 0
|
...(!offerApply && itemDiscountPrice > 0
|
||||||
? {
|
? {
|
||||||
DiscountAmt: safeRound(itemDiscountPrice * fixedQty),
|
DiscountAmt: safeRound(itemDiscountPrice * fixedQty),
|
||||||
DiscountType:
|
DiscountType:
|
||||||
itemDiscountPercentageSelection === 'Fixed' ? 'F' : 'P',
|
itemDiscountPercentageSelection === 'Fixed' ? 'F' : 'P',
|
||||||
DiscountValue:
|
DiscountValue:
|
||||||
itemDiscountPercentageSelection === 'Fixed'
|
itemDiscountPercentageSelection === 'Fixed'
|
||||||
? itemDiscountPrice * fixedQty
|
? itemDiscountPrice * fixedQty
|
||||||
: ((itemDiscountPrice * fixedQty) /
|
: ((itemDiscountPrice * fixedQty) /
|
||||||
(newPrice > 0 ? newPrice : editedProduct?.OrderRate)) *
|
(newPrice > 0 ? newPrice : editedProduct?.OrderRate)) *
|
||||||
100,
|
100,
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
DiscountAmt: null,
|
DiscountAmt: null,
|
||||||
DiscountType: null,
|
DiscountType: null,
|
||||||
DiscountValue: null,
|
DiscountValue: null,
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (hasOffer) {
|
if (hasOffer) {
|
||||||
|
|
@ -3256,17 +3288,17 @@ const BSBillingEditQuantity = (props) => {
|
||||||
changeOrderCardDetails(
|
changeOrderCardDetails(
|
||||||
CartOrderDetails?.map((i) =>
|
CartOrderDetails?.map((i) =>
|
||||||
i?.InwardDtlId == updatedProduct?.InwardDtlId &&
|
i?.InwardDtlId == updatedProduct?.InwardDtlId &&
|
||||||
i?.BookingTypeName == updatedProduct?.BookingTypeName &&
|
i?.BookingTypeName == updatedProduct?.BookingTypeName &&
|
||||||
i?.localId === updatedProduct?.localId
|
i?.localId === updatedProduct?.localId
|
||||||
? {
|
? {
|
||||||
...updatedProduct,
|
...updatedProduct,
|
||||||
Offer: 0,
|
Offer: 0,
|
||||||
OfferType:
|
OfferType:
|
||||||
updatedProduct?.Type === 'C'
|
updatedProduct?.Type === 'C'
|
||||||
? updatedProduct?.OfferType
|
? updatedProduct?.OfferType
|
||||||
: null,
|
: null,
|
||||||
OfferMessage: null,
|
OfferMessage: null,
|
||||||
}
|
}
|
||||||
: i
|
: i
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -3302,10 +3334,10 @@ const BSBillingEditQuantity = (props) => {
|
||||||
((c?.OfferModeType && c?.OfferMode === 'B'
|
((c?.OfferModeType && c?.OfferMode === 'B'
|
||||||
? true
|
? true
|
||||||
: c?.OfferMode !== 'B') &&
|
: c?.OfferMode !== 'B') &&
|
||||||
c?.OfferMode !== 'P' &&
|
c?.OfferMode !== 'P' &&
|
||||||
c?.OfferMode !== 'C' &&
|
c?.OfferMode !== 'C' &&
|
||||||
c?.OfferMode !== 'O' &&
|
c?.OfferMode !== 'O' &&
|
||||||
c?.OfferMode !== 'L'
|
c?.OfferMode !== 'L'
|
||||||
? true
|
? true
|
||||||
: c?.Offer === 0);
|
: c?.Offer === 0);
|
||||||
|
|
||||||
|
|
@ -4040,14 +4072,14 @@ const BSBillingEditQuantity = (props) => {
|
||||||
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
||||||
{((RadioBtnSelection == 'Price' && disableSubmitButton) ||
|
{((RadioBtnSelection == 'Price' && disableSubmitButton) ||
|
||||||
RadioBtnSelection == 'Quantity') && (
|
RadioBtnSelection == 'Quantity') && (
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText="Submit"
|
buttonText="Submit"
|
||||||
color="901D77"
|
color="901D77"
|
||||||
htmlType
|
htmlType
|
||||||
// handleSubmit={AddProductQuantity}
|
// handleSubmit={AddProductQuantity}
|
||||||
icon={<ArrowRightOutlined />}
|
icon={<ArrowRightOutlined />}
|
||||||
></Buttons>
|
></Buttons>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@ import {
|
||||||
changeSearchedData,
|
changeSearchedData,
|
||||||
GlobalSelectedCustDisable,
|
GlobalSelectedCustDisable,
|
||||||
GlobalOrderStatus,
|
GlobalOrderStatus,
|
||||||
|
PostCancelPayment,
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
|
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
|
||||||
import {
|
import {
|
||||||
|
|
@ -944,7 +945,7 @@ export default function BST1Payment() {
|
||||||
|
|
||||||
const selectedStyle =
|
const selectedStyle =
|
||||||
stylesMap[
|
stylesMap[
|
||||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||||
];
|
];
|
||||||
|
|
||||||
if (selectedStyle) {
|
if (selectedStyle) {
|
||||||
|
|
@ -1392,6 +1393,15 @@ export default function BST1Payment() {
|
||||||
: AddBookingDetails(BookingType, true);
|
: AddBookingDetails(BookingType, true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// PostCancelPayment
|
||||||
|
const CancelPayment = async () => {
|
||||||
|
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
|
||||||
|
if (response?.data?.statusCode) {
|
||||||
|
ClearAllGlobalStateDatas();
|
||||||
|
CustomerDisplay();
|
||||||
|
setBusinessUPI(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
const financialYearError = async () => {
|
const financialYearError = async () => {
|
||||||
setMessageType('error');
|
setMessageType('error');
|
||||||
setMessageData('Financial Year-Based Sales Not Yet Started');
|
setMessageData('Financial Year-Based Sales Not Yet Started');
|
||||||
|
|
@ -2069,15 +2079,15 @@ export default function BST1Payment() {
|
||||||
OrderStatus: 'O',
|
OrderStatus: 'O',
|
||||||
OrderType:
|
OrderType:
|
||||||
BookingType === 'Dine In' ||
|
BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
Estimation?.SettingValue == 'N'
|
Estimation?.SettingValue == 'N'
|
||||||
? 'S'
|
? 'S'
|
||||||
: GlobEstBooking === 'OvrAllEst'
|
: GlobEstBooking === 'OvrAllEst'
|
||||||
? 'E'
|
? 'E'
|
||||||
: GlobEstBooking === 'ParEst'
|
: GlobEstBooking === 'ParEst'
|
||||||
? GlobProdwisedata?.includes(
|
? GlobProdwisedata?.includes(
|
||||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||||
)
|
)
|
||||||
? 'E'
|
? 'E'
|
||||||
: 'S'
|
: 'S'
|
||||||
: 'S',
|
: 'S',
|
||||||
|
|
@ -2170,7 +2180,7 @@ export default function BST1Payment() {
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
OrderDtlDetails:
|
OrderDtlDetails:
|
||||||
|
|
@ -2187,9 +2197,9 @@ export default function BST1Payment() {
|
||||||
? globalTipAmount === 0
|
? globalTipAmount === 0
|
||||||
? SelectedTableDetails
|
? SelectedTableDetails
|
||||||
: SelectedTableDetails?.map((item) => ({
|
: SelectedTableDetails?.map((item) => ({
|
||||||
...item,
|
...item,
|
||||||
TipsAmount: globalTipAmount,
|
TipsAmount: globalTipAmount,
|
||||||
}))
|
}))
|
||||||
: null,
|
: null,
|
||||||
|
|
||||||
SalesPaymentType: 'normal',
|
SalesPaymentType: 'normal',
|
||||||
|
|
@ -2205,8 +2215,8 @@ export default function BST1Payment() {
|
||||||
? PaymentgatewayUPI?.[0]?.ModeId
|
? PaymentgatewayUPI?.[0]?.ModeId
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||||
? BusinessPayOption?.find(
|
? BusinessPayOption?.find(
|
||||||
(busupi) => busupi?.ModeId === UpiId
|
(busupi) => busupi?.ModeId === UpiId
|
||||||
)?.ModeId
|
)?.ModeId
|
||||||
: paybtnselected
|
: paybtnselected
|
||||||
: paybtnselected
|
: paybtnselected
|
||||||
? paybtnselected
|
? paybtnselected
|
||||||
|
|
@ -2219,15 +2229,15 @@ export default function BST1Payment() {
|
||||||
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||||
? null
|
? null
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||||
?.MerchantId
|
?.MerchantId
|
||||||
: null,
|
: null,
|
||||||
PaymentOptionType:
|
PaymentOptionType:
|
||||||
salesBillEdit &&
|
salesBillEdit &&
|
||||||
currentOrderNetAmount < previousNetAmount &&
|
currentOrderNetAmount < previousNetAmount &&
|
||||||
(refundPaySelectedName?.toLowerCase() === 'cash' ||
|
(refundPaySelectedName?.toLowerCase() === 'cash' ||
|
||||||
refundPaySelectedName?.toLowerCase() === 'credit')
|
refundPaySelectedName?.toLowerCase() === 'credit')
|
||||||
? 'PC'
|
? 'PC'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'cash'
|
: Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'PC'
|
? 'PC'
|
||||||
|
|
@ -2247,29 +2257,29 @@ export default function BST1Payment() {
|
||||||
? null
|
? null
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'default'
|
: SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||||
?.UPIDetailId
|
?.UPIDetailId
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||||
? BusinessPayOption?.find(
|
? BusinessPayOption?.find(
|
||||||
(busupi) => busupi?.ModeId === UpiId
|
(busupi) => busupi?.ModeId === UpiId
|
||||||
)?.MerchantUPIId
|
)?.MerchantUPIId
|
||||||
: null,
|
: null,
|
||||||
AccountDtl:
|
AccountDtl:
|
||||||
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||||
? []
|
? []
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||||
(upipay) => upipay?.UPIId === UpiId
|
(upipay) => upipay?.UPIId === UpiId
|
||||||
)
|
)
|
||||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||||
SelectedCardOption?.toLowerCase() === 'pd')
|
SelectedCardOption?.toLowerCase() === 'pd')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
||||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||||
SelectedCardOption?.toLowerCase() === 'pg')
|
SelectedCardOption?.toLowerCase() === 'pg')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||||
: [],
|
: [],
|
||||||
PaymentStatus:
|
PaymentStatus:
|
||||||
|
|
@ -2280,13 +2290,13 @@ export default function BST1Payment() {
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
Debit:
|
Debit:
|
||||||
salesBillEdit &&
|
salesBillEdit &&
|
||||||
currentOrderNetAmount < previousNetAmount &&
|
currentOrderNetAmount < previousNetAmount &&
|
||||||
refundPaySelectedName?.toLowerCase() === 'credit'
|
refundPaySelectedName?.toLowerCase() === 'credit'
|
||||||
? Math.round(previousNetAmount - currentOrderNetAmount)
|
? Math.round(previousNetAmount - currentOrderNetAmount)
|
||||||
: 0,
|
: 0,
|
||||||
Credit: salesBillEdit
|
Credit: salesBillEdit
|
||||||
|
|
@ -2362,14 +2372,14 @@ export default function BST1Payment() {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(
|
setMessageData(
|
||||||
response?.data?.response +
|
response?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(response?.data?.OrderDetails?.length > 0
|
(response?.data?.OrderDetails?.length > 0
|
||||||
? response?.data?.OrderId &&
|
? response?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
response?.data?.OrderId,
|
response?.data?.OrderId,
|
||||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
response?.data?.OrderDetails?.length > 0 &&
|
response?.data?.OrderDetails?.length > 0 &&
|
||||||
setPrintOrderDetails([response?.data]);
|
setPrintOrderDetails([response?.data]);
|
||||||
|
|
@ -2526,14 +2536,14 @@ export default function BST1Payment() {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(
|
setMessageData(
|
||||||
response?.data?.response +
|
response?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(response?.data?.OrderDetails?.length > 0
|
(response?.data?.OrderDetails?.length > 0
|
||||||
? response?.data?.OrderId &&
|
? response?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
response?.data?.OrderId,
|
response?.data?.OrderId,
|
||||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
response?.data?.OrderDetails?.length > 0 &&
|
response?.data?.OrderDetails?.length > 0 &&
|
||||||
setPrintOrderDetails([response?.data]);
|
setPrintOrderDetails([response?.data]);
|
||||||
|
|
@ -2634,14 +2644,14 @@ export default function BST1Payment() {
|
||||||
}
|
}
|
||||||
setMessageData(
|
setMessageData(
|
||||||
response?.data?.response +
|
response?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(response?.data?.OrderDetails?.length > 0
|
(response?.data?.OrderDetails?.length > 0
|
||||||
? response?.data?.OrderId &&
|
? response?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
response?.data?.OrderId,
|
response?.data?.OrderId,
|
||||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
if (response?.data?.OrderDetails?.length > 0) {
|
if (response?.data?.OrderDetails?.length > 0) {
|
||||||
setPrintOrderDetails([response?.data]);
|
setPrintOrderDetails([response?.data]);
|
||||||
|
|
@ -2816,14 +2826,14 @@ export default function BST1Payment() {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(
|
setMessageData(
|
||||||
bookingpaymentupdate?.data?.response +
|
bookingpaymentupdate?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||||
? bookingpaymentupdate?.data?.OrderId &&
|
? bookingpaymentupdate?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
bookingpaymentupdate?.data?.OrderId,
|
bookingpaymentupdate?.data?.OrderId,
|
||||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
||||||
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
||||||
|
|
@ -2841,7 +2851,7 @@ export default function BST1Payment() {
|
||||||
if (
|
if (
|
||||||
Date.now() - startTime >
|
Date.now() - startTime >
|
||||||
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
||||||
60000
|
60000
|
||||||
) {
|
) {
|
||||||
// 60,000 ms = 1 minute
|
// 60,000 ms = 1 minute
|
||||||
|
|
||||||
|
|
@ -3650,29 +3660,29 @@ export default function BST1Payment() {
|
||||||
{tableOptions.find(
|
{tableOptions.find(
|
||||||
(item) => item.OptionName === 'AddCustomer'
|
(item) => item.OptionName === 'AddCustomer'
|
||||||
) && (
|
) && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
columnGap: '0.5rem',
|
columnGap: '0.5rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<BSCustomerSelect />
|
<BSCustomerSelect />
|
||||||
|
|
||||||
<TooltipWrapper title={'Add Customer'} isMobile={isMobile}>
|
<TooltipWrapper title={'Add Customer'} isMobile={isMobile}>
|
||||||
{' '}
|
{' '}
|
||||||
<PozoAddCustomerIcon
|
<PozoAddCustomerIcon
|
||||||
className="BSBillingNav-icon-table-icon"
|
className="BSBillingNav-icon-table-icon"
|
||||||
onClick={handleAddCustomer}
|
onClick={handleAddCustomer}
|
||||||
style={{
|
style={{
|
||||||
fontSize: '25px',
|
fontSize: '25px',
|
||||||
color: selOption || GetCustId ? '#52c41a' : '#1292EE',
|
color: selOption || GetCustId ? '#52c41a' : '#1292EE',
|
||||||
cursor: Custdisable ? 'not-allowed' : 'pointer',
|
cursor: Custdisable ? 'not-allowed' : 'pointer',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</TooltipWrapper>
|
</TooltipWrapper>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -3735,31 +3745,31 @@ export default function BST1Payment() {
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 'none'
|
? 'none'
|
||||||
: 'auto',
|
: 'auto',
|
||||||
opacity:
|
opacity:
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 0.5
|
? 0.5
|
||||||
: 1,
|
: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{paybtns?.length > 0 &&
|
{paybtns?.length > 0 &&
|
||||||
currentOrderNetAmount >= previousNetAmount ? (
|
currentOrderNetAmount >= previousNetAmount ? (
|
||||||
paybtns?.map((payment) => (
|
paybtns?.map((payment) => (
|
||||||
<div className="Table3-cash">
|
<div className="Table3-cash">
|
||||||
<button
|
<button
|
||||||
className={
|
className={
|
||||||
paybtnselected === payment.ModeId &&
|
paybtnselected === payment.ModeId &&
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
(UpinotSelected || CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode-notupisel'
|
? 'Btn-payment-mode-notupisel'
|
||||||
: paybtnselected === payment.ModeId &&
|
: paybtnselected === payment.ModeId &&
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
(!UpinotSelected || !CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode'
|
? 'Btn-payment-mode'
|
||||||
: 'Btn-payment-mode-sel'
|
: 'Btn-payment-mode-sel'
|
||||||
}
|
}
|
||||||
|
|
@ -3773,13 +3783,13 @@ export default function BST1Payment() {
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id
|
payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id
|
||||||
? handleUPIButtonClick(
|
? handleUPIButtonClick(
|
||||||
payment.ModeId,
|
payment.ModeId,
|
||||||
payment.ModeName
|
payment.ModeName
|
||||||
)
|
)
|
||||||
: handlePaymentMode(
|
: handlePaymentMode(
|
||||||
payment.ModeId,
|
payment.ModeId,
|
||||||
payment.ModeName
|
payment.ModeName
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
||||||
|
|
@ -3838,10 +3848,10 @@ export default function BST1Payment() {
|
||||||
<button
|
<button
|
||||||
className={
|
className={
|
||||||
refundPaySelected === payment.ConfigId &&
|
refundPaySelected === payment.ConfigId &&
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
(UpinotSelected || CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode-notupisel'
|
? 'Btn-payment-mode-notupisel'
|
||||||
: refundPaySelected === payment.ConfigId &&
|
: refundPaySelected === payment.ConfigId &&
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
(!UpinotSelected || !CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode'
|
? 'Btn-payment-mode'
|
||||||
: 'Btn-payment-mode-sel'
|
: 'Btn-payment-mode-sel'
|
||||||
}
|
}
|
||||||
|
|
@ -3916,9 +3926,9 @@ export default function BST1Payment() {
|
||||||
OrderCardDetail?.length > 0 && 'not-allowed',
|
OrderCardDetail?.length > 0 && 'not-allowed',
|
||||||
color:
|
color:
|
||||||
OrderCardDetail?.length > 0 ||
|
OrderCardDetail?.length > 0 ||
|
||||||
(selOption?.value === undefined &&
|
(selOption?.value === undefined &&
|
||||||
GlobalAddCustomerDetails1?.length === 0 &&
|
GlobalAddCustomerDetails1?.length === 0 &&
|
||||||
GetCustId?.CustMobile === undefined)
|
GetCustId?.CustMobile === undefined)
|
||||||
? 'gray'
|
? 'gray'
|
||||||
: 'rgb(18, 146, 238)',
|
: 'rgb(18, 146, 238)',
|
||||||
fontSize: '28px',
|
fontSize: '28px',
|
||||||
|
|
@ -3968,16 +3978,16 @@ export default function BST1Payment() {
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 'none'
|
? 'none'
|
||||||
: 'auto',
|
: 'auto',
|
||||||
opacity:
|
opacity:
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 0.5
|
? 0.5
|
||||||
: 1,
|
: 1,
|
||||||
}}
|
}}
|
||||||
|
|
@ -3996,14 +4006,14 @@ export default function BST1Payment() {
|
||||||
width: '1.5rem',
|
width: '1.5rem',
|
||||||
cursor:
|
cursor:
|
||||||
OrderCardDetail?.length === 0 ||
|
OrderCardDetail?.length === 0 ||
|
||||||
CheckBookingStatus == 'Close' ||
|
CheckBookingStatus == 'Close' ||
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'not-allowed'
|
? 'not-allowed'
|
||||||
: 'pointer',
|
: 'pointer',
|
||||||
color:
|
color:
|
||||||
OrderCardDetail?.length === 0 ||
|
OrderCardDetail?.length === 0 ||
|
||||||
CheckBookingStatus == 'Close' ||
|
CheckBookingStatus == 'Close' ||
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'gray'
|
? 'gray'
|
||||||
: 'rgb(18, 146, 238)',
|
: 'rgb(18, 146, 238)',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
@ -4040,8 +4050,8 @@ export default function BST1Payment() {
|
||||||
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
||||||
color:
|
color:
|
||||||
OrderCardDetail?.length > 0 ||
|
OrderCardDetail?.length > 0 ||
|
||||||
(OrderCardDetail?.length > 0 &&
|
(OrderCardDetail?.length > 0 &&
|
||||||
GetCustId?.CustMobile === undefined)
|
GetCustId?.CustMobile === undefined)
|
||||||
? 'gray'
|
? 'gray'
|
||||||
: 'rgb(18, 146, 238)',
|
: 'rgb(18, 146, 238)',
|
||||||
fontSize: '25px',
|
fontSize: '25px',
|
||||||
|
|
@ -4070,14 +4080,14 @@ export default function BST1Payment() {
|
||||||
width: '1.5rem',
|
width: '1.5rem',
|
||||||
cursor:
|
cursor:
|
||||||
OrderCardDetail?.length === 0 ||
|
OrderCardDetail?.length === 0 ||
|
||||||
CheckBookingStatus == 'Close' ||
|
CheckBookingStatus == 'Close' ||
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'not-allowed'
|
? 'not-allowed'
|
||||||
: 'pointer',
|
: 'pointer',
|
||||||
color:
|
color:
|
||||||
OrderCardDetail?.length === 0 ||
|
OrderCardDetail?.length === 0 ||
|
||||||
CheckBookingStatus == 'Close' ||
|
CheckBookingStatus == 'Close' ||
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'gray'
|
? 'gray'
|
||||||
: 'rgb(18, 146, 238)',
|
: 'rgb(18, 146, 238)',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
@ -4159,58 +4169,58 @@ export default function BST1Payment() {
|
||||||
<div>
|
<div>
|
||||||
{unpaidFlow == false
|
{unpaidFlow == false
|
||||||
? holdCheckedSalesSetup &&
|
? holdCheckedSalesSetup &&
|
||||||
BookingType !== 'Dine In' &&
|
BookingType !== 'Dine In' &&
|
||||||
!BookingTypeBoth &&
|
!BookingTypeBoth &&
|
||||||
OrderCardDetail?.length != 0 &&
|
OrderCardDetail?.length != 0 &&
|
||||||
CheckOrderType?.length === 0 &&
|
CheckOrderType?.length === 0 &&
|
||||||
OrderType != 'Failed' &&
|
OrderType != 'Failed' &&
|
||||||
CheckBookingStatus != 'Close' &&
|
CheckBookingStatus != 'Close' &&
|
||||||
paybtns?.length > 0 &&
|
paybtns?.length > 0 &&
|
||||||
!addnewAccess && (
|
!addnewAccess && (
|
||||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||||
{' '}
|
{' '}
|
||||||
<PozoHoldIcon
|
<PozoHoldIcon
|
||||||
className="BSBillingNav-icon-table-icon"
|
className="BSBillingNav-icon-table-icon"
|
||||||
onClick={() => AddBookingDetails('Hold')}
|
onClick={() => AddBookingDetails('Hold')}
|
||||||
style={{
|
style={{
|
||||||
fontSize: '30px',
|
fontSize: '30px',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
color: '' ? '#52c41a' : '#1292EE',
|
color: '' ? '#52c41a' : '#1292EE',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</TooltipWrapper>
|
</TooltipWrapper>
|
||||||
)
|
)
|
||||||
: ''}
|
: ''}
|
||||||
{unpaidFlow == false
|
{unpaidFlow == false
|
||||||
? holdCheckedSalesSetup &&
|
? holdCheckedSalesSetup &&
|
||||||
paybtns?.length > 0 &&
|
paybtns?.length > 0 &&
|
||||||
BookingType !== 'Dine In' &&
|
BookingType !== 'Dine In' &&
|
||||||
!BookingTypeBoth &&
|
!BookingTypeBoth &&
|
||||||
Holddata?.length > 0 &&
|
Holddata?.length > 0 &&
|
||||||
OrderCardDetail?.length == 0 &&
|
OrderCardDetail?.length == 0 &&
|
||||||
CheckBookingStatus != 'Close' &&
|
CheckBookingStatus != 'Close' &&
|
||||||
!addnewAccess && (
|
!addnewAccess && (
|
||||||
<TooltipWrapper title={'Recall'} isMobile={isMobile}>
|
<TooltipWrapper title={'Recall'} isMobile={isMobile}>
|
||||||
{' '}
|
{' '}
|
||||||
<Badge
|
<Badge
|
||||||
count={Holddata?.length}
|
count={Holddata?.length}
|
||||||
size={'small'}
|
size={'small'}
|
||||||
offset={[0, 7]}
|
offset={[0, 7]}
|
||||||
>
|
>
|
||||||
<PozoHoldIcon
|
<PozoHoldIcon
|
||||||
className="BSBillingNav-icon-table-icon"
|
className="BSBillingNav-icon-table-icon"
|
||||||
onClick={() => HandleholdModelOpen()}
|
onClick={() => HandleholdModelOpen()}
|
||||||
style={{
|
style={{
|
||||||
fontSize: '28px',
|
fontSize: '28px',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
color: Holddata ? '#52c41a' : 'default',
|
color: Holddata ? '#52c41a' : 'default',
|
||||||
pointerEvents:
|
pointerEvents:
|
||||||
OrderType === 'Failed' ? 'none' : 'auto',
|
OrderType === 'Failed' ? 'none' : 'auto',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Badge>
|
</Badge>
|
||||||
</TooltipWrapper>
|
</TooltipWrapper>
|
||||||
)
|
)
|
||||||
: ''}
|
: ''}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
@ -4253,9 +4263,9 @@ export default function BST1Payment() {
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'price-button-disabled'
|
? 'price-button-disabled'
|
||||||
: FirstPaymentclick === false &&
|
: FirstPaymentclick === false &&
|
||||||
OrderCardDetail?.length > 0 &&
|
OrderCardDetail?.length > 0 &&
|
||||||
paybtnselected &&
|
paybtnselected &&
|
||||||
CheckBookingStatus != 'Close'
|
CheckBookingStatus != 'Close'
|
||||||
? !OrderStatus
|
? !OrderStatus
|
||||||
? salesBillEdit &&
|
? salesBillEdit &&
|
||||||
currentOrderNetAmount < previousNetAmount
|
currentOrderNetAmount < previousNetAmount
|
||||||
|
|
@ -4277,7 +4287,7 @@ export default function BST1Payment() {
|
||||||
{isMobile ? (
|
{isMobile ? (
|
||||||
!OrderStatus ? (
|
!OrderStatus ? (
|
||||||
salesBillEdit &&
|
salesBillEdit &&
|
||||||
currentOrderNetAmount < previousNetAmount ? (
|
currentOrderNetAmount < previousNetAmount ? (
|
||||||
<div>
|
<div>
|
||||||
Refund: ₹
|
Refund: ₹
|
||||||
{(previousNetAmount || 0) -
|
{(previousNetAmount || 0) -
|
||||||
|
|
@ -4503,14 +4513,14 @@ export default function BST1Payment() {
|
||||||
OrderType === 'Failed'
|
OrderType === 'Failed'
|
||||||
? FailedTotalAmt
|
? FailedTotalAmt
|
||||||
: Math.round(
|
: Math.round(
|
||||||
OrderCardDetail?.reduce(
|
OrderCardDetail?.reduce(
|
||||||
(acc, data) => data?.TotalAmt + acc,
|
(acc, data) => data?.TotalAmt + acc,
|
||||||
0
|
0
|
||||||
) -
|
) -
|
||||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
((OverAllSales > 0 ? OverAllSales : 0) +
|
||||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
||||||
(Discount > 0 ? Discount : 0))
|
(Discount > 0 ? Discount : 0))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
failedOrderData={failedOrderData}
|
failedOrderData={failedOrderData}
|
||||||
/>
|
/>
|
||||||
|
|
@ -4643,9 +4653,9 @@ export default function BST1Payment() {
|
||||||
|
|
||||||
const qty = isGroup
|
const qty = isGroup
|
||||||
? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
|
? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
|
||||||
(sum, o) => sum + (o.OrderQty || 1),
|
(sum, o) => sum + (o.OrderQty || 1),
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
: item.OrderQty || 1;
|
: item.OrderQty || 1;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -4728,6 +4738,7 @@ export default function BST1Payment() {
|
||||||
handleCancel={() => setShowCancelConfirm(true)}
|
handleCancel={() => setShowCancelConfirm(true)}
|
||||||
footer={false}
|
footer={false}
|
||||||
width={500}
|
width={500}
|
||||||
|
destroyOnClose={true}
|
||||||
children={
|
children={
|
||||||
<>
|
<>
|
||||||
<PaymentGatewayEmbedded
|
<PaymentGatewayEmbedded
|
||||||
|
|
@ -4744,14 +4755,27 @@ export default function BST1Payment() {
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{showCancelConfirm && (
|
{showCancelConfirm && (
|
||||||
|
// <Modal
|
||||||
|
// open={showCancelConfirm}
|
||||||
|
// title="Cancel Payment"
|
||||||
|
// onOk={() => {
|
||||||
|
// setBusinessUPI(false);
|
||||||
|
// setShowCancelConfirm(false);
|
||||||
|
// ClearAllGlobalStateDatas();
|
||||||
|
// CustomerDisplay();
|
||||||
|
// }}
|
||||||
|
// onCancel={() => setShowCancelConfirm(false)}
|
||||||
|
// okText="Yes"
|
||||||
|
// cancelText="No"
|
||||||
|
// >
|
||||||
|
// Do you want to cancel the payment?
|
||||||
|
// </Modal>
|
||||||
<Modal
|
<Modal
|
||||||
open={showCancelConfirm}
|
open={showCancelConfirm}
|
||||||
title="Cancel Payment"
|
title="Cancel Payment"
|
||||||
onOk={() => {
|
onOk={() => {
|
||||||
setBusinessUPI(false);
|
|
||||||
setShowCancelConfirm(false);
|
setShowCancelConfirm(false);
|
||||||
ClearAllGlobalStateDatas();
|
CancelPayment()
|
||||||
CustomerDisplay();
|
|
||||||
}}
|
}}
|
||||||
onCancel={() => setShowCancelConfirm(false)}
|
onCancel={() => setShowCancelConfirm(false)}
|
||||||
okText="Yes"
|
okText="Yes"
|
||||||
|
|
|
||||||
|
|
@ -217,16 +217,16 @@ const BSBillingTable3 = (Props) => {
|
||||||
OrderType === 'Hold'
|
OrderType === 'Hold'
|
||||||
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
||||||
: tableData?.filter(
|
: tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
||||||
);
|
);
|
||||||
const OldtableDataDinein = tableData?.filter(
|
const OldtableDataDinein = tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId
|
||||||
);
|
);
|
||||||
const OldtableDataTakeAway =
|
const OldtableDataTakeAway =
|
||||||
OrderType != 'Hold'
|
OrderType != 'Hold'
|
||||||
? tableData?.filter(
|
? tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
||||||
)
|
)
|
||||||
: [];
|
: [];
|
||||||
const [EditQuantity, setEditQuantity] = useState(false);
|
const [EditQuantity, setEditQuantity] = useState(false);
|
||||||
const [Modaldata, setModaldata] = useState([]);
|
const [Modaldata, setModaldata] = useState([]);
|
||||||
|
|
@ -473,27 +473,27 @@ const BSBillingTable3 = (Props) => {
|
||||||
) {
|
) {
|
||||||
if (BillOrderPre === 'Y') {
|
if (BillOrderPre === 'Y') {
|
||||||
const UpdatedCartItem =
|
const UpdatedCartItem =
|
||||||
// if the item is already in the cart, increase the quantity of the item
|
// if the item is already in the cart, increase the quantity of the item
|
||||||
{
|
{
|
||||||
...isItemInCart,
|
...isItemInCart,
|
||||||
OrderQty: isItemInCart?.OrderQty - 1,
|
OrderQty: isItemInCart?.OrderQty - 1,
|
||||||
TotalAmt:
|
TotalAmt:
|
||||||
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate,
|
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate,
|
||||||
TaxAmt: (
|
TaxAmt: (
|
||||||
|
((isItemInCart?.OrderQty - 1) *
|
||||||
|
isItemInCart?.OrderRate *
|
||||||
|
isItemInCart?.TaxPercentage) /
|
||||||
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
|
).toFixed(2),
|
||||||
|
WithoutTaxRate:
|
||||||
|
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate -
|
||||||
|
(
|
||||||
((isItemInCart?.OrderQty - 1) *
|
((isItemInCart?.OrderQty - 1) *
|
||||||
isItemInCart?.OrderRate *
|
isItemInCart?.OrderRate *
|
||||||
isItemInCart?.TaxPercentage) /
|
isItemInCart?.TaxPercentage) /
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
).toFixed(2),
|
).toFixed(2),
|
||||||
WithoutTaxRate:
|
};
|
||||||
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate -
|
|
||||||
(
|
|
||||||
((isItemInCart?.OrderQty - 1) *
|
|
||||||
isItemInCart?.OrderRate *
|
|
||||||
isItemInCart?.TaxPercentage) /
|
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
|
||||||
).toFixed(2),
|
|
||||||
};
|
|
||||||
|
|
||||||
const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal];
|
const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal];
|
||||||
|
|
||||||
|
|
@ -504,27 +504,27 @@ const BSBillingTable3 = (Props) => {
|
||||||
// }
|
// }
|
||||||
} else {
|
} else {
|
||||||
const UpdatedCartItem =
|
const UpdatedCartItem =
|
||||||
// if the item is already in the cart, increase the quantity of the item
|
// if the item is already in the cart, increase the quantity of the item
|
||||||
{
|
{
|
||||||
...isItemInCart,
|
...isItemInCart,
|
||||||
OrderQty: isItemInCart?.OrderQty - 1,
|
OrderQty: isItemInCart?.OrderQty - 1,
|
||||||
TotalAmt:
|
TotalAmt:
|
||||||
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate,
|
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate,
|
||||||
TaxAmt: (
|
TaxAmt: (
|
||||||
|
((isItemInCart?.OrderQty - 1) *
|
||||||
|
isItemInCart?.OrderRate *
|
||||||
|
isItemInCart?.TaxPercentage) /
|
||||||
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
|
).toFixed(2),
|
||||||
|
WithoutTaxRate:
|
||||||
|
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate -
|
||||||
|
(
|
||||||
((isItemInCart?.OrderQty - 1) *
|
((isItemInCart?.OrderQty - 1) *
|
||||||
isItemInCart?.OrderRate *
|
isItemInCart?.OrderRate *
|
||||||
isItemInCart?.TaxPercentage) /
|
isItemInCart?.TaxPercentage) /
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
).toFixed(2),
|
).toFixed(2),
|
||||||
WithoutTaxRate:
|
};
|
||||||
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate -
|
|
||||||
(
|
|
||||||
((isItemInCart?.OrderQty - 1) *
|
|
||||||
isItemInCart?.OrderRate *
|
|
||||||
isItemInCart?.TaxPercentage) /
|
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
|
||||||
).toFixed(2),
|
|
||||||
};
|
|
||||||
|
|
||||||
const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem];
|
const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem];
|
||||||
|
|
||||||
|
|
@ -543,27 +543,27 @@ const BSBillingTable3 = (Props) => {
|
||||||
) {
|
) {
|
||||||
if (BillOrderPre === 'Y') {
|
if (BillOrderPre === 'Y') {
|
||||||
const UpdatedCartItem =
|
const UpdatedCartItem =
|
||||||
// if the item is already in the cart, increase the quantity of the item
|
// if the item is already in the cart, increase the quantity of the item
|
||||||
{
|
{
|
||||||
...isItemInCart,
|
...isItemInCart,
|
||||||
OrderQty: isItemInCart?.OrderQty - 1,
|
OrderQty: isItemInCart?.OrderQty - 1,
|
||||||
TotalAmt:
|
TotalAmt:
|
||||||
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate,
|
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate,
|
||||||
TaxAmt: (
|
TaxAmt: (
|
||||||
|
((isItemInCart?.OrderQty - 1) *
|
||||||
|
isItemInCart?.OrderRate *
|
||||||
|
isItemInCart?.TaxPercentage) /
|
||||||
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
|
).toFixed(2),
|
||||||
|
WithoutTaxRate:
|
||||||
|
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate -
|
||||||
|
(
|
||||||
((isItemInCart?.OrderQty - 1) *
|
((isItemInCart?.OrderQty - 1) *
|
||||||
isItemInCart?.OrderRate *
|
isItemInCart?.OrderRate *
|
||||||
isItemInCart?.TaxPercentage) /
|
isItemInCart?.TaxPercentage) /
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
).toFixed(2),
|
).toFixed(2),
|
||||||
WithoutTaxRate:
|
};
|
||||||
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate -
|
|
||||||
(
|
|
||||||
((isItemInCart?.OrderQty - 1) *
|
|
||||||
isItemInCart?.OrderRate *
|
|
||||||
isItemInCart?.TaxPercentage) /
|
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
|
||||||
).toFixed(2),
|
|
||||||
};
|
|
||||||
const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal];
|
const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal];
|
||||||
|
|
||||||
// if (OfferCheckedInSetup && preferenceOffer) {
|
// if (OfferCheckedInSetup && preferenceOffer) {
|
||||||
|
|
@ -573,27 +573,27 @@ const BSBillingTable3 = (Props) => {
|
||||||
// }
|
// }
|
||||||
} else {
|
} else {
|
||||||
const UpdatedCartItem =
|
const UpdatedCartItem =
|
||||||
// if the item is already in the cart, increase the quantity of the item
|
// if the item is already in the cart, increase the quantity of the item
|
||||||
{
|
{
|
||||||
...isItemInCart,
|
...isItemInCart,
|
||||||
OrderQty: isItemInCart?.OrderQty - 1,
|
OrderQty: isItemInCart?.OrderQty - 1,
|
||||||
TotalAmt:
|
TotalAmt:
|
||||||
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate,
|
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate,
|
||||||
TaxAmt: (
|
TaxAmt: (
|
||||||
|
((isItemInCart?.OrderQty - 1) *
|
||||||
|
isItemInCart?.OrderRate *
|
||||||
|
isItemInCart?.TaxPercentage) /
|
||||||
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
|
).toFixed(2),
|
||||||
|
WithoutTaxRate:
|
||||||
|
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate -
|
||||||
|
(
|
||||||
((isItemInCart?.OrderQty - 1) *
|
((isItemInCart?.OrderQty - 1) *
|
||||||
isItemInCart?.OrderRate *
|
isItemInCart?.OrderRate *
|
||||||
isItemInCart?.TaxPercentage) /
|
isItemInCart?.TaxPercentage) /
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
).toFixed(2),
|
).toFixed(2),
|
||||||
WithoutTaxRate:
|
};
|
||||||
(isItemInCart?.OrderQty - 1) * isItemInCart?.OrderRate -
|
|
||||||
(
|
|
||||||
((isItemInCart?.OrderQty - 1) *
|
|
||||||
isItemInCart?.OrderRate *
|
|
||||||
isItemInCart?.TaxPercentage) /
|
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
|
||||||
).toFixed(2),
|
|
||||||
};
|
|
||||||
|
|
||||||
const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem];
|
const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem];
|
||||||
|
|
||||||
|
|
@ -606,29 +606,29 @@ const BSBillingTable3 = (Props) => {
|
||||||
} else if (isItemInCartHold && OrderType === 'Hold') {
|
} else if (isItemInCartHold && OrderType === 'Hold') {
|
||||||
if (BillOrderPre === 'Y') {
|
if (BillOrderPre === 'Y') {
|
||||||
const UpdatedCartItem =
|
const UpdatedCartItem =
|
||||||
// if the item is already in the cart, increase the quantity of the item
|
// if the item is already in the cart, increase the quantity of the item
|
||||||
{
|
{
|
||||||
...isItemInCartHold,
|
...isItemInCartHold,
|
||||||
OrderQty: isItemInCartHold?.OrderQty - 1,
|
OrderQty: isItemInCartHold?.OrderQty - 1,
|
||||||
TotalAmt:
|
TotalAmt:
|
||||||
(isItemInCartHold?.OrderQty - 1) *
|
(isItemInCartHold?.OrderQty - 1) *
|
||||||
isItemInCartHold?.OrderRate,
|
isItemInCartHold?.OrderRate,
|
||||||
TaxAmt: (
|
TaxAmt: (
|
||||||
|
((isItemInCartHold?.OrderQty - 1) *
|
||||||
|
isItemInCartHold?.OrderRate *
|
||||||
|
isItemInCartHold?.TaxPercentage) /
|
||||||
|
(100 + isItemInCartHold?.TaxPercentage)
|
||||||
|
).toFixed(2),
|
||||||
|
WithoutTaxRate:
|
||||||
|
(isItemInCartHold?.OrderQty - 1) *
|
||||||
|
isItemInCartHold?.OrderRate -
|
||||||
|
(
|
||||||
((isItemInCartHold?.OrderQty - 1) *
|
((isItemInCartHold?.OrderQty - 1) *
|
||||||
isItemInCartHold?.OrderRate *
|
isItemInCartHold?.OrderRate *
|
||||||
isItemInCartHold?.TaxPercentage) /
|
isItemInCartHold?.TaxPercentage) /
|
||||||
(100 + isItemInCartHold?.TaxPercentage)
|
(100 + isItemInCartHold?.TaxPercentage)
|
||||||
).toFixed(2),
|
).toFixed(2),
|
||||||
WithoutTaxRate:
|
};
|
||||||
(isItemInCartHold?.OrderQty - 1) *
|
|
||||||
isItemInCartHold?.OrderRate -
|
|
||||||
(
|
|
||||||
((isItemInCartHold?.OrderQty - 1) *
|
|
||||||
isItemInCartHold?.OrderRate *
|
|
||||||
isItemInCartHold?.TaxPercentage) /
|
|
||||||
(100 + isItemInCartHold?.TaxPercentage)
|
|
||||||
).toFixed(2),
|
|
||||||
};
|
|
||||||
|
|
||||||
const UpdatedData = [
|
const UpdatedData = [
|
||||||
UpdatedCartItem,
|
UpdatedCartItem,
|
||||||
|
|
@ -642,29 +642,29 @@ const BSBillingTable3 = (Props) => {
|
||||||
// }
|
// }
|
||||||
} else {
|
} else {
|
||||||
const UpdatedCartItem =
|
const UpdatedCartItem =
|
||||||
// if the item is already in the cart, increase the quantity of the item
|
// if the item is already in the cart, increase the quantity of the item
|
||||||
{
|
{
|
||||||
...isItemInCartHold,
|
...isItemInCartHold,
|
||||||
OrderQty: isItemInCartHold?.OrderQty - 1,
|
OrderQty: isItemInCartHold?.OrderQty - 1,
|
||||||
TotalAmt:
|
TotalAmt:
|
||||||
(isItemInCartHold?.OrderQty - 1) *
|
(isItemInCartHold?.OrderQty - 1) *
|
||||||
isItemInCartHold?.OrderRate,
|
isItemInCartHold?.OrderRate,
|
||||||
TaxAmt: (
|
TaxAmt: (
|
||||||
|
((isItemInCartHold?.OrderQty - 1) *
|
||||||
|
isItemInCartHold?.OrderRate *
|
||||||
|
isItemInCartHold?.TaxPercentage) /
|
||||||
|
(100 + isItemInCartHold?.TaxPercentage)
|
||||||
|
).toFixed(2),
|
||||||
|
WithoutTaxRate:
|
||||||
|
(isItemInCartHold?.OrderQty - 1) *
|
||||||
|
isItemInCartHold?.OrderRate -
|
||||||
|
(
|
||||||
((isItemInCartHold?.OrderQty - 1) *
|
((isItemInCartHold?.OrderQty - 1) *
|
||||||
isItemInCartHold?.OrderRate *
|
isItemInCartHold?.OrderRate *
|
||||||
isItemInCartHold?.TaxPercentage) /
|
isItemInCartHold?.TaxPercentage) /
|
||||||
(100 + isItemInCartHold?.TaxPercentage)
|
(100 + isItemInCartHold?.TaxPercentage)
|
||||||
).toFixed(2),
|
).toFixed(2),
|
||||||
WithoutTaxRate:
|
};
|
||||||
(isItemInCartHold?.OrderQty - 1) *
|
|
||||||
isItemInCartHold?.OrderRate -
|
|
||||||
(
|
|
||||||
((isItemInCartHold?.OrderQty - 1) *
|
|
||||||
isItemInCartHold?.OrderRate *
|
|
||||||
isItemInCartHold?.TaxPercentage) /
|
|
||||||
(100 + isItemInCartHold?.TaxPercentage)
|
|
||||||
).toFixed(2),
|
|
||||||
};
|
|
||||||
|
|
||||||
const UpdatedData = [
|
const UpdatedData = [
|
||||||
...OtherorderDataforNormalWithoutSalesId,
|
...OtherorderDataforNormalWithoutSalesId,
|
||||||
|
|
@ -968,26 +968,26 @@ const BSBillingTable3 = (Props) => {
|
||||||
if (isItemInCart && BookingTypeProd != 'Dine In' && OrderType != 'Hold') {
|
if (isItemInCart && BookingTypeProd != 'Dine In' && OrderType != 'Hold') {
|
||||||
if (BillOrderPre === 'Y') {
|
if (BillOrderPre === 'Y') {
|
||||||
const UpdatedCartItem =
|
const UpdatedCartItem =
|
||||||
// if the item is already in the cart, increase the quantity of the item
|
// if the item is already in the cart, increase the quantity of the item
|
||||||
{
|
{
|
||||||
...isItemInCart,
|
...isItemInCart,
|
||||||
OrderQty: isItemInCart?.OrderQty + 1,
|
OrderQty: isItemInCart?.OrderQty + 1,
|
||||||
TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate,
|
TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate,
|
||||||
TaxAmt: (
|
TaxAmt: (
|
||||||
|
((isItemInCart?.OrderQty + 1) *
|
||||||
|
isItemInCart?.OrderRate *
|
||||||
|
isItemInCart?.TaxPercentage) /
|
||||||
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
|
).toFixed(2),
|
||||||
|
WithoutTaxRate:
|
||||||
|
(isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate -
|
||||||
|
(
|
||||||
((isItemInCart?.OrderQty + 1) *
|
((isItemInCart?.OrderQty + 1) *
|
||||||
isItemInCart?.OrderRate *
|
isItemInCart?.OrderRate *
|
||||||
isItemInCart?.TaxPercentage) /
|
isItemInCart?.TaxPercentage) /
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
).toFixed(2),
|
).toFixed(2),
|
||||||
WithoutTaxRate:
|
};
|
||||||
(isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate -
|
|
||||||
(
|
|
||||||
((isItemInCart?.OrderQty + 1) *
|
|
||||||
isItemInCart?.OrderRate *
|
|
||||||
isItemInCart?.TaxPercentage) /
|
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
|
||||||
).toFixed(2),
|
|
||||||
};
|
|
||||||
|
|
||||||
const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal];
|
const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal];
|
||||||
|
|
||||||
|
|
@ -998,26 +998,26 @@ const BSBillingTable3 = (Props) => {
|
||||||
// }
|
// }
|
||||||
} else {
|
} else {
|
||||||
const UpdatedCartItem =
|
const UpdatedCartItem =
|
||||||
// if the item is already in the cart, increase the quantity of the item
|
// if the item is already in the cart, increase the quantity of the item
|
||||||
{
|
{
|
||||||
...isItemInCart,
|
...isItemInCart,
|
||||||
OrderQty: isItemInCart?.OrderQty + 1,
|
OrderQty: isItemInCart?.OrderQty + 1,
|
||||||
TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate,
|
TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate,
|
||||||
TaxAmt: (
|
TaxAmt: (
|
||||||
|
((isItemInCart?.OrderQty + 1) *
|
||||||
|
isItemInCart?.OrderRate *
|
||||||
|
isItemInCart?.TaxPercentage) /
|
||||||
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
|
).toFixed(2),
|
||||||
|
WithoutTaxRate:
|
||||||
|
(isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate -
|
||||||
|
(
|
||||||
((isItemInCart?.OrderQty + 1) *
|
((isItemInCart?.OrderQty + 1) *
|
||||||
isItemInCart?.OrderRate *
|
isItemInCart?.OrderRate *
|
||||||
isItemInCart?.TaxPercentage) /
|
isItemInCart?.TaxPercentage) /
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
).toFixed(2),
|
).toFixed(2),
|
||||||
WithoutTaxRate:
|
};
|
||||||
(isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate -
|
|
||||||
(
|
|
||||||
((isItemInCart?.OrderQty + 1) *
|
|
||||||
isItemInCart?.OrderRate *
|
|
||||||
isItemInCart?.TaxPercentage) /
|
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
|
||||||
).toFixed(2),
|
|
||||||
};
|
|
||||||
|
|
||||||
const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem];
|
const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem];
|
||||||
|
|
||||||
|
|
@ -1036,26 +1036,26 @@ const BSBillingTable3 = (Props) => {
|
||||||
) {
|
) {
|
||||||
if (BillOrderPre === 'Y') {
|
if (BillOrderPre === 'Y') {
|
||||||
const UpdatedCartItem =
|
const UpdatedCartItem =
|
||||||
// if the item is already in the cart, increase the quantity of the item
|
// if the item is already in the cart, increase the quantity of the item
|
||||||
{
|
{
|
||||||
...isItemInCart,
|
...isItemInCart,
|
||||||
OrderQty: isItemInCart?.OrderQty + 1,
|
OrderQty: isItemInCart?.OrderQty + 1,
|
||||||
TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate,
|
TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate,
|
||||||
TaxAmt: (
|
TaxAmt: (
|
||||||
|
((isItemInCart?.OrderQty + 1) *
|
||||||
|
isItemInCart?.OrderRate *
|
||||||
|
isItemInCart?.TaxPercentage) /
|
||||||
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
|
).toFixed(2),
|
||||||
|
WithoutTaxRate:
|
||||||
|
(isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate -
|
||||||
|
(
|
||||||
((isItemInCart?.OrderQty + 1) *
|
((isItemInCart?.OrderQty + 1) *
|
||||||
isItemInCart?.OrderRate *
|
isItemInCart?.OrderRate *
|
||||||
isItemInCart?.TaxPercentage) /
|
isItemInCart?.TaxPercentage) /
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
).toFixed(2),
|
).toFixed(2),
|
||||||
WithoutTaxRate:
|
};
|
||||||
(isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate -
|
|
||||||
(
|
|
||||||
((isItemInCart?.OrderQty + 1) *
|
|
||||||
isItemInCart?.OrderRate *
|
|
||||||
isItemInCart?.TaxPercentage) /
|
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
|
||||||
).toFixed(2),
|
|
||||||
};
|
|
||||||
|
|
||||||
const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal];
|
const UpdatedData = [UpdatedCartItem, ...OtherorderDataforNormal];
|
||||||
|
|
||||||
|
|
@ -1066,26 +1066,26 @@ const BSBillingTable3 = (Props) => {
|
||||||
// }
|
// }
|
||||||
} else {
|
} else {
|
||||||
const UpdatedCartItem =
|
const UpdatedCartItem =
|
||||||
// if the item is already in the cart, increase the quantity of the item
|
// if the item is already in the cart, increase the quantity of the item
|
||||||
{
|
{
|
||||||
...isItemInCart,
|
...isItemInCart,
|
||||||
OrderQty: isItemInCart?.OrderQty + 1,
|
OrderQty: isItemInCart?.OrderQty + 1,
|
||||||
TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate,
|
TotalAmt: (isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate,
|
||||||
TaxAmt: (
|
TaxAmt: (
|
||||||
|
((isItemInCart?.OrderQty + 1) *
|
||||||
|
isItemInCart?.OrderRate *
|
||||||
|
isItemInCart?.TaxPercentage) /
|
||||||
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
|
).toFixed(2),
|
||||||
|
WithoutTaxRate:
|
||||||
|
(isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate -
|
||||||
|
(
|
||||||
((isItemInCart?.OrderQty + 1) *
|
((isItemInCart?.OrderQty + 1) *
|
||||||
isItemInCart?.OrderRate *
|
isItemInCart?.OrderRate *
|
||||||
isItemInCart?.TaxPercentage) /
|
isItemInCart?.TaxPercentage) /
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
(100 + isItemInCart?.TaxPercentage)
|
||||||
).toFixed(2),
|
).toFixed(2),
|
||||||
WithoutTaxRate:
|
};
|
||||||
(isItemInCart?.OrderQty + 1) * isItemInCart?.OrderRate -
|
|
||||||
(
|
|
||||||
((isItemInCart?.OrderQty + 1) *
|
|
||||||
isItemInCart?.OrderRate *
|
|
||||||
isItemInCart?.TaxPercentage) /
|
|
||||||
(100 + isItemInCart?.TaxPercentage)
|
|
||||||
).toFixed(2),
|
|
||||||
};
|
|
||||||
|
|
||||||
const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem];
|
const UpdatedData = [...OtherorderDataforNormal, UpdatedCartItem];
|
||||||
|
|
||||||
|
|
@ -1098,27 +1098,27 @@ const BSBillingTable3 = (Props) => {
|
||||||
} else if (isItemInCartHold && OrderType === 'Hold') {
|
} else if (isItemInCartHold && OrderType === 'Hold') {
|
||||||
if (BillOrderPre === 'Y') {
|
if (BillOrderPre === 'Y') {
|
||||||
const UpdatedCartItem =
|
const UpdatedCartItem =
|
||||||
// if the item is already in the cart, increase the quantity of the item
|
// if the item is already in the cart, increase the quantity of the item
|
||||||
{
|
{
|
||||||
...isItemInCartHold,
|
...isItemInCartHold,
|
||||||
OrderQty: isItemInCartHold?.OrderQty + 1,
|
OrderQty: isItemInCartHold?.OrderQty + 1,
|
||||||
TotalAmt:
|
TotalAmt:
|
||||||
(isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate,
|
(isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate,
|
||||||
TaxAmt: (
|
TaxAmt: (
|
||||||
|
((isItemInCartHold?.OrderQty + 1) *
|
||||||
|
isItemInCartHold?.OrderRate *
|
||||||
|
isItemInCartHold?.TaxPercentage) /
|
||||||
|
(100 + isItemInCartHold?.TaxPercentage)
|
||||||
|
).toFixed(2),
|
||||||
|
WithoutTaxRate:
|
||||||
|
(isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate -
|
||||||
|
(
|
||||||
((isItemInCartHold?.OrderQty + 1) *
|
((isItemInCartHold?.OrderQty + 1) *
|
||||||
isItemInCartHold?.OrderRate *
|
isItemInCartHold?.OrderRate *
|
||||||
isItemInCartHold?.TaxPercentage) /
|
isItemInCartHold?.TaxPercentage) /
|
||||||
(100 + isItemInCartHold?.TaxPercentage)
|
(100 + isItemInCartHold?.TaxPercentage)
|
||||||
).toFixed(2),
|
).toFixed(2),
|
||||||
WithoutTaxRate:
|
};
|
||||||
(isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate -
|
|
||||||
(
|
|
||||||
((isItemInCartHold?.OrderQty + 1) *
|
|
||||||
isItemInCartHold?.OrderRate *
|
|
||||||
isItemInCartHold?.TaxPercentage) /
|
|
||||||
(100 + isItemInCartHold?.TaxPercentage)
|
|
||||||
).toFixed(2),
|
|
||||||
};
|
|
||||||
|
|
||||||
const UpdatedData = [
|
const UpdatedData = [
|
||||||
UpdatedCartItem,
|
UpdatedCartItem,
|
||||||
|
|
@ -1132,27 +1132,27 @@ const BSBillingTable3 = (Props) => {
|
||||||
// }
|
// }
|
||||||
} else {
|
} else {
|
||||||
const UpdatedCartItem =
|
const UpdatedCartItem =
|
||||||
// if the item is already in the cart, increase the quantity of the item
|
// if the item is already in the cart, increase the quantity of the item
|
||||||
{
|
{
|
||||||
...isItemInCartHold,
|
...isItemInCartHold,
|
||||||
OrderQty: isItemInCartHold?.OrderQty + 1,
|
OrderQty: isItemInCartHold?.OrderQty + 1,
|
||||||
TotalAmt:
|
TotalAmt:
|
||||||
(isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate,
|
(isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate,
|
||||||
TaxAmt: (
|
TaxAmt: (
|
||||||
|
((isItemInCartHold?.OrderQty + 1) *
|
||||||
|
isItemInCartHold?.OrderRate *
|
||||||
|
isItemInCartHold?.TaxPercentage) /
|
||||||
|
(100 + isItemInCartHold?.TaxPercentage)
|
||||||
|
).toFixed(2),
|
||||||
|
WithoutTaxRate:
|
||||||
|
(isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate -
|
||||||
|
(
|
||||||
((isItemInCartHold?.OrderQty + 1) *
|
((isItemInCartHold?.OrderQty + 1) *
|
||||||
isItemInCartHold?.OrderRate *
|
isItemInCartHold?.OrderRate *
|
||||||
isItemInCartHold?.TaxPercentage) /
|
isItemInCartHold?.TaxPercentage) /
|
||||||
(100 + isItemInCartHold?.TaxPercentage)
|
(100 + isItemInCartHold?.TaxPercentage)
|
||||||
).toFixed(2),
|
).toFixed(2),
|
||||||
WithoutTaxRate:
|
};
|
||||||
(isItemInCartHold?.OrderQty + 1) * isItemInCartHold?.OrderRate -
|
|
||||||
(
|
|
||||||
((isItemInCartHold?.OrderQty + 1) *
|
|
||||||
isItemInCartHold?.OrderRate *
|
|
||||||
isItemInCartHold?.TaxPercentage) /
|
|
||||||
(100 + isItemInCartHold?.TaxPercentage)
|
|
||||||
).toFixed(2),
|
|
||||||
};
|
|
||||||
|
|
||||||
const UpdatedData = [
|
const UpdatedData = [
|
||||||
...OtherorderDataforNormalWithoutSalesId,
|
...OtherorderDataforNormalWithoutSalesId,
|
||||||
|
|
@ -1990,9 +1990,9 @@ const BSBillingTable3 = (Props) => {
|
||||||
)?.map((item, idx) =>
|
)?.map((item, idx) =>
|
||||||
idx === 0
|
idx === 0
|
||||||
? {
|
? {
|
||||||
...item,
|
...item,
|
||||||
FreeQty,
|
FreeQty,
|
||||||
}
|
}
|
||||||
: item
|
: item
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
@ -3155,7 +3155,7 @@ const BSBillingTable3 = (Props) => {
|
||||||
} = section;
|
} = section;
|
||||||
|
|
||||||
if (!data?.length) return null;
|
if (!data?.length) return null;
|
||||||
|
console.log(data, "OrderCart")
|
||||||
// ── Disabled check ──────────────────────────────────────────────────────────
|
// ── Disabled check ──────────────────────────────────────────────────────────
|
||||||
const isDisabled = (item) => {
|
const isDisabled = (item) => {
|
||||||
if (isOld) {
|
if (isOld) {
|
||||||
|
|
@ -3395,8 +3395,8 @@ const BSBillingTable3 = (Props) => {
|
||||||
style={{ fontFamily: 'Poppins' }}
|
style={{ fontFamily: 'Poppins' }}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
item.FullProductIdentifierDtls?.length > 0 ||
|
item.FullProductIdentifierDtls?.length > 0 ||
|
||||||
item.ProductIdentifierDtls?.length > 0 ||
|
item.ProductIdentifierDtls?.length > 0 ||
|
||||||
imeiModal
|
imeiModal
|
||||||
? handleImeiDetails(item)
|
? handleImeiDetails(item)
|
||||||
: editField && handleEditQuantity(item, index)
|
: editField && handleEditQuantity(item, index)
|
||||||
}
|
}
|
||||||
|
|
@ -3427,7 +3427,7 @@ const BSBillingTable3 = (Props) => {
|
||||||
<p
|
<p
|
||||||
className={`offermessageTag ${!isMobile ? 'desktop' : ''}`}
|
className={`offermessageTag ${!isMobile ? 'desktop' : ''}`}
|
||||||
>
|
>
|
||||||
{item.OfferMessage?.split('>')?.[0] +
|
{item?.OfferModeType === true ? item.OfferMessage : item.OfferMessage?.split('>')?.[0] +
|
||||||
`> ${item?.OrderQty} Eligible Free`}
|
`> ${item?.OrderQty} Eligible Free`}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3448,21 +3448,21 @@ const BSBillingTable3 = (Props) => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(f) => f.ProdId === item.ProdId
|
(f) => f.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges.find(
|
productBasedExtraCharges.find(
|
||||||
(f) => f.ProdId === item.ProdId
|
(f) => f.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,18 @@ const BSBillingTable3overall = () => {
|
||||||
const [isSmallScreen, setIsSmallScreen] = useState(window.innerWidth <= 768);
|
const [isSmallScreen, setIsSmallScreen] = useState(window.innerWidth <= 768);
|
||||||
const [isCartOpen, setIsCartOpen] = useState(window.innerWidth > 768);
|
const [isCartOpen, setIsCartOpen] = useState(window.innerWidth > 768);
|
||||||
|
|
||||||
|
const [isLandscape, setIsLandscape] = useState(
|
||||||
|
window.matchMedia('(orientation: landscape)').matches
|
||||||
|
);
|
||||||
|
useEffect(() => {
|
||||||
|
const handleResize = () => {
|
||||||
|
setIsLandscape(window.matchMedia('(orientation: landscape)').matches);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('resize', handleResize);
|
||||||
|
return () => window.removeEventListener('resize', handleResize);
|
||||||
|
}, []);
|
||||||
|
|
||||||
// ✅ Handle resize properly
|
// ✅ Handle resize properly
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleResize = () => {
|
const handleResize = () => {
|
||||||
|
|
@ -106,7 +118,7 @@ const BSBillingTable3overall = () => {
|
||||||
}
|
}
|
||||||
// style={{ height: containerHeight }}
|
// style={{ height: containerHeight }}
|
||||||
style={{
|
style={{
|
||||||
height: isMobile ? '75vh' : '85vh',
|
height: isMobile ? (isLandscape ? '75vh' : '83vh') : '85vh',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* ✅ Cart/Table */}
|
{/* ✅ Cart/Table */}
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,7 @@ import {
|
||||||
changePreviousOrderOfferDetail,
|
changePreviousOrderOfferDetail,
|
||||||
GlobalAllBookingType,
|
GlobalAllBookingType,
|
||||||
changeSearchedData,
|
changeSearchedData,
|
||||||
|
PostCancelPayment,
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import { PrintStyleFunction } from '../../../../paymentpdfPage/PrintStyleFunction.js';
|
import { PrintStyleFunction } from '../../../../paymentpdfPage/PrintStyleFunction.js';
|
||||||
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
|
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
|
||||||
|
|
@ -1035,7 +1036,7 @@ const BSBillingTable3Pay = () => {
|
||||||
|
|
||||||
const selectedStyle =
|
const selectedStyle =
|
||||||
stylesMap[
|
stylesMap[
|
||||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||||
];
|
];
|
||||||
|
|
||||||
if (selectedStyle) {
|
if (selectedStyle) {
|
||||||
|
|
@ -1574,7 +1575,15 @@ const BSBillingTable3Pay = () => {
|
||||||
: AddBookingDetails(BookingType, true);
|
: AddBookingDetails(BookingType, true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// PostCancelPayment
|
||||||
|
const CancelPayment = async () => {
|
||||||
|
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
|
||||||
|
if (response?.data?.statusCode) {
|
||||||
|
ClearAllGlobalStateDatas();
|
||||||
|
CustomerDisplay();
|
||||||
|
setBusinessUPI(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
const financialYearError = async () => {
|
const financialYearError = async () => {
|
||||||
setMessageType('error');
|
setMessageType('error');
|
||||||
setMessageData('Financial Year-Based Sales Not Yet Started');
|
setMessageData('Financial Year-Based Sales Not Yet Started');
|
||||||
|
|
@ -2261,15 +2270,15 @@ const BSBillingTable3Pay = () => {
|
||||||
OrderStatus: 'O',
|
OrderStatus: 'O',
|
||||||
OrderType:
|
OrderType:
|
||||||
BookingType === 'Dine In' ||
|
BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
Estimation?.SettingValue == 'N'
|
Estimation?.SettingValue == 'N'
|
||||||
? 'S'
|
? 'S'
|
||||||
: GlobEstBooking === 'OvrAllEst'
|
: GlobEstBooking === 'OvrAllEst'
|
||||||
? 'E'
|
? 'E'
|
||||||
: GlobEstBooking === 'ParEst'
|
: GlobEstBooking === 'ParEst'
|
||||||
? GlobProdwisedata?.includes(
|
? GlobProdwisedata?.includes(
|
||||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||||
)
|
)
|
||||||
? 'E'
|
? 'E'
|
||||||
: 'S'
|
: 'S'
|
||||||
: 'S',
|
: 'S',
|
||||||
|
|
@ -2364,7 +2373,7 @@ const BSBillingTable3Pay = () => {
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
OrderDtlDetails:
|
OrderDtlDetails:
|
||||||
|
|
@ -2381,9 +2390,9 @@ const BSBillingTable3Pay = () => {
|
||||||
? globalTipAmount === 0
|
? globalTipAmount === 0
|
||||||
? SelectedTableDetails
|
? SelectedTableDetails
|
||||||
: SelectedTableDetails?.map((item) => ({
|
: SelectedTableDetails?.map((item) => ({
|
||||||
...item,
|
...item,
|
||||||
TipsAmount: globalTipAmount,
|
TipsAmount: globalTipAmount,
|
||||||
}))
|
}))
|
||||||
: null,
|
: null,
|
||||||
SalesPaymentType: 'normal',
|
SalesPaymentType: 'normal',
|
||||||
PaymentDetail: [
|
PaymentDetail: [
|
||||||
|
|
@ -2398,8 +2407,8 @@ const BSBillingTable3Pay = () => {
|
||||||
? PaymentgatewayUPI?.[0]?.ModeId
|
? PaymentgatewayUPI?.[0]?.ModeId
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||||
? BusinessPayOption?.find(
|
? BusinessPayOption?.find(
|
||||||
(busupi) => busupi?.ModeId === UpiId
|
(busupi) => busupi?.ModeId === UpiId
|
||||||
)?.ModeId
|
)?.ModeId
|
||||||
: paybtnselected
|
: paybtnselected
|
||||||
: paybtnselected
|
: paybtnselected
|
||||||
? paybtnselected
|
? paybtnselected
|
||||||
|
|
@ -2412,15 +2421,15 @@ const BSBillingTable3Pay = () => {
|
||||||
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||||
? null
|
? null
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||||
?.MerchantId
|
?.MerchantId
|
||||||
: null,
|
: null,
|
||||||
PaymentOptionType:
|
PaymentOptionType:
|
||||||
salesBillEdit &&
|
salesBillEdit &&
|
||||||
currentOrderNetAmount < previousNetAmount &&
|
currentOrderNetAmount < previousNetAmount &&
|
||||||
(refundPaySelectedName?.toLowerCase() === 'cash' ||
|
(refundPaySelectedName?.toLowerCase() === 'cash' ||
|
||||||
refundPaySelectedName?.toLowerCase() === 'credit')
|
refundPaySelectedName?.toLowerCase() === 'credit')
|
||||||
? 'PC'
|
? 'PC'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'cash'
|
: Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'PC'
|
? 'PC'
|
||||||
|
|
@ -2440,29 +2449,29 @@ const BSBillingTable3Pay = () => {
|
||||||
? null
|
? null
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'default'
|
: SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||||
?.UPIDetailId
|
?.UPIDetailId
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||||
? BusinessPayOption?.find(
|
? BusinessPayOption?.find(
|
||||||
(busupi) => busupi?.ModeId === UpiId
|
(busupi) => busupi?.ModeId === UpiId
|
||||||
)?.MerchantUPIId
|
)?.MerchantUPIId
|
||||||
: null,
|
: null,
|
||||||
AccountDtl:
|
AccountDtl:
|
||||||
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||||
? []
|
? []
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||||
(upipay) => upipay?.UPIId === UpiId
|
(upipay) => upipay?.UPIId === UpiId
|
||||||
)
|
)
|
||||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||||
SelectedCardOption?.toLowerCase() === 'pd')
|
SelectedCardOption?.toLowerCase() === 'pd')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
||||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||||
SelectedCardOption?.toLowerCase() === 'pg')
|
SelectedCardOption?.toLowerCase() === 'pg')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||||
: [],
|
: [],
|
||||||
PaymentStatus:
|
PaymentStatus:
|
||||||
|
|
@ -2473,13 +2482,13 @@ const BSBillingTable3Pay = () => {
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
Debit:
|
Debit:
|
||||||
salesBillEdit &&
|
salesBillEdit &&
|
||||||
currentOrderNetAmount < previousNetAmount &&
|
currentOrderNetAmount < previousNetAmount &&
|
||||||
refundPaySelectedName?.toLowerCase() === 'credit'
|
refundPaySelectedName?.toLowerCase() === 'credit'
|
||||||
? Math.round(previousNetAmount - currentOrderNetAmount)
|
? Math.round(previousNetAmount - currentOrderNetAmount)
|
||||||
: 0,
|
: 0,
|
||||||
Credit: salesBillEdit
|
Credit: salesBillEdit
|
||||||
|
|
@ -2557,14 +2566,14 @@ const BSBillingTable3Pay = () => {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(
|
setMessageData(
|
||||||
response?.data?.response +
|
response?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(response?.data?.OrderDetails?.length > 0
|
(response?.data?.OrderDetails?.length > 0
|
||||||
? response?.data?.OrderId &&
|
? response?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
response?.data?.OrderId,
|
response?.data?.OrderId,
|
||||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
response?.data?.OrderDetails?.length > 0 &&
|
response?.data?.OrderDetails?.length > 0 &&
|
||||||
setPrintOrderDetails([response?.data]);
|
setPrintOrderDetails([response?.data]);
|
||||||
|
|
@ -2724,14 +2733,14 @@ const BSBillingTable3Pay = () => {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(
|
setMessageData(
|
||||||
response?.data?.response +
|
response?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(response?.data?.OrderDetails?.length > 0
|
(response?.data?.OrderDetails?.length > 0
|
||||||
? response?.data?.OrderId &&
|
? response?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
response?.data?.OrderId,
|
response?.data?.OrderId,
|
||||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
response?.data?.OrderDetails?.length > 0 &&
|
response?.data?.OrderDetails?.length > 0 &&
|
||||||
setPrintOrderDetails([response?.data]);
|
setPrintOrderDetails([response?.data]);
|
||||||
|
|
@ -2834,14 +2843,14 @@ const BSBillingTable3Pay = () => {
|
||||||
}
|
}
|
||||||
setMessageData(
|
setMessageData(
|
||||||
response?.data?.response +
|
response?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(response?.data?.OrderDetails?.length > 0
|
(response?.data?.OrderDetails?.length > 0
|
||||||
? response?.data?.OrderId &&
|
? response?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
response?.data?.OrderId,
|
response?.data?.OrderId,
|
||||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
if (response?.data?.OrderDetails?.length > 0) {
|
if (response?.data?.OrderDetails?.length > 0) {
|
||||||
setPrintOrderDetails([response?.data]);
|
setPrintOrderDetails([response?.data]);
|
||||||
|
|
@ -3018,14 +3027,14 @@ const BSBillingTable3Pay = () => {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(
|
setMessageData(
|
||||||
bookingpaymentupdate?.data?.response +
|
bookingpaymentupdate?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||||
? bookingpaymentupdate?.data?.OrderId &&
|
? bookingpaymentupdate?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
bookingpaymentupdate?.data?.OrderId,
|
bookingpaymentupdate?.data?.OrderId,
|
||||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
||||||
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
||||||
|
|
@ -3044,7 +3053,7 @@ const BSBillingTable3Pay = () => {
|
||||||
if (
|
if (
|
||||||
Date.now() - startTime >
|
Date.now() - startTime >
|
||||||
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
||||||
60000
|
60000
|
||||||
) {
|
) {
|
||||||
// 60,000 ms = 1 minute
|
// 60,000 ms = 1 minute
|
||||||
|
|
||||||
|
|
@ -3751,9 +3760,9 @@ const BSBillingTable3Pay = () => {
|
||||||
'not-allowed',
|
'not-allowed',
|
||||||
color:
|
color:
|
||||||
OrderCardDetail?.length > 0 ||
|
OrderCardDetail?.length > 0 ||
|
||||||
(selOption?.value === undefined &&
|
(selOption?.value === undefined &&
|
||||||
GlobalAddCustomerDetails1?.length === 0 &&
|
GlobalAddCustomerDetails1?.length === 0 &&
|
||||||
GetCustId?.CustMobile === undefined)
|
GetCustId?.CustMobile === undefined)
|
||||||
? 'gray'
|
? 'gray'
|
||||||
: 'rgb(18, 146, 238)',
|
: 'rgb(18, 146, 238)',
|
||||||
fontSize: '28px',
|
fontSize: '28px',
|
||||||
|
|
@ -3775,16 +3784,16 @@ const BSBillingTable3Pay = () => {
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 'none'
|
? 'none'
|
||||||
: 'auto',
|
: 'auto',
|
||||||
opacity:
|
opacity:
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 0.5
|
? 0.5
|
||||||
: 1,
|
: 1,
|
||||||
width: '2rem',
|
width: '2rem',
|
||||||
|
|
@ -3807,14 +3816,14 @@ const BSBillingTable3Pay = () => {
|
||||||
width: '1.5rem',
|
width: '1.5rem',
|
||||||
cursor:
|
cursor:
|
||||||
OrderCardDetail?.length === 0 ||
|
OrderCardDetail?.length === 0 ||
|
||||||
CheckBookingStatus == 'Close' ||
|
CheckBookingStatus == 'Close' ||
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'not-allowed'
|
? 'not-allowed'
|
||||||
: 'pointer',
|
: 'pointer',
|
||||||
color:
|
color:
|
||||||
OrderCardDetail?.length === 0 ||
|
OrderCardDetail?.length === 0 ||
|
||||||
CheckBookingStatus == 'Close' ||
|
CheckBookingStatus == 'Close' ||
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'gray'
|
? 'gray'
|
||||||
: 'rgb(18, 146, 238)',
|
: 'rgb(18, 146, 238)',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
@ -3850,8 +3859,8 @@ const BSBillingTable3Pay = () => {
|
||||||
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
||||||
color:
|
color:
|
||||||
OrderCardDetail?.length > 0 ||
|
OrderCardDetail?.length > 0 ||
|
||||||
(OrderCardDetail?.length > 0 &&
|
(OrderCardDetail?.length > 0 &&
|
||||||
GetCustId?.CustMobile === undefined)
|
GetCustId?.CustMobile === undefined)
|
||||||
? 'gray'
|
? 'gray'
|
||||||
: 'rgb(18, 146, 238)',
|
: 'rgb(18, 146, 238)',
|
||||||
fontSize: '25px',
|
fontSize: '25px',
|
||||||
|
|
@ -3938,65 +3947,65 @@ const BSBillingTable3Pay = () => {
|
||||||
<>
|
<>
|
||||||
{unpaidFlow == false
|
{unpaidFlow == false
|
||||||
? item?.OptionName == 'Hold' &&
|
? item?.OptionName == 'Hold' &&
|
||||||
BookingType !== 'Dine In' &&
|
BookingType !== 'Dine In' &&
|
||||||
!BookingTypeBoth &&
|
!BookingTypeBoth &&
|
||||||
OrderCardDetail?.length != 0 &&
|
OrderCardDetail?.length != 0 &&
|
||||||
CheckOrderType?.length === 0 &&
|
CheckOrderType?.length === 0 &&
|
||||||
OrderType != 'Failed' &&
|
OrderType != 'Failed' &&
|
||||||
CheckBookingStatus != 'Close' &&
|
CheckBookingStatus != 'Close' &&
|
||||||
paybtns?.length > 0 &&
|
paybtns?.length > 0 &&
|
||||||
!addnewAccess && (
|
!addnewAccess && (
|
||||||
<TooltipWrapper
|
<TooltipWrapper
|
||||||
title={'Hold (Alt+W)'}
|
title={'Hold (Alt+W)'}
|
||||||
isMobile={isMobile}
|
isMobile={isMobile}
|
||||||
>
|
>
|
||||||
{' '}
|
{' '}
|
||||||
<PozoHoldIcon
|
<PozoHoldIcon
|
||||||
className="BSBillingNav-icon-table-icon"
|
className="BSBillingNav-icon-table-icon"
|
||||||
onClick={() => AddBookingDetails('Hold', false)}
|
onClick={() => AddBookingDetails('Hold', false)}
|
||||||
style={{
|
style={{
|
||||||
fontSize: '30px',
|
fontSize: '30px',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
color: '' ? '#52c41a' : '#1292EE',
|
color: '' ? '#52c41a' : '#1292EE',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</TooltipWrapper>
|
</TooltipWrapper>
|
||||||
)
|
)
|
||||||
: ''}
|
: ''}
|
||||||
|
|
||||||
{unpaidFlow == false
|
{unpaidFlow == false
|
||||||
? item?.OptionName == 'Hold' &&
|
? item?.OptionName == 'Hold' &&
|
||||||
paybtns?.length > 0 &&
|
paybtns?.length > 0 &&
|
||||||
BookingType !== 'Dine In' &&
|
BookingType !== 'Dine In' &&
|
||||||
!BookingTypeBoth &&
|
!BookingTypeBoth &&
|
||||||
Holddata?.length > 0 &&
|
Holddata?.length > 0 &&
|
||||||
OrderCardDetail?.length == 0 &&
|
OrderCardDetail?.length == 0 &&
|
||||||
CheckBookingStatus != 'Close' &&
|
CheckBookingStatus != 'Close' &&
|
||||||
!addnewAccess && (
|
!addnewAccess && (
|
||||||
<TooltipWrapper
|
<TooltipWrapper
|
||||||
title={'Recall (Alt+W)'}
|
title={'Recall (Alt+W)'}
|
||||||
isMobile={isMobile}
|
isMobile={isMobile}
|
||||||
|
>
|
||||||
|
{' '}
|
||||||
|
<Badge
|
||||||
|
count={Holddata?.length}
|
||||||
|
size={'small'}
|
||||||
|
offset={[0, 7]}
|
||||||
>
|
>
|
||||||
{' '}
|
<PozoHoldIcon
|
||||||
<Badge
|
className="BSBillingNav-icon-table-icon"
|
||||||
count={Holddata?.length}
|
onClick={() => HandleholdModelOpen()}
|
||||||
size={'small'}
|
style={{
|
||||||
offset={[0, 7]}
|
fontSize: '28px',
|
||||||
>
|
cursor: 'pointer',
|
||||||
<PozoHoldIcon
|
color: Holddata ? '#52c41a' : 'default',
|
||||||
className="BSBillingNav-icon-table-icon"
|
pointerEvents:
|
||||||
onClick={() => HandleholdModelOpen()}
|
OrderType === 'Failed' ? 'none' : 'auto',
|
||||||
style={{
|
}}
|
||||||
fontSize: '28px',
|
/>
|
||||||
cursor: 'pointer',
|
</Badge>
|
||||||
color: Holddata ? '#52c41a' : 'default',
|
</TooltipWrapper>
|
||||||
pointerEvents:
|
)
|
||||||
OrderType === 'Failed' ? 'none' : 'auto',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Badge>
|
|
||||||
</TooltipWrapper>
|
|
||||||
)
|
|
||||||
: ''}
|
: ''}
|
||||||
</>
|
</>
|
||||||
))}
|
))}
|
||||||
|
|
@ -4042,14 +4051,14 @@ const BSBillingTable3Pay = () => {
|
||||||
width: '1.5rem',
|
width: '1.5rem',
|
||||||
cursor:
|
cursor:
|
||||||
OrderCardDetail?.length === 0 ||
|
OrderCardDetail?.length === 0 ||
|
||||||
CheckBookingStatus == 'Close' ||
|
CheckBookingStatus == 'Close' ||
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'not-allowed'
|
? 'not-allowed'
|
||||||
: 'pointer',
|
: 'pointer',
|
||||||
color:
|
color:
|
||||||
OrderCardDetail?.length === 0 ||
|
OrderCardDetail?.length === 0 ||
|
||||||
CheckBookingStatus == 'Close' ||
|
CheckBookingStatus == 'Close' ||
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'gray'
|
? 'gray'
|
||||||
: 'rgb(18, 146, 238)',
|
: 'rgb(18, 146, 238)',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
@ -4148,31 +4157,31 @@ const BSBillingTable3Pay = () => {
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 'none'
|
? 'none'
|
||||||
: 'auto',
|
: 'auto',
|
||||||
opacity:
|
opacity:
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 0.5
|
? 0.5
|
||||||
: 1,
|
: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{paybtns?.length > 0 &&
|
{paybtns?.length > 0 &&
|
||||||
currentOrderNetAmount >= previousNetAmount ? (
|
currentOrderNetAmount >= previousNetAmount ? (
|
||||||
paybtns?.map((payment) => (
|
paybtns?.map((payment) => (
|
||||||
<div className="Table3-cash">
|
<div className="Table3-cash">
|
||||||
<button
|
<button
|
||||||
className={
|
className={
|
||||||
paybtnselected === payment.ModeId &&
|
paybtnselected === payment.ModeId &&
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
(UpinotSelected || CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode-notupisel'
|
? 'Btn-payment-mode-notupisel'
|
||||||
: paybtnselected === payment.ModeId &&
|
: paybtnselected === payment.ModeId &&
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
(!UpinotSelected || !CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode'
|
? 'Btn-payment-mode'
|
||||||
: 'Btn-payment-mode-sel'
|
: 'Btn-payment-mode-sel'
|
||||||
}
|
}
|
||||||
|
|
@ -4186,13 +4195,13 @@ const BSBillingTable3Pay = () => {
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id
|
payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id
|
||||||
? handleUPIButtonClick(
|
? handleUPIButtonClick(
|
||||||
payment.ModeId,
|
payment.ModeId,
|
||||||
payment.ModeName
|
payment.ModeName
|
||||||
)
|
)
|
||||||
: handlePaymentMode(
|
: handlePaymentMode(
|
||||||
payment.ModeId,
|
payment.ModeId,
|
||||||
payment.ModeName
|
payment.ModeName
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
||||||
|
|
@ -4252,10 +4261,10 @@ const BSBillingTable3Pay = () => {
|
||||||
<button
|
<button
|
||||||
className={
|
className={
|
||||||
refundPaySelected === payment.ConfigId &&
|
refundPaySelected === payment.ConfigId &&
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
(UpinotSelected || CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode-notupisel'
|
? 'Btn-payment-mode-notupisel'
|
||||||
: refundPaySelected === payment.ConfigId &&
|
: refundPaySelected === payment.ConfigId &&
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
(!UpinotSelected || !CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode'
|
? 'Btn-payment-mode'
|
||||||
: 'Btn-payment-mode-sel'
|
: 'Btn-payment-mode-sel'
|
||||||
}
|
}
|
||||||
|
|
@ -4516,9 +4525,9 @@ const BSBillingTable3Pay = () => {
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'BSBillingTable3-paybtn-deactive'
|
? 'BSBillingTable3-paybtn-deactive'
|
||||||
: FirstPaymentclick === false &&
|
: FirstPaymentclick === false &&
|
||||||
OrderCardDetail?.length > 0 &&
|
OrderCardDetail?.length > 0 &&
|
||||||
paybtnselected &&
|
paybtnselected &&
|
||||||
CheckBookingStatus != 'Close'
|
CheckBookingStatus != 'Close'
|
||||||
? !OrderStatus
|
? !OrderStatus
|
||||||
? salesBillEdit &&
|
? salesBillEdit &&
|
||||||
currentOrderNetAmount < previousNetAmount
|
currentOrderNetAmount < previousNetAmount
|
||||||
|
|
@ -4752,14 +4761,14 @@ const BSBillingTable3Pay = () => {
|
||||||
OrderType === 'Failed'
|
OrderType === 'Failed'
|
||||||
? FailedTotalAmt
|
? FailedTotalAmt
|
||||||
: Math.round(
|
: Math.round(
|
||||||
OrderCardDetail?.reduce(
|
OrderCardDetail?.reduce(
|
||||||
(acc, data) => data?.TotalAmt + acc,
|
(acc, data) => data?.TotalAmt + acc,
|
||||||
0
|
0
|
||||||
) -
|
) -
|
||||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
((OverAllSales > 0 ? OverAllSales : 0) +
|
||||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
||||||
(Discount > 0 ? Discount : 0))
|
(Discount > 0 ? Discount : 0))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
failedOrderData={failedOrderData}
|
failedOrderData={failedOrderData}
|
||||||
/>
|
/>
|
||||||
|
|
@ -4835,9 +4844,9 @@ const BSBillingTable3Pay = () => {
|
||||||
|
|
||||||
const qty = isGroup
|
const qty = isGroup
|
||||||
? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
|
? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
|
||||||
(sum, o) => sum + (o.OrderQty || 1),
|
(sum, o) => sum + (o.OrderQty || 1),
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
: item.OrderQty || 1;
|
: item.OrderQty || 1;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -4919,6 +4928,7 @@ const BSBillingTable3Pay = () => {
|
||||||
open={businessUPI}
|
open={businessUPI}
|
||||||
handleCancel={() => setShowCancelConfirm(true)}
|
handleCancel={() => setShowCancelConfirm(true)}
|
||||||
footer={false}
|
footer={false}
|
||||||
|
destroyOnClose={true}
|
||||||
width={500}
|
width={500}
|
||||||
children={
|
children={
|
||||||
<>
|
<>
|
||||||
|
|
@ -4936,14 +4946,27 @@ const BSBillingTable3Pay = () => {
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{showCancelConfirm && (
|
{showCancelConfirm && (
|
||||||
|
// <Modal
|
||||||
|
// open={showCancelConfirm}
|
||||||
|
// title="Cancel Payment"
|
||||||
|
// onOk={() => {
|
||||||
|
// setBusinessUPI(false);
|
||||||
|
// setShowCancelConfirm(false);
|
||||||
|
// ClearAllGlobalStateDatas();
|
||||||
|
// CustomerDisplay();
|
||||||
|
// }}
|
||||||
|
// onCancel={() => setShowCancelConfirm(false)}
|
||||||
|
// okText="Yes"
|
||||||
|
// cancelText="No"
|
||||||
|
// >
|
||||||
|
// Do you want to cancel the payment?
|
||||||
|
// </Modal>
|
||||||
<Modal
|
<Modal
|
||||||
open={showCancelConfirm}
|
open={showCancelConfirm}
|
||||||
title="Cancel Payment"
|
title="Cancel Payment"
|
||||||
onOk={() => {
|
onOk={() => {
|
||||||
setBusinessUPI(false);
|
|
||||||
setShowCancelConfirm(false);
|
setShowCancelConfirm(false);
|
||||||
ClearAllGlobalStateDatas();
|
CancelPayment()
|
||||||
CustomerDisplay();
|
|
||||||
}}
|
}}
|
||||||
onCancel={() => setShowCancelConfirm(false)}
|
onCancel={() => setShowCancelConfirm(false)}
|
||||||
okText="Yes"
|
okText="Yes"
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ import {
|
||||||
GlobalUnpaidListData,
|
GlobalUnpaidListData,
|
||||||
PaymentGatewayGetdetail,
|
PaymentGatewayGetdetail,
|
||||||
PostBookingData,
|
PostBookingData,
|
||||||
|
PostCancelPayment,
|
||||||
PostPaymentdevice,
|
PostPaymentdevice,
|
||||||
PreferenceData,
|
PreferenceData,
|
||||||
PutBookingData,
|
PutBookingData,
|
||||||
|
|
@ -1214,6 +1215,15 @@ const StandardTablePayment = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// PostCancelPayment
|
||||||
|
const CancelPayment = async () => {
|
||||||
|
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
|
||||||
|
if (response?.data?.statusCode) {
|
||||||
|
ClearAllGlobalStateDatas();
|
||||||
|
CustomerDisplay();
|
||||||
|
setBusinessUPI(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
const Otherserviceprint = async () => {
|
const Otherserviceprint = async () => {
|
||||||
if (OtherServicesPrintDetails?.length > 0) {
|
if (OtherServicesPrintDetails?.length > 0) {
|
||||||
const style = await PrintStyleFunction('OtherServices1');
|
const style = await PrintStyleFunction('OtherServices1');
|
||||||
|
|
@ -4191,6 +4201,7 @@ const StandardTablePayment = () => {
|
||||||
handleCancel={() => setShowCancelConfirm(true)}
|
handleCancel={() => setShowCancelConfirm(true)}
|
||||||
footer={false}
|
footer={false}
|
||||||
width={600}
|
width={600}
|
||||||
|
destroyOnClose={true}
|
||||||
className={'ModalPaymentGatewayEmbedded'}
|
className={'ModalPaymentGatewayEmbedded'}
|
||||||
children={
|
children={
|
||||||
<>
|
<>
|
||||||
|
|
@ -4209,22 +4220,35 @@ const StandardTablePayment = () => {
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{showCancelConfirm && (
|
{showCancelConfirm && (
|
||||||
<Modal
|
// <Modal
|
||||||
open={showCancelConfirm}
|
// open={showCancelConfirm}
|
||||||
title="Cancel Payment"
|
// title="Cancel Payment"
|
||||||
onOk={() => {
|
// onOk={() => {
|
||||||
paymentGatewayRef.current?.clearPolling();
|
// paymentGatewayRef.current?.clearPolling();
|
||||||
setBusinessUPI(false);
|
// setBusinessUPI(false);
|
||||||
setShowCancelConfirm(false);
|
// setShowCancelConfirm(false);
|
||||||
ClearAllGlobalStateDatas();
|
// ClearAllGlobalStateDatas();
|
||||||
CustomerDisplay();
|
// CustomerDisplay();
|
||||||
}}
|
// }}
|
||||||
onCancel={() => setShowCancelConfirm(false)}
|
// onCancel={() => setShowCancelConfirm(false)}
|
||||||
okText="Yes"
|
// okText="Yes"
|
||||||
cancelText="No"
|
// cancelText="No"
|
||||||
>
|
// >
|
||||||
Do you want to cancel the payment?
|
// Do you want to cancel the payment?
|
||||||
</Modal>
|
// </Modal>
|
||||||
|
<Modal
|
||||||
|
open={showCancelConfirm}
|
||||||
|
title="Cancel Payment"
|
||||||
|
onOk={() => {
|
||||||
|
setShowCancelConfirm(false);
|
||||||
|
CancelPayment()
|
||||||
|
}}
|
||||||
|
onCancel={() => setShowCancelConfirm(false)}
|
||||||
|
okText="Yes"
|
||||||
|
cancelText="No"
|
||||||
|
>
|
||||||
|
Do you want to cancel the payment?
|
||||||
|
</Modal>
|
||||||
)}
|
)}
|
||||||
{customerPreviesOrders && (
|
{customerPreviesOrders && (
|
||||||
<DefaultModal
|
<DefaultModal
|
||||||
|
|
|
||||||
|
|
@ -534,10 +534,14 @@ function BSCategoryHorizontal(props) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 2 or more items, always show
|
// 2 or more items, always show
|
||||||
setSubCat(true);
|
if (FavSelected) {
|
||||||
|
setSubCat(false);
|
||||||
|
} else {
|
||||||
|
setSubCat(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [SubcategorieData, templateData]);
|
}, [SubcategorieData, templateData, FavSelected]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (typeof searchData === 'string' && categoryData?.length > 0) {
|
if (typeof searchData === 'string' && categoryData?.length > 0) {
|
||||||
|
|
@ -608,9 +612,9 @@ function BSCategoryHorizontal(props) {
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
...(AvailableDate && selectedDate
|
...(AvailableDate && selectedDate
|
||||||
? {
|
? {
|
||||||
fromDate: selectedDate?.[0],
|
fromDate: selectedDate?.[0],
|
||||||
toDate: selectedDate?.[1],
|
toDate: selectedDate?.[1],
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -647,9 +651,9 @@ function BSCategoryHorizontal(props) {
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
...(AvailableDate && selectedDate
|
...(AvailableDate && selectedDate
|
||||||
? {
|
? {
|
||||||
fromDate: selectedDate?.[0],
|
fromDate: selectedDate?.[0],
|
||||||
toDate: selectedDate?.[1],
|
toDate: selectedDate?.[1],
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
let res = await dispatch(getSelectedFavItems(data)).unwrap();
|
let res = await dispatch(getSelectedFavItems(data)).unwrap();
|
||||||
|
|
@ -886,9 +890,9 @@ function BSCategoryHorizontal(props) {
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
!accessOther && accessToCard
|
!accessOther && accessToCard
|
||||||
? lightenColor(
|
? lightenColor(
|
||||||
SelectedCatgColor?.['BackgroundColor'],
|
SelectedCatgColor?.['BackgroundColor'],
|
||||||
0.4
|
0.4
|
||||||
)
|
)
|
||||||
: SelectedCatgColor?.['BackgroundColor'],
|
: SelectedCatgColor?.['BackgroundColor'],
|
||||||
padding: padding,
|
padding: padding,
|
||||||
border: accessToCard ? '1px solid' : undefined,
|
border: accessToCard ? '1px solid' : undefined,
|
||||||
|
|
@ -899,9 +903,9 @@ function BSCategoryHorizontal(props) {
|
||||||
: SelectedCatgColor?.['BackgroundColor'] === '#000000'
|
: SelectedCatgColor?.['BackgroundColor'] === '#000000'
|
||||||
? '#ffffff'
|
? '#ffffff'
|
||||||
: darkenColor(
|
: darkenColor(
|
||||||
SelectedCatgColor?.['BackgroundColor'],
|
SelectedCatgColor?.['BackgroundColor'],
|
||||||
70
|
70
|
||||||
)
|
)
|
||||||
: undefined,
|
: undefined,
|
||||||
}}
|
}}
|
||||||
className="sampleCard"
|
className="sampleCard"
|
||||||
|
|
@ -935,9 +939,9 @@ function BSCategoryHorizontal(props) {
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
!accessOther && !accessToCard && -2 == indexval
|
!accessOther && !accessToCard && -2 == indexval
|
||||||
? lightenColor(
|
? lightenColor(
|
||||||
SelectedCatgColor?.['BackgroundColor'],
|
SelectedCatgColor?.['BackgroundColor'],
|
||||||
0.4
|
0.4
|
||||||
)
|
)
|
||||||
: SelectedCatgColor?.['BackgroundColor'],
|
: SelectedCatgColor?.['BackgroundColor'],
|
||||||
padding: padding,
|
padding: padding,
|
||||||
border:
|
border:
|
||||||
|
|
@ -983,9 +987,9 @@ function BSCategoryHorizontal(props) {
|
||||||
? index != indexval
|
? index != indexval
|
||||||
? SelectedCatgColor?.['BackgroundColor']
|
? SelectedCatgColor?.['BackgroundColor']
|
||||||
: lightenColor(
|
: lightenColor(
|
||||||
SelectedCatgColor?.['BackgroundColor'],
|
SelectedCatgColor?.['BackgroundColor'],
|
||||||
0.4
|
0.4
|
||||||
)
|
)
|
||||||
: SelectedCatgColor?.['BackgroundColor'],
|
: SelectedCatgColor?.['BackgroundColor'],
|
||||||
padding: padding,
|
padding: padding,
|
||||||
border: '1px solid',
|
border: '1px solid',
|
||||||
|
|
@ -1088,11 +1092,11 @@ function BSCategoryHorizontal(props) {
|
||||||
? index !== indexval
|
? index !== indexval
|
||||||
? SelectedCatgColor?.['BackgroundColor']
|
? SelectedCatgColor?.['BackgroundColor']
|
||||||
: lightenColor(
|
: lightenColor(
|
||||||
SelectedCatgColor?.[
|
SelectedCatgColor?.[
|
||||||
'BackgroundColor'
|
'BackgroundColor'
|
||||||
],
|
],
|
||||||
0.4
|
0.4
|
||||||
)
|
)
|
||||||
: SelectedCatgColor?.['BackgroundColor'],
|
: SelectedCatgColor?.['BackgroundColor'],
|
||||||
padding: padding,
|
padding: padding,
|
||||||
border: '1px solid',
|
border: '1px solid',
|
||||||
|
|
@ -1100,18 +1104,18 @@ function BSCategoryHorizontal(props) {
|
||||||
index !== indexval
|
index !== indexval
|
||||||
? SelectedCatgColor?.['BackgroundColor']
|
? SelectedCatgColor?.['BackgroundColor']
|
||||||
: SelectedCatgColor?.['BackgroundColor'] ===
|
: SelectedCatgColor?.['BackgroundColor'] ===
|
||||||
'#ffffff'
|
'#ffffff'
|
||||||
? '#000000'
|
? '#000000'
|
||||||
: SelectedCatgColor?.[
|
: SelectedCatgColor?.[
|
||||||
'BackgroundColor'
|
'BackgroundColor'
|
||||||
] === '#000000'
|
] === '#000000'
|
||||||
? '#ffffff'
|
? '#ffffff'
|
||||||
: darkenColor(
|
: darkenColor(
|
||||||
SelectedCatgColor?.[
|
SelectedCatgColor?.[
|
||||||
'BackgroundColor'
|
'BackgroundColor'
|
||||||
],
|
],
|
||||||
70
|
70
|
||||||
),
|
),
|
||||||
userSelect: 'none',
|
userSelect: 'none',
|
||||||
minWidth: 'max-content', // set a width if needed
|
minWidth: 'max-content', // set a width if needed
|
||||||
}}
|
}}
|
||||||
|
|
@ -1170,16 +1174,16 @@ function BSCategoryHorizontal(props) {
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
!accessOther && accessToCard
|
!accessOther && accessToCard
|
||||||
? lightenColor(
|
? lightenColor(
|
||||||
SelectedCatgColor?.['BackgroundColor'],
|
SelectedCatgColor?.['BackgroundColor'],
|
||||||
0.4
|
0.4
|
||||||
)
|
)
|
||||||
: SelectedCatgColor?.['BackgroundColor'],
|
: SelectedCatgColor?.['BackgroundColor'],
|
||||||
padding: padding,
|
padding: padding,
|
||||||
border: accessToCard && '1px solid',
|
border: accessToCard && '1px solid',
|
||||||
borderColor:
|
borderColor:
|
||||||
accessToCard &&
|
accessToCard &&
|
||||||
!accessOther &&
|
!accessOther &&
|
||||||
SelectedCatgColor?.['BackgroundColor'] == '#ffffff'
|
SelectedCatgColor?.['BackgroundColor'] == '#ffffff'
|
||||||
? '#000000'
|
? '#000000'
|
||||||
: SelectedCatgColor?.['BackgroundColor'] === '#000000'
|
: SelectedCatgColor?.['BackgroundColor'] === '#000000'
|
||||||
? '#ffffff'
|
? '#ffffff'
|
||||||
|
|
@ -1219,7 +1223,7 @@ function BSCategoryHorizontal(props) {
|
||||||
border: accessOther && '1px solid',
|
border: accessOther && '1px solid',
|
||||||
borderColor:
|
borderColor:
|
||||||
accessOther &&
|
accessOther &&
|
||||||
SelectedCatgColor?.['BackgroundColor'] == '#ffffff'
|
SelectedCatgColor?.['BackgroundColor'] == '#ffffff'
|
||||||
? '#000000'
|
? '#000000'
|
||||||
: SelectedCatgColor?.['BackgroundColor'] === '#000000'
|
: SelectedCatgColor?.['BackgroundColor'] === '#000000'
|
||||||
? '#ffffff'
|
? '#ffffff'
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,7 @@ import {
|
||||||
changePreviousOrderOfferDetail,
|
changePreviousOrderOfferDetail,
|
||||||
GlobalPaymentTrigger,
|
GlobalPaymentTrigger,
|
||||||
changeSearchedData,
|
changeSearchedData,
|
||||||
|
PostCancelPayment,
|
||||||
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import { PrintStyleFunction } from '../../../paymentpdfPage/PrintStyleFunction.js';
|
import { PrintStyleFunction } from '../../../paymentpdfPage/PrintStyleFunction.js';
|
||||||
import {
|
import {
|
||||||
|
|
@ -1294,6 +1295,16 @@ const BSC1Payment = (props) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// PostCancelPayment
|
||||||
|
const CancelPayment = async () => {
|
||||||
|
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
|
||||||
|
if (response?.data?.statusCode) {
|
||||||
|
ClearAllGlobalStateDatas();
|
||||||
|
CustomerDisplay();
|
||||||
|
setBusinessUPI(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyPress = (event) => {
|
const handleKeyPress = (event) => {
|
||||||
if (event.key === 'F4' && isButtonActive() && !isF4Pressed.current) {
|
if (event.key === 'F4' && isButtonActive() && !isF4Pressed.current) {
|
||||||
|
|
@ -4993,6 +5004,7 @@ const BSC1Payment = (props) => {
|
||||||
handleCancel={() => setShowCancelConfirm(true)}
|
handleCancel={() => setShowCancelConfirm(true)}
|
||||||
footer={false}
|
footer={false}
|
||||||
width={500}
|
width={500}
|
||||||
|
destroyOnClose={true}
|
||||||
children={
|
children={
|
||||||
<>
|
<>
|
||||||
<PaymentGatewayEmbedded
|
<PaymentGatewayEmbedded
|
||||||
|
|
@ -5009,21 +5021,34 @@ const BSC1Payment = (props) => {
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{showCancelConfirm && (
|
{showCancelConfirm && (
|
||||||
|
// <Modal
|
||||||
|
// open={showCancelConfirm}
|
||||||
|
// title="Cancel Payment"
|
||||||
|
// onOk={() => {
|
||||||
|
// setBusinessUPI(false);
|
||||||
|
// setShowCancelConfirm(false);
|
||||||
|
// ClearAllGlobalStateDatas();
|
||||||
|
// CustomerDisplay();
|
||||||
|
// }}
|
||||||
|
// onCancel={() => setShowCancelConfirm(false)}
|
||||||
|
// okText="Yes"
|
||||||
|
// cancelText="No"
|
||||||
|
// >
|
||||||
|
// Do you want to cancel the payment?
|
||||||
|
// </Modal>
|
||||||
<Modal
|
<Modal
|
||||||
open={showCancelConfirm}
|
open={showCancelConfirm}
|
||||||
title="Cancel Payment"
|
title="Cancel Payment"
|
||||||
onOk={() => {
|
onOk={() => {
|
||||||
setBusinessUPI(false);
|
setShowCancelConfirm(false);
|
||||||
setShowCancelConfirm(false);
|
CancelPayment()
|
||||||
ClearAllGlobalStateDatas();
|
}}
|
||||||
CustomerDisplay();
|
onCancel={() => setShowCancelConfirm(false)}
|
||||||
}}
|
okText="Yes"
|
||||||
onCancel={() => setShowCancelConfirm(false)}
|
cancelText="No"
|
||||||
okText="Yes"
|
>
|
||||||
cancelText="No"
|
Do you want to cancel the payment?
|
||||||
>
|
</Modal>
|
||||||
Do you want to cancel the payment?
|
|
||||||
</Modal>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{customerPreviesOrders && (
|
{customerPreviesOrders && (
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1223,7 +1223,7 @@ const BSNavbar1 = (props, BookingNavbar) => {
|
||||||
pointerEvents: OrderType === 'Failed' ? 'none' : 'auto',
|
pointerEvents: OrderType === 'Failed' ? 'none' : 'auto',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<BSNavBarFavItems />
|
<BSNavBarFavItems setNavmenu={setNavmenu} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{/* DragItem */}
|
{/* DragItem */}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
import { useEffect, useRef, useState } from 'react';
|
import { useEffect, useRef, useState } from 'react';
|
||||||
import { useSelector, useDispatch } from 'react-redux';
|
import { useSelector, useDispatch } from 'react-redux';
|
||||||
import { Button, Carousel, Skeleton } from 'antd';
|
import { Button, Carousel, Skeleton } from 'antd';
|
||||||
import { ArrowRightOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons';
|
import {
|
||||||
|
ArrowRightOutlined,
|
||||||
|
LeftOutlined,
|
||||||
|
RightOutlined,
|
||||||
|
} from '@ant-design/icons';
|
||||||
import SelectionComponent from './SelectionComponent';
|
import SelectionComponent from './SelectionComponent';
|
||||||
import PreviewLayout1 from '../PreviewLayouts/PreviewLayout1';
|
import PreviewLayout1 from '../PreviewLayouts/PreviewLayout1';
|
||||||
import PreviewLayout2 from '../PreviewLayouts/PreviewLayout2';
|
import PreviewLayout2 from '../PreviewLayouts/PreviewLayout2';
|
||||||
|
|
@ -10,19 +14,30 @@ import PreViewLayout4 from '../PreviewLayouts/PreViewLayout4';
|
||||||
import PreviewLayout5 from '../PreviewLayouts/PreviewLayout5';
|
import PreviewLayout5 from '../PreviewLayouts/PreviewLayout5';
|
||||||
import PreViewLayout6 from '../PreviewLayouts/PreViewLayout6';
|
import PreViewLayout6 from '../PreviewLayouts/PreViewLayout6';
|
||||||
import ComboLayout1 from '../PreviewLayouts/ComboLayout1';
|
import ComboLayout1 from '../PreviewLayouts/ComboLayout1';
|
||||||
import { changeActiveTheme, changeOthersTheme, changeSelectedTheme, changeThemeCreation, getOthersTemplate, getPreviewData, getTemplate, GlobalActiveTheme, GlobalDefaultTheme, GlobalOthersTheme, GlobalSelectedTheme } from '../../../../Features/ThemeChange/ThemeChange';
|
import {
|
||||||
|
changeActiveTheme,
|
||||||
|
changeOthersTheme,
|
||||||
|
changeSelectedTheme,
|
||||||
|
changeThemeCreation,
|
||||||
|
getOthersTemplate,
|
||||||
|
getPreviewData,
|
||||||
|
getTemplate,
|
||||||
|
GlobalActiveTheme,
|
||||||
|
GlobalDefaultTheme,
|
||||||
|
GlobalOthersTheme,
|
||||||
|
GlobalSelectedTheme,
|
||||||
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import '../../../../Styles/BookingScreen/Components/SelectionComponent/MainPage.scss';
|
import '../../../../Styles/BookingScreen/Components/SelectionComponent/MainPage.scss';
|
||||||
import { HiOutlineSquares2X2, HiSquaresPlus } from 'react-icons/hi2';
|
import { HiOutlineSquares2X2, HiSquaresPlus } from 'react-icons/hi2';
|
||||||
import { getSession } from '../../../../Services/Others';
|
import { getSession } from '../../../../Services/Others';
|
||||||
import Buttons from '../../../../Components/Forms/Buttons';
|
import Buttons from '../../../../Components/Forms/Buttons';
|
||||||
import { BiSkipNext, BiSkipPrevious } from 'react-icons/bi';
|
import { BiSkipNext, BiSkipPrevious } from 'react-icons/bi';
|
||||||
import { MdOutlineDisplaySettings } from "react-icons/md";
|
import { MdOutlineDisplaySettings } from 'react-icons/md';
|
||||||
import { useAuth } from '../../../../AuthContext';
|
import { useAuth } from '../../../../AuthContext';
|
||||||
import { getEmpAccess } from '../../../../Features/AppPage/CenterPage';
|
import { getEmpAccess } from '../../../../Features/AppPage/CenterPage';
|
||||||
|
|
||||||
|
|
||||||
const BookingSelectionPage = (props) => {
|
const BookingSelectionPage = (props) => {
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Sales Screen'
|
(e) => e?.MenuName === 'Sales Screen'
|
||||||
);
|
);
|
||||||
|
|
@ -39,16 +54,16 @@ const BookingSelectionPage = (props) => {
|
||||||
// const [activeTheme, setActiveTheme] = useState(
|
// const [activeTheme, setActiveTheme] = useState(
|
||||||
// 'default'
|
// 'default'
|
||||||
// );
|
// );
|
||||||
const activeTheme = useSelector(GlobalActiveTheme)
|
const activeTheme = useSelector(GlobalActiveTheme);
|
||||||
const SelectedTheme = useSelector(GlobalSelectedTheme)
|
const SelectedTheme = useSelector(GlobalSelectedTheme);
|
||||||
|
|
||||||
const mergedThemes = DefaultThemes.concat(OthersTheme)
|
const mergedThemes = DefaultThemes.concat(OthersTheme);
|
||||||
const [currentSlide, setCurrentSlide] = useState(0);
|
const [currentSlide, setCurrentSlide] = useState(0);
|
||||||
console.log(SelectedTheme, "currentSlide")
|
console.log(SelectedTheme, 'currentSlide');
|
||||||
const [OthersCount, setOthersCount] = useState(1);
|
const [OthersCount, setOthersCount] = useState(1);
|
||||||
const [isNext, isSetNext] = useState(true);
|
const [isNext, isSetNext] = useState(true);
|
||||||
const [empData, setEmpData] = useState();
|
const [empData, setEmpData] = useState();
|
||||||
const [addnewAccess, setaddnewAccess] = useState(true);
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
const rightIsLastSlide = currentSlide === mergedThemes.length - 1;
|
const rightIsLastSlide = currentSlide === mergedThemes.length - 1;
|
||||||
const leftIsFirstSlide = currentSlide === 0 && OthersCount > 1;
|
const leftIsFirstSlide = currentSlide === 0 && OthersCount > 1;
|
||||||
const [pendingSlide, setPendingSlide] = useState(null);
|
const [pendingSlide, setPendingSlide] = useState(null);
|
||||||
|
|
@ -68,42 +83,42 @@ const BookingSelectionPage = (props) => {
|
||||||
: useSelector(getPreviewData);
|
: useSelector(getPreviewData);
|
||||||
console.log(previewData, 'previewDatapreviewData');
|
console.log(previewData, 'previewDatapreviewData');
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
GetOthersTemplate()
|
GetOthersTemplate();
|
||||||
// gettemplatedetail()
|
// gettemplatedetail()
|
||||||
}, [])
|
}, []);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (UserType === 'Employee') {
|
if (UserType === 'Employee') {
|
||||||
fetchApi();
|
fetchApi();
|
||||||
}
|
}
|
||||||
}, [UserType]);
|
}, [UserType]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let hasAccess = false;
|
let hasAccess = false;
|
||||||
|
|
||||||
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
||||||
hasAccess = true;
|
hasAccess = true;
|
||||||
} else if (UserType === 'Employee') {
|
} else if (UserType === 'Employee') {
|
||||||
hasAccess = empData?.AddAccess === 'Y';
|
hasAccess = empData?.AddAccess === 'Y';
|
||||||
} else if (UserType === 'Super Admin User') {
|
} else if (UserType === 'Super Admin User') {
|
||||||
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
||||||
}
|
}
|
||||||
|
|
||||||
setaddnewAccess(!hasAccess);
|
setaddnewAccess(!hasAccess);
|
||||||
}, [empData, SAAccessCommonMaster, UserType]);
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
|
||||||
const fetchApi = async () => {
|
const fetchApi = async () => {
|
||||||
let data = {
|
let data = {
|
||||||
CompId: CompId,
|
CompId: CompId,
|
||||||
BranchId: BranchId,
|
BranchId: BranchId,
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
EmpId: UserId,
|
EmpId: UserId,
|
||||||
};
|
|
||||||
let response = await dispatch(getEmpAccess(data)).unwrap();
|
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
|
||||||
(item) => item.ConfigName === 'Sales Screen'
|
|
||||||
);
|
|
||||||
setEmpData(datas?.[0]);
|
|
||||||
};
|
};
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
|
(item) => item.ConfigName === 'Sales Screen'
|
||||||
|
);
|
||||||
|
setEmpData(datas?.[0]);
|
||||||
|
};
|
||||||
|
|
||||||
const gettemplatedetail = async () => {
|
const gettemplatedetail = async () => {
|
||||||
let tempdetail = await dispatch(
|
let tempdetail = await dispatch(
|
||||||
|
|
@ -111,7 +126,7 @@ const BookingSelectionPage = (props) => {
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
if (tempdetail?.data?.statusCode == 1) {
|
if (tempdetail?.data?.statusCode == 1) {
|
||||||
dispatch(changeActiveTheme("customised"));
|
dispatch(changeActiveTheme('customised'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -149,7 +164,12 @@ const BookingSelectionPage = (props) => {
|
||||||
setCurrentSlide(pendingSlide);
|
setCurrentSlide(pendingSlide);
|
||||||
let seltheme = updatedThemes[pendingSlide];
|
let seltheme = updatedThemes[pendingSlide];
|
||||||
dispatch(changeThemeCreation({ formtype: 'edit', editdata: seltheme }));
|
dispatch(changeThemeCreation({ formtype: 'edit', editdata: seltheme }));
|
||||||
dispatch(changeSelectedTheme({ ThemeId: seltheme?.TemplatePreferenceId, ThemeName: seltheme?.ThemeName }));
|
dispatch(
|
||||||
|
changeSelectedTheme({
|
||||||
|
ThemeId: seltheme?.TemplatePreferenceId,
|
||||||
|
ThemeName: seltheme?.ThemeName,
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
setPendingSlide(null); // Reset
|
setPendingSlide(null); // Reset
|
||||||
}
|
}
|
||||||
|
|
@ -205,7 +225,12 @@ const BookingSelectionPage = (props) => {
|
||||||
setCurrentSlide(newIndex);
|
setCurrentSlide(newIndex);
|
||||||
let seltheme = mergedThemes[newIndex];
|
let seltheme = mergedThemes[newIndex];
|
||||||
dispatch(changeThemeCreation({ formtype: 'edit', editdata: seltheme }));
|
dispatch(changeThemeCreation({ formtype: 'edit', editdata: seltheme }));
|
||||||
dispatch(changeSelectedTheme({ ThemeId: seltheme?.TemplatePreferenceId, ThemeName: seltheme?.ThemeName }));
|
dispatch(
|
||||||
|
changeSelectedTheme({
|
||||||
|
ThemeId: seltheme?.TemplatePreferenceId,
|
||||||
|
ThemeName: seltheme?.ThemeName,
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -214,12 +239,18 @@ const BookingSelectionPage = (props) => {
|
||||||
await GetLessTemplate();
|
await GetLessTemplate();
|
||||||
setPendingSlide(DefaultThemes.concat(OthersTheme).length - 1); // Ask to jump to last slide after fetch
|
setPendingSlide(DefaultThemes.concat(OthersTheme).length - 1); // Ask to jump to last slide after fetch
|
||||||
} else {
|
} else {
|
||||||
const newIndex = (currentSlide - 1 + mergedThemes.length) % mergedThemes.length;
|
const newIndex =
|
||||||
|
(currentSlide - 1 + mergedThemes.length) % mergedThemes.length;
|
||||||
carouselRef.current.goTo(newIndex);
|
carouselRef.current.goTo(newIndex);
|
||||||
setCurrentSlide(newIndex);
|
setCurrentSlide(newIndex);
|
||||||
let seltheme = mergedThemes[newIndex];
|
let seltheme = mergedThemes[newIndex];
|
||||||
dispatch(changeThemeCreation({ formtype: 'edit', editdata: seltheme }));
|
dispatch(changeThemeCreation({ formtype: 'edit', editdata: seltheme }));
|
||||||
dispatch(changeSelectedTheme({ ThemeId: seltheme?.TemplatePreferenceId, ThemeName: seltheme?.ThemeName }));
|
dispatch(
|
||||||
|
changeSelectedTheme({
|
||||||
|
ThemeId: seltheme?.TemplatePreferenceId,
|
||||||
|
ThemeName: seltheme?.ThemeName,
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const CustomisedthemeSelection = async (seltheme) => {
|
const CustomisedthemeSelection = async (seltheme) => {
|
||||||
|
|
@ -236,16 +267,25 @@ const BookingSelectionPage = (props) => {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (Object.keys(DefaultThemes)?.length > 0) {
|
if (Object.keys(DefaultThemes)?.length > 0) {
|
||||||
dispatch(changeSelectedTheme({ ThemeId: DefaultThemes?.[0]?.TemplatePreferenceId, ThemeName: DefaultThemes?.[0]?.ThemeName }));
|
dispatch(
|
||||||
|
changeSelectedTheme({
|
||||||
|
ThemeId: DefaultThemes?.[0]?.TemplatePreferenceId,
|
||||||
|
ThemeName: DefaultThemes?.[0]?.ThemeName,
|
||||||
|
})
|
||||||
|
);
|
||||||
// settemplateData(DefaultThemes?.[0]);
|
// settemplateData(DefaultThemes?.[0]);
|
||||||
dispatch(changeThemeCreation({ formtype: 'edit', editdata: DefaultThemes?.[0] }));
|
dispatch(
|
||||||
|
changeThemeCreation({
|
||||||
|
formtype: 'edit',
|
||||||
|
editdata: DefaultThemes?.[0],
|
||||||
|
})
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
dispatch(changeSelectedTheme({}));
|
dispatch(changeSelectedTheme({}));
|
||||||
dispatch(changeThemeCreation({ formtype: 'new' }));
|
dispatch(changeThemeCreation({ formtype: 'new' }));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
const handlesubmit = () => {
|
const handlesubmit = () => {
|
||||||
const PostData = {};
|
const PostData = {};
|
||||||
|
|
@ -256,7 +296,7 @@ const BookingSelectionPage = (props) => {
|
||||||
PostData['ColorId'] = colorFilteredArray;
|
PostData['ColorId'] = colorFilteredArray;
|
||||||
PostData['FontId'] = fontFilteredArray;
|
PostData['FontId'] = fontFilteredArray;
|
||||||
PostData['CreatedBy'] = UserId;
|
PostData['CreatedBy'] = UserId;
|
||||||
}
|
};
|
||||||
const GetOthersTemplate = async () => {
|
const GetOthersTemplate = async () => {
|
||||||
let OtherTemp = await dispatch(
|
let OtherTemp = await dispatch(
|
||||||
getOthersTemplate({ pagenumber: OthersCount })
|
getOthersTemplate({ pagenumber: OthersCount })
|
||||||
|
|
@ -266,7 +306,7 @@ const BookingSelectionPage = (props) => {
|
||||||
...temp,
|
...temp,
|
||||||
ThemeName: `Theme ${index + 1 + OthersCount * 10 - 10}`,
|
ThemeName: `Theme ${index + 1 + OthersCount * 10 - 10}`,
|
||||||
}));
|
}));
|
||||||
dispatch(changeOthersTheme(withname))
|
dispatch(changeOthersTheme(withname));
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -288,8 +328,7 @@ const BookingSelectionPage = (props) => {
|
||||||
...temp,
|
...temp,
|
||||||
ThemeName: `Theme ${index + 1 + (tempcount - 1) * 10}`,
|
ThemeName: `Theme ${index + 1 + (tempcount - 1) * 10}`,
|
||||||
}));
|
}));
|
||||||
dispatch(changeOthersTheme(withname))
|
dispatch(changeOthersTheme(withname));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
setMessageType('warning');
|
setMessageType('warning');
|
||||||
setMessageData('No more templates');
|
setMessageData('No more templates');
|
||||||
|
|
@ -306,22 +345,24 @@ const BookingSelectionPage = (props) => {
|
||||||
...temp,
|
...temp,
|
||||||
ThemeName: `Theme ${index + 1 + (tempcount - 1) * 10}`,
|
ThemeName: `Theme ${index + 1 + (tempcount - 1) * 10}`,
|
||||||
}));
|
}));
|
||||||
dispatch(changeOthersTheme(withname))
|
dispatch(changeOthersTheme(withname));
|
||||||
|
|
||||||
isSetNext(true);
|
isSetNext(true);
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const clearOtherTemplate = async () => {
|
const clearOtherTemplate = async () => {
|
||||||
dispatch(changeOthersTheme([]))
|
dispatch(changeOthersTheme([]));
|
||||||
setOthersCount(1);
|
setOthersCount(1);
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div className='SalesSetupMaster'>
|
<div className="SalesSetupMaster">
|
||||||
|
|
||||||
<div className="Salessetup-header">
|
<div className="Salessetup-header">
|
||||||
<h1 className="formHeader">
|
<h1 className="formHeader">
|
||||||
<p> <MdOutlineDisplaySettings size={30} color='#2563eb' /> Sales Setup</p>
|
<p>
|
||||||
|
{' '}
|
||||||
|
<MdOutlineDisplaySettings size={30} color="#2563eb" /> Sales Setup
|
||||||
|
</p>
|
||||||
<div>Customize your sales screen here </div>
|
<div>Customize your sales screen here </div>
|
||||||
</h1>
|
</h1>
|
||||||
<div className="defaultandCustomisedThemeSales">
|
<div className="defaultandCustomisedThemeSales">
|
||||||
|
|
@ -338,29 +379,24 @@ const BookingSelectionPage = (props) => {
|
||||||
>
|
>
|
||||||
<HiSquaresPlus size={16} /> Customized Theme
|
<HiSquaresPlus size={16} /> Customized Theme
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{activeTheme === 'default' &&
|
{activeTheme === 'default' && (
|
||||||
<div className="Default-SubmitButton">
|
<div className="Default-SubmitButton">
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText="Save"
|
buttonText="Save"
|
||||||
color="901D77"
|
color="901D77"
|
||||||
disabled = {addnewAccess}
|
disabled={addnewAccess}
|
||||||
handleSubmit={handleMainSubmit}
|
handleSubmit={handleMainSubmit}
|
||||||
icon={<ArrowRightOutlined />}
|
icon={<ArrowRightOutlined />}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className='salesScreenView'
|
<div className="salesScreenView">
|
||||||
>
|
{activeTheme === 'default' ? (
|
||||||
{activeTheme === 'default' ?
|
|
||||||
<>
|
<>
|
||||||
<div
|
<div className="default-Sales-dotted-box">
|
||||||
className="default-Sales-dotted-box"
|
|
||||||
>
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
icon={<LeftOutlined />}
|
icon={<LeftOutlined />}
|
||||||
onClick={() => leftOnclick()}
|
onClick={() => leftOnclick()}
|
||||||
|
|
@ -396,7 +432,7 @@ const BookingSelectionPage = (props) => {
|
||||||
dots={false}
|
dots={false}
|
||||||
draggable={true}
|
draggable={true}
|
||||||
style={{ width: '100%', height: '100%', position: 'relative' }}
|
style={{ width: '100%', height: '100%', position: 'relative' }}
|
||||||
// afterChange={handleCarouselChange}
|
// afterChange={handleCarouselChange}
|
||||||
>
|
>
|
||||||
{Object.keys(previewData)?.length > 0 ? (
|
{Object.keys(previewData)?.length > 0 ? (
|
||||||
renderPreviewLayout()
|
renderPreviewLayout()
|
||||||
|
|
@ -406,26 +442,24 @@ const BookingSelectionPage = (props) => {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Carousel>
|
</Carousel>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ display: 'none' }}>
|
<div style={{ display: 'none' }}>
|
||||||
<SelectionComponent ref={childRef} />
|
<SelectionComponent ref={childRef} />
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
:
|
) : (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className="Sales-dotted-box"
|
className="Sales-dotted-box"
|
||||||
style={{ width: '55%', height: '85%', position: 'relative' }}
|
style={{ width: '55%', height: '85%', position: 'relative' }}
|
||||||
>
|
>
|
||||||
|
|
||||||
<Carousel
|
<Carousel
|
||||||
ref={carouselRef}
|
ref={carouselRef}
|
||||||
dots={false}
|
dots={false}
|
||||||
draggable={true}
|
draggable={true}
|
||||||
style={{ width: '100%', height: '100%', position: 'relative' }}
|
style={{ width: '100%', height: '100%', position: 'relative' }}
|
||||||
// afterChange={handleCarouselChange}
|
// afterChange={handleCarouselChange}
|
||||||
>
|
>
|
||||||
{Object.keys(previewData)?.length > 0 ? (
|
{Object.keys(previewData)?.length > 0 ? (
|
||||||
renderPreviewLayout()
|
renderPreviewLayout()
|
||||||
|
|
@ -436,16 +470,14 @@ const BookingSelectionPage = (props) => {
|
||||||
)}
|
)}
|
||||||
</Carousel>
|
</Carousel>
|
||||||
</div>
|
</div>
|
||||||
<div className='SelectionComponentImport'>
|
<div className="SelectionComponentImport">
|
||||||
<SelectionComponent ref={childRef} />
|
<SelectionComponent ref={childRef} />
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default BookingSelectionPage;
|
export default BookingSelectionPage;
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ const PreviewLayout1 = (props) => {
|
||||||
)}
|
)}
|
||||||
/>{' '}
|
/>{' '}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ backgroundColor: '#fff'}}>
|
<div style={{ backgroundColor: '#fff' }}>
|
||||||
{Preview1Data?.BookingLayout?.[1] &&
|
{Preview1Data?.BookingLayout?.[1] &&
|
||||||
Preview1Data?.BookingBilling?.[0] != 'Billing1' &&
|
Preview1Data?.BookingBilling?.[0] != 'Billing1' &&
|
||||||
Preview1Data?.BookingBilling?.[0] != 'Billing2' &&
|
Preview1Data?.BookingBilling?.[0] != 'Billing2' &&
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,14 @@ import { SlArrowDown } from 'react-icons/sl';
|
||||||
import { IoCloseSharp } from 'react-icons/io5';
|
import { IoCloseSharp } from 'react-icons/io5';
|
||||||
import TooltipWrapper from '../../../../Components/Tooltip/Tooltip';
|
import TooltipWrapper from '../../../../Components/Tooltip/Tooltip';
|
||||||
import { isMobile } from 'react-device-detect';
|
import { isMobile } from 'react-device-detect';
|
||||||
import "./BSNavBarFavItems.scss"
|
import './BSNavBarFavItems.scss';
|
||||||
|
|
||||||
const BSNavBarFavItems = ({ type, fill, drawerOpen = false }) => {
|
const BSNavBarFavItems = ({
|
||||||
|
type,
|
||||||
|
fill,
|
||||||
|
drawerOpen = false,
|
||||||
|
setNavmenu = () => {},
|
||||||
|
}) => {
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [favopen, setFavopen] = useState(false);
|
const [favopen, setFavopen] = useState(false);
|
||||||
const globalAllItemdata = useSelector(GlobalAllItemData);
|
const globalAllItemdata = useSelector(GlobalAllItemData);
|
||||||
|
|
|
||||||
|
|
@ -85,13 +85,13 @@
|
||||||
.AddFavList {
|
.AddFavList {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 17rem;
|
top: 15rem;
|
||||||
width: 100vw !important;
|
width: 100vw !important;
|
||||||
padding: 1rem 1rem !important;
|
padding: 1rem 1rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.AddFavItemListCont {
|
.AddFavItemListCont {
|
||||||
height: 34vh;
|
height: 30vh;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
.AddFavList {
|
.AddFavList {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 17rem;
|
top: 15rem;
|
||||||
width: 100vw !important;
|
width: 100vw !important;
|
||||||
padding: 1rem 1rem !important;
|
padding: 1rem 1rem !important;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { useEffect, useRef, useState, useImperativeHandle, forwardRef } from 'react';
|
import { useEffect, useRef, useState, useImperativeHandle, forwardRef } from 'react';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch } from 'react-redux';
|
||||||
import { getPaymentStatusForBusinessUPI } from '../../../../Features/BookingScreen/BookingData/BookingData';
|
import { getPaymentStatusForBusinessUPI, PostCancelPayment } from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
|
|
||||||
const PaymentGatewayEmbedded = forwardRef(({
|
const PaymentGatewayEmbedded = forwardRef(({
|
||||||
orderId,
|
orderId,
|
||||||
|
|
@ -65,6 +65,7 @@ const PaymentGatewayEmbedded = forwardRef(({
|
||||||
|
|
||||||
if (data.status === 'TIMEOUT') {
|
if (data.status === 'TIMEOUT') {
|
||||||
// Stop polling and mark as timed out
|
// Stop polling and mark as timed out
|
||||||
|
dispatch(PostCancelPayment({OrderId: orderId})).unwrap()
|
||||||
setTimedOut(true);
|
setTimedOut(true);
|
||||||
setShowTimeout(true);
|
setShowTimeout(true);
|
||||||
if (intervalRef.current) {
|
if (intervalRef.current) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useSelector, useDispatch, shallowEqual } from 'react-redux';
|
import { useSelector, useDispatch, shallowEqual } from 'react-redux';
|
||||||
import {
|
import {
|
||||||
|
ChangeSubcategoryData,
|
||||||
getLayoutSubCategories,
|
getLayoutSubCategories,
|
||||||
|
GlobalisFavClicked,
|
||||||
GlobalProductCategorie,
|
GlobalProductCategorie,
|
||||||
} from '../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import { getTemplateData } from '../../Features/ThemeChange/ThemeChange';
|
import { getTemplateData } from '../../Features/ThemeChange/ThemeChange';
|
||||||
|
|
@ -12,6 +14,7 @@ const LayoutSubCategoryFetcher = () => {
|
||||||
|
|
||||||
const ProdCat = useSelector(GlobalProductCategorie, shallowEqual);
|
const ProdCat = useSelector(GlobalProductCategorie, shallowEqual);
|
||||||
const templateData = useSelector(getTemplateData, shallowEqual);
|
const templateData = useSelector(getTemplateData, shallowEqual);
|
||||||
|
const favSelected = useSelector(GlobalisFavClicked);
|
||||||
|
|
||||||
const CompId = getSession('CompId');
|
const CompId = getSession('CompId');
|
||||||
const BranchId = getSession('BranchId');
|
const BranchId = getSession('BranchId');
|
||||||
|
|
@ -23,6 +26,11 @@ const LayoutSubCategoryFetcher = () => {
|
||||||
const isCategory5 = templateData?.BookingCategory?.[0] === 'Category5';
|
const isCategory5 = templateData?.BookingCategory?.[0] === 'Category5';
|
||||||
const isLayout2 = templateData?.BookingLayout?.[0] === 'Layout2';
|
const isLayout2 = templateData?.BookingLayout?.[0] === 'Layout2';
|
||||||
|
|
||||||
|
if (favSelected) {
|
||||||
|
dispatch(ChangeSubcategoryData([]));
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (isCategory5 && isLayout2) {
|
if (isCategory5 && isLayout2) {
|
||||||
dispatch(
|
dispatch(
|
||||||
getLayoutSubCategories({
|
getLayoutSubCategories({
|
||||||
|
|
@ -37,6 +45,7 @@ const LayoutSubCategoryFetcher = () => {
|
||||||
ProdCat,
|
ProdCat,
|
||||||
templateData?.BookingCategory?.[0],
|
templateData?.BookingCategory?.[0],
|
||||||
templateData?.BookingLayout?.[0],
|
templateData?.BookingLayout?.[0],
|
||||||
|
favSelected
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return null; // this component renders nothing
|
return null; // this component renders nothing
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { Tooltip, Badge, Popconfirm } from 'antd';
|
||||||
import { isMobile } from 'react-device-detect';
|
import { isMobile } from 'react-device-detect';
|
||||||
import BookingCloseIcon from '../../Components/UtillComponents/BookingCloseIcon.jsx';
|
import BookingCloseIcon from '../../Components/UtillComponents/BookingCloseIcon.jsx';
|
||||||
const BSNavbar1 = lazy(() => import('../../Components/BSNavbar/BSNavbar1'));
|
const BSNavbar1 = lazy(() => import('../../Components/BSNavbar/BSNavbar1'));
|
||||||
const CategoryHorizontal = lazy(
|
const CategoryHorizontal = lazy(
|
||||||
() => import('../../Components/BSCategories/BSCategoryHorizontal')
|
() => import('../../Components/BSCategories/BSCategoryHorizontal')
|
||||||
);
|
);
|
||||||
const BSItemCard = lazy(
|
const BSItemCard = lazy(
|
||||||
|
|
@ -16,10 +16,8 @@ const BSBillingTable2 = lazy(
|
||||||
() =>
|
() =>
|
||||||
import('../../Components/BSBillingTables/BSBillingTable2/BSBillingTable2')
|
import('../../Components/BSBillingTables/BSBillingTable2/BSBillingTable2')
|
||||||
);
|
);
|
||||||
const BSBillingTable3 = lazy(
|
|
||||||
() =>
|
import BSBillingTable3 from '../../Components/BSBillingTables/BSBillingTable3/BSBillingTable3overall';
|
||||||
import('../../Components/BSBillingTables/BSBillingTable3/BSBillingTable3overall')
|
|
||||||
);
|
|
||||||
|
|
||||||
import { dynamicComponentProps } from '../DynamicComponentProps.js';
|
import { dynamicComponentProps } from '../DynamicComponentProps.js';
|
||||||
import {
|
import {
|
||||||
|
|
@ -95,16 +93,10 @@ const BSOtherServicesVerticalcat = lazy(
|
||||||
() => import('../../Components/BSCategories/BSOtherServicesVerticalcat.jsx')
|
() => import('../../Components/BSCategories/BSOtherServicesVerticalcat.jsx')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const SalesCountForStandard = lazy(
|
const SalesCountForStandard = lazy(
|
||||||
() => import('../SalesCountForStandard.jsx')
|
() => import('../SalesCountForStandard.jsx')
|
||||||
);
|
);
|
||||||
|
|
||||||
const StandardTable = lazy(
|
|
||||||
() =>
|
|
||||||
import('../../Components/BSBillingTables/StandardTable/StandardTable.jsx')
|
|
||||||
);
|
|
||||||
|
|
||||||
const ComboSalesBillTable = lazy(
|
const ComboSalesBillTable = lazy(
|
||||||
() =>
|
() =>
|
||||||
import('../../Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx')
|
import('../../Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx')
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import { DatePicProd } from "../../Components/Forms/DatePickerProduct";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { FaEye, FaPlus } from "react-icons/fa";
|
import { FaEye, FaPlus } from "react-icons/fa";
|
||||||
import { DefaultModal } from "../../Components/Modal/DefaultModal";
|
import { DefaultModal } from "../../Components/Modal/DefaultModal";
|
||||||
|
import { IoEye } from "react-icons/io5";
|
||||||
|
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const SEARCH_OPTIONS = [
|
const SEARCH_OPTIONS = [
|
||||||
|
|
@ -70,6 +71,8 @@ const SalesBillProductsReturn = () => {
|
||||||
const [currentEditingItem, setCurrentEditingItem] = useState(null);
|
const [currentEditingItem, setCurrentEditingItem] = useState(null);
|
||||||
const [modalDescription, setModalDescription] = useState('');
|
const [modalDescription, setModalDescription] = useState('');
|
||||||
const [modalImageUrl, setModalImageUrl] = useState('');
|
const [modalImageUrl, setModalImageUrl] = useState('');
|
||||||
|
const [policyDeatilModal, setPolicyDeatilModal] = useState(false);
|
||||||
|
const [selectedPolicyDetails, setSelectedPolicyDetails] = useState(null);
|
||||||
|
|
||||||
console.log(selectedItems, "selectedItemsselectedItemsselectedItems")
|
console.log(selectedItems, "selectedItemsselectedItemsselectedItems")
|
||||||
|
|
||||||
|
|
@ -77,7 +80,7 @@ const SalesBillProductsReturn = () => {
|
||||||
navigateTo(`${subDirectory}setting/sales-bill-product-return/list`);
|
navigateTo(`${subDirectory}setting/sales-bill-product-return/list`);
|
||||||
};
|
};
|
||||||
const handleCheckboxChange = (item, checked) => {
|
const handleCheckboxChange = (item, checked) => {
|
||||||
const { ProdId, InwardDtlId, Type, SalesQty, Rate, TotalAmt, TaxAmt, SinglePc, ProdNameQty,IsWarrantyEligible } = item;
|
const { ProdId, InwardDtlId, Type, SalesQty, Rate, TotalAmt, TaxAmt, SinglePc, ProdNameQty, IsWarrantyEligible } = item;
|
||||||
if (checked) {
|
if (checked) {
|
||||||
const data = {
|
const data = {
|
||||||
ProdId,
|
ProdId,
|
||||||
|
|
@ -108,7 +111,15 @@ const SalesBillProductsReturn = () => {
|
||||||
const description = product?.Description || ""
|
const description = product?.Description || ""
|
||||||
return { ReturnEligible: eligible, Description: description };
|
return { ReturnEligible: eligible, Description: description };
|
||||||
};
|
};
|
||||||
|
const handleOrdermodalCancel = () => {
|
||||||
|
setPolicyDeatilModal(false);
|
||||||
|
setSelectedPolicyDetails(null);
|
||||||
|
};
|
||||||
|
const Viewdetails = (item) => {
|
||||||
|
const policy = policybasedprodcuts?.find(p => p.ProdId === item.ProdId) || null;
|
||||||
|
setSelectedPolicyDetails(policy);
|
||||||
|
setPolicyDeatilModal(true);
|
||||||
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchPaymentOptions = async () => {
|
const fetchPaymentOptions = async () => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -192,12 +203,11 @@ const SalesBillProductsReturn = () => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await dispatch(getReturnBill(data)).unwrap();
|
const res = await dispatch(getReturnBill(data)).unwrap();
|
||||||
|
|
||||||
if (res?.data?.statusCode === 1) {
|
if (res?.data?.statusCode === 1) {
|
||||||
const modifiedData = res?.data?.data?.map(item => {
|
const modifiedData = res?.data?.data?.map(item => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
productDetails: item?.productDetails.map(product => {
|
productDetails: item?.productDetails?.map(product => {
|
||||||
return {
|
return {
|
||||||
...product,
|
...product,
|
||||||
ExchangeQty: 0,
|
ExchangeQty: 0,
|
||||||
|
|
@ -577,8 +587,9 @@ const SalesBillProductsReturn = () => {
|
||||||
<table className="custom-product-table">
|
<table className="custom-product-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th>Select</th>
|
||||||
<th style={{ width: "30px", whiteSpace: "normal", wordWrap: "break-word" }}>Sl.No</th>
|
<th style={{ width: "30px", whiteSpace: "normal", wordWrap: "break-word" }}>Sl.No</th>
|
||||||
|
<th style={{ width: "100px", whiteSpace: "normal", wordWrap: "break-word" }}>Policy Details</th>
|
||||||
<th style={{ width: "100px", whiteSpace: "normal", wordWrap: "break-word" }}>Product Name</th>
|
<th style={{ width: "100px", whiteSpace: "normal", wordWrap: "break-word" }}>Product Name</th>
|
||||||
<th style={{ width: "70px", whiteSpace: "normal", wordWrap: "break-word" }}>Sales-Qty</th>
|
<th style={{ width: "70px", whiteSpace: "normal", wordWrap: "break-word" }}>Sales-Qty</th>
|
||||||
<th style={{ width: "80px", whiteSpace: "normal", wordWrap: "break-word" }}>Rate</th>
|
<th style={{ width: "80px", whiteSpace: "normal", wordWrap: "break-word" }}>Rate</th>
|
||||||
|
|
@ -597,17 +608,23 @@ const SalesBillProductsReturn = () => {
|
||||||
disabled={!ReturnEligible}
|
disabled={!ReturnEligible}
|
||||||
onChange={(e) => handleCheckboxChange(item, e.target.checked)}
|
onChange={(e) => handleCheckboxChange(item, e.target.checked)}
|
||||||
/>
|
/>
|
||||||
{!ReturnEligible && (
|
{/* {(
|
||||||
<span style={{ marginLeft: 4 }}>
|
<span style={{ marginLeft: 4 }}>
|
||||||
<Tooltip title={Description}>
|
<Tooltip title={Description}>
|
||||||
{/* <span style={{ color: '#faad14', cursor: 'pointer', fontSize: 18, verticalAlign: 'middle' }}> */}
|
<IoEye
|
||||||
<RiErrorWarningLine />
|
style={{ color: '#1292EE', fontSize: '25px', cursor: 'pointer' }}
|
||||||
{/* </span> */}
|
onClick={() => Viewdetails(item)}
|
||||||
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</span>
|
</span>
|
||||||
)}
|
)} */}
|
||||||
</td>
|
</td>
|
||||||
<td style={{ textAlignLast: "center", width: "30px", whiteSpace: "normal", wordWrap: "break-word" }}>{index + 1}</td>
|
<td style={{ textAlignLast: "center", width: "30px", whiteSpace: "normal", wordWrap: "break-word" }}>{index + 1}</td>
|
||||||
|
<td style={{ width: "100px", wordWrap: "break-word" }}>
|
||||||
|
<IoEye
|
||||||
|
style={{ color: '#1292EE', fontSize: '25px', cursor: 'pointer' }}
|
||||||
|
onClick={() => Viewdetails(item)}
|
||||||
|
/></td>
|
||||||
<td style={{ width: "100px", wordWrap: "break-word" }}>{item.ProdNameQty}</td>
|
<td style={{ width: "100px", wordWrap: "break-word" }}>{item.ProdNameQty}</td>
|
||||||
<td style={{ textAlignLast: "center" }}>{item.SalesQty}</td>
|
<td style={{ textAlignLast: "center" }}>{item.SalesQty}</td>
|
||||||
<td style={{ textAlignLast: "end" }}>₹{item.Rate}</td>
|
<td style={{ textAlignLast: "end" }}>₹{item.Rate}</td>
|
||||||
|
|
@ -634,11 +651,11 @@ const SalesBillProductsReturn = () => {
|
||||||
<th>Sales-Qty</th>
|
<th>Sales-Qty</th>
|
||||||
<th>Return-Qty</th>
|
<th>Return-Qty</th>
|
||||||
<th>More</th>
|
<th>More</th>
|
||||||
<th>Details</th>
|
{/* <th>Details</th> */}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{selectedItems.map((item, index) => {
|
{selectedItems?.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
<tr key={item.ProdId} >
|
<tr key={item.ProdId} >
|
||||||
<td>{index + 1}</td>
|
<td>{index + 1}</td>
|
||||||
|
|
@ -706,7 +723,7 @@ const SalesBillProductsReturn = () => {
|
||||||
<FaPlus />
|
<FaPlus />
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
<td style={{ textAlign: "center", maxWidth: "150px" }}>
|
{/* <td style={{ textAlign: "center", maxWidth: "150px" }}>
|
||||||
{item.description && (
|
{item.description && (
|
||||||
<Tooltip title={item.description}>
|
<Tooltip title={item.description}>
|
||||||
<div style={{
|
<div style={{
|
||||||
|
|
@ -724,7 +741,7 @@ const SalesBillProductsReturn = () => {
|
||||||
<div>🖼️</div>
|
<div>🖼️</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td> */}
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
@ -816,6 +833,43 @@ const SalesBillProductsReturn = () => {
|
||||||
handleCancel={handleCancel}
|
handleCancel={handleCancel}
|
||||||
handleSubmit={handleModalSubmit}
|
handleSubmit={handleModalSubmit}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<DefaultModal
|
||||||
|
open={policyDeatilModal}
|
||||||
|
title="Product Policy Details"
|
||||||
|
handleCancel={handleOrdermodalCancel}
|
||||||
|
footer={false}
|
||||||
|
children={
|
||||||
|
<div style={{ padding: '8px' }}>
|
||||||
|
{selectedPolicyDetails ? (
|
||||||
|
<table style={{ width: '100%', borderCollapse: 'collapse', fontSize: '14px' }}>
|
||||||
|
<tbody>
|
||||||
|
{[
|
||||||
|
['Product Name', selectedPolicyDetails.ProdName],
|
||||||
|
['Policy Name', selectedPolicyDetails.PolicyName],
|
||||||
|
['Description', selectedPolicyDetails.Description],
|
||||||
|
['Return Allowed', selectedPolicyDetails.IsReturnAllowed === 'Y' ? 'Yes' : 'No'],
|
||||||
|
['Exchange Allowed', selectedPolicyDetails.IsExchangeAllowed === 'Y' ? 'Yes' : 'No'],
|
||||||
|
['Return Window (Days)', selectedPolicyDetails.ReturnWindowDays],
|
||||||
|
['Exchange Window (Days)', selectedPolicyDetails.ExchangeWindowDays],
|
||||||
|
['Exchange Limit Count', selectedPolicyDetails.ExchangeLimitCount ?? 'N/A'],
|
||||||
|
['Return Eligible', selectedPolicyDetails.ReturnEligible ? 'Yes' : 'No'],
|
||||||
|
// ['Effective From', selectedPolicyDetails.EffectiveFrom ? dayjs(selectedPolicyDetails.EffectiveFrom).format('DD-MM-YYYY') : 'N/A'],
|
||||||
|
// ['Effective To', selectedPolicyDetails.EffectiveTo ? dayjs(selectedPolicyDetails.EffectiveTo).format('DD-MM-YYYY') : 'N/A'],
|
||||||
|
].map(([label, value]) => (
|
||||||
|
<tr key={label} style={{ borderBottom: '1px solid #f0f0f0' }}>
|
||||||
|
<td style={{ padding: '8px', fontWeight: 600, color: '#555', width: '45%' }}>{label}</td>
|
||||||
|
<td style={{ padding: '8px', color: '#222' }}>{value}</td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
) : (
|
||||||
|
<p style={{ textAlign: 'center', color: '#888' }}>No policy found for this product.</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,7 @@ import { Messages } from '../../Components/Notifications/Messages';
|
||||||
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
|
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
|
||||||
import { useAuth } from '../../AuthContext.jsx';
|
import { useAuth } from '../../AuthContext.jsx';
|
||||||
import { getPreferenceData } from '../../Features/BookingScreen/BookingData/BookingData.js';
|
import { getPreferenceData } from '../../Features/BookingScreen/BookingData/BookingData.js';
|
||||||
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
|
|
@ -71,7 +70,6 @@ const CustomerMaster = () => {
|
||||||
const [addnewAccess, setaddnewAccess] = useState(true);
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
const [allowDecimal, setAllowDecimal] = useState(false);
|
const [allowDecimal, setAllowDecimal] = useState(false);
|
||||||
|
|
||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
if (location?.state?.Notiffy) {
|
if (location?.state?.Notiffy) {
|
||||||
setMessageType(location?.state?.Notiffy.messageType);
|
setMessageType(location?.state?.Notiffy.messageType);
|
||||||
|
|
@ -155,13 +153,22 @@ const CustomerMaster = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId, UserId: UserId };
|
const data = {
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
AppId: AppId,
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
UserId: UserId,
|
||||||
|
};
|
||||||
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
|
(setting) =>
|
||||||
|
setting?.SettingIdName?.toLowerCase() === 'decimal' &&
|
||||||
|
setting?.SettingValue === 'Y'
|
||||||
|
);
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
setAllowDecimal(true)
|
setAllowDecimal(true);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
//Delete
|
//Delete
|
||||||
const statusFormatter = async (row) => {
|
const statusFormatter = async (row) => {
|
||||||
|
|
@ -251,7 +258,8 @@ const CustomerMaster = () => {
|
||||||
width: '100px',
|
width: '100px',
|
||||||
render: (text, row) => (
|
render: (text, row) => (
|
||||||
<a style={{ color: 'black', width: '200px' }}>
|
<a style={{ color: 'black', width: '200px' }}>
|
||||||
{(row?.CustName ? (row?.CustName + ' ') : '') + (row?.CustShortName || "") || row?.CustMobile}
|
{(row?.CustName ? row?.CustName + ' ' : '') +
|
||||||
|
(row?.CustShortName || '') || row?.CustMobile}
|
||||||
</a>
|
</a>
|
||||||
),
|
),
|
||||||
filteredValue: [searchedText],
|
filteredValue: [searchedText],
|
||||||
|
|
@ -260,8 +268,12 @@ const CustomerMaster = () => {
|
||||||
String(record.CustShortName)
|
String(record.CustShortName)
|
||||||
?.toLowerCase()
|
?.toLowerCase()
|
||||||
?.includes(value?.toLowerCase()) ||
|
?.includes(value?.toLowerCase()) ||
|
||||||
String(record.CustName)?.toLowerCase()?.includes(value?.toLowerCase()) ||
|
String(record.CustName)
|
||||||
String(record.CustMobile)?.toLowerCase()?.includes(value?.toLowerCase())
|
?.toLowerCase()
|
||||||
|
?.includes(value?.toLowerCase()) ||
|
||||||
|
String(record.CustMobile)
|
||||||
|
?.toLowerCase()
|
||||||
|
?.includes(value?.toLowerCase())
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
sorter: (a, b) => a?.CustName?.length - b?.CustName?.length,
|
sorter: (a, b) => a?.CustName?.length - b?.CustName?.length,
|
||||||
|
|
|
||||||
|
|
@ -1775,11 +1775,6 @@ const RetailDashboard = () => {
|
||||||
UserType === 'Super Admin' ||
|
UserType === 'Super Admin' ||
|
||||||
UserType === 'Super Admin User'
|
UserType === 'Super Admin User'
|
||||||
) {
|
) {
|
||||||
if (!document.fullscreenElement) {
|
|
||||||
document.documentElement.requestFullscreen().catch((err) => {
|
|
||||||
console.error('Error attempting to enable fullscreen:', err);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
navigate(`${subDirectory}sales`);
|
navigate(`${subDirectory}sales`);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import { Popconfirm, Drawer, Badge } from 'antd';
|
import { Popconfirm, Drawer, Badge, Modal } from 'antd';
|
||||||
import { QuestionCircleOutlined } from '@ant-design/icons';
|
import { QuestionCircleOutlined } from '@ant-design/icons';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { IoIosArrowForward } from 'react-icons/io';
|
import { IoIosArrowForward } from 'react-icons/io';
|
||||||
|
|
@ -43,7 +43,7 @@ import KioskPayment from '../Payment/KioskPaymentWithModal';
|
||||||
import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin';
|
import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin';
|
||||||
import { FaAngleUp, FaCircleCheck } from 'react-icons/fa6';
|
import { FaAngleUp, FaCircleCheck } from 'react-icons/fa6';
|
||||||
import { FaAngleDown } from 'react-icons/fa';
|
import { FaAngleDown } from 'react-icons/fa';
|
||||||
import { PostBookingData } from '../../../Features/BookingScreen/BookingData/BookingData';
|
import { PostBookingData, PostCancelPayment } from '../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import {
|
import {
|
||||||
generateRandomKey,
|
generateRandomKey,
|
||||||
getSession,
|
getSession,
|
||||||
|
|
@ -129,6 +129,7 @@ const selfKioskFooter = (props) => {
|
||||||
const [chairInformation, setChairInformation] = useState();
|
const [chairInformation, setChairInformation] = useState();
|
||||||
const [TableINformation, setTableINformation] = useState();
|
const [TableINformation, setTableINformation] = useState();
|
||||||
const [paymentUrl, setpaymentUrl] = useState(null);
|
const [paymentUrl, setpaymentUrl] = useState(null);
|
||||||
|
const [showCancelConfirm, setShowCancelConfirm] = useState(null);
|
||||||
const [TransctionId, setTransctionId] = useState(null);
|
const [TransctionId, setTransctionId] = useState(null);
|
||||||
const [paymentGatewayAccess, setPaymentGatewayAccess] = useState([]);
|
const [paymentGatewayAccess, setPaymentGatewayAccess] = useState([]);
|
||||||
// let chairInformation = getSession('table');
|
// let chairInformation = getSession('table');
|
||||||
|
|
@ -939,6 +940,15 @@ const selfKioskFooter = (props) => {
|
||||||
setMessageType(null);
|
setMessageType(null);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// PostCancelPayment
|
||||||
|
const CancelPayment = async () => {
|
||||||
|
const response = await dispatch(PostCancelPayment({OrderId: TransctionId})).unwrap()
|
||||||
|
if (response?.data?.statusCode) {
|
||||||
|
// setBusinessUPI(false);
|
||||||
|
setpaymentUrl(null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Messages
|
<Messages
|
||||||
|
|
@ -1462,7 +1472,8 @@ const selfKioskFooter = (props) => {
|
||||||
<button
|
<button
|
||||||
className="paymentclose-btn"
|
className="paymentclose-btn"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setpaymentUrl(null);
|
// setpaymentUrl(null);
|
||||||
|
setShowCancelConfirm(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
✖
|
✖
|
||||||
|
|
@ -1476,6 +1487,21 @@ const selfKioskFooter = (props) => {
|
||||||
></iframe>
|
></iframe>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
{showCancelConfirm && (
|
||||||
|
<Modal
|
||||||
|
open={showCancelConfirm}
|
||||||
|
title="Cancel Payment"
|
||||||
|
onOk={() => {
|
||||||
|
setShowCancelConfirm(false);
|
||||||
|
CancelPayment()
|
||||||
|
}}
|
||||||
|
onCancel={() => setShowCancelConfirm(false)}
|
||||||
|
okText="Yes"
|
||||||
|
cancelText="No"
|
||||||
|
>
|
||||||
|
Do you want to cancel the payment?
|
||||||
|
</Modal>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ import {
|
||||||
import {
|
import {
|
||||||
getConfigType,
|
getConfigType,
|
||||||
getPreferenceData,
|
getPreferenceData,
|
||||||
|
PostCancelPayment,
|
||||||
PreferenceData,
|
PreferenceData,
|
||||||
PutPendingPaymentList,
|
PutPendingPaymentList,
|
||||||
} from '../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
|
|
@ -1092,6 +1093,15 @@ const KioskPayment = (props) => {
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// PostCancelPayment
|
||||||
|
const CancelPayment = async () => {
|
||||||
|
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
|
||||||
|
if (response?.data?.statusCode) {
|
||||||
|
ClearAllGlobalStateDatas();
|
||||||
|
CustomerDisplay();
|
||||||
|
setBusinessUPI(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const handleDevice = async (paymentDetails, option) => {
|
const handleDevice = async (paymentDetails, option) => {
|
||||||
const paymentDeviceDetails = await dispatch(
|
const paymentDeviceDetails = await dispatch(
|
||||||
|
|
@ -2342,6 +2352,7 @@ const KioskPayment = (props) => {
|
||||||
handleCancel={() => setShowCancelConfirm(true)}
|
handleCancel={() => setShowCancelConfirm(true)}
|
||||||
footer={false}
|
footer={false}
|
||||||
width={500}
|
width={500}
|
||||||
|
destroyOnClose={true}
|
||||||
children={
|
children={
|
||||||
<>
|
<>
|
||||||
<PaymentGatewayEmbedded
|
<PaymentGatewayEmbedded
|
||||||
|
|
@ -2359,21 +2370,34 @@ const KioskPayment = (props) => {
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{showCancelConfirm && (
|
{showCancelConfirm && (
|
||||||
<Modal
|
// <Modal
|
||||||
open={showCancelConfirm}
|
// open={showCancelConfirm}
|
||||||
title="Cancel Payment"
|
// title="Cancel Payment"
|
||||||
onOk={() => {
|
// onOk={() => {
|
||||||
paymentGatewayRef.current?.clearPolling();
|
// paymentGatewayRef.current?.clearPolling();
|
||||||
setBusinessUPI(false);
|
// setBusinessUPI(false);
|
||||||
setShowCancelConfirm(false);
|
// setShowCancelConfirm(false);
|
||||||
ClearAllGlobalStateDatas();
|
// ClearAllGlobalStateDatas();
|
||||||
}}
|
// }}
|
||||||
onCancel={() => setShowCancelConfirm(false)}
|
// onCancel={() => setShowCancelConfirm(false)}
|
||||||
okText="Yes"
|
// okText="Yes"
|
||||||
cancelText="No"
|
// cancelText="No"
|
||||||
>
|
// >
|
||||||
Do you want to cancel the payment?
|
// Do you want to cancel the payment?
|
||||||
</Modal>
|
// </Modal>
|
||||||
|
<Modal
|
||||||
|
open={showCancelConfirm}
|
||||||
|
title="Cancel Payment"
|
||||||
|
onOk={() => {
|
||||||
|
setShowCancelConfirm(false);
|
||||||
|
CancelPayment()
|
||||||
|
}}
|
||||||
|
onCancel={() => setShowCancelConfirm(false)}
|
||||||
|
okText="Yes"
|
||||||
|
cancelText="No"
|
||||||
|
>
|
||||||
|
Do you want to cancel the payment?
|
||||||
|
</Modal>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ const OtherServices = ({ formType }) => {
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
|
|
||||||
console.log(SelectedCategory, 'SelectedCategory');
|
console.log(TaxData, 'TaxData');
|
||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
|
|
@ -435,8 +435,8 @@ const OtherServices = ({ formType }) => {
|
||||||
<DropDowns
|
<DropDowns
|
||||||
options={[
|
options={[
|
||||||
...TaxData?.map((option) => ({
|
...TaxData?.map((option) => ({
|
||||||
value: option.TaxId,
|
value: option?.TaxId,
|
||||||
label: option.TaxIdName,
|
label: `${option?.TaxIdName} - ${option?.TaxPercentage}%`,
|
||||||
})),
|
})),
|
||||||
]}
|
]}
|
||||||
label="Tax"
|
label="Tax"
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -2714,7 +2714,7 @@ const ProductList = () => {
|
||||||
open={openExcel}
|
open={openExcel}
|
||||||
title="Bulk Upload"
|
title="Bulk Upload"
|
||||||
footer={true}
|
footer={true}
|
||||||
width={excelDataValues?.length > 0 ? 2500 : 600}
|
width={excelDataValues?.length > 0 ? 2500 : 700}
|
||||||
className={'bulkuploadmodal'}
|
className={'bulkuploadmodal'}
|
||||||
children={
|
children={
|
||||||
<>
|
<>
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,14 @@ function RedirectApps() {
|
||||||
const SessionId = encryptedValuesUrlFun(getSession('SessionId'));
|
const SessionId = encryptedValuesUrlFun(getSession('SessionId'));
|
||||||
// const AuthToken = sessionStorage.getItem('auth');
|
// const AuthToken = sessionStorage.getItem('auth');
|
||||||
|
|
||||||
if (sessionStorage.getItem('BranchId') !== null) {
|
if (getSession('BranchId') !== null) {
|
||||||
clearSession('BranchId');
|
clearSession('BranchId');
|
||||||
}
|
}
|
||||||
if (sessionStorage.getItem('AppId') !== null) {
|
if (getSession('AppId') !== null) {
|
||||||
clearSession('AppId');
|
clearSession('AppId');
|
||||||
}
|
}
|
||||||
if (sessionStorage.getItem('hasRefreshed') !== null) {
|
if (getSession('hasRefreshed') !== null) {
|
||||||
sessionStorage.removeItem('hasRefreshed');
|
clearSession('hasRefreshed');
|
||||||
}
|
}
|
||||||
const param = {
|
const param = {
|
||||||
MN: MobileNo,
|
MN: MobileNo,
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ const DateWiseReport = () => {
|
||||||
getSession('AppType')?.toLowerCase() == 'wholesale' ? true : false;
|
getSession('AppType')?.toLowerCase() == 'wholesale' ? true : false;
|
||||||
const [OrderFromDate, setOrderFromDate] = useState();
|
const [OrderFromDate, setOrderFromDate] = useState();
|
||||||
const [OrderToDate, setOrderToDate] = useState();
|
const [OrderToDate, setOrderToDate] = useState();
|
||||||
|
const sessionuserid = getSession('UserId')
|
||||||
const [UserId, setUserId] = useState(
|
const [UserId, setUserId] = useState(
|
||||||
UserRole != 'Employee' ? 0 : getSession('UserId')
|
UserRole != 'Employee' ? 0 : getSession('UserId')
|
||||||
);
|
);
|
||||||
|
|
@ -63,7 +64,7 @@ const DateWiseReport = () => {
|
||||||
setting?.SettingIdName?.toLowerCase() === 'mobilea4' &&
|
setting?.SettingIdName?.toLowerCase() === 'mobilea4' &&
|
||||||
setting?.SettingValue === 'Y'
|
setting?.SettingValue === 'Y'
|
||||||
);
|
);
|
||||||
console.log(MobileA4Print, 'MobileA4PrintMobileA4Print');
|
console.log(MobileA4Print,SettingDataSelector, 'MobileA4PrintMobileA4Print');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (dataSource?.length > 0) {
|
if (dataSource?.length > 0) {
|
||||||
|
|
@ -368,7 +369,7 @@ const DateWiseReport = () => {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: sessionuserid };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
|
|
@ -545,12 +546,12 @@ const DateWiseReport = () => {
|
||||||
let TokenData = '';
|
let TokenData = '';
|
||||||
let FooterPrint = '';
|
let FooterPrint = '';
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
if (MobileA4Print) {
|
// if (MobileA4Print) {
|
||||||
ReportMobilePDFPrint({
|
// ReportMobilePDFPrint({
|
||||||
printId: 'RePrint',
|
// printId: 'RePrint',
|
||||||
printStyle: style,
|
// printStyle: style,
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
var textEncoded = encodeURI(receiptText);
|
var textEncoded = encodeURI(receiptText);
|
||||||
var TypeCheck = 'PrintReceipt';
|
var TypeCheck = 'PrintReceipt';
|
||||||
var scheme = 'pozoprinter';
|
var scheme = 'pozoprinter';
|
||||||
|
|
@ -578,7 +579,7 @@ const DateWiseReport = () => {
|
||||||
FooterPrint +
|
FooterPrint +
|
||||||
'HasFooterTextE' +
|
'HasFooterTextE' +
|
||||||
';end;';
|
';end;';
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
await printDiv('RePrint', style);
|
await printDiv('RePrint', style);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ const ItemWiseReport = () => {
|
||||||
const BranchId = getSession('BranchId');
|
const BranchId = getSession('BranchId');
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
const UserRole = getSession('UserType');
|
const UserRole = getSession('UserType');
|
||||||
|
const sessionuserid = getSession('UserId')
|
||||||
const [UserId, setUserId] = useState(
|
const [UserId, setUserId] = useState(
|
||||||
UserRole != 'Employee' ? 0 : getSession('UserId')
|
UserRole != 'Employee' ? 0 : getSession('UserId')
|
||||||
);
|
);
|
||||||
|
|
@ -79,7 +80,7 @@ const ItemWiseReport = () => {
|
||||||
setting?.SettingIdName?.toLowerCase() === 'mobilea4' &&
|
setting?.SettingIdName?.toLowerCase() === 'mobilea4' &&
|
||||||
setting?.SettingValue === 'Y'
|
setting?.SettingValue === 'Y'
|
||||||
);
|
);
|
||||||
|
console.log(MobileA4Print,SettingDataSelector, 'MobileA4PrintMobileA4Print')
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getPreference();
|
getPreference();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
@ -210,7 +211,7 @@ const ItemWiseReport = () => {
|
||||||
}
|
}
|
||||||
}, [apiCall]);
|
}, [apiCall]);
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: sessionuserid };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
|
|
@ -310,12 +311,12 @@ const ItemWiseReport = () => {
|
||||||
};
|
};
|
||||||
const Print = async () => {
|
const Print = async () => {
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
if (MobileA4Print) {
|
// if (MobileA4Print) {
|
||||||
ReportMobilePDFPrint({
|
// ReportMobilePDFPrint({
|
||||||
printId: 'RePrint',
|
// printId: 'RePrint',
|
||||||
printStyle: style,
|
// printStyle: style,
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
let LogoImage = '';
|
let LogoImage = '';
|
||||||
let TokenData = '';
|
let TokenData = '';
|
||||||
let FooterPrint = '';
|
let FooterPrint = '';
|
||||||
|
|
@ -346,7 +347,7 @@ const ItemWiseReport = () => {
|
||||||
FooterPrint +
|
FooterPrint +
|
||||||
'HasFooterTextE' +
|
'HasFooterTextE' +
|
||||||
';end;';
|
';end;';
|
||||||
}
|
// }
|
||||||
} else {
|
} else {
|
||||||
await printDiv('RePrint', style);
|
await printDiv('RePrint', style);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
|
margin-top: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.BST1-Payment-onlypay {
|
.BST1-Payment-onlypay {
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.BSItemCard-content {
|
.BSItemCard-content {
|
||||||
padding: 1px 0;
|
padding: 3px 0;
|
||||||
background-color: rgba(255, 255, 255, 0.8);
|
background-color: rgba(255, 255, 255, 0.8);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -96,7 +96,8 @@
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
max-width: 130px;
|
max-width: 130px;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-line-clamp: 3;
|
-webkit-line-clamp: 2;
|
||||||
|
line-height: 1;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -635,11 +635,10 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
.resNavbarMain {
|
.resNavbarMain {
|
||||||
width: 100vw;
|
width: max-content;
|
||||||
|
max-width: 250px;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background-color: #00000056;
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
|
@ -648,7 +647,7 @@
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
backdrop-filter: blur(6px);
|
box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
|
||||||
animation: fadeInRes 0.3s ease;
|
animation: fadeInRes 0.3s ease;
|
||||||
|
|
||||||
&.closing {
|
&.closing {
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.AddFavItemListCont {
|
.AddFavItemListCont {
|
||||||
height: 34vh;
|
height: 30vh;
|
||||||
padding-bottom: 4rem;
|
padding-bottom: 4rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1721,3 +1721,17 @@ table {
|
||||||
right: 2rem;
|
right: 2rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.addVariant {
|
||||||
|
background: #23378a29;
|
||||||
|
color: #23378a;
|
||||||
|
padding: 12px 24px;
|
||||||
|
border: none;
|
||||||
|
font-family: "Poppins", sans-serif;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 6px;
|
||||||
|
outline: none;
|
||||||
|
height: max-content;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,7 @@
|
||||||
font-weight: bold !important;
|
font-weight: bold !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// .viewerExcelupload table {
|
|
||||||
// // table-layout: auto !important;
|
|
||||||
// }
|
|
||||||
|
|
||||||
.viewerExcelupload::-webkit-scrollbar {
|
.viewerExcelupload::-webkit-scrollbar {
|
||||||
// display: block !important;
|
|
||||||
width: 0rem;
|
width: 0rem;
|
||||||
height: 0.5rem;
|
height: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
@ -28,7 +23,7 @@
|
||||||
background-color: #1292ee;
|
background-color: #1292ee;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
font-family: 'Poppins';
|
font-family: "Poppins";
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
|
|
@ -48,6 +43,8 @@
|
||||||
.tableExcelUpload {
|
.tableExcelUpload {
|
||||||
.ant-table-cell {
|
.ant-table-cell {
|
||||||
padding: 0 8px !important;
|
padding: 0 8px !important;
|
||||||
|
font-family: "Poppins";
|
||||||
|
font-weight: 500 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-select-selection-placeholder {
|
.ant-select-selection-placeholder {
|
||||||
|
|
@ -129,16 +126,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.mdsheet {
|
.mdsheet {
|
||||||
width: 25px;
|
width: 20px;
|
||||||
height: 25px;
|
height: 20px;
|
||||||
border: 1px solid #5bff73;
|
border: 1px solid #5bff73;
|
||||||
background-color: #b3ffbf;
|
background-color: #b3ffbf;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
.mdsheet2 {
|
.mdsheet2 {
|
||||||
width: 25px;
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
height: 25px;
|
|
||||||
background-color: #ffc7f8;
|
background-color: #ffc7f8;
|
||||||
border: 1px solid #ff74ec;
|
border: 1px solid #ff74ec;
|
||||||
}
|
}
|
||||||
|
|
@ -148,5 +145,88 @@
|
||||||
font-family: "Poppins";
|
font-family: "Poppins";
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
@media (max-width: 500px) {
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.field-setup-selected-fields {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 4px;
|
||||||
|
margin-bottom: 50px;
|
||||||
|
height: max-content;
|
||||||
|
max-height: 50vh;
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
|
.selected-field {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
background: #0bad77;
|
||||||
|
padding: 6px 10px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
.close-icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
> svg {
|
||||||
|
color: #ffffffff !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.HeadingUploadExl {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 1rem;
|
||||||
|
width: 50%;
|
||||||
|
@media (max-width: 950px) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.download-linkMain {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1rem;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
@media (max-width: 950px) {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.download-link {
|
||||||
|
width: 50%;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
@media (max-width: 950px) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.viewerExcelupload {
|
||||||
|
.ant-select-selection-item {
|
||||||
|
margin-top: 0 !important ;
|
||||||
|
padding-top: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.download-link span {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
.imgUpldr {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 2px;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -705,7 +705,7 @@
|
||||||
color: #fff;
|
color: #fff;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
.optionnew:selection {
|
.optionnew::selection {
|
||||||
background-color: #ff4d4f;
|
background-color: #ff4d4f;
|
||||||
}
|
}
|
||||||
.ovrly-icos {
|
.ovrly-icos {
|
||||||
|
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
const DevToolsDetector = {
|
|
||||||
checkWindowSize() {
|
|
||||||
const threshold = 160;
|
|
||||||
return (
|
|
||||||
window.outerWidth - window.innerWidth > threshold ||
|
|
||||||
window.outerHeight - window.innerHeight > threshold
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
checkConsole() {
|
|
||||||
let detected = false;
|
|
||||||
const element = new Image();
|
|
||||||
Object.defineProperty(element, 'id', {
|
|
||||||
get: () => { detected = true; }
|
|
||||||
});
|
|
||||||
console.log('%c', element);
|
|
||||||
console.clear();
|
|
||||||
return detected;
|
|
||||||
},
|
|
||||||
|
|
||||||
checkDebugger() {
|
|
||||||
if (import.meta.env.DEV) return false;
|
|
||||||
const start = performance.now();
|
|
||||||
// eslint-disable-next-line no-debugger
|
|
||||||
debugger;
|
|
||||||
const end = performance.now();
|
|
||||||
return end - start > 100;
|
|
||||||
},
|
|
||||||
|
|
||||||
checkToString() {
|
|
||||||
let detected = false;
|
|
||||||
const div = document.createElement('div');
|
|
||||||
Object.defineProperty(div, 'id', {
|
|
||||||
get: function () {
|
|
||||||
detected = true;
|
|
||||||
return 'id';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
console.log(div);
|
|
||||||
console.clear();
|
|
||||||
return detected;
|
|
||||||
},
|
|
||||||
|
|
||||||
detect() {
|
|
||||||
return (
|
|
||||||
this.checkWindowSize() ||
|
|
||||||
this.checkConsole() ||
|
|
||||||
this.checkDebugger() ||
|
|
||||||
this.checkToString()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default DevToolsDetector;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import { useEffect, useState } from 'react';
|
|
||||||
|
|
||||||
const isMobileOrIOS = () =>
|
|
||||||
/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
|
|
||||||
|
|
||||||
export const useDevToolsDetection = (onDetected) => {
|
|
||||||
const [isBlocked, setIsBlocked] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (isMobileOrIOS()) return;
|
|
||||||
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
const detected = DevToolsDetector.detect();
|
|
||||||
|
|
||||||
if (detected && !isBlocked) {
|
|
||||||
setIsBlocked(true);
|
|
||||||
onDetected?.();
|
|
||||||
} else if (!detected && isBlocked) {
|
|
||||||
setIsBlocked(false);
|
|
||||||
clearInterval(interval);
|
|
||||||
setTimeout(() => window.location.reload(), 100);
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
return () => clearInterval(interval);
|
|
||||||
}, [isBlocked]);
|
|
||||||
|
|
||||||
return isBlocked;
|
|
||||||
};
|
|
||||||
Loading…
Reference in New Issue