diff --git a/src/Components/PozoAppLoader/PozoLoader2.jsx b/src/Components/PozoAppLoader/PozoLoader2.jsx index 0801ef9..6b08056 100644 --- a/src/Components/PozoAppLoader/PozoLoader2.jsx +++ b/src/Components/PozoAppLoader/PozoLoader2.jsx @@ -262,7 +262,7 @@ const styles = { status: { marginTop: '6px', - fontSize: '0.7rem', + fontSize: '0.6rem', fontWeight: 600, letterSpacing: '4px', textTransform: 'uppercase', diff --git a/src/Features/BrachLogin/BranchLogin.js b/src/Features/BrachLogin/BranchLogin.js index 9b415cd..2c1d3c6 100644 --- a/src/Features/BrachLogin/BranchLogin.js +++ b/src/Features/BrachLogin/BranchLogin.js @@ -192,14 +192,14 @@ export const getLoginuser = createAsyncThunk( export const getCommonAppPreference = createAsyncThunk( '/getAppPreference', async (AppId) => { - if ( - AppId != null && - AppId != undefined - ){ - return await axiosCommonInstanceData.get( - `/ApplicationPreferenceMapping?AppId=${AppId}` - ); - } + if ( + AppId != null && + AppId != undefined + ) { + return await axiosCommonInstanceData.get( + `/ApplicationPreferenceMapping?AppId=${AppId}` + ); + } } ); @@ -209,7 +209,7 @@ const initialState = { SadminUserPin: [], SadminUserData: [], AppPreferences: [], - isWarehouse:false, + isWarehouse: false, }; const BranchLogin = createSlice({ @@ -219,8 +219,8 @@ const BranchLogin = createSlice({ changeSelectedBranchId: (state, action) => { state.SelectedBrachId = action?.payload; }, - changeWarehouse:(state,action)=>{ - state.isWarehouse=action?.payload + changeWarehouse: (state, action) => { + state.isWarehouse = action?.payload } }, @@ -257,7 +257,7 @@ const BranchLogin = createSlice({ }); }, }); -export const { changeSelectedBranchId ,changeWarehouse} = BranchLogin.actions; +export const { changeSelectedBranchId, changeWarehouse } = BranchLogin.actions; export const GlobalSelectedBranchId = (state) => state?.BranchLogin?.SelectedBrachId; export const GlobalCompBranchData = (state) => diff --git a/src/Pages/AppPage/AppPage.jsx b/src/Pages/AppPage/AppPage.jsx index 80dd710..9ad182a 100644 --- a/src/Pages/AppPage/AppPage.jsx +++ b/src/Pages/AppPage/AppPage.jsx @@ -864,10 +864,11 @@ const AppPage = () => { 'Payment Updates', `${subDirectory}setting/payment-received-retail` ), - getsubItem('Settlement', `${subDirectory}setting/Settlement`, null, [ - getsubItem('Tips', `${subDirectory}report/tipamountsettlementlist`), - getsubItem('Incentive', `${subDirectory}report/EmployeeSettlement`), - ]), + // getsubItem('Settlement', `${subDirectory}setting/Settlement`, null, [ + // getsubItem('Tips', `${subDirectory}report/tipamountsettlementlist`), + // getsubItem('Incentive', `${subDirectory}report/EmployeeSettlement`), + // ]), + getsubItem('Settlement', `${subDirectory}report/Settlement`), !iswarehouse && getsubItem('Others', `${subDirectory}cancelReschedule`, null, [ @@ -1112,10 +1113,11 @@ const AppPage = () => { ]; const Settlement = [ !sportsAppPreference && - getsubItem('Settlement', `${subDirectory}setting/Settlement`, null, [ - getsubItem('Tips', `${subDirectory}report/tipamountsettlementlist`), - getsubItem('Incentive', `${subDirectory}report/EmployeeSettlement`), - ]), + // getsubItem('Settlement', `${subDirectory}setting/Settlement`, null, [ + // getsubItem('Tips', `${subDirectory}report/tipamountsettlementlist`), + // getsubItem('Incentive', `${subDirectory}report/EmployeeSettlement`), + // ]), + getsubItem('Settlement', `${subDirectory}report/Settlement`), ]; const Others = [ !iswarehouse && @@ -1817,21 +1819,22 @@ const AppPage = () => { `${subDirectory}setting/payment-received-retail` ), - getsubItem( - 'Settlement', - `${subDirectory}setting/Settlement`, - null, - [ - getsubItem( - 'Tips', - `${subDirectory}report/tipamountsettlementlist` - ), - getsubItem( - 'Incentive', - `${subDirectory}report/EmployeeSettlement` - ), - ] - ), + // getsubItem( + // 'Settlement', + // `${subDirectory}setting/Settlement`, + // null, + // [ + // getsubItem( + // 'Tips', + // `${subDirectory}report/tipamountsettlementlist` + // ), + // getsubItem( + // 'Incentive', + // `${subDirectory}report/EmployeeSettlement` + // ), + // ] + // ), + getsubItem('Settlement', `${subDirectory}report/Settlement`), !iswarehouse && getsubItem('Others', `${subDirectory}cancelReschedule`, null, [ getsubItem( @@ -2401,21 +2404,22 @@ const AppPage = () => { ), !sportsAppPreference && - getsubItem( - 'Settlement', - `${subDirectory}setting/Settlement`, - null, - [ - getsubItem( - 'Tips', - `${subDirectory}report/tipamountsettlementlist` - ), - getsubItem( - 'Incentive', - `${subDirectory}report/EmployeeSettlement` - ), - ] - ), + // getsubItem( + // 'Settlement', + // `${subDirectory}setting/Settlement`, + // null, + // [ + // getsubItem( + // 'Tips', + // `${subDirectory}report/tipamountsettlementlist` + // ), + // getsubItem( + // 'Incentive', + // `${subDirectory}report/EmployeeSettlement` + // ), + // ] + // ), + getsubItem('Settlement', `${subDirectory}report/Settlement`), !iswarehouse && getsubItem('Others', `${subDirectory}cancelReschedule`, null, [ getsubItem( diff --git a/src/Pages/Automated Reorder/AutomatedReorder.jsx b/src/Pages/Automated Reorder/AutomatedReorder.jsx index fe59735..ceaebed 100644 --- a/src/Pages/Automated Reorder/AutomatedReorder.jsx +++ b/src/Pages/Automated Reorder/AutomatedReorder.jsx @@ -396,11 +396,12 @@ const AutomatedReorder = ({ formType = 'add' }) => { message: 'Please select a product', }, ]} - > + > + Product} options={products?.map((item) => ({ - label: item?.ProdName, + label: `${item?.ProdName} (${item?.UOMName})`, value: item?.ProdId, variantDtls: item?.ProdVariantPriceDetails, CheapestStatus: item?.CheapestStatus, diff --git a/src/Pages/Automated Reorder/AutomatedReorder.scss b/src/Pages/Automated Reorder/AutomatedReorder.scss index 083b4a9..903a74f 100644 --- a/src/Pages/Automated Reorder/AutomatedReorder.scss +++ b/src/Pages/Automated Reorder/AutomatedReorder.scss @@ -3,7 +3,7 @@ height: 90vh; overflow: auto; scrollbar-width: thin; - font-family: 'Poppins'; + font-family: "Poppins"; .automated-reorder-content { padding-top: 18px; @@ -51,4 +51,12 @@ padding: 6px !important; } } -} \ No newline at end of file +} + +.automated-reorder-list-content { + .eyeopenShow { + display: flex; + align-items: center; + justify-content: center; + } +} diff --git a/src/Pages/Automated Reorder/AutomatedReorderList.jsx b/src/Pages/Automated Reorder/AutomatedReorderList.jsx index d574ead..db7e7db 100644 --- a/src/Pages/Automated Reorder/AutomatedReorderList.jsx +++ b/src/Pages/Automated Reorder/AutomatedReorderList.jsx @@ -1,342 +1,359 @@ -import { useCallback, useEffect, useState } from "react"; -import { useDispatch } from "react-redux"; -import { getSession } from "../../Services/Others"; -import { changeBreadCrumb, getEmpAccess } from "../../Features/AppPage/CenterPage"; -import { Messages } from "../../Components/Notifications/Messages"; -import { Tables } from "../../Components/Tables/Table"; -import FormHeader from "../PageComponents/FormHeader"; -import Search from "../../Components/Forms/Search"; -import Buttons from "../../Components/Forms/Buttons"; +import { useCallback, useEffect, useState } from 'react'; +import { useDispatch } from 'react-redux'; +import { getSession } from '../../Services/Others'; import { - EditFilled, - DeleteFilled, - PlusOutlined, - ReloadOutlined, + changeBreadCrumb, + getEmpAccess, +} from '../../Features/AppPage/CenterPage'; +import { Messages } from '../../Components/Notifications/Messages'; +import { Tables } from '../../Components/Tables/Table'; +import FormHeader from '../PageComponents/FormHeader'; +import Search from '../../Components/Forms/Search'; +import Buttons from '../../Components/Forms/Buttons'; +import { + EditFilled, + DeleteFilled, + PlusOutlined, + ReloadOutlined, } from '@ant-design/icons'; -import { useLocation, useNavigate } from "react-router-dom"; -import { Space, Tooltip } from "antd"; -import { deleteAutomatedReorder, getAutomatedReorderList } from "../../Features/PurchaseOrder/PurchaseOrder"; -import { DefaultModal } from "../../Components/Modal/DefaultModal"; -import { FaRegEye } from "react-icons/fa"; -import { render } from "react-dom"; -import { useAuth } from "../../AuthContext"; -import "./AutomatedReorder.scss"; +import { useLocation, useNavigate } from 'react-router-dom'; +import { Space, Tooltip } from 'antd'; +import { + deleteAutomatedReorder, + getAutomatedReorderList, +} from '../../Features/PurchaseOrder/PurchaseOrder'; +import { DefaultModal } from '../../Components/Modal/DefaultModal'; +import { FaRegEye } from 'react-icons/fa'; +import { render } from 'react-dom'; +import { useAuth } from '../../AuthContext'; +import './AutomatedReorder.scss'; const subDirectory = import.meta.env.BASE_URL; const items = [ - { - name: 'Home', - link: `${subDirectory}app-page/home`, - }, - { - name: 'Automated Reorder', - link: `${subDirectory}setting/automated-reorder`, - }, + { + name: 'Home', + link: `${subDirectory}app-page/home`, + }, + { + name: 'Automated Reorder', + link: `${subDirectory}setting/automated-reorder`, + }, ]; - - const AutomatedReorderList = () => { - const dispatch = useDispatch(); - const navigate = useNavigate(); - const location = useLocation(); - const state = location?.state; - const { SadminuserAccess } = useAuth(); - let SAAccessCommonMaster = SadminuserAccess?.find( - (e) => e?.MenuName === 'Product Receipt' + const dispatch = useDispatch(); + const navigate = useNavigate(); + const location = useLocation(); + const state = location?.state; + const { SadminuserAccess } = useAuth(); + let SAAccessCommonMaster = SadminuserAccess?.find( + (e) => e?.MenuName === 'Product Receipt' + ); + + const AppId = getSession('AppId'); + const CompId = getSession('CompId'); + const BranchId = getSession('BranchId'); + const UserId = getSession('UserId'); + const UserType = getSession('UserType'); + const [empData, setEmpData] = useState(); + const [addnewAccess, setaddnewAccess] = useState(true); + + const [messageType, setMessageType] = useState(null); + const [messageData, setMessageData] = useState(null); + const [supplierModalOpen, setSupplierModalOpen] = useState(false); + const [supplierRecords, setSupplierRecords] = useState([]); + const [supplierRecordIndex, setSupplierRecordIndex] = useState(null); + const [page, setPage] = useState(1); + + const [searchedText, setSearchedText] = useState(''); + const [tableData, setTableData] = useState([]); + + const columns = [ + { + title: 'SL.NO', + dataIndex: 'SLNO', + key: 'SLNO', + width: '10%', + render: (_, record, index) => index + 1, + align: 'center', + }, + { + title: 'Product Name', + dataIndex: 'ProdName', + key: 'ProdName', + render: (_, record) => `${record.ProdName} (${record.UOMName})`, + }, + { + title: 'Supplier', + dataIndex: 'Supplier', + key: 'Supplier', + align: 'center', + render: (_, record, index) => ( + //
+ +
+ { + setSupplierModalOpen(true); + setSupplierRecords(record.SupplierDetails); + setSupplierRecordIndex(index); + }} + /> +
+
+ ), + }, + { + title: 'Order Type', + dataIndex: 'OrderType', + key: 'OrderType', + render: (_, record, index) => + record.OrderType === 'E' ? 'End of Day (EOD)' : 'Immediate', + }, + { + title: 'Confirmation Type', + dataIndex: 'OrderProcessing', + key: 'OrderProcessing', + render: (_, record, index) => + record.OrderProcessing === 'Y' ? 'Need Confirmation' : 'Auto', + }, + { + title: 'Reorder Quantity', + dataIndex: 'OrderQty', + key: 'OrderQty', + align: 'center', + }, + { + title: 'Action', + dataIndex: 'Action', + key: 'Action', + width: '100px', + align: 'center', + render: (_, record, index) => + record.ActiveStatus === 'A' ? ( +
+ handleEdit(record)} + /> + handleActiveAndDeactive(record)} + /> +
+ ) : ( + handleActiveAndDeactive(record)} + /> + ), + }, + ]; + + const supplierColumns = [ + { + title: 'SL.NO', + dataIndex: 'SLNO', + key: 'SLNO', + width: '10%', + render: (_, record, index) => index + 1, + }, + { + title: 'Supplier Name', + dataIndex: 'SuppName', + key: 'SuppName', + width: '20%', + }, + ]; + + useEffect(() => { + try { + if (AppId && CompId && BranchId) { + dispatch(changeBreadCrumb({ items: items })); + fetchData(); + if (state?.Notify) { + setMessageType(state?.Notify.messageType); + setMessageData(state?.Notify.messageData); + } + } + } catch (error) { + console.error(error, 'error: changeBreadCrumb'); + } + }, [AppId, CompId, BranchId]); + + useEffect(() => { + if (UserType === 'Employee') { + fetchApi(); + } + }, [UserType]); + + useEffect(() => { + let hasAccess = false; + + if (UserType === 'Admin' || UserType === 'Super Admin') { + hasAccess = true; + } else if (UserType === 'Employee') { + hasAccess = empData?.AddAccess === 'Y'; + } else if (UserType === 'Super Admin User') { + hasAccess = SAAccessCommonMaster?.AddAccess === 'Y'; + } + + setaddnewAccess(!hasAccess); + }, [empData, SAAccessCommonMaster, UserType]); + + const fetchApi = async () => { + let data = { + CompId: CompId, + BranchId: BranchId, + AppId: AppId, + EmpId: UserId, + }; + let response = await dispatch(getEmpAccess(data)).unwrap(); + let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter( + (item) => item.ConfigName === 'Automated Reorder' ); + setEmpData(datas?.[0]); + }; - const AppId = getSession('AppId'); - const CompId = getSession('CompId'); - const BranchId = getSession('BranchId'); - const UserId = getSession('UserId'); - const UserType = getSession('UserType'); - const [empData, setEmpData] = useState(); - const [addnewAccess, setaddnewAccess] = useState(true); - - const [messageType, setMessageType] = useState(null); - const [messageData, setMessageData] = useState(null); - const [supplierModalOpen, setSupplierModalOpen] = useState(false); - const [supplierRecords, setSupplierRecords] = useState([]); - const [supplierRecordIndex, setSupplierRecordIndex] = useState(null); - const [page, setPage] = useState(1); - - - const [searchedText, setSearchedText] = useState(''); - const [tableData, setTableData] = useState([]); - - const columns = [ - { - title: 'SL.NO', - dataIndex: 'SLNO', - key: 'SLNO', - width: '10%', - render: (_, record, index) => index + 1, - align: 'center', - }, - { - title: 'Product Name', - dataIndex: 'ProdName', - key: 'ProdName', - }, - { - title: 'Supplier', - dataIndex: 'Supplier', - key: 'Supplier', - align: 'center', - render: (_, record, index) => ( - //
- -
- { - setSupplierModalOpen(true); - setSupplierRecords(record.SupplierDetails); - setSupplierRecordIndex(index); - }} - /> -
-
- ), - }, - { - title: 'Order Type', - dataIndex: 'OrderType', - key: 'OrderType', - render: (_, record, index) => ( - record.OrderType === 'E' ? 'End of Day (EOD)' : 'Immediate' - ) - }, - { - title: 'Confirmation Type', - dataIndex: 'OrderProcessing', - key: 'OrderProcessing', - render: (_, record, index) => ( - record.OrderProcessing === 'Y' ? 'Need Confirmation' : 'Auto' - ) - }, - { - title: 'Reorder Quantity', - dataIndex: 'OrderQty', - key: 'OrderQty', - align: 'center', - }, - { - title: 'Action', - dataIndex: 'Action', - key: 'Action', - width: '100px', - align: 'center', - render: (_, record, index) => ( - - record.ActiveStatus === 'A' ? ( -
- handleEdit(record)} - /> - handleActiveAndDeactive(record)} - /> -
- ) : ( - handleActiveAndDeactive(record)} - /> - ) - ), - }, - ]; - - const supplierColumns = [ - { - title: 'SL.NO', - dataIndex: 'SLNO', - key: 'SLNO', - width: '10%', - render: (_, record, index) => index + 1 - }, - { - title: 'Supplier Name', - dataIndex: 'SuppName', - key: 'SuppName', - width: '20%', - } - ]; - - useEffect(() => { - try { - if (AppId && CompId && BranchId) { - dispatch(changeBreadCrumb({ items: items })); - fetchData() - if (state?.Notify) { - setMessageType(state?.Notify.messageType); - setMessageData(state?.Notify.messageData); - } - } - } catch (error) { - console.error(error, 'error: changeBreadCrumb'); - } - }, [AppId, CompId, BranchId]); - - useEffect(() => { - if (UserType === 'Employee') { - fetchApi(); - } - }, [UserType]); - - useEffect(() => { - let hasAccess = false; - - if (UserType === 'Admin' || UserType === 'Super Admin') { - hasAccess = true; - } else if (UserType === 'Employee') { - hasAccess = empData?.AddAccess === 'Y'; - } else if (UserType === 'Super Admin User') { - hasAccess = SAAccessCommonMaster?.AddAccess === 'Y'; - } - - setaddnewAccess(!hasAccess); - }, [empData, SAAccessCommonMaster, UserType]); - - const fetchApi = async () => { - let data = { - CompId: CompId, - BranchId: BranchId, - AppId: AppId, - EmpId: UserId, - }; - let response = await dispatch(getEmpAccess(data)).unwrap(); - let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter( - (item) => item.ConfigName === 'Automated Reorder' - ); - setEmpData(datas?.[0]); - }; - - const fetchData = async () => { - try { - const res = await dispatch(getAutomatedReorderList({ AppId, CompId, BranchId }))?.unwrap(); - if (res?.data?.statusCode === 1 && res?.data?.data?.length > 0) { - setTableData(res?.data?.data) - } else { - setTableData([]) - } - } catch (error) { - console.error(error, 'error: getAutomatedReorderList'); - } + const fetchData = async () => { + try { + const res = await dispatch( + getAutomatedReorderList({ AppId, CompId, BranchId }) + )?.unwrap(); + if (res?.data?.statusCode === 1 && res?.data?.data?.length > 0) { + setTableData(res?.data?.data); + } else { + setTableData([]); + } + } catch (error) { + console.error(error, 'error: getAutomatedReorderList'); } + }; - const onSearch = (value) => { - setSearchedText(value); - }; - const onSearchChange = (e) => { - setSearchedText(e?.target?.value); - }; + const onSearch = (value) => { + setSearchedText(value); + }; + const onSearchChange = (e) => { + setSearchedText(e?.target?.value); + }; - const handleAdd = () => { - navigate(`${subDirectory}setting/automated-reorder/new`); + const handleAdd = () => { + navigate(`${subDirectory}setting/automated-reorder/new`); + }; + + const handleEdit = (record) => { + navigate(`${subDirectory}setting/automated-reorder/update`, { + state: { + editstate: record, + }, + }); + }; + const handleActiveAndDeactive = async (record) => { + const res = await dispatch( + deleteAutomatedReorder({ + UniqueId: record?.UniqueId, + UpdatedBy: UserId, + ActiveStatus: record?.ActiveStatus === 'A' ? 'D' : 'A', + }) + )?.unwrap(); + if (res?.data?.statusCode === 1) { + setMessageType('success'); + setMessageData( + record?.ActiveStatus === 'A' + ? 'Deactivated Successfully' + : 'Activated Successfully' + ); + fetchData(); + } else { + setMessageType('error'); + setMessageData(res?.data?.message); } + }; - const handleEdit = (record) => { - navigate(`${subDirectory}setting/automated-reorder/update`, { - state: { - editstate: record, - } - }); - } - const handleActiveAndDeactive = async (record) => { - const res = await dispatch(deleteAutomatedReorder({ UniqueId: record?.UniqueId, UpdatedBy: UserId, ActiveStatus: record?.ActiveStatus === 'A' ? 'D' : 'A' }))?.unwrap(); - if (res?.data?.statusCode === 1) { - setMessageType('success'); - setMessageData(record?.ActiveStatus === 'A' ? 'Deactivated Successfully' : 'Activated Successfully'); - fetchData(); - } else { - setMessageType('error'); - setMessageData(res?.data?.message); - } - } + const onComplete = useCallback(() => { + setMessageType(null); + setMessageData(null); + }, []); + const handlePageChange = (current) => { + setPage(current); + }; - const onComplete = useCallback(() => { - setMessageType(null); - setMessageData(null); - }, []); - const handlePageChange = (current) => { - setPage(current); - }; - - return ( -
- -
-
-
-
- -
-
-
- -
- } - /> -
-
-
-
- -
+ return ( +
+ +
+
+
+
+
- { - setSupplierModalOpen(false); - setSupplierRecords(null); - setSupplierRecordIndex(null); - }} - children={ -
- -
- } - /> -
- ) -} +
+
+ +
+ } + /> +
+
+
+
+ +
+
+ { + setSupplierModalOpen(false); + setSupplierRecords(null); + setSupplierRecordIndex(null); + }} + children={ +
+ +
+ } + /> + + ); +}; -export default AutomatedReorderList \ No newline at end of file +export default AutomatedReorderList; diff --git a/src/Pages/BookingScreen/Components/BSItemCards/BSItemCard.jsx b/src/Pages/BookingScreen/Components/BSItemCards/BSItemCard.jsx index 02957fd..788066c 100644 --- a/src/Pages/BookingScreen/Components/BSItemCards/BSItemCard.jsx +++ b/src/Pages/BookingScreen/Components/BSItemCards/BSItemCard.jsx @@ -120,7 +120,10 @@ import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLo import { useDateStore } from '../../../../Features/BookingScreen/BookingData/DateStore.js'; import AddProduct from '../../../../Components/AddProduct/AddProduct.jsx'; import { MdOutlineAddShoppingCart } from 'react-icons/md'; -import { bulkpostdata, getUomData } from '../../../../Features/ProductPage/ProductPage.js'; +import { + bulkpostdata, + getUomData, +} from '../../../../Features/ProductPage/ProductPage.js'; import ProductPriceChange from '../UtillComponents/ProductPriceChange.jsx'; import ExpireConfirmModal from '../BookingFunctionality/ExpireConfirmModal.jsx'; import { calculateOverAllQtyLimit } from '../../../../utils/calculations.js'; @@ -162,7 +165,7 @@ export function SortableCard({ id, children, item }) { const BSItemCard = (props) => { const cardFunction = props?.cardFunctionality; - const { connectingState = null, setConnectingState = () => { } } = props; + const { connectingState = null, setConnectingState = () => {} } = props; console.log(connectingState?.positionChange, 'positionChange'); // const applyOffer = useApplyOfferto_CardDetail(); const preferenceDatas = useSelector(PreferenceData, shallowEqual); @@ -638,7 +641,7 @@ const BSItemCard = (props) => { WithoutTaxRate: availableFreeQty * item.OrderRate - (availableFreeQty * item.OrderRate * item.TaxPercentage) / - 100, + 100, Offer: availableFreeQty * item.OrderRate, }; @@ -687,7 +690,7 @@ const BSItemCard = (props) => { ((existingPaidItem.OrderQty + excessQty) * item.OrderRate * item.TaxPercentage) / - 100, + 100, }; ModifiedData.push(mergedPaidItem); @@ -722,7 +725,7 @@ const BSItemCard = (props) => { data?.InwardDtlId === item?.InwardDtlId && data?.ProdId === item?.ProdId && data?.OfferMessage?.[0]?.OfferId === - item?.OfferMessage?.[0]?.OfferId + item?.OfferMessage?.[0]?.OfferId ); if (isAlreadyExists !== -1) { @@ -742,11 +745,11 @@ const BSItemCard = (props) => { ).toFixed(2), WithoutTaxRate: (ModifiedData[isAlreadyExists].OrderQty + item.OrderQty) * - item.OrderRate - + item.OrderRate - ((ModifiedData[isAlreadyExists].OrderQty + item.OrderQty) * item.OrderRate * item.TaxPercentage) / - 100, + 100, Offer: (ModifiedData[isAlreadyExists].OrderQty + item.OrderQty) * item.OrderRate, @@ -772,10 +775,10 @@ const BSItemCard = (props) => { const appliedOfferAlreadyExists = AppliedOffers.findIndex( (offer) => offer?.FreeProductsList?.FreeProdId === - matchingFreeProduct?.FreeProdId && + matchingFreeProduct?.FreeProdId && offer?.TableName === matchingFreeProduct?.TableName && offer?.TableUniqueName === - matchingFreeProduct?.TableUniqueName && + matchingFreeProduct?.TableUniqueName && offer?.OfferId === matchingFreeProduct?.OfferId && offer?.OfferMode === matchingFreeProduct?.OfferMode && offer?.FreeProductsList?.ProdVariantDetails?.[0] @@ -978,7 +981,6 @@ const BSItemCard = (props) => { await dispatch( getOfferinBooking({ AppId: AppId, CompId: CompId, BranchId: BranchId }) ).unwrap(); - } useEffect(() => { @@ -1022,7 +1024,7 @@ const BSItemCard = (props) => { ? [] : SelectedDatas : ItemCard?.length == 0 || - (ItemCard?.[0]?.AppId === 0 && ItemCard?.[0]?.CompId === 0) + (ItemCard?.[0]?.AppId === 0 && ItemCard?.[0]?.CompId === 0) ? noSubcatCardData : ItemCard : ''; @@ -1056,8 +1058,7 @@ const BSItemCard = (props) => { if (AppId && CompId && BranchId) { fetchedit(); GetmultipleSearchData(); - getUom() - + getUom(); } // dispatch(changepreOrder(false)); Commented to Add Normal Produts After Adding the Combo Pack !!!!!! Dont Touch Without Shifayath Permission @@ -1065,7 +1066,7 @@ const BSItemCard = (props) => { const getUom = () => { dispatch(getUomData()); - } + }; const GetmultipleSearchData = async () => { const data = { @@ -1133,14 +1134,14 @@ const BSItemCard = (props) => { ProdSubCat: ProdSubCat, ...(AvailableDate && selectedDate ? { - date: Array.isArray(selectedDate) - ? selectedDate - .map((d) => (d?.format ? d.format('YYYY-MM-DD') : d)) - .join(',') - : selectedDate?.format - ? selectedDate.format('YYYY-MM-DD') - : selectedDate, - } + date: Array.isArray(selectedDate) + ? selectedDate + .map((d) => (d?.format ? d.format('YYYY-MM-DD') : d)) + .join(',') + : selectedDate?.format + ? selectedDate.format('YYYY-MM-DD') + : selectedDate, + } : {}), }; //mohan @@ -1187,14 +1188,14 @@ const BSItemCard = (props) => { prodCat: ProdCat, ...(AvailableDate && selectedDate ? { - date: Array.isArray(selectedDate) - ? selectedDate - .map((d) => (d?.format ? d.format('YYYY-MM-DD') : d)) - .join(',') - : selectedDate?.format - ? selectedDate.format('YYYY-MM-DD') - : selectedDate, - } + date: Array.isArray(selectedDate) + ? selectedDate + .map((d) => (d?.format ? d.format('YYYY-MM-DD') : d)) + .join(',') + : selectedDate?.format + ? selectedDate.format('YYYY-MM-DD') + : selectedDate, + } : {}), }; @@ -1400,13 +1401,13 @@ const BSItemCard = (props) => { (cartItem) => cartItem?.ProdId === item?.ProductDetail?.[QtyIndex]?.ProdId && cartItem?.InwardDtlId === - item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ - VarientIndex - ]?.StockDetails?.[0]?.InwardDtlId && + item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ + VarientIndex + ]?.StockDetails?.[0]?.InwardDtlId && cartItem?.OrderRate === - item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ - VarientIndex - ]?.StockDetails?.[0]?.SellPrice && + item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ + VarientIndex + ]?.StockDetails?.[0]?.SellPrice && !cartItem?.SalesId ); @@ -1415,9 +1416,9 @@ const BSItemCard = (props) => { (cartItem) => cartItem?.ProdId === item?.ProductDetail?.[QtyIndex]?.ProdId && cartItem?.InwardDtlId === - item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ - VarientIndex - ]?.StockDetails?.[0]?.InwardDtlId && + item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ + VarientIndex + ]?.StockDetails?.[0]?.InwardDtlId && // (cartItem?.OrderRate === item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]?.StockDetails?.[0]?.SellPrice) !cartItem?.SalesId ); @@ -1459,11 +1460,11 @@ const BSItemCard = (props) => { (cartItem) => cartItem?.ProdId === item?.ProductDetail?.[QtyIndex]?.ProdId && cartItem?.InwardDtlId === - item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex] - ?.StockDetails?.[0]?.InwardDtlId && + item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex] + ?.StockDetails?.[0]?.InwardDtlId && cartItem?.OrderRate === - item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex] - ?.StockDetails?.[0]?.SellPrice && + item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex] + ?.StockDetails?.[0]?.SellPrice && !cartItem?.SalesId ); @@ -1472,9 +1473,9 @@ const BSItemCard = (props) => { (cartItem) => cartItem?.ProdId === item?.ProductDetail?.[QtyIndex]?.ProdId && cartItem?.InwardDtlId === - item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ - VarientIndex - ]?.StockDetails?.[0]?.InwardDtlId && + item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ + VarientIndex + ]?.StockDetails?.[0]?.InwardDtlId && // (cartItem?.OrderRate === item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]?.StockDetails?.[0]?.SellPrice) !cartItem?.SalesId ); @@ -1555,13 +1556,13 @@ const BSItemCard = (props) => { (cartItem) => cartItem?.ProdId === qtydata?.ProductDetail?.[QtyIndex]?.ProdId && cartItem?.InwardDtlId === - qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ - index.key - ]?.StockDetails?.[0]?.InwardDtlId && + qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ + index.key + ]?.StockDetails?.[0]?.InwardDtlId && cartItem?.OrderRate === - qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ - index.key - ]?.StockDetails?.[0]?.SellPrice && + qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ + index.key + ]?.StockDetails?.[0]?.SellPrice && !cartItem?.SalesId ); @@ -1569,11 +1570,11 @@ const BSItemCard = (props) => { let Isincartonepc = CartOrderDetails?.filter( (cartItem) => cartItem?.ProdId === - qtydata?.ProductDetail?.[QtyIndex]?.ProdId && + qtydata?.ProductDetail?.[QtyIndex]?.ProdId && cartItem?.InwardDtlId === - qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ - index.key - ]?.StockDetails?.[0]?.InwardDtlId && + qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ + index.key + ]?.StockDetails?.[0]?.InwardDtlId && // (cartItem?.OrderRate === item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]?.StockDetails?.[0]?.SellPrice) !cartItem?.SalesId ); @@ -1641,13 +1642,13 @@ const BSItemCard = (props) => { (cartItem) => cartItem?.ProdId === qtydata?.ProductDetail?.[QtyIndex]?.ProdId && cartItem?.InwardDtlId === - qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ - index.key - ]?.StockDetails?.[0]?.InwardDtlId && + qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ + index.key + ]?.StockDetails?.[0]?.InwardDtlId && cartItem?.OrderRate === - qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ - index.key - ]?.StockDetails?.[0]?.SellPrice && + qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ + index.key + ]?.StockDetails?.[0]?.SellPrice && !cartItem?.SalesId ); @@ -1656,9 +1657,9 @@ const BSItemCard = (props) => { (cartItem) => cartItem?.ProdId === qtydata?.ProductDetail?.[QtyIndex]?.ProdId && cartItem?.InwardDtlId === - qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ - index.key - ]?.StockDetails?.[0]?.InwardDtlId && + qtydata?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[ + index.key + ]?.StockDetails?.[0]?.InwardDtlId && // (cartItem?.OrderRate === item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]?.StockDetails?.[0]?.SellPrice) !cartItem?.SalesId ); @@ -1826,15 +1827,15 @@ const BSItemCard = (props) => { let Isincart = CartOrderDetails?.find( (cartItem) => cartItem?.ProdId === - qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdId && + qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdId && cartItem?.InwardDtlId === - qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[ - item?.VarientIndex - ]?.StockDetails?.[0]?.InwardDtlId && + qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[ + item?.VarientIndex + ]?.StockDetails?.[0]?.InwardDtlId && cartItem?.OrderRate === - qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[ - item?.VarientIndex - ]?.StockDetails?.[0]?.SellPrice && + qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[ + item?.VarientIndex + ]?.StockDetails?.[0]?.SellPrice && !cartItem?.SalesId ); @@ -1842,11 +1843,11 @@ const BSItemCard = (props) => { let Isincartonepc = CartOrderDetails?.filter( (cartItem) => cartItem?.ProdId === - qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdId && + qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdId && cartItem?.InwardDtlId === - qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[ - item?.VarientIndex - ]?.StockDetails?.[0]?.InwardDtlId && + qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[ + item?.VarientIndex + ]?.StockDetails?.[0]?.InwardDtlId && // (cartItem?.OrderRate === item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]?.StockDetails?.[0]?.SellPrice) !cartItem?.SalesId ); @@ -1925,15 +1926,15 @@ const BSItemCard = (props) => { let Isincart = CartOrderDetails?.find( (cartItem) => cartItem?.ProdId === - qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdId && + qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdId && cartItem?.InwardDtlId === - qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[ - item?.VarientIndex - ]?.StockDetails?.[0]?.InwardDtlId && + qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[ + item?.VarientIndex + ]?.StockDetails?.[0]?.InwardDtlId && cartItem?.OrderRate === - qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[ - item?.VarientIndex - ]?.StockDetails?.[0]?.SellPrice && + qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[ + item?.VarientIndex + ]?.StockDetails?.[0]?.SellPrice && !cartItem?.SalesId ); @@ -1941,11 +1942,11 @@ const BSItemCard = (props) => { let Isincartonepc = CartOrderDetails?.filter( (cartItem) => cartItem?.ProdId === - qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdId && + qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdId && cartItem?.InwardDtlId === - qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[ - item?.VarientIndex - ]?.StockDetails?.[0]?.InwardDtlId && + qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[ + item?.VarientIndex + ]?.StockDetails?.[0]?.InwardDtlId && // (cartItem?.OrderRate === item?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]?.StockDetails?.[0]?.SellPrice) !cartItem?.SalesId ); @@ -2237,15 +2238,15 @@ const BSItemCard = (props) => { const isExistsInFreeProdList = hasOffer ? FreeProdList?.filter( - (f) => - f?.FreeProdId === item?.ProdId && - f?.ProdVariantDetails?.some((variant) => - variant?.StockDetails?.some( - (stock) => stock?.FreeInwardDtlId === item?.InwardDtlId - ) - ) && - f?.RemainingQty > 0 - ) + (f) => + f?.FreeProdId === item?.ProdId && + f?.ProdVariantDetails?.some((variant) => + variant?.StockDetails?.some( + (stock) => stock?.FreeInwardDtlId === item?.InwardDtlId + ) + ) && + f?.RemainingQty > 0 + ) : []; const calculateTaxAmounts = (qty, rate, taxPercentage) => { @@ -2312,10 +2313,10 @@ const BSItemCard = (props) => { ((cartItem?.OfferModeType && cartItem?.OfferMode === 'B' ? true : cartItem?.OfferMode !== 'B') && - cartItem?.OfferMode !== 'P' && - cartItem?.OfferMode !== 'C' && - cartItem?.OfferMode !== 'O' && - cartItem?.OfferMode !== 'L' + cartItem?.OfferMode !== 'P' && + cartItem?.OfferMode !== 'C' && + cartItem?.OfferMode !== 'O' && + cartItem?.OfferMode !== 'L' ? true : cartItem?.Offer === 0) ); @@ -2326,10 +2327,10 @@ const BSItemCard = (props) => { ((cartItem?.OfferModeType && cartItem?.OfferMode === 'B' ? true : cartItem?.OfferMode !== 'B') && - cartItem?.OfferMode !== 'P' && - cartItem?.OfferMode !== 'C' && - cartItem?.OfferMode !== 'O' && - cartItem?.OfferMode !== 'L' + cartItem?.OfferMode !== 'P' && + cartItem?.OfferMode !== 'C' && + cartItem?.OfferMode !== 'O' && + cartItem?.OfferMode !== 'L' ? true : cartItem?.Offer === 0) ); @@ -2343,10 +2344,10 @@ const BSItemCard = (props) => { ((cartItem?.OfferModeType && cartItem?.OfferMode === 'B' ? true : cartItem?.OfferMode !== 'B') && - cartItem?.OfferMode !== 'P' && - cartItem?.OfferMode !== 'C' && - cartItem?.OfferMode !== 'O' && - cartItem?.OfferMode !== 'L' + cartItem?.OfferMode !== 'P' && + cartItem?.OfferMode !== 'C' && + cartItem?.OfferMode !== 'O' && + cartItem?.OfferMode !== 'L' ? true : cartItem?.Offer === 0) ) @@ -2359,10 +2360,10 @@ const BSItemCard = (props) => { ((cartItem?.OfferModeType && cartItem?.OfferMode === 'B' ? true : cartItem?.OfferMode !== 'B') && - cartItem?.OfferMode !== 'P' && - cartItem?.OfferMode !== 'C' && - cartItem?.OfferMode !== 'O' && - cartItem?.OfferMode !== 'L' + cartItem?.OfferMode !== 'P' && + cartItem?.OfferMode !== 'C' && + cartItem?.OfferMode !== 'O' && + cartItem?.OfferMode !== 'L' ? true : cartItem?.Offer === 0) ) @@ -2383,8 +2384,8 @@ const BSItemCard = (props) => { isItemInCart, item?.OtherProduct === 'Others' || item?.ScaleType === 'weight' ? ( - (item?.OrderQty || 0) + parseFloat(isItemInCart?.OrderQty) - )?.toFixed(3) + (item?.OrderQty || 0) + parseFloat(isItemInCart?.OrderQty) + )?.toFixed(3) : null ); const updatedData = addFirst @@ -2410,8 +2411,8 @@ const BSItemCard = (props) => { isItemInCartHold, item?.OtherProduct === 'Others' || item?.ScaleType === 'weight' ? ( - (item?.OrderQty || 0) + parseFloat(isItemInCartHold?.OrderQty) - )?.toFixed(3) + (item?.OrderQty || 0) + parseFloat(isItemInCartHold?.OrderQty) + )?.toFixed(3) : null ); const updatedData = addFirst @@ -2638,14 +2639,14 @@ const BSItemCard = (props) => { updatedCartData = cartData.map((item, idx) => idx === indexToCheck ? { - ...item, - Offer: null, - OfferMessage: undefined, - OfferMode: undefined, - OfferModeType: false, - OfferType: undefined, - OfferValue: null, - } + ...item, + Offer: null, + OfferMessage: undefined, + OfferMode: undefined, + OfferModeType: false, + OfferType: undefined, + OfferValue: null, + } : item ); } @@ -2699,8 +2700,8 @@ const BSItemCard = (props) => { ...item, Offer: sameProduct || - bestOffer?.OfferMode === 'I' || - bestOffer?.OfferMode === 'Q' + bestOffer?.OfferMode === 'I' || + bestOffer?.OfferMode === 'Q' ? bestOffer?.OfferAmount || item.Offer : item.Offer || bestOffer?.OfferAmount, OfferType: item?.OfferType || bestOffer?.OfferType, @@ -2717,10 +2718,10 @@ const BSItemCard = (props) => { ((c?.OfferModeType && c?.OfferMode === 'B' ? true : c?.OfferMode !== 'B') && - c?.OfferMode !== 'P' && - c?.OfferMode !== 'C' && - c?.OfferMode !== 'O' && - c?.OfferMode !== 'L' + c?.OfferMode !== 'P' && + c?.OfferMode !== 'C' && + c?.OfferMode !== 'O' && + c?.OfferMode !== 'L' ? true : c?.Offer === 0); @@ -3113,10 +3114,10 @@ const BSItemCard = (props) => { return FreeProdList.map((f, i) => i === index ? { - ...existing, - ...newFreeProd, - ProdVariantDetails: existing.ProdVariantDetails, - } + ...existing, + ...newFreeProd, + ProdVariantDetails: existing.ProdVariantDetails, + } : f ); } else { @@ -3771,7 +3772,7 @@ const BSItemCard = (props) => { parseInt(totalSelectedProductQty || 0) + parseInt(reorderComboConsumed || 0); } - } catch (_) { } + } catch (_) {} let getCurrentProdDtl = orderDetails?.filter( (a) => a?.ProdName === ProdName ); @@ -3972,7 +3973,7 @@ const BSItemCard = (props) => { parseInt(totalSelectedProductQty || 0) + parseInt(reorderComboConsumed || 0); } - } catch (_) { } + } catch (_) {} let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId); let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => { return ( @@ -4008,7 +4009,7 @@ const BSItemCard = (props) => { }, 0); totalOrderQty = parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0); - } catch (_) { } + } catch (_) {} let OverallProdQty = totalOrderQty - totalSelectedProductQty; if ( parseInt(ItemQuantity) > @@ -4094,7 +4095,7 @@ const BSItemCard = (props) => { parseInt(totalSelectedProductQty || 0) + parseInt(reorderComboConsumed || 0); } - } catch (_) { } + } catch (_) {} let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId); let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => { return ( @@ -4133,7 +4134,7 @@ const BSItemCard = (props) => { }, 0); totalOrderQty = parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0); - } catch (_) { } + } catch (_) {} let OverallProdQty = totalOrderQty - totalSelectedProductQty; if ( parseInt(ItemQuantity) > @@ -4225,7 +4226,7 @@ const BSItemCard = (props) => { parseInt(totalSelectedProductQty || 0) + parseInt(reorderComboConsumed || 0); } - } catch (_) { } + } catch (_) {} let getCurrentProdDtl = orderDetails?.filter( (a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId ); @@ -4268,7 +4269,7 @@ const BSItemCard = (props) => { }, 0); totalOrderQty = parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0); - } catch (_) { } + } catch (_) {} let OverallProdQty = totalOrderQty - totalSelectedProductQty; if ( @@ -4352,7 +4353,7 @@ const BSItemCard = (props) => { parseInt(totalSelectedProductQty || 0) + parseInt(reorderComboConsumed || 0); } - } catch (_) { } + } catch (_) {} let getCurrentProdDtl = orderDetails?.filter( (a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId ); @@ -4399,7 +4400,7 @@ const BSItemCard = (props) => { }, 0); totalOrderQty = parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0); - } catch (_) { } + } catch (_) {} let OverallProdQty = totalOrderQty - totalSelectedProductQty; if ( @@ -4577,7 +4578,7 @@ const BSItemCard = (props) => { 0 || - record.StockCount === 'Stock Not Maintained' + record.StockCount === 'Stock Not Maintained' ? { color: '#000', cursor: 'pointer' } : { color: '#f49898', cursor: 'not-allowed' } } @@ -4607,7 +4608,7 @@ const BSItemCard = (props) => { 0 || - record.StockCount === 'Stock Not Maintained' + record.StockCount === 'Stock Not Maintained' ? { color: '#000', cursor: 'pointer' } : { color: '#f49898', cursor: 'not-allowed' } } @@ -4637,7 +4638,7 @@ const BSItemCard = (props) => { 0 || - record.StockCount === 'Stock Not Maintained' + record.StockCount === 'Stock Not Maintained' ? { color: '#000', cursor: 'pointer' } : { color: '#f49898', cursor: 'not-allowed' } } @@ -4812,17 +4813,17 @@ const BSItemCard = (props) => { qtydata?.ProductDetail?.[QtyIndex]?.StockAvailable === 'Y' ? onePeiceFlow ? returnVariantStock( - qtydata?.ProductDetail?.[QtyIndex]?.ProdId, - item?.OverAllPcs, - CartOrderDetails, - item?.ProdVariantName - ) + qtydata?.ProductDetail?.[QtyIndex]?.ProdId, + item?.OverAllPcs, + CartOrderDetails, + item?.ProdVariantName + ) : returnVariantStock( - qtydata?.ProductDetail?.[QtyIndex]?.ProdId, - item?.OverAllQty, - CartOrderDetails, - item?.ProdVariantName - ) + qtydata?.ProductDetail?.[QtyIndex]?.ProdId, + item?.OverAllQty, + CartOrderDetails, + item?.ProdVariantName + ) : 'Stock Not Maintained', VariantAvailableFrom: item?.AvailableFrom, VariantAvailableTo: item?.AvailableTo, @@ -4844,20 +4845,20 @@ const BSItemCard = (props) => { 'Batch No': item?.BatchRef, StockCount: onePeiceFlow ? returnCountStock( - item?.ProdId, - item?.OverAllPcs, - CartOrderDetails, - item?.InwardDtlId, - 'Y' - ) + item?.ProdId, + item?.OverAllPcs, + CartOrderDetails, + item?.InwardDtlId, + 'Y' + ) : returnCountStock( - item?.ProdId, - item?.BalanceQty, - CartOrderDetails, - item?.InwardDtlId, - 'N', - item?.OverAllPcs - ), + item?.ProdId, + item?.BalanceQty, + CartOrderDetails, + item?.InwardDtlId, + 'N', + item?.OverAllPcs + ), 'Stock Date': ExtractDateFormate(item?.InwardDate), Price: onePeiceFlow ? item?.OnePcsPrice : item?.SellPrice, ExpDate: @@ -6034,9 +6035,9 @@ const BSItemCard = (props) => { allProducts.forEach((product) => { const brandName = product.BrandName && - product.BrandName !== 'null' && - product.BrandName !== 'undefined' && - product.BrandName.trim() !== '' + product.BrandName !== 'null' && + product.BrandName !== 'undefined' && + product.BrandName.trim() !== '' ? product.BrandName : 'Others'; @@ -6070,13 +6071,13 @@ const BSItemCard = (props) => { const result = prodname ? (cardData || [])?.filter( - (item) => - normalize(item.ProdName).includes(normalize(prodname)) || - normalize(item.ProdCatName).includes(normalize(prodname)) || - item.ProductDetail?.some((detail) => - normalize(detail.ProdName).includes(normalize(prodname)) - ) - ) + (item) => + normalize(item.ProdName).includes(normalize(prodname)) || + normalize(item.ProdCatName).includes(normalize(prodname)) || + item.ProductDetail?.some((detail) => + normalize(detail.ProdName).includes(normalize(prodname)) + ) + ) : cardData; console.log(prodQty, 'cardDatacardData', result, prodname); @@ -6096,8 +6097,8 @@ const BSItemCard = (props) => { CardOnclick( result?.[0], result?.[0]?.OnePcsAvailable === 'Y' && - preferenceSingleSales && - 'OnePeiceProduct' + preferenceSingleSales && + 'OnePeiceProduct' ); // AddOrderDetails2(result?.[0]) } else if (item?.OverAllQty < prodQty) { @@ -6157,21 +6158,21 @@ const BSItemCard = (props) => { zIndex: connectingState?.positionChange ? '0' : '20', top: templateData?.BookingNavbar?.[0] === 'Navbar3' && - templateData?.BookingLayout?.[0] === 'Layout3' + templateData?.BookingLayout?.[0] === 'Layout3' ? '5px' : templateData?.BookingNavbar?.[0] === 'Navbar3' && - ['Layout1', 'Layout2'].includes( - templateData?.BookingLayout?.[0] - ) + ['Layout1', 'Layout2'].includes( + templateData?.BookingLayout?.[0] + ) ? '3px' : templateData?.BookingNavbar?.[0] === 'Navbar3' && - ['Layout4', 'Layout5', 'Layout6'].includes( - templateData?.BookingLayout?.[0] - ) + ['Layout4', 'Layout5', 'Layout6'].includes( + templateData?.BookingLayout?.[0] + ) ? '3rem' : ['Layout4', 'Layout5', 'Layout6'].includes( - templateData?.BookingLayout?.[0] - ) + templateData?.BookingLayout?.[0] + ) ? '3.1rem' : templateData?.BookingNavbar?.[0] === 'Navbar3' ? '3rem' @@ -6253,21 +6254,21 @@ const BSItemCard = (props) => { }} className={ (item?.OverAllQty !== undefined && - !preferenceSingleSales + !preferenceSingleSales ? returnCount( - item?.ProductDetail?.[0]?.ProdName, - item?.OverAllQty, - CartOrderDetails, - item?.OverAllPcs - ) + item?.ProductDetail?.[0]?.ProdName, + item?.OverAllQty, + CartOrderDetails, + item?.OverAllPcs + ) : returnOnepcCount( - item?.ProductDetail?.[0]?.ProdName, - item?.OverAllPcs, - CartOrderDetails - ) > 0) || - item?.ProductDetail?.some( - (item) => item?.StockAvailable !== 'Y' - ) + item?.ProductDetail?.[0]?.ProdName, + item?.OverAllPcs, + CartOrderDetails + ) > 0) || + item?.ProductDetail?.some( + (item) => item?.StockAvailable !== 'Y' + ) ? 'BkPrdCardActive' : 'BkPrdCardDeActive' } @@ -6305,39 +6306,39 @@ const BSItemCard = (props) => { cardFunction?.Background && (SelectedCardColor ? SelectedCardColor?.[ - 'BackgroundColor' - ] + 'BackgroundColor' + ] : ''), padding: !cardFunction?.ImageUp && - !cardFunction?.ImageDown + !cardFunction?.ImageDown ? cardFunction?.SmallImage && - '5px 9px' + '5px 9px' : '8px 2px', flexDirection: cardFunction?.ImageRight && - 'row-reverse' + 'row-reverse' ? cardFunction?.ImageRight && - 'row-reverse' + 'row-reverse' : cardFunction?.ImageUp && 'column' ? cardFunction?.ImageUp && - 'column' + 'column' : cardFunction?.ImageDown && - 'column-reverse' + 'column-reverse' ? cardFunction?.ImageDown && - 'column-reverse' + 'column-reverse' : cardFunction?.ImageLeft && - 'row', + 'row', borderRadius: cardFunction?.EdgeCurve && '6px', width: !cardFunction?.ImageUp && - !cardFunction?.ImageDown && - !cardFunction?.BigImage && - !cardFunction?.ImageRight && - cardFunction?.SmallImage && - (cardFunction?.ImageUp || - cardFunction?.ImageDown) + !cardFunction?.ImageDown && + !cardFunction?.BigImage && + !cardFunction?.ImageRight && + cardFunction?.SmallImage && + (cardFunction?.ImageUp || + cardFunction?.ImageDown) ? '6rem' : cardFunction?.BigImage && '9rem', height: @@ -6370,19 +6371,19 @@ const BSItemCard = (props) => { if ( !( (item?.OverAllQty !== undefined && - !preferenceSingleSales + !preferenceSingleSales ? returnCount( - item?.ProductDetail?.[0] - ?.ProdName, - item?.OverAllQty, - CartOrderDetails - ) + item?.ProductDetail?.[0] + ?.ProdName, + item?.OverAllQty, + CartOrderDetails + ) : returnOnepcCount( - item?.ProductDetail?.[0] - ?.ProdName, - item?.OverAllPcs, - CartOrderDetails - ) > 0) || + item?.ProductDetail?.[0] + ?.ProdName, + item?.OverAllPcs, + CartOrderDetails + ) > 0) || item?.ProductDetail?.some( (item) => item?.StockAvailable !== 'Y' @@ -6394,8 +6395,8 @@ const BSItemCard = (props) => { CardOnclick( item, item?.OnePcsAvailable === 'Y' && - preferenceSingleSales && - 'OnePeiceProduct' + preferenceSingleSales && + 'OnePeiceProduct' ); } }} @@ -6404,39 +6405,39 @@ const BSItemCard = (props) => { > {(cardFunction?.BigImage || cardFunction?.SmallImage) && ( - - )} + ? item?.ProductDetail?.[0] + ?.ProdLogo + : defaultimage + } + alt="" + /> + )}
{ cardFunction?.Background && (SelectedCardColor ? SelectedCardColor?.[ - 'BackgroundColor' - ] + 'BackgroundColor' + ] : ''), position: !cardFunction?.BigImage @@ -6470,7 +6471,7 @@ const BSItemCard = (props) => { height: cardFunction?.SmallImage ? '5.5rem' : !cardFunction?.BigImage && - '5.5rem', + '5.5rem', alignItems: !cardFunction?.BigImage && !cardFunction?.SmallImage && @@ -6493,11 +6494,11 @@ const BSItemCard = (props) => { 'uppercase', width: !cardFunction?.SmallImage ? cardFunction?.BigImage && - '120px' + '120px' : cardFunction?.SmallImage && - !cardFunction?.ImageUp && - !cardFunction?.ImageDown && - '85px', + !cardFunction?.ImageUp && + !cardFunction?.ImageDown && + '85px', // Width: cardFunction?.BigImage && "70px", fontSize: !cardFunction?.BigImage && @@ -6519,24 +6520,24 @@ const BSItemCard = (props) => { > {item?.ProdName}{' '} {(item?.OverAllQty !== undefined && - !preferenceSingleSales + !preferenceSingleSales ? returnCount( - item?.ProductDetail?.[0] - ?.ProdName, - item?.OverAllQty, - CartOrderDetails, - item - ) + item?.ProductDetail?.[0] + ?.ProdName, + item?.OverAllQty, + CartOrderDetails, + item + ) : returnOnepcCount( - item?.ProductDetail?.[0] - ?.ProdName, - item?.OverAllPcs, - CartOrderDetails - ) > 0) || - item?.ProductDetail?.some( - (item) => - item?.StockAvailable !== 'Y' - ) ? ( + item?.ProductDetail?.[0] + ?.ProdName, + item?.OverAllPcs, + CartOrderDetails + ) > 0) || + item?.ProductDetail?.some( + (item) => + item?.StockAvailable !== 'Y' + ) ? ( '' ) : (

{ fontSize: !cardFunction?.SmallImage ? cardFunction?.BigImage && - '12px' + '12px' : '12px', textAlign: 'center', - lineHeight: '2', fontFamily: SelectedCardFont ? SelectedCardFont : '', color: SelectedCardColor ? SelectedCardColor?.[ - 'FontColor' - ] + 'FontColor' + ] : '', }} > @@ -6601,17 +6601,16 @@ const BSItemCard = (props) => { fontSize: !cardFunction?.SmallImage ? cardFunction?.BigImage && - '12px' + '12px' : '12px', textAlign: 'center', - lineHeight: '2', fontFamily: SelectedCardFont ? SelectedCardFont : '', color: SelectedCardColor ? SelectedCardColor?.[ - 'FontColor' - ] + 'FontColor' + ] : '', }} > @@ -6659,19 +6658,19 @@ const BSItemCard = (props) => { count={ !preferenceSingleSales ? returnCount( - item - ?.ProductDetail?.[0] - ?.ProdName, - item?.OverAllQty, - CartOrderDetails - ) + item + ?.ProductDetail?.[0] + ?.ProdName, + item?.OverAllQty, + CartOrderDetails + ) : returnOnepcCount( - item - ?.ProductDetail?.[0] - ?.ProdName, - item?.OverAllPcs, - CartOrderDetails - ) + item + ?.ProductDetail?.[0] + ?.ProdName, + item?.OverAllPcs, + CartOrderDetails + ) } overflowCount={10000} > @@ -6723,14 +6722,14 @@ const BSItemCard = (props) => { item?.OverAllPcs, CartOrderDetails ) > 0 || - item?.ProductDetail?.some( - (product) => - product?.StockAvailable !== - 'Y' - ) + item?.ProductDetail?.some( + (product) => + product?.StockAvailable !== + 'Y' + ) ? cardFunction?.Background ? SelectedCardColor?.BackgroundColor || - '#000000' + '#000000' : '#fff' : '#ff4d4f', }} @@ -6772,39 +6771,39 @@ const BSItemCard = (props) => { cardFunction?.Background && (SelectedCardColor ? SelectedCardColor?.[ - 'BackgroundColor' - ] + 'BackgroundColor' + ] : ''), padding: !cardFunction?.ImageUp && - !cardFunction?.ImageDown + !cardFunction?.ImageDown ? cardFunction?.SmallImage && - '5px 9px' + '5px 9px' : '8px 2px', flexDirection: cardFunction?.ImageRight && - 'row-reverse' + 'row-reverse' ? cardFunction?.ImageRight && - 'row-reverse' + 'row-reverse' : cardFunction?.ImageUp && 'column' ? cardFunction?.ImageUp && - 'column' + 'column' : cardFunction?.ImageDown && - 'column-reverse' + 'column-reverse' ? cardFunction?.ImageDown && - 'column-reverse' + 'column-reverse' : cardFunction?.ImageLeft && - 'row', + 'row', borderRadius: cardFunction?.EdgeCurve && '6px', width: !cardFunction?.ImageUp && - !cardFunction?.ImageDown && - !cardFunction?.BigImage && - !cardFunction?.ImageRight && - cardFunction?.SmallImage && - (cardFunction?.ImageUp || - cardFunction?.ImageDown) + !cardFunction?.ImageDown && + !cardFunction?.BigImage && + !cardFunction?.ImageRight && + cardFunction?.SmallImage && + (cardFunction?.ImageUp || + cardFunction?.ImageDown) ? '6rem' : cardFunction?.BigImage && '9rem', height: @@ -6822,19 +6821,19 @@ const BSItemCard = (props) => { if ( !( (item?.OverAllQty !== undefined && - !preferenceSingleSales + !preferenceSingleSales ? returnCount( - item?.ProductDetail?.[0] - ?.ProdName, - item?.OverAllQty, - CartOrderDetails - ) + item?.ProductDetail?.[0] + ?.ProdName, + item?.OverAllQty, + CartOrderDetails + ) : returnOnepcCount( - item?.ProductDetail?.[0] - ?.ProdName, - item?.OverAllPcs, - CartOrderDetails - ) > 0) || + item?.ProductDetail?.[0] + ?.ProdName, + item?.OverAllPcs, + CartOrderDetails + ) > 0) || item?.ProductDetail?.some( (item) => item?.StockAvailable !== 'Y' @@ -6846,48 +6845,48 @@ const BSItemCard = (props) => { CardOnclick( item, item?.OnePcsAvailable === 'Y' && - preferenceSingleSales && - 'OnePeiceProduct' + preferenceSingleSales && + 'OnePeiceProduct' ); } }} - // data-aos="zoom-in" data-aos-duration="600" + // data-aos="zoom-in" data-aos-duration="600" > {(cardFunction?.BigImage || cardFunction?.SmallImage) && ( - - )} + ? item?.ProductDetail?.[0] + ?.ProdLogo + : defaultimage + } + alt="" + /> + )}

{ cardFunction?.Background && (SelectedCardColor ? SelectedCardColor?.[ - 'BackgroundColor' - ] + 'BackgroundColor' + ] : ''), position: !cardFunction?.BigImage @@ -6921,7 +6920,7 @@ const BSItemCard = (props) => { height: cardFunction?.SmallImage ? '5.5rem' : !cardFunction?.BigImage && - '4.5rem', + '4.5rem', alignItems: !cardFunction?.BigImage && !cardFunction?.SmallImage && @@ -6941,11 +6940,11 @@ const BSItemCard = (props) => { 'uppercase', width: !cardFunction?.SmallImage ? cardFunction?.BigImage && - '120px' + '120px' : cardFunction?.SmallImage && - !cardFunction?.ImageUp && - !cardFunction?.ImageDown && - '85px', + !cardFunction?.ImageUp && + !cardFunction?.ImageDown && + '85px', // Width: cardFunction?.BigImage && "70px", fontSize: !cardFunction?.BigImage && @@ -6967,24 +6966,24 @@ const BSItemCard = (props) => { > {item?.ProdName}{' '} {(item?.OverAllQty !== undefined && - !preferenceSingleSales + !preferenceSingleSales ? returnCount( - item?.ProductDetail?.[0] - ?.ProdName, - item?.OverAllQty, - CartOrderDetails, - item - ) + item?.ProductDetail?.[0] + ?.ProdName, + item?.OverAllQty, + CartOrderDetails, + item + ) : returnOnepcCount( - item?.ProductDetail?.[0] - ?.ProdName, - item?.OverAllPcs, - CartOrderDetails - ) > 0) || - item?.ProductDetail?.some( - (item) => - item?.StockAvailable !== 'Y' - ) ? ( + item?.ProductDetail?.[0] + ?.ProdName, + item?.OverAllPcs, + CartOrderDetails + ) > 0) || + item?.ProductDetail?.some( + (item) => + item?.StockAvailable !== 'Y' + ) ? ( '' ) : (

{ fontSize: !cardFunction?.SmallImage ? cardFunction?.BigImage && - '12px' + '12px' : '12px', textAlign: 'center', - lineHeight: '2', fontFamily: SelectedCardFont ? SelectedCardFont : '', color: SelectedCardColor ? SelectedCardColor?.[ - 'FontColor' - ] + 'FontColor' + ] : '', }} > @@ -7049,17 +7047,16 @@ const BSItemCard = (props) => { fontSize: !cardFunction?.SmallImage ? cardFunction?.BigImage && - '12px' + '12px' : '12px', textAlign: 'center', - lineHeight: '2', fontFamily: SelectedCardFont ? SelectedCardFont : '', color: SelectedCardColor ? SelectedCardColor?.[ - 'FontColor' - ] + 'FontColor' + ] : '', }} > @@ -7104,19 +7101,19 @@ const BSItemCard = (props) => { count={ !preferenceSingleSales ? returnCount( - item - ?.ProductDetail?.[0] - ?.ProdName, - item?.OverAllQty, - CartOrderDetails - ) + item + ?.ProductDetail?.[0] + ?.ProdName, + item?.OverAllQty, + CartOrderDetails + ) : returnOnepcCount( - item - ?.ProductDetail?.[0] - ?.ProdName, - item?.OverAllPcs, - CartOrderDetails - ) + item + ?.ProductDetail?.[0] + ?.ProdName, + item?.OverAllPcs, + CartOrderDetails + ) } overflowCount={10000} > @@ -7167,14 +7164,14 @@ const BSItemCard = (props) => { item?.OverAllPcs, CartOrderDetails ) > 0 || - item?.ProductDetail?.some( - (product) => - product?.StockAvailable !== - 'Y' - ) + item?.ProductDetail?.some( + (product) => + product?.StockAvailable !== + 'Y' + ) ? cardFunction?.Background ? SelectedCardColor?.BackgroundColor || - '#000000' + '#000000' : '#fff' : '#ff4d4f', }} @@ -7189,21 +7186,21 @@ const BSItemCard = (props) => {

0) || - item?.ProductDetail?.some( - (item) => item?.StockAvailable !== 'Y' - ) + item?.ProductDetail?.[0]?.ProdName, + item?.OverAllPcs, + CartOrderDetails + ) > 0) || + item?.ProductDetail?.some( + (item) => item?.StockAvailable !== 'Y' + ) ? 'card4Main card4Main-active' : 'card4Main card4Main-deactive' } @@ -7226,17 +7223,17 @@ const BSItemCard = (props) => { if ( !( (item?.OverAllQty !== undefined && - !preferenceSingleSales + !preferenceSingleSales ? returnCount( - item?.ProductDetail?.[0]?.ProdName, - item?.OverAllQty, - CartOrderDetails - ) + item?.ProductDetail?.[0]?.ProdName, + item?.OverAllQty, + CartOrderDetails + ) : returnOnepcCount( - item?.ProductDetail?.[0]?.ProdName, - item?.OverAllPcs, - CartOrderDetails - ) > 0) || + item?.ProductDetail?.[0]?.ProdName, + item?.OverAllPcs, + CartOrderDetails + ) > 0) || item?.ProductDetail?.some( (item) => item?.StockAvailable !== 'Y' ) @@ -7251,8 +7248,8 @@ const BSItemCard = (props) => { CardOnclick( item, item?.OnePcsAvailable === 'Y' && - preferenceSingleSales && - 'OnePeiceProduct' + preferenceSingleSales && + 'OnePeiceProduct' ); // This will trigger if you're clicking outside the "One Piece" button } @@ -7294,7 +7291,7 @@ const BSItemCard = (props) => { height={60} src={ item?.ProductDetail?.[0]?.ProdLogo === - '' + '' ? defaultimage : item?.ProductDetail?.[0]?.ProdLogo ? item?.ProductDetail?.[0]?.ProdLogo @@ -7309,21 +7306,21 @@ const BSItemCard = (props) => {
{item?.ProdName} {(item?.OverAllQty !== undefined && - !preferenceSingleSales + !preferenceSingleSales ? returnCount( - item?.ProductDetail?.[0]?.ProdName, - item?.OverAllQty, - CartOrderDetails, - item - ) + item?.ProductDetail?.[0]?.ProdName, + item?.OverAllQty, + CartOrderDetails, + item + ) : returnOnepcCount( - item?.ProductDetail?.[0]?.ProdName, - item?.OverAllPcs, - CartOrderDetails - ) > 0) || - item?.ProductDetail?.some( - (item) => item?.StockAvailable !== 'Y' - ) ? ( + item?.ProductDetail?.[0]?.ProdName, + item?.OverAllPcs, + CartOrderDetails + ) > 0) || + item?.ProductDetail?.some( + (item) => item?.StockAvailable !== 'Y' + ) ? ( '' ) : (

{

{cardFunction?.MRP && ((item?.OverAllQty !== undefined && - !preferenceSingleSales + !preferenceSingleSales ? returnCount( - item?.ProductDetail?.[0]?.ProdName, - item?.OverAllQty, - CartOrderDetails, - item - ) + item?.ProductDetail?.[0]?.ProdName, + item?.OverAllQty, + CartOrderDetails, + item + ) : returnOnepcCount( - item?.ProductDetail?.[0]?.ProdName, - item?.OverAllPcs, - CartOrderDetails - ) > 0) || + item?.ProductDetail?.[0]?.ProdName, + item?.OverAllPcs, + CartOrderDetails + ) > 0) || item?.ProductDetail?.some( (item) => item?.StockAvailable !== 'Y' )) && ( @@ -7363,33 +7360,33 @@ const BSItemCard = (props) => {
)} {((item?.OverAllQty !== undefined && - !preferenceSingleSales + !preferenceSingleSales ? returnCount( - item?.ProductDetail?.[0]?.ProdName, - item?.OverAllQty, - CartOrderDetails, - item - ) + item?.ProductDetail?.[0]?.ProdName, + item?.OverAllQty, + CartOrderDetails, + item + ) : returnOnepcCount( - item?.ProductDetail?.[0]?.ProdName, - item?.OverAllPcs, - CartOrderDetails - ) > 0) || + item?.ProductDetail?.[0]?.ProdName, + item?.OverAllPcs, + CartOrderDetails + ) > 0) || item?.ProductDetail?.some( (item) => item?.StockAvailable !== 'Y' )) && ( -
-
- ₹ {ItemSellingPrice(item)} -
- -
- <> - ({ItemSize(item)} {ItemUomName(item)}) - -
+
+
+ ₹ {ItemSellingPrice(item)}
- )} + +
+ <> + ({ItemSize(item)} {ItemUomName(item)}) + +
+
+ )}
{/* Stock Count Badge */} @@ -7414,17 +7411,17 @@ const BSItemCard = (props) => { count={ !preferenceSingleSales ? returnCount( - item?.ProductDetail?.[0] - ?.ProdName, - item?.OverAllQty, - CartOrderDetails - ) + item?.ProductDetail?.[0] + ?.ProdName, + item?.OverAllQty, + CartOrderDetails + ) : returnOnepcCount( - item?.ProductDetail?.[0] - ?.ProdName, - item?.OverAllPcs, - CartOrderDetails - ) + item?.ProductDetail?.[0] + ?.ProdName, + item?.OverAllPcs, + CartOrderDetails + ) } overflowCount={10000} > @@ -7473,13 +7470,13 @@ const BSItemCard = (props) => { item?.OverAllPcs, CartOrderDetails ) > 0 || - item?.ProductDetail?.some( - (product) => - product?.StockAvailable !== 'Y' - ) + item?.ProductDetail?.some( + (product) => + product?.StockAvailable !== 'Y' + ) ? cardFunction?.Background ? SelectedCardColor?.BackgroundColor || - '#000000' + '#000000' : '#fff' : '#ff4d4f', }} @@ -7861,16 +7858,16 @@ const BSItemCard = (props) => { ]?.ProdVariantName?.toLowerCase()?.includes( 'variant' ) && ( - - ( - { - qtydata?.ProductDetail?.[QtyIndex] - ?.ProdVariantDetails?.[VarientIndex] - ?.ProdVariantName - } - ){' '} - - )} + + ( + { + qtydata?.ProductDetail?.[QtyIndex] + ?.ProdVariantDetails?.[VarientIndex] + ?.ProdVariantName + } + ){' '} + + )}

diff --git a/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx b/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx index 5749d4f..74de142 100644 --- a/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx +++ b/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx @@ -95,6 +95,7 @@ import { Radio } from 'antd'; import ReprintPDFDataShare from './ReprintPDFDataShare.jsx'; import { ImShare } from 'react-icons/im'; import EmailModel from '../../UtillComponents/EmailModel.jsx'; +import dayjs from "dayjs"; const RetailApiurl = import.meta.env.ENV_API_URL; @@ -1439,6 +1440,9 @@ function BSReprint({ setOpenModel = () => { } }) { const typeChange = (e) => { setType(e.target.value); }; + const disabledDate = (current) => { + return current && current > dayjs().endOf("day"); + }; return ( <> @@ -1492,8 +1496,9 @@ function BSReprint({ setOpenModel = () => { } }) {
diff --git a/src/Pages/BookingScreen/Components/UtillComponents/SalesDetailsNetAmountModal.jsx b/src/Pages/BookingScreen/Components/UtillComponents/SalesDetailsNetAmountModal.jsx index 5f98235..44b02da 100644 --- a/src/Pages/BookingScreen/Components/UtillComponents/SalesDetailsNetAmountModal.jsx +++ b/src/Pages/BookingScreen/Components/UtillComponents/SalesDetailsNetAmountModal.jsx @@ -187,7 +187,8 @@ const SalesDetailsModal = ({ isModalOpen = false, const SalesNetAmountModal = ({ isNetAmtModalOpen = false, setIsNetAmtModalOpen = () => { }, - orderDetails = [] + orderDetails = [], + RefundAmt }) => { return ( Business UPI + + Refund Amt + {item.BusinessUpiAmount} + + {RefundAmt} + - {total} + {total-RefundAmt} ); diff --git a/src/Pages/BookingScreen/Template/BSLayout4/BSLayout4.jsx b/src/Pages/BookingScreen/Template/BSLayout4/BSLayout4.jsx index f43e5fc..2cb1cb5 100644 --- a/src/Pages/BookingScreen/Template/BSLayout4/BSLayout4.jsx +++ b/src/Pages/BookingScreen/Template/BSLayout4/BSLayout4.jsx @@ -5,22 +5,20 @@ import { Tooltip, Badge, Popconfirm } from 'antd'; import { isMobile } from 'react-device-detect'; import BookingCloseIcon from '../../Components/UtillComponents/BookingCloseIcon.jsx'; const BSNavbar1 = lazy(() => import('../../Components/BSNavbar/BSNavbar1')); - const CategoryHorizontal = lazy( +const CategoryHorizontal = lazy( () => import('../../Components/BSCategories/BSCategoryHorizontal') ); const BSItemCard = lazy( () => import('../../Components/BSItemCards/BSItemCard') ); - + const BSBillingTable2 = lazy( () => import('../../Components/BSBillingTables/BSBillingTable2/BSBillingTable2') ); -const BSBillingTable3 = lazy( - () => - import('../../Components/BSBillingTables/BSBillingTable3/BSBillingTable3overall') -); - + +import BSBillingTable3 from '../../Components/BSBillingTables/BSBillingTable3/BSBillingTable3overall'; + import { dynamicComponentProps } from '../DynamicComponentProps.js'; import { getTemplateData, @@ -95,16 +93,10 @@ const BSOtherServicesVerticalcat = lazy( () => import('../../Components/BSCategories/BSOtherServicesVerticalcat.jsx') ); - const SalesCountForStandard = lazy( () => import('../SalesCountForStandard.jsx') ); -const StandardTable = lazy( - () => - import('../../Components/BSBillingTables/StandardTable/StandardTable.jsx') -); - const ComboSalesBillTable = lazy( () => import('../../Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx') diff --git a/src/Pages/BookingScreen/Template/SalesCountComponent.jsx b/src/Pages/BookingScreen/Template/SalesCountComponent.jsx index 94dd5c9..48984a6 100644 --- a/src/Pages/BookingScreen/Template/SalesCountComponent.jsx +++ b/src/Pages/BookingScreen/Template/SalesCountComponent.jsx @@ -65,7 +65,8 @@ const SalesCountComponent = React.memo( // Destructure to simplify access to required values console.log( BookingNavbar, - 'BookingNavbarBookingNavbar' + 'BookingNavbarBookingNavbar', + GlobalsalesDetailData ); const { @@ -81,6 +82,7 @@ const SalesCountComponent = React.memo( SelfTakeAwayAmount, SelfDineInAmount, PreOrderAmount, + RefundAmt } = GlobalsalesDetailData.length > 0 ? GlobalsalesDetailData[0] : {}; const dispatch = useDispatch(); @@ -91,7 +93,7 @@ const SalesCountComponent = React.memo( const templateData = useSelector(getTemplateData); const preferencedata = useSelector(PreferenceData); - console.log(preferencedata, 'preferencedatasalescount'); + console.log(dailySalesData, 'preferencedatasalescount'); const bookingTypePreference = appPreferences?.find( (preference) => preference?.PreferredCatName === 'Booking Type' )?.PreferenceCatDetails; @@ -686,6 +688,7 @@ const SalesCountComponent = React.memo( isNetAmtModalOpen={isNetAmtModalOpen} setIsNetAmtModalOpen={setIsNetAmtModalOpen} orderDetails={orderDetails} + RefundAmt={RefundAmt} /> {TableData?.length > 0 && AutoReceiveStock && ( diff --git a/src/Pages/CustomerMaster/CustMasterList.jsx b/src/Pages/CustomerMaster/CustMasterList.jsx index cade722..b11113f 100644 --- a/src/Pages/CustomerMaster/CustMasterList.jsx +++ b/src/Pages/CustomerMaster/CustMasterList.jsx @@ -25,8 +25,7 @@ import { Messages } from '../../Components/Notifications/Messages'; import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx'; import { useAuth } from '../../AuthContext.jsx'; import { getPreferenceData } from '../../Features/BookingScreen/BookingData/BookingData.js'; - -const subDirectory = import.meta.env.BASE_URL; +const subDirectory = import.meta.env.ENV_BASE_URL; const items = [ { @@ -71,7 +70,6 @@ const CustomerMaster = () => { const [addnewAccess, setaddnewAccess] = useState(true); const [allowDecimal, setAllowDecimal] = useState(false); - async function fetchData() { if (location?.state?.Notiffy) { setMessageType(location?.state?.Notiffy.messageType); @@ -155,13 +153,22 @@ const CustomerMaster = () => { } }; const getPreference = async () => { - const data = { AppId: AppId, CompId: CompId, BranchId: BranchId, UserId: UserId }; - const { data: res } = await dispatch(getPreferenceData(data)).unwrap() - const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y'); + const data = { + AppId: AppId, + CompId: CompId, + BranchId: BranchId, + UserId: UserId, + }; + const { data: res } = await dispatch(getPreferenceData(data)).unwrap(); + const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find( + (setting) => + setting?.SettingIdName?.toLowerCase() === 'decimal' && + setting?.SettingValue === 'Y' + ); if (decimalSetting) { - setAllowDecimal(true) + setAllowDecimal(true); } - } + }; //Delete const statusFormatter = async (row) => { @@ -251,7 +258,8 @@ const CustomerMaster = () => { width: '100px', render: (text, row) => ( - {(row?.CustName ? (row?.CustName + ' ') : '') + (row?.CustShortName || "") || row?.CustMobile} + {(row?.CustName ? row?.CustName + ' ' : '') + + (row?.CustShortName || '') || row?.CustMobile} ), filteredValue: [searchedText], @@ -260,8 +268,12 @@ const CustomerMaster = () => { String(record.CustShortName) ?.toLowerCase() ?.includes(value?.toLowerCase()) || - String(record.CustName)?.toLowerCase()?.includes(value?.toLowerCase()) || - String(record.CustMobile)?.toLowerCase()?.includes(value?.toLowerCase()) + String(record.CustName) + ?.toLowerCase() + ?.includes(value?.toLowerCase()) || + String(record.CustMobile) + ?.toLowerCase() + ?.includes(value?.toLowerCase()) ); }, sorter: (a, b) => a?.CustName?.length - b?.CustName?.length, diff --git a/src/Pages/EmpMaster/EmpMasterForm.jsx b/src/Pages/EmpMaster/EmpMasterForm.jsx index 7005c09..05ffc5a 100644 --- a/src/Pages/EmpMaster/EmpMasterForm.jsx +++ b/src/Pages/EmpMaster/EmpMasterForm.jsx @@ -55,7 +55,7 @@ const EmployeeForm = ({ formType }) => { const [brId, setBrId] = useState(getSession('BranchId')); const [AppId, setAppId] = useState(getSession('AppId')); const [AdminUserId, setAdminUserId] = useState(getSession('UserId')); - const [ImageUrl, setImageUrl] = useState(null); + const [ProfileImageUrl, setProfileImageUrl] = useState(null); const [EmpTypeDropDownData, setEmpTypeDropDownData] = useState([]); const [seletedEmpTypeDrop, setseletedEmpTypeDrop] = useState(null); const [EmpDesgDropDownData, setEmpDesgDropDownData] = useState([]); @@ -132,8 +132,8 @@ const EmployeeForm = ({ formType }) => { postData['EmpDOJ'] = moment(SelectedDate).format('YYYY-MM-DD'); postData['BranchId'] = brId; postData['MobileAppAccess'] = SelectedMobApp ? SelectedMobApp : 'N'; - postData['EmpPhotoLink'] = ImageUrl - ? ImageUrl + postData['EmpPhotoLink'] = ProfileImageUrl + ? ProfileImageUrl : 'https://api.pozo.app/pozo-common-image-api/upload?fileId=655c9e25fe20def9916edf1f.png'; // postData["Description"]=form?.getFieldValue("coachQualifications"), // postData["Certification"]=form?.getFieldValue("coachQualifications"), @@ -143,8 +143,8 @@ const EmployeeForm = ({ formType }) => { // "Experience": form?.getFieldValue("coachExperience"), postData['ImageDetails'] = (imageUrls || []) - .filter((item) => item && (item.image || item.name)) - .map((item, index) => ({ + ?.filter((item) => item && (item.image || item.name)) + ?.map((item, index) => ({ ImageUrl: item.image || '', ImageType: item.name || '', // ImageType: "Coach", @@ -202,9 +202,17 @@ const EmployeeForm = ({ formType }) => { setseletedEmpDeptDrop(editstate?.EmpDept); setseletedShiftDrop(editstate?.EmpShiftId); setSelectedDate(editstate?.EmpDOJ); - setImageUrl(editstate?.EmpPhotoLink); + setProfileImageUrl(editstate?.EmpPhotoLink); setSelectedLatitude(editstate?.Latitude); setSelectedLongitude(editstate?.Longitude); + if (editstate?.ImageDetails?.length > 0) { + setImageUrls( + editstate.ImageDetails.map((img) => ({ + image: img.ImageUrl || '', + name: img.ImageType || '', + })) + ); + } formRef.current?.setFieldsValue({ EmpDOJ: moment(editstate?.EmpDOJ), }); @@ -245,8 +253,6 @@ const EmployeeForm = ({ formType }) => { }; return copy; }); - - setImageUrl(url); }; const updateImageName = (name, index = 0) => { @@ -672,7 +678,7 @@ const EmployeeForm = ({ formType }) => { // seletedEmpTypeDrop const updateImageUrl = (url) => { - setImageUrl(url); + setProfileImageUrl(url); }; const selectValue = async (e) => { @@ -1242,7 +1248,7 @@ const EmployeeForm = ({ formType }) => { formType === 'edit' ? editstate?.EmpPhotoLink : formRef.current?.getFieldsValue() - ?.UserImage || ImageUrl; + ?.UserImage || ProfileImageUrl; // Always return a string return typeof link === 'string' ? link : ''; })()} @@ -1624,11 +1630,10 @@ const EmployeeForm = ({ formType }) => { } /> -
- {Array.from({ - length: Math.max(1, imageUrls.length), - }).map((_, idx) => ( + {Array?.from({ + length: Math.max(1, (imageUrls ?? []).length), + })?.map((_, idx) => (
{ const actionContainerRef = useRef(null); @@ -20,7 +22,11 @@ const InitialPage1 = (props) => { const getKioskCompLogodata = useSelector(getKioskCompLogo); const getKioskBackgroundimgdata = useSelector(getKioskBackgroundimg); const SalesType = useSelector(globalSalesType); - console.log(getKioskCompLogodata, 'getKioskCompLogodata'); + const preferences = useSelector(PreferenceData); + const appPreferences = useSelector(ApplicationPreferences); + const bookingTypePref = appPreferences?.find(pref => pref?.PreferredCatName?.toLowerCase() === 'booking type'); + const dineInPreference = preferences?.[0]?.SettingDtlDetails?.find((item) => (item.SettingIdName)?.toLowerCase() === 'dinein')?.SettingValue === 'Y'; + const dineInAppPreference = bookingTypePref?.PreferenceCatDetails?.find((item) => item.PreferredSubCatName?.toLowerCase() === 'dine in')?.PreferredStatus === 'Y'; const FlowChange = async (event, eventName) => { await dispatch(changeKioskPageName(event)); await dispatch(changeBookingType(eventName)); @@ -96,7 +102,7 @@ const InitialPage1 = (props) => {

- {(SalesType === 'D' || SalesType === 'B') && ( + {((SalesType === 'D' || SalesType === 'B') && dineInPreference && dineInAppPreference) && (
{ FlowChange('categoryPage', 'Dine In'); diff --git a/src/Pages/Kiosk/InitialPage/InitialPage2.jsx b/src/Pages/Kiosk/InitialPage/InitialPage2.jsx index f94b28e..27fe999 100644 --- a/src/Pages/Kiosk/InitialPage/InitialPage2.jsx +++ b/src/Pages/Kiosk/InitialPage/InitialPage2.jsx @@ -10,6 +10,8 @@ import { import '../../../Styles/Kiosk/InitialPage/InitialPage2.scss'; import { changeBookingType } from '../../../Features/BookingScreen/BookingData/KioskBookingData'; import initialBg from '../../../Images/theme3bgimg.png'; +import { PreferenceData } from '../../../Features/BookingScreen/BookingData/BookingData'; +import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin'; const InitialPage2 = (props) => { const dispatch = useDispatch(); @@ -17,6 +19,12 @@ const InitialPage2 = (props) => { const getKioskBranchNamedata = useSelector(getKioskBranchName); const getKioskBackgroundimgdata = useSelector(getKioskBackgroundimg); const SalesType = useSelector(globalSalesType); + const preferences = useSelector(PreferenceData); + const appPreferences = useSelector(ApplicationPreferences); + const bookingTypePref = appPreferences?.find(pref => pref?.PreferredCatName?.toLowerCase() === 'booking type'); + const dineInPreference = preferences?.[0]?.SettingDtlDetails?.find((item) => (item.SettingIdName)?.toLowerCase() === 'dinein')?.SettingValue === 'Y'; + const dineInAppPreference = bookingTypePref?.PreferenceCatDetails?.find((item) => item.PreferredSubCatName?.toLowerCase() === 'dine in')?.PreferredStatus === 'Y'; + const FlowChange = async (event, eventName) => { await dispatch(changeKioskPageName(event)); await dispatch(changeBookingType(eventName)); @@ -78,7 +86,7 @@ const InitialPage2 = (props) => {

- {(SalesType === 'D' || SalesType === 'B') && ( + {((SalesType === 'D' || SalesType === 'B') && dineInPreference && dineInAppPreference) && (
{ FlowChange('categoryPage', 'Dine In'); diff --git a/src/Pages/Kiosk/InitialPage/InitialPage3.jsx b/src/Pages/Kiosk/InitialPage/InitialPage3.jsx index 67d72a5..9cabc5d 100644 --- a/src/Pages/Kiosk/InitialPage/InitialPage3.jsx +++ b/src/Pages/Kiosk/InitialPage/InitialPage3.jsx @@ -26,6 +26,8 @@ import { getKioskOfferType, } from '../../../Features/Kiosk/kiosk'; import { changeBookingType } from '../../../Features/BookingScreen/BookingData/KioskBookingData'; +import { PreferenceData } from '../../../Features/BookingScreen/BookingData/BookingData'; +import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin'; const InitialPage3 = (props) => { const dispatch = useDispatch(); @@ -40,6 +42,12 @@ const InitialPage3 = (props) => { const getKioskOfferContent3Data = useSelector(getKioskOfferContent3); const getKioskOfferValueData = useSelector(getKioskOfferValue); const getKioskOfferTypeData = useSelector(getKioskOfferType); + const preferences = useSelector(PreferenceData); + const appPreferences = useSelector(ApplicationPreferences); + const bookingTypePref = appPreferences?.find(pref => pref?.PreferredCatName?.toLowerCase() === 'booking type'); + const dineInPreference = preferences?.[0]?.SettingDtlDetails?.find((item) => (item.SettingIdName)?.toLowerCase() === 'dinein')?.SettingValue === 'Y'; + const dineInAppPreference = bookingTypePref?.PreferenceCatDetails?.find((item) => item.PreferredSubCatName?.toLowerCase() === 'dine in')?.PreferredStatus === 'Y'; + const FlowChange = async (event, eventName) => { await dispatch(changeKioskPageName(event)); @@ -424,7 +432,7 @@ const InitialPage3 = (props) => { {/*

ORDER HERE

*/}
Skip the Queue line & order now for instant service!
- {(SalesType === 'D' || SalesType === 'B') && ( + {((SalesType === 'D' || SalesType === 'B') && dineInPreference && dineInAppPreference) && (
- {(SalesType === 'D' || SalesType === 'B') && ( + {((SalesType === 'D' || SalesType === 'B') && dineInPreference && dineInAppPreference) && (
{ FlowChange('categoryPage', 'Dine In'); diff --git a/src/Pages/Product/ExcelUpload.jsx b/src/Pages/Product/ExcelUpload.jsx index 08040aa..b7ab7f0 100644 --- a/src/Pages/Product/ExcelUpload.jsx +++ b/src/Pages/Product/ExcelUpload.jsx @@ -1,6 +1,5 @@ import React, { useState, useRef, useEffect, useContext } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -// import { read, utils } from 'xlsx'; import ExcelJS from 'exceljs'; import { Table, Form, Input, Tooltip, Modal, Select } from 'antd'; import { @@ -18,7 +17,6 @@ import { getFieldSetupData, } from '../../Features/ProductPage/ProductPage.js'; import Imageupload from '../../Components/Forms/Upload.jsx'; -import { BiSolidFileExport } from 'react-icons/bi'; import { CiExport } from 'react-icons/ci'; import { uploadImage } from '../../Features/upload/upload.js'; @@ -617,15 +615,20 @@ const ProductExcel = ({ }; console.log(tableFieldPreferences, 'tableFieldPreferences'); + useEffect(() => { if (excelData && excelData?.length > 0) { let ExecelToJsConvertion = []; let slicedData = excelData?.slice(1); - let filteredData = slicedData?.filter( - (item) => item?.[item?.length - 1]?.trim() !== 'sample row' - ); + let filteredData = slicedData?.filter((item) => { + const values = Object.values(item || {}); + const lastVal = values[values.length - 1]; + return typeof lastVal === 'string' + ? lastVal.trim() !== 'sample row' + : true; + }); filteredData?.map((item, index) => { - ExecelToJsConvertion.push({ + ExecelToJsConvertion?.push({ key: index, ProductName: item?.['0'], Quantity: item?.['1'], @@ -1005,112 +1008,6 @@ const ProductExcel = ({ reader.readAsArrayBuffer(file); }; - // const uploadAndProcessExcel = (file) => { - // const reader = new FileReader(); - - // reader.onload = (e) => { - // const data = new Uint8Array(e.target.result); - - // const workbook = read(data, { type: 'array' }); - // const worksheet = workbook.Sheets[workbook.SheetNames[0]]; - - // const jsonData = utils.sheet_to_json(worksheet, { - // header: 1, - // raw: false, - // dateNF: 'DD/MM/YY', - // }); - - // const nonEmptyRows = jsonData.filter((row) => - // row.some((cell) => cell !== '') - // ); - - // const header = nonEmptyRows[0]; - // const rows = nonEmptyRows.slice(1); - - // const dateFields = [ - // 'Available From', - // 'Available To', - // 'Manufacture Date', - // 'Expire Date', - // 'Stock Date', - // ]; - - // function convertToDisplayFormat(dateString) { - // const date = new Date(dateString); - // const day = date.getDate().toString().padStart(2, '0'); - // const month = (date.getMonth() + 1).toString().padStart(2, '0'); - // const year = date.getFullYear().toString(); - // return `${day}-${month}-${year}`; - // } - - // const formattedData = rows.map((row) => { - // let rowData = header.reduce((acc, col, columnIndex) => { - // if (dateFields?.includes(col)) { - // acc[col] = convertToDisplayFormat(row[columnIndex]); - // } else { - // acc[col] = row[columnIndex]; - // } - // return acc; - // }, {}); - - // return rowData; - // }); - - // if (jsonData.length > 0) { - // const extractedHeaders = Object.keys(formattedData[0]); - - // const filteredData = formattedData.filter( - // (item) => !Object.values(item)?.includes('sample row') - // ); - - // // ✅ Add default variant name if missing - // const updatedData = filteredData.map((item) => ({ - // ...item, - // 'Product Varient Name': - // item['Product Varient Name'] === undefined - // ? 'Variant 1' - // : item['Product Varient Name'], - // 'Available To': - // item['Available To'] == 'NaN-NaN-NaN' ? '' : item['Available To'], - // ProdId: item['ProdId'] || null, - // })); - - // // Detect modified products - - // const modifiedProducts = findModifiedProducts(OrginalData, updatedData); - // const modifiedIds = new Set(modifiedProducts.map((p) => p.ProdId)); - // const originalIds = new Set(OrginalData?.map((p) => p.ProdId) || []); - // const markedData = updatedData - // .map((item) => ({ - // ...item, - // isModified: - // modifiedIds.has(item.ProdId) || !originalIds.has(item.ProdId), - // })) - // .sort((a, b) => b.isModified - a.isModified); - // setUploadedRawData(markedData); - // console.log(modifiedProducts, 'modifiedProducts'); - - // // ✅ Set only once with final data - // setHeaders(extractedHeaders); - - // autoMapFields(extractedHeaders); - // dispatch(uploadExcel({ file, jsonData: nonEmptyRows })); - // setWorksheet(worksheet); - // setDatas([]); // Clear mapped state initially - // setExcelData([]); - // } - - // // setMappingOpen(true); - // dispatch(uploadExcel({ file, jsonData: nonEmptyRows })); - // setWorksheet(worksheet); - // setWorksheet1(worksheet1); - // setDatas(formattedData); // Update Datas state here - // // setExcelData(formattedData); - // }; - - // reader.readAsArrayBuffer(file); - // }; - useEffect(() => { imagecall(); addOnlineImage(); @@ -1875,24 +1772,6 @@ const ProductExcel = ({ } }); - // // Now set protection for all rows - // // First, unlock ALL cells in the worksheet - // for (let rowNum = 1; rowNum <= worksheet.rowCount; rowNum++) { - // const row = worksheet.getRow(rowNum); - // row.eachCell({ includeEmpty: true }, (cell, colNumber) => { - // const config = selectedColumns[colNumber - 1]; - // cell.protection = { locked: config?.locked || false }; - // }); - // } - - // // Then lock ONLY the header row (row 1) and sample row (row 2) - // worksheet.getRow(1).eachCell({ includeEmpty: true }, (cell) => { - // cell.protection = { locked: true }; - // }); - - // worksheet.getRow(2).eachCell({ includeEmpty: true }, (cell) => { - // cell.protection = { locked: true }; - // }); // Add empty rows for data entry for (let i = 1; i <= 1000; i++) { worksheet.addRow({}); @@ -2497,18 +2376,6 @@ const ProductExcel = ({ } }; - // Usage examples: - // Download only specific fields: - // handleDownload(['ProdName', 'Size']); // Only Product Name and Quantity - // handleDownload(['ProdName', 'Size', 'UOM', 'SellPrice']); // Multiple fields - // handleDownload(['ProdName', 'Size', 'UOM', 'SellPrice', 'ProdCat', 'Brand']); // More fields - - // Available field names: - // 'ProdName', 'Size', 'UOM', 'SellPrice', 'ProdCat', 'ProdSubCat', 'Brand', - // 'ProdVarientName', 'MRP', 'StockAvailable', 'OfferPrice', 'Supplier', 'TaxId', - // 'AutoGenerateQr', 'AddQrCode', 'SpecialPrice', 'OnePiecePrice', 'AutoGenOnePieceQr', - // 'AutoGenOnePieceQrNum', 'CESS', 'HSNCode', 'PartNumber', 'Rack', 'ManufDate', - // 'ExpDate', 'AvailableFrom', 'AvailableTo' const handleFileSubmit = (e) => { e.preventDefault(); if (excelFile === null) { @@ -2883,7 +2750,7 @@ const ProductExcel = ({
@@ -3162,13 +3029,24 @@ const ProductExcel = ({ display: 'flex', flexDirection: 'column', justifyContent: 'space-between', - height: '80%', + alignItems: 'center', + height: '60%', }} >
- {col.title} + + {col.title} + {!isMapped && ( - Not mapped + + Not mapped + )}
@@ -3217,7 +3095,7 @@ const ProductExcel = ({ style={{ position: 'absolute', right: '-17px', - top: '80%', + top: '90%', transform: 'translateY(-50%)', color: 'red', fontSize: 14, @@ -3347,111 +3225,102 @@ const ProductExcel = ({ autoComplete="off" onSubmit={handleFileSubmit} > -
-

- Upload Your Excel -

+
+
+

+ Upload Your Excel +

+
+ +
+ +
+
+
handleExportData()} + > +
+ +
+
+ Export Excel +
+
+ + {message && ( +
No Data Found
+ )} +
+ + {excelData?.length > 0 && excelData && ( +
+ + + +
+ )} +
0 ? 'space-between' : 'flex-end', + gap: '1rem', }} > - -
- + {excelData?.length > 0 && ( +
+
+

+ Modified +
+
+

+ Not Modified +
+ )} + + + -
handleExportData()} - > -
- -
-
- Export Excel -
-
- {/* {excelData?.length > 0 && excelData && -
setMappingOpen(true)}> -
- -
-
- Map Your Fields -
-
- } */} - {loading &&
Loading...
} - {message &&
No Data Found
}
- - {excelData?.length > 0 && excelData && ( -
- - - -
- )} -
-
0 ? 'space-between' : 'flex-end', - width: '100%', - }} - > - {excelData?.length > 0 && ( -
-
-

- Modified -
-
-

- Not Modified -
-
- )} - - - -
{(!excelData || excelData?.length === 0) && ( @@ -3542,13 +3411,6 @@ const ProductExcel = ({ margin: '1rem 0rem', }} > - {/* -
- - Download -
-
*/} - {excelData && excelData?.length > 0 && (
-
+ setMappingOpen(false)} > {requiredFields.map((field) => { diff --git a/src/Pages/Product/ProductList.jsx b/src/Pages/Product/ProductList.jsx index 98d0b0e..a2edd1c 100644 --- a/src/Pages/Product/ProductList.jsx +++ b/src/Pages/Product/ProductList.jsx @@ -2714,7 +2714,7 @@ const ProductList = () => { open={openExcel} title="Bulk Upload" footer={true} - width={excelDataValues?.length > 0 ? 2500 : 600} + width={excelDataValues?.length > 0 ? 2500 : 700} className={'bulkuploadmodal'} children={ <> diff --git a/src/Pages/Reports/EmployeeSettlement/EmployeeSettlement.jsx b/src/Pages/Reports/EmployeeSettlement/EmployeeSettlement.jsx index 6e21e02..c699748 100644 --- a/src/Pages/Reports/EmployeeSettlement/EmployeeSettlement.jsx +++ b/src/Pages/Reports/EmployeeSettlement/EmployeeSettlement.jsx @@ -22,7 +22,7 @@ import { getTipAmountSettlementList, postTipSettle, } from '../../../Features/TipAmountSettlementList/TipAmountSettlementList'; -import { getSession } from '../../../Services/Others'; +import { ExtractDateFormate, getSession } from '../../../Services/Others'; import { WaiterNames } from '../../../Features/Reports/Reports'; import { Messages } from '../../../Components/Notifications/Messages'; import { @@ -32,9 +32,11 @@ import { } from '../../../Features/EmployeeSettlement/EmployeeSettlement'; import FormHeader from '../../PageComponents/FormHeader'; import { changeBreadCrumb } from '../../../Features/AppPage/CenterPage'; +import "../../../Styles/OverAllStyle/OverAllStyle.scss" const { Option } = Select; const subDirectory = import.meta.env.BASE_URL; + const EmployeeSettlement = () => { const [form] = Form.useForm(); const dispatch = useDispatch(); @@ -51,51 +53,70 @@ const EmployeeSettlement = () => { const AppId = getSession('AppId'); const UserId = getSession('UserId'); const [TableData, setTableData] = useState([]); - const [employeeList, setEmployee] = useState([]); // Add this state for employee dropdown + const [employeeList, setEmployee] = useState([]); + const [statusValue, setStatusValue] = useState('toBe'); + const checkedTotal = checkedRows.reduce( (sum, row) => sum + (Number(row?.IncentiveDetails?.[0]?.IncentiveAmount) || 0), 0 ); - const Paymentstatus = form.getFieldValue('status'); - - console.log(checkedRowKeys, 'checkedRowKeys'); - // const employeeOptions = [ - // ...new Set(TableData.map(item => item.Employee)) - // ]; const [filteredData, setFilteredData] = useState(TableData); + const items = [ { name: 'Home', link: `${subDirectory}app-page/home`, }, - { - name: 'Incentive Settlement', - link: `${subDirectory}report/EmployeeSettlement`, - }, ]; + const modalColumns = [ { - title: 'Tip Date', - dataIndex: 'SalesDate', - key: 'SalesDate', - width: 100, - render: (date) => (date ? dayjs(date).format('DD/MM/YYYY') : ''), + title: 'Sales Start Date', + dataIndex: 'SalesStartDate', + key: 'SalesStartDate', + width: 130, + render: (date) => (date ? ExtractDateFormate(date) : ''), }, { - title: 'Tip Date', - dataIndex: 'TipsAmount', - key: 'TipsAmount', - width: 100, - render: (item) => {item}, + title: 'Sales End Date', + dataIndex: 'SalesEndDate', + key: 'SalesEndDate', + width: 130, + render: (date) => (date ? ExtractDateFormate(date) : ''), + }, + { + title: 'Total Sales Amount', + dataIndex: 'TotalSalesAmount', + key: 'TotalSalesAmount', + width: 150, + align: 'right', + render: (item) => {item ?? 0}, + }, + { + title: 'Incentive Amount', + dataIndex: 'IncentiveAmount', + key: 'IncentiveAmount', + width: 130, + align: 'right', + render: (item) => {item ?? 0}, + }, + { + title: 'Status', + dataIndex: 'SettledStatus', + key: 'SettledStatus', + width: 100, + align: 'center', + render: (item) => ( + + {item === 'Y' ? 'Settled' : 'Pending'} + + ), }, - - // Add more columns as needed based on your TipsDetails structure ]; const handleEyeClick = (record) => { - // Assuming TipsDetails is an array inside WaiterDetails[0] setModalData(record); setModalOpen(true); }; @@ -111,13 +132,12 @@ const EmployeeSettlement = () => { {index + 1} ), }, - { title: 'Employee', dataIndex: 'EmployeeName', key: 'EmployeeName', render: (item, record) => ( - {item ? item : record?.MobileNo} + {item ? item : record?.MobileNo} ), }, { @@ -127,7 +147,7 @@ const EmployeeSettlement = () => { key: 'TotalSalesAmount', render: (_, record) => { const statusMap = { toBe: 'N', already: 'Y' }; - const value = statusMap[form.getFieldValue('status')]; + const value = statusMap[statusValue]; const group = record?.StatusGroups?.find( (e) => e?.SettledStatus === value ); @@ -135,73 +155,116 @@ const EmployeeSettlement = () => { }, }, { - title: 'IncentiveAmount', + title: 'Incentive Amount', align: 'right', dataIndex: 'IncentiveAmount', key: 'IncentiveAmount', render: (_, record) => { const statusMap = { toBe: 'N', already: 'Y' }; - const value = statusMap[form.getFieldValue('status')]; + const value = statusMap[statusValue]; const group = record?.StatusGroups?.find( (e) => e?.SettledStatus === value ); return {group?.IncentiveAmount ?? 0}; }, }, - ...(Paymentstatus !== 'already' + { + title: 'Details', + dataIndex: 'TipsDetails', + key: 'TipsDetails', + width: 80, + align: 'center', + render: (_, record) => { + const statusMap = { toBe: 'N', already: 'Y' }; + const value = statusMap[statusValue]; + const group = record?.StatusGroups?.find( + (e) => e?.SettledStatus === value + ); + return ( + handleEyeClick(group?.items ?? [])} + > + + + + + ); + }, + }, + ...(statusValue !== 'already' ? [ - { - title: 'Settle', - key: 'settle', - width: 80, - align: 'center', - render: (_, record) => { - const waiterId = record?.EmployeeId; - const isDisabled = record?.IncentiveAmount === 12; + { + title: 'Settle', + key: 'settle', + width: 80, + align: 'center', + render: (_, record) => { + const waiterId = record?.EmployeeId; + const statusMap = { toBe: 'N', already: 'Y' }; + const value = statusMap[statusValue]; + const group = record?.StatusGroups?.find( + (g) => g?.SettledStatus === value + ); + const isDisabled = !group || group?.IncentiveAmount === 0; - return ( - { - if (e.target.checked) { - setCheckedRowKeys((prev) => - prev.includes(waiterId) ? prev : [...prev, waiterId] - ); - setCheckedRows((prev) => - prev.find((row) => row?.EmployeeId === waiterId) - ? prev - : [...prev, record] - ); - } else { - setCheckedRowKeys((prev) => - prev.filter((key) => key !== waiterId) - ); - setCheckedRows((prev) => - prev.filter((row) => row?.EmployeeId !== waiterId) - ); - } - }} - /> - ); - }, + return ( + { + if (e.target.checked) { + setCheckedRowKeys((prev) => + prev.includes(waiterId) ? prev : [...prev, waiterId] + ); + setCheckedRows((prev) => + prev.find((row) => row?.EmployeeId === waiterId) + ? prev + : [...prev, record] + ); + } else { + setCheckedRowKeys((prev) => + prev.filter((key) => key !== waiterId) + ); + setCheckedRows((prev) => + prev.filter((row) => row?.EmployeeId !== waiterId) + ); + } + }} + /> + ); }, - ] + }, + ] : [{}]), ]; // Handle select all checkboxes const handleSelectAll = (e) => { if (e.target.checked) { - const allWaiterIds = groupByEmployeeAndStatus(TableData) + const allEmployees = groupByEmployeeAndStatus(TableData) .map((emp) => ({ ...emp, StatusGroups: emp.StatusGroups.filter((g) => g.SettledStatus === 'N'), })) - .filter((emp) => emp.StatusGroups.length > 0) - ?.map((row) => row?.EmployeeId); - setCheckedRowKeys(allWaiterIds); - setCheckedRows(TableData.slice()); + .filter((emp) => emp.StatusGroups.length > 0); + + const allIds = allEmployees.map((row) => row?.EmployeeId); + setCheckedRowKeys(allIds); + setCheckedRows(allEmployees); } else { setCheckedRowKeys([]); setCheckedRows([]); @@ -209,7 +272,6 @@ const EmployeeSettlement = () => { }; useEffect(() => { - // Set today's date for fromDate and toDate in the form const today = dayjs(); form.setFieldsValue({ fromDate: today, @@ -230,8 +292,8 @@ const EmployeeSettlement = () => { if (response?.data?.statusCode === 1) { setTableData(response?.data?.data?.EmployeeDetails); } - // handle response as needed }; + const fetchData = async () => { let data = { activeStatus: 'A', @@ -250,6 +312,9 @@ const EmployeeSettlement = () => { setSelectedRowKeys([]); setFilteredData(TableData); setTableData([]); + setCheckedRows([]); + setCheckedRowKeys([]); + setStatusValue('toBe'); }; const onFinish = async (values) => { @@ -266,21 +331,21 @@ const EmployeeSettlement = () => { let response; Employee !== 'all' ? (response = await dispatch( - getEmployeeSettlementListindIvidually(data) - ).unwrap()) + getEmployeeSettlementListindIvidually(data) + ).unwrap()) : (response = await dispatch(getEmployeeSettlementList(data)).unwrap()); + if (response?.data?.statusCode === 1) { setTableData(response?.data?.data?.EmployeeDetails); const StatusValue = form.getFieldValue('status') === 'toBe' ? 'N' : 'Y'; - const employees = response?.data?.data?.EmployeeDetails ?? []; - const data = employees.some((e) => + const hasData = employees.some((e) => e?.IncentiveDetails?.some( (a) => a?.SettledStatus === StatusValue && a?.IncentiveAmount > 0 ) ); - if (data) { + if (hasData) { setMessageType('success'); setMessageData(response?.data?.response); } @@ -294,7 +359,7 @@ const EmployeeSettlement = () => { const handleCheckedSubmit = async () => { const today = dayjs(); const statusMap = { toBe: 'N', already: 'Y' }; - const value = statusMap[form.getFieldValue('status')]; // "N" or "Y" + const value = statusMap[statusValue]; const postData = { CompId, @@ -305,7 +370,6 @@ const EmployeeSettlement = () => { const group = item?.StatusGroups?.find( (g) => g?.SettledStatus === value ); - return { SettlementAmount: group?.IncentiveAmount ?? 0, EmployeeId: item?.EmployeeId, @@ -315,27 +379,23 @@ const EmployeeSettlement = () => { }), }; - console.log(postData); - let response = await dispatch(postEmployeeSettle(postData))?.unwrap(); if (response?.data?.statusCode === 1) { setMessageType('success'); setMessageData(response?.data?.response); handleReset(); - setCheckedRows([]); } else { setMessageType('error'); setMessageData(response?.data?.response); handleReset(); } }; + function formatToYYYYMMDD(dateString) { const date = new Date(dateString); - const year = date.getFullYear(); - const month = String(date.getMonth() + 1).padStart(2, '0'); // Months are 0-based + const month = String(date.getMonth() + 1).padStart(2, '0'); const day = String(date.getDate()).padStart(2, '0'); - return `${year}/${month}/${day}`; } @@ -344,24 +404,11 @@ const EmployeeSettlement = () => { setMessageType(null); }, []); - // const getFilteredTableData = useCallback(() => { - // const statusMap = { toBe: "N", already: "Y" }; - // const value = statusMap[form.getFieldValue('status')]; - - // return value - // ? TableData.flatMap(item => - // item?.IncentiveDetails?.filter(detail => detail?.SettledStatus === value) || [] - // ) - // : TableData.flatMap(item => item?.IncentiveDetails || []); - // }, [form, TableData]); + // ✅ FIXED: No longer skips records with IncentiveAmount === 0 function groupByEmployeeAndStatus(tableData) { return tableData .map((emp) => { const grouped = emp.IncentiveDetails.reduce((acc, curr) => { - if ((curr.IncentiveAmount || 0) === 0) { - return acc; // skip this detail entirely - } - const status = curr.SettledStatus; if (!acc[status]) { acc[status] = { @@ -380,20 +427,33 @@ const EmployeeSettlement = () => { return { EmployeeId: emp?.EmployeeId, EmployeeName: emp.EmployeeName, + MobileNo: emp.MobileNo, StatusGroups: Object.values(grouped), }; }) - .filter((emp) => emp.StatusGroups.length > 0); // remove employees with no valid items + .filter((emp) => emp.StatusGroups.length > 0); } - let dataaaa = groupByEmployeeAndStatus(TableData); - console.log(dataaaa, 'dataaaa'); + const getTableDataSource = () => { + const grouped = groupByEmployeeAndStatus(TableData); + const statusFilter = statusValue === 'toBe' ? 'N' : 'Y'; + return grouped + ?.map((emp) => ({ + ...emp, + StatusGroups: emp.StatusGroups.filter( + (g) => g.SettledStatus === statusFilter + ), + })) + ?.filter((emp) => emp.StatusGroups.length > 0); + }; + useEffect(() => { setCheckedRowKeys([]); setCheckedRows([]); - }, [form.getFieldValue('status'), TableData]); + }, [statusValue, TableData]); - const handleStatusChange = () => { + const handleStatusChange = (e) => { + setStatusValue(e.target.value); setCheckedRowKeys([]); setCheckedRows([]); setFilteredData([]); @@ -408,9 +468,6 @@ const EmployeeSettlement = () => { overflow: 'scroll', }} > -
- -
{ Employee: 'all', status: 'toBe', }} + style={{ + padding: '10px', + border: '1px solid #d7d7d7', + borderRadius: '10px', + }} > - + { ))} @@ -452,35 +510,6 @@ const EmployeeSettlement = () => { - {/* - - current && current > dayjs().endOf('day')} - /> - - - - - current && current > dayjs().endOf('day')} - /> - - */} - { - {/* Data Table */} - {Paymentstatus !== 'already' && ( + {/* Select All checkbox */} + {statusValue !== 'already' && (
0 && - checkedRowKeys?.length < TableData?.length + checkedRowKeys?.length < getTableDataSource()?.length } checked={ - TableData?.length > 0 && - checkedRowKeys?.length === TableData?.length + getTableDataSource()?.length > 0 && + checkedRowKeys?.length === getTableDataSource()?.length } onChange={handleSelectAll} > @@ -530,28 +559,13 @@ const EmployeeSettlement = () => {
)} + + {/* Data Table */}
({ - ...emp, - StatusGroups: emp.StatusGroups.filter( - (g) => g.SettledStatus === 'N' - ), - })) - .filter((emp) => emp.StatusGroups.length > 0) - : groupByEmployeeAndStatus(TableData) - .map((emp) => ({ - ...emp, - StatusGroups: emp.StatusGroups.filter( - (g) => g.SettledStatus === 'Y' - ), - })) - .filter((emp) => emp.StatusGroups.length > 0) - } + dataSource={getTableDataSource()} + rowKey={(record) => record?.EmployeeId} loading={loading} scroll={{ x: 'max-content' }} size="middle" @@ -559,20 +573,12 @@ const EmployeeSettlement = () => { /> - {/* Button to submit checked rows */} - + {/* Pay Button */}
- {/* {checkedRowKeys.length !== 0 && ( - - )} */}
+ {/* Detail Modal */} setModalOpen(false)} footer={null} - title="Tip Details" - width={600} + title="Incentive Details" + width={700} >
{ ); }; -export default EmployeeSettlement; +export default EmployeeSettlement; \ No newline at end of file diff --git a/src/Pages/Reports/Revenue/RevenueItemWiseReport.jsx b/src/Pages/Reports/Revenue/RevenueItemWiseReport.jsx index a45b993..52b5c42 100644 --- a/src/Pages/Reports/Revenue/RevenueItemWiseReport.jsx +++ b/src/Pages/Reports/Revenue/RevenueItemWiseReport.jsx @@ -35,23 +35,17 @@ const RevenueItemWiseReport = () => { const formattedToday = today.toISOString()?.split('T')[0]; const dispatch = useDispatch(); const formRef = useRef(); - // const [filteredInfo, setFilteredInfo] = useState({}); const [sortedInfo, setSortedInfo] = useState({}); - // const [sortedInfo2, setSortedInfo2] = useState({}); const [searchedText, setSearchedText] = useState(''); - // const [searchedText2, setSearchedText2] = useState(""); const [OrderFromDate, setOrderFromDate] = useState(formattedToday); const [OrderToDate, setOrderToDate] = useState(formattedToday); const [RevenueData, setRevenueData] = useState(); - // const [CateWiseData, setCateWiseData] = useState(); const [userDropDown, setuserDropDown] = useState([]); - // const [chartData, setchartdata] = useState([]); const [apiCall, setapiCall] = useState(false); const [chart, setchart] = useState(false); const [selectedUserData, setSelectedUserData] = useState(null); const [receiptTextItemWise, setreceiptTextItemWise] = useState(); - // const [receiptTextCatWise, setreceiptTextCatWise] = useState() const SettingDataSelector = useSelector(PreferenceData); const UomPrint = SettingDataSelector?.[0]?.SettingDtlDetails?.filter( @@ -174,32 +168,11 @@ const RevenueItemWiseReport = () => { fetchInitialData(); }, []); - // useEffect(() => { - // setchart(false) - // }, [apiCall]); useEffect(() => { if (UserRole != 'Employee') { userDropData(); } }, []); - // useEffect(() => { - // if (apiCall) { - // setSelectedUserData(0); - // fetchCatData(); - // } - // else { - - // setSelectedUserData(0); - // fetchInitialData(); - - // } - // }, [apiCall]); - // useEffect(() => { - // if (UserId==0){ - // onFinish(); - // } - // }, []); - function safeRound(amountStr) { if (amountStr == null) return allowDecimal ? '0.00' : '0'; @@ -211,28 +184,6 @@ const RevenueItemWiseReport = () => { return allowDecimal ? num.toFixed(2) : Math.round(num).toString(); } - // const fetchCatData = async () => { - // let data1 = { - // CompId: CompId, - // BranchId: BranchId, - // AppId: AppId, - // OrderFromDate: OrderFromDate?.split("T")?.[0], - // OrderToDate: OrderToDate?.split("T")?.[0], - // UserId: 0, - // type: 'PE' - - // }; - - // let response = await dispatch(getEstimateCatItemWiseReport(data1)).unwrap(); - // if (response?.data?.statusCode == 1) { - // setCateWiseData(response?.data?.data) - - // } - // else { - - // setCateWiseData(); - // } - // } const userDropData = async () => { const gettinguserDropDown = await dispatch( UserDataBasedOnBranchId(BranchId) @@ -268,27 +219,14 @@ const RevenueItemWiseReport = () => { setFilteredInfo(filters); setSortedInfo(sorter); }; - // const handleChange2 = (pagination, filters, sorter) => { - // setSortedInfo2(sorter); - // }; - - // const onComplete = useCallback(() => { - // setMessageData(null); - // setMessageType(null); - // }, []) const onSearch = (value) => { - setSearchedText(value); + setSearchedText(typeof value === "string" ? value : ""); }; + const onSearchChange = (e) => { - setSearchedText(e?.target?.value); + setSearchedText(e?.target?.value || ""); }; - // const onSearch2 = (value) => { - // setSearchedText2(value); - // }; - // const onSearchChange2 = (e) => { - // setSearchedText2(e?.target?.value); - // }; const Print = async () => { if (isMobile) { if (MobileA4Print) { @@ -426,45 +364,7 @@ const RevenueItemWiseReport = () => { }, }, ]; - // const columns2 = [ - // { - // title: "SI NO", - // dataIndex: "SINO", - // key: "SINO", - // align: "center", - // render: (text, object, index) => {index + 1}, - // }, - // { - // title: "Category", - // dataIndex: "ProdCatName", - // key: "Category", - // filteredValue: [searchedText2], - // onFilter: (value, record) => { - // return String(record.ProdCatName) - // ?.toLowerCase() - // ?.includes(value?.toLowerCase()); - // }, - // sorter: (a, b) => a?.ProdCatName?.localeCompare(b?.ProdCatName), - // sortOrder: sortedInfo2.columnKey === "ItemName" ? sortedInfo2.order : null, - // ellipsis: true, - // }, - // { - // title: "Qty", - // dataIndex: "SalesQty", - // key: "Qty", - // align: "right", - // }, - // { - // title: "Amount", - // dataIndex: "TotalAmt", - // key: "Amount", - // align: "right", - // render : (text)=> ( - // {safeRound(text)} - // ) - // } - // ]; const DateWisTableData = RevenueData?.map((item, index) => ({ SINO: index + 1, ItemName: @@ -511,40 +411,16 @@ const RevenueItemWiseReport = () => { UserId: UserId, type: 'E', }; - // let data1 = { - // CompId: CompId, - // BranchId: BranchId, - // AppId: AppId, - // OrderFromDate: OrderFromDate?.split("T")?.[0], - // OrderToDate: OrderToDate?.split("T")?.[0], - // UserId: UserId, - // type: 'E' - // }; if (!apiCall) { let Response = await dispatch(getRevenueItemWiseReport(data)).unwrap(); setRevenueData(Response?.data?.data); } - // else { - // let response = await dispatch(getEstimateCatItemWiseReport(data1)).unwrap(); - // if (response?.data?.statusCode === 1) { - // setCateWiseData(response?.data?.data) - // } else { - // // setMessageType("warning"); - // // setMessageData("No Data Found"); - // setCateWiseData(); - // } - // } + } catch (error) { console.error('An error occurred:', error); } }; - // let filterRate1 = CateWiseData?.map((item) => item.TotalAmt); - // const TotalAmount2 = filterRate1?.reduce( - // (accumulator, currentValue) => accumulator + currentValue, - // 0 - // ); - let filterPurchaseRate = RevenueData?.map((item) => item.ProductPurchaseRate); const PurchaseRate = filterPurchaseRate?.reduce( @@ -562,10 +438,6 @@ const RevenueItemWiseReport = () => { const TotalSalesAmt = salesRate - PurchaseRate; - // const onChange = (checked) => { - // setapiCall(checked); - // }; - const reprintDate = (date) => { const salesDate = new Date(date); const formattedDate = salesDate.toLocaleDateString('en-GB', { @@ -582,58 +454,6 @@ const RevenueItemWiseReport = () => { } }, [itemData]); - // useEffect(() => { - // if (CateWiseData?.length > 0) { - // mobileCatWisePrintFun(CateWiseData) - // } - - // }, [CateWiseData]) - - // const mobileCatWisePrintFun = async (printdata) => { - - // let Tabledata = printdata?.map((data, index) => { - - // const snoSpacing = Math.max(0, 3 - String(index + 1).length); - // // Calculate dynamic spacing for Rate - // const QtySpacing = Math.max(0, 5 - String(data?.SalesQty).length); - // const rateSpacing = Math.max(0, 7 - String(data?.TotalAmt).length); - - // // Calculate dynamic spacing for TotalAmt - - // // Generate formatted string with dynamic spacings - // const formattedString = - // " ".repeat(snoSpacing) + - // parseInt(index + 1) + - // " " + - // (data?.ProdCatName + " ".repeat(20)).substring(0, 20) + - - // " " + - // " ".repeat(QtySpacing) + String(data?.SalesQty) + - // " " + - // " ".repeat(rateSpacing) + String(data?.TotalAmt) + - // " " + "\n"; - - // return formattedString; - // }); - - // var receiptTextdata = - - // "[C]" + "Category Wise Sales" + "\n" + - // "[L]From Date :" + reprintDate(OrderFromDate) + - // "[L]" + " " + "To Date :" + reprintDate(OrderToDate) + - // "\n" + - // "[C]------------------------------------------------\n" + - - // "[L]" + "" + "S.No" + " " + " Category " + " " + "Quantity " + " " + "Amount " + "" + "" + - // "[L]\n" + - // "[C]------------------------------------------------\n" + - // Tabledata.join("") + - // "[C]------------------------------------------------\n" + - // "[R]" + "TotalAmount:" + parseFloat(TotalAmount).toFixed(2) + "\n" + - // "[L]------------------------------------------------\n" - - // setreceiptTextCatWise(receiptTextdata) - // } const mobileItemWisePrintFun = async (printdata) => { let Tabledata = printdata?.map((data, index) => { @@ -701,7 +521,7 @@ const RevenueItemWiseReport = () => { return allowDecimal ? parseFloat(value || 0).toFixed(2) : Math.round(value || 0); }; const getPreference = async () => { - const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId }; + const data = { AppId: AppId, CompId: CompId, BranchId: BranchId, UserId: UserId }; const { data: res } = await dispatch(getPreferenceData(data)).unwrap() const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y'); if (decimalSetting) { @@ -721,12 +541,6 @@ const RevenueItemWiseReport = () => { TotalSalesAmt={TotalSalesAmt} RevenueData={RevenueData} /> - {/* */}
@@ -735,57 +549,6 @@ const RevenueItemWiseReport = () => {

Gross Margin

- {/*
-
-

- From Date -

-
- - - -
- -
-
-

To Date

-
- - - - -
*/} @@ -863,59 +626,20 @@ const RevenueItemWiseReport = () => { />
- {/*
- - {!apiCall ? 0 - ? "ItemWiseReport-printerIcon" - : "ItemWiseReport-printerIcon-disabled" - } - /> : - 0 - ? "ItemWiseReport-printerIcon" - : "ItemWiseReport-printerIcon-disabled" - } - />} - -
*/} +
- {!apiCall ? ( - - ) : !chart ? ( - - ) : ( - '' - )} +
- {/* {apiCall &&
-

PieChart

   

TableData

-
} */}
- {/* */} -
@@ -929,16 +653,17 @@ const RevenueItemWiseReport = () => { {itemData && - itemData - .filter( - (row) => - !searchedText || + (itemData || []) + .filter((row) => { + const search = (searchedText || "").toLowerCase(); + + return ( + !search || (row.ItemName && - row.ItemName?.toLowerCase()?.includes( - searchedText?.toLowerCase() - )) - ) - .sort((a, b) => { + row.ItemName.toLowerCase().includes(search)) + ); + }) + ?.sort((a, b) => { if (sortedInfo.columnKey === 'ItemName') { return sortedInfo.order === 'ascend' ? a.ItemName?.localeCompare(b.ItemName) @@ -946,7 +671,7 @@ const RevenueItemWiseReport = () => { } return 0; }) - .map((row, idx) => ( + ?.map((row, idx) => ( @@ -994,30 +719,10 @@ const RevenueItemWiseReport = () => {
{idx + 1} {row.ItemName}
- {/*
- {!apiCall ? : !chart ? ( - - ) : () - } -
*/}
- {/* {apiCall && chart ? null : ( -

Net Amount: {!apiCall ? TotalAmount : (!chart ? TotalAmount2 : "")}

- )} */} - {!apiCall ? (
@@ -1030,15 +735,6 @@ const RevenueItemWiseReport = () => { - {/* {RevenueData?.[0]?.OverallDisc > 0 && - - - } - - {RevenueData?.[0]?.TaxAmt > 0 && - - - } */}

diff --git a/src/Styles/BookingScreen/Components/BSItemCards/BSItemCard.scss b/src/Styles/BookingScreen/Components/BSItemCards/BSItemCard.scss index 3cc2a73..5f386db 100644 --- a/src/Styles/BookingScreen/Components/BSItemCards/BSItemCard.scss +++ b/src/Styles/BookingScreen/Components/BSItemCards/BSItemCard.scss @@ -78,7 +78,7 @@ } .BSItemCard-content { - padding: 1px 0; + padding: 3px 0; background-color: rgba(255, 255, 255, 0.8); position: absolute; display: flex; @@ -96,7 +96,8 @@ font-weight: 500; max-width: 130px; display: -webkit-box; - -webkit-line-clamp: 3; + -webkit-line-clamp: 2; + line-height: 1; -webkit-box-orient: vertical; overflow: hidden; } diff --git a/src/Styles/OverAllStyle/OverAllStyle.scss b/src/Styles/OverAllStyle/OverAllStyle.scss index 841b020..bfd5707 100644 --- a/src/Styles/OverAllStyle/OverAllStyle.scss +++ b/src/Styles/OverAllStyle/OverAllStyle.scss @@ -1721,3 +1721,17 @@ table { right: 2rem; } } + +.addVariant { + background: #23378a29; + color: #23378a; + padding: 12px 24px; + border: none; + font-family: "Poppins", sans-serif; + font-size: 14px; + font-weight: 500; + cursor: pointer; + border-radius: 6px; + outline: none; + height: max-content; +} diff --git a/src/Styles/Product/excel.scss b/src/Styles/Product/excel.scss index 00a9214..a964f20 100644 --- a/src/Styles/Product/excel.scss +++ b/src/Styles/Product/excel.scss @@ -8,12 +8,7 @@ font-weight: bold !important; } -// .viewerExcelupload table { -// // table-layout: auto !important; -// } - .viewerExcelupload::-webkit-scrollbar { - // display: block !important; width: 0rem; height: 0.5rem; } @@ -28,7 +23,7 @@ background-color: #1292ee; color: #fff; border-radius: 4px; - font-family: 'Poppins'; + font-family: "Poppins"; font-size: 16px; svg { @@ -48,6 +43,8 @@ .tableExcelUpload { .ant-table-cell { padding: 0 8px !important; + font-family: "Poppins"; + font-weight: 500 !important; } .ant-select-selection-placeholder { @@ -129,16 +126,16 @@ } .mdsheet { - width: 25px; - height: 25px; + width: 20px; + height: 20px; border: 1px solid #5bff73; background-color: #b3ffbf; border-radius: 4px; } .mdsheet2 { - width: 25px; + width: 20px; + height: 20px; border-radius: 4px; - height: 25px; background-color: #ffc7f8; border: 1px solid #ff74ec; } @@ -148,5 +145,88 @@ font-family: "Poppins"; font-size: 14px; font-weight: 500; + @media (max-width: 500px) { + font-size: 10px; + } } -} \ No newline at end of file +} + +.field-setup-selected-fields { + display: flex; + flex-wrap: wrap; + gap: 4px; + margin-bottom: 50px; + height: max-content; + max-height: 50vh; + overflow: auto; + + .selected-field { + display: flex; + align-items: center; + gap: 4px; + background: #0bad77; + padding: 6px 10px; + border-radius: 6px; + font-size: 13px; + font-weight: 600; + color: #fff; + + .close-icon { + display: flex; + align-items: center; + cursor: pointer; + + > svg { + color: #ffffffff !important; + } + } + } +} + +.HeadingUploadExl { + display: flex; + align-items: center; + justify-content: space-between; + gap: 1rem; + width: 50%; + @media (max-width: 950px) { + width: 100%; + } +} +.download-linkMain { + display: flex; + align-items: center; + gap: 1rem; + justify-content: space-between; + margin-bottom: 10px; + @media (max-width: 950px) { + flex-wrap: wrap; + } +} + +.download-link { + width: 50%; + justify-content: space-between; + align-items: center; + @media (max-width: 950px) { + width: 100%; + } +} + +.viewerExcelupload { + .ant-select-selection-item { + margin-top: 0 !important ; + padding-top: 0 !important; + } +} + +.download-link span { + font-size: 12px; + font-weight: 400; +} +.imgUpldr { + display: flex; + flex-direction: column; + align-items: center; + gap: 2px; +} diff --git a/src/routesConfig.jsx b/src/routesConfig.jsx index e20568d..718e320 100644 --- a/src/routesConfig.jsx +++ b/src/routesConfig.jsx @@ -552,6 +552,9 @@ const TipAmountSettlementList = lazy( const EmployeeSettlement = lazy( () => import('./Pages/Reports/EmployeeSettlement/EmployeeSettlement.jsx') ); +const Settlement = lazy( + () => import ('./Pages/Reports/TipAmountSettlement/Settlement.jsx') +); const PublicQrCode = lazy(() => import('./Pages/Reports/PublicQrCode.jsx')); const TableMapping = lazy( @@ -684,7 +687,7 @@ const initSession = () => { sessionStorage.setItem( 'auth', - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiODA3MjMyOTE1MyIsIlBhc3N3b3JkIjoiWkB6MTIzNCIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTIiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTQiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiXSwiZXhwIjoxNzczNDI3NTExLCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMDEifQ.Elg8MMqbF4nMYwcWgzrxVaLfYhxdx3drixoV83RbuAM' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiODA3MjMyOTE1MyIsIlBhc3N3b3JkIjoiWkB6MTIzNCIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTIiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTQiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiXSwiZXhwIjoxNzc0Mzc5NTY2LCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMDEifQ.uTdcz-FHE4GTux7FTtT2pQt9gEe-17_mIrwJWbHdHE8' ); }; @@ -865,16 +868,22 @@ export const routesConfig = [ component: MenuQRCode, empAccess: 'MenuQRCode', }, + // { + // path: 'tipamountsettlementlist', + // component: TipAmountSettlementList, + // empAccess: 'Tips', + // }, + // { + // path: 'EmployeeSettlement', + // component: EmployeeSettlement, + // empAccess: 'Incentive', + // }, { - path: 'tipamountsettlementlist', - component: TipAmountSettlementList, - empAccess: 'Tips', - }, - { - path: 'EmployeeSettlement', - component: EmployeeSettlement, - empAccess: 'Incentive', + path: 'Settlement', + component: Settlement, + empAccess: 'Settlement', }, + { path: 'datewisereport', component: DateWiseReport,
Sales Rate {safeRound(salesRate)}
Discount Amount{RevenueData?.[0]?.OverallDisc}
Total Tax{RevenueData?.[0]?.TaxAmt}
@@ -1093,11 +789,6 @@ const RevenueItemWiseReport = () => { ) )} - {/*
- {apiCall && chart ? null : ( -

Net Amount: {!apiCall ? TotalAmount : (!chart ? TotalAmount2 : "")}

- )} -
*/} diff --git a/src/Pages/Reports/TipAmountSettlement/Settlement.jsx b/src/Pages/Reports/TipAmountSettlement/Settlement.jsx new file mode 100644 index 0000000..b9ed493 --- /dev/null +++ b/src/Pages/Reports/TipAmountSettlement/Settlement.jsx @@ -0,0 +1,61 @@ +import { useState } from "react"; +import { Messages } from "../../../Components/Notifications/Messages"; +import TipAmountSettlementList from "./TipAmountSettlementList"; +import EmployeeSettlement from "../EmployeeSettlement/EmployeeSettlement"; +import "./Settlement.scss"; + +const Settlement = () => { + const [selectedComponent, setSelectedComponent] = useState("tips"); + + const messageType = ""; + const messageData = []; + const onComplete = () => {}; + + return ( +
+
+ + + {/* ✅ Tabs */} +
+
+ +
setSelectedComponent("tips")} + > + Tip Settlement +
+ +
setSelectedComponent("insentive")} + > + Incentive Settlement +
+ +
+
+ + {/* ✅ Content */} +
+ {selectedComponent === "tips" ? ( + + ) : ( + + )} +
+
+
+ ); +}; + +export default Settlement; \ No newline at end of file diff --git a/src/Pages/Reports/TipAmountSettlement/Settlement.scss b/src/Pages/Reports/TipAmountSettlement/Settlement.scss new file mode 100644 index 0000000..4c45c67 --- /dev/null +++ b/src/Pages/Reports/TipAmountSettlement/Settlement.scss @@ -0,0 +1,35 @@ +/* Container for tabs */ +.settlementTabs { + display: inline-flex; + gap: 16px; + font-family: "Poppins"; + margin-bottom: 12px; + border-bottom: 1px solid #d1d5db; + +} + +/* Default tab style */ +.tabItem { + font-size: 22px; + font-weight: 600; + cursor: pointer; + color: #6b7280; + display: flex; + align-items: center; + gap: 6px; + position: relative; + border: none; + background: transparent; + font-family: "Gilroy"; + transition: color 0.2s ease; +} + +.tabItem.active { + color: #0f172a; + border-bottom: 2px solid #1296db !important; +} + +.tabContent { + margin-top: 20px; +} + \ No newline at end of file diff --git a/src/Pages/Reports/TipAmountSettlement/TipAmountSettlementList.jsx b/src/Pages/Reports/TipAmountSettlement/TipAmountSettlementList.jsx index 813f415..936455e 100644 --- a/src/Pages/Reports/TipAmountSettlement/TipAmountSettlementList.jsx +++ b/src/Pages/Reports/TipAmountSettlement/TipAmountSettlementList.jsx @@ -444,9 +444,9 @@ const TipAmountSettlementList = () => {
-
- -
+ {/*
+ +
*/} {