Merge pull request 'Optimization Code' (#161) from FridayOptim into main

Reviewed-on: Pozomind/pozo-retail-app#161
This commit is contained in:
karthikalakshmi 2026-02-23 12:21:21 +05:30
commit f717c55f67
46 changed files with 29098 additions and 25396 deletions

796
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -53,6 +53,9 @@ export default function AddProduct({ products, setProducts }) {
return ( return (
<div className="add-product__container"> <div className="add-product__container">
<div className="add-product__header"> <div className="add-product__header">
<div>
Add Product
</div>
<button className="add-product__add-btn" onClick={addRow}>+ Add Row</button> <button className="add-product__add-btn" onClick={addRow}>+ Add Row</button>
</div> </div>

View File

@ -1,9 +1,11 @@
import React from 'react'; import React, { lazy } from 'react';
import { DefaultModal } from './DefaultModal'; import { DefaultModal } from './DefaultModal';
import StockReceived from '../../Pages/StockTransfer/StockReceived';
import Buttons from '../Forms/Buttons'; import Buttons from '../Forms/Buttons';
import { BiPlus } from 'react-icons/bi'; import { BiPlus } from 'react-icons/bi';
import { ArrowRightOutlined } from '@ant-design/icons'; import { ArrowRightOutlined } from '@ant-design/icons';
const StockReceived = lazy(
() => import('../../Pages/StockTransfer/StockReceived.jsx')
);
const ProductDetailsModal = ({ const ProductDetailsModal = ({
open, open,
@ -11,7 +13,7 @@ const ProductDetailsModal = ({
productDetails, productDetails,
headerData, headerData,
onDataChange, onDataChange,
onSubmit onSubmit,
}) => { }) => {
return ( return (
<DefaultModal <DefaultModal
@ -23,17 +25,34 @@ const ProductDetailsModal = ({
> >
<div style={{ overflowX: 'auto' }}> <div style={{ overflowX: 'auto' }}>
{headerData && ( {headerData && (
<div style={{ <div
display: 'flex', style={{
gap: '20px', display: 'flex',
marginBottom: '15px', gap: '20px',
padding: '10px', marginBottom: '15px',
backgroundColor: '#f5f5f5', padding: '10px',
borderRadius: '4px' backgroundColor: '#f5f5f5',
}}> borderRadius: '4px',
<div><strong>Dispatch Id:</strong> <span style={{fontSize:"12px"}}> {headerData.Dispatch_Id} </span> </div> }}
<div><strong>Date & Time:</strong> <span style={{fontSize:"12px"}}> {headerData.dateTime} </span></div> >
<div><strong>From Branch:</strong> <span style={{fontSize:"12px"}}> {headerData.fromBranch} </span> </div> <div>
<strong>Dispatch Id:</strong>{' '}
<span style={{ fontSize: '12px' }}>
{' '}
{headerData.Dispatch_Id}{' '}
</span>{' '}
</div>
<div>
<strong>Date & Time:</strong>{' '}
<span style={{ fontSize: '12px' }}> {headerData.dateTime} </span>
</div>
<div>
<strong>From Branch:</strong>{' '}
<span style={{ fontSize: '12px' }}>
{' '}
{headerData.fromBranch}{' '}
</span>{' '}
</div>
{/* <div><strong>dispatched By</strong> {headerData.Created_By}</div> */} {/* <div><strong>dispatched By</strong> {headerData.Created_By}</div> */}
</div> </div>
)} )}
@ -43,12 +62,14 @@ const ProductDetailsModal = ({
editable={true} editable={true}
/> />
<div style={{ <div
display: "flex", style={{
alignItems: "center", display: 'flex',
paddingTop: "10px", alignItems: 'center',
flexDirection: "row-reverse" paddingTop: '10px',
}}> flexDirection: 'row-reverse',
}}
>
<Buttons <Buttons
buttonText={'SUBMIT'} buttonText={'SUBMIT'}
handleSubmit={onSubmit} handleSubmit={onSubmit}
@ -63,4 +84,4 @@ const ProductDetailsModal = ({
); );
}; };
export default ProductDetailsModal; export default ProductDetailsModal;

View File

@ -1,14 +1,14 @@
import React from 'react'; import React from 'react';
import { DefaultModal } from './DefaultModal'; import { DefaultModal } from './DefaultModal';
import { Tables } from '../Tables/Table'; import { Tables } from '../Tables/Table';
import "./ReceivedStockModel.scss" import './ReceivedStockModel.scss';
const ReceivedStocksModal = ({ const ReceivedStocksModal = ({
open, open,
onClose, onClose,
columns, columns,
tableData, tableData,
handlePageChange, handlePageChange,
customTable = false customTable = false,
}) => { }) => {
const renderCell = (column, row, index) => { const renderCell = (column, row, index) => {
if (column.render) { if (column.render) {
@ -28,24 +28,32 @@ const ReceivedStocksModal = ({
className={'receive-stocks-modal'} className={'receive-stocks-modal'}
> >
<> <>
{!customTable && (
{!customTable && <div style={{overflowX:"auto"}}> <div style={{ overflowX: 'auto' }}>
<Tables
<Tables columns={columns}
columns={columns} data={tableData}
data={tableData} dataSource={tableData}
dataSource={tableData} pagination={handlePageChange}
pagination={handlePageChange} />
/> </div>
</div>} )}
{ {customTable && (
customTable && <div className="ReceivedStocksModalMaster">
<div className="ReceivedStocksModalMaster" > <table style={{ width: '100%' }}>
<table style={{ width: "100%" }}>
<thead> <thead>
<tr> <tr>
{columns.map((column) => ( {columns.map((column) => (
<th key={column.key} style={{ textAlign: column.align, width: column.width, backgroundColor: '#f0f8ff', fontFamily: "poppins", fontWeight: "450" }}> <th
key={column.key}
style={{
textAlign: column.align,
width: column.width,
backgroundColor: '#f0f8ff',
fontFamily: 'poppins',
fontWeight: '450',
}}
>
{column.title?.toUpperCase()} {column.title?.toUpperCase()}
</th> </th>
))} ))}
@ -53,9 +61,12 @@ const ReceivedStocksModal = ({
</thead> </thead>
<tbody> <tbody>
{tableData.map((row, index) => ( {tableData.map((row, index) => (
<tr key={row.key || index} style={{ fontSize: "13px" }}> <tr key={row.key || index} style={{ fontSize: '13px' }}>
{columns.map((column) => ( {columns.map((column) => (
<td key={column.key} style={{ textAlign: column.align, width: column.width }}> <td
key={column.key}
style={{ textAlign: column.align, width: column.width }}
>
{renderCell(column, row, index)} {renderCell(column, row, index)}
</td> </td>
))} ))}
@ -64,13 +75,10 @@ const ReceivedStocksModal = ({
</tbody> </tbody>
</table> </table>
</div> </div>
} )}
</> </>
</DefaultModal> </DefaultModal>
); );
}; };
export default ReceivedStocksModal; export default ReceivedStocksModal;

View File

@ -149,6 +149,16 @@ export const getConfigType = createAsyncThunk(
} }
} }
); );
export const getConfigTypeBookingType = createAsyncThunk(
'BookingData/getConfigTypeBookingType',
async ({ TypeName }) => {
if (TypeName != null && TypeName != undefined) {
return await axiosRetailInstanceData.get(
`/configMaster?TypeName=${TypeName}`
);
}
}
);
export const PostBookingData = createAsyncThunk( export const PostBookingData = createAsyncThunk(
'BookingData/PostBookingdata', 'BookingData/PostBookingdata',
async (postData) => { async (postData) => {
@ -682,7 +692,6 @@ export const getSelectedFavItems = createAsyncThunk(
if (fromDate) params.append('fromDate', fromDate); if (fromDate) params.append('fromDate', fromDate);
if (toDate) params.append('toDate', toDate); if (toDate) params.append('toDate', toDate);
// let url = `/productCardList?CompId=${data?.CompId}&BranchId=${data?.BranchId}&AppId=${data?.AppId}&Type=A`; // let url = `/productCardList?CompId=${data?.CompId}&BranchId=${data?.BranchId}&AppId=${data?.AppId}&Type=A`;
return await axiosRetailInstanceData.get( return await axiosRetailInstanceData.get(
`/productCardList?${params.toString()}` `/productCardList?${params.toString()}`
); );
@ -858,7 +867,6 @@ export const getCardDataWithoutSubmodule = createAsyncThunk(
? { fromDate: data?.fromDate, toDate: data?.toDate } ? { fromDate: data?.fromDate, toDate: data?.toDate }
: {}), : {}),
}); });
return await axiosRetailInstanceData.get( return await axiosRetailInstanceData.get(
`/productCardList?${params.toString()}` `/productCardList?${params.toString()}`
); );
@ -1609,7 +1617,8 @@ const initialState = {
salesBillEdit: false, salesBillEdit: false,
previousOrderPayment: [], previousOrderPayment: [],
previousOrderOfferDetails: [], previousOrderOfferDetails: [],
getmultipleSearchDatas: [] getmultipleSearchDatas: [],
AllBookingType: [],
}; };
const BookingData = createSlice({ const BookingData = createSlice({
@ -1981,6 +1990,13 @@ const BookingData = createSlice({
state.ItemCard = []; state.ItemCard = [];
} }
}), }),
builder.addCase(getConfigTypeBookingType.fulfilled, (state, action) => {
if (action?.payload?.data?.statusCode === 1) {
state.AllBookingType = action?.payload?.data?.data;
} else {
state.AllBookingType = [];
}
}),
builder.addCase(getLayoutsearch.fulfilled, (state, action) => { builder.addCase(getLayoutsearch.fulfilled, (state, action) => {
if (action?.payload?.data?.statusCode === 1) { if (action?.payload?.data?.statusCode === 1) {
state.ItemCard = action?.payload?.data?.data; state.ItemCard = action?.payload?.data?.data;
@ -2113,7 +2129,10 @@ const BookingData = createSlice({
}); });
builder.addCase(getmultipleSearch.fulfilled, (state, action) => { builder.addCase(getmultipleSearch.fulfilled, (state, action) => {
if (action?.payload?.data?.statusCode === 1) { if (action?.payload?.data?.statusCode === 1) {
state.getmultipleSearchDatas = action?.payload?.data?.data[0]?.SearchTermDtl?.map((e) => e?.SearchTerm) || []; state.getmultipleSearchDatas =
action?.payload?.data?.data[0]?.SearchTermDtl?.map(
(e) => e?.SearchTerm
) || [];
} else { } else {
state.getmultipleSearchDatas = []; state.getmultipleSearchDatas = [];
} }
@ -2220,7 +2239,7 @@ export const {
triggerProductCard, triggerProductCard,
changeBillEditingMode, changeBillEditingMode,
changePreviousOrderPayment, changePreviousOrderPayment,
changePreviousOrderOfferDetail changePreviousOrderOfferDetail,
} = BookingData.actions; } = BookingData.actions;
export const GlobalComboRedirectionToDefaultLayoutForParking = (state) => export const GlobalComboRedirectionToDefaultLayoutForParking = (state) =>
@ -2389,13 +2408,14 @@ export const GlobalAddBookingDetailsTrigger = (state) =>
state?.BookingData?.AddBookingDetailsTrigger; state?.BookingData?.AddBookingDetailsTrigger;
export const GlobalCurrentOrderId = (state) => export const GlobalCurrentOrderId = (state) =>
state?.BookingData?.CurrentOrderId; state?.BookingData?.CurrentOrderId;
export const GlobalSalesBillEdit = (state) => export const GlobalSalesBillEdit = (state) => state?.BookingData?.salesBillEdit;
state?.BookingData?.salesBillEdit;
export const GlobalPreviousOrderPayment = (state) => export const GlobalPreviousOrderPayment = (state) =>
state?.BookingData?.previousOrderPayment; state?.BookingData?.previousOrderPayment;
export const GlobalPreviousOrderOfferDetails = (state) => export const GlobalPreviousOrderOfferDetails = (state) =>
state?.BookingData?.previousOrderOfferDetails; state?.BookingData?.previousOrderOfferDetails;
export const GlobalGetmultipleSearchDatas = (state) => export const GlobalGetmultipleSearchDatas = (state) =>
state?.BookingData?.getmultipleSearchDatas; state?.BookingData?.getmultipleSearchDatas;
export const GlobalAllBookingType = (state) =>
state?.BookingData?.AllBookingType;
export default BookingData.reducer; export default BookingData.reducer;

View File

@ -77,7 +77,7 @@ export const putPaymentOptions = createAsyncThunk(
} }
); );
export const getPaymentUPIDetails = createAsyncThunk( export const getPaymentUPIDetails = createAsyncThunk(
'getPaymentGatewayDetails', 'getPaymentGatewayDetails',
async ({ CompId, AppId, BranchId, DetailType }) => { async ({ CompId, AppId, BranchId, DetailType }) => {
if ( if (
CompId != undefined && CompId != undefined &&

View File

@ -465,8 +465,8 @@ const WholesaleData = createSlice({
state.WholeSaleEntryList = action?.payload; state.WholeSaleEntryList = action?.payload;
}, },
changeWholeSaleSelectedEntryDtl: (state, action) => { changeWholeSaleSelectedEntryDtl: (state, action) => {
(state.WholeSaleSelectedEntryDtl = action?.payload), ((state.WholeSaleSelectedEntryDtl = action?.payload),
(state.WholeSaleSelectedProdDtl = [action?.payload?.ProdDetails?.[0]]); (state.WholeSaleSelectedProdDtl = [action?.payload?.ProdDetails?.[0]]));
state.WholeSaleSelectedGradeDtl = [ state.WholeSaleSelectedGradeDtl = [
action?.payload?.ProdDetails?.[0].GradeDetails?.[0], action?.payload?.ProdDetails?.[0].GradeDetails?.[0],
]; ];
@ -513,7 +513,7 @@ const WholesaleData = createSlice({
}, },
}, },
extraReducers: (builder) => { extraReducers: (builder) => {
builder.addCase(getWholeSaleSupplier.fulfilled, (state, action) => { (builder.addCase(getWholeSaleSupplier.fulfilled, (state, action) => {
if (action?.payload?.data?.statusCode == 1) { if (action?.payload?.data?.statusCode == 1) {
state.SupplierDetails = action?.payload?.data?.data; state.SupplierDetails = action?.payload?.data?.data;
} else { } else {
@ -636,7 +636,7 @@ const WholesaleData = createSlice({
} else { } else {
state.WSBookingStatus = []; state.WSBookingStatus = [];
} }
}); }));
}, },
}); });
export const { export const {

View File

@ -1,11 +1,8 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect, lazy, Suspense } from 'react';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import { Button, Popover } from 'antd'; import { Button, Popover } from 'antd';
import { AiOutlineClose } from 'react-icons/ai'; import { AiOutlineClose } from 'react-icons/ai';
import { IoIosArrowUp } from 'react-icons/io'; import { IoIosArrowUp } from 'react-icons/io';
import BSBillingTable1 from '../BSBillingTable1/BSBillingTable1';
import BST1Payment from '../BSBillingTable1/BST1Payment';
import BSSummery from '../BSBillingTableSummery/BSSummery';
import { import {
GlobalCustId, GlobalCustId,
GlobalSelOption, GlobalSelOption,
@ -14,13 +11,23 @@ import {
GlobalOrderStatus, GlobalOrderStatus,
} from '../../../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../../../Features/BookingScreen/BookingData/BookingData';
import '../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBTOverall.scss'; import '../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBTOverall.scss';
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
import BSCustomerSelect from '../../UtillComponents/BSSelectCustomer.jsx';
import PozoAddCustomerIcon from '../../UtillComponents/Pozo retail icons/PozoAddCustomerIcon'; import PozoAddCustomerIcon from '../../UtillComponents/Pozo retail icons/PozoAddCustomerIcon';
import { isMobile } from 'react-device-detect'; import { isMobile } from 'react-device-detect';
import { getTemplateData } from '../../../../../Features/ThemeChange/ThemeChange.js'; import { getTemplateData } from '../../../../../Features/ThemeChange/ThemeChange.js';
import PozoCartIcon from '../../../../../Pages/BookingScreen/Components/UtillComponents/PozoCartIcon.jsx'; import PozoCartIcon from '../../../../../Pages/BookingScreen/Components/UtillComponents/PozoCartIcon.jsx';
import TooltipWrapper from '../../../../../Components/Tooltip/Tooltip'; import TooltipWrapper from '../../../../../Components/Tooltip/Tooltip';
// jsx File
const BSBillingTable1 = lazy(
() => import('../BSBillingTable1/BSBillingTable1.jsx')
);
const BST1Payment = lazy(() => import('../BSBillingTable1/BST1Payment'));
const BSSummery = lazy(() => import('../BSBillingTableSummery/BSSummery'));
const FeaturesFunctionalities = lazy(
() => import('../../BookingFunctionality/FeaturesFunctionalities')
);
const BSCustomerSelect = lazy(
() => import('../../UtillComponents/BSSelectCustomer.jsx')
);
export default function BSBTOverall1() { export default function BSBTOverall1() {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
@ -73,7 +80,7 @@ export default function BSBTOverall1() {
containerHeight = isMobile containerHeight = isMobile
? ExpDate <= 7 ? ExpDate <= 7
? '490px' ? '490px'
: '475px' // billing table 1 height in POS : '475px' // billing table 1 height in POS
: ExpDate <= 7 : ExpDate <= 7
? '85vh' ? '85vh'
: ''; : '';
@ -121,126 +128,132 @@ export default function BSBTOverall1() {
}, [width]); }, [width]);
return ( return (
<> <Suspense fallback={<div>Loading</div>}>
<div <>
className={ <div
templateData?.BookingLayout?.[0] === 'Layout6' className={
? 'BSBTOverall1-Default layout6-height' templateData?.BookingLayout?.[0] === 'Layout6'
: 'BSBTOverall1-Default' ? 'BSBTOverall1-Default layout6-height'
} : 'BSBTOverall1-Default'
style={{ height: containerHeight }} }
> style={{ height: containerHeight }}
{width > 768 && <BSBillingTable1 />} >
{(addcustomer || hold) && ( {width > 768 && <BSBillingTable1 />}
<FeaturesFunctionalities {(addcustomer || hold) && (
handleAddCustomerCancel={handleAddCustomerCancel} <FeaturesFunctionalities
addcustomer={addcustomer} handleAddCustomerCancel={handleAddCustomerCancel}
handleHoldCancel={handleHoldCancel} addcustomer={addcustomer}
modalOpen={hold} handleHoldCancel={handleHoldCancel}
/> modalOpen={hold}
)} />
<div className="BSBTOverall1-div">
{width <= 768 && (
<div
className={`BSBillingTable1-summeryTable ${responsiveBill ? 'open' : 'closed'}`}
style={{
transition: 'max-height 0.3s ease-in-out',
overflow: 'scroll',
maxHeight: responsiveBill ? '210px' : '0px',
}}
>
{tableData && <BSBillingTable1 />}
</div>
)} )}
<div className="BSBTOverall1-Default-summary"> <div className="BSBTOverall1-div">
{summeryopen == true && ( {width <= 768 && (
<div className="BSBillingTable1-summary">
<button
className="BSBillingTable1-summary-close"
onClick={() => {
setSummeryopen(false);
}}
>
X
</button>
</div>
)}
<Popover
content={
open && (
<>
<a onClick={hide}>
<AiOutlineClose color="black" />
</a>
<BSSummery />
</>
)
}
trigger="click"
open={open}
onOpenChange={handleOpenChange}
>
<Button className="icon-button" onClick={handleOpenChange}>
SUMMARY <IoIosArrowUp />
</Button>
</Popover>
<div className="CustomerAddSrch">
<div style={{ height: '2.1rem' }}>
{tableOptions.find(
(item) => item.OptionName === 'AddCustomer'
) && (
<div
style={{
display: 'flex',
alignItems: 'center',
columnGap: '0.5rem',
}}
>
<BSCustomerSelect />
<TooltipWrapper title={'Add Customer'} isMobile={isMobile}>
{' '}
<PozoAddCustomerIcon
className="BSBillingNav-icon-table-icon"
onClick={handleAddCustomer}
style={{
fontSize: '25px',
color: selOption || GetCustId ? '#52c41a' : '#1292EE',
cursor: Custdisable ? 'not-allowed' : 'pointer',
}}
/>
</TooltipWrapper>
</div>
)}
</div>
</div>
{tableData && (
<div <div
onClick={handleResponsiveBill} className={`BSBillingTable1-summeryTable ${responsiveBill ? 'open' : 'closed'}`}
className="Btn-responsiveBill" style={{
style={{ color: responsiveBill ? '#52c41a' : '#1292ee' }} transition: 'max-height 0.3s ease-in-out',
overflow: 'scroll',
maxHeight: responsiveBill ? '210px' : '0px',
}}
> >
{width <= 768 && ( {tableData && <BSBillingTable1 />}
<div
style={{
width: '28px',
display: 'flex',
alignItems: 'center',
height: '26px',
}}
>
<PozoCartIcon />
</div>
)}
</div> </div>
)} )}
</div> <div className="BSBTOverall1-Default-summary">
<div> {summeryopen == true && (
<BST1Payment /> <div className="BSBillingTable1-summary">
<button
className="BSBillingTable1-summary-close"
onClick={() => {
setSummeryopen(false);
}}
>
X
</button>
</div>
)}
<Popover
content={
open && (
<>
<a onClick={hide}>
<AiOutlineClose color="black" />
</a>
<BSSummery />
</>
)
}
trigger="click"
open={open}
onOpenChange={handleOpenChange}
>
<Button className="icon-button" onClick={handleOpenChange}>
SUMMARY <IoIosArrowUp />
</Button>
</Popover>
<div className="CustomerAddSrch">
<div style={{ height: '2.1rem' }}>
{tableOptions.find(
(item) => item.OptionName === 'AddCustomer'
) && (
<div
style={{
display: 'flex',
alignItems: 'center',
columnGap: '0.5rem',
}}
>
<BSCustomerSelect />
<TooltipWrapper
title={'Add Customer'}
isMobile={isMobile}
>
{' '}
<PozoAddCustomerIcon
className="BSBillingNav-icon-table-icon"
onClick={handleAddCustomer}
style={{
fontSize: '25px',
color:
selOption || GetCustId ? '#52c41a' : '#1292EE',
cursor: Custdisable ? 'not-allowed' : 'pointer',
}}
/>
</TooltipWrapper>
</div>
)}
</div>
</div>
{tableData && (
<div
onClick={handleResponsiveBill}
className="Btn-responsiveBill"
style={{ color: responsiveBill ? '#52c41a' : '#1292ee' }}
>
{width <= 768 && (
<div
style={{
width: '28px',
display: 'flex',
alignItems: 'center',
height: '26px',
}}
>
<PozoCartIcon />
</div>
)}
</div>
)}
</div>
<div>
<BST1Payment />
</div>
</div> </div>
</div> </div>
</div> </>
</> </Suspense>
); );
} }

View File

@ -10,16 +10,13 @@ import {
ChangeTotalAmount, ChangeTotalAmount,
globalExtraTotalAmount, globalExtraTotalAmount,
} from '../../../../../Features/ExteraCharges/ExtraCharges.js'; } from '../../../../../Features/ExteraCharges/ExtraCharges.js';
import BSBillingEditQuantity from '../BSBillingEditQuantity/BSBillingEditQuantity';
import { import {
changeholddata, changeholddata,
gettinghold, gettinghold,
puttinghold, puttinghold,
} from '../../../../../Features/BookingScreen/HoldOption/HoldOption.js'; } from '../../../../../Features/BookingScreen/HoldOption/HoldOption.js';
import { getCustomerDisplayWindow } from '../../../../../Features/customerDisplayWindow/customerDisplayWindow.js'; import { getCustomerDisplayWindow } from '../../../../../Features/customerDisplayWindow/customerDisplayWindow.js';
import BSEditTotalAmt from '../BSEditTotalAmount/BSEditTotalAmt.jsx';
import { useApplyOfferto_CardDetail } from '../../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx'; import { useApplyOfferto_CardDetail } from '../../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx';
import BSImeiDetails from '../BSImeiDetails/BSImeiDetails.jsx';
import { import {
getTemplateData, getTemplateData,
SelectedGlobalBillingColorDetail, SelectedGlobalBillingColorDetail,
@ -80,6 +77,10 @@ import {
import { useRemoveProducts } from './RemoveCartWithOffer.jsx'; import { useRemoveProducts } from './RemoveCartWithOffer.jsx';
import { useUtilsComponent } from '../../../../../Services/utils.js'; import { useUtilsComponent } from '../../../../../Services/utils.js';
import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx'; import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx';
// jsx Files
import BSBillingEditQuantity from '../BSBillingEditQuantity/BSBillingEditQuantity';
import BSEditTotalAmt from '../BSEditTotalAmount/BSEditTotalAmt.jsx';
import BSImeiDetails from '../BSImeiDetails/BSImeiDetails.jsx';
const BSBillingTable3 = () => { const BSBillingTable3 = () => {
const { removeExtraCharge } = useUtilsComponent(); const { removeExtraCharge } = useUtilsComponent();
@ -123,7 +124,6 @@ const BSBillingTable3 = () => {
const UnpaidData = useSelector(GlobalUnpaidData); const UnpaidData = useSelector(GlobalUnpaidData);
const GlobProdwisedata = useSelector(GlobalSelProdWiseEst); const GlobProdwisedata = useSelector(GlobalSelProdWiseEst);
const ReportholdData = useSelector(GlobalReorderHoldDetails); const ReportholdData = useSelector(GlobalReorderHoldDetails);
const salesBillEdit = useSelector(GlobalSalesBillEdit);
const prodCat = useSelector(GlobalProductCategorie); const prodCat = useSelector(GlobalProductCategorie);
const ProdSubCat = useSelector(GlobalProductSubCategorie); const ProdSubCat = useSelector(GlobalProductSubCategorie);
const [PreviousdataLength, setPreviousdataLength] = const [PreviousdataLength, setPreviousdataLength] =
@ -137,7 +137,8 @@ const BSBillingTable3 = () => {
const GetCustId = useSelector(GlobalCustId); const GetCustId = useSelector(GlobalCustId);
const selectedCustomer = useSelector(GlobalSelOption); const selectedCustomer = useSelector(GlobalSelOption);
const [customerPriceHistoryOpen, setCustomerPriceHistoryOpen] = useState(false); const [customerPriceHistoryOpen, setCustomerPriceHistoryOpen] =
useState(false);
const [customerProduct, setCustomerProduct] = useState(null); const [customerProduct, setCustomerProduct] = useState(null);
const preferenceshortcutkey = preferenceDatas?.[0]?.[ const preferenceshortcutkey = preferenceDatas?.[0]?.[
'SettingDtlDetails' 'SettingDtlDetails'
@ -154,16 +155,16 @@ const BSBillingTable3 = () => {
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([]);
@ -259,7 +260,6 @@ const BSBillingTable3 = () => {
event.preventDefault(); event.preventDefault();
handleShortcut('weightAmount'); handleShortcut('weightAmount');
} }
}; };
window.addEventListener('keydown', handleKeyDown); window.addEventListener('keydown', handleKeyDown);
@ -389,7 +389,7 @@ const BSBillingTable3 = () => {
const handleCustomerProductPriceHistory = (item) => { const handleCustomerProductPriceHistory = (item) => {
setCustomerPriceHistoryOpen(true); setCustomerPriceHistoryOpen(true);
setCustomerProduct(item?.ProdId); setCustomerProduct(item?.ProdId);
} };
function safeRound(amountStr) { function safeRound(amountStr) {
if (amountStr == null) return allowDecimal ? '0.00' : '0'; if (amountStr == null) return allowDecimal ? '0.00' : '0';
@ -1057,9 +1057,9 @@ const BSBillingTable3 = () => {
)?.map((item, idx) => )?.map((item, idx) =>
idx === 0 idx === 0
? { ? {
...item, ...item,
FreeQty, FreeQty,
} }
: item : item
), ),
}; };
@ -1983,7 +1983,6 @@ const BSBillingTable3 = () => {
} }
} }
} }
}; };
// const removeFromCart = async (item) => { // const removeFromCart = async (item) => {
@ -2395,10 +2394,11 @@ const BSBillingTable3 = () => {
{OldtableDataTakeAway?.map((item, index) => ( {OldtableDataTakeAway?.map((item, index) => (
<tr <tr
key={index} key={index}
className={`${item?.SalesId && OrderType !== 'Hold' className={`${
? 'BSBill-Table3-content-Disabled' item?.SalesId && OrderType !== 'Hold'
: 'BSBill-Table3-content' ? 'BSBill-Table3-content-Disabled'
} : 'BSBill-Table3-content'
}
`} `}
style={{ style={{
@ -2409,15 +2409,15 @@ const BSBillingTable3 = () => {
? item?.SalesId && OrderType !== 'Hold' ? item?.SalesId && OrderType !== 'Hold'
? 'rgb(243, 248, 213)' ? 'rgb(243, 248, 213)'
: triggerAnimation && : triggerAnimation &&
index === 0 && index === 0 &&
!item?.SalesId && !item?.SalesId &&
tableDataTakeAway?.length >= PreviousdataLength tableDataTakeAway?.length >= PreviousdataLength
? 'wheat' ? 'wheat'
: triggerAnimation && : triggerAnimation &&
index === 0 && index === 0 &&
tableDataTakeAway?.length >= PreviousdataLength && tableDataTakeAway?.length >= PreviousdataLength &&
!HoldOrderDtl && !HoldOrderDtl &&
!UnpaidData !UnpaidData
? 'wheat' ? 'wheat'
: 'inherit' : 'inherit'
: 'none', : 'none',
@ -2425,9 +2425,9 @@ const BSBillingTable3 = () => {
item?.SalesId && OrderType !== 'Hold' item?.SalesId && OrderType !== 'Hold'
? 'rgb(243, 248, 213)' ? 'rgb(243, 248, 213)'
: GlobEstBooking === 'ParEst' && : GlobEstBooking === 'ParEst' &&
GlobProdwisedata?.includes( GlobProdwisedata?.includes(
item?.InwardDtlId + ' ' + item?.BookingTypeName item?.InwardDtlId + ' ' + item?.BookingTypeName
) )
? '#b2d1f7' ? '#b2d1f7'
: index % 2 === 0 : index % 2 === 0
? 'white' ? 'white'
@ -2483,7 +2483,7 @@ const BSBillingTable3 = () => {
style={{ fontFamily: 'Poppins' }} style={{ fontFamily: 'Poppins' }}
onClick={() => onClick={() =>
item.FullProductIdentifierDtls?.length > 0 || item.FullProductIdentifierDtls?.length > 0 ||
item.ProductIdentifierDtls?.length > 0 item.ProductIdentifierDtls?.length > 0
? handleImeiDetails(item) ? handleImeiDetails(item)
: editField && handleEditQuantity(item) : editField && handleEditQuantity(item)
} }
@ -2530,21 +2530,21 @@ const BSBillingTable3 = () => {
{productBasedExtraCharges?.find( {productBasedExtraCharges?.find(
(find) => find.ProdId === item.ProdId (find) => find.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(
(find) => find.ProdId === item.ProdId (find) => find.ProdId === item.ProdId
)?.TotalAmt )?.TotalAmt
} }
</div> </div>
)} )}
</td> </td>
</> </>
)} )}
@ -2637,8 +2637,8 @@ const BSBillingTable3 = () => {
> >
{allowDecimal {allowDecimal
? Number( ? Number(
item?.TotalAmt - (item?.Offer || 0) || 0 item?.TotalAmt - (item?.Offer || 0) || 0
).toFixed(2) ).toFixed(2)
: Number(item?.TotalAmt - (item?.Offer || 0) || 0)} : Number(item?.TotalAmt - (item?.Offer || 0) || 0)}
</td> </td>
)} )}
@ -2673,10 +2673,11 @@ const BSBillingTable3 = () => {
{OldtableDataDinein?.map((item, index) => ( {OldtableDataDinein?.map((item, index) => (
<tr <tr
key={OldtableDataTakeAway?.length + index} key={OldtableDataTakeAway?.length + index}
className={`${item?.SalesId className={`${
? 'BSBill-Table3-content-Disabled' item?.SalesId
: 'BSBill-Table3-content' ? 'BSBill-Table3-content-Disabled'
} : 'BSBill-Table3-content'
}
`} `}
style={{ style={{
@ -2687,26 +2688,26 @@ const BSBillingTable3 = () => {
? item?.SalesId ? item?.SalesId
? 'rgb(243, 248, 213)' ? 'rgb(243, 248, 213)'
: BookingType === 'Dine In' && : BookingType === 'Dine In' &&
triggerAnimation &&
OldtableDataTakeAway?.length + index === 0 &&
!item?.SalesId &&
tableDataDinein?.length >= PreviousdataLength
? 'wheat'
: BookingType !== 'Dine In' &&
triggerAnimation && triggerAnimation &&
OldtableDataTakeAway?.length + index === 0 && OldtableDataTakeAway?.length + index === 0 &&
tableDataDinein?.length >= PreviousdataLength && !item?.SalesId &&
!HoldOrderDtl && tableDataDinein?.length >= PreviousdataLength
!UnpaidData ? 'wheat'
: BookingType !== 'Dine In' &&
triggerAnimation &&
OldtableDataTakeAway?.length + index === 0 &&
tableDataDinein?.length >= PreviousdataLength &&
!HoldOrderDtl &&
!UnpaidData
? 'wheat' ? 'wheat'
: 'inherit' : 'inherit'
: 'none', : 'none',
background: item?.SalesId background: item?.SalesId
? 'rgb(243, 248, 213)' ? 'rgb(243, 248, 213)'
: GlobEstBooking === 'ParEst' && : GlobEstBooking === 'ParEst' &&
GlobProdwisedata?.includes( GlobProdwisedata?.includes(
item?.InwardDtlId + ' ' + item?.BookingTypeName item?.InwardDtlId + ' ' + item?.BookingTypeName
) )
? '#b2d1f7' ? '#b2d1f7'
: (OldtableDataTakeAway?.length + index) % 2 === 0 : (OldtableDataTakeAway?.length + index) % 2 === 0
? 'white' ? 'white'
@ -2807,21 +2808,21 @@ const BSBillingTable3 = () => {
{productBasedExtraCharges?.find( {productBasedExtraCharges?.find(
(find) => find.ProdId === item.ProdId (find) => find.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(
(find) => find.ProdId === item.ProdId (find) => find.ProdId === item.ProdId
)?.TotalAmt )?.TotalAmt
} }
</div> </div>
)} )}
</td> </td>
</> </>
)} )}
@ -2914,8 +2915,8 @@ const BSBillingTable3 = () => {
> >
{allowDecimal {allowDecimal
? Number( ? Number(
item?.TotalAmt - (item?.Offer || 0) || 0 item?.TotalAmt - (item?.Offer || 0) || 0
).toFixed(2) ).toFixed(2)
: Number(item?.TotalAmt - (item?.Offer || 0) || 0)} : Number(item?.TotalAmt - (item?.Offer || 0) || 0)}
</td> </td>
)} )}
@ -2955,10 +2956,11 @@ const BSBillingTable3 = () => {
OldtableDataTakeAway?.length + OldtableDataTakeAway?.length +
index index
} }
className={`${BookingType === 'Dine In' && item?.SalesId className={`${
? 'BSBill-Table3-content-Disabled' BookingType === 'Dine In' && item?.SalesId
: 'BSBill-Table3-content' ? 'BSBill-Table3-content-Disabled'
} : 'BSBill-Table3-content'
}
`} `}
style={{ style={{
@ -2969,38 +2971,38 @@ const BSBillingTable3 = () => {
? BookingType === 'Dine In' && item?.SalesId ? BookingType === 'Dine In' && item?.SalesId
? 'rgb(243, 248, 213)' ? 'rgb(243, 248, 213)'
: BookingType === 'Dine In' && : BookingType === 'Dine In' &&
triggerAnimation &&
OldtableDataDinein?.length +
OldtableDataTakeAway?.length +
index ===
0 &&
!item?.SalesId &&
tableDataTakeAway?.length >= PreviousdataLength
? 'wheat'
: BookingType !== 'Dine In' &&
triggerAnimation && triggerAnimation &&
OldtableDataDinein?.length + OldtableDataDinein?.length +
OldtableDataTakeAway?.length + OldtableDataTakeAway?.length +
index === index ===
0 && 0 &&
tableDataTakeAway?.length >= PreviousdataLength && !item?.SalesId &&
!HoldOrderDtl && tableDataTakeAway?.length >= PreviousdataLength
!UnpaidData ? 'wheat'
: BookingType !== 'Dine In' &&
triggerAnimation &&
OldtableDataDinein?.length +
OldtableDataTakeAway?.length +
index ===
0 &&
tableDataTakeAway?.length >= PreviousdataLength &&
!HoldOrderDtl &&
!UnpaidData
? 'wheat' ? 'wheat'
: (OldtableDataDinein?.length + : (OldtableDataDinein?.length +
OldtableDataTakeAway?.length + OldtableDataTakeAway?.length +
index) % index) %
2 === 2 ===
0 0
? 'white' ? 'white'
: SelectedBillColor?.['OverallBackgroundColor'] : SelectedBillColor?.['OverallBackgroundColor']
? SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor']
: '#d6d6d6' : '#d6d6d6'
: (OldtableDataDinein?.length + : (OldtableDataDinein?.length +
OldtableDataTakeAway?.length + OldtableDataTakeAway?.length +
index) % index) %
2 === 2 ===
0 0
? 'white' ? 'white'
: SelectedBillColor?.['OverallBackgroundColor'] : SelectedBillColor?.['OverallBackgroundColor']
? SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor']
@ -3009,15 +3011,15 @@ const BSBillingTable3 = () => {
BookingType === 'Dine In' && item?.SalesId BookingType === 'Dine In' && item?.SalesId
? 'rgb(243, 248, 213)' ? 'rgb(243, 248, 213)'
: GlobEstBooking === 'ParEst' && : GlobEstBooking === 'ParEst' &&
GlobProdwisedata?.includes( GlobProdwisedata?.includes(
item?.InwardDtlId + ' ' + item?.BookingTypeName item?.InwardDtlId + ' ' + item?.BookingTypeName
) )
? '#b2d1f7' ? '#b2d1f7'
: (OldtableDataDinein?.length + : (OldtableDataDinein?.length +
OldtableDataTakeAway?.length + OldtableDataTakeAway?.length +
index) % index) %
2 === 2 ===
0 0
? 'white' ? 'white'
: SelectedBillColor?.['OverallBackgroundColor'] : SelectedBillColor?.['OverallBackgroundColor']
? SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor']
@ -3026,9 +3028,9 @@ const BSBillingTable3 = () => {
BillOrderPre === 'Y' && !BookingTypeBoth BillOrderPre === 'Y' && !BookingTypeBoth
? triggerAnimation && ? triggerAnimation &&
OldtableDataDinein?.length + OldtableDataDinein?.length +
OldtableDataTakeAway?.length + OldtableDataTakeAway?.length +
index === index ===
0 && 0 &&
!item?.SalesId && !item?.SalesId &&
tableDataTakeAway?.length >= PreviousdataLength && tableDataTakeAway?.length >= PreviousdataLength &&
!HoldOrderDtl && !HoldOrderDtl &&
@ -3077,7 +3079,7 @@ const BSBillingTable3 = () => {
style={{ fontFamily: 'Poppins' }} style={{ fontFamily: 'Poppins' }}
onClick={() => onClick={() =>
item.FullProductIdentifierDtls?.length > 0 || item.FullProductIdentifierDtls?.length > 0 ||
item.ProductIdentifierDtls?.length > 0 item.ProductIdentifierDtls?.length > 0
? handleImeiDetails(item) ? handleImeiDetails(item)
: editField && handleEditQuantity(item, index) : editField && handleEditQuantity(item, index)
} }
@ -3131,21 +3133,21 @@ const BSBillingTable3 = () => {
{productBasedExtraCharges?.find( {productBasedExtraCharges?.find(
(find) => find.ProdId === item.ProdId (find) => find.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(
(find) => find.ProdId === item.ProdId (find) => find.ProdId === item.ProdId
)?.TotalAmt )?.TotalAmt
} }
</div> </div>
)} )}
</td> </td>
</> </>
)} )}
@ -3239,8 +3241,8 @@ const BSBillingTable3 = () => {
> >
{allowDecimal {allowDecimal
? Number( ? Number(
item?.TotalAmt - (item?.Offer || 0) || 0 item?.TotalAmt - (item?.Offer || 0) || 0
).toFixed(2) ).toFixed(2)
: Number(item?.TotalAmt - (item?.Offer || 0) || 0)} : Number(item?.TotalAmt - (item?.Offer || 0) || 0)}
</td> </td>
)} )}
@ -3280,10 +3282,11 @@ const BSBillingTable3 = () => {
tableDataTakeAway?.length + tableDataTakeAway?.length +
index index
} }
className={`${BookingType === 'Dine In' && item?.SalesId className={`${
? 'BSBill-Table3-content-Disabled' BookingType === 'Dine In' && item?.SalesId
: 'BSBill-Table3-content' ? 'BSBill-Table3-content-Disabled'
} : 'BSBill-Table3-content'
}
`} `}
style={{ style={{
@ -3296,44 +3299,44 @@ const BSBillingTable3 = () => {
!BookingTypeBoth !BookingTypeBoth
? 'rgb(243, 248, 213)' ? 'rgb(243, 248, 213)'
: BookingType === 'Dine In' && : BookingType === 'Dine In' &&
triggerAnimation &&
OldtableDataTakeAway?.length +
OldtableDataDinein?.length +
tableDataTakeAway?.length +
index ===
0 &&
!item?.SalesId &&
tableDataDinein?.length >= PreviousdataLength
? 'wheat'
: BookingType !== 'Dine In' &&
triggerAnimation && triggerAnimation &&
OldtableDataTakeAway?.length + OldtableDataTakeAway?.length +
OldtableDataDinein?.length + OldtableDataDinein?.length +
tableDataTakeAway?.length + tableDataTakeAway?.length +
index === index ===
0 && 0 &&
tableDataDinein?.length >= PreviousdataLength && !item?.SalesId &&
!HoldOrderDtl && tableDataDinein?.length >= PreviousdataLength
!UnpaidData ? 'wheat'
: BookingType !== 'Dine In' &&
triggerAnimation &&
OldtableDataTakeAway?.length +
OldtableDataDinein?.length +
tableDataTakeAway?.length +
index ===
0 &&
tableDataDinein?.length >= PreviousdataLength &&
!HoldOrderDtl &&
!UnpaidData
? 'wheat' ? 'wheat'
: 'inherit' : 'inherit'
: 'none', : 'none',
background: background:
BookingType === 'Dine In' && BookingType === 'Dine In' &&
item?.SalesId && item?.SalesId &&
!BookingTypeBoth !BookingTypeBoth
? 'rgb(243, 248, 213)' ? 'rgb(243, 248, 213)'
: GlobEstBooking === 'ParEst' && : GlobEstBooking === 'ParEst' &&
GlobProdwisedata?.includes( GlobProdwisedata?.includes(
item?.InwardDtlId + ' ' + item?.BookingTypeName item?.InwardDtlId + ' ' + item?.BookingTypeName
) )
? '#b2d1f7' ? '#b2d1f7'
: (OldtableDataTakeAway?.length + : (OldtableDataTakeAway?.length +
OldtableDataDinein?.length + OldtableDataDinein?.length +
tableDataTakeAway?.length + tableDataTakeAway?.length +
index) % index) %
2 === 2 ===
0 0
? 'white' ? 'white'
: SelectedBillColor?.['OverallBackgroundColor'] : SelectedBillColor?.['OverallBackgroundColor']
? SelectedBillColor?.['OverallBackgroundColor'] ? SelectedBillColor?.['OverallBackgroundColor']
@ -3342,10 +3345,10 @@ const BSBillingTable3 = () => {
BillOrderPre === 'Y' && !BookingTypeBoth BillOrderPre === 'Y' && !BookingTypeBoth
? triggerAnimation && ? triggerAnimation &&
OldtableDataTakeAway?.length + OldtableDataTakeAway?.length +
OldtableDataDinein?.length + OldtableDataDinein?.length +
tableDataTakeAway?.length + tableDataTakeAway?.length +
index === index ===
0 && 0 &&
!item?.SalesId && !item?.SalesId &&
tableDataDinein?.length >= PreviousdataLength && tableDataDinein?.length >= PreviousdataLength &&
!HoldOrderDtl && !HoldOrderDtl &&
@ -3441,21 +3444,21 @@ const BSBillingTable3 = () => {
{productBasedExtraCharges?.find( {productBasedExtraCharges?.find(
(find) => find.ProdId === item.ProdId (find) => find.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(
(find) => find.ProdId === item.ProdId (find) => find.ProdId === item.ProdId
)?.TotalAmt )?.TotalAmt
} }
</div> </div>
)} )}
</td> </td>
</> </>
)} )}
@ -3548,8 +3551,8 @@ const BSBillingTable3 = () => {
> >
{allowDecimal {allowDecimal
? Number( ? Number(
item?.TotalAmt - (item?.Offer || 0) || 0 item?.TotalAmt - (item?.Offer || 0) || 0
).toFixed(2) ).toFixed(2)
: Number(item?.TotalAmt - (item?.Offer || 0) || 0)} : Number(item?.TotalAmt - (item?.Offer || 0) || 0)}
</td> </td>
)} )}
@ -3592,7 +3595,7 @@ const BSBillingTable3 = () => {
ProductDetail={Modaldata} ProductDetail={Modaldata}
/> />
)} )}
{(customerPriceHistoryOpen && GetCustId) && {customerPriceHistoryOpen && GetCustId && (
<CustomerPriceHistory <CustomerPriceHistory
open={customerPriceHistoryOpen} open={customerPriceHistoryOpen}
custId={GetCustId} custId={GetCustId}
@ -3601,7 +3604,7 @@ const BSBillingTable3 = () => {
setCustomerProduct={setCustomerProduct} setCustomerProduct={setCustomerProduct}
selectedCustomer={selectedCustomer} selectedCustomer={selectedCustomer}
/> />
} )}
</div> </div>
); );
}; };

View File

@ -7,7 +7,7 @@ import { BiRightArrowAlt } from 'react-icons/bi';
import { AiOutlineClose } from 'react-icons/ai'; import { AiOutlineClose } from 'react-icons/ai';
import BSSummery from '../BSBillingTableSummery/BSSummery.jsx'; import BSSummery from '../BSBillingTableSummery/BSSummery.jsx';
import BSBillingTable7 from './BSBillingTable7'; import BSBillingTable7 from './BSBillingTable7';
import { UpCircleOutlined, UpOutlined } from '@ant-design/icons'; import { UpCircleOutlined } from '@ant-design/icons';
import '../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBillingTable4.scss'; import '../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBillingTable4.scss';
import { import {
GlobalSelectedFont, GlobalSelectedFont,
@ -17,7 +17,7 @@ import {
GlobalprintDatas, GlobalprintDatas,
GlobalPrinterMappingDtls, GlobalPrinterMappingDtls,
getPrinterMappingDetails, getPrinterMappingDetails,
getPrintSelectionComponentData, // getPrintSelectionComponentData,
} from '../../../../../Features/ThemeChange/ThemeChange.js'; } from '../../../../../Features/ThemeChange/ThemeChange.js';
import { PrintStyleFunction } from '../../../../paymentpdfPage/PrintStyleFunction.js'; import { PrintStyleFunction } from '../../../../paymentpdfPage/PrintStyleFunction.js';
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities.jsx'; import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities.jsx';
@ -94,7 +94,7 @@ import {
GlobalOverAllDiscSales, GlobalOverAllDiscSales,
ChangeOverAllDiscSales, ChangeOverAllDiscSales,
ChangeOverAllDiscEstimate, ChangeOverAllDiscEstimate,
getAllCustomer,
GlobalBranchFinancialStatus, GlobalBranchFinancialStatus,
changeSummeryComboOfferAmount, changeSummeryComboOfferAmount,
ChangeComboCarddata, ChangeComboCarddata,
@ -119,6 +119,7 @@ import {
changeBillEditingMode, changeBillEditingMode,
changePreviousOrderPayment, changePreviousOrderPayment,
changePreviousOrderOfferDetail, changePreviousOrderOfferDetail,
GlobalAllBookingType,
} from '../../../../../Features/BookingScreen/BookingData/BookingData.js'; } from '../../../../../Features/BookingScreen/BookingData/BookingData.js';
import { import {
globalExtraTotalAmount, globalExtraTotalAmount,
@ -174,11 +175,8 @@ import { getEmpAccess } from '../../../../../Features/AppPage/CenterPage.js';
import PozoSplitPaymentIcon from '../../UtillComponents/Pozo retail icons/PozoSplitPaymentIcon.jsx'; import PozoSplitPaymentIcon from '../../UtillComponents/Pozo retail icons/PozoSplitPaymentIcon.jsx';
import PozoCartIcon from '../../../../../Pages/BookingScreen/Components/UtillComponents/PozoCartIcon.jsx'; import PozoCartIcon from '../../../../../Pages/BookingScreen/Components/UtillComponents/PozoCartIcon.jsx';
import { import {
Global_CoupenCodeAmount,
Global_loyaltyPointsDiscountAmount,
Global_OrderOfferDetail, Global_OrderOfferDetail,
Global_OverallOfferAmount, Global_OverallOfferAmount
Global_SalesWiseOfferAmount,
} from '../../../../../Features/Offer/Offer.js'; } from '../../../../../Features/Offer/Offer.js';
import { useApplyOfferto_CardDetail } from '../../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx'; import { useApplyOfferto_CardDetail } from '../../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx';
import TooltipWrapper from '../../../../../Components/Tooltip/Tooltip'; import TooltipWrapper from '../../../../../Components/Tooltip/Tooltip';
@ -242,6 +240,7 @@ const BSBilling7Payment = () => {
const screenwidth = useSelector(GlobalScreenSize); const screenwidth = useSelector(GlobalScreenSize);
const defaultBookingType = useSelector(GlobalDefaultBookingType); const defaultBookingType = useSelector(GlobalDefaultBookingType);
const printerTemplateStyle = useSelector(SelectedPrintTemplate); const printerTemplateStyle = useSelector(SelectedPrintTemplate);
const AllBookingType=useSelector(GlobalAllBookingType)
const FontFamily = useSelector(GlobalSelectedFont); const FontFamily = useSelector(GlobalSelectedFont);
const OrderCardDetail = useSelector(GlobalOrderCardDetails); const OrderCardDetail = useSelector(GlobalOrderCardDetails);
const GetCustId = useSelector(GlobalCustId); const GetCustId = useSelector(GlobalCustId);
@ -269,6 +268,9 @@ const BSBilling7Payment = () => {
const templateData = useSelector(getTemplateData); const templateData = useSelector(getTemplateData);
const appPreferences = useSelector(ApplicationPreferences); const appPreferences = useSelector(ApplicationPreferences);
const Combodata = useSelector(GlobalCombocarddata, shallowEqual); const Combodata = useSelector(GlobalCombocarddata, shallowEqual);
const holdCheckedSalesSetup = tableOptions?.some(
(item) => item?.OptionName === 'Hold'
);
const bookingTypePreference = appPreferences?.find( const bookingTypePreference = appPreferences?.find(
(preference) => preference?.PreferredCatName === 'Booking Type' (preference) => preference?.PreferredCatName === 'Booking Type'
)?.PreferenceCatDetails; )?.PreferenceCatDetails;
@ -306,11 +308,9 @@ const BSBilling7Payment = () => {
const offerAppliedProducts = useSelector(GlobalOfferAppliedProducts); const offerAppliedProducts = useSelector(GlobalOfferAppliedProducts);
const GlobEstBooking = useSelector(GlobalEstimateBooking); const GlobEstBooking = useSelector(GlobalEstimateBooking);
const GlobProdwisedata = useSelector(GlobalSelProdWiseEst); const GlobProdwisedata = useSelector(GlobalSelProdWiseEst);
const BranchFinancialStatus = useSelector(GlobalBranchFinancialStatus);
const preOrder = useSelector(GlobalpreOrderOpen); const preOrder = useSelector(GlobalpreOrderOpen);
const OrderType = useSelector(GlobalOrderType); const OrderType = useSelector(GlobalOrderType);
const FailedTotalAmt = useSelector(GlobalFailedTotalAmt); const FailedTotalAmt = useSelector(GlobalFailedTotalAmt);
const OrderOfferDetail = useSelector(Global_OrderOfferDetail, shallowEqual);
const defaultPaymentTrigger = useSelector(GlobalPaymentTrigger); const defaultPaymentTrigger = useSelector(GlobalPaymentTrigger);
const [defaultPaymentMode, setDefaultPaymentMode] = useState([]); const [defaultPaymentMode, setDefaultPaymentMode] = useState([]);
const [defaultEnabled, setDefaultEnabled] = useState(false); const [defaultEnabled, setDefaultEnabled] = useState(false);
@ -324,8 +324,6 @@ const BSBilling7Payment = () => {
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 AuthToken = SessionData?.AuthToken;
const SessionMobileNo = SessionData?.SessionMobileNo;
const [FirstPaymentclick, setFirstPaymentclick] = useState(false); const [FirstPaymentclick, setFirstPaymentclick] = useState(false);
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const [unpaidopen, setUnpaidOpen] = useState(false); const [unpaidopen, setUnpaidOpen] = useState(false);
@ -692,13 +690,16 @@ const BSBilling7Payment = () => {
UserId: UserId, UserId: UserId,
}; };
dispatch(getPrinterMappingDetails(data)).unwrap(); dispatch(getPrinterMappingDetails(data)).unwrap();
const Data1 = { AppId, CompId, BranchId }; // const Data1 = { AppId, CompId, BranchId };
dispatch(getPrintSelectionComponentData(Data1)).unwrap(); // dispatch(getPrintSelectionComponentData(Data1)).unwrap();
}, []); }, []);
useEffect(() => { useEffect(() => {
if (CompId && BranchId && AppId) { if (CompId && BranchId && AppId) {
if(holdCheckedSalesSetup)
{
getHolddata(); getHolddata();
getUnpaiddatas(); }
// getUnpaiddatas();
getCustomerData(); getCustomerData();
} }
}, [CompId, BranchId, AppId]); }, [CompId, BranchId, AppId]);
@ -814,9 +815,7 @@ const BSBilling7Payment = () => {
: parseInt(value || 0); : parseInt(value || 0);
}; };
const getCustomerData = async () => { const getCustomerData = async () => {
await dispatch(
getAllCustomer({ CompId: CompId, AppId: AppId, branchId: BranchId })
);
await dispatch( await dispatch(
getAddCustomerDetails({ getAddCustomerDetails({
CompId: CompId, CompId: CompId,
@ -1627,20 +1626,14 @@ const BSBilling7Payment = () => {
}; };
const getBookingTypeId = async () => { const getBookingTypeId = async () => {
let tempconfigdata = await dispatch( setConfigDataList(AllBookingType);
getConfigType({ TypeName: 'Booking Type' }) let configdata = AllBookingType;
).unwrap();
if (tempconfigdata?.data?.statusCode == 1) {
setConfigDataList(tempconfigdata?.data?.data);
let configdata = tempconfigdata?.data?.data;
let checkName = BookingTypeBoth ? 'DineIn,TakeAway' : BookingType; let checkName = BookingTypeBoth ? 'DineIn,TakeAway' : BookingType;
let filterconfigdata = configdata?.find( let filterconfigdata = configdata?.find(
(a) => a?.ConfigName === checkName (a) => a?.ConfigName === checkName
); );
setSelectedBookingType(filterconfigdata?.ConfigId); setSelectedBookingType(filterconfigdata?.ConfigId);
}
}; };
const gettodaydate = () => { const gettodaydate = () => {
const currentDate = new Date(); const currentDate = new Date();
@ -1932,7 +1925,10 @@ const BSBilling7Payment = () => {
setCurrentOrderNetAmount(0); setCurrentOrderNetAmount(0);
setPreviousNetAmount(0); setPreviousNetAmount(0);
setUpinotSelected(false); setUpinotSelected(false);
if(holdCheckedSalesSetup)
{
getHolddata(); getHolddata();
}
if (defaultBookingType === 'Both') { if (defaultBookingType === 'Both') {
await dispatch(changeBookingType('TakeAway')); await dispatch(changeBookingType('TakeAway'));
} }
@ -3331,8 +3327,10 @@ const BSBilling7Payment = () => {
setDefaultPaymentMode([]); setDefaultPaymentMode([]);
} }
}; };
setDefaultPaymentOption(); if(salesBillEdit){
}, [defaultPaymentTrigger]); setDefaultPaymentOption();
}
}, [defaultPaymentTrigger,salesBillEdit]);
const Otherserviceprint = async () => { const Otherserviceprint = async () => {
if (OtherServicesPrintDetails?.length > 0) { if (OtherServicesPrintDetails?.length > 0) {

View File

@ -1,7 +1,5 @@
import { useCallback, useEffect, useRef, useState } from 'react'; import { useCallback, useEffect, useRef, useState } from 'react';
import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import { DefaultModal } from '../../../../../Components/Modal/DefaultModal';
import FormHeader from '../../../../PageComponents/FormHeader.jsx';
import { Form } from 'antd'; import { Form } from 'antd';
import { import {
GlobalOrderCardDetails, GlobalOrderCardDetails,
@ -11,38 +9,29 @@ import {
GlobalOrderType, GlobalOrderType,
GlobalReorderProductDetails, GlobalReorderProductDetails,
PreferenceData, PreferenceData,
getConfigType, GlobalAllBookingType,
} from '../../../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../../../Features/BookingScreen/BookingData/BookingData';
import { ArrowRightOutlined } from '@ant-design/icons';
import { Messages } from '../../../../../Components/Notifications/Messages'; import { Messages } from '../../../../../Components/Notifications/Messages';
import '../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.scss'; import '../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.scss';
import { settingDataSelector } from '../../../../../Features/PreferenceMaster/PreferenceMaster.js';
import { RadioGrpButton } from '../../../../../Components/Forms/RadioGroup.jsx';
import Buttons from '../../../../../Components/Forms/Buttons.jsx';
import { InputField } from '../../../../../Components/Forms/InputField.jsx';
import { useApplyOfferto_CardDetail } from '../../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx';
import { import {
getTemplateData, getTemplateData,
StoredSessionData, StoredSessionData,
} from '../../../../../Features/ThemeChange/ThemeChange.js'; } from '../../../../../Features/ThemeChange/ThemeChange.js';
import { validateSafeInput } from '../../../../../Services/Others.js';
import { GlobalEmpAccessDetail } from '../../../../../Features/AppPage/CenterPage.js'; import { GlobalEmpAccessDetail } from '../../../../../Features/AppPage/CenterPage.js';
import { import {
ChangeFullFreeProductList, ChangeFullFreeProductList,
changeFullOfferAppliedProducts, changeFullOfferAppliedProducts,
ChangeOfferAppliedProducts, ChangeOfferAppliedProducts,
changeOfferAppliedProductsForLoyalty,
GlobalFreeProdList, GlobalFreeProdList,
GlobalOfferAppliedProducts, GlobalOfferAppliedProducts,
RemoveOfferAppliedProduct, RemoveOfferAppliedProduct,
} from '../../../../../Features/Offer/Offernew/BookingOffernew.js'; } from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
import { validateOffers } from '../../BSItemCards/ValidateOffer.jsx'; import { validateOffers } from '../../BSItemCards/ValidateOffer.jsx';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import "./ComboBillTableEdit.scss" import './ComboBillTableEdit.scss';
const ComboEditQty = (props) => { const ComboEditQty = (props) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const formRef = useRef(null);
const quantityInputRef = useRef(null); const quantityInputRef = useRef(null);
const priceChangeInputRef = useRef(null); const priceChangeInputRef = useRef(null);
const reductionInputRef = useRef(null); const reductionInputRef = useRef(null);
@ -54,7 +43,7 @@ const ComboEditQty = (props) => {
// const CompId = SessionData?.CompId; // const CompId = SessionData?.CompId;
// const BranchId = SessionData?.BranchId; // const BranchId = SessionData?.BranchId;
const UserType = SessionData?.UserType; const UserType = SessionData?.UserType;
const applyOffer = useApplyOfferto_CardDetail(); const AllBookingType = useSelector(GlobalAllBookingType);
const preferenceDatas = useSelector(PreferenceData); const preferenceDatas = useSelector(PreferenceData);
const EmpAccessDetail = useSelector(GlobalEmpAccessDetail); const EmpAccessDetail = useSelector(GlobalEmpAccessDetail);
const OverAllproductBasedOfferDatas = useSelector( const OverAllproductBasedOfferDatas = useSelector(
@ -75,7 +64,7 @@ const ComboEditQty = (props) => {
console.log(preferenceshortcutkey, 'preferenceshortcutkey'); console.log(preferenceshortcutkey, 'preferenceshortcutkey');
const [PriceChangeaccess, setPriceChangeaccess] = useState(true); const [PriceChangeaccess, setPriceChangeaccess] = useState(true);
const [ConfigDataList, setConfigDataList] = useState([]); const [ConfigDataList, setConfigDataList] = useState(AllBookingType);
const [messageType, setMessageType] = useState(null); const [messageType, setMessageType] = useState(null);
const [messageData, setMessageData] = useState(null); const [messageData, setMessageData] = useState(null);
const [EditOpen, setEditOpen] = useState(props?.BSBillingEditQuantity); const [EditOpen, setEditOpen] = useState(props?.BSBillingEditQuantity);
@ -104,7 +93,7 @@ const ComboEditQty = (props) => {
? 'Price' ? 'Price'
: 'Parcel' : 'Parcel'
); );
const [PercentageSelection, setPercentageSelection] = useState('Fixed');
const [RadioDetails, setRadioDetails] = useState(false); const [RadioDetails, setRadioDetails] = useState(false);
const [editedPrice, setEditedPrice] = useState(0); const [editedPrice, setEditedPrice] = useState(0);
const allowDecimal = preferenceDatas?.[0]?.SettingDtlDetails?.find( const allowDecimal = preferenceDatas?.[0]?.SettingDtlDetails?.find(
@ -265,11 +254,7 @@ const ComboEditQty = (props) => {
setEditedPrice(0); setEditedPrice(0);
}; };
// const AddQuantityonly = () => {
// setMessageType('success');
// setMessageData('Quantity Added');
// };
const createUpdatedCartItem = (cartItem, quantity, newPrice) => { const createUpdatedCartItem = (cartItem, quantity, newPrice) => {
const qty = parseInt(quantity); const qty = parseInt(quantity);
const rate = parseFloat(newPrice); const rate = parseFloat(newPrice);

View File

@ -29,16 +29,18 @@ import {
} from '../../../../../Features/Offer/Offernew/BookingOffernew.js'; } from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
import { validateOffers } from '../../BSItemCards/ValidateOffer.jsx'; import { validateOffers } from '../../BSItemCards/ValidateOffer.jsx';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import "./ComboBillTableEdit.scss" import './ComboBillTableEdit.scss';
const ComboEditQtyAndRate = (props) => { const ComboEditQtyAndRate = (props) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const formRef = useRef(null); const formRef = useRef(null);
const quantityInputRef = useRef(null); const quantityInputRef = useRef(null);
const priceChangeInputRef = useRef(null); const priceChangeInputRef = useRef(null);
const modalRef = useRef(null); const {
const { setIndex = () => {}, setEditQtyCombo = () => {}, setEditRateCombo = () => {} } = props; setIndex = () => {},
setEditQtyCombo = () => {},
setEditRateCombo = () => {},
} = props;
const [disableSubmitButton, setDisableSubmitButton] = useState(false); const [disableSubmitButton, setDisableSubmitButton] = useState(false);
const SessionData = useSelector(StoredSessionData); const SessionData = useSelector(StoredSessionData);
@ -70,7 +72,9 @@ const ComboEditQtyAndRate = (props) => {
const [ConfigDataList, setConfigDataList] = useState([]); const [ConfigDataList, setConfigDataList] = useState([]);
const [messageType, setMessageType] = useState(null); const [messageType, setMessageType] = useState(null);
const [messageData, setMessageData] = useState(null); const [messageData, setMessageData] = useState(null);
const [EditOpen, setEditOpen] = useState(props?.BSBillingEditQuantity || props?.BSBillingEditRate); const [EditOpen, setEditOpen] = useState(
props?.BSBillingEditQuantity || props?.BSBillingEditRate
);
const [ItemData, setItemData] = useState(props?.Productdata); const [ItemData, setItemData] = useState(props?.Productdata);
const [Quantity, setQuantity] = useState(''); const [Quantity, setQuantity] = useState('');
const ReorderProductData = useSelector(GlobalReorderProductDetails); const ReorderProductData = useSelector(GlobalReorderProductDetails);
@ -123,7 +127,7 @@ const ComboEditQtyAndRate = (props) => {
setEditOpen(props.BSBillingEditQuantity || props.BSBillingEditRate); setEditOpen(props.BSBillingEditQuantity || props.BSBillingEditRate);
setItemData(props.Productdata); setItemData(props.Productdata);
setQuantity(''); setQuantity('');
setEditedPrice(''); setEditedPrice('');
}, },
[props.BSBillingEditQuantity], [props.BSBillingEditQuantity],
[props.Productdata], [props.Productdata],
@ -141,21 +145,26 @@ const ComboEditQtyAndRate = (props) => {
}, [RadioBtnSelection, props.BSBillingEditQuantity, props.BSBillingEditRate]); }, [RadioBtnSelection, props.BSBillingEditQuantity, props.BSBillingEditRate]);
useEffect(() => { useEffect(() => {
const handleKeyDown = (event) => { const handleKeyDown = (event) => {
const navigationKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown']; const navigationKeys = [
if (event.key === 'Escape' || navigationKeys.includes(event.key)) { 'ArrowLeft',
event.preventDefault(); 'ArrowRight',
if (props.BSBillingEditQuantity) { 'ArrowUp',
props.handleEditQuantityCancel?.(); 'ArrowDown',
setEditQtyCombo(false); ];
} if (event.key === 'Escape' || navigationKeys.includes(event.key)) {
if (props.BSBillingEditRate) { event.preventDefault();
props.handleEditRateComboCancel?.(); if (props.BSBillingEditQuantity) {
setEditRateCombo(false); props.handleEditQuantityCancel?.();
} setEditQtyCombo(false);
return; }
} if (props.BSBillingEditRate) {
}; props.handleEditRateComboCancel?.();
setEditRateCombo(false);
}
return;
}
};
if (EditOpen) { if (EditOpen) {
document.addEventListener('keydown', handleKeyDown); document.addEventListener('keydown', handleKeyDown);
@ -173,8 +182,6 @@ const handleKeyDown = (event) => {
props.BSBillingEditRate, props.BSBillingEditRate,
]); ]);
useEffect(() => { useEffect(() => {
const BillOrder = SettingDataSelector?.[0]?.SettingDtlDetails?.find( const BillOrder = SettingDataSelector?.[0]?.SettingDtlDetails?.find(
(item) => item.SettingIdName === 'BillItemsOrder' (item) => item.SettingIdName === 'BillItemsOrder'
@ -198,7 +205,11 @@ const handleKeyDown = (event) => {
} else if (props?.BSBillingEditQuantity) { } else if (props?.BSBillingEditQuantity) {
setRadioBtnSelection('Quantity'); setRadioBtnSelection('Quantity');
} }
}, [props?.BSBillingEditRate, props?.BSBillingEditQuantity, props.Productdata?.OrderRate]); }, [
props?.BSBillingEditRate,
props?.BSBillingEditQuantity,
props.Productdata?.OrderRate,
]);
const getBookingTypeId = async () => { const getBookingTypeId = async () => {
let tempconfigdata = await dispatch( let tempconfigdata = await dispatch(
getConfigType({ TypeName: 'Booking Type' }) getConfigType({ TypeName: 'Booking Type' })
@ -209,7 +220,6 @@ const handleKeyDown = (event) => {
} }
}; };
const calculateOverAllQty = (item, filterItems) => { const calculateOverAllQty = (item, filterItems) => {
if (!item) return 0; if (!item) return 0;
@ -256,25 +266,25 @@ const handleKeyDown = (event) => {
setMessageData('Product not found in cart'); setMessageData('Product not found in cart');
return; return;
} }
const editedProduct = CartOrderDetails[editedProductIndex]; const editedProduct = CartOrderDetails[editedProductIndex];
const existingQty = editedProduct.OrderQty; const existingQty = editedProduct.OrderQty;
// Validate rate value // Validate rate value
if (!newPrice || newPrice <= 0) { if (!newPrice || newPrice <= 0) {
setMessageType('error'); setMessageType('error');
setMessageData('Please enter a valid rate'); setMessageData('Please enter a valid rate');
return; return;
} }
// Update ONLY the rate, use existing quantity // Update ONLY the rate, use existing quantity
await handleNormalEditQuantity( await handleNormalEditQuantity(
editedProduct, editedProduct,
editedProductIndex, editedProductIndex,
existingQty, existingQty,
newPrice newPrice
); );
// Reset and close // Reset and close
setClearQuantity(false); setClearQuantity(false);
setIndex(null); setIndex(null);
@ -3216,14 +3226,13 @@ const handleKeyDown = (event) => {
ref={quantityInputRef} ref={quantityInputRef}
type="number" type="number"
value={Quantity} value={Quantity}
min="0" min="0"
onChange={(e) => setQuantity(e.target.value)} onChange={(e) => setQuantity(e.target.value)}
onBlur={() => { onBlur={() => {
if (Quantity && Quantity.trim() !== '') { if (Quantity && Quantity.trim() !== '') {
AddProductQuantity(); AddProductQuantity();
} }
}} }}
min={0}
className="EditQTYcomboInput" className="EditQTYcomboInput"
placeholder="Enter Qty" placeholder="Enter Qty"
/> />
@ -3239,7 +3248,11 @@ const handleKeyDown = (event) => {
autoComplete="off" autoComplete="off"
onChange={SellingPriceChange} onChange={SellingPriceChange}
onBlur={() => { onBlur={() => {
if (editedPrice && editedPrice !== '' && disableSubmitButton) { if (
editedPrice &&
editedPrice !== '' &&
disableSubmitButton
) {
AddProductQuantity(); AddProductQuantity();
} }
}} }}

View File

@ -1,5 +1,4 @@
import React, { useEffect, useRef, useState } from 'react'; import React, { lazy, useEffect, useRef, useState } from 'react';
import './ComboSalesBillTable.scss';
import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import { Popconfirm, Tooltip } from 'antd'; import { Popconfirm, Tooltip } from 'antd';
import WebFont from 'webfontloader'; import WebFont from 'webfontloader';
@ -9,16 +8,12 @@ import {
ChangeTotalAmount, ChangeTotalAmount,
globalExtraTotalAmount, globalExtraTotalAmount,
} from '../../../../../Features/ExteraCharges/ExtraCharges.js'; } from '../../../../../Features/ExteraCharges/ExtraCharges.js';
import BSBillingEditQuantity from '../BSBillingEditQuantity/BSBillingEditQuantity';
import { import {
changeholddata, changeholddata,
gettinghold, gettinghold,
puttinghold, puttinghold,
} from '../../../../../Features/BookingScreen/HoldOption/HoldOption.js'; } from '../../../../../Features/BookingScreen/HoldOption/HoldOption.js';
import { getCustomerDisplayWindow } from '../../../../../Features/customerDisplayWindow/customerDisplayWindow.js'; import { getCustomerDisplayWindow } from '../../../../../Features/customerDisplayWindow/customerDisplayWindow.js';
import BSEditTotalAmt from '../BSEditTotalAmount/BSEditTotalAmt.jsx';
import { useApplyOfferto_CardDetail } from '../../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx';
import BSImeiDetails from '../BSImeiDetails/BSImeiDetails.jsx';
import { import {
getTemplateData, getTemplateData,
SelectedGlobalBillingColorDetail, SelectedGlobalBillingColorDetail,
@ -66,8 +61,6 @@ import {
GlobalSalesBillEdit, GlobalSalesBillEdit,
} from '../../../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../../../Features/BookingScreen/BookingData/BookingData';
import { import {
ChangeOfferAppliedProducts,
ChangeFreeProductList,
ChangeFullFreeProductList, ChangeFullFreeProductList,
GlobalFreeProdList, GlobalFreeProdList,
GlobalOfferAppliedProducts, GlobalOfferAppliedProducts,
@ -75,11 +68,24 @@ import {
changeLoyaltyConsumedQuantities, changeLoyaltyConsumedQuantities,
ClearOfferAppliedProducts, ClearOfferAppliedProducts,
} from '../../../../../Features/Offer/Offernew/BookingOffernew.js'; } from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
import { useRemoveProducts } from '../BSBillingTable3/RemoveCartWithOffer.jsx';
import { useUtilsComponent } from '../../../../../Services/utils.js'; import { useUtilsComponent } from '../../../../../Services/utils.js';
import ComboEditRate from '../ComboBillTableEdit/ComboEditRate.jsx'; import { useRemoveProducts } from '../BSBillingTable3/RemoveCartWithOffer.jsx';
import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx'; import { useApplyOfferto_CardDetail } from '../../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx';
import ComboEditQtyAndRate from '../ComboBillTableEdit/ComboEditQtyAndRate.jsx'; // jsx files
const CustomerPriceHistory = lazy(
() => import('../../UtillComponents/CustomerPriceHistory.jsx')
);
const ComboEditQtyAndRate = lazy(
() => import('../ComboBillTableEdit/ComboEditQtyAndRate.jsx')
);
const BSEditTotalAmt = lazy(
() => import('../BSEditTotalAmount/BSEditTotalAmt.jsx')
);
const BSImeiDetails = lazy(() => import('../BSImeiDetails/BSImeiDetails.jsx'));
const BSBillingEditQuantity = lazy(
() => import('../BSBillingEditQuantity/BSBillingEditQuantity.jsx')
); // Scss Files
import './ComboSalesBillTable.scss';
const ComboSalesBillTable = () => { const ComboSalesBillTable = () => {
const { removeExtraCharge } = useUtilsComponent(); const { removeExtraCharge } = useUtilsComponent();
@ -152,13 +158,13 @@ const ComboSalesBillTable = () => {
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 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);
@ -267,7 +273,9 @@ const ComboSalesBillTable = () => {
...sameItems[0], ...sameItems[0],
OrderQty: totalQty, OrderQty: totalQty,
TotalAmt: totalQty * item.OrderRate, TotalAmt: totalQty * item.OrderRate,
TaxAmt: ((totalQty * item.OrderRate * item.TaxPercentage) / (100 + item.TaxPercentage)), TaxAmt:
(totalQty * item.OrderRate * item.TaxPercentage) /
(100 + item.TaxPercentage),
}; };
mergedData.push(mergedItem); mergedData.push(mergedItem);
} else { } else {
@ -313,13 +321,7 @@ const ComboSalesBillTable = () => {
}; };
}, [GetCustId, tableData]); }, [GetCustId, tableData]);
// useEffect(() => { useEffect(() => {
// const BillOrder = preferenceDatas?.[0]?.SettingDtlDetails?.find(
// (item) => item.SettingIdName === 'BillItemsOrder'
// );
// setBillOrderPre(BillOrder?.SettingValue);
// }, [preferenceDatas]);
useEffect(() => {
const getSelectedItem = () => { const getSelectedItem = () => {
const getItem = (data = []) => { const getItem = (data = []) => {
if (!data.length) return null; if (!data.length) return null;
@ -463,6 +465,7 @@ const ComboSalesBillTable = () => {
BranchId: BranchId, BranchId: BranchId,
AppId: AppId, AppId: AppId,
}; };
await dispatch(getSelectedFavItems(data)).unwrap(); await dispatch(getSelectedFavItems(data)).unwrap();
let data1 = { let data1 = {
@ -1229,9 +1232,9 @@ const ComboSalesBillTable = () => {
)?.map((item, idx) => )?.map((item, idx) =>
idx === 0 idx === 0
? { ? {
...item, ...item,
FreeQty, FreeQty,
} }
: item : item
), ),
}; };
@ -2136,7 +2139,6 @@ const ComboSalesBillTable = () => {
} }
} }
} }
}; };
useEffect(() => { useEffect(() => {
@ -2468,24 +2470,25 @@ const ComboSalesBillTable = () => {
tableDataDinein?.length >= PreviousdataLength tableDataDinein?.length >= PreviousdataLength
? 'wheat' ? 'wheat'
: BookingType !== 'Dine In' && : BookingType !== 'Dine In' &&
triggerAnimation && triggerAnimation &&
OldtableDataTakeAway?.length + index === 0 && OldtableDataTakeAway?.length + index === 0 &&
tableDataDinein?.length >= PreviousdataLength && tableDataDinein?.length >= PreviousdataLength &&
!HoldOrderDtl && !HoldOrderDtl &&
!UnpaidData !UnpaidData
? 'wheat' ? 'wheat'
: 'inherit' : 'inherit'
: 'none', : 'none',
background: row?.SalesId && OrderType !== 'Hold' background:
? 'rgb(243, 248, 213)' row?.SalesId && OrderType !== 'Hold'
: GlobEstBooking === 'ParEst' && ? 'rgb(243, 248, 213)'
GlobProdwisedata?.includes( : GlobEstBooking === 'ParEst' &&
row?.InwardDtlId + ' ' + row?.BookingTypeName GlobProdwisedata?.includes(
) row?.InwardDtlId + ' ' + row?.BookingTypeName
? '#b2d1f7' )
: (OldtableDataTakeAway?.length + index) % 2 === 0 ? '#b2d1f7'
? 'white' : (OldtableDataTakeAway?.length + index) % 2 === 0
: SelectedBillColor?.['OverallBackgroundColor'], ? 'white'
: SelectedBillColor?.['OverallBackgroundColor'],
animation: animation:
BillOrderPre === 'Y' && !BookingTypeBoth BillOrderPre === 'Y' && !BookingTypeBoth
@ -2524,44 +2527,44 @@ const ComboSalesBillTable = () => {
{/* Product Name / Item */} {/* Product Name / Item */}
{(item.OptionName === 'Item' || {(item.OptionName === 'Item' ||
item.OptionName === 'Product Name') && ( item.OptionName === 'Product Name') && (
<td <td
key={`prod-${index}`} key={`prod-${index}`}
className={`productNameTd ${isActiveCell ? 'active-cell' : ''}`} className={`productNameTd ${isActiveCell ? 'active-cell' : ''}`}
onClick={() => onClick={() =>
row.FullProductIdentifierDtls?.length > 0 || row.FullProductIdentifierDtls?.length > 0 ||
row.ProductIdentifierDtls?.length > 0 row.ProductIdentifierDtls?.length > 0
? handleImeiDetails(row) ? handleImeiDetails(row)
: editField && handleEditQuantity(row) : editField && handleEditQuantity(row)
} }
> >
{row?.Type !== 'OS' ? row.ProdName : row.ServiceName} {row?.Type !== 'OS' ? row.ProdName : row.ServiceName}
{row?.BrandName ? ` ${row.BrandName}` : ''} {row?.BrandName ? ` ${row.BrandName}` : ''}
{row?.Type !== 'C' && ( {row?.Type !== 'C' && (
<p <p
// className="Tbl3-Variant" // className="Tbl3-Variant"
className={ className={
isActiveCell isActiveCell
? 'Tbl3VariantActve' ? 'Tbl3VariantActve'
: 'Tbl3-Variant' : 'Tbl3-Variant'
} }
> >
{/* {row?.ProdVariantName} {row?.Size} {row?.UomName} */} {/* {row?.ProdVariantName} {row?.Size} {row?.UomName} */}
( (
{!row?.ProdVariantName?.toLowerCase()?.includes( {!row?.ProdVariantName?.toLowerCase()?.includes(
'variant' 'variant'
) && <span>{row?.ProdVariantName} </span>} ) && <span>{row?.ProdVariantName} </span>}
{row?.Size} {row?.Size}
{row?.SinglePc == 'Y' ? 'PCS' : row?.UomName}) {row?.SinglePc == 'Y' ? 'PCS' : row?.UomName})
</p>
)}
{row?.Type === 'C' &&
row.ProdDetail?.map((prod, idx) => (
<p key={idx}>
{prod.ProdName} - {prod.Size} {prod.UomName}
</p> </p>
)} ))}
{row?.Type === 'C' && </td>
row.ProdDetail?.map((prod, idx) => ( )}
<p key={idx}>
{prod.ProdName} - {prod.Size} {prod.UomName}
</p>
))}
</td>
)}
{/* Barcode */} {/* Barcode */}
{item.OptionName === 'Barcode' && ( {item.OptionName === 'Barcode' && (
@ -2588,10 +2591,11 @@ const ComboSalesBillTable = () => {
}} }}
key={`qty-${index}`} key={`qty-${index}`}
tabIndex={0} tabIndex={0}
className={`${EditQtyCombo && row?.localId === Index className={`${
? 'EditQTYcomboTD' EditQtyCombo && row?.localId === Index
: 'qtyTd' ? 'EditQTYcomboTD'
} ${isActiveCell ? 'active-cell' : ''}`} : 'qtyTd'
} ${isActiveCell ? 'active-cell' : ''}`}
onClick={() => onClick={() =>
editField && handleEditQuantityCombo(row) editField && handleEditQuantityCombo(row)
} }
@ -2654,9 +2658,9 @@ const ComboSalesBillTable = () => {
> >
{row?.Offer > 0 {row?.Offer > 0
? `${( ? `${(
(row.Offer / (row?.OrderQty * row?.OrderRate)) * (row.Offer / (row?.OrderQty * row?.OrderRate)) *
100 100
).toFixed(2)}%` ).toFixed(2)}%`
: '-'} : '-'}
</td> </td>
)} )}
@ -2688,8 +2692,8 @@ const ComboSalesBillTable = () => {
> >
{allowDecimal {allowDecimal
? Number(row.TotalAmt - (row?.Offer || 0)).toFixed( ? Number(row.TotalAmt - (row?.Offer || 0)).toFixed(
2 2
) )
: Number(row.TotalAmt - (row?.Offer || 0))} : Number(row.TotalAmt - (row?.Offer || 0))}
</td> </td>
)} )}
@ -2732,7 +2736,7 @@ const ComboSalesBillTable = () => {
<td <td
key={`delete-${index}`} key={`delete-${index}`}
className={`deleteTd ${isActiveCell ? 'active-cell' : ''}`} className={`deleteTd ${isActiveCell ? 'active-cell' : ''}`}
// className="" // className=""
> >
<AiOutlineClose <AiOutlineClose
onClick={() => removeFromCart(row)} onClick={() => removeFromCart(row)}

View File

@ -524,36 +524,6 @@ function BSCategoryHorizontal(props) {
await dispatch(changeProductSubCategorieProdCatfun()); await dispatch(changeProductSubCategorieProdCatfun());
} }
}; };
// const handleClick = async (e, ProdCat, index) => {
// let data1 = {
// compId: CompId,
// branchId: BranchId,
// appId: AppId,
// prodCat: ProdCat,
// };
// let data = false;
// setaccessToCard(false);
// await dispatch(changeCombosearch(false));
// dispatch(ChangeisFavClicked(false));
// setAccessOther(false);
// setIsModalOpen(false);
// setIndexVal(index);
// await dispatch(changeProductCategorie(ProdCat));
// // await dispatch(changeProductSubCategorie(ProdCat));
// await dispatch(changeAccessForOthers(data));
// await dispatch(ChangeFocusCatCard(!FocusStatus));
// let tempSubCat = templateData?.BookingLayout?.[1]?.filter(
// (a, b) => a?.OptionName === 'SubCategory'
// );
// if (tempSubCat.length === 0) {
// await dispatch(changeProductSubCategorieProdCatfun());
// }
// if (templateData?.BookingLayout?.[0] === 'Layout2') {
// setSubCat(true);
// }
// };
useEffect(() => { useEffect(() => {
if (productCardTrigger && FavSelected) { if (productCardTrigger && FavSelected) {
@ -584,27 +554,15 @@ function BSCategoryHorizontal(props) {
} }
: {}), : {}),
}; };
await dispatch(getSelectedFavItems(data1));
// await dispatch(getSelectedFavItems(data1));
await dispatch(ChangeFocusCatCard(!FocusStatus)); await dispatch(ChangeFocusCatCard(!FocusStatus));
}; };
const handleClickOtherItems = async () => { const handleClickOtherItems = async () => {
dispatch(ChangedraggingComponent(null)); dispatch(ChangedraggingComponent(null));
dispatch(Changedragging(false)); dispatch(Changedragging(false));
let data = false;
setIndexVal(Infinity); setIndexVal(Infinity);
// setaccessToCard(true);
// dispatch(ChangeisFavClicked(true));
// setAccessOther(false);
setIsModalOpen(true); setIsModalOpen(true);
// // await dispatch(ChangeSubcategoryData(null));
// await dispatch(changeAccessForOthers(data));
// let data1 = {
// CompId: CompId,
// BranchId: BranchId,
// AppId: AppId,
// };
// await dispatch(getSelectedFavItems(data1));
// await dispatch(ChangeFocusCatCard(!FocusStatus));
}; };
const handleClick2 = async () => { const handleClick2 = async () => {
@ -690,8 +648,10 @@ function BSCategoryHorizontal(props) {
}; };
useEffect(() => { useEffect(() => {
holdnamedrop(); if (isModalOpen) {
}, [AppId, CompId, BranchId]); holdnamedrop();
}
}, [isModalOpen]);
const holdnamedrop = async () => { const holdnamedrop = async () => {
let data = { let data = {
@ -896,16 +856,16 @@ function BSCategoryHorizontal(props) {
formRef?.current?.resetFields(); formRef?.current?.resetFields();
resetForm(); resetForm();
let data = { // let data = {
CompId: CompId, // CompId: CompId,
BranchId: BranchId, // BranchId: BranchId,
AppId: AppId, // AppId: AppId,
ProdType: 'O', // ProdType: 'O',
}; // };
const respons = await dispatch(othernamedrop(data)).unwrap(); // const respons = await dispatch(othernamedrop(data)).unwrap();
if (respons?.data?.statusCode == 1) { // if (respons?.data?.statusCode == 1) {
setTabledropname(respons?.data?.data); // setTabledropname(respons?.data?.data);
} // }
}; };
const handleValuesChange = (values) => { const handleValuesChange = (values) => {
@ -1702,7 +1662,7 @@ function BSCategoryHorizontal(props) {
}))} }))}
className="field-DropDown" className="field-DropDown"
// placeholder="ConfigType" // placeholder="ConfigType"
label={<label class="required">Tax</label>} label={<label className="required">Tax</label>}
// optionsNames={{ value: "TaxPercentage", label: "TaxIdName" }} // optionsNames={{ value: "TaxPercentage", label: "TaxIdName" }}
onChangeFunction={(selectedValue) => onChangeFunction={(selectedValue) =>
onChangeFunction(selectedValue) onChangeFunction(selectedValue)
@ -1773,7 +1733,7 @@ function BSCategoryHorizontal(props) {
// }} // }}
className="size-input" className="size-input"
label={ label={
<label class="required">No.of.Units :</label> <label className="required">No.of.Units :</label>
} }
autocomplete="off" autocomplete="off"
onChange={(e) => onChange={(e) =>
@ -1885,7 +1845,7 @@ function BSCategoryHorizontal(props) {
]} ]}
> >
<InputField <InputField
label={<label class="required">Quantity</label>} label={<label className="required">Quantity</label>}
valueData={defaultQuantity} valueData={defaultQuantity}
autocomplete="off" autocomplete="off"
onChange={(e) => onChange={(e) =>
@ -1953,7 +1913,9 @@ function BSCategoryHorizontal(props) {
> >
<InputField <InputField
label={ label={
<label class="required">Amount / Per Item</label> <label className="required">
Amount / Per Item
</label>
} }
autocomplete="off" autocomplete="off"
onChange={(e) => onChange={(e) =>

View File

@ -510,8 +510,10 @@ function BSCategoryVertical(props) {
}; };
useEffect(() => { useEffect(() => {
holdnamedrop(); if (isModalOpen) {
}, [AppId, CompId, BranchId]); holdnamedrop();
}
}, [isModalOpen]);
const holdnamedrop = async () => { const holdnamedrop = async () => {
let data = { let data = {
@ -708,16 +710,16 @@ function BSCategoryVertical(props) {
formRef?.current?.resetFields(); formRef?.current?.resetFields();
resetForm(); resetForm();
let data = { // let data = {
CompId: CompId, // CompId: CompId,
BranchId: BranchId, // BranchId: BranchId,
AppId: AppId, // AppId: AppId,
ProdType: 'O', // ProdType: 'O',
}; // };
const respons = await dispatch(othernamedrop(data)).unwrap(); // const respons = await dispatch(othernamedrop(data)).unwrap();
if (respons?.data?.statusCode == 1) { // if (respons?.data?.statusCode == 1) {
setTabledropname(respons?.data?.data); // setTabledropname(respons?.data?.data);
} // }
}; };
const handleValuesChange = (values) => { const handleValuesChange = (values) => {
@ -1422,7 +1424,7 @@ function BSCategoryVertical(props) {
<p <p
style={{ style={{
textTransform: Uppercase, textTransform: Uppercase,
fontWeight: '600', fontWeight: '500',
// paddingTop: !item.SmallIcon && "4px", // paddingTop: !item.SmallIcon && "4px",
fontFamily: SelectedFontFamily ? SelectedFontFamily : '', fontFamily: SelectedFontFamily ? SelectedFontFamily : '',
color: SelectedCatgColor color: SelectedCatgColor

View File

@ -62,7 +62,10 @@ import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
import { BsSortAlphaDown } from 'react-icons/bs'; import { BsSortAlphaDown } from 'react-icons/bs';
import { BsSortAlphaDownAlt } from 'react-icons/bs'; import { BsSortAlphaDownAlt } from 'react-icons/bs';
import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin.js'; import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin.js';
import {changeothersdatas, OtherServicesCardlistdata} from '../../../../Features/OtherServices/OtherServices.js'; import {
changeothersdatas,
OtherServicesCardlistdata,
} from '../../../../Features/OtherServices/OtherServices.js';
function BSOtherServicesHorizontalcat(props) { function BSOtherServicesHorizontalcat(props) {
const formRef = useRef(null); const formRef = useRef(null);
@ -93,7 +96,6 @@ function BSOtherServicesHorizontalcat(props) {
const draggingComponent = useSelector(GlobaldraggingComponent); const draggingComponent = useSelector(GlobaldraggingComponent);
const alphabeticFormat = useSelector(GlobalisAlphabeticFormat); const alphabeticFormat = useSelector(GlobalisAlphabeticFormat);
const [isDragging, setIsDragging] = useState(false); const [isDragging, setIsDragging] = useState(false);
const [startX, setStartX] = useState(null); const [startX, setStartX] = useState(null);
const [accessToCard, setaccessToCard] = useState(false); const [accessToCard, setaccessToCard] = useState(false);
@ -375,14 +377,19 @@ function BSOtherServicesHorizontalcat(props) {
}; };
const handleClick = async (e, ProdCat, index) => { const handleClick = async (e, ProdCat, index) => {
let Filterdata1 = ComboCardata?.filter(
(item) => item?.ServiceCategory === ProdCat
);
let Filterdata2 = ComboCardata?.filter(
(item) => item?.ServiceCategory === ProdCat
);
let Filterdata1 = ComboCardata?.filter((item) => item?.ServiceCategory === ProdCat) let Filterdata = ComboCardata?.filter(
let Filterdata2 = ComboCardata?.filter((item) => item?.ServiceCategory === ProdCat) (item) => item?.ServiceCategory === ProdCat
)?.[0]?.ServiceDetails;
let Filterdatas = ComboCardata?.filter(
let Filterdata = ComboCardata?.filter((item) => item?.ServiceCategory === ProdCat)?.[0]?.ServiceDetails; (item) => item?.ServiceCategory === ProdCat
let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdCat)?.[0]?.ServiceDetails; )?.[0]?.ServiceDetails;
let data1 = { let data1 = {
compId: CompId, compId: CompId,
@ -430,7 +437,6 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
}; };
const handleClick2 = async () => { const handleClick2 = async () => {
getTaxname(); getTaxname();
getUom(); getUom();
setIndexVal(-1); setIndexVal(-1);
@ -511,8 +517,10 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
}; };
useEffect(() => { useEffect(() => {
holdnamedrop(); if (isModalOpen) {
}, [AppId, CompId, BranchId]); holdnamedrop();
}
}, [isModalOpen]);
const holdnamedrop = async () => { const holdnamedrop = async () => {
let data = { let data = {
@ -526,13 +534,7 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
const response = await dispatch(getUomData()).unwrap(); const response = await dispatch(getUomData()).unwrap();
// setTableuomname(response?.data?.data);
// let UomId = response?.data?.data?.filter(
// (item) => item.ConfigName?.toLowerCase() === 'pcs'
// )?.[0]?.['ConfigId'];
// formRef.current?.setFieldsValue({ UOM: UomId });
// setselectedUom(UomId);
const UomTypePreference = ApplicationPreferenceData?.find( const UomTypePreference = ApplicationPreferenceData?.find(
(preference) => preference?.PreferredCatName === 'Product Uom' (preference) => preference?.PreferredCatName === 'Product Uom'
)?.PreferenceCatDetails; )?.PreferenceCatDetails;
@ -718,17 +720,7 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
handleCancel(); handleCancel();
formRef?.current?.resetFields(); formRef?.current?.resetFields();
resetForm(); resetForm();
let data = {
CompId: CompId,
BranchId: BranchId,
AppId: AppId,
ProdType: 'O',
};
const respons = await dispatch(othernamedrop(data)).unwrap();
if (respons?.data?.statusCode == 1) {
setTabledropname(respons?.data?.data);
}
}; };
const handleValuesChange = (values) => { const handleValuesChange = (values) => {
@ -860,20 +852,19 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
}; };
useEffect(() => { useEffect(() => {
if (typeof searchData === 'string' && categoryData?.length > 0) { if (typeof searchData === 'string' && categoryData?.length > 0) {
const searchTerm = searchData?.trim()?.toLowerCase(); const searchTerm = searchData?.trim()?.toLowerCase();
const foundIndex = categoryData.findIndex( const foundIndex = categoryData.findIndex(
(cat) => (cat) =>
typeof cat.ProdCatName === 'string' && typeof cat.ProdCatName === 'string' &&
cat.ProdCatName?.trim()?.toLowerCase() === searchTerm cat.ProdCatName?.trim()?.toLowerCase() === searchTerm
); );
if (foundIndex !== -1) { if (foundIndex !== -1) {
setIndexVal(foundIndex); setIndexVal(foundIndex);
}
} else if (categoryData?.length > 0) {
setIndexVal(0);
} }
} else if (categoryData?.length > 0) {
setIndexVal(0);
}
}, [searchData, categoryData]); }, [searchData, categoryData]);
useEffect(() => { useEffect(() => {
@ -893,14 +884,13 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
let Data = response?.data?.data; let Data = response?.data?.data;
setCombocardata(Data?.ServiceCategories); setCombocardata(Data?.ServiceCategories);
} }
}; };
return ( return (
<> <>
<div
<div className="CategoryHorizontal bs1" className="CategoryHorizontal bs1"
ref={containerRef} ref={containerRef}
style={{ maxWidth: '100%' }} style={{ maxWidth: '100%' }}
> >
@ -1026,7 +1016,7 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
option, option,
selectedTaxPercentage === option.TaxId selectedTaxPercentage === option.TaxId
), ),
// label: option.TaxIdName + ' - ' + option.TaxPercentage + ' % ', // label: option.NameTaxIdName + ' - ' + option.TaxPercentage + ' % ',
}))} }))}
className="field-DropDown" className="field-DropDown"
// placeholder="ConfigType" // placeholder="ConfigType"
@ -1099,13 +1089,11 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
} }
// inputMode="numeric" // inputMode="numeric"
// onInput={(e) => { // onInput={(e) => {
// e.target.value = e.target.value.replace(/\D/g, ""); // e.target.Namevalue = e.target.value.replace(/\D/g, "");
// }} // }}
className="size-input" className="size-input"
label={ label={
<label class="required"> <label class="required">No.of.Units :</label>
No.of.Units :
</label>
} }
autocomplete="off" autocomplete="off"
onChange={(e) => onChange={(e) =>
@ -1147,32 +1135,7 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
/> />
</Form.Item> </Form.Item>
</div> </div>
</div> </div>
{/* <Form.Item
name="UOM"
rules={[
{
required: true,
message: "Please Select UOM",
},
]}
>
<DropDowns
options={Tableuomname?.map((option) => ({
value: option.ConfigId,
label: option.ConfigName,
}))}
placeholder="ConfigType"
label={<label class="required">UOM</label>}
optionsNames={{ value: "TypeId", label: "TypeName" }}
className="field-DropDown"
onChangeFunction={(selectedValues) =>
onChangeuomFunction(selectedValues)
}
valueData={selectedUom}
disabled={add || !EditState ? false : true}
/>
</Form.Item> */}
<div <div
className="quantity-amt" className="quantity-amt"
style={{ style={{
@ -1420,7 +1383,7 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
index={indexval} index={indexval}
onClick={() => handleClick1()} onClick={() => handleClick1()}
> */} > */}
{/* <div {/* <div
style={{ flexDirection: Reverse1 }} style={{ flexDirection: Reverse1 }}
className="CategoryHorizontal-sub-samplecard" className="CategoryHorizontal-sub-samplecard"
> >
@ -1438,7 +1401,7 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
Favourites Favourites
</p> </p>
</div> */} </div> */}
{/* </div> */} {/* </div> */}
{/* )} */} {/* )} */}
{(!Isdragging || draggingComponent !== 'category') && {(!Isdragging || draggingComponent !== 'category') &&
@ -1469,7 +1432,7 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
borderColor: borderColor:
index === indexval index === indexval
? '#000000' ? '#000000'
: SelectedCatgColor?.['BackgroundColor'], : SelectedCatgColor?.['BackgroundColor'],
}} }}
// key={} // key={}
@ -1569,7 +1532,9 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
minWidth: 'max-content', // set a width if needed minWidth: 'max-content', // set a width if needed
}} }}
className="sampleCard" className="sampleCard"
onClick={(e) => handleClick(e, item.ServiceCategory, index)} onClick={(e) =>
handleClick(e, item.ServiceCategory, index)
}
> >
<div <div
style={{ flexDirection: Reverse1 }} style={{ flexDirection: Reverse1 }}
@ -1672,7 +1637,7 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
index={indexval} index={indexval}
onClick={() => handleClick2()} onClick={() => handleClick2()}
> */} > */}
{/* <div {/* <div
style={{ flexDirection: Reverse1 }} style={{ flexDirection: Reverse1 }}
className="CategoryHorizontal-sub-samplecard" className="CategoryHorizontal-sub-samplecard"
> >
@ -1703,9 +1668,7 @@ let Filterdatas = ComboCardata?.filter((item) => item?.ServiceCategory === ProdC
</div> </div>
)} )}
</div> </div>
</div> </div>
</> </>
); );
} }

View File

@ -58,7 +58,10 @@ import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
import { BsSortAlphaDown } from 'react-icons/bs'; import { BsSortAlphaDown } from 'react-icons/bs';
import { BsSortAlphaDownAlt } from 'react-icons/bs'; import { BsSortAlphaDownAlt } from 'react-icons/bs';
import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin.js'; import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin.js';
import { changeothersdatas, OtherServicesCardlistdata } from '../../../../Features/OtherServices/OtherServices.js'; import {
changeothersdatas,
OtherServicesCardlistdata,
} from '../../../../Features/OtherServices/OtherServices.js';
function BSOtherServicesVerticalcat(props) { function BSOtherServicesVerticalcat(props) {
const formRef = useRef(null); const formRef = useRef(null);
@ -105,7 +108,7 @@ function BSOtherServicesVerticalcat(props) {
const [add, setAdd] = useState(false); const [add, setAdd] = useState(false);
const [defaultQuantity, setdefaultQuantity] = useState(1); const [defaultQuantity, setdefaultQuantity] = useState(1);
const [isSortClicked, setIsSortClicked] = useState(false); const [isSortClicked, setIsSortClicked] = useState(false);
const [otherServiceCategoryData,setOtherServiceCategoryData] = useState([]) const [otherServiceCategoryData, setOtherServiceCategoryData] = useState([]);
const AppId = SessionData?.AppId; const AppId = SessionData?.AppId;
const CompId = SessionData?.CompId; const CompId = SessionData?.CompId;
const BranchId = SessionData?.BranchId; const BranchId = SessionData?.BranchId;
@ -147,7 +150,7 @@ function BSOtherServicesVerticalcat(props) {
); );
} }
}; };
OtherServicesCategoryList() OtherServicesCategoryList();
const container = scrollContainerRef?.current; const container = scrollContainerRef?.current;
if (container) { if (container) {
container.addEventListener('scroll', handleScroll); container.addEventListener('scroll', handleScroll);
@ -299,7 +302,9 @@ function BSOtherServicesVerticalcat(props) {
}; };
const handleClick = async (e, ProdCat, index) => { const handleClick = async (e, ProdCat, index) => {
const selectedOtherServiceCategory = otherServiceCategoryData?.filter(({ServiceCategory}) => ServiceCategory === ProdCat) const selectedOtherServiceCategory = otherServiceCategoryData?.filter(
({ ServiceCategory }) => ServiceCategory === ProdCat
);
let data = false; let data = false;
setaccessToCard(false); setaccessToCard(false);
setAccessOther(false); setAccessOther(false);
@ -416,8 +421,10 @@ function BSOtherServicesVerticalcat(props) {
}; };
useEffect(() => { useEffect(() => {
holdnamedrop(); if (isModalOpen) {
}, [AppId, CompId, BranchId]); holdnamedrop();
}
}, [isModalOpen]);
const holdnamedrop = async () => { const holdnamedrop = async () => {
let data = { let data = {
@ -614,16 +621,16 @@ function BSOtherServicesVerticalcat(props) {
formRef?.current?.resetFields(); formRef?.current?.resetFields();
resetForm(); resetForm();
let data = { // let data = {
CompId: CompId, // CompId: CompId,
BranchId: BranchId, // BranchId: BranchId,
AppId: AppId, // AppId: AppId,
ProdType: 'O', // ProdType: 'O',
}; // };
const respons = await dispatch(othernamedrop(data)).unwrap(); // const respons = await dispatch(othernamedrop(data)).unwrap();
if (respons?.data?.statusCode == 1) { // if (respons?.data?.statusCode == 1) {
setTabledropname(respons?.data?.data); // setTabledropname(respons?.data?.data);
} // }
}; };
const handleValuesChange = (values) => { const handleValuesChange = (values) => {
@ -778,31 +785,32 @@ function BSOtherServicesVerticalcat(props) {
}; };
useEffect(() => { useEffect(() => {
if (typeof searchData === 'string' && categoryData?.length > 0) { if (typeof searchData === 'string' && categoryData?.length > 0) {
const searchTerm = searchData?.trim()?.toLowerCase(); const searchTerm = searchData?.trim()?.toLowerCase();
const foundIndex = categoryData.findIndex( const foundIndex = categoryData.findIndex(
(cat) => (cat) =>
typeof cat.ProdCatName === 'string' && typeof cat.ProdCatName === 'string' &&
cat.ProdCatName?.trim()?.toLowerCase() === searchTerm cat.ProdCatName?.trim()?.toLowerCase() === searchTerm
); );
if (foundIndex !== -1) { if (foundIndex !== -1) {
setIndexVal(foundIndex); setIndexVal(foundIndex);
}
} else if (categoryData?.length > 0) {
setIndexVal(0);
} }
} else if (categoryData?.length > 0) {
setIndexVal(0);
}
}, [searchData, categoryData]); }, [searchData, categoryData]);
const OtherServicesCategoryList = async () => { const OtherServicesCategoryList = async () => {
let response = await dispatch(OtherServicesCardlistdata({CompId,BranchId,AppId})).unwrap(); let response = await dispatch(
if (response?.data?.statusCode === 1) { OtherServicesCardlistdata({ CompId, BranchId, AppId })
setOtherServiceCategoryData(response?.data?.data?.ServiceCategories); ).unwrap();
}else{ if (response?.data?.statusCode === 1) {
setMessageType("error") setOtherServiceCategoryData(response?.data?.data?.ServiceCategories);
setMessageData(response?.data?.response) } else {
} setMessageType('error');
}; setMessageData(response?.data?.response);
}
};
return ( return (
<div className="CategoryVertical"> <div className="CategoryVertical">
@ -919,7 +927,7 @@ function BSOtherServicesVerticalcat(props) {
), ),
// label: // label:
// option.TaxIdName + // option.TaxIdName +
// " - " + // " - " +Name
// option.TaxPercentage + // option.TaxPercentage +
// " % ", // " % ",
}))} }))}
@ -951,7 +959,7 @@ function BSOtherServicesVerticalcat(props) {
); );
} }
return Promise.resolve(); return Promise.Nameresolve();
}, },
}, },
]} ]}
@ -1099,6 +1107,7 @@ function BSOtherServicesVerticalcat(props) {
return Promise.resolve(); return Promise.resolve();
}, },
Name,
}, },
]} ]}
> >
@ -1210,51 +1219,7 @@ function BSOtherServicesVerticalcat(props) {
pointerEvents: OrderType === 'Failed' ? 'none' : 'auto', pointerEvents: OrderType === 'Failed' ? 'none' : 'auto',
}} }}
> >
{/* {globalAllItemdata?.length > 0 && (
<div
style={{
borderRadius: Radius,
backgroundColor:
!accessOther && accessToCard
? lightenColor(SelectedCatgColor?.['BackgroundColor'], 0.4)
: SelectedCatgColor?.['BackgroundColor'],
padding: padding,
border: accessToCard && '1px solid',
borderColor:
accessToCard &&
!accessOther &&
SelectedCatgColor?.['BackgroundColor'] == '#ffffff'
? '#000000'
: SelectedCatgColor?.['BackgroundColor'] === '#000000'
? '#ffffff'
: darkenColor(SelectedCatgColor?.['BackgroundColor'], 70),
}}
// key={}
className="sampleCard"
index={indexval}
onClick={() => handleClick1()}
>
<div
style={{ flexDirection: Reverse1 }}
className="CategoryHorizontal-sub-samplecard"
>
{categoryFunction?.Image && <img src={catLogo} alt="" />}
<p
style={{
textTransform: Uppercase,
fontWeight: '600',
fontFamily: SelectedFontFamily ? SelectedFontFamily : '',
color: SelectedCatgColor
? SelectedCatgColor?.['FontColor']
: '',
}}
>
Favourites
</p>
</div>
</div>
)} */}
{(!Isdragging || draggingComponent !== 'category') && {(!Isdragging || draggingComponent !== 'category') &&
otherServiceCategoryData?.map((item, index) => ( otherServiceCategoryData?.map((item, index) => (
<div <div
@ -1281,7 +1246,7 @@ function BSOtherServicesVerticalcat(props) {
borderColor: borderColor:
index === indexval index === indexval
? '#000000' ? '#000000'
: SelectedCatgColor?.['BackgroundColor'], : SelectedCatgColor?.['BackgroundColor'],
}} }}
className="sampleCard" className="sampleCard"
@ -1418,91 +1383,7 @@ function BSOtherServicesVerticalcat(props) {
</DragDropContext> </DragDropContext>
)} )}
{/* {globalAllItemdata?.length === 0 && ( </div>
<div
style={{
borderRadius: Radius,
backgroundColor:
!accessOther && accessToCard
? lightenColor(SelectedCatgColor?.['BackgroundColor'], 0.4)
: SelectedCatgColor?.['BackgroundColor'],
padding: padding,
border: accessToCard && '1px solid',
borderColor:
accessToCard &&
!accessOther &&
SelectedCatgColor?.['BackgroundColor'] == '#ffffff'
? '#000000'
: SelectedCatgColor?.['BackgroundColor'] === '#000000'
? '#ffffff'
: SelectedCatgColor?.['BackgroundColor'],
}}
// key={}
className="sampleCard"
index={indexval}
onClick={() => handleClick1()}
>
<div
style={{ flexDirection: Reverse1 }}
className="CategoryHorizontal-sub-samplecard"
>
{categoryFunction?.Image && <img src={catLogo} alt="" />}
<p
style={{
textTransform: Uppercase,
fontWeight: '600',
fontFamily: SelectedFontFamily ? SelectedFontFamily : '',
color: SelectedCatgColor
? SelectedCatgColor?.['FontColor']
: '',
}}
>
Favourites
</p>
</div>
</div>
)} */}
{/* <div
style={{
borderRadius: Radius,
backgroundColor: accessOther
? lightenColor(SelectedCatgColor?.['BackgroundColor'], 0.4)
: SelectedCatgColor?.['BackgroundColor'],
padding: padding,
border: accessOther && '1px solid',
borderColor:
accessOther && SelectedCatgColor?.['BackgroundColor'] == '#ffffff'
? '#000000'
: SelectedCatgColor?.['BackgroundColor'] === '#000000'
? '#ffffff'
: SelectedCatgColor?.['BackgroundColor'],
}}
// key={}
className="sampleCard"
index={indexval}
onClick={() => handleClick2()}
>
<div
style={{ flexDirection: Reverse1 }}
className="CategoryHorizontal-sub-samplecard"
>
{categoryFunction?.Image && <img src={horizontal} alt="" />}
<p
style={{
textTransform: Uppercase,
fontWeight: '600',
fontFamily: SelectedFontFamily ? SelectedFontFamily : '',
color: SelectedCatgColor
? SelectedCatgColor?.['FontColor']
: '',
}}
>
Others
</p>
</div>
</div> */}
</div>
</div> </div>
); );
} }

View File

@ -1,4 +1,4 @@
import React, { useEffect, useRef, useState } from 'react'; import React, { lazy, Suspense, useEffect, useRef, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import { TiLocation } from 'react-icons/ti'; import { TiLocation } from 'react-icons/ti';
@ -24,30 +24,31 @@ import BSPrinterSetting from '../UtillComponents/BSPrinterSetting.jsx';
import { isMobile } from 'react-device-detect'; import { isMobile } from 'react-device-detect';
import { FaDisplay } from 'react-icons/fa6'; import { FaDisplay } from 'react-icons/fa6';
import { import {
FeatureAddon,
GlobalFeatAddOnData, GlobalFeatAddOnData,
PreferenceData, PreferenceData,
} from '../../../../Features/BookingScreen/BookingData/BookingData.js'; } from '../../../../Features/BookingScreen/BookingData/BookingData.js';
import { import { setCustomerDisplayWindow } from '../../../../Features/customerDisplayWindow/customerDisplayWindow';
setCustomerDisplayWindow,
closeCustomerDisplayWindow,
} from '../../../../Features/customerDisplayWindow/customerDisplayWindow';
import TooltipWrapper from '../../../../Components/Tooltip/Tooltip'; import TooltipWrapper from '../../../../Components/Tooltip/Tooltip';
import { import { userDataByUserId } from '../../../../Features/UserAccount/userData.js';
getUserProfile,
userDataByUserId,
} from '../../../../Features/UserAccount/userData.js';
import UserRelieveManager from '../../Template/RealivingUser.jsx';
import BSNavBarUserInfo from '../BSNavbar/BSNavBarUserInfo.jsx';
import BSScanTemplate from '../UtillComponents/BSScanTemplate.jsx';
import { RiFullscreenExitFill, RiFullscreenFill } from 'react-icons/ri'; import { RiFullscreenExitFill, RiFullscreenFill } from 'react-icons/ri';
import { Popconfirm, Tooltip } from 'antd'; import { Popconfirm, Tooltip } from 'antd';
import { FaCaretDown } from 'react-icons/fa'; import { FaCaretDown } from 'react-icons/fa';
const UserRelieveManager = lazy(
() => import('../../Template/RealivingUser.jsx')
);
const BSNavBarUserInfo = lazy(() => import('../BSNavbar/BSNavBarUserInfo.jsx'));
const BSScanTemplate = lazy(
() => import('../UtillComponents/BSScanTemplate.jsx')
);
const BSPrinterSetting = lazy(
() => import('../UtillComponents/BSPrinterSetting.jsx')
);
const subDirectory = import.meta.env.ENV_BASE_URL; const subDirectory = import.meta.env.ENV_BASE_URL;
const commonUrl = import.meta.env.ENV_COMMON_BASE_URL; const commonUrl = import.meta.env.ENV_COMMON_BASE_URL;
const BSC1NavBar = (props) => { const BSC1NavBar = (props) => {
const BSComboData = props?.hasOwnProperty('data') ? props['data'] : null;
const divRef = useRef(null); const divRef = useRef(null);
const navigate = useNavigate(); const navigate = useNavigate();
@ -109,16 +110,7 @@ const BSC1NavBar = (props) => {
).unwrap(); ).unwrap();
} }
}; };
// const getFeatureAddonData = async () => {
// let featureAddon = await dispatch(
// FeatureAddon({ AppId: AppId, UserId: UserId })
// ).unwrap();
// if (featureAddon?.data?.statusCode === 1) {
// setFeatureAddonData(featureAddon?.data?.data?.[0]?.FeatAddonHdr?.[0]);
// } else {
// setFeatureAddonData([]);
// }
// };
const UserAcc = () => { const UserAcc = () => {
setAccIsOpen(!isAccOpen); setAccIsOpen(!isAccOpen);
}; };
@ -197,25 +189,6 @@ const BSC1NavBar = (props) => {
console.error('Customer display window failed to open.'); console.error('Customer display window failed to open.');
} }
}; };
// const openNewTab = async () => {
// const initialData = {
// Paymentgateway: false,
// };
// const customerDisplayWindow = window.open(`${subDirectory}customer-display`, 'CustomerDisplayWindow', 'width=2000,height=5000,scrollbars=yes,resizable=yes');
// if (customerDisplayWindow && !customerDisplayWindow.closed) {
// setCustomerDisplayWindow(customerDisplayWindow);
// customerDisplayWindow.onload = () => {
// setTimeout(() => {
// customerDisplayWindow.postMessage(initialData, '*'); // Or use targetOrigin for CORS
// }, 500); // Slight delay to ensure window is ready
// };
// } else {
// console.error("Customer display window failed to open.");
// }
// };
const handleEditProfile = async () => { const handleEditProfile = async () => {
navigate(`${subDirectory}app-page/redirect-userprofile`); navigate(`${subDirectory}app-page/redirect-userprofile`);
}; };
@ -240,161 +213,167 @@ const BSC1NavBar = (props) => {
}; };
return ( return (
<> <Suspense fallback={<div>Loading...</div>}>
<div <>
className="BSC1NavBar-Container" <div
style={{ className="BSC1NavBar-Container"
// backgroundColor: style={{
// BSComboData?.BookingLayout?.[0] === 'Combo1' // backgroundColor:
// ? '#645CAA' // BSComboData?.BookingLayout?.[0] === 'Combo1'
// : '#08A7B8', // ? '#645CAA'
background: 'linear-gradient(to bottom right, #1e2536, #2a3447)', // : '#08A7B8',
}} background: 'linear-gradient(to bottom right, #1e2536, #2a3447)',
> }}
<div className="BSC1NavBar-div1"> >
<div className="BSC1NavBar-manu"> <div className="BSC1NavBar-div1">
<Popconfirm <div className="BSC1NavBar-manu">
title="Are you sure you want to go to home?" <Popconfirm
onConfirm={handleHome} title="Are you sure you want to go to home?"
okText="Yes" onConfirm={handleHome}
cancelText="No" okText="Yes"
> cancelText="No"
<PozoHomeIcon
style={{ color: '#1292EE', fontSize: '30px' }}
className="BSC1NavBar-manu-icon"
/>
</Popconfirm>{' '}
<div
className={`BSC1NavBar-manu-content ${menu ? 'BSC1NavBar-manu-menu' : ''}`}
>
<div className="BSC1NavBar-manu-div">
<TooltipWrapper
placement="right"
title="DashBoard"
isMobile={isMobile}
>
<BiSolidDashboard className="BSC1Nav-menu-icon" />
</TooltipWrapper>
<TooltipWrapper
placement="right"
title="Booking / Sale"
isMobile={isMobile}
>
<CgMenuGridR className="BSC1Nav-menu-icon" />
</TooltipWrapper>
<TooltipWrapper
placement="right"
title="TableBooking"
isMobile={isMobile}
>
<MdTableChart className="BSC1Nav-menu-icon" />
</TooltipWrapper>
<TooltipWrapper
placement="right"
title="Report"
isMobile={isMobile}
>
<BiSolidReport className="BSC1Nav-menu-icon" />
</TooltipWrapper>
</div>
</div>
</div>
<div className="BSC1NavBar-name">
{/* <PiStorefrontFill className="BSC1NavBar-name-icon" /> */}
<TooltipWrapper placement="bottom" title={branchName}>
<span className="BSC1NavBar-ellipsisname">{branchName}</span>{' '}
</TooltipWrapper>
{BranchCity && (
<span className="BSC1NavBar-location">
{' '}
<TiLocation className="BSC1NavBar-location-icon" />
<span className="BSC1NavBar-name-ellipsis">
{BranchCity}
</span>{' '}
</span>
)}
</div>
<div className="BSC1NavBar-name">
{ScanLayoutScreen?.SettingValue === 'Y' && (
<span className="BSC1NavBarlocation">
<BSScanTemplate />
</span>
)}
</div>
<div></div>
</div>
<div className="BSC1NavBar-div2">
<div className="BSC1NavBar-date">
{/* {formattedDate} */}
<TimeDisplay />
<DateDisplay />
</div>
<Tooltip title={isFullscreen ? 'Exit Full Screen' : 'Full Screen'}>
<div
className={
isFullscreen ? 'BsNavbar1FullScreenExit' : 'BsNavbar1FullScreen'
}
onClick={handleFullscreen}
>
{isFullscreen ? <RiFullscreenExitFill /> : <RiFullscreenFill />}
</div>
</Tooltip>
{FeatureAddonData?.FeatureDtls?.find(
(item) =>
item?.FeatureAddonName?.toLowerCase() === 'customer display'
) && (
<TooltipWrapper title="Customer Display" isMobile={isMobile}>
<div
onClick={openNewTab}
style={{
display: 'flex',
alignItems: 'center',
cursor: 'pointer',
}}
> >
<FaDisplay color="#1292ee" size={18} /> <PozoHomeIcon
</div> style={{ color: '#1292EE', fontSize: '30px' }}
</TooltipWrapper> className="BSC1NavBar-manu-icon"
)} />
</Popconfirm>{' '}
<div
className={`BSC1NavBar-manu-content ${menu ? 'BSC1NavBar-manu-menu' : ''}`}
>
<div className="BSC1NavBar-manu-div">
<TooltipWrapper
placement="right"
title="DashBoard"
isMobile={isMobile}
>
<BiSolidDashboard className="BSC1Nav-menu-icon" />
</TooltipWrapper>
{!isMobile && ( <TooltipWrapper
<div className="comboPrinterIcon"> placement="right"
<BSPrinterSetting /> title="Booking / Sale"
isMobile={isMobile}
>
<CgMenuGridR className="BSC1Nav-menu-icon" />
</TooltipWrapper>
<TooltipWrapper
placement="right"
title="TableBooking"
isMobile={isMobile}
>
<MdTableChart className="BSC1Nav-menu-icon" />
</TooltipWrapper>
<TooltipWrapper
placement="right"
title="Report"
isMobile={isMobile}
>
<BiSolidReport className="BSC1Nav-menu-icon" />
</TooltipWrapper>
</div>
</div>
</div> </div>
)}
<div className="BSC1NavBar-person" onClick={UserAcc}> <div className="BSC1NavBar-name">
<TooltipWrapper title="Account " isMobile={isMobile}> {/* <PiStorefrontFill className="BSC1NavBar-name-icon" /> */}
<div className="myProfileIconDrDown"> <TooltipWrapper placement="bottom" title={branchName}>
<BsFillPersonFill className="BSC1NavBar-person-icon" /> <span className="BSC1NavBar-ellipsisname">
<FaCaretDown /> {branchName}
</div> </span>{' '}
</TooltipWrapper> </TooltipWrapper>
{BranchCity && (
<span className="BSC1NavBar-location">
{' '}
<TiLocation className="BSC1NavBar-location-icon" />
<span className="BSC1NavBar-name-ellipsis">
{BranchCity}
</span>{' '}
</span>
)}
</div>
<div className="BSC1NavBar-name">
{ScanLayoutScreen?.SettingValue === 'Y' && (
<span className="BSC1NavBarlocation">
<BSScanTemplate />
</span>
)}
</div>
<div></div>
</div>
<div className="BSC1NavBar-div2">
<div className="BSC1NavBar-date">
{/* {formattedDate} */}
<TimeDisplay />
<DateDisplay />
</div>
<Tooltip title={isFullscreen ? 'Exit Full Screen' : 'Full Screen'}>
<div
className={
isFullscreen
? 'BsNavbar1FullScreenExit'
: 'BsNavbar1FullScreen'
}
onClick={handleFullscreen}
>
{isFullscreen ? <RiFullscreenExitFill /> : <RiFullscreenFill />}
</div>
</Tooltip>
{FeatureAddonData?.FeatureDtls?.find(
(item) =>
item?.FeatureAddonName?.toLowerCase() === 'customer display'
) && (
<TooltipWrapper title="Customer Display" isMobile={isMobile}>
<div
onClick={openNewTab}
style={{
display: 'flex',
alignItems: 'center',
cursor: 'pointer',
}}
>
<FaDisplay color="#1292ee" size={18} />
</div>
</TooltipWrapper>
)}
{!isMobile && (
<div className="comboPrinterIcon">
<BSPrinterSetting />
</div>
)}
<div className="BSC1NavBar-person" onClick={UserAcc}>
<TooltipWrapper title="Account " isMobile={isMobile}>
<div className="myProfileIconDrDown">
<BsFillPersonFill className="BSC1NavBar-person-icon" />
<FaCaretDown />
</div>
</TooltipWrapper>
</div>
{isAccOpen && (
<BSNavBarUserInfo
isOpen={isAccOpen}
divRef={divRef}
CompBranchData={CompBranchData}
BacktoLogin={BacktoLogin}
userProfileData={userProfileData}
handleEditProfile={handleEditProfile}
UserRelieveManager={<UserRelieveManager />}
Logout={Logout}
/>
)}
</div> </div>
{isAccOpen && (
<BSNavBarUserInfo
isOpen={isAccOpen}
divRef={divRef}
CompBranchData={CompBranchData}
BacktoLogin={BacktoLogin}
userProfileData={userProfileData}
handleEditProfile={handleEditProfile}
UserRelieveManager={<UserRelieveManager />}
Logout={Logout}
/>
)}
</div> </div>
</div> </>
</> </Suspense>
); );
}; };

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,11 @@
import { useEffect, useRef, useState, useCallback } from 'react'; import {
useEffect,
useRef,
useState,
useCallback,
Suspense,
lazy,
} from 'react';
import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import moment from 'moment'; import moment from 'moment';
import { BiBarcodeReader } from 'react-icons/bi'; import { BiBarcodeReader } from 'react-icons/bi';
@ -54,7 +61,9 @@ import { Messages } from '../../../../Components/Notifications/Messages';
import FormHeader from '../../../PageComponents/FormHeader'; import FormHeader from '../../../PageComponents/FormHeader';
import { DefaultModal } from '../../../../Components/Modal/DefaultModal'; import { DefaultModal } from '../../../../Components/Modal/DefaultModal';
import { Tables } from '../../../../Components/Tables/Table'; import { Tables } from '../../../../Components/Tables/Table';
import FeaturesFunctionalities from '../BookingFunctionality/FeaturesFunctionalities'; const FeaturesFunctionalities = lazy(
() => import('../BookingFunctionality/FeaturesFunctionalities')
);
import { isMobile } from 'react-device-detect'; import { isMobile } from 'react-device-detect';
import BarcodeScanner from '../UtillComponents/BarcodeScanner.jsx'; import BarcodeScanner from '../UtillComponents/BarcodeScanner.jsx';
import { import {
@ -80,11 +89,20 @@ import {
import { Global_PromoCodeOffers } from '../../../../Features/Offer/Offer.js'; import { Global_PromoCodeOffers } from '../../../../Features/Offer/Offer.js';
import { validateOffers } from '../BSItemCards/ValidateOffer.jsx'; import { validateOffers } from '../BSItemCards/ValidateOffer.jsx';
import { useSaleswiseOfferWatcher } from '../BSItemCards/SalesWiseOffer.jsx'; import { useSaleswiseOfferWatcher } from '../BSItemCards/SalesWiseOffer.jsx';
import ExpireConfirmModal from '../BookingFunctionality/ExpireConfirmModal.jsx'; const ExpireConfirmModal = lazy(
import BarCodeScan from '../../../../Services/BarCodeScan.jsx'; () => import('../BookingFunctionality/ExpireConfirmModal.jsx')
);
const BarcodeScanner = lazy(
() => import('../UtillComponents/BarcodeScanner.jsx')
);
const BSNavBarWeightScale = lazy(
() => import('../UtillComponents/BSNavBarWeightScale.jsx')
);
export default function BSC1Search(props) { export default function BSC1Search(props) {
const dispatch = useDispatch(); const dispatch = useDispatch();
const searchPromiseRef = useRef(null); const searchPromiseRef = useRef(null);
const debounceTimerRef = useRef(null); const debounceTimerRef = useRef(null);
const SessionData = useSelector(StoredSessionData); const SessionData = useSelector(StoredSessionData);
@ -4499,335 +4517,349 @@ export default function BSC1Search(props) {
const widthBasedOnProdVariantDetails = getMaxBrandWidth(); const widthBasedOnProdVariantDetails = getMaxBrandWidth();
return ( return (
<> <Suspense fallback={<div>Loading...</div>}>
<div <>
className="BSC1Search-container"
ref={containerRef}
onFocus={handleFocus}
>
<Messages
messageType={messageType}
messageData={messageData}
onComplete={onComplete}
/>
<div <div
className="BSC1Search-div1" className="BSC1Search-container"
style={{ pointerEvents: OrderType === 'Failed' ? 'none' : 'auto' }} ref={containerRef}
onClick={() => OnfocusTrue()} onFocus={handleFocus}
> >
<Form ref={formRef}> <Messages
<Form.Item name="ItemName"> messageType={messageType}
<AutoComplete messageData={messageData}
options={ onComplete={onComplete}
Array.isArray(ProductList) &&
ProductList?.map((option) => ({
value: option.ProdName,
label: (
<div style={{ display: 'flex' }}>
<div
style={{
display: 'flex',
justifyContent: 'space-between',
width: '100%',
}}
onClick={() => {
setOnePeiceFlow(false);
}}
>
{option.ProdName}
</div>
<div>
{option.ProductDetail?.filter(
(item) => item.OnePcsAvailable == 'Y'
).length !== 0 && (
<GoTriangleRight
style={{
fontSize: '25px',
}}
onClick={() => {
setOnePeiceFlow(true);
}}
/>
)}
</div>
</div>
),
}))
}
className="Search-auto-field"
ref={inputRef}
onChange={ProductNameOnChange}
onSelect={ProductOnSelect}
placeholder="Product Name (SHIFT + S)"
allowClear={{
clearIcon: <CloseSquareFilled />,
}}
autoFocus={autoCompleteVisible}
onFocus={handleFocus}
/>
</Form.Item>
</Form>
{isMobile && screenWidth <= 768 && (
// <BiBarcodeReader
// className="BSC1Search-barcodeicon"
// onClick={() => handleQrcode()}
// // onClick={() => OnfocusTrue()}
// />
<BarCodeScan
onScan={(value) => {
ProductNameOnChange(value, true);
}}
/>
)}
<FiSearch
className="BSC1Search-searchicon"
// onClick={() => OnfocusTrue()}
/> />
</div> <div
{ProductSearch?.length > 5 && className="BSC1Search-div1"
QuickAdd && style={{ pointerEvents: OrderType === 'Failed' ? 'none' : 'auto' }}
GetmultipleSearchDatas.some((e) => e.toLowerCase() === 'qrcode') && ( onClick={() => OnfocusTrue()}
<div> >
<FeaturesFunctionalities <Form ref={formRef}>
handleQuickAddCancel={handleQuickCancel} <Form.Item name="ItemName">
QuickAdd={QuickAdd} <AutoComplete
ProductSearch={true} options={
ProductSearchType={'C'} Array.isArray(ProductList) &&
cardData={SelectedDatas} ProductList?.map((option) => ({
value: option.ProdName,
label: (
<div style={{ display: 'flex' }}>
<div
style={{
display: 'flex',
justifyContent: 'space-between',
width: '100%',
}}
onClick={() => {
setOnePeiceFlow(false);
}}
>
{option.ProdName}
</div>
<div>
{option.ProductDetail?.filter(
(item) => item.OnePcsAvailable == 'Y'
).length !== 0 && (
<GoTriangleRight
style={{
fontSize: '25px',
}}
onClick={() => {
setOnePeiceFlow(true);
}}
/>
)}
</div>
</div>
),
}))
}
className="Search-auto-field"
ref={inputRef}
onChange={ProductNameOnChange}
onSelect={ProductOnSelect}
placeholder="Product Name (SHIFT + S)"
allowClear={{
clearIcon: <CloseSquareFilled />,
}}
autoFocus={autoCompleteVisible}
onFocus={handleFocus}
/>
</Form.Item>
</Form>
{isMobile && screenWidth <= 768 && (
// <BiBarcodeReader
// className="BSC1Search-barcodeicon"
// onClick={() => handleQrcode()}
// // onClick={() => OnfocusTrue()}
// />
<BarCodeScan
onScan={(value) => {
ProductNameOnChange(value, true);
}}
/> />
</div> )}
)}
{BSComboData == 'Combo1' &&
FeatureAddonData?.FeatureDtls?.find(
(item) => item?.FeatureAddonName?.toLowerCase() === 'weight scale'
) && <BSNavBarWeightScale Combo="combolayout" />}
</div>
{expireModal?.open && (
<ExpireConfirmModal
open={expireModal?.open}
title={expireModal?.title}
onOk={() => {
expireModal.onOk?.();
closeExpireModal();
}}
onCancel={() => {
expireModal.onCancel?.();
closeExpireModal();
}}
/>
)}
<DefaultModal <FiSearch
title={ className="BSC1Search-searchicon"
<div className="EditQuantity-title"> // onClick={() => OnfocusTrue()}
<FormHeader title={'Item Quantity'} /> />
</div> </div>
} {ProductSearch?.length > 5 &&
open={modelQty} QuickAdd &&
width={widthBasedOnProdVariantDetails} GetmultipleSearchDatas.some(
footer={null} (e) => e.toLowerCase() === 'qrcode'
handleCancel={CloseModal} ) && (
> <div>
<div> <FeaturesFunctionalities
<div className="EditQuantity-heading"> handleQuickAddCancel={handleQuickCancel}
<div className="EditQuantity-headingname"> QuickAdd={QuickAdd}
<p className="EditQuantity-itemname">Item Name:</p> ProductSearch={true}
ProductSearchType={'C'}
cardData={SelectedDatas}
/>
</div>
)}
{BSComboData == 'Combo1' &&
FeatureAddonData?.FeatureDtls?.find(
(item) => item?.FeatureAddonName?.toLowerCase() === 'weight scale'
) && <BSNavBarWeightScale Combo="combolayout" />}
</div>
{expireModal?.open && (
<ExpireConfirmModal
open={expireModal?.open}
title={expireModal?.title}
onOk={() => {
expireModal.onOk?.();
closeExpireModal();
}}
onCancel={() => {
expireModal.onCancel?.();
closeExpireModal();
}}
/>
)}
<DefaultModal
title={
<div className="EditQuantity-title">
<FormHeader title={'Item Quantity'} />
</div>
}
open={modelQty}
width={widthBasedOnProdVariantDetails}
footer={null}
handleCancel={CloseModal}
>
<div>
<div className="EditQuantity-heading">
<div className="EditQuantity-headingname">
<p className="EditQuantity-itemname">Item Name:</p>
</div>
<div
className="EditQuantity-headingproductname"
style={{ marginLeft: '1rem' }}
>
<p className="EditQuantity-productname">{qtydata?.ProdName}</p>
</div>
</div> </div>
<div <div
className="EditQuantity-headingproductname" className={
style={{ marginLeft: '1rem' }} BrandCheckresult ? 'Card-modal-table' : 'Brand-Card-modal-table'
}
> >
<p className="EditQuantity-productname">{qtydata?.ProdName}</p> {Object.keys(brandMapping)?.map((brandId) => (
</div> <div key={brandId} className="Brand-Card">
</div> <div className="Brandname">
<div <h4>
className={ {' '}
BrandCheckresult ? 'Card-modal-table' : 'Brand-Card-modal-table' {brandId !== 'null' && brandId !== 'undefined'
} ? brandId
> : ''}
{Object.keys(brandMapping)?.map((brandId) => ( </h4>
<div key={brandId} className="Brand-Card"> </div>
<div className="Brandname">
<h4>
{' '}
{brandId !== 'null' && brandId !== 'undefined'
? brandId
: ''}
</h4>
</div>
<div className="BrandDetail"> <div className="BrandDetail">
{brandMapping[brandId]?.map((item, index) => ( {brandMapping[brandId]?.map((item, index) => (
<div key={index}> <div key={index}>
<div <div
className={ className={
returnQtyCount(item?.ProdId, item, CartOrderDetails) > returnQtyCount(
0 || item?.StockAvailable !== 'Y' item?.ProdId,
? 'ItemQtyCard' item,
: 'ItemQtyCard-disabled' CartOrderDetails
} ) > 0 || item?.StockAvailable !== 'Y'
onClick={() => VarientFun(item)} ? 'ItemQtyCard'
> : 'ItemQtyCard-disabled'
<div className="ItemQtyImgCard"> }
<img onClick={() => VarientFun(item)}
src={ >
item?.ProdLogo && <div className="ItemQtyImgCard">
item?.ProdLogo != null && <img
item?.ProdLogo != undefined src={
? item?.ProdLogo item?.ProdLogo &&
: defaultimage item?.ProdLogo != null &&
} item?.ProdLogo != undefined
width={'80px'} ? item?.ProdLogo
height={'70px'} : defaultimage
alt={`Product ${index}`}
/>
</div>
<div className="qtyDetail">
<p className="qtyUomName">
{item?.Size + ' ' + item?.UomName}
</p>
{returnQtyCount(
item?.ProdId,
item,
CartOrderDetails
) > 0 || item?.StockAvailable !== 'Y' ? (
<p className="qtyprice">
<sup style={{ fontFamily: 'Gilroy' }}></sup>
&nbsp;
{
item?.ProdVariantDetails?.[0]?.StockDetails?.[0]
?.SellPrice
} }
width={'80px'}
height={'70px'}
alt={`Product ${index}`}
/>
</div>
<div className="qtyDetail">
<p className="qtyUomName">
{item?.Size + ' ' + item?.UomName}
</p> </p>
) : ( {returnQtyCount(
'' item?.ProdId,
)} item,
CartOrderDetails
) > 0 || item?.StockAvailable !== 'Y' ? (
<p className="qtyprice">
<sup style={{ fontFamily: 'Gilroy' }}></sup>
&nbsp;
{
item?.ProdVariantDetails?.[0]
?.StockDetails?.[0]?.SellPrice
}
</p>
) : (
''
)}
</div>
</div> </div>
</div> </div>
</div> ))}
))} </div>
{brandId !== 'null' && brandId !== 'undefined' ? (
<hr></hr>
) : (
''
)}
</div> </div>
{brandId !== 'null' && brandId !== 'undefined' ? <hr></hr> : ''} ))}
</div>
))}
{Object.keys(brandMapping).length === 0 && ( {Object.keys(brandMapping).length === 0 && (
<p>No product details available</p> <p>No product details available</p>
)} )}
</div>
</div>
</DefaultModal>
<DefaultModal
title={
<div className="EditQuantity-title">
<FormHeader title={'Item Stock'} />
</div>
}
open={modelstock}
// width={500}
footer={null}
handleCancel={CloseModal1}
>
<div>
<div
className="EditQuantity-heading"
style={{
display: 'flex',
flexDirection: 'column',
marginBottom: '3rem',
alignItems: 'start',
}}
>
<div style={{ display: 'flex' }}>
<div className="EditQuantity-headingname">
<p className="EditQuantity-itemname">Item Name:</p>
</div>
<div
className="EditQuantity-headingproductname"
style={{ marginLeft: '1rem' }}
>
<p className="EditQuantity-productname">{qtydata?.ProdName}</p>
</div>
</div>
<div style={{ display: 'flex' }}>
<div className="EditQuantity-headingname">
<p className="EditQuantity-itemname">Item Quantity:</p>
</div>
<div
className="EditQuantity-headingproductname"
style={{ marginLeft: '1rem' }}
>
<p className="EditQuantity-productname">
{qtydata?.ProductDetail?.[QtyIndex]?.Size}{' '}
{onePeiceFlow
? 'PCS'
: qtydata?.ProductDetail?.[QtyIndex]?.UomName}
</p>
</div>
</div> </div>
</div> </div>
<div className="StockVariantModal"> </DefaultModal>
<Tables columns={stockcolumns} data={stockdataSource} /> <DefaultModal
</div> title={
</div> <div className="EditQuantity-title">
</DefaultModal> <FormHeader title={'Item Stock'} />
<DefaultModal </div>
title={ }
<div className="EditQuantity-title"> open={modelstock}
<FormHeader title={'Item Varients'} /> // width={500}
</div> footer={null}
} handleCancel={CloseModal1}
open={ModalVarient} >
width={500} <div>
footer={null} <div
handleCancel={CloseVarientModal} className="EditQuantity-heading"
> style={{
<div> display: 'flex',
<div flexDirection: 'column',
className="EditQuantity-heading" marginBottom: '3rem',
style={{ alignItems: 'start',
display: 'flex', }}
flexDirection: 'column', >
marginBottom: '3rem', <div style={{ display: 'flex' }}>
alignItems: 'start', <div className="EditQuantity-headingname">
}} <p className="EditQuantity-itemname">Item Name:</p>
> </div>
<div style={{ display: 'flex' }}> <div
<div className="EditQuantity-headingname"> className="EditQuantity-headingproductname"
<p className="EditQuantity-itemname">Item Name:</p> style={{ marginLeft: '1rem' }}
>
<p className="EditQuantity-productname">
{qtydata?.ProdName}
</p>
</div>
</div> </div>
<div <div style={{ display: 'flex' }}>
className="EditQuantity-headingproductname" <div className="EditQuantity-headingname">
style={{ marginLeft: '1rem' }} <p className="EditQuantity-itemname">Item Quantity:</p>
> </div>
<p className="EditQuantity-productname">{qtydata?.ProdName}</p> <div
className="EditQuantity-headingproductname"
style={{ marginLeft: '1rem' }}
>
<p className="EditQuantity-productname">
{qtydata?.ProductDetail?.[QtyIndex]?.Size}{' '}
{onePeiceFlow
? 'PCS'
: qtydata?.ProductDetail?.[QtyIndex]?.UomName}
</p>
</div>
</div> </div>
</div> </div>
<div style={{ display: 'flex' }}> <div className="StockVariantModal">
<div className="EditQuantity-headingname"> <Tables columns={stockcolumns} data={stockdataSource} />
<p className="EditQuantity-itemname">Item Quantity:</p>
</div>
<div
className="EditQuantity-headingproductname"
style={{ marginLeft: '1rem' }}
>
<p className="EditQuantity-productname">
{qtydata?.ProductDetail?.[QtyIndex]?.Size}{' '}
{onePeiceFlow
? 'PCS'
: qtydata?.ProductDetail?.[QtyIndex]?.UomName}
</p>
</div>
</div> </div>
</div> </div>
<div className="Card-modal-table"> </DefaultModal>
<Tables columns={varientcolumns} data={varientdataSource} /> <DefaultModal
title={
<div className="EditQuantity-title">
<FormHeader title={'Item Varients'} />
</div>
}
open={ModalVarient}
width={500}
footer={null}
handleCancel={CloseVarientModal}
>
<div>
<div
className="EditQuantity-heading"
style={{
display: 'flex',
flexDirection: 'column',
marginBottom: '3rem',
alignItems: 'start',
}}
>
<div style={{ display: 'flex' }}>
<div className="EditQuantity-headingname">
<p className="EditQuantity-itemname">Item Name:</p>
</div>
<div
className="EditQuantity-headingproductname"
style={{ marginLeft: '1rem' }}
>
<p className="EditQuantity-productname">
{qtydata?.ProdName}
</p>
</div>
</div>
<div style={{ display: 'flex' }}>
<div className="EditQuantity-headingname">
<p className="EditQuantity-itemname">Item Quantity:</p>
</div>
<div
className="EditQuantity-headingproductname"
style={{ marginLeft: '1rem' }}
>
<p className="EditQuantity-productname">
{qtydata?.ProductDetail?.[QtyIndex]?.Size}{' '}
{onePeiceFlow
? 'PCS'
: qtydata?.ProductDetail?.[QtyIndex]?.UomName}
</p>
</div>
</div>
</div>
<div className="Card-modal-table">
<Tables columns={varientcolumns} data={varientdataSource} />
</div>
</div> </div>
</div> </DefaultModal>
</DefaultModal> {/* {isMobile && screenWidth <= 768 && (
{/* {isMobile && screenWidth <= 768 && (
<DefaultModal <DefaultModal
title="Barcode Reader" title="Barcode Reader"
width={800} width={800}
@ -4846,6 +4878,7 @@ export default function BSC1Search(props) {
)} )}
</DefaultModal> </DefaultModal>
)} */} )} */}
</> </>
</Suspense>
); );
} }

View File

@ -6098,7 +6098,7 @@ const BSItemCard = (props) => {
style={{ style={{
position: 'relative', position: 'relative',
overflow: 'hidden', overflow: 'hidden',
scrollbarWidth:"none" scrollbarWidth: 'none',
}} }}
className={ className={
(item?.OverAllQty !== undefined && (item?.OverAllQty !== undefined &&

View File

@ -223,9 +223,9 @@ export const useRemoveFromCart = () => {
AppId: AppId, AppId: AppId,
...(AvailableDate && selectedDate ...(AvailableDate && selectedDate
? { ? {
fromDate: selectedDate?.[0], fromDate: selectedDate?.[0],
toDate: selectedDate?.[1], toDate: selectedDate?.[1],
} }
: {}), : {}),
}; };
await dispatch(getSelectedFavItems(data)).unwrap(); await dispatch(getSelectedFavItems(data)).unwrap();
@ -237,9 +237,9 @@ export const useRemoveFromCart = () => {
ProdSubCat: useSelector((state) => state.BookingData.ProductSubCategorie), ProdSubCat: useSelector((state) => state.BookingData.ProductSubCategorie),
...(AvailableDate && selectedDate ...(AvailableDate && selectedDate
? { ? {
fromDate: selectedDate?.[0], fromDate: selectedDate?.[0],
toDate: selectedDate?.[1], toDate: selectedDate?.[1],
} }
: {}), : {}),
}; };
@ -250,9 +250,9 @@ export const useRemoveFromCart = () => {
prodCat: useSelector((state) => state.BookingData.ProductCategorie), prodCat: useSelector((state) => state.BookingData.ProductCategorie),
...(AvailableDate && selectedDate ...(AvailableDate && selectedDate
? { ? {
fromDate: selectedDate?.[0], fromDate: selectedDate?.[0],
toDate: selectedDate?.[1], toDate: selectedDate?.[1],
} }
: {}), : {}),
}; };
@ -345,26 +345,26 @@ export const useRemoveFromCart = () => {
console.log('isItemInCart', isItemInCart); console.log('isItemInCart', isItemInCart);
if (isItemInCart?.OrderQty > 1) { if (isItemInCart?.OrderQty > 1) {
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 UpdatedcardData = [UpdatedCartItem, ...UpdatedData]; const UpdatedcardData = [UpdatedCartItem, ...UpdatedData];
if (OfferCheckedInSetup && preferenceOffer) { if (OfferCheckedInSetup && preferenceOffer) {

View File

@ -1,15 +1,16 @@
import React from 'react'; import React, { lazy, Suspense } from 'react';
import { MdEdit } from 'react-icons/md'; import { MdEdit } from 'react-icons/md';
import { FaUserLarge } from 'react-icons/fa6'; import { FaUserLarge } from 'react-icons/fa6';
import { BiSolidPhoneCall } from 'react-icons/bi'; import { BiSolidPhoneCall } from 'react-icons/bi';
import { PiSignOutLight } from 'react-icons/pi'; import { PiSignOutLight } from 'react-icons/pi';
import user from '../../../../Images/dashboard/user.jpg'; import user from '../../../../Images/dashboard/user.jpg';
import { clearSession, getSession } from '../../../../Services/Others'; import { clearSession, getSession } from '../../../../Services/Others';
import UserRelieveManager from '../../Template/RealivingUser';
import { GlobalCompBranchData } from '../../../../Features/BrachLogin/BranchLogin'; import { GlobalCompBranchData } from '../../../../Features/BrachLogin/BranchLogin';
import { userDataByUserId } from '../../../../Features/UserAccount/userData'; import { userDataByUserId } from '../../../../Features/UserAccount/userData';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
const UserRelieveManager = lazy(() => import('../../Template/RealivingUser'));
// Scss
import "../../../../Styles/BookingScreen/Components/BSNavbar/BSNavbar1.scss" import "../../../../Styles/BookingScreen/Components/BSNavbar/BSNavbar1.scss"
const subDirectory = import.meta.env.ENV_BASE_URL; const subDirectory = import.meta.env.ENV_BASE_URL;
@ -37,65 +38,67 @@ const BSNavBarUserInfo = ({
navigate(`${subDirectory}app-page/branch-login`); navigate(`${subDirectory}app-page/branch-login`);
}; };
return ( return (
<div ref={divRef} className="BSNavBar1-Accmenu"> <Suspense fallback={<div>Loading</div>}>
<div className="BSNavBar1-Acc-menu"> <div ref={divRef} className="BSNavBar1-Accmenu">
{CompBranchData?.length > 1 && ( <div className="BSNavBar1-Acc-menu">
<div onClick={BacktoLogin}> {CompBranchData?.length > 1 && (
<p className="BSNavBar1-Acc-menu-list">Back to Signin</p> <div onClick={BacktoLogin}>
</div> <p className="BSNavBar1-Acc-menu-list">Back to Signin</p>
)} </div>
<div className="salesUserProfile" style={{ position: 'relative' }}> )}
<div <div className="salesUserProfile" style={{ position: 'relative' }}>
style={{ <div
position: 'absolute',
top: '5px',
right: '5px',
cursor: 'pointer',
display: 'flex',
justifyContent: 'flex-end',
gap: '1rem',
}}
>
{/* {UserType != 'Employee' && */}
<MdEdit size={16} onClick={handleEditProfile} />
{/* } */}
<UserRelieveManager />
</div>
<img
src={
userProfileData?.UserImage && userProfileData.UserImage !== ''
? userProfileData.UserImage
: user
}
alt={userProfileData?.UserName || 'User'}
onError={(e) => {
e.target.onerror = null;
e.target.src = user;
}}
/>
<div>
<FaUserLarge size={14} /> {userProfileData?.UserName || 'Name'}
<p
style={{ style={{
fontSize: '12px', position: 'absolute',
textTransform: 'uppercase', top: '5px',
color: '#0b53b3', right: '5px',
fontWeight: '500', cursor: 'pointer',
display: 'flex',
justifyContent: 'flex-end',
gap: '1rem',
}} }}
> >
({UserType}) {/* {UserType != 'Employee' && */}
<MdEdit size={16} onClick={handleEditProfile} />
{/* } */}
<UserRelieveManager />
</div>
<img
src={
userProfileData?.UserImage && userProfileData.UserImage !== ''
? userProfileData.UserImage
: user
}
alt={userProfileData?.UserName || 'User'}
onError={(e) => {
e.target.onerror = null;
e.target.src = user;
}}
/>
<div>
<FaUserLarge size={14} /> {userProfileData?.UserName || 'Name'}
<p
style={{
fontSize: '12px',
textTransform: 'uppercase',
color: '#0b53b3',
fontWeight: '500',
}}
>
({UserType})
</p>
</div>
<div>
<BiSolidPhoneCall size={16} />{' '}
{userProfileData?.MobileNo || 'Number'}
</div>
<p className="BSNavBar1-Acc-menu-list" onClick={Logout}>
Sign Out <PiSignOutLight size={16} strokeWidth={10} />
</p> </p>
</div> </div>
<div>
<BiSolidPhoneCall size={16} />{' '}
{userProfileData?.MobileNo || 'Number'}
</div>
<p className="BSNavBar1-Acc-menu-list" onClick={Logout}>
Sign Out <PiSignOutLight size={16} strokeWidth={10} />
</p>
</div> </div>
</div> </div>
</div> </Suspense>
); );
}; };

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,11 @@
import { useEffect, useRef, useState, useCallback } from 'react'; import {
useEffect,
useRef,
useState,
useCallback,
Suspense,
lazy,
} from 'react';
import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import { import {
getConfigType, getConfigType,
@ -43,13 +50,17 @@ import {
validateSafeInput, validateSafeInput,
} from '../../../../Services/Others.js'; } from '../../../../Services/Others.js';
import WpIcon from '../../../../Images/message.png'; import WpIcon from '../../../../Images/message.png';
import QrinScreen from '../BookingFunctionality/DynamicScreenQr.jsx'; const QrinScreen = lazy(
() => import('../BookingFunctionality/DynamicScreenQr.jsx')
);
import { import {
getTemplateData, getTemplateData,
SelectedPrintTemplate, SelectedPrintTemplate,
} from '../../../../Features/ThemeChange/ThemeChange.js'; } from '../../../../Features/ThemeChange/ThemeChange.js';
import '../../../../Styles/BookingScreen/Components/BookingFunctionality/SplitPayment.scss'; import '../../../../Styles/BookingScreen/Components/BookingFunctionality/SplitPayment.scss';
import FeaturesFunctionalities from './FeaturesFunctionalities.jsx'; const FeaturesFunctionalities = lazy(
() => import('./FeaturesFunctionalities.jsx')
);
import numberToWords from 'number-to-words'; import numberToWords from 'number-to-words';
import { getCustomerDisplayWindow } from '../../../../Features/customerDisplayWindow/customerDisplayWindow.js'; import { getCustomerDisplayWindow } from '../../../../Features/customerDisplayWindow/customerDisplayWindow.js';
import { getConfigTypeData } from '../../../../Features/ConfigMasterPage/ConfigMasterPage.js'; import { getConfigTypeData } from '../../../../Features/ConfigMasterPage/ConfigMasterPage.js';
@ -93,7 +104,7 @@ const CreditCustSplitPayment = (props) => {
const [UpiPayOption, setUpiPayOption] = useState([]); const [UpiPayOption, setUpiPayOption] = useState([]);
const [CardPayOption, setCardPayOption] = useState([]); const [CardPayOption, setCardPayOption] = useState([]);
const GlobaluseOptions = useSelector(GlobalCommonPaymentOptions); const GlobaluseOptions = useSelector(GlobalCommonPaymentOptions);
const RetailWSSalesType= useSelector(GlobalRetailWSSalesType, shallowEqual); const RetailWSSalesType = useSelector(GlobalRetailWSSalesType, shallowEqual);
const [useOptions, setuseOptions] = useState([]); const [useOptions, setuseOptions] = useState([]);
const BookingType = useSelector(GlobalBookingType); const BookingType = useSelector(GlobalBookingType);
const BookingTypeBoth = useSelector(GlobalBookingTypeBoth); const BookingTypeBoth = useSelector(GlobalBookingTypeBoth);
@ -730,7 +741,7 @@ const CreditCustSplitPayment = (props) => {
(item) => item?.ConfigName?.toLowerCase() == 'DEP'.toLowerCase() (item) => item?.ConfigName?.toLowerCase() == 'DEP'.toLowerCase()
); );
let postData = { let postData = {
SalesMode:RetailWSSalesType || 'R', SalesMode: RetailWSSalesType || 'R',
CompId: CompId, CompId: CompId,
BranchId: BranchId, BranchId: BranchId,
Type: obId?.[0]?.ConfigId, Type: obId?.[0]?.ConfigId,
@ -1241,139 +1252,141 @@ const CreditCustSplitPayment = (props) => {
: 'Debit amount not available'; : 'Debit amount not available';
return ( return (
<> <Suspense fallback={<div>Loading features...</div>}>
<Messages messageType={messageType} messageData={messageData} /> <>
<div className="splitmodal"> <Messages messageType={messageType} messageData={messageData} />
<DefaultModal <div className="splitmodal">
open={Splitpayment} <DefaultModal
title="Split Payment" open={Splitpayment}
handleCancel={() => { title="Split Payment"
SplitSelPayMode[`PaymentStatus-0`] !== 'S' && HandleModalClose(); handleCancel={() => {
}} SplitSelPayMode[`PaymentStatus-0`] !== 'S' && HandleModalClose();
footer={false} }}
width={1000} footer={false}
children={ width={1000}
<div> children={
<p>Total Amount:{TotalAmount}</p> <div>
<p>Total Amount:{TotalAmount}</p>
<>{calculateField()}</> <>{calculateField()}</>
{TotalAmount > TotalSplitAmount && {TotalAmount > TotalSplitAmount &&
SplitSelPayMode[`PaymentStatus-${count}`] === 'S' && ( SplitSelPayMode[`PaymentStatus-${count}`] === 'S' && (
<Form.Item> <Form.Item>
<div <div
style={{
display: 'flex',
justifyContent: 'flex-end',
}}
>
<PlusOutlined
style={{ style={{
backgroundColor: '#37943C', display: 'flex',
color: 'white', justifyContent: 'flex-end',
borderRadius: '50px',
padding: '5px',
}} }}
onClick={() => setCount(count + 1)} >
/> <PlusOutlined
</div> style={{
</Form.Item> backgroundColor: '#37943C',
)} color: 'white',
</div> borderRadius: '50px',
} padding: '5px',
/> }}
</div> onClick={() => setCount(count + 1)}
{TotalAmount == 0 && Success && ( />
<div> </div>
<QrComponent com={`WelcomeScreen**${branchName}`} /> </Form.Item>
)}
</div>
}
/>
</div> </div>
)} {TotalAmount == 0 && Success && (
{TotalAmount > 0 &&
qrCode &&
PaymentUpiOptions?.length > 0 &&
SelUpiId && (
<div> <div>
<QrComponent <QrComponent com={`WelcomeScreen**${branchName}`} />
com={`DisplayQRCodeScreen**upi://pay?pa=${SelUpiId}&pn=Bonrix&cu=INR&am=${TotalAmount}&pn=Bonrix%20Software%20Systems**${TotalAmount}**${SelUpiId}`}
/>
</div> </div>
)} )}
{UpiOpen && ( {TotalAmount > 0 &&
<DefaultModal qrCode &&
open={UpiOpen} PaymentUpiOptions?.length > 0 &&
title="UPI PAYMENT" SelUpiId && (
width={500} <div>
handleCancel={() => { <QrComponent
Upimodel('Cancel'); com={`DisplayQRCodeScreen**upi://pay?pa=${SelUpiId}&pn=Bonrix&cu=INR&am=${TotalAmount}&pn=Bonrix%20Software%20Systems**${TotalAmount}**${SelUpiId}`}
}} />
footer={false} </div>
children={ )}
<div style={{ overflow: 'scroll' }}> {UpiOpen && (
<div <DefaultModal
style={{ open={UpiOpen}
display: 'flex', title="UPI PAYMENT"
flexDirection: 'column', width={500}
justifyContent: 'space-evenly', handleCancel={() => {
alignItems: 'center', Upimodel('Cancel');
}} }}
> footer={false}
<div> children={
<QrinScreen Amount={CurrentPayAmount} UpiId={SelUpiId} /> <div style={{ overflow: 'scroll' }}>
</div>
<div>
<h1> RS :{CurrentPayAmount} </h1>
</div>
</div>
<div className="sentok">
{(selOption || SelCustId) && (
<div className="sentLink" onClick={onFinalSubmit}>
Sent Payment Link
<img
src={WpIcon}
alt="Your Alt Text"
style={{ width: '30px', height: '30px' }}
/>
</div>
)}
<div <div
style={{ style={{
display: 'flex', display: 'flex',
flexDirection: 'row-reverse', flexDirection: 'column',
width: '100px', justifyContent: 'space-evenly',
alignItems: 'center',
}} }}
> >
<Buttons <div>
buttonText="OK" <QrinScreen Amount={CurrentPayAmount} UpiId={SelUpiId} />
color="901D77" </div>
icon={<ArrowRightOutlined />}
handleSubmit={() => { <div>
Upimodel('Submit'); <h1> RS :{CurrentPayAmount} </h1>
</div>
</div>
<div className="sentok">
{(selOption || SelCustId) && (
<div className="sentLink" onClick={onFinalSubmit}>
Sent Payment Link
<img
src={WpIcon}
alt="Your Alt Text"
style={{ width: '30px', height: '30px' }}
/>
</div>
)}
<div
style={{
display: 'flex',
flexDirection: 'row-reverse',
width: '100px',
}} }}
/> >
<Buttons
buttonText="OK"
color="901D77"
icon={<ArrowRightOutlined />}
handleSubmit={() => {
Upimodel('Submit');
}}
/>
</div>
</div> </div>
</div> </div>
</div> }
}
/>
)}
{addcustomer && (
<FeaturesFunctionalities
handleAddCustomerCancel={handleAddCustomerCancel}
addcustomer={addcustomer}
/>
)}
{Object.keys(PrintDatas).length > 0 && (
<div id="Credit-customer1" style={{ display: 'none' }}>
<BSCreditCustomerPrint
words={words}
PrintDatas={PrintDatas}
url={qrData}
/> />
</div> )}
)} {addcustomer && (
</> <FeaturesFunctionalities
handleAddCustomerCancel={handleAddCustomerCancel}
addcustomer={addcustomer}
/>
)}
{Object.keys(PrintDatas).length > 0 && (
<div id="Credit-customer1" style={{ display: 'none' }}>
<BSCreditCustomerPrint
words={words}
PrintDatas={PrintDatas}
url={qrData}
/>
</div>
)}
</>
</Suspense>
); );
}; };
export default CreditCustSplitPayment; export default CreditCustSplitPayment;

View File

@ -4,6 +4,7 @@ import React, {
useEffect, useEffect,
useCallback, useCallback,
useContext, useContext,
lazy,
} from 'react'; } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { import {
@ -16,7 +17,6 @@ import {
Checkbox, Checkbox,
AutoComplete, AutoComplete,
Switch, Switch,
Tooltip,
Popconfirm, Popconfirm,
Tabs, Tabs,
} from 'antd'; } from 'antd';
@ -58,7 +58,6 @@ import {
ChangeOverAllDiscSales, ChangeOverAllDiscSales,
PreferenceData, PreferenceData,
ChangeComboCarddata, ChangeComboCarddata,
getPreferenceData,
getCustomerForHold, getCustomerForHold,
PostBlockSlots, PostBlockSlots,
} from '../../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../../Features/BookingScreen/BookingData/BookingData';
@ -68,7 +67,6 @@ import { ArrowRightOutlined, CloseSquareFilled } from '@ant-design/icons';
import { InputField } from '../../../../Components/Forms/InputField'; import { InputField } from '../../../../Components/Forms/InputField';
import { Messages } from '../../../../Components/Notifications/Messages'; import { Messages } from '../../../../Components/Notifications/Messages';
import Buttons from '../../../../Components/Forms/Buttons'; import Buttons from '../../../../Components/Forms/Buttons';
import ProductForm from '../../../../Pages/BookingScreen/Forms/QuickAdd/QuickAdd.jsx';
import { import {
GlobalAddCustomerDetails, GlobalAddCustomerDetails,
getAddCustomerDetails, getAddCustomerDetails,
@ -86,7 +84,6 @@ import {
ChangeTotalAmount, ChangeTotalAmount,
globalExtraTotalAmount, globalExtraTotalAmount,
} from '../../../../Features/ExteraCharges/ExtraCharges.js'; } from '../../../../Features/ExteraCharges/ExtraCharges.js';
import WeightScaleComp from '../../../../Components/WeightScale/weightScale.jsx';
import { import {
gettinghold, gettinghold,
puttinghold, puttinghold,
@ -98,7 +95,6 @@ import {
getProductsearch, getProductsearch,
} from '../../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../../Features/BookingScreen/BookingData/BookingData';
import { AiOutlineDownCircle, AiOutlineUpCircle } from 'react-icons/ai'; import { AiOutlineDownCircle, AiOutlineUpCircle } from 'react-icons/ai';
import '../../../../Styles/BookingScreen/Components/BookingFunctionality/FeaturesFunctionalities.scss';
import { import {
IoCloseSharp, IoCloseSharp,
IoPersonAddSharp, IoPersonAddSharp,
@ -111,7 +107,6 @@ import {
GlobalPreOrderList, GlobalPreOrderList,
GlobalpreOrderOpen, GlobalpreOrderOpen,
} from '../../../../Features/BookingScreen/PreOrder/PreOrder.js'; } from '../../../../Features/BookingScreen/PreOrder/PreOrder.js';
import Imageupload from '../../../../Components/Forms/Upload.jsx';
import { useApplyOfferto_CardDetail } from '../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx'; import { useApplyOfferto_CardDetail } from '../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx';
import { getCombolist } from '../../../../Features/ComboMaster/ComboMaster.js'; import { getCombolist } from '../../../../Features/ComboMaster/ComboMaster.js';
import { import {
@ -122,12 +117,24 @@ import {
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin.js'; import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin.js';
import { useDateStore } from '../../../../Features/BookingScreen/BookingData/DateStore.js'; import { useDateStore } from '../../../../Features/BookingScreen/BookingData/DateStore.js';
import { FaEdit, FaMapMarkedAlt, FaTrash } from 'react-icons/fa'; import { FaEdit, FaTrash } from 'react-icons/fa';
import { MdHome, MdLocationOn } from 'react-icons/md'; import { MdHome, MdLocationOn } from 'react-icons/md';
import { RadioGrpButton } from '../../../../Components/Forms/RadioGroup.jsx'; import { RadioGrpButton } from '../../../../Components/Forms/RadioGroup.jsx';
// jsx Files
const ProductForm = lazy(
() => import('../../../../Pages/BookingScreen/Forms/QuickAdd/QuickAdd.jsx')
);
const WeightScaleComp = lazy(
() => import('../../../../Components/WeightScale/weightScale.jsx')
);
const Imageupload = lazy(
() => import('../../../../Components/Forms/Upload.jsx')
);
// Scss
import '../../../../Styles/BookingScreen/Components/BookingFunctionality/FeaturesFunctionalities.scss';
const FeaturesFunctionalities = (props) => { const FeaturesFunctionalities = (props) => {
const { closeModal = () => { } } = props; const { closeModal = () => {} } = props;
const applyOffer = useApplyOfferto_CardDetail(); const applyOffer = useApplyOfferto_CardDetail();
const EditableContext = React.createContext(null); const EditableContext = React.createContext(null);
const EditableContext1 = React.createContext(null); const EditableContext1 = React.createContext(null);
@ -141,7 +148,6 @@ const FeaturesFunctionalities = (props) => {
const formRefExtraCharges = useRef(); const formRefExtraCharges = useRef();
const ExtraChargesType = useSelector(globalExtraChargesType); const ExtraChargesType = useSelector(globalExtraChargesType);
const GlobalExtraCharge = useSelector(globalExtraTotalAmount); const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
console.log(GlobalExtraCharge, "GlobalExtraCharge")
const ReorderHoldDetails = useSelector(GlobalReorderHoldDetails); const ReorderHoldDetails = useSelector(GlobalReorderHoldDetails);
const BookingType = useSelector(GlobalBookingType); const BookingType = useSelector(GlobalBookingType);
const BookingTypeBoth = useSelector(GlobalBookingTypeBoth); const BookingTypeBoth = useSelector(GlobalBookingTypeBoth);
@ -370,30 +376,30 @@ const FeaturesFunctionalities = (props) => {
const options = suggestions const options = suggestions
? suggestions ? suggestions
?.filter((item) => ?.filter((item) =>
selectedSearchValue === 'CustName' ? item.CustName !== null : item selectedSearchValue === 'CustName' ? item.CustName !== null : item
) )
.map((item) => ({ .map((item) => ({
value: item?.CustMobile, value: item?.CustMobile,
label: label:
selectedSearchValue === 'CustMobile' selectedSearchValue === 'CustMobile'
? `${item?.CustMobile} - ${item?.CustName ? item?.CustName : ''} ${item?.CustName ? ' - ' : ''} ${'Id:' + item?.CustId?.match(/-(\d+)$/)?.[1]}` ? `${item?.CustMobile} - ${item?.CustName ? item?.CustName : ''} ${item?.CustName ? ' - ' : ''} ${'Id:' + item?.CustId?.match(/-(\d+)$/)?.[1]}`
: selectedSearchValue === 'CustId' : selectedSearchValue === 'CustId'
? `${'Id:' + item?.CustId?.match(/-(\d+)$/)?.[1]}${item?.CustName ? ' - ' : ''} ${item?.CustName ? item?.CustName : ''} - ${item?.CustMobile}` ? `${'Id:' + item?.CustId?.match(/-(\d+)$/)?.[1]}${item?.CustName ? ' - ' : ''} ${item?.CustName ? item?.CustName : ''} - ${item?.CustMobile}`
: selectedSearchValue === 'CustName' && : selectedSearchValue === 'CustName' &&
item?.CustName !== null && item?.CustName !== null &&
`${item?.CustName ? item?.CustName : ''} ${item?.CustName ? ' - ' : ''} ${item?.CustMobile} - ${'Id:' + item?.CustId?.match(/-(\d+)$/)?.[1]}`, `${item?.CustName ? item?.CustName : ''} ${item?.CustName ? ' - ' : ''} ${item?.CustMobile} - ${'Id:' + item?.CustId?.match(/-(\d+)$/)?.[1]}`,
CustMobile: item?.CustMobile, CustMobile: item?.CustMobile,
CustId: item?.CustId?.match(/-(\d+)$/)?.[1], CustId: item?.CustId?.match(/-(\d+)$/)?.[1],
CustName: item?.CustName, CustName: item?.CustName,
})) }))
: GlobalAddCustomerDetails1?.map((item) => ({ : GlobalAddCustomerDetails1?.map((item) => ({
value: item.CustMobile, value: item.CustMobile,
label: `${item?.CustName} ${item?.CustMobile}`, label: `${item?.CustName} ${item?.CustMobile}`,
CustMobile: item?.CustMobile, CustMobile: item?.CustMobile,
CustId: item?.CustId, CustId: item?.CustId,
CustName: item?.CustName, CustName: item?.CustName,
})); }));
const handleYesOrNoChange = (value) => { const handleYesOrNoChange = (value) => {
setSelectedValue(value); setSelectedValue(value);
formRef.current?.setFieldsValue({ OfferActiveStatus: value }); formRef.current?.setFieldsValue({ OfferActiveStatus: value });
@ -456,34 +462,34 @@ const FeaturesFunctionalities = (props) => {
}, },
...(sportsAppPreference ...(sportsAppPreference
? [ ? [
{ {
title: 'Subcategory', title: 'Subcategory',
key: 'productDetails', key: 'productDetails',
dataIndex: 'productDetails', dataIndex: 'productDetails',
align: 'center', align: 'center',
width: '150px', width: '150px',
onCell: (record) => { onCell: (record) => {
const productDetails = record?.productDetails; const productDetails = record?.productDetails;
const Combodtl = const Combodtl =
record?.productDetails?.[0]?.comboDtl?.[0] record?.productDetails?.[0]?.comboDtl?.[0]
?.ComboInwardDetails?.[0]?.ComboDetails; ?.ComboInwardDetails?.[0]?.ComboDetails;
return { return {
onClick: () => { onClick: () => {
HoldPutfun(productDetails, record, Combodtl); HoldPutfun(productDetails, record, Combodtl);
}, },
}; };
},
render: (productDetails, record) => (
<a
style={{ color: 'black' }}
onClick={() => HoldPutfun(productDetails, record)}
>
{record?.productDetails?.[0]?.ProdSubCatName}
</a>
),
}, },
render: (productDetails, record) => ( ]
<a
style={{ color: 'black' }}
onClick={() => HoldPutfun(productDetails, record)}
>
{record?.productDetails?.[0]?.ProdSubCatName}
</a>
),
},
]
: []), : []),
{ {
title: 'Orders', title: 'Orders',
@ -581,13 +587,7 @@ const FeaturesFunctionalities = (props) => {
]; ];
useEffect(() => { useEffect(() => {
setWeightScale(props.WeightScale); setWeightScale(props.WeightScale);
}, [props.WeightScale]); }, [props.WeightScale]);
// useEffect(() => {
// if (!props.addcustomer) {
// formRef.current?.resetFields();
// setZipCodeData(false);
// }
// }, [props.addcustomer]);
const ExtTabledata = async () => { const ExtTabledata = async () => {
const data = { const data = {
CompId: CompId, CompId: CompId,
@ -761,7 +761,7 @@ const FeaturesFunctionalities = (props) => {
TaxAmt: formatAmount( TaxAmt: formatAmount(
((record.Price * record.TaxPercentage) / ((record.Price * record.TaxPercentage) /
(100 + record.TaxPercentage)) * (100 + record.TaxPercentage)) *
record.QTY record.QTY
), ),
TaxId: record.TaxId, TaxId: record.TaxId,
TaxPercentage: record.TaxPercentage, TaxPercentage: record.TaxPercentage,
@ -788,11 +788,11 @@ const FeaturesFunctionalities = (props) => {
const isDuplicate = TableName?.some( const isDuplicate = TableName?.some(
(item) => (item) =>
item.InwardDtlId + item.InwardDtlId +
' ' + ' ' +
item.BookingTypeName + item.BookingTypeName +
' ' + ' ' +
item.SinglePc === item.SinglePc ===
selectedProduct && item.UniqueId === record.UniqueId selectedProduct && item.UniqueId === record.UniqueId
); );
if (!isDuplicate) { if (!isDuplicate) {
@ -810,7 +810,7 @@ const FeaturesFunctionalities = (props) => {
TaxAmt: formatAmount( TaxAmt: formatAmount(
((record.Price * record.TaxPercentage) / ((record.Price * record.TaxPercentage) /
(100 + record.TaxPercentage)) * (100 + record.TaxPercentage)) *
record.QTY record.QTY
), ),
TaxId: record?.TaxId, TaxId: record?.TaxId,
TaxPercentage: record.TaxPercentage, TaxPercentage: record.TaxPercentage,
@ -1057,7 +1057,7 @@ const FeaturesFunctionalities = (props) => {
...record, ...record,
...values, ...values,
}); });
} catch (errInfo) { } } catch (errInfo) {}
}; };
let childNode = children; let childNode = children;
@ -1109,7 +1109,7 @@ const FeaturesFunctionalities = (props) => {
return ( return (
record.Price * record.QTY - record.Price * record.QTY -
((record.Price * record.TaxPercentage) / (100 + record.TaxPercentage)) * ((record.Price * record.TaxPercentage) / (100 + record.TaxPercentage)) *
record.QTY record.QTY
); );
}; };
const WithTaxAmountTaxAmount = (record) => { const WithTaxAmountTaxAmount = (record) => {
@ -1182,10 +1182,10 @@ const FeaturesFunctionalities = (props) => {
onClick={() => addeddata(record)} onClick={() => addeddata(record)}
disabled={ disabled={
Object.keys(ReorderHoldDetails).length !== 0 && Object.keys(ReorderHoldDetails).length !== 0 &&
BookingType === 'Dine In' && BookingType === 'Dine In' &&
GlobalExtraCharge.some( GlobalExtraCharge.some(
(item) => item.ExtraChargeId === record.UniqueId (item) => item.ExtraChargeId === record.UniqueId
) )
? true ? true
: false : false
} }
@ -1194,11 +1194,6 @@ const FeaturesFunctionalities = (props) => {
), ),
}, },
]; ];
console.log(ReorderHoldDetails,
BookingType,
GlobalExtraCharge, "GlobalExtraCharge");
const defaultColumns1 = [ const defaultColumns1 = [
{ {
title: 'ExtraCharge Type', title: 'ExtraCharge Type',
@ -1286,7 +1281,7 @@ const FeaturesFunctionalities = (props) => {
QTY: parseInt(row.QTY), QTY: parseInt(row.QTY),
TaxAmt: formatAmount( TaxAmt: formatAmount(
((row.Price * row.TaxPercentage) / (100 + row.TaxPercentage)) * ((row.Price * row.TaxPercentage) / (100 + row.TaxPercentage)) *
row.QTY row.QTY
), ),
TotalAmt: row.Price * row.QTY, TotalAmt: row.Price * row.QTY,
// ((row.Price * row.TaxPercentage) / (100 + row.TaxPercentage) *row.QTY ).toFixed(2), // ((row.Price * row.TaxPercentage) / (100 + row.TaxPercentage) *row.QTY ).toFixed(2),
@ -1435,12 +1430,12 @@ const FeaturesFunctionalities = (props) => {
<Space size="middle"> <Space size="middle">
<a> <a>
{Object.keys(ReorderHoldDetails).length !== 0 && {Object.keys(ReorderHoldDetails).length !== 0 &&
BookingType === 'Dine In' && BookingType === 'Dine In' &&
GlobalExtraCharge?.some( GlobalExtraCharge?.some(
(item) => (item) =>
item.ExtraChargeId === record.UniqueId && item.ExtraChargeId === record.UniqueId &&
item.InwardDtlId === record.InwardDtlId item.InwardDtlId === record.InwardDtlId
) ? ( ) ? (
<DeleteFilled <DeleteFilled
style={{ style={{
color: '#FF4D4F', color: '#FF4D4F',
@ -1710,7 +1705,7 @@ const FeaturesFunctionalities = (props) => {
dispatch( dispatch(
changeCustomerID( changeCustomerID(
response?.data?.CustomerDetails?.[ response?.data?.CustomerDetails?.[
response?.data?.CustomerDetails.length - 1 response?.data?.CustomerDetails.length - 1
] ]
) )
); );
@ -2194,9 +2189,9 @@ const FeaturesFunctionalities = (props) => {
AppId: AppId, AppId: AppId,
...(AvailableDate && selectedDate ...(AvailableDate && selectedDate
? { ? {
fromDate: selectedDate?.[0], fromDate: selectedDate?.[0],
toDate: selectedDate?.[1], toDate: selectedDate?.[1],
} }
: {}), : {}),
}; };
await dispatch(getSelectedFavItems(data)).unwrap(); await dispatch(getSelectedFavItems(data)).unwrap();
@ -2208,9 +2203,9 @@ const FeaturesFunctionalities = (props) => {
ProdSubCat: ProdSubCat, ProdSubCat: ProdSubCat,
...(AvailableDate && selectedDate ...(AvailableDate && selectedDate
? { ? {
fromDate: selectedDate?.[0], fromDate: selectedDate?.[0],
toDate: selectedDate?.[1], toDate: selectedDate?.[1],
} }
: {}), : {}),
}; };
@ -2221,9 +2216,9 @@ const FeaturesFunctionalities = (props) => {
prodCat: prodCat, prodCat: prodCat,
...(AvailableDate && selectedDate ...(AvailableDate && selectedDate
? { ? {
fromDate: selectedDate?.[0], fromDate: selectedDate?.[0],
toDate: selectedDate?.[1], toDate: selectedDate?.[1],
} }
: {}), : {}),
}; };
@ -2596,7 +2591,7 @@ const FeaturesFunctionalities = (props) => {
e?.stopPropagation(); e?.stopPropagation();
removeAll(); removeAll();
}} }}
// onClick={() => statusFormatter(record,index)} // onClick={() => statusFormatter(record,index)}
> >
Clear All Clear All
</Button> </Button>
@ -2723,7 +2718,7 @@ const FeaturesFunctionalities = (props) => {
: selectedSearchValue == 'CustName' : selectedSearchValue == 'CustName'
? 'Please Enter Valid Name' ? 'Please Enter Valid Name'
: selectedSearchValue == 'CustId' && : selectedSearchValue == 'CustId' &&
'Please EnterCustomer Id', 'Please EnterCustomer Id',
}, },
]} ]}
> >
@ -2812,7 +2807,7 @@ const FeaturesFunctionalities = (props) => {
: selectedSearchValue == 'CustName' : selectedSearchValue == 'CustName'
? 'Enter Name' ? 'Enter Name'
: selectedSearchValue == 'CustId' && : selectedSearchValue == 'CustId' &&
'Enter Customer Id' 'Enter Customer Id'
: ' Mobile Number'} : ' Mobile Number'}
</label> </label>
} }
@ -2994,7 +2989,7 @@ const FeaturesFunctionalities = (props) => {
autocomplete="off" autocomplete="off"
isOnChange={ isOnChange={
formRef.current?.getFieldsValue()?.CustName || formRef.current?.getFieldsValue()?.CustName ||
inputValue inputValue
? true ? true
: false : false
} }
@ -3060,9 +3055,9 @@ const FeaturesFunctionalities = (props) => {
<p>Upload Profile</p> <p>Upload Profile</p>
<Form.Item <Form.Item
name="CustomerProfile" name="CustomerProfile"
// getValueFromEvent={(e) => // getValueFromEvent={(e) =>
// formType === 'edit' ? editstate?.EmpPhotoLink : e // formType === 'edit' ? editstate?.EmpPhotoLink : e
// } // }
> >
<Imageupload <Imageupload
singleImage={true} singleImage={true}
@ -3316,7 +3311,9 @@ const FeaturesFunctionalities = (props) => {
<Popconfirm <Popconfirm
title="Remove Address" title="Remove Address"
description="Are you sure you want to remove this address?" description="Are you sure you want to remove this address?"
onConfirm={() => handleRemoveAddress(idx)} onConfirm={() =>
handleRemoveAddress(idx)
}
okText="Yes, Remove" okText="Yes, Remove"
cancelText="Cancel" cancelText="Cancel"
okType="danger" okType="danger"
@ -3492,7 +3489,7 @@ const FeaturesFunctionalities = (props) => {
<Form.Item <Form.Item
name="State" name="State"
// rules={[{ required: true }]} // rules={[{ required: true }]}
> >
<InputField <InputField
field="State" field="State"
@ -3535,13 +3532,13 @@ const FeaturesFunctionalities = (props) => {
style={ style={
offerType == 'P' offerType == 'P'
? { ? {
opacity: '1', opacity: '1',
boxShadow: boxShadow:
'rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px', 'rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px',
margin: '3px', margin: '3px',
padding: '5px', padding: '5px',
backgroundColor: '#fff', backgroundColor: '#fff',
} }
: { opacity: '0.6', boxShadow: 'none' } : { opacity: '0.6', boxShadow: 'none' }
} }
onClick={() => { onClick={() => {
@ -3557,13 +3554,13 @@ const FeaturesFunctionalities = (props) => {
style={ style={
offerType == 'F' offerType == 'F'
? { ? {
opacity: '1', opacity: '1',
boxShadow: boxShadow:
'rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px', 'rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px',
margin: '3px', margin: '3px',
padding: '5px', padding: '5px',
backgroundColor: '#fff', backgroundColor: '#fff',
} }
: { opacity: '0.6', boxShadow: 'none' } : { opacity: '0.6', boxShadow: 'none' }
} }
onClick={() => { onClick={() => {
@ -3660,7 +3657,7 @@ const FeaturesFunctionalities = (props) => {
} }
isOnChange={ isOnChange={
formRef.current?.getFieldsValue()?.CustEmail || formRef.current?.getFieldsValue()?.CustEmail ||
inputValue inputValue
? true ? true
: false : false
} }
@ -3688,7 +3685,7 @@ const FeaturesFunctionalities = (props) => {
autocomplete="off" autocomplete="off"
isOnChange={ isOnChange={
formRef.current?.getFieldsValue()?.CreditLimit || formRef.current?.getFieldsValue()?.CreditLimit ||
inputValue inputValue
? true ? true
: false : false
} }
@ -3921,7 +3918,7 @@ const FeaturesFunctionalities = (props) => {
onChange={setActiveTab} onChange={setActiveTab}
items={[ items={[
{ key: 'quickAdd', label: 'Quick Add' }, { key: 'quickAdd', label: 'Quick Add' },
{ key: 'directSale', label: 'Direct Sale' } { key: 'directSale', label: 'Direct Sale' },
]} ]}
/> />
<ProductForm <ProductForm
@ -4045,7 +4042,7 @@ const FeaturesFunctionalities = (props) => {
buttonText="SAVE" buttonText="SAVE"
color="901D77" color="901D77"
icon={<ArrowRightOutlined />} icon={<ArrowRightOutlined />}
// handleSubmit={() => { globalamount1() }} // handleSubmit={() => { globalamount1() }}
/> />
</div> </div>
</div> </div>
@ -4059,7 +4056,7 @@ const FeaturesFunctionalities = (props) => {
bordered bordered
dataSource={TableName} dataSource={TableName}
width={'120px'} width={'120px'}
//pagination={column2?.length < "11" ? false : true} //pagination={column2?.length < "11" ? false : true}
></Table> ></Table>
</div> </div>
)} )}

View File

@ -1,6 +1,28 @@
import { useEffect, useRef, useState, useCallback } from 'react'; import {
useEffect,
useRef,
useState,
useCallback,
lazy,
Suspense,
} from 'react';
import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import moment from 'moment'; import moment from 'moment';
import { Form, Radio } from 'antd';
import {
ArrowRightOutlined,
CheckCircleOutlined,
CloseCircleOutlined,
PlusOutlined,
} from '@ant-design/icons';
import { InputField } from '../../../../Components/Forms/InputField';
import { DefaultModal } from '../../../../Components/Modal/DefaultModal.jsx';
import { DropDowns } from '../../../../Components/Forms/DropDown.jsx';
import Buttons from '../../../../Components/Forms/Buttons';
import { Messages } from '../../../../Components/Notifications/Messages';
import { isMobile } from 'react-device-detect';
// Js files
import { import {
getConfigType, getConfigType,
GlobalCommonPaymentOptions, GlobalCommonPaymentOptions,
@ -58,54 +80,61 @@ import {
putSalesBillEdit, putSalesBillEdit,
changeBillEditingMode, changeBillEditingMode,
changePreviousOrderPayment, changePreviousOrderPayment,
changePreviousOrderOfferDetail changePreviousOrderOfferDetail,
GlobalAllBookingType,
} from '../../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../../Features/BookingScreen/BookingData/BookingData';
import { Form, Radio } from 'antd';
import {
ArrowRightOutlined,
CheckCircleOutlined,
CloseCircleOutlined,
PlusOutlined,
} from '@ant-design/icons';
import { InputField } from '../../../../Components/Forms/InputField';
import { DefaultModal } from '../../../../Components/Modal/DefaultModal.jsx';
import { DropDowns } from '../../../../Components/Forms/DropDown.jsx';
import Buttons from '../../../../Components/Forms/Buttons';
import QrComponent from '../BookingFunctionality/DynamicQr.jsx';
import { Messages } from '../../../../Components/Notifications/Messages';
import { import {
extractLastNumberOrderId, extractLastNumberOrderId,
getSession, getSession,
printDiv, printDiv,
validateSafeInput, validateSafeInput,
} from '../../../../Services/Others.js'; } from '../../../../Services/Others.js';
import WpIcon from '../../../../Images/message.png';
import { import {
ChangeTotalAmount, ChangeTotalAmount,
globalExtraTotalAmount, globalExtraTotalAmount,
} from '../../../../Features/ExteraCharges/ExtraCharges.js'; } from '../../../../Features/ExteraCharges/ExtraCharges.js';
import QrinScreen from '../BookingFunctionality/DynamicScreenQr.jsx';
import PaymentPdfBooking from '../../../paymentpdfPage/PaymentPdfBooking.jsx';
import { isMobile } from 'react-device-detect';
import { PrintStyleFunction } from '../../../paymentpdfPage/PrintStyleFunction.js'; import { PrintStyleFunction } from '../../../paymentpdfPage/PrintStyleFunction.js';
import { import {
getTemplateData, getTemplateData,
GlobalprintDatas, GlobalprintDatas,
SelectedPrintTemplate, SelectedPrintTemplate,
} from '../../../../Features/ThemeChange/ThemeChange.js'; } from '../../../../Features/ThemeChange/ThemeChange.js';
import '../../../../Styles/BookingScreen/Components/BookingFunctionality/SplitPayment.scss';
import BsBillingCreditCustomer from '../BookingFunctionality/BSBillingCreditCustomer.jsx';
import MobilePrint from '../BookingFunctionality/MobilePrint.jsx';
import FeaturesFunctionalities from './FeaturesFunctionalities.jsx';
import TokensinglePrint from '../../../paymentpdfPage/TokenOnlyPrints/TokeninsinglePrint.jsx';
import TokenOnlyMobilePrint from './TokenOnlyMobilePrint.jsx';
import AllProductTokenMobilePrint from './AllProductTokenMobilePrint.jsx';
import { getCustomerDisplayWindow } from '../../../../Features/customerDisplayWindow/customerDisplayWindow.js'; import { getCustomerDisplayWindow } from '../../../../Features/customerDisplayWindow/customerDisplayWindow.js';
import { gettinghold } from '../../../../Features/BookingScreen/HoldOption/HoldOption.js'; import { gettinghold } from '../../../../Features/BookingScreen/HoldOption/HoldOption.js';
import { Global_OrderOfferDetail } from '../../../../Features/Offer/Offer.js'; import { Global_OrderOfferDetail } from '../../../../Features/Offer/Offer.js';
import { useApplyOfferto_CardDetail } from '../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx';
import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin.js'; import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin.js';
import { ChangeFullFreeProductList, changeFullOfferAppliedProducts, GlobalOfferAppliedProducts } from '../../../../Features/Offer/Offernew/BookingOffernew.js'; import {
ChangeFullFreeProductList,
changeFullOfferAppliedProducts,
GlobalOfferAppliedProducts,
} from '../../../../Features/Offer/Offernew/BookingOffernew.js';
// jsx
const QrinScreen = lazy(
() => import('../BookingFunctionality/DynamicScreenQr.jsx')
);
const MobilePrint = lazy(
() => import('../BookingFunctionality/MobilePrint.jsx')
);
const FeaturesFunctionalities = lazy(
() => import('./FeaturesFunctionalities.jsx')
);
const PaymentPdfBooking = lazy(
() => import('../../../paymentpdfPage/PaymentPdfBooking.jsx')
);
const BsBillingCreditCustomer = lazy(
() => import('../BookingFunctionality/BSBillingCreditCustomer.jsx')
);
const TokensinglePrint = lazy(
() => import('../../../paymentpdfPage/TokenOnlyPrints/TokeninsinglePrint.jsx')
);
const QrComponent = lazy(() => import('../BookingFunctionality/DynamicQr.jsx'));
import { useApplyOfferto_CardDetail } from '../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx';
// Style and Icon
import '../../../../Styles/BookingScreen/Components/BookingFunctionality/SplitPayment.scss';
import WpIcon from '../../../../Images/message.png';
const subDirectory = import.meta.env.BASE_URL; const subDirectory = import.meta.env.BASE_URL;
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL; const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
@ -119,12 +148,13 @@ const SplitPayment = (props) => {
const AppId = getSession('AppId'); const AppId = getSession('AppId');
const UserId = getSession('UserId'); const UserId = getSession('UserId');
const appPreferences = useSelector(ApplicationPreferences); const appPreferences = useSelector(ApplicationPreferences);
const AllBookingType = useSelector(GlobalAllBookingType);
const applyOffer = useApplyOfferto_CardDetail(); const applyOffer = useApplyOfferto_CardDetail();
const globalTipAmount = useSelector(GlobaltipAmount); const globalTipAmount = useSelector(GlobaltipAmount);
const TotalNetAmount = (props.hasOwnProperty('TotalNetAmount') const TotalNetAmount = props.hasOwnProperty('TotalNetAmount')
? props['TotalNetAmount'] ? props['TotalNetAmount']
: null); : null;
const TableOrderId = props.hasOwnProperty('TableBookingOrderId') const TableOrderId = props.hasOwnProperty('TableBookingOrderId')
? props['TableBookingOrderId'] ? props['TableBookingOrderId']
: null; : null;
@ -138,10 +168,16 @@ const SplitPayment = (props) => {
const SelCustId = useSelector(GlobalSelCustId); const SelCustId = useSelector(GlobalSelCustId);
const salesBillEdit = useSelector(GlobalSalesBillEdit); const salesBillEdit = useSelector(GlobalSalesBillEdit);
const previousOrderPayment = useSelector(GlobalPreviousOrderPayment); const previousOrderPayment = useSelector(GlobalPreviousOrderPayment);
const previousOrderOfferDetails = useSelector(GlobalPreviousOrderOfferDetails); const previousOrderOfferDetails = useSelector(
GlobalPreviousOrderOfferDetails
);
const filteredPayments = const filteredPayments =
previousOrderPayment?.filter( previousOrderPayment?.filter(
p => p?.LastOrderTran === 'Y' && p?.AfterAdjustment != null && p?.AfterAdjustment !== '' && p?.AfterAdjustment (p) =>
p?.LastOrderTran === 'Y' &&
p?.AfterAdjustment != null &&
p?.AfterAdjustment !== '' &&
p?.AfterAdjustment
) || []; ) || [];
const paymentsToUse = const paymentsToUse =
filteredPayments.length > 0 ? filteredPayments : previousOrderPayment || []; filteredPayments.length > 0 ? filteredPayments : previousOrderPayment || [];
@ -150,7 +186,8 @@ const SplitPayment = (props) => {
0 0
); );
const totalPreviouspayment = paymentsToUse?.reduce( const totalPreviouspayment = paymentsToUse?.reduce(
(acc, payment) => acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0), (acc, payment) =>
acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0),
0 0
); );
const [paybtns, setpaybtns] = useState([]); const [paybtns, setpaybtns] = useState([]);
@ -193,7 +230,11 @@ const SplitPayment = (props) => {
const OverAllSales = useSelector(GlobalOverAllDiscSales); const OverAllSales = useSelector(GlobalOverAllDiscSales);
const OverAllEstimate = useSelector(GlobalOverAllDiscEstimate); const OverAllEstimate = useSelector(GlobalOverAllDiscEstimate);
const printDatas = useSelector(GlobalprintDatas); const printDatas = useSelector(GlobalprintDatas);
const allowDecimal = SettingDataSelector?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y'); const allowDecimal = SettingDataSelector?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'decimal' &&
setting?.SettingValue === 'Y'
);
const UomPrint = SettingDataSelector?.[0]?.SettingDtlDetails.filter( const UomPrint = SettingDataSelector?.[0]?.SettingDtlDetails.filter(
(i) => i.SettingIdName === 'PrintUom' (i) => i.SettingIdName === 'PrintUom'
)?.[0]; )?.[0];
@ -223,7 +264,7 @@ const SplitPayment = (props) => {
(item) => item?.OptionName == 'Offer' (item) => item?.OptionName == 'Offer'
); );
const [TotalAmount, setTotalAmount] = useState(0); const [TotalAmount, setTotalAmount] = useState(0);
console.log(TotalAmount, "TotalSplitAmount", TotalSplitAmount) console.log(TotalAmount, 'TotalSplitAmount', TotalSplitAmount);
const preferenceOffer = const preferenceOffer =
SettingDataSelector?.[0]?.['SettingDtlDetails']?.find( SettingDataSelector?.[0]?.['SettingDtlDetails']?.find(
(item) => item.SettingIdName === 'Offer' (item) => item.SettingIdName === 'Offer'
@ -237,9 +278,8 @@ const SplitPayment = (props) => {
}, []); }, []);
useEffect(() => { useEffect(() => {
if (salesBillEdit) { if (salesBillEdit) {
const previousNetAmount = (totalPreviouspayment || 0); const previousNetAmount = totalPreviouspayment || 0;
if (TotalNetAmount > previousNetAmount) { if (TotalNetAmount > previousNetAmount) {
setTotalAmount(TotalNetAmount - previousNetAmount); setTotalAmount(TotalNetAmount - previousNetAmount);
} else { } else {
@ -248,8 +288,7 @@ const SplitPayment = (props) => {
} else { } else {
setTotalAmount(TotalNetAmount); setTotalAmount(TotalNetAmount);
} }
}, [totalPreviousOfferAmount, totalPreviouspayment, TotalNetAmount]);
}, [totalPreviousOfferAmount, totalPreviouspayment, TotalNetAmount])
useEffect(() => { useEffect(() => {
if (SelCustId) { if (SelCustId) {
@ -272,7 +311,7 @@ const SplitPayment = (props) => {
}, [Splitpayment]); }, [Splitpayment]);
useEffect(() => { useEffect(() => {
const totalPayAmount = Object.keys(SplitSelPayMode) const totalPayAmount = Object.keys(SplitSelPayMode)
.filter(key => key.startsWith('PayAmount-')) .filter((key) => key.startsWith('PayAmount-'))
.reduce((sum, key) => { .reduce((sum, key) => {
const value = parseInt(SplitSelPayMode[key], 10); const value = parseInt(SplitSelPayMode[key], 10);
return sum + (isNaN(value) ? 0 : value); return sum + (isNaN(value) ? 0 : value);
@ -360,20 +399,12 @@ const SplitPayment = (props) => {
setUpiPayOption(options); setUpiPayOption(options);
}; };
const getBookingTypeId = async () => { const getBookingTypeId = async () => {
let tempconfigdata = await dispatch( setConfigDataList(AllBookingType);
getConfigType({ TypeName: 'Booking Type' }) let configdata = AllBookingType;
).unwrap(); let checkName = BookingTypeBoth ? 'DineIn,TakeAway' : BookingType;
if (tempconfigdata?.data?.statusCode == 1) { let filterconfigdata = configdata?.find((a) => a?.ConfigName === checkName);
setConfigDataList(tempconfigdata?.data?.data); setSelectedBookingType(filterconfigdata?.ConfigId);
let configdata = tempconfigdata?.data?.data;
let checkName = BookingTypeBoth ? 'DineIn,TakeAway' : BookingType;
let filterconfigdata = configdata?.find(
(a) => a?.ConfigName === checkName
);
setSelectedBookingType(filterconfigdata?.ConfigId);
}
}; };
const gettodaydate = () => { const gettodaydate = () => {
const currentDate = new Date(); const currentDate = new Date();
@ -547,7 +578,8 @@ const SplitPayment = (props) => {
SingleTokenMobilePrint(PrintOrderDetails, SelUpiId, 'Booking'); SingleTokenMobilePrint(PrintOrderDetails, SelUpiId, 'Booking');
} }
} else { } else {
MobilePrint(appPreferences, MobilePrint(
appPreferences,
PrintOrderDetails, PrintOrderDetails,
SelUpiId, SelUpiId,
'Booking', 'Booking',
@ -570,8 +602,9 @@ const SplitPayment = (props) => {
await Promise.all( await Promise.all(
PrintOrderDetails?.[0]?.OrderDetails?.map( PrintOrderDetails?.[0]?.OrderDetails?.map(
async (orderDetail, index) => { async (orderDetail, index) => {
const groupedTokens = orderDetail?.productDetails?.filter(data => data?.EditTokenAvailable !== 'N')?.reduce( const groupedTokens = orderDetail?.productDetails
(acc, item, idx) => { ?.filter((data) => data?.EditTokenAvailable !== 'N')
?.reduce((acc, item, idx) => {
if (item.TokenAvailable === 'Y') { if (item.TokenAvailable === 'Y') {
if (!item.CounterName) { if (!item.CounterName) {
// If CounterName is null or empty // If CounterName is null or empty
@ -584,9 +617,7 @@ const SplitPayment = (props) => {
} }
} }
return acc; return acc;
}, }, {});
{}
);
// Iterate over grouped tokens and print them // Iterate over grouped tokens and print them
const tokensToPrint = Object.entries(groupedTokens).map( const tokensToPrint = Object.entries(groupedTokens).map(
@ -605,11 +636,11 @@ const SplitPayment = (props) => {
); );
} else { } else {
await Promise.all( await Promise.all(
PrintOrderDetails?.[0]?.OrderDetails?.filter(data => data?.EditTokenAvailable !== 'N')?.map( PrintOrderDetails?.[0]?.OrderDetails?.filter(
async (orderDetail, index) => { (data) => data?.EditTokenAvailable !== 'N'
await TokenPrint(`${index}-${orderDetail?.OrderId}`); )?.map(async (orderDetail, index) => {
} await TokenPrint(`${index}-${orderDetail?.OrderId}`);
) })
); );
setPrintOrderDetails([]); setPrintOrderDetails([]);
} }
@ -641,7 +672,7 @@ const SplitPayment = (props) => {
const selectedStyle = const selectedStyle =
stylesMap[ stylesMap[
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
]; ];
if (selectedStyle) { if (selectedStyle) {
@ -650,8 +681,9 @@ const SplitPayment = (props) => {
async (orderDetail, index) => { async (orderDetail, index) => {
await printDiv(`${selectedStyle}-${index}`, style); // Use unique IDs for each print await printDiv(`${selectedStyle}-${index}`, style); // Use unique IDs for each print
if (orderDetail?.BookingTypeName !== 'Dine In') { if (orderDetail?.BookingTypeName !== 'Dine In') {
const groupedTokens = orderDetail?.productDetails?.filter(data => data?.EditTokenAvailable !== 'N')?.reduce( const groupedTokens = orderDetail?.productDetails
(acc, item, idx) => { ?.filter((data) => data?.EditTokenAvailable !== 'N')
?.reduce((acc, item, idx) => {
if (item.TokenAvailable === 'Y') { if (item.TokenAvailable === 'Y') {
if (!item.CounterName) { if (!item.CounterName) {
// If CounterName is null or empty // If CounterName is null or empty
@ -664,9 +696,7 @@ const SplitPayment = (props) => {
} }
} }
return acc; return acc;
}, }, {});
{}
);
// Iterate over grouped tokens and print them // Iterate over grouped tokens and print them
const tokensToPrint = Object.entries(groupedTokens).map( const tokensToPrint = Object.entries(groupedTokens).map(
@ -1033,11 +1063,11 @@ const SplitPayment = (props) => {
<button <button
className={ className={
SplitSelPayMode[`PaymentStatus-${i}`] === 'S' || SplitSelPayMode[`PaymentStatus-${i}`] === 'S' ||
SplitSelPayMode[`FirstPaymentclick-${i}`] === 'Y' SplitSelPayMode[`FirstPaymentclick-${i}`] === 'Y'
? 'Splitbutton-diabled' ? 'Splitbutton-diabled'
: 'Splitbutton' : 'Splitbutton'
} }
// onClick={(e) => (SplitSelPayMode[`PaymentStatus-${i}`] === "S" || SplitSelPayMode[`FirstPaymentclick-${i}`] === "Y") ? e.stopPropagation() : onFinish(i)} // onClick={(e) => (SplitSelPayMode[`PaymentStatus-${i}`] === "S" || SplitSelPayMode[`FirstPaymentclick-${i}`] === "Y") ? e.stopPropagation() : onFinish(i)}
> >
Pay Pay
</button> </button>
@ -1365,8 +1395,8 @@ const SplitPayment = (props) => {
? 'E' ? 'E'
: GlobEstBooking === 'ParEst' : GlobEstBooking === 'ParEst'
? GlobProdwisedata?.includes( ? GlobProdwisedata?.includes(
a.InwardDtlId + ' ' + a?.BookingTypeName a.InwardDtlId + ' ' + a?.BookingTypeName
) )
? 'E' ? 'E'
: 'S' : 'S'
: 'S', : 'S',
@ -1448,7 +1478,14 @@ const SplitPayment = (props) => {
// SalesTableLinkDetails: // SalesTableLinkDetails:
// SelectedTableDetails?.length > 0 ? SelectedTableDetails : null, // SelectedTableDetails?.length > 0 ? SelectedTableDetails : null,
SalesTableLinkDetails: SalesTableLinkDetails:
SelectedTableDetails?.length > 0 ? globalTipAmount === 0 ? SelectedTableDetails : SelectedTableDetails?.map(item => ({ ...item, "TipsAmount": globalTipAmount })) : null, SelectedTableDetails?.length > 0
? globalTipAmount === 0
? SelectedTableDetails
: SelectedTableDetails?.map((item) => ({
...item,
TipsAmount: globalTipAmount,
}))
: null,
// "Credit": TotalAmount, // "Credit": TotalAmount,
// "Debit": 0, // "Debit": 0,
@ -1472,37 +1509,37 @@ const SplitPayment = (props) => {
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'card' : SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'card'
? SplitSelPayMode[`CardSelection-${i}`] ? SplitSelPayMode[`CardSelection-${i}`]
: SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === : SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
'default' 'default'
? 'PC' ? 'PC'
: SplitSelPayMode[`UPISelection-${i}`], : SplitSelPayMode[`UPISelection-${i}`],
ModeOfPayment: ModeOfPayment:
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default' SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default'
? PaymentUpiOptions?.find( ? PaymentUpiOptions?.find(
(upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`] (upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`]
)?.UPIDetailId )?.UPIDetailId
: null, : null,
AccountDtl: AccountDtl:
SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' && SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default' SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default'
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find( ? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
(upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`] (upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`]
) )
: (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' && : (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
'pd') || 'pd') ||
(SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
'card' &&
SplitSelPayMode[`CardSelection-${i}`]?.toLowerCase() ===
'pd')
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
: (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
'upi' &&
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
'pg') ||
(SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
'card' && 'card' &&
SplitSelPayMode[`CardSelection-${i}`]?.toLowerCase() === SplitSelPayMode[`CardSelection-${i}`]?.toLowerCase() ===
'pg') 'pd')
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
: (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
'upi' &&
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
'pg') ||
(SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
'card' &&
SplitSelPayMode[`CardSelection-${i}`]?.toLowerCase() ===
'pg')
? useOptions?.[0]?.PaymentDetails?.PaymentGateway ? useOptions?.[0]?.PaymentDetails?.PaymentGateway
: [], : [],
PaymentStatus: PaymentStatus:
@ -1511,9 +1548,9 @@ const SplitPayment = (props) => {
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'credit' : SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'credit'
? 'S' ? 'S'
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === : SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
'upi' && 'upi' &&
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
'default' 'default'
? 'S' ? 'S'
: 'P', : 'P',
Debit: 0, Debit: 0,
@ -1527,7 +1564,7 @@ const SplitPayment = (props) => {
}; };
let PostData = temppostdata; let PostData = temppostdata;
(i === 0 && SplitSelPayMode[`PaymentStatus-${i}`] === 'F') || (i === 0 && SplitSelPayMode[`PaymentStatus-${i}`] === 'F') ||
(i === 0 && props.hasOwnProperty('TableBookingOrderId')) (i === 0 && props.hasOwnProperty('TableBookingOrderId'))
? PutSplitPayment(i) ? PutSplitPayment(i)
: i === 0 : i === 0
? Object.keys(ReportholdData)?.length > 0 ? Object.keys(ReportholdData)?.length > 0
@ -1576,14 +1613,14 @@ const SplitPayment = (props) => {
} }
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]);
@ -1635,10 +1672,16 @@ const SplitPayment = (props) => {
if (response?.data?.statusCode == 1) { if (response?.data?.statusCode == 1) {
setSalesOrderId(response?.data?.OrderId); setSalesOrderId(response?.data?.OrderId);
const salesEditAmount = response?.data?.PaymentOrderDtl?.find(payment => const salesEditAmount = response?.data?.PaymentOrderDtl?.find(
payment?.LastOrderTran === 'Y' && payment?.AdjustmentType && (payment) =>
payment?.AdjustmentType != null && payment?.AfterAdjustment && payment?.BeforeAdjustment && payment?.AfterAdjustment != null && payment?.BeforeAdjustment != null payment?.LastOrderTran === 'Y' &&
) payment?.AdjustmentType &&
payment?.AdjustmentType != null &&
payment?.AfterAdjustment &&
payment?.BeforeAdjustment &&
payment?.AfterAdjustment != null &&
payment?.BeforeAdjustment != null
);
setBeforeAdjAmount(salesEditAmount?.BeforeAdjustment || null); setBeforeAdjAmount(salesEditAmount?.BeforeAdjustment || null);
setAfterAdjAmount(salesEditAmount?.AfterAdjustment || null); setAfterAdjAmount(salesEditAmount?.AfterAdjustment || null);
setAdjustmentType(salesEditAmount?.AdjustmentType || null); setAdjustmentType(salesEditAmount?.AdjustmentType || null);
@ -1677,14 +1720,14 @@ const SplitPayment = (props) => {
} }
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]);
@ -1722,7 +1765,13 @@ const SplitPayment = (props) => {
OrderId: props.hasOwnProperty('TableBookingOrderId') OrderId: props.hasOwnProperty('TableBookingOrderId')
? TableOrderId ? TableOrderId
: SalesOrderId, : SalesOrderId,
...(i === 0 ? { SalesId: props.hasOwnProperty('TableBookingSalesId') ? TableSalesId : SalesOrderId } : {}), ...(i === 0
? {
SalesId: props.hasOwnProperty('TableBookingSalesId')
? TableSalesId
: SalesOrderId,
}
: {}),
PaymentType: PaymentType:
SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi'
? SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'pd' ? SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'pd'
@ -1743,32 +1792,32 @@ const SplitPayment = (props) => {
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'card' : SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'card'
? SplitSelPayMode[`CardSelection-${i}`] ? SplitSelPayMode[`CardSelection-${i}`]
: SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === : SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
'default' 'default'
? 'PC' ? 'PC'
: SplitSelPayMode[`UPISelection-${i}`], : SplitSelPayMode[`UPISelection-${i}`],
ModeOfPayment: ModeOfPayment:
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default' SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default'
? PaymentUpiOptions?.find( ? PaymentUpiOptions?.find(
(upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`] (upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`]
)?.UPIDetailId )?.UPIDetailId
: null, : null,
AccountDtl: AccountDtl:
SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' && SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default' SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default'
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find( ? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
(upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`] (upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`]
) )
: (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' && : (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'pd') || SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'pd') ||
(SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'card' && (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'card' &&
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'pd') SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'pd')
? useOptions?.[0]?.PaymentDetails?.PaymentDevice ? useOptions?.[0]?.PaymentDetails?.PaymentDevice
: (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' && : (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
'pg') || 'pg') ||
(SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
'card' && 'card' &&
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'pg') SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'pg')
? useOptions?.[0]?.PaymentDetails?.PaymentGateway ? useOptions?.[0]?.PaymentDetails?.PaymentGateway
: [], : [],
PaymentStatus: PaymentStatus:
@ -1777,8 +1826,8 @@ const SplitPayment = (props) => {
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'credit' : SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'credit'
? 'S' ? 'S'
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' && : SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
'default' 'default'
? 'S' ? 'S'
: 'P', : 'P',
Debit: 0, Debit: 0,
@ -1789,7 +1838,6 @@ const SplitPayment = (props) => {
BeforeAdjAmount: beforeAdjAmount || null, BeforeAdjAmount: beforeAdjAmount || null,
AfterAdjAmount: afterAdjAmount || null, AfterAdjAmount: afterAdjAmount || null,
AdjustmentType: adjustmentType || null, AdjustmentType: adjustmentType || null,
}; };
let response = await dispatch( let response = await dispatch(
@ -1836,14 +1884,14 @@ const SplitPayment = (props) => {
} }
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]);
@ -1945,14 +1993,14 @@ const SplitPayment = (props) => {
}); });
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?.OrderDetails?.[0]?.FYStatus bookingpaymentupdate?.data?.OrderDetails?.[0]?.FYStatus
) )
: '') : '')
); );
if (bookingpaymentupdate?.data?.OrderDetails?.length > 0) { if (bookingpaymentupdate?.data?.OrderDetails?.length > 0) {
setPrintOrderDetails([bookingpaymentupdate?.data]); setPrintOrderDetails([bookingpaymentupdate?.data]);
@ -1970,7 +2018,7 @@ const SplitPayment = (props) => {
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
@ -2125,195 +2173,200 @@ const SplitPayment = (props) => {
} }
return ( return (
<> <Suspense fallback={<div>Loading...</div>}>
<Messages messageType={messageType} messageData={messageData} /> <>
<div className="splitmodal"> <Messages messageType={messageType} messageData={messageData} />
<DefaultModal <div className="splitmodal">
open={Splitpayment} <DefaultModal
title="Split Payment" open={Splitpayment}
handleCancel={() => { title="Split Payment"
SplitSelPayMode[`PaymentStatus-0`] !== 'S' && HandleModalClose(); handleCancel={() => {
}} SplitSelPayMode[`PaymentStatus-0`] !== 'S' && HandleModalClose();
footer={false} }}
width={1000} footer={false}
className={'splitpaymentModal'} width={1000}
children={ className={'splitpaymentModal'}
<div className="splitpaymentModal-content"> children={
<p>Total Amount : {safeRound(TotalAmount)}</p> <div className="splitpaymentModal-content">
<p> <p>Total Amount : {safeRound(TotalAmount)}</p>
Remaining Balance : {TotalAmount - (isNaN(TotalSplitAmount) ? 0 : TotalSplitAmount)} </p> <p>
Remaining Balance :{' '}
{TotalAmount -
(isNaN(TotalSplitAmount) ? 0 : TotalSplitAmount)}{' '}
</p>
<>{calculateField()}</> <>{calculateField()}</>
{TotalAmount > TotalSplitAmount && {TotalAmount > TotalSplitAmount &&
SplitSelPayMode[`PaymentStatus-${count}`] === 'S' && ( SplitSelPayMode[`PaymentStatus-${count}`] === 'S' && (
<Form.Item> <Form.Item>
<div <div
style={{
display: 'flex',
justifyContent: 'flex-end',
}}
>
<PlusOutlined
style={{ style={{
backgroundColor: '#37943C', display: 'flex',
color: 'white', justifyContent: 'flex-end',
borderRadius: '50px',
padding: '5px',
}} }}
onClick={() => setCount(count + 1)} >
/> <PlusOutlined
</div> style={{
</Form.Item> backgroundColor: '#37943C',
)} color: 'white',
</div> borderRadius: '50px',
} padding: '5px',
/> }}
</div> onClick={() => setCount(count + 1)}
{TotalAmount == 0 && Success && ( />
<div> </div>
<QrComponent com={`WelcomeScreen**${branchName}`} /> </Form.Item>
)}
</div>
}
/>
</div> </div>
)} {TotalAmount == 0 && Success && (
{TotalAmount > 0 && <div>
qrCode && <QrComponent com={`WelcomeScreen**${branchName}`} />
PaymentUpiOptions?.length > 0 && </div>
SelUpiId && ( )}
{TotalAmount > 0 &&
qrCode &&
PaymentUpiOptions?.length > 0 &&
SelUpiId && (
<div>
<QrComponent
com={`DisplayQRCodeScreen**upi://pay?pa=${SelUpiId}&pn=Bonrix&cu=INR&am=${TotalAmount}&pn=Bonrix%20Software%20Systems**${TotalAmount}**${SelUpiId}`}
/>
</div>
)}
{PaymentUpiOptions?.length > 0 && OrderId && (
<div> <div>
<QrComponent <QrComponent
com={`DisplayQRCodeScreen**upi://pay?pa=${SelUpiId}&pn=Bonrix&cu=INR&am=${TotalAmount}&pn=Bonrix%20Software%20Systems**${TotalAmount}**${SelUpiId}`} com={`DisplaySuccessQRCodeScreen**...**${extractLastNumberOrderId(OrderId, PrintOrderDetails?.[0]?.OrderDetails?.[0]?.FYStatus)}**${Todaydate}`}
/> />
</div> </div>
)} )}
{PrintOrderDetails?.length > 0 &&
{PaymentUpiOptions?.length > 0 && OrderId && ( PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => (
<div> <div style={{ display: 'none' }}>
<QrComponent <PaymentPdfBooking
com={`DisplaySuccessQRCodeScreen**...**${extractLastNumberOrderId(OrderId, PrintOrderDetails?.[0]?.OrderDetails?.[0]?.FYStatus)}**${Todaydate}`} index={index}
/> table2Data={orderDetail}
</div> singleData2={orderDetail?.productDetails}
)} orderId={
{PrintOrderDetails?.length > 0 && orderDetail?.OrderId &&
PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => ( extractLastNumberOrderId(
orderDetail?.OrderId,
orderDetail?.FYStatus
)
}
CreatedDate={orderDetail?.CreatedDate}
PaymentStatus={PrintOrderDetails?.[0]?.PaymentOrderDtl}
Preference={SettingDataSelector}
printDatas={printDatas}
/>
</div>
))}
{CreditCustomer && (
<div style={{ display: 'none' }}> <div style={{ display: 'none' }}>
<PaymentPdfBooking <BsBillingCreditCustomer
index={index} ModalCreditCustomer={CreditCustomer}
table2Data={orderDetail} handlemodalclose={() => {
singleData2={orderDetail?.productDetails} handleCreditCustomer('Cancel');
orderId={ }}
orderDetail?.OrderId && handleOk={() => {
extractLastNumberOrderId( handleCreditCustomer('Submit');
orderDetail?.OrderId, }}
orderDetail?.FYStatus SplitPayAmount={SplitSelPayMode[`PayAmount-${count}`]}
)
}
CreatedDate={orderDetail?.CreatedDate}
PaymentStatus={PrintOrderDetails?.[0]?.PaymentOrderDtl}
Preference={SettingDataSelector}
printDatas={printDatas}
/> />
</div> </div>
))} )}
{CreditCustomer && ( {PrintOrderDetails?.length > 0 &&
<div style={{ display: 'none' }}> (TokenOnly?.SettingValue === 'Y' ||
<BsBillingCreditCustomer IndividualToken?.SettingValue === 'Y') &&
ModalCreditCustomer={CreditCustomer} PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => (
handlemodalclose={() => { <div style={{ display: 'none' }}>
handleCreditCustomer('Cancel'); <TokensinglePrint
index={index}
table2Data={orderDetail}
singleData2={orderDetail?.productDetails}
orderId={
orderDetail?.OrderId &&
extractLastNumberOrderId(
orderDetail?.OrderId,
orderDetail?.FYStatus
)
}
CreatedDate={orderDetail?.CreatedDate}
PaymentStatus={PrintOrderDetails?.[0]?.PaymentOrderDtl}
/>
</div>
))}
{UpiOpen && (
<DefaultModal
open={UpiOpen}
title="UPI PAYMENT"
width={500}
handleCancel={() => {
Upimodel('Cancel');
}} }}
handleOk={() => { footer={false}
handleCreditCustomer('Submit'); children={
}} <div style={{ overflow: 'scroll' }}>
SplitPayAmount={SplitSelPayMode[`PayAmount-${count}`]}
/>
</div>
)}
{PrintOrderDetails?.length > 0 &&
(TokenOnly?.SettingValue === 'Y' ||
IndividualToken?.SettingValue === 'Y') &&
PrintOrderDetails?.[0]?.OrderDetails?.map((orderDetail, index) => (
<div style={{ display: 'none' }}>
<TokensinglePrint
index={index}
table2Data={orderDetail}
singleData2={orderDetail?.productDetails}
orderId={
orderDetail?.OrderId &&
extractLastNumberOrderId(
orderDetail?.OrderId,
orderDetail?.FYStatus
)
}
CreatedDate={orderDetail?.CreatedDate}
PaymentStatus={PrintOrderDetails?.[0]?.PaymentOrderDtl}
/>
</div>
))}
{UpiOpen && (
<DefaultModal
open={UpiOpen}
title="UPI PAYMENT"
width={500}
handleCancel={() => {
Upimodel('Cancel');
}}
footer={false}
children={
<div style={{ overflow: 'scroll' }}>
<div
style={{
display: 'flex',
flexDirection: 'column',
justifyContent: 'space-evenly',
alignItems: 'center',
}}
>
<div>
<QrinScreen Amount={CurrentPayAmount} UpiId={SelUpiId} />
</div>
<div>
<h1> RS :{CurrentPayAmount} </h1>
</div>
</div>
<div className="sentok">
{(selOption || SelCustId) && (
<div className="sentLink" onClick={onFinalSubmit}>
Sent Payment Link
<img
src={WpIcon}
alt="Your Alt Text"
style={{ width: '30px', height: '30px' }}
/>
</div>
)}
<div <div
style={{ style={{
display: 'flex', display: 'flex',
flexDirection: 'row-reverse', flexDirection: 'column',
width: '100px', justifyContent: 'space-evenly',
alignItems: 'center',
}} }}
> >
<Buttons <div>
buttonText="OK" <QrinScreen Amount={CurrentPayAmount} UpiId={SelUpiId} />
color="901D77" </div>
icon={<ArrowRightOutlined />}
handleSubmit={() => { <div>
Upimodel('Submit'); <h1> RS :{CurrentPayAmount} </h1>
</div>
</div>
<div className="sentok">
{(selOption || SelCustId) && (
<div className="sentLink" onClick={onFinalSubmit}>
Sent Payment Link
<img
src={WpIcon}
alt="Your Alt Text"
style={{ width: '30px', height: '30px' }}
/>
</div>
)}
<div
style={{
display: 'flex',
flexDirection: 'row-reverse',
width: '100px',
}} }}
/> >
<Buttons
buttonText="OK"
color="901D77"
icon={<ArrowRightOutlined />}
handleSubmit={() => {
Upimodel('Submit');
}}
/>
</div>
</div> </div>
</div> </div>
</div> }
} />
/> )}
)} {addcustomer && (
{addcustomer && ( <FeaturesFunctionalities
<FeaturesFunctionalities handleAddCustomerCancel={handleAddCustomerCancel}
handleAddCustomerCancel={handleAddCustomerCancel} addcustomer={addcustomer}
addcustomer={addcustomer} />
/> )}
)} </>
</> </Suspense>
); );
}; };
export default SplitPayment; export default SplitPayment;

View File

@ -85,6 +85,7 @@ import {
} from '../../Features/BrachLogin/BranchLogin.js'; } from '../../Features/BrachLogin/BranchLogin.js';
import RackForm from '../Rack/RackForm.jsx'; import RackForm from '../Rack/RackForm.jsx';
import { isMobile } from 'react-device-detect'; import { isMobile } from 'react-device-detect';
import BarCodeScan from '../../Services/BarCodeScan.jsx';
const subDirectory = import.meta.env.ENV_BASE_URL; const subDirectory = import.meta.env.ENV_BASE_URL;
const ProductForm = ({ formType }) => { const ProductForm = ({ formType }) => {
@ -818,12 +819,19 @@ const ProductForm = ({ formType }) => {
// dispatch(changeSetup_OfferValue(e?.target?.value)) // dispatch(changeSetup_OfferValue(e?.target?.value))
}; };
const handleInput = async (val) => { const handleInput = async (val) => {
if (val?.target?.value?.length >= 5) { // normalize whether we receive an event (e.target.value) or a raw string
const inputVal = val && val.target && typeof val.target.value === 'string' ? val.target.value : val;
if (!inputVal) return;
if (inputVal.length >= 5) {
let QRCodeData = await dispatch( let QRCodeData = await dispatch(
getQrcodeData({ QRCode: val?.target?.value }) getQrcodeData({ QRCode: inputVal })
).unwrap(); ).unwrap();
if (QRCodeData?.data?.statusCode == 0) { if (QRCodeData?.data?.statusCode == 0) {
await setQrcodeFinalVal(val?.target?.value); // valid & unique - update component state and the form field
setQrcodeFinalVal(inputVal);
formRef.current?.setFieldsValue({ QRCode: inputVal });
} else { } else {
let existsQrcodeData = QRCodeData?.data?.data?.filter( let existsQrcodeData = QRCodeData?.data?.data?.filter(
(item) => (item) =>
@ -831,17 +839,18 @@ const ProductForm = ({ formType }) => {
item.CompId === CompId && item.CompId === CompId &&
item.BranchId === BranchId item.BranchId === BranchId
); );
if (existsQrcodeData?.length > 0) { if (existsQrcodeData?.length > 0) {
setQrcodeFinalVal(null); setQrcodeFinalVal(null);
formRef.current?.setFieldsValue({ QRCode: null }); formRef.current?.setFieldsValue({ QRCode: null });
setQrcodeExistsVal(existsQrcodeData?.[0]?.QRCode); setQrcodeExistsVal(existsQrcodeData?.[0]?.QRCode);
setMessageType('error'); setMessageType('error');
setMessageData('Qrcode Already Exists'); setMessageData('Qrcode Already Exists');
} else { } else {
setQrcodeExistsData(QRCodeData.data?.data); setQrcodeExistsData(QRCodeData.data?.data);
setQrcodeExistsDataOpen(true); setQrcodeExistsDataOpen(true);
await setQrcodeFinalVal(val?.target?.value); setQrcodeFinalVal(inputVal);
formRef.current?.setFieldsValue({ QRCode: inputVal });
setQrcodeAuto('N'); setQrcodeAuto('N');
} }
} }
@ -2685,11 +2694,19 @@ const ProductForm = ({ formType }) => {
autoComplete="off" autoComplete="off"
label="Scanner / AddQrcode" label="Scanner / AddQrcode"
onKeyPress={handleKeyPress} onKeyPress={handleKeyPress}
value={QrcodeFinalVal}
valueData={QrcodeFinalVal} valueData={QrcodeFinalVal}
isOnChange={QrcodeFinalVal ? true : false} isOnChange={QrcodeFinalVal ? true : false}
onChange={handleInput} onChange={handleInput}
disabled={editstate?.QRCode ? true : false} disabled={editstate?.QRCode ? true : false}
/> />
{isMobile &&
<BarCodeScan
onScan={(value) => {
handleInput(value);
}}
/>
}
{QrcodeExistsVal && QrcodeExistsVal} {QrcodeExistsVal && QrcodeExistsVal}
</Form.Item> </Form.Item>
</div> </div>
@ -2904,6 +2921,7 @@ const ProductForm = ({ formType }) => {
autoComplete="off" autoComplete="off"
label="Scanner / AddOnePcQrcode" label="Scanner / AddOnePcQrcode"
onKeyPress={handleKeyPressSingle} onKeyPress={handleKeyPressSingle}
value={QrcodeSingleFinalVal}
valueData={QrcodeSingleFinalVal} valueData={QrcodeSingleFinalVal}
isOnChange={ isOnChange={
QrcodeSingleFinalVal ? true : false QrcodeSingleFinalVal ? true : false

File diff suppressed because it is too large Load Diff

View File

@ -684,7 +684,7 @@ const initSession = () => {
sessionStorage.setItem( sessionStorage.setItem(
'auth', 'auth',
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiOTM2MDY0MjI0NCIsIlBhc3N3b3JkIjoiWkB6MTIzNCIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTIiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTQiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiXSwiZXhwIjoxNzcwOTIyMDEyLCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMDEifQ.8iuEF8S7kW1OvVUda3YAx9v7ilp-uy9PVfbBvCPoq20' 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiOTM2MDY0MjI0NCIsIlBhc3N3b3JkIjoiWkB6MTIzNCIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTIiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTQiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiXSwiZXhwIjoxNzcxODcyOTYwLCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMDEifQ.tRA41-3-m2VYm_jkndGPLzB-jxzuO1XvG94Fmf6NTGQ'
); );
}; };