Fix#140 One month free Plan Updated
This commit is contained in:
parent
3f52918a09
commit
c18c4ebd2c
|
|
@ -27,7 +27,7 @@ import ExtendSubscriptionModal from './Pages/ExtentedModal/ExtendSubscriptionMod
|
||||||
const AppRoutes = () => {
|
const AppRoutes = () => {
|
||||||
const ItemCard = useSelector(GlobalItemCard);
|
const ItemCard = useSelector(GlobalItemCard);
|
||||||
const { sessionData, logout } = useSessionManager(ItemCard);
|
const { sessionData, logout } = useSessionManager(ItemCard);
|
||||||
const { remainingDays, handleCancel, handlePay, freeExtend, extendModel } = useSubscriptionManager(sessionData, logout);
|
const { remainingDays, handleCancel, freeExtend, extendModel,setExtendModel } = useSubscriptionManager(sessionData, logout);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handlePopState = () => {
|
const handlePopState = () => {
|
||||||
|
|
@ -69,8 +69,7 @@ const AppRoutes = () => {
|
||||||
return (
|
return (
|
||||||
<ExtendSubscriptionModal
|
<ExtendSubscriptionModal
|
||||||
onClose={handleCancel}
|
onClose={handleCancel}
|
||||||
onPayNow={handlePay}
|
setExtendModel={setExtendModel}
|
||||||
onContinueWithCredits={freeExtend}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,8 @@ const BookingPage = () => {
|
||||||
const UserType = getSession('UserType');
|
const UserType = getSession('UserType');
|
||||||
const AuthToken = sessionStorage.getItem('auth');
|
const AuthToken = sessionStorage.getItem('auth');
|
||||||
const SessionMobileNo = getSession('MobileNo');
|
const SessionMobileNo = getSession('MobileNo');
|
||||||
|
const UserName = getSession("UserName");
|
||||||
|
const SessionId =getSession("SessionId")
|
||||||
const FeatureAddonData = useSelector(GlobalFeatAddOnData);
|
const FeatureAddonData = useSelector(GlobalFeatAddOnData);
|
||||||
const Scantemplatedata = useSelector(GlobalScanTemplate);
|
const Scantemplatedata = useSelector(GlobalScanTemplate);
|
||||||
|
|
||||||
|
|
@ -128,6 +130,8 @@ const BookingPage = () => {
|
||||||
AuthToken,
|
AuthToken,
|
||||||
SessionMobileNo,
|
SessionMobileNo,
|
||||||
FeatureAddonData,
|
FeatureAddonData,
|
||||||
|
UserName,
|
||||||
|
SessionId
|
||||||
};
|
};
|
||||||
dispatch(changeSessionData(SessionData));
|
dispatch(changeSessionData(SessionData));
|
||||||
}, [BranchId, FeatureAddonData]);
|
}, [BranchId, FeatureAddonData]);
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,6 @@ const BSLayout1 = () => {
|
||||||
const BranchId = SessionData?.BranchId;
|
const BranchId = SessionData?.BranchId;
|
||||||
const UserId = SessionData?.UserId;
|
const UserId = SessionData?.UserId;
|
||||||
const UserType = SessionData?.UserType;
|
const UserType = SessionData?.UserType;
|
||||||
const AppName = SessionData?.AppName;
|
|
||||||
|
|
||||||
const GlobalLayoutColorDetail = useSelector(SelectedGlobalLayoutColorDetail);
|
const GlobalLayoutColorDetail = useSelector(SelectedGlobalLayoutColorDetail);
|
||||||
const GlobalsalesDetailData = useSelector(GlobalSalesDetailData);
|
const GlobalsalesDetailData = useSelector(GlobalSalesDetailData);
|
||||||
const SelectedCatgColor = useSelector(SelectedGlobalCatgColorDetail);
|
const SelectedCatgColor = useSelector(SelectedGlobalCatgColorDetail);
|
||||||
|
|
@ -134,7 +132,7 @@ const BSLayout1 = () => {
|
||||||
const SelectedBillColor = useSelector(SelectedGlobalBillingColorDetail);
|
const SelectedBillColor = useSelector(SelectedGlobalBillingColorDetail);
|
||||||
|
|
||||||
const currentDateValue = moment().format('YYYY-MM-DD HH:mm:ss');
|
const currentDateValue = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||||
const [count, setcount] = useState(0);
|
|
||||||
const [popOverOpen, setPopOverOpen] = useState(false);
|
const [popOverOpen, setPopOverOpen] = useState(false);
|
||||||
const appPreferences = useSelector(ApplicationPreferences);
|
const appPreferences = useSelector(ApplicationPreferences);
|
||||||
const salespagefields = appPreferences?.find(
|
const salespagefields = appPreferences?.find(
|
||||||
|
|
@ -159,16 +157,15 @@ const BSLayout1 = () => {
|
||||||
(i) => i.SettingIdName === 'DineIn'
|
(i) => i.SettingIdName === 'DineIn'
|
||||||
)?.[0];
|
)?.[0];
|
||||||
let containerHeight = isMobile
|
let containerHeight = isMobile
|
||||||
? AppExpDate?.RemainingDays <= 7
|
? AppExpDate?.RemainingDays <= 7 || AppExpDate?.PlanType?.toLowerCase() === 'extend'
|
||||||
? '575px'
|
? '575px'
|
||||||
: '595px'
|
: '595px'
|
||||||
: UserType != 'Super Admin' &&
|
: UserType != 'Super Admin' &&
|
||||||
UserType != 'Super Admin User' &&
|
UserType != 'Super Admin User' &&
|
||||||
AppExpDate?.RemainingDays <= 7
|
AppExpDate?.RemainingDays <= 7 || AppExpDate?.PlanType?.toLowerCase() === 'extend'
|
||||||
? '96vh'
|
? '96vh'
|
||||||
: '99vh';
|
: '99vh';
|
||||||
const animations = ['example1', 'example2', 'example3'];
|
|
||||||
let ss = animations[count];
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (AppId && CompId && BranchId && UserId) {
|
if (AppId && CompId && BranchId && UserId) {
|
||||||
|
|
@ -227,14 +224,6 @@ const BSLayout1 = () => {
|
||||||
// setBadgeCount(length);
|
// setBadgeCount(length);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (AppExpDate?.RemainingDays <= 7) {
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
setcount((prevCount) => (prevCount >= 2 ? 0 : prevCount + 1));
|
|
||||||
}, 22000);
|
|
||||||
return () => clearInterval(interval);
|
|
||||||
}
|
|
||||||
}, [count == 2]);
|
|
||||||
|
|
||||||
|
|
||||||
const onComplete = useCallback(() => {
|
const onComplete = useCallback(() => {
|
||||||
|
|
@ -317,8 +306,8 @@ const BSLayout1 = () => {
|
||||||
/>
|
/>
|
||||||
{UserType != 'Super Admin' &&
|
{UserType != 'Super Admin' &&
|
||||||
UserType != 'Super Admin User' &&
|
UserType != 'Super Admin User' &&
|
||||||
(AppExpDate?.RemainingDays <= 7 || AppExpDate === 'undefined') && (
|
(AppExpDate?.RemainingDays <= 7 || AppExpDate === 'undefined' || AppExpDate?.PlanType?.toLowerCase() === 'extend') && (
|
||||||
<PlanExpireNotification ss={ss}/>
|
<PlanExpireNotification />
|
||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
className="BSLayout1-Master"
|
className="BSLayout1-Master"
|
||||||
|
|
|
||||||
|
|
@ -182,16 +182,15 @@ const BSLayout2 = () => {
|
||||||
(i) => i.SettingIdName === 'DineIn'
|
(i) => i.SettingIdName === 'DineIn'
|
||||||
)?.[0];
|
)?.[0];
|
||||||
let containerHeight = isMobile
|
let containerHeight = isMobile
|
||||||
? AppExpDate?.RemainingDays <= 7
|
? AppExpDate?.RemainingDays <= 7 || AppExpDate?.PlanType?.toLowerCase() === 'extend'
|
||||||
? '575px'
|
? '575px'
|
||||||
: ''
|
: ''
|
||||||
: UserType != 'Super Admin' &&
|
: UserType != 'Super Admin' &&
|
||||||
UserType != 'Super Admin User' &&
|
UserType != 'Super Admin User' &&
|
||||||
AppExpDate?.RemainingDays <= 7
|
AppExpDate?.RemainingDays <= 7 || AppExpDate?.PlanType?.toLowerCase() === 'extend'
|
||||||
? '96vh'
|
? '96vh'
|
||||||
: '99vh';
|
: '99vh';
|
||||||
const animations = ['example1', 'example2', 'example3'];
|
|
||||||
const [count, setcount] = useState(0);
|
|
||||||
const [ListOfInvoices, setListOfInvoices] = useState(false);
|
const [ListOfInvoices, setListOfInvoices] = useState(false);
|
||||||
const appPreferences = useSelector(ApplicationPreferences);
|
const appPreferences = useSelector(ApplicationPreferences);
|
||||||
const salespagefields = appPreferences?.find(
|
const salespagefields = appPreferences?.find(
|
||||||
|
|
@ -211,7 +210,6 @@ const BSLayout2 = () => {
|
||||||
preference?.PreferredStatus == 'Y'
|
preference?.PreferredStatus == 'Y'
|
||||||
);
|
);
|
||||||
|
|
||||||
let ss = animations[count];
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchAmount();
|
fetchAmount();
|
||||||
|
|
@ -228,15 +226,6 @@ const BSLayout2 = () => {
|
||||||
fetchBookingStatus();
|
fetchBookingStatus();
|
||||||
}
|
}
|
||||||
}, [AppId, CompId, BranchId, UserId]);
|
}, [AppId, CompId, BranchId, UserId]);
|
||||||
useEffect(() => {
|
|
||||||
if (AppExpDate?.RemainingDays <= 7) {
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
setcount((prevCount) => (prevCount >= 2 ? 0 : prevCount + 1));
|
|
||||||
}, 22000);
|
|
||||||
|
|
||||||
return () => clearInterval(interval);
|
|
||||||
}
|
|
||||||
}, [count == 2]);
|
|
||||||
|
|
||||||
const fetchAmount = async () => {
|
const fetchAmount = async () => {
|
||||||
let data = {
|
let data = {
|
||||||
|
|
@ -345,9 +334,9 @@ const BSLayout2 = () => {
|
||||||
<div ref={elementRef} style={{ backgroundColor: '#fff' }}>
|
<div ref={elementRef} style={{ backgroundColor: '#fff' }}>
|
||||||
{UserType != 'Super Admin' &&
|
{UserType != 'Super Admin' &&
|
||||||
UserType != 'Super Admin User' &&
|
UserType != 'Super Admin User' &&
|
||||||
(AppExpDate?.RemainingDays <= 7 || AppExpDate === 'undefined') && (
|
(AppExpDate?.RemainingDays <= 7 || AppExpDate === 'undefined' || AppExpDate?.PlanType?.toLowerCase() === 'extend') && (
|
||||||
<Suspense fallback={<div>Loading...</div>}>
|
<Suspense fallback={<div>Loading...</div>}>
|
||||||
<PlanExpireNotification ss={ss} />
|
<PlanExpireNotification/>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,6 @@ const BSLayout3 = () => {
|
||||||
const AppExpDate = useSelector(GlobalAppExpDateData);
|
const AppExpDate = useSelector(GlobalAppExpDateData);
|
||||||
// const [AppExpDate, setAppExpDate] = useState(0);
|
// const [AppExpDate, setAppExpDate] = useState(0);
|
||||||
const [Kioskopen, setKioskopen] = useState(false);
|
const [Kioskopen, setKioskopen] = useState(false);
|
||||||
const [count, setcount] = useState(0);
|
|
||||||
const BookingStatus = useSelector(GlobalBookingStatus);
|
const BookingStatus = useSelector(GlobalBookingStatus);
|
||||||
const appPreferences = useSelector(ApplicationPreferences);
|
const appPreferences = useSelector(ApplicationPreferences);
|
||||||
const commonModulePreference = appPreferences?.find(
|
const commonModulePreference = appPreferences?.find(
|
||||||
|
|
@ -125,8 +124,7 @@ const BSLayout3 = () => {
|
||||||
const BookingSubCategory = BSLayout3Data?.BookingSubCategory;
|
const BookingSubCategory = BSLayout3Data?.BookingSubCategory;
|
||||||
const BookingCard = BSLayout3Data?.BookingCard;
|
const BookingCard = BSLayout3Data?.BookingCard;
|
||||||
const BookingBilling = BSLayout3Data?.BookingBilling?.[0];
|
const BookingBilling = BSLayout3Data?.BookingBilling?.[0];
|
||||||
const animations = ['example1', 'example2', 'example3'];
|
|
||||||
let ss = animations[count];
|
|
||||||
const DineInAccess = SettingDataSelector?.[0]?.SettingDtlDetails.filter(
|
const DineInAccess = SettingDataSelector?.[0]?.SettingDtlDetails.filter(
|
||||||
(i) => i.SettingIdName === 'DineIn'
|
(i) => i.SettingIdName === 'DineIn'
|
||||||
)?.[0];
|
)?.[0];
|
||||||
|
|
@ -138,12 +136,12 @@ const BSLayout3 = () => {
|
||||||
const UserType = SessionData?.UserType;
|
const UserType = SessionData?.UserType;
|
||||||
const currentDateValue = moment().format('YYYY-MM-DD HH:mm:ss');
|
const currentDateValue = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||||
let containerHeight = isMobile
|
let containerHeight = isMobile
|
||||||
? AppExpDate?.RemainingDays <= 7
|
? AppExpDate?.RemainingDays <= 7 || AppExpDate?.PlanType?.toLowerCase() === 'extend'
|
||||||
? '576px'
|
? '576px'
|
||||||
: '590px'
|
: '590px'
|
||||||
: UserType != 'Super Admin' &&
|
: UserType != 'Super Admin' &&
|
||||||
UserType != 'Super Admin User' &&
|
UserType != 'Super Admin User' &&
|
||||||
AppExpDate?.RemainingDays <= 7
|
AppExpDate?.RemainingDays <= 7 || AppExpDate?.PlanType?.toLowerCase() === 'extend'
|
||||||
? '95vh'
|
? '95vh'
|
||||||
: '99vh';
|
: '99vh';
|
||||||
const SAdminuserPin = useSelector(GLobalSadminUserPin);
|
const SAdminuserPin = useSelector(GLobalSadminUserPin);
|
||||||
|
|
@ -164,14 +162,7 @@ const BSLayout3 = () => {
|
||||||
}
|
}
|
||||||
}, [SessionData]);
|
}, [SessionData]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (AppExpDate?.RemainingDays <= 7) {
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
setcount((prevCount) => (prevCount >= 2 ? 0 : prevCount + 1));
|
|
||||||
}, 22000);
|
|
||||||
return () => clearInterval(interval);
|
|
||||||
}
|
|
||||||
}, [count == 2]);
|
|
||||||
const fetchKioskDatas = async () => {
|
const fetchKioskDatas = async () => {
|
||||||
let data = {
|
let data = {
|
||||||
CompId: CompId,
|
CompId: CompId,
|
||||||
|
|
@ -278,8 +269,8 @@ const BSLayout3 = () => {
|
||||||
/>
|
/>
|
||||||
{UserType != 'Super Admin' &&
|
{UserType != 'Super Admin' &&
|
||||||
UserType != 'Super Admin User' &&
|
UserType != 'Super Admin User' &&
|
||||||
(AppExpDate?.RemainingDays <= 7 || AppExpDate === 'undefined') && (
|
(AppExpDate?.RemainingDays <= 7 || AppExpDate === 'undefined' || AppExpDate?.PlanType?.toLowerCase() === 'extend') && (
|
||||||
<PlanExpireNotification ss={ss}/>
|
<PlanExpireNotification />
|
||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
className="BSLayout3-Master"
|
className="BSLayout3-Master"
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,7 @@ import { CiShop } from 'react-icons/ci';
|
||||||
import BranchName from '../BranchName.jsx';
|
import BranchName from '../BranchName.jsx';
|
||||||
import ComboSalesBillTable from '../../Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx';
|
import ComboSalesBillTable from '../../Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx';
|
||||||
import PlanExpireNotification from '../PlanExpireNotification.jsx';
|
import PlanExpireNotification from '../PlanExpireNotification.jsx';
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
|
||||||
const commonDirectory = import.meta.env.COMMON_BASE_URL;
|
|
||||||
|
|
||||||
const BSLayout4 = () => {
|
const BSLayout4 = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
@ -111,7 +110,6 @@ const BSLayout4 = () => {
|
||||||
);
|
);
|
||||||
// const [AppExpDate, setAppExpDate] = useState(0);
|
// const [AppExpDate, setAppExpDate] = useState(0);
|
||||||
const [Kioskopen, setKioskopen] = useState(false);
|
const [Kioskopen, setKioskopen] = useState(false);
|
||||||
const [count, setcount] = useState(0);
|
|
||||||
const BookingStatus = useSelector(GlobalBookingStatus);
|
const BookingStatus = useSelector(GlobalBookingStatus);
|
||||||
const CheckBookingStatus =
|
const CheckBookingStatus =
|
||||||
BookingStatus?.find((item) => item.ScreenType === 'Booking')
|
BookingStatus?.find((item) => item.ScreenType === 'Booking')
|
||||||
|
|
@ -122,11 +120,9 @@ const BSLayout4 = () => {
|
||||||
const BookingCard = BSLayout4Data?.BookingCard;
|
const BookingCard = BSLayout4Data?.BookingCard;
|
||||||
const BookingBilling = BSLayout4Data?.BookingBilling?.[0];
|
const BookingBilling = BSLayout4Data?.BookingBilling?.[0];
|
||||||
console.log('BSLayout4Data', BookingBilling);
|
console.log('BSLayout4Data', BookingBilling);
|
||||||
const animations = ['example1', 'example2', 'example3'];
|
|
||||||
const DineInAccess = SettingDataSelector?.[0]?.SettingDtlDetails.filter(
|
const DineInAccess = SettingDataSelector?.[0]?.SettingDtlDetails.filter(
|
||||||
(i) => i.SettingIdName === 'DineIn'
|
(i) => i.SettingIdName === 'DineIn'
|
||||||
)?.[0];
|
)?.[0];
|
||||||
const AppName = SessionData?.AppName;
|
|
||||||
const AppId = SessionData?.AppId;
|
const AppId = SessionData?.AppId;
|
||||||
const CompId = SessionData?.CompId;
|
const CompId = SessionData?.CompId;
|
||||||
const BranchId = SessionData?.BranchId;
|
const BranchId = SessionData?.BranchId;
|
||||||
|
|
@ -134,15 +130,14 @@ const BSLayout4 = () => {
|
||||||
const UserType = SessionData?.UserType;
|
const UserType = SessionData?.UserType;
|
||||||
const currentDateValue = moment().format('YYYY-MM-DD HH:mm:ss');
|
const currentDateValue = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||||
let containerHeight = isMobile
|
let containerHeight = isMobile
|
||||||
? AppExpDate?.RemainingDays <= 7
|
? AppExpDate?.RemainingDays <= 7 || AppExpDate?.PlanType?.toLowerCase() === 'extend'
|
||||||
? '575px'
|
? '575px'
|
||||||
: '590px'
|
: '590px'
|
||||||
: UserType != 'Super Admin' &&
|
: UserType != 'Super Admin' &&
|
||||||
UserType != 'Super Admin User' &&
|
UserType != 'Super Admin User' &&
|
||||||
AppExpDate?.RemainingDays <= 7
|
AppExpDate?.RemainingDays <= 7 || AppExpDate?.PlanType?.toLowerCase() === 'extend'
|
||||||
? '96vh'
|
? '96vh'
|
||||||
: '99vh';
|
: '99vh';
|
||||||
let ss = animations[count];
|
|
||||||
const [ListOfInvoices, setListOfInvoices] = useState(false);
|
const [ListOfInvoices, setListOfInvoices] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -160,15 +155,7 @@ const BSLayout4 = () => {
|
||||||
fetchBookingStatus();
|
fetchBookingStatus();
|
||||||
}
|
}
|
||||||
}, [AppId, CompId, BranchId, UserId]);
|
}, [AppId, CompId, BranchId, UserId]);
|
||||||
useEffect(() => {
|
|
||||||
if (AppExpDate?.RemainingDays <= 7) {
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
setcount((prevCount) => (prevCount >= 2 ? 0 : prevCount + 1));
|
|
||||||
}, 22000);
|
|
||||||
|
|
||||||
return () => clearInterval(interval);
|
|
||||||
}
|
|
||||||
}, [count == 2]);
|
|
||||||
const OpenListOfInvoices = () => {
|
const OpenListOfInvoices = () => {
|
||||||
setListOfInvoices(true);
|
setListOfInvoices(true);
|
||||||
};
|
};
|
||||||
|
|
@ -278,8 +265,8 @@ const BSLayout4 = () => {
|
||||||
/>
|
/>
|
||||||
{UserType != 'Super Admin' &&
|
{UserType != 'Super Admin' &&
|
||||||
UserType != 'Super Admin User' &&
|
UserType != 'Super Admin User' &&
|
||||||
(AppExpDate?.RemainingDays <= 7 || AppExpDate === 'undefined') && (
|
(AppExpDate?.RemainingDays <= 7 || AppExpDate === 'undefined' || AppExpDate?.PlanType?.toLowerCase() === 'extend') && (
|
||||||
<PlanExpireNotification ss={ss}/>
|
<PlanExpireNotification />
|
||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
className="BsLayout4-Master"
|
className="BsLayout4-Master"
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ import {
|
||||||
globalKioskSalesCount,
|
globalKioskSalesCount,
|
||||||
} from '../../../../Features/Kiosk/kiosk.js';
|
} from '../../../../Features/Kiosk/kiosk.js';
|
||||||
import SalesCountComponent from '../SalesCountComponent.jsx';
|
import SalesCountComponent from '../SalesCountComponent.jsx';
|
||||||
|
import '../../../../Styles/BookingScreen/Template/BSLayout5/BSLayout5.scss';
|
||||||
import PozoKioskIcon from '../../Components/UtillComponents/Pozo retail icons/PozoKioskIcon.jsx';
|
import PozoKioskIcon from '../../Components/UtillComponents/Pozo retail icons/PozoKioskIcon.jsx';
|
||||||
import {
|
import {
|
||||||
GLobalSadminUserPin,
|
GLobalSadminUserPin,
|
||||||
|
|
@ -78,8 +79,6 @@ import { CiShop } from 'react-icons/ci';
|
||||||
import BranchName from '../BranchName.jsx';
|
import BranchName from '../BranchName.jsx';
|
||||||
import ComboSalesBillTable from '../../Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx';
|
import ComboSalesBillTable from '../../Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx';
|
||||||
import PlanExpireNotification from '../PlanExpireNotification.jsx';
|
import PlanExpireNotification from '../PlanExpireNotification.jsx';
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
|
||||||
const commonDirectory = import.meta.env.COMMON_BASE_URL;
|
|
||||||
|
|
||||||
const BSLayout5 = () => {
|
const BSLayout5 = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
@ -107,7 +106,6 @@ const BSLayout5 = () => {
|
||||||
// const [AppExpDate, setAppExpDate] = useState(0);
|
// const [AppExpDate, setAppExpDate] = useState(0);
|
||||||
const [screenHeight, setScreenHeight] = useState(window.innerHeight);
|
const [screenHeight, setScreenHeight] = useState(window.innerHeight);
|
||||||
const [Kioskopen, setKioskopen] = useState(false);
|
const [Kioskopen, setKioskopen] = useState(false);
|
||||||
const [count, setcount] = useState(0);
|
|
||||||
const PricingAppPricingName = useSelector(GlobalPricingAppPricingName);
|
const PricingAppPricingName = useSelector(GlobalPricingAppPricingName);
|
||||||
const SAdminuserPin = useSelector(GLobalSadminUserPin);
|
const SAdminuserPin = useSelector(GLobalSadminUserPin);
|
||||||
const BookingNavbar = BSLayout5Data?.BookingNavbar?.[0];
|
const BookingNavbar = BSLayout5Data?.BookingNavbar?.[0];
|
||||||
|
|
@ -117,22 +115,20 @@ const BSLayout5 = () => {
|
||||||
const DineInAccess = SettingDataSelector?.[0]?.SettingDtlDetails.filter(
|
const DineInAccess = SettingDataSelector?.[0]?.SettingDtlDetails.filter(
|
||||||
(i) => i.SettingIdName === 'DineIn'
|
(i) => i.SettingIdName === 'DineIn'
|
||||||
)?.[0];
|
)?.[0];
|
||||||
const AppName = SessionData?.AppName;
|
|
||||||
const AppId = SessionData?.AppId;
|
const AppId = SessionData?.AppId;
|
||||||
const CompId = SessionData?.CompId;
|
const CompId = SessionData?.CompId;
|
||||||
const BranchId = SessionData?.BranchId;
|
const BranchId = SessionData?.BranchId;
|
||||||
const UserId = SessionData?.UserId;
|
const UserId = SessionData?.UserId;
|
||||||
const UserType = SessionData?.UserType;
|
const UserType = SessionData?.UserType;
|
||||||
const currentDateValue = moment().format('YYYY-MM-DD HH:mm:ss');
|
const currentDateValue = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||||
const animations = ['example1', 'example2', 'example3'];
|
|
||||||
let ss = animations[count];
|
|
||||||
let containerHeight = isMobile
|
let containerHeight = isMobile
|
||||||
? AppExpDate?.RemainingDays <= 7
|
? AppExpDate?.RemainingDays <= 7 || AppExpDate?.PlanType?.toLowerCase() === 'extend'
|
||||||
? '580px'
|
? '580px'
|
||||||
: '590px'
|
: '590px'
|
||||||
: UserType != 'Super Admin' &&
|
: UserType != 'Super Admin' &&
|
||||||
UserType != 'Super Admin User' &&
|
UserType != 'Super Admin User' &&
|
||||||
AppExpDate?.RemainingDays <= 7
|
AppExpDate?.RemainingDays <= 7 || AppExpDate?.PlanType?.toLowerCase() === 'extend'
|
||||||
? '96vh'
|
? '96vh'
|
||||||
: '99vh';
|
: '99vh';
|
||||||
const [ListOfInvoices, setListOfInvoices] = useState(false);
|
const [ListOfInvoices, setListOfInvoices] = useState(false);
|
||||||
|
|
@ -160,15 +156,7 @@ const BSLayout5 = () => {
|
||||||
fetchKioskDatas();
|
fetchKioskDatas();
|
||||||
}
|
}
|
||||||
}, [SessionData]);
|
}, [SessionData]);
|
||||||
useEffect(() => {
|
|
||||||
if (AppExpDate?.RemainingDays <= 7) {
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
setcount((prevCount) => (prevCount >= 2 ? 0 : prevCount + 1));
|
|
||||||
}, 22000);
|
|
||||||
|
|
||||||
return () => clearInterval(interval);
|
|
||||||
}
|
|
||||||
}, [count == 2]);
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (AppId && CompId && BranchId && UserId) {
|
if (AppId && CompId && BranchId && UserId) {
|
||||||
fetchBookingStatus();
|
fetchBookingStatus();
|
||||||
|
|
@ -293,8 +281,8 @@ const BSLayout5 = () => {
|
||||||
/>
|
/>
|
||||||
{UserType != 'Super Admin' &&
|
{UserType != 'Super Admin' &&
|
||||||
UserType != 'Super Admin User' &&
|
UserType != 'Super Admin User' &&
|
||||||
(AppExpDate?.RemainingDays <= 7 || AppExpDate === 'undefined') && (
|
(AppExpDate?.RemainingDays <= 7 || AppExpDate === 'undefined' || AppExpDate?.PlanType?.toLowerCase() === 'extend') && (
|
||||||
<PlanExpireNotification ss={ss}/>
|
<PlanExpireNotification />
|
||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
className="BSLayout5-Master"
|
className="BSLayout5-Master"
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ import {
|
||||||
import { Messages } from '../../../../Components/Notifications/Messages.jsx';
|
import { Messages } from '../../../../Components/Notifications/Messages.jsx';
|
||||||
import SAdminUserNotification from '../../Components/BookingFunctionality/SAdminUserNotification.jsx';
|
import SAdminUserNotification from '../../Components/BookingFunctionality/SAdminUserNotification.jsx';
|
||||||
import SalesCountComponent from '../SalesCountComponent.jsx';
|
import SalesCountComponent from '../SalesCountComponent.jsx';
|
||||||
|
import '../../../../Styles/BookingScreen/Template/BSLayout6/BSLayout6.scss';
|
||||||
import {
|
import {
|
||||||
getBookingStatus,
|
getBookingStatus,
|
||||||
GlobalBookingStatus,
|
GlobalBookingStatus,
|
||||||
|
|
@ -68,10 +69,6 @@ import BSEwayBillicon from '../../Components/UtillComponents/BSEwayBillicon.jsx'
|
||||||
import BSComboItemCard from '../../Components/BSItemCards/BSComboItemCard.jsx';
|
import BSComboItemCard from '../../Components/BSItemCards/BSComboItemCard.jsx';
|
||||||
import BranchTransferComponent from '../../Components/UtillComponents/BSQuickBranchToBranchTransferComponent.jsx';
|
import BranchTransferComponent from '../../Components/UtillComponents/BSQuickBranchToBranchTransferComponent.jsx';
|
||||||
import BSExpireProductsList from '../../Components/UtillComponents/BSExpireProductsList.jsx';
|
import BSExpireProductsList from '../../Components/UtillComponents/BSExpireProductsList.jsx';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
|
||||||
const commonDirectory = import.meta.env.COMMON_BASE_URL;
|
|
||||||
|
|
||||||
import BSOtherServiceItemCard from '../../Components/BSItemCards/BSOtherServiceItemCard.jsx';
|
import BSOtherServiceItemCard from '../../Components/BSItemCards/BSOtherServiceItemCard.jsx';
|
||||||
import BSOtherServicesHorizontalcat from '../../Components/BSCategories/BSOtherServicesHorizontalcat';
|
import BSOtherServicesHorizontalcat from '../../Components/BSCategories/BSOtherServicesHorizontalcat';
|
||||||
import BSNavbar3 from '../../Components/BSNavbar/BSNavbar3.jsx';
|
import BSNavbar3 from '../../Components/BSNavbar/BSNavbar3.jsx';
|
||||||
|
|
@ -115,12 +112,10 @@ const BSLayout6 = () => {
|
||||||
const AppExpDate = useSelector(GlobalAppExpDateData);
|
const AppExpDate = useSelector(GlobalAppExpDateData);
|
||||||
const [screenHeight, setScreenHeight] = useState(window?.innerHeight);
|
const [screenHeight, setScreenHeight] = useState(window?.innerHeight);
|
||||||
// const [AppExpDate, setAppExpDate] = useState(0);
|
// const [AppExpDate, setAppExpDate] = useState(0);
|
||||||
const [count, setcount] = useState(0);
|
|
||||||
const BookingNavbar = BSLayout6Data?.BookingNavbar?.[0];
|
const BookingNavbar = BSLayout6Data?.BookingNavbar?.[0];
|
||||||
const BookingCategory = BSLayout6Data?.BookingCategory;
|
const BookingCategory = BSLayout6Data?.BookingCategory;
|
||||||
const BookingCard = BSLayout6Data?.BookingCard;
|
const BookingCard = BSLayout6Data?.BookingCard;
|
||||||
const BookingBilling = BSLayout6Data?.BookingBilling?.[0];
|
const BookingBilling = BSLayout6Data?.BookingBilling?.[0];
|
||||||
const AppName = SessionData?.AppName;
|
|
||||||
const AppId = SessionData?.AppId;
|
const AppId = SessionData?.AppId;
|
||||||
const CompId = SessionData?.CompId;
|
const CompId = SessionData?.CompId;
|
||||||
const BranchId = SessionData?.BranchId;
|
const BranchId = SessionData?.BranchId;
|
||||||
|
|
@ -154,15 +149,7 @@ const BSLayout6 = () => {
|
||||||
}
|
}
|
||||||
}, [SessionData]);
|
}, [SessionData]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (AppExpDate?.RemainingDays <= 7) {
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
setcount((prevCount) => (prevCount >= 2 ? 0 : prevCount + 1));
|
|
||||||
}, 22000);
|
|
||||||
|
|
||||||
return () => clearInterval(interval);
|
|
||||||
}
|
|
||||||
}, [count == 2]);
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (AppId && CompId && BranchId && UserId) {
|
if (AppId && CompId && BranchId && UserId) {
|
||||||
fetchBookingStatus();
|
fetchBookingStatus();
|
||||||
|
|
@ -198,18 +185,16 @@ const BSLayout6 = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
let containerHeight = isMobile
|
let containerHeight = isMobile
|
||||||
? AppExpDate?.RemainingDays <= 7
|
? AppExpDate?.RemainingDays <= 7 || AppExpDate?.PlanType?.toLowerCase() === 'extend'
|
||||||
? '577px'
|
? '577px'
|
||||||
: '595px'
|
: '595px'
|
||||||
: UserType != 'Super Admin' &&
|
: UserType != 'Super Admin' &&
|
||||||
UserType != 'Super Admin User' &&
|
UserType != 'Super Admin User' &&
|
||||||
AppExpDate?.RemainingDays <= 7
|
AppExpDate?.RemainingDays <= 7 || AppExpDate?.PlanType?.toLowerCase() === 'extend'
|
||||||
? '96vh'
|
? '96vh'
|
||||||
: '99vh';
|
: '99vh';
|
||||||
|
|
||||||
const animations = ['example1', 'example2', 'example3'];
|
|
||||||
|
|
||||||
let ss = animations[count];
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
function handleResize() {
|
function handleResize() {
|
||||||
setScreenHeight(window.innerHeight);
|
setScreenHeight(window.innerHeight);
|
||||||
|
|
@ -300,8 +285,8 @@ const BSLayout6 = () => {
|
||||||
/>
|
/>
|
||||||
{UserType != 'Super Admin' &&
|
{UserType != 'Super Admin' &&
|
||||||
UserType != 'Super Admin User' &&
|
UserType != 'Super Admin User' &&
|
||||||
(AppExpDate?.RemainingDays <= 30 || AppExpDate === 'undefined') && (
|
(AppExpDate?.RemainingDays <= 30 || AppExpDate === 'undefined' || AppExpDate?.PlanType?.toLowerCase() === 'extend') && (
|
||||||
<PlanExpireNotification ss={ss}/>
|
<PlanExpireNotification />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
|
|
@ -73,9 +73,6 @@ import VerfiedProducts from '../../Components/BSNavbar/verfiedProduct/VerfiedPro
|
||||||
import ShortcutKeyHelper from '../../Components/UtillComponents/ShortcutKeyHelper.jsx';
|
import ShortcutKeyHelper from '../../Components/UtillComponents/ShortcutKeyHelper.jsx';
|
||||||
import PlanExpireNotification from '../PlanExpireNotification.jsx';
|
import PlanExpireNotification from '../PlanExpireNotification.jsx';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
|
||||||
const commonDirectory = import.meta.env.COMMON_BASE_URL;
|
|
||||||
|
|
||||||
export default function BSCombo1() {
|
export default function BSCombo1() {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { action, selectedProducts } = useSelector(
|
const { action, selectedProducts } = useSelector(
|
||||||
|
|
@ -114,7 +111,6 @@ export default function BSCombo1() {
|
||||||
|
|
||||||
// const [AppExpDate, setAppExpDate] = useState(0);
|
// const [AppExpDate, setAppExpDate] = useState(0);
|
||||||
const [Kioskopen, setKioskopen] = useState(false);
|
const [Kioskopen, setKioskopen] = useState(false);
|
||||||
const [count, setcount] = useState(0);
|
|
||||||
const [messageType, setMessageType] = useState(null);
|
const [messageType, setMessageType] = useState(null);
|
||||||
const [messageData, setMessageData] = useState(null);
|
const [messageData, setMessageData] = useState(null);
|
||||||
const [multiple, setMultiple] = useState(false);
|
const [multiple, setMultiple] = useState(false);
|
||||||
|
|
@ -127,7 +123,6 @@ export default function BSCombo1() {
|
||||||
item.SettingIdName === 'VerifyProduct' && item?.SettingValue === 'Y'
|
item.SettingIdName === 'VerifyProduct' && item?.SettingValue === 'Y'
|
||||||
);
|
);
|
||||||
|
|
||||||
const AppName = SessionData?.AppName;
|
|
||||||
const AppId = SessionData?.AppId;
|
const AppId = SessionData?.AppId;
|
||||||
const CompId = SessionData?.CompId;
|
const CompId = SessionData?.CompId;
|
||||||
const BranchId = SessionData?.BranchId;
|
const BranchId = SessionData?.BranchId;
|
||||||
|
|
@ -139,8 +134,7 @@ export default function BSCombo1() {
|
||||||
?.ScreenStatus ?? 'Open';
|
?.ScreenStatus ?? 'Open';
|
||||||
const [BookingModalOpen, setBookingModalOpen] = useState(false);
|
const [BookingModalOpen, setBookingModalOpen] = useState(false);
|
||||||
const currentDateValue = moment().format('YYYY-MM-DD HH:mm:ss');
|
const currentDateValue = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||||
const animations = ['example1', 'example2', 'example3'];
|
|
||||||
let ss = animations[count];
|
|
||||||
const [ListOfInvoices, setListOfInvoices] = useState(false);
|
const [ListOfInvoices, setListOfInvoices] = useState(false);
|
||||||
const [ComboDropDown, setComboDropDown] = useState();
|
const [ComboDropDown, setComboDropDown] = useState();
|
||||||
|
|
||||||
|
|
@ -155,15 +149,7 @@ export default function BSCombo1() {
|
||||||
}
|
}
|
||||||
}, [SessionData]);
|
}, [SessionData]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (AppExpDate?.RemainingDays <= 7) {
|
|
||||||
const interval = setInterval(() => {
|
|
||||||
setcount((prevCount) => (prevCount >= 2 ? 0 : prevCount + 1));
|
|
||||||
}, 22000);
|
|
||||||
|
|
||||||
return () => clearInterval(interval);
|
|
||||||
}
|
|
||||||
}, [count == 2]);
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Combodata();
|
Combodata();
|
||||||
if (AppId && CompId && BranchId && UserId) {
|
if (AppId && CompId && BranchId && UserId) {
|
||||||
|
|
@ -298,8 +284,8 @@ export default function BSCombo1() {
|
||||||
/>
|
/>
|
||||||
{UserType != 'Super Admin' &&
|
{UserType != 'Super Admin' &&
|
||||||
UserType != 'Super Admin User' &&
|
UserType != 'Super Admin User' &&
|
||||||
(AppExpDate?.RemainingDays <= 7 || AppExpDate === 'undefined') && (
|
(AppExpDate?.RemainingDays <= 7 || AppExpDate === 'undefined' || AppExpDate?.PlanType?.toLowerCase() === 'extend') && (
|
||||||
<PlanExpireNotification ss={ss}/>
|
<PlanExpireNotification />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Combo Container */}
|
{/* Combo Container */}
|
||||||
|
|
|
||||||
|
|
@ -1,222 +1,62 @@
|
||||||
// import { useSelector } from "react-redux";
|
import { useSelector } from 'react-redux';
|
||||||
// import { GlobalAppExpDateData } from "../../../Features/BookingScreen/BookingData/BookingData";
|
import { GlobalAppExpDateData } from '../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
// import { useNavigate } from "react-router-dom";
|
import { useNavigate } from 'react-router-dom';
|
||||||
// import { ArrowUpOutlined } from '@ant-design/icons';
|
|
||||||
// import { StoredSessionData } from "../../../Features/ThemeChange/ThemeChange";
|
|
||||||
// import ExtendSubscriptionModal from "../../ExtentedModal/ExtendSubscriptionModal";
|
|
||||||
// import { useDispatch } from "react-redux";
|
|
||||||
// import { getPurchasedAppDetails, postInvoice } from "../../../Features/BookingScreen/Pricing/Pricing";
|
|
||||||
// import { sendSms } from "../../../Features/Payment/PaymentDetails/PaymentDetails";
|
|
||||||
// import { useState } from "react";
|
|
||||||
// const subDirectory = import.meta.env.BASE_URL;
|
|
||||||
// const commonDirectory = import.meta.env.COMMON_BASE_URL;
|
|
||||||
|
|
||||||
// const PlanExpireNotification = ({ss}) => {
|
|
||||||
// const navigate = useNavigate();
|
|
||||||
// const dispatch = useDispatch();
|
|
||||||
|
|
||||||
// const AppExpDate = useSelector(GlobalAppExpDateData);
|
|
||||||
// const SessionData = useSelector(StoredSessionData);
|
|
||||||
// const [extendModel, setExtendModel] = useState(false);
|
|
||||||
// console.log("AppExpDate", AppExpDate);
|
|
||||||
// const navigateFun = () => {
|
|
||||||
// navigate(`${subDirectory}PricingPage`, { state: { AppName: SessionData?.AppName } });
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const navigatePublicFun = () => {
|
|
||||||
// navigate(`${commonDirectory}`);
|
|
||||||
// };
|
|
||||||
// const formatDate = (dateStr) => {
|
|
||||||
// const date = new Date(dateStr);
|
|
||||||
// const year = date.getFullYear();
|
|
||||||
// const month = String(date.getMonth() + 1).padStart(2, '0'); // Months are 0-based
|
|
||||||
// const day = String(date.getDate()).padStart(2, '0');
|
|
||||||
// return `${day}-${month}-${year}`;
|
|
||||||
// };
|
|
||||||
// const freeExtend = async () => {
|
|
||||||
// try {
|
|
||||||
// const { CompId, AppId, BranchId, UserType,UserId } = SessionData;
|
|
||||||
|
|
||||||
// // Current date
|
|
||||||
// const now = new Date();
|
|
||||||
// const currentDate = formatDate(now);
|
|
||||||
|
|
||||||
// // 1️⃣ Get purchased app details
|
|
||||||
// const response1 = await dispatch(
|
|
||||||
// getPurchasedAppDetails({ AppId, UserId })
|
|
||||||
// ).unwrap();
|
|
||||||
|
|
||||||
// const PurchasedDetails = response1?.data?.data;
|
|
||||||
|
|
||||||
// if (!PurchasedDetails || !PurchasedDetails.length) {
|
|
||||||
// console.error('No purchased details found');
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 2️⃣ Prepare post data
|
|
||||||
// const postData = {
|
|
||||||
// UserId: UserId,
|
|
||||||
// AppId: AppId,
|
|
||||||
// PricingId: PurchasedDetails[0]?.PricingId,
|
|
||||||
// PurDate: currentDate,
|
|
||||||
// NoofDays: 30,
|
|
||||||
// PaymentMode: 27,
|
|
||||||
// PaymentStatus: 'S',
|
|
||||||
// LicenseStatus: PurchasedDetails[0]?.LicenseStatus,
|
|
||||||
// Price: PurchasedDetails[0]?.Price ?? 0,
|
|
||||||
// TaxId: PurchasedDetails[0]?.TaxId ?? 0,
|
|
||||||
// NetPrice: PurchasedDetails[0]?.ExistingPlanNetPrice ?? 0,
|
|
||||||
// ValidityStart: currentDate,
|
|
||||||
// ValidityEnd: addDays(
|
|
||||||
// currentDate,
|
|
||||||
// PurchasedDetails[0]?.NoOfDays
|
|
||||||
// ),
|
|
||||||
// CreatedBy: UserId,
|
|
||||||
// TaxAmount: PurchasedDetails[0]?.TaxAmount ?? 0,
|
|
||||||
// MobileNo: getSession('MobileNo'),
|
|
||||||
// MailId: 'ts@gmmail.com',
|
|
||||||
// Type: "FreeExtend"
|
|
||||||
// };
|
|
||||||
|
|
||||||
// // 3️⃣ Post invoice
|
|
||||||
// const response = await dispatch(postInvoice(postData)).unwrap();
|
|
||||||
|
|
||||||
// // 4️⃣ Send SMS if required
|
|
||||||
// if (response?.data?.statusCode === 1 && response?.data?.SMSbody) {
|
|
||||||
// await dispatch(
|
|
||||||
// sendSms({ body: response.data.SMSbody })
|
|
||||||
// );
|
|
||||||
// setExtendModel(false)
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
// } catch (error) {
|
|
||||||
// console.error('freeExtend error:', error);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// const handleCancel = () => {
|
|
||||||
// Logout();
|
|
||||||
// setExtendModel(false)
|
|
||||||
|
|
||||||
// }
|
|
||||||
// const handlePay = () => {
|
|
||||||
// setExtendModel(false)
|
|
||||||
// let AppName = getSession("AppName")
|
|
||||||
// navigate(`${subDirectory}PricingPage`, { state: { AppName: AppName } });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return(
|
|
||||||
// <>
|
|
||||||
// <div className={`${ss}`}>
|
|
||||||
// <p>
|
|
||||||
// {(AppExpDate?.RemainingDays < 30 &&
|
|
||||||
// AppExpDate?.RemainingHours < 30 &&
|
|
||||||
// AppExpDate?.RemainingMinutes < 50 &&
|
|
||||||
// AppExpDate?.RemainingSeconds < 60
|
|
||||||
// ) ||
|
|
||||||
// AppExpDate === 'undefined' ? (
|
|
||||||
// (AppExpDate?.PlanType?.toLowerCase() == "extend expired")?(
|
|
||||||
|
|
||||||
// <span className="ExpiredMessage">
|
|
||||||
// Subscription expired
|
|
||||||
// <a
|
|
||||||
// onClick={() => {
|
|
||||||
// navigatePublicFun();
|
|
||||||
// }}
|
|
||||||
// className="upgrdbtn"
|
|
||||||
// >
|
|
||||||
// RENEWAL NOW <ArrowUpOutlined />
|
|
||||||
// </a>
|
|
||||||
// </span>
|
|
||||||
// ) : (
|
|
||||||
|
|
||||||
// )
|
|
||||||
// ) : AppExpDate?.RemainingDays < 1 ? (
|
|
||||||
// <p>
|
|
||||||
// Your application subscription will expire within
|
|
||||||
// <span className="Expired">
|
|
||||||
// {AppExpDate?.RemainingHours >= 1
|
|
||||||
// ? AppExpDate?.RemainingHours
|
|
||||||
// : AppExpDate?.RemainingMinutes}
|
|
||||||
// </span>{' '}
|
|
||||||
// {AppExpDate?.RemainingHours >= 1 ? 'Hrs' : 'Min'} .
|
|
||||||
// <a
|
|
||||||
// onClick={() => {
|
|
||||||
// navigateFun();
|
|
||||||
// }}
|
|
||||||
// className="upgrdbtn"
|
|
||||||
// >
|
|
||||||
// RENEWAL NOW <ArrowUpOutlined />
|
|
||||||
// </a>
|
|
||||||
// </p>
|
|
||||||
// ) : (
|
|
||||||
// <p>
|
|
||||||
// Your application subscription will expire within
|
|
||||||
// <span className="NosDays">
|
|
||||||
// {AppExpDate?.RemainingDays}
|
|
||||||
// </span>{' '}
|
|
||||||
// days.
|
|
||||||
// <a
|
|
||||||
// onClick={() => {
|
|
||||||
// navigateFun();
|
|
||||||
// }}
|
|
||||||
// className="upgrdbtn"
|
|
||||||
// >
|
|
||||||
// RENEWAL NOW <ArrowUpOutlined />
|
|
||||||
// </a>
|
|
||||||
// </p>
|
|
||||||
// )}
|
|
||||||
// </p>
|
|
||||||
// </div>
|
|
||||||
// {extendModel && (
|
|
||||||
// <ExtendSubscriptionModal
|
|
||||||
// onClose={handleCancel}
|
|
||||||
// onPayNow={handlePay}
|
|
||||||
// onContinueWithCredits={freeExtend}
|
|
||||||
// />
|
|
||||||
// )}
|
|
||||||
// </>
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
// export default PlanExpireNotification;
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
import { GlobalAppExpDateData } from "../../../Features/BookingScreen/BookingData/BookingData";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
import { ArrowUpOutlined } from '@ant-design/icons';
|
import { ArrowUpOutlined } from '@ant-design/icons';
|
||||||
import { StoredSessionData } from "../../../Features/ThemeChange/ThemeChange";
|
import { StoredSessionData } from '../../../Features/ThemeChange/ThemeChange';
|
||||||
import ExtendSubscriptionModal from "../../ExtentedModal/ExtendSubscriptionModal";
|
import ExtendSubscriptionModal from '../../ExtentedModal/ExtendSubscriptionModal';
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from 'react-redux';
|
||||||
import { getPurchasedAppDetails, postInvoice } from "../../../Features/BookingScreen/Pricing/Pricing";
|
import {
|
||||||
import { sendSms } from "../../../Features/Payment/PaymentDetails/PaymentDetails";
|
getPurchasedAppDetails,
|
||||||
import { useEffect, useState, useMemo } from "react";
|
postInvoice,
|
||||||
import { getSession } from "../../../Services/Others";
|
} from '../../../Features/BookingScreen/Pricing/Pricing';
|
||||||
|
import { sendSms } from '../../../Features/Payment/PaymentDetails/PaymentDetails';
|
||||||
|
import { useEffect, useState, useMemo } from 'react';
|
||||||
|
import { encryptObject, getSession } from '../../../Services/Others';
|
||||||
|
import { GenerateLogout } from '../../../Features/BrachLogin/BranchLogin';
|
||||||
|
import { PublicQrCodepost } from '../../../Features/ConfigMasterPage/ConfigMasterPage';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
const commonDirectory = import.meta.env.COMMON_BASE_URL;
|
const commonDirectory = import.meta.env.ENV_COMMON_BASE_URL;
|
||||||
|
console.log('commonDirectory', commonDirectory);
|
||||||
const PlanExpireNotification = ({ ss }) => {
|
const PlanExpireNotification = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const AppExpDate = useSelector(GlobalAppExpDateData);
|
const AppExpDate = useSelector(GlobalAppExpDateData);
|
||||||
const SessionData = useSelector(StoredSessionData);
|
const SessionData = useSelector(StoredSessionData);
|
||||||
const [extendModel, setExtendModel] = useState(false);
|
const [extendModel, setExtendModel] = useState(false);
|
||||||
const { AppId, UserId } = SessionData;
|
const {
|
||||||
console.log("AppExpDate", AppExpDate);
|
AppId,
|
||||||
|
UserId,
|
||||||
|
AppName,
|
||||||
|
SessionId,
|
||||||
|
AuthToken,
|
||||||
|
CompId,
|
||||||
|
SessionMobileNo,
|
||||||
|
UserName,
|
||||||
|
UserType,
|
||||||
|
} = SessionData;
|
||||||
|
console.log('SessionData', AppExpDate);
|
||||||
|
const [count, setcount] = useState(0);
|
||||||
|
const animations = ['example1', 'example2', 'example3'];
|
||||||
|
let ss = animations[count];
|
||||||
|
|
||||||
// ================= NAVIGATION =================
|
useEffect(() => {
|
||||||
const navigateFun = () => {
|
if (
|
||||||
navigate(`${subDirectory}PricingPage`, { state: { AppName: SessionData?.AppName } });
|
AppExpDate?.RemainingDays <= 7 ||
|
||||||
};
|
AppExpDate?.PlanType?.toLowerCase() === 'extend'
|
||||||
|
) {
|
||||||
const navigatePublicFun = () => {
|
const interval = setInterval(() => {
|
||||||
navigate(`${commonDirectory}`);
|
setcount((prevCount) => (prevCount >= 2 ? 0 : prevCount + 1));
|
||||||
};
|
}, 22000);
|
||||||
|
return () => clearInterval(interval);
|
||||||
|
}
|
||||||
|
}, [count == 2]);
|
||||||
|
|
||||||
// ================= DATE FORMAT =================
|
// ================= DATE FORMAT =================
|
||||||
const formatDate = (dateStr) => {
|
const formatDate = (dateStr) => {
|
||||||
const date = new Date(dateStr);
|
const date = new Date(dateStr);
|
||||||
return `${String(date.getDate()).padStart(2, "0")}-${String(date.getMonth() + 1).padStart(2, "0")}-${date.getFullYear()}`;
|
return `${String(date.getDate()).padStart(2, '0')}-${String(date.getMonth() + 1).padStart(2, '0')}-${date.getFullYear()}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ================= CHECK STATUS FLAGS =================
|
// ================= CHECK STATUS FLAGS =================
|
||||||
|
|
@ -229,115 +69,117 @@ const PlanExpireNotification = ({ ss }) => {
|
||||||
);
|
);
|
||||||
}, [AppExpDate]);
|
}, [AppExpDate]);
|
||||||
|
|
||||||
const isExtendExpired = useMemo(() => {
|
const isExtend = useMemo(() => {
|
||||||
return AppExpDate?.PlanType?.toLowerCase() === "extend expired";
|
return AppExpDate?.PlanType?.toLowerCase() === 'extend';
|
||||||
}, [AppExpDate]);
|
}, [AppExpDate]);
|
||||||
|
|
||||||
const isExpiringToday = AppExpDate?.RemainingDays < 1 && !isExpired;
|
const isExpiringToday =
|
||||||
const isExpiringSoon = AppExpDate?.RemainingDays >= 1 && AppExpDate?.RemainingDays <= 30;
|
AppExpDate?.RemainingDays < 1 && !isExpired && !isExtend;
|
||||||
|
const isExpiringSoon =
|
||||||
|
AppExpDate?.RemainingDays >= 1 &&
|
||||||
|
AppExpDate?.RemainingDays <= 30 &&
|
||||||
|
!isExtend;
|
||||||
|
|
||||||
// ================= AUTO OPEN EXTEND MODAL =================
|
// ================= AUTO OPEN EXTEND MODAL =================
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isExpired && !isExtendExpired) {
|
if (isExpired && !isExtend) {
|
||||||
setExtendModel(true);
|
setExtendModel(true);
|
||||||
}
|
}
|
||||||
}, [isExpired, isExtendExpired]);
|
}, [isExpired, isExtend]);
|
||||||
|
|
||||||
// ================= FREE EXTEND =================
|
|
||||||
const freeExtend = async () => {
|
|
||||||
try {
|
|
||||||
|
|
||||||
const now = new Date();y
|
|
||||||
const currentDate = formatDate(now);
|
|
||||||
|
|
||||||
const response1 = await dispatch(getPurchasedAppDetails({ AppId, UserId })).unwrap();
|
|
||||||
const PurchasedDetails = response1?.data?.data;
|
|
||||||
|
|
||||||
if (!PurchasedDetails?.length) return;
|
|
||||||
|
|
||||||
const postData = {
|
|
||||||
UserId,
|
|
||||||
AppId,
|
|
||||||
PricingId: PurchasedDetails[0]?.PricingId,
|
|
||||||
PurDate: currentDate,
|
|
||||||
NoofDays: 30,
|
|
||||||
PaymentMode: 27,
|
|
||||||
PaymentStatus: "S",
|
|
||||||
LicenseStatus: PurchasedDetails[0]?.LicenseStatus,
|
|
||||||
Price: PurchasedDetails[0]?.Price ?? 0,
|
|
||||||
TaxId: PurchasedDetails[0]?.TaxId ?? 0,
|
|
||||||
NetPrice: PurchasedDetails[0]?.ExistingPlanNetPrice ?? 0,
|
|
||||||
ValidityStart: currentDate,
|
|
||||||
ValidityEnd: addDays(currentDate, PurchasedDetails[0]?.NoOfDays),
|
|
||||||
CreatedBy: UserId,
|
|
||||||
TaxAmount: PurchasedDetails[0]?.TaxAmount ?? 0,
|
|
||||||
MobileNo: getSession("MobileNo"),
|
|
||||||
MailId: "ts@gmail.com",
|
|
||||||
Type: "FreeExtend"
|
|
||||||
};
|
|
||||||
|
|
||||||
const response = await dispatch(postInvoice(postData)).unwrap();
|
|
||||||
|
|
||||||
if (response?.data?.statusCode === 1 && response?.data?.SMSbody) {
|
|
||||||
await dispatch(sendSms({ body: response.data.SMSbody }));
|
|
||||||
setExtendModel(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
console.error("freeExtend error:", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
Logout();
|
Logout();
|
||||||
setExtendModel(false);
|
setExtendModel(false);
|
||||||
};
|
};
|
||||||
const Logout = async () => {
|
const Logout = async () => {
|
||||||
const UserId = UserId;
|
|
||||||
const status = 'N';
|
const status = 'N';
|
||||||
try {
|
try {
|
||||||
const res = await dispatch(GenerateLogout({ UserId, status })).unwrap();
|
const res = await dispatch(GenerateLogout({ UserId, status })).unwrap();
|
||||||
if (res?.data?.statusCode === 1) {
|
if (res?.data?.statusCode === 1) {
|
||||||
sessionStorage.clear();
|
sessionStorage.clear();
|
||||||
window.location.replace(`${commonSubDir}`);
|
window.location.replace(`${commonDirectory}`);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Logout failed:', error);
|
console.error('Logout failed:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const handlePay = () => {
|
const handlePay = async () => {
|
||||||
setExtendModel(false);
|
const response1 = await dispatch(
|
||||||
navigate(`${subDirectory}PricingPage`, { state: { AppName: getSession("AppName") } });
|
getPurchasedAppDetails({ AppId, UserId })
|
||||||
|
).unwrap();
|
||||||
|
const PurchasedDetails = response1?.data?.data;
|
||||||
|
let data = {
|
||||||
|
MN: SessionMobileNo,
|
||||||
|
UN: UserName,
|
||||||
|
UD: UserId,
|
||||||
|
UT: UserType,
|
||||||
|
CD: CompId,
|
||||||
|
SD: SessionId || '',
|
||||||
|
AU: AuthToken,
|
||||||
|
Plandetails: PurchasedDetails?.[0],
|
||||||
|
};
|
||||||
|
const encrypted = encryptObject(data);
|
||||||
|
const postData = { Url: encrypted, CreatedBy: UserId };
|
||||||
|
try {
|
||||||
|
const res = await dispatch(PublicQrCodepost(postData)).unwrap();
|
||||||
|
// navigate(`${commonDirectory}invoice-details`);
|
||||||
|
if (res?.data?.statusCode == 1) {
|
||||||
|
navigate(`${commonDirectory}invoice-details/${res?.data?.ReferenceNo}`);
|
||||||
|
setExtendModel(false);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error generating QR code:', error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// ================= UI BLOCKS =================
|
// ================= UI BLOCKS =================
|
||||||
const ExpiredBlock = () => (
|
const ExpiredBlock = () => (
|
||||||
<span className="ExpiredMessage">
|
<div
|
||||||
|
className="ExpiredMessage"
|
||||||
|
style={{
|
||||||
|
backgroundColor: '#ff4d4f',
|
||||||
|
color: '#fff',
|
||||||
|
fontSize: '13px',
|
||||||
|
fontWeight: '500',
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
width: '100%',
|
||||||
|
}}
|
||||||
|
>
|
||||||
Subscription expired
|
Subscription expired
|
||||||
<a onClick={navigatePublicFun} className="upgrdbtn">
|
<a onClick={handlePay} className="upgrdbtn">
|
||||||
RENEWAL NOW <ArrowUpOutlined />
|
RENEWAL NOW <ArrowUpOutlined />
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
const ExpiringTodayBlock = () => (
|
const ExpiringTodayBlock = () => (
|
||||||
<p>
|
<p>
|
||||||
Your application subscription will expire within
|
Your application subscription will expire within
|
||||||
<span className="Expired">
|
<span className="Expired">
|
||||||
{AppExpDate?.RemainingHours >= 1 ? AppExpDate?.RemainingHours : AppExpDate?.RemainingMinutes}
|
{AppExpDate?.RemainingHours >= 1
|
||||||
</span>{" "}
|
? AppExpDate?.RemainingHours
|
||||||
{AppExpDate?.RemainingHours >= 1 ? "Hrs" : "Min"}
|
: AppExpDate?.RemainingMinutes}
|
||||||
<a onClick={navigateFun} className="upgrdbtn">
|
</span>{' '}
|
||||||
|
{AppExpDate?.RemainingHours >= 1 ? 'Hrs' : 'Min'}
|
||||||
|
<a onClick={handlePay} className="upgrdbtn">
|
||||||
RENEWAL NOW <ArrowUpOutlined />
|
RENEWAL NOW <ArrowUpOutlined />
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
|
|
||||||
const ExpiringDaysBlock = () => (
|
const ExpiringDaysBlock = () => (
|
||||||
<p>
|
<p
|
||||||
|
style={{
|
||||||
|
backgroundColor: '#ff4d4f',
|
||||||
|
color: '#fff',
|
||||||
|
fontSize: '13px',
|
||||||
|
fontWeight: '500',
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
}}
|
||||||
|
>
|
||||||
Your application subscription will expire within
|
Your application subscription will expire within
|
||||||
<span className="NosDays">{AppExpDate?.RemainingDays}</span> days.
|
<span className="NosDays">{AppExpDate?.RemainingDays}</span> days.
|
||||||
<a onClick={navigateFun} className="upgrdbtn">
|
<a onClick={handlePay} className="upgrdbtn">
|
||||||
RENEWAL NOW <ArrowUpOutlined />
|
RENEWAL NOW <ArrowUpOutlined />
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -346,8 +188,9 @@ const PlanExpireNotification = ({ ss }) => {
|
||||||
// ================= RETURN =================
|
// ================= RETURN =================
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={ss}>
|
{/* <div className={ ss : 'dd'}> */}
|
||||||
{isExpired && isExtendExpired && <ExpiredBlock />}
|
<div className={isExtend ? 'dd' : ss} style={{ width: '100%' }}>
|
||||||
|
{isExtend && <ExpiredBlock />}
|
||||||
|
|
||||||
{isExpiringToday && <ExpiringTodayBlock />}
|
{isExpiringToday && <ExpiringTodayBlock />}
|
||||||
|
|
||||||
|
|
@ -357,8 +200,9 @@ const PlanExpireNotification = ({ ss }) => {
|
||||||
{extendModel && (
|
{extendModel && (
|
||||||
<ExtendSubscriptionModal
|
<ExtendSubscriptionModal
|
||||||
onClose={handleCancel}
|
onClose={handleCancel}
|
||||||
onPayNow={handlePay}
|
setExtendModel={setExtendModel}
|
||||||
onContinueWithCredits={freeExtend}
|
// onPayNow={handlePay}
|
||||||
|
// onContinueWithCredits={freeExtend}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,124 @@
|
||||||
import { Tooltip } from "antd";
|
import { Tooltip } from "antd";
|
||||||
import "./extendSubscribtionModel.scss";
|
import "./extendSubscribtionModel.scss";
|
||||||
import { IoClose } from "react-icons/io5";
|
import { IoClose } from "react-icons/io5";
|
||||||
|
import { getPurchasedAppDetails, postInvoice } from "../../Features/BookingScreen/Pricing/Pricing";
|
||||||
|
import { GlobalAppExpDateData } from "../../Features/BookingScreen/BookingData/BookingData";
|
||||||
|
import { StoredSessionData } from "../../Features/ThemeChange/ThemeChange";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
|
import { sendSms } from "../../Features/Payment/PaymentDetails/PaymentDetails";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
import { encryptObject } from "../../Services/Others";
|
||||||
|
import { PublicQrCodepost } from "../../Features/ConfigMasterPage/ConfigMasterPage";
|
||||||
|
|
||||||
const ExtendSubscriptionModal = ({
|
const ExtendSubscriptionModal = ({
|
||||||
onClose,
|
onClose,
|
||||||
onPayNow,
|
|
||||||
onContinueWithCredits
|
|
||||||
}) => {
|
}) => {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const SessionData = useSelector(StoredSessionData);
|
||||||
|
const {
|
||||||
|
AppId,
|
||||||
|
UserId,
|
||||||
|
AppName,
|
||||||
|
SessionId,
|
||||||
|
AuthToken,
|
||||||
|
CompId,
|
||||||
|
SessionMobileNo,
|
||||||
|
UserName,
|
||||||
|
UserType,
|
||||||
|
} = SessionData;
|
||||||
|
// ================= DATE FORMAT =================
|
||||||
|
const formatDate = (dateStr) => {
|
||||||
|
const date = new Date(dateStr);
|
||||||
|
return `${String(date.getDate()).padStart(2, '0')}-${String(date.getMonth() + 1).padStart(2, '0')}-${date.getFullYear()}`;
|
||||||
|
};
|
||||||
|
// ================= DATE ADDITION =================
|
||||||
|
function addDays(dateString, days) {
|
||||||
|
// Make it ISO-safe for iOS / WebView
|
||||||
|
const isoDate = dateString.replace(' ', 'T');
|
||||||
|
const currentDate = new Date(isoDate);
|
||||||
|
|
||||||
|
currentDate.setDate(currentDate.getDate() + Number(days));
|
||||||
|
|
||||||
|
return formatDate(currentDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ================= FREE EXTEND =================
|
||||||
|
const freeExtend = async () => {
|
||||||
|
try {
|
||||||
|
const now = new Date();
|
||||||
|
const currentDate = formatDate(now);
|
||||||
|
|
||||||
|
const response1 = await dispatch(
|
||||||
|
getPurchasedAppDetails({ AppId, UserId })
|
||||||
|
).unwrap();
|
||||||
|
const PurchasedDetails = response1?.data?.data;
|
||||||
|
|
||||||
|
if (!PurchasedDetails?.length) return;
|
||||||
|
|
||||||
|
const postData = {
|
||||||
|
UserId,
|
||||||
|
AppId,
|
||||||
|
PricingId: PurchasedDetails[0]?.PricingId,
|
||||||
|
PurDate: currentDate,
|
||||||
|
NoofDays: 30,
|
||||||
|
PaymentMode: 27,
|
||||||
|
PaymentStatus: 'S',
|
||||||
|
LicenseStatus: PurchasedDetails[0]?.LicenseStatus,
|
||||||
|
Price: PurchasedDetails[0]?.Price ?? 0,
|
||||||
|
TaxId: PurchasedDetails[0]?.TaxId ?? 0,
|
||||||
|
NetPrice: PurchasedDetails[0]?.ExistingPlanNetPrice ?? 0,
|
||||||
|
ValidityStart: currentDate,
|
||||||
|
ValidityEnd: addDays(currentDate, PurchasedDetails[0]?.NoOfDays),
|
||||||
|
CreatedBy: UserId,
|
||||||
|
TaxAmount: PurchasedDetails[0]?.TaxAmount ?? 0,
|
||||||
|
MobileNo: SessionMobileNo,
|
||||||
|
MailId: 'ts@gmail.com',
|
||||||
|
Type: 'FreeExtend',
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await dispatch(postInvoice(postData)).unwrap();
|
||||||
|
|
||||||
|
if (response?.data?.statusCode === 1 && response?.data?.SMSbody) {
|
||||||
|
await dispatch(sendSms({ body: response.data.SMSbody }));
|
||||||
|
setExtendModel(false)
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('freeExtend error:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePay = async () => {
|
||||||
|
const response1 = await dispatch(
|
||||||
|
getPurchasedAppDetails({ AppId, UserId })
|
||||||
|
).unwrap();
|
||||||
|
const PurchasedDetails = response1?.data?.data;
|
||||||
|
let data = {
|
||||||
|
MN: SessionMobileNo,
|
||||||
|
UN: UserName,
|
||||||
|
UD: UserId,
|
||||||
|
UT: UserType,
|
||||||
|
CD: CompId,
|
||||||
|
SD: SessionId || "3308120220260447406469360642222",
|
||||||
|
AU: AuthToken,
|
||||||
|
Plandetails: PurchasedDetails?.[0],
|
||||||
|
};
|
||||||
|
const encrypted = encryptObject(data);
|
||||||
|
const postData = { Url: encrypted, CreatedBy: UserId };
|
||||||
|
try{
|
||||||
|
const res = await dispatch(PublicQrCodepost(postData)).unwrap();
|
||||||
|
// navigate(`${commonDirectory}invoice-details`);
|
||||||
|
if (res?.data?.statusCode == 1) {
|
||||||
|
navigate(`${commonDirectory}invoice-details/${res?.data?.ReferenceNo}`);
|
||||||
|
setExtendModel(false)
|
||||||
|
|
||||||
|
}
|
||||||
|
}catch(error){console.error('Error generating QR code:', error); }
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="extendmodal-backdrop">
|
<div className="extendmodal-backdrop">
|
||||||
<div className="extendmodal">
|
<div className="extendmodal">
|
||||||
|
|
@ -28,14 +140,14 @@ const ExtendSubscriptionModal = ({
|
||||||
<div className="extendmodal-actions">
|
<div className="extendmodal-actions">
|
||||||
<button
|
<button
|
||||||
className="CreditsBTN"
|
className="CreditsBTN"
|
||||||
onClick={onContinueWithCredits}
|
onClick={freeExtend}
|
||||||
>
|
>
|
||||||
Continue with Credits
|
Continue with Credits
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
className="PayNowBTN"
|
className="PayNowBTN"
|
||||||
onClick={onPayNow}
|
onClick={handlePay}
|
||||||
>
|
>
|
||||||
Pay Now
|
Pay Now
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue