Resolved merge conflict in BSItemCard.jsx
This commit is contained in:
commit
c791ebf945
|
|
@ -262,7 +262,7 @@ const styles = {
|
||||||
|
|
||||||
status: {
|
status: {
|
||||||
marginTop: '6px',
|
marginTop: '6px',
|
||||||
fontSize: '0.7rem',
|
fontSize: '0.6rem',
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
letterSpacing: '4px',
|
letterSpacing: '4px',
|
||||||
textTransform: 'uppercase',
|
textTransform: 'uppercase',
|
||||||
|
|
|
||||||
|
|
@ -864,10 +864,11 @@ const AppPage = () => {
|
||||||
'Payment Updates',
|
'Payment Updates',
|
||||||
`${subDirectory}setting/payment-received-retail`
|
`${subDirectory}setting/payment-received-retail`
|
||||||
),
|
),
|
||||||
getsubItem('Settlement', `${subDirectory}setting/Settlement`, null, [
|
// getsubItem('Settlement', `${subDirectory}setting/Settlement`, null, [
|
||||||
getsubItem('Tips', `${subDirectory}report/tipamountsettlementlist`),
|
// getsubItem('Tips', `${subDirectory}report/tipamountsettlementlist`),
|
||||||
getsubItem('Incentive', `${subDirectory}report/EmployeeSettlement`),
|
// getsubItem('Incentive', `${subDirectory}report/EmployeeSettlement`),
|
||||||
]),
|
// ]),
|
||||||
|
getsubItem('Settlement', `${subDirectory}report/Settlement`),
|
||||||
|
|
||||||
!iswarehouse &&
|
!iswarehouse &&
|
||||||
getsubItem('Others', `${subDirectory}cancelReschedule`, null, [
|
getsubItem('Others', `${subDirectory}cancelReschedule`, null, [
|
||||||
|
|
@ -1112,10 +1113,11 @@ const AppPage = () => {
|
||||||
];
|
];
|
||||||
const Settlement = [
|
const Settlement = [
|
||||||
!sportsAppPreference &&
|
!sportsAppPreference &&
|
||||||
getsubItem('Settlement', `${subDirectory}setting/Settlement`, null, [
|
// getsubItem('Settlement', `${subDirectory}setting/Settlement`, null, [
|
||||||
getsubItem('Tips', `${subDirectory}report/tipamountsettlementlist`),
|
// getsubItem('Tips', `${subDirectory}report/tipamountsettlementlist`),
|
||||||
getsubItem('Incentive', `${subDirectory}report/EmployeeSettlement`),
|
// getsubItem('Incentive', `${subDirectory}report/EmployeeSettlement`),
|
||||||
]),
|
// ]),
|
||||||
|
getsubItem('Settlement', `${subDirectory}report/Settlement`),
|
||||||
];
|
];
|
||||||
const Others = [
|
const Others = [
|
||||||
!iswarehouse &&
|
!iswarehouse &&
|
||||||
|
|
@ -1817,21 +1819,22 @@ const AppPage = () => {
|
||||||
`${subDirectory}setting/payment-received-retail`
|
`${subDirectory}setting/payment-received-retail`
|
||||||
),
|
),
|
||||||
|
|
||||||
getsubItem(
|
// getsubItem(
|
||||||
'Settlement',
|
// 'Settlement',
|
||||||
`${subDirectory}setting/Settlement`,
|
// `${subDirectory}setting/Settlement`,
|
||||||
null,
|
// null,
|
||||||
[
|
// [
|
||||||
getsubItem(
|
// getsubItem(
|
||||||
'Tips',
|
// 'Tips',
|
||||||
`${subDirectory}report/tipamountsettlementlist`
|
// `${subDirectory}report/tipamountsettlementlist`
|
||||||
),
|
// ),
|
||||||
getsubItem(
|
// getsubItem(
|
||||||
'Incentive',
|
// 'Incentive',
|
||||||
`${subDirectory}report/EmployeeSettlement`
|
// `${subDirectory}report/EmployeeSettlement`
|
||||||
),
|
// ),
|
||||||
]
|
// ]
|
||||||
),
|
// ),
|
||||||
|
getsubItem('Settlement', `${subDirectory}report/Settlement`),
|
||||||
!iswarehouse &&
|
!iswarehouse &&
|
||||||
getsubItem('Others', `${subDirectory}cancelReschedule`, null, [
|
getsubItem('Others', `${subDirectory}cancelReschedule`, null, [
|
||||||
getsubItem(
|
getsubItem(
|
||||||
|
|
@ -2401,21 +2404,22 @@ const AppPage = () => {
|
||||||
),
|
),
|
||||||
|
|
||||||
!sportsAppPreference &&
|
!sportsAppPreference &&
|
||||||
getsubItem(
|
// getsubItem(
|
||||||
'Settlement',
|
// 'Settlement',
|
||||||
`${subDirectory}setting/Settlement`,
|
// `${subDirectory}setting/Settlement`,
|
||||||
null,
|
// null,
|
||||||
[
|
// [
|
||||||
getsubItem(
|
// getsubItem(
|
||||||
'Tips',
|
// 'Tips',
|
||||||
`${subDirectory}report/tipamountsettlementlist`
|
// `${subDirectory}report/tipamountsettlementlist`
|
||||||
),
|
// ),
|
||||||
getsubItem(
|
// getsubItem(
|
||||||
'Incentive',
|
// 'Incentive',
|
||||||
`${subDirectory}report/EmployeeSettlement`
|
// `${subDirectory}report/EmployeeSettlement`
|
||||||
),
|
// ),
|
||||||
]
|
// ]
|
||||||
),
|
// ),
|
||||||
|
getsubItem('Settlement', `${subDirectory}report/Settlement`),
|
||||||
!iswarehouse &&
|
!iswarehouse &&
|
||||||
getsubItem('Others', `${subDirectory}cancelReschedule`, null, [
|
getsubItem('Others', `${subDirectory}cancelReschedule`, null, [
|
||||||
getsubItem(
|
getsubItem(
|
||||||
|
|
|
||||||
|
|
@ -397,10 +397,11 @@ const AutomatedReorder = ({ formType = 'add' }) => {
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
|
|
||||||
<DropDowns
|
<DropDowns
|
||||||
label={<label className="required">Product</label>}
|
label={<label className="required">Product</label>}
|
||||||
options={products?.map((item) => ({
|
options={products?.map((item) => ({
|
||||||
label: item?.ProdName,
|
label: `${item?.ProdName} (${item?.UOMName})`,
|
||||||
value: item?.ProdId,
|
value: item?.ProdId,
|
||||||
variantDtls: item?.ProdVariantPriceDetails,
|
variantDtls: item?.ProdVariantPriceDetails,
|
||||||
CheapestStatus: item?.CheapestStatus,
|
CheapestStatus: item?.CheapestStatus,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
height: 90vh;
|
height: 90vh;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
font-family: 'Poppins';
|
font-family: "Poppins";
|
||||||
|
|
||||||
.automated-reorder-content {
|
.automated-reorder-content {
|
||||||
padding-top: 18px;
|
padding-top: 18px;
|
||||||
|
|
@ -52,3 +52,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.automated-reorder-list-content {
|
||||||
|
.eyeopenShow {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,32 @@
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from 'react-redux';
|
||||||
import { getSession } from "../../Services/Others";
|
import { getSession } from '../../Services/Others';
|
||||||
import { changeBreadCrumb, getEmpAccess } from "../../Features/AppPage/CenterPage";
|
import {
|
||||||
import { Messages } from "../../Components/Notifications/Messages";
|
changeBreadCrumb,
|
||||||
import { Tables } from "../../Components/Tables/Table";
|
getEmpAccess,
|
||||||
import FormHeader from "../PageComponents/FormHeader";
|
} from '../../Features/AppPage/CenterPage';
|
||||||
import Search from "../../Components/Forms/Search";
|
import { Messages } from '../../Components/Notifications/Messages';
|
||||||
import Buttons from "../../Components/Forms/Buttons";
|
import { Tables } from '../../Components/Tables/Table';
|
||||||
|
import FormHeader from '../PageComponents/FormHeader';
|
||||||
|
import Search from '../../Components/Forms/Search';
|
||||||
|
import Buttons from '../../Components/Forms/Buttons';
|
||||||
import {
|
import {
|
||||||
EditFilled,
|
EditFilled,
|
||||||
DeleteFilled,
|
DeleteFilled,
|
||||||
PlusOutlined,
|
PlusOutlined,
|
||||||
ReloadOutlined,
|
ReloadOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
import { useLocation, useNavigate } from 'react-router-dom';
|
||||||
import { Space, Tooltip } from "antd";
|
import { Space, Tooltip } from 'antd';
|
||||||
import { deleteAutomatedReorder, getAutomatedReorderList } from "../../Features/PurchaseOrder/PurchaseOrder";
|
import {
|
||||||
import { DefaultModal } from "../../Components/Modal/DefaultModal";
|
deleteAutomatedReorder,
|
||||||
import { FaRegEye } from "react-icons/fa";
|
getAutomatedReorderList,
|
||||||
import { render } from "react-dom";
|
} from '../../Features/PurchaseOrder/PurchaseOrder';
|
||||||
import { useAuth } from "../../AuthContext";
|
import { DefaultModal } from '../../Components/Modal/DefaultModal';
|
||||||
import "./AutomatedReorder.scss";
|
import { FaRegEye } from 'react-icons/fa';
|
||||||
|
import { render } from 'react-dom';
|
||||||
|
import { useAuth } from '../../AuthContext';
|
||||||
|
import './AutomatedReorder.scss';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
|
|
||||||
|
|
@ -35,8 +41,6 @@ const items = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const AutomatedReorderList = () => {
|
const AutomatedReorderList = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
@ -62,7 +66,6 @@ const AutomatedReorderList = () => {
|
||||||
const [supplierRecordIndex, setSupplierRecordIndex] = useState(null);
|
const [supplierRecordIndex, setSupplierRecordIndex] = useState(null);
|
||||||
const [page, setPage] = useState(1);
|
const [page, setPage] = useState(1);
|
||||||
|
|
||||||
|
|
||||||
const [searchedText, setSearchedText] = useState('');
|
const [searchedText, setSearchedText] = useState('');
|
||||||
const [tableData, setTableData] = useState([]);
|
const [tableData, setTableData] = useState([]);
|
||||||
|
|
||||||
|
|
@ -79,6 +82,7 @@ const AutomatedReorderList = () => {
|
||||||
title: 'Product Name',
|
title: 'Product Name',
|
||||||
dataIndex: 'ProdName',
|
dataIndex: 'ProdName',
|
||||||
key: 'ProdName',
|
key: 'ProdName',
|
||||||
|
render: (_, record) => `${record.ProdName} (${record.UOMName})`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Supplier',
|
title: 'Supplier',
|
||||||
|
|
@ -88,7 +92,7 @@ const AutomatedReorderList = () => {
|
||||||
render: (_, record, index) => (
|
render: (_, record, index) => (
|
||||||
// <div className="productMasterImageUpload">
|
// <div className="productMasterImageUpload">
|
||||||
<Tooltip title={record.SupplierDetails ? 'View Image' : 'Upload Image'}>
|
<Tooltip title={record.SupplierDetails ? 'View Image' : 'Upload Image'}>
|
||||||
<div>
|
<div className="eyeopenShow">
|
||||||
<FaRegEye
|
<FaRegEye
|
||||||
style={{ background: 'none', cursor: 'pointer' }}
|
style={{ background: 'none', cursor: 'pointer' }}
|
||||||
size={22}
|
size={22}
|
||||||
|
|
@ -107,17 +111,15 @@ const AutomatedReorderList = () => {
|
||||||
title: 'Order Type',
|
title: 'Order Type',
|
||||||
dataIndex: 'OrderType',
|
dataIndex: 'OrderType',
|
||||||
key: 'OrderType',
|
key: 'OrderType',
|
||||||
render: (_, record, index) => (
|
render: (_, record, index) =>
|
||||||
record.OrderType === 'E' ? 'End of Day (EOD)' : 'Immediate'
|
record.OrderType === 'E' ? 'End of Day (EOD)' : 'Immediate',
|
||||||
)
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Confirmation Type',
|
title: 'Confirmation Type',
|
||||||
dataIndex: 'OrderProcessing',
|
dataIndex: 'OrderProcessing',
|
||||||
key: 'OrderProcessing',
|
key: 'OrderProcessing',
|
||||||
render: (_, record, index) => (
|
render: (_, record, index) =>
|
||||||
record.OrderProcessing === 'Y' ? 'Need Confirmation' : 'Auto'
|
record.OrderProcessing === 'Y' ? 'Need Confirmation' : 'Auto',
|
||||||
)
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Reorder Quantity',
|
title: 'Reorder Quantity',
|
||||||
|
|
@ -131,10 +133,17 @@ const AutomatedReorderList = () => {
|
||||||
key: 'Action',
|
key: 'Action',
|
||||||
width: '100px',
|
width: '100px',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render: (_, record, index) => (
|
render: (_, record, index) =>
|
||||||
|
|
||||||
record.ActiveStatus === 'A' ? (
|
record.ActiveStatus === 'A' ? (
|
||||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%', gap: '10px' }}>
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
width: '100%',
|
||||||
|
gap: '10px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
<EditFilled
|
<EditFilled
|
||||||
style={{ color: '#1292EE' }}
|
style={{ color: '#1292EE' }}
|
||||||
onClick={() => handleEdit(record)}
|
onClick={() => handleEdit(record)}
|
||||||
|
|
@ -149,7 +158,6 @@ const AutomatedReorderList = () => {
|
||||||
style={{ color: '#52C41A' }}
|
style={{ color: '#52C41A' }}
|
||||||
onClick={() => handleActiveAndDeactive(record)}
|
onClick={() => handleActiveAndDeactive(record)}
|
||||||
/>
|
/>
|
||||||
)
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
@ -160,21 +168,21 @@ const AutomatedReorderList = () => {
|
||||||
dataIndex: 'SLNO',
|
dataIndex: 'SLNO',
|
||||||
key: 'SLNO',
|
key: 'SLNO',
|
||||||
width: '10%',
|
width: '10%',
|
||||||
render: (_, record, index) => index + 1
|
render: (_, record, index) => index + 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Supplier Name',
|
title: 'Supplier Name',
|
||||||
dataIndex: 'SuppName',
|
dataIndex: 'SuppName',
|
||||||
key: 'SuppName',
|
key: 'SuppName',
|
||||||
width: '20%',
|
width: '20%',
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
try {
|
try {
|
||||||
if (AppId && CompId && BranchId) {
|
if (AppId && CompId && BranchId) {
|
||||||
dispatch(changeBreadCrumb({ items: items }));
|
dispatch(changeBreadCrumb({ items: items }));
|
||||||
fetchData()
|
fetchData();
|
||||||
if (state?.Notify) {
|
if (state?.Notify) {
|
||||||
setMessageType(state?.Notify.messageType);
|
setMessageType(state?.Notify.messageType);
|
||||||
setMessageData(state?.Notify.messageData);
|
setMessageData(state?.Notify.messageData);
|
||||||
|
|
@ -221,16 +229,18 @@ const AutomatedReorderList = () => {
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await dispatch(getAutomatedReorderList({ AppId, CompId, BranchId }))?.unwrap();
|
const res = await dispatch(
|
||||||
|
getAutomatedReorderList({ AppId, CompId, BranchId })
|
||||||
|
)?.unwrap();
|
||||||
if (res?.data?.statusCode === 1 && res?.data?.data?.length > 0) {
|
if (res?.data?.statusCode === 1 && res?.data?.data?.length > 0) {
|
||||||
setTableData(res?.data?.data)
|
setTableData(res?.data?.data);
|
||||||
} else {
|
} else {
|
||||||
setTableData([])
|
setTableData([]);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error, 'error: getAutomatedReorderList');
|
console.error(error, 'error: getAutomatedReorderList');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
const onSearch = (value) => {
|
const onSearch = (value) => {
|
||||||
setSearchedText(value);
|
setSearchedText(value);
|
||||||
|
|
@ -241,26 +251,36 @@ const AutomatedReorderList = () => {
|
||||||
|
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
navigate(`${subDirectory}setting/automated-reorder/new`);
|
navigate(`${subDirectory}setting/automated-reorder/new`);
|
||||||
}
|
};
|
||||||
|
|
||||||
const handleEdit = (record) => {
|
const handleEdit = (record) => {
|
||||||
navigate(`${subDirectory}setting/automated-reorder/update`, {
|
navigate(`${subDirectory}setting/automated-reorder/update`, {
|
||||||
state: {
|
state: {
|
||||||
editstate: record,
|
editstate: record,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
const handleActiveAndDeactive = async (record) => {
|
const handleActiveAndDeactive = async (record) => {
|
||||||
const res = await dispatch(deleteAutomatedReorder({ UniqueId: record?.UniqueId, UpdatedBy: UserId, ActiveStatus: record?.ActiveStatus === 'A' ? 'D' : 'A' }))?.unwrap();
|
const res = await dispatch(
|
||||||
|
deleteAutomatedReorder({
|
||||||
|
UniqueId: record?.UniqueId,
|
||||||
|
UpdatedBy: UserId,
|
||||||
|
ActiveStatus: record?.ActiveStatus === 'A' ? 'D' : 'A',
|
||||||
|
})
|
||||||
|
)?.unwrap();
|
||||||
if (res?.data?.statusCode === 1) {
|
if (res?.data?.statusCode === 1) {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(record?.ActiveStatus === 'A' ? 'Deactivated Successfully' : 'Activated Successfully');
|
setMessageData(
|
||||||
|
record?.ActiveStatus === 'A'
|
||||||
|
? 'Deactivated Successfully'
|
||||||
|
: 'Activated Successfully'
|
||||||
|
);
|
||||||
fetchData();
|
fetchData();
|
||||||
} else {
|
} else {
|
||||||
setMessageType('error');
|
setMessageType('error');
|
||||||
setMessageData(res?.data?.message);
|
setMessageData(res?.data?.message);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
const onComplete = useCallback(() => {
|
const onComplete = useCallback(() => {
|
||||||
setMessageType(null);
|
setMessageType(null);
|
||||||
|
|
@ -311,7 +331,7 @@ const AutomatedReorderList = () => {
|
||||||
onChange: handlePageChange,
|
onChange: handlePageChange,
|
||||||
defaultPageSize: 10,
|
defaultPageSize: 10,
|
||||||
showSizeChanger: false,
|
showSizeChanger: false,
|
||||||
hideOnSinglePage: true
|
hideOnSinglePage: true,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -328,15 +348,12 @@ const AutomatedReorderList = () => {
|
||||||
}}
|
}}
|
||||||
children={
|
children={
|
||||||
<div className="automated-reorder-list-content">
|
<div className="automated-reorder-list-content">
|
||||||
<Tables
|
<Tables columns={supplierColumns} data={supplierRecords} />
|
||||||
columns={supplierColumns}
|
|
||||||
data={supplierRecords}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
export default AutomatedReorderList
|
export default AutomatedReorderList;
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,10 @@ import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLo
|
||||||
import { useDateStore } from '../../../../Features/BookingScreen/BookingData/DateStore.js';
|
import { useDateStore } from '../../../../Features/BookingScreen/BookingData/DateStore.js';
|
||||||
import AddProduct from '../../../../Components/AddProduct/AddProduct.jsx';
|
import AddProduct from '../../../../Components/AddProduct/AddProduct.jsx';
|
||||||
import { MdOutlineAddShoppingCart } from 'react-icons/md';
|
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 ProductPriceChange from '../UtillComponents/ProductPriceChange.jsx';
|
||||||
import ExpireConfirmModal from '../BookingFunctionality/ExpireConfirmModal.jsx';
|
import ExpireConfirmModal from '../BookingFunctionality/ExpireConfirmModal.jsx';
|
||||||
import { calculateOverAllQtyLimit } from '../../../../utils/calculations.js';
|
import { calculateOverAllQtyLimit } from '../../../../utils/calculations.js';
|
||||||
|
|
@ -978,7 +981,6 @@ const BSItemCard = (props) => {
|
||||||
await dispatch(
|
await dispatch(
|
||||||
getOfferinBooking({ AppId: AppId, CompId: CompId, BranchId: BranchId })
|
getOfferinBooking({ AppId: AppId, CompId: CompId, BranchId: BranchId })
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -1056,8 +1058,7 @@ const BSItemCard = (props) => {
|
||||||
if (AppId && CompId && BranchId) {
|
if (AppId && CompId && BranchId) {
|
||||||
fetchedit();
|
fetchedit();
|
||||||
GetmultipleSearchData();
|
GetmultipleSearchData();
|
||||||
getUom()
|
getUom();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// dispatch(changepreOrder(false)); Commented to Add Normal Produts After Adding the Combo Pack !!!!!! Dont Touch Without Shifayath Permission
|
// dispatch(changepreOrder(false)); Commented to Add Normal Produts After Adding the Combo Pack !!!!!! Dont Touch Without Shifayath Permission
|
||||||
|
|
@ -1065,7 +1066,7 @@ const BSItemCard = (props) => {
|
||||||
|
|
||||||
const getUom = () => {
|
const getUom = () => {
|
||||||
dispatch(getUomData());
|
dispatch(getUomData());
|
||||||
}
|
};
|
||||||
|
|
||||||
const GetmultipleSearchData = async () => {
|
const GetmultipleSearchData = async () => {
|
||||||
const data = {
|
const data = {
|
||||||
|
|
@ -6569,7 +6570,6 @@ const BSItemCard = (props) => {
|
||||||
'12px'
|
'12px'
|
||||||
: '12px',
|
: '12px',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
lineHeight: '2',
|
|
||||||
fontFamily: SelectedCardFont
|
fontFamily: SelectedCardFont
|
||||||
? SelectedCardFont
|
? SelectedCardFont
|
||||||
: '',
|
: '',
|
||||||
|
|
@ -6604,7 +6604,6 @@ const BSItemCard = (props) => {
|
||||||
'12px'
|
'12px'
|
||||||
: '12px',
|
: '12px',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
lineHeight: '2',
|
|
||||||
fontFamily: SelectedCardFont
|
fontFamily: SelectedCardFont
|
||||||
? SelectedCardFont
|
? SelectedCardFont
|
||||||
: '',
|
: '',
|
||||||
|
|
@ -7017,7 +7016,6 @@ const BSItemCard = (props) => {
|
||||||
'12px'
|
'12px'
|
||||||
: '12px',
|
: '12px',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
lineHeight: '2',
|
|
||||||
fontFamily: SelectedCardFont
|
fontFamily: SelectedCardFont
|
||||||
? SelectedCardFont
|
? SelectedCardFont
|
||||||
: '',
|
: '',
|
||||||
|
|
@ -7052,7 +7050,6 @@ const BSItemCard = (props) => {
|
||||||
'12px'
|
'12px'
|
||||||
: '12px',
|
: '12px',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
lineHeight: '2',
|
|
||||||
fontFamily: SelectedCardFont
|
fontFamily: SelectedCardFont
|
||||||
? SelectedCardFont
|
? SelectedCardFont
|
||||||
: '',
|
: '',
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,7 @@ import { Radio } from 'antd';
|
||||||
import ReprintPDFDataShare from './ReprintPDFDataShare.jsx';
|
import ReprintPDFDataShare from './ReprintPDFDataShare.jsx';
|
||||||
import { ImShare } from 'react-icons/im';
|
import { ImShare } from 'react-icons/im';
|
||||||
import EmailModel from '../../UtillComponents/EmailModel.jsx';
|
import EmailModel from '../../UtillComponents/EmailModel.jsx';
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
const RetailApiurl = import.meta.env.ENV_API_URL;
|
const RetailApiurl = import.meta.env.ENV_API_URL;
|
||||||
|
|
||||||
|
|
@ -1439,6 +1440,9 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
const typeChange = (e) => {
|
const typeChange = (e) => {
|
||||||
setType(e.target.value);
|
setType(e.target.value);
|
||||||
};
|
};
|
||||||
|
const disabledDate = (current) => {
|
||||||
|
return current && current > dayjs().endOf("day");
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
@ -1492,8 +1496,9 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
<div>
|
<div>
|
||||||
<RangePicker
|
<RangePicker
|
||||||
placeholder={['Start Date', 'End Date']}
|
placeholder={['Start Date', 'End Date']}
|
||||||
format="YYYY-MM-DD"
|
format="DD-MM-YYYY"
|
||||||
onChange={handleDateChange}
|
onChange={handleDateChange}
|
||||||
|
disabledDate={disabledDate}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="bsreprintmodaltable-search">
|
<div className="bsreprintmodaltable-search">
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,8 @@ const SalesDetailsModal = ({ isModalOpen = false,
|
||||||
const SalesNetAmountModal = ({
|
const SalesNetAmountModal = ({
|
||||||
isNetAmtModalOpen = false,
|
isNetAmtModalOpen = false,
|
||||||
setIsNetAmtModalOpen = () => { },
|
setIsNetAmtModalOpen = () => { },
|
||||||
orderDetails = []
|
orderDetails = [],
|
||||||
|
RefundAmt
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<DefaultModal
|
<DefaultModal
|
||||||
|
|
@ -244,6 +245,17 @@ const SalesNetAmountModal = ({
|
||||||
>
|
>
|
||||||
Business UPI
|
Business UPI
|
||||||
</th>
|
</th>
|
||||||
|
<th
|
||||||
|
rowSpan="2"
|
||||||
|
style={{
|
||||||
|
border: '1px solid #ddd',
|
||||||
|
padding: '10px',
|
||||||
|
backgroundColor: '#055ec0',
|
||||||
|
color: '#fff',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Refund Amt
|
||||||
|
</th>
|
||||||
<th
|
<th
|
||||||
rowSpan="2"
|
rowSpan="2"
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -403,6 +415,17 @@ const SalesNetAmountModal = ({
|
||||||
>
|
>
|
||||||
{item.BusinessUpiAmount}
|
{item.BusinessUpiAmount}
|
||||||
</td>
|
</td>
|
||||||
|
<td
|
||||||
|
style={{
|
||||||
|
border: '1px solid #ddd',
|
||||||
|
padding: '8px',
|
||||||
|
fontWeight: '700',
|
||||||
|
// backgroundColor: '#eaf6ea',
|
||||||
|
// color: '#2e7d32',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{RefundAmt}
|
||||||
|
</td>
|
||||||
<td
|
<td
|
||||||
style={{
|
style={{
|
||||||
border: '1px solid #ddd',
|
border: '1px solid #ddd',
|
||||||
|
|
@ -412,7 +435,7 @@ const SalesNetAmountModal = ({
|
||||||
color: '#2e7d32',
|
color: '#2e7d32',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{total}
|
{total-RefundAmt}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,8 @@ const BSBillingTable2 = lazy(
|
||||||
() =>
|
() =>
|
||||||
import('../../Components/BSBillingTables/BSBillingTable2/BSBillingTable2')
|
import('../../Components/BSBillingTables/BSBillingTable2/BSBillingTable2')
|
||||||
);
|
);
|
||||||
const BSBillingTable3 = lazy(
|
|
||||||
() =>
|
import BSBillingTable3 from '../../Components/BSBillingTables/BSBillingTable3/BSBillingTable3overall';
|
||||||
import('../../Components/BSBillingTables/BSBillingTable3/BSBillingTable3overall')
|
|
||||||
);
|
|
||||||
|
|
||||||
import { dynamicComponentProps } from '../DynamicComponentProps.js';
|
import { dynamicComponentProps } from '../DynamicComponentProps.js';
|
||||||
import {
|
import {
|
||||||
|
|
@ -95,16 +93,10 @@ const BSOtherServicesVerticalcat = lazy(
|
||||||
() => import('../../Components/BSCategories/BSOtherServicesVerticalcat.jsx')
|
() => import('../../Components/BSCategories/BSOtherServicesVerticalcat.jsx')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const SalesCountForStandard = lazy(
|
const SalesCountForStandard = lazy(
|
||||||
() => import('../SalesCountForStandard.jsx')
|
() => import('../SalesCountForStandard.jsx')
|
||||||
);
|
);
|
||||||
|
|
||||||
const StandardTable = lazy(
|
|
||||||
() =>
|
|
||||||
import('../../Components/BSBillingTables/StandardTable/StandardTable.jsx')
|
|
||||||
);
|
|
||||||
|
|
||||||
const ComboSalesBillTable = lazy(
|
const ComboSalesBillTable = lazy(
|
||||||
() =>
|
() =>
|
||||||
import('../../Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx')
|
import('../../Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx')
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,8 @@ const SalesCountComponent = React.memo(
|
||||||
// Destructure to simplify access to required values
|
// Destructure to simplify access to required values
|
||||||
console.log(
|
console.log(
|
||||||
BookingNavbar,
|
BookingNavbar,
|
||||||
'BookingNavbarBookingNavbar'
|
'BookingNavbarBookingNavbar',
|
||||||
|
GlobalsalesDetailData
|
||||||
);
|
);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|
@ -81,6 +82,7 @@ const SalesCountComponent = React.memo(
|
||||||
SelfTakeAwayAmount,
|
SelfTakeAwayAmount,
|
||||||
SelfDineInAmount,
|
SelfDineInAmount,
|
||||||
PreOrderAmount,
|
PreOrderAmount,
|
||||||
|
RefundAmt
|
||||||
} = GlobalsalesDetailData.length > 0 ? GlobalsalesDetailData[0] : {};
|
} = GlobalsalesDetailData.length > 0 ? GlobalsalesDetailData[0] : {};
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
@ -91,7 +93,7 @@ const SalesCountComponent = React.memo(
|
||||||
const templateData = useSelector(getTemplateData);
|
const templateData = useSelector(getTemplateData);
|
||||||
const preferencedata = useSelector(PreferenceData);
|
const preferencedata = useSelector(PreferenceData);
|
||||||
|
|
||||||
console.log(preferencedata, 'preferencedatasalescount');
|
console.log(dailySalesData, 'preferencedatasalescount');
|
||||||
const bookingTypePreference = appPreferences?.find(
|
const bookingTypePreference = appPreferences?.find(
|
||||||
(preference) => preference?.PreferredCatName === 'Booking Type'
|
(preference) => preference?.PreferredCatName === 'Booking Type'
|
||||||
)?.PreferenceCatDetails;
|
)?.PreferenceCatDetails;
|
||||||
|
|
@ -686,6 +688,7 @@ const SalesCountComponent = React.memo(
|
||||||
isNetAmtModalOpen={isNetAmtModalOpen}
|
isNetAmtModalOpen={isNetAmtModalOpen}
|
||||||
setIsNetAmtModalOpen={setIsNetAmtModalOpen}
|
setIsNetAmtModalOpen={setIsNetAmtModalOpen}
|
||||||
orderDetails={orderDetails}
|
orderDetails={orderDetails}
|
||||||
|
RefundAmt={RefundAmt}
|
||||||
/>
|
/>
|
||||||
<Tooltip title="Receive Stock">
|
<Tooltip title="Receive Stock">
|
||||||
{TableData?.length > 0 && AutoReceiveStock && (
|
{TableData?.length > 0 && AutoReceiveStock && (
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,7 @@ import { Messages } from '../../Components/Notifications/Messages';
|
||||||
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
|
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
|
||||||
import { useAuth } from '../../AuthContext.jsx';
|
import { useAuth } from '../../AuthContext.jsx';
|
||||||
import { getPreferenceData } from '../../Features/BookingScreen/BookingData/BookingData.js';
|
import { getPreferenceData } from '../../Features/BookingScreen/BookingData/BookingData.js';
|
||||||
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
|
|
@ -71,7 +70,6 @@ const CustomerMaster = () => {
|
||||||
const [addnewAccess, setaddnewAccess] = useState(true);
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
const [allowDecimal, setAllowDecimal] = useState(false);
|
const [allowDecimal, setAllowDecimal] = useState(false);
|
||||||
|
|
||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
if (location?.state?.Notiffy) {
|
if (location?.state?.Notiffy) {
|
||||||
setMessageType(location?.state?.Notiffy.messageType);
|
setMessageType(location?.state?.Notiffy.messageType);
|
||||||
|
|
@ -155,13 +153,22 @@ const CustomerMaster = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId, UserId: UserId };
|
const data = {
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
AppId: AppId,
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
UserId: UserId,
|
||||||
|
};
|
||||||
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
|
(setting) =>
|
||||||
|
setting?.SettingIdName?.toLowerCase() === 'decimal' &&
|
||||||
|
setting?.SettingValue === 'Y'
|
||||||
|
);
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
setAllowDecimal(true)
|
setAllowDecimal(true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
//Delete
|
//Delete
|
||||||
const statusFormatter = async (row) => {
|
const statusFormatter = async (row) => {
|
||||||
|
|
@ -251,7 +258,8 @@ const CustomerMaster = () => {
|
||||||
width: '100px',
|
width: '100px',
|
||||||
render: (text, row) => (
|
render: (text, row) => (
|
||||||
<a style={{ color: 'black', width: '200px' }}>
|
<a style={{ color: 'black', width: '200px' }}>
|
||||||
{(row?.CustName ? (row?.CustName + ' ') : '') + (row?.CustShortName || "") || row?.CustMobile}
|
{(row?.CustName ? row?.CustName + ' ' : '') +
|
||||||
|
(row?.CustShortName || '') || row?.CustMobile}
|
||||||
</a>
|
</a>
|
||||||
),
|
),
|
||||||
filteredValue: [searchedText],
|
filteredValue: [searchedText],
|
||||||
|
|
@ -260,8 +268,12 @@ const CustomerMaster = () => {
|
||||||
String(record.CustShortName)
|
String(record.CustShortName)
|
||||||
?.toLowerCase()
|
?.toLowerCase()
|
||||||
?.includes(value?.toLowerCase()) ||
|
?.includes(value?.toLowerCase()) ||
|
||||||
String(record.CustName)?.toLowerCase()?.includes(value?.toLowerCase()) ||
|
String(record.CustName)
|
||||||
String(record.CustMobile)?.toLowerCase()?.includes(value?.toLowerCase())
|
?.toLowerCase()
|
||||||
|
?.includes(value?.toLowerCase()) ||
|
||||||
|
String(record.CustMobile)
|
||||||
|
?.toLowerCase()
|
||||||
|
?.includes(value?.toLowerCase())
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
sorter: (a, b) => a?.CustName?.length - b?.CustName?.length,
|
sorter: (a, b) => a?.CustName?.length - b?.CustName?.length,
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
const [brId, setBrId] = useState(getSession('BranchId'));
|
const [brId, setBrId] = useState(getSession('BranchId'));
|
||||||
const [AppId, setAppId] = useState(getSession('AppId'));
|
const [AppId, setAppId] = useState(getSession('AppId'));
|
||||||
const [AdminUserId, setAdminUserId] = useState(getSession('UserId'));
|
const [AdminUserId, setAdminUserId] = useState(getSession('UserId'));
|
||||||
const [ImageUrl, setImageUrl] = useState(null);
|
const [ProfileImageUrl, setProfileImageUrl] = useState(null);
|
||||||
const [EmpTypeDropDownData, setEmpTypeDropDownData] = useState([]);
|
const [EmpTypeDropDownData, setEmpTypeDropDownData] = useState([]);
|
||||||
const [seletedEmpTypeDrop, setseletedEmpTypeDrop] = useState(null);
|
const [seletedEmpTypeDrop, setseletedEmpTypeDrop] = useState(null);
|
||||||
const [EmpDesgDropDownData, setEmpDesgDropDownData] = useState([]);
|
const [EmpDesgDropDownData, setEmpDesgDropDownData] = useState([]);
|
||||||
|
|
@ -132,8 +132,8 @@ const EmployeeForm = ({ formType }) => {
|
||||||
postData['EmpDOJ'] = moment(SelectedDate).format('YYYY-MM-DD');
|
postData['EmpDOJ'] = moment(SelectedDate).format('YYYY-MM-DD');
|
||||||
postData['BranchId'] = brId;
|
postData['BranchId'] = brId;
|
||||||
postData['MobileAppAccess'] = SelectedMobApp ? SelectedMobApp : 'N';
|
postData['MobileAppAccess'] = SelectedMobApp ? SelectedMobApp : 'N';
|
||||||
postData['EmpPhotoLink'] = ImageUrl
|
postData['EmpPhotoLink'] = ProfileImageUrl
|
||||||
? ImageUrl
|
? ProfileImageUrl
|
||||||
: 'https://api.pozo.app/pozo-common-image-api/upload?fileId=655c9e25fe20def9916edf1f.png';
|
: 'https://api.pozo.app/pozo-common-image-api/upload?fileId=655c9e25fe20def9916edf1f.png';
|
||||||
// postData["Description"]=form?.getFieldValue("coachQualifications"),
|
// postData["Description"]=form?.getFieldValue("coachQualifications"),
|
||||||
// postData["Certification"]=form?.getFieldValue("coachQualifications"),
|
// postData["Certification"]=form?.getFieldValue("coachQualifications"),
|
||||||
|
|
@ -143,8 +143,8 @@ const EmployeeForm = ({ formType }) => {
|
||||||
// "Experience": form?.getFieldValue("coachExperience"),
|
// "Experience": form?.getFieldValue("coachExperience"),
|
||||||
postData['ImageDetails'] =
|
postData['ImageDetails'] =
|
||||||
(imageUrls || [])
|
(imageUrls || [])
|
||||||
.filter((item) => item && (item.image || item.name))
|
?.filter((item) => item && (item.image || item.name))
|
||||||
.map((item, index) => ({
|
?.map((item, index) => ({
|
||||||
ImageUrl: item.image || '',
|
ImageUrl: item.image || '',
|
||||||
ImageType: item.name || '',
|
ImageType: item.name || '',
|
||||||
// ImageType: "Coach",
|
// ImageType: "Coach",
|
||||||
|
|
@ -202,9 +202,17 @@ const EmployeeForm = ({ formType }) => {
|
||||||
setseletedEmpDeptDrop(editstate?.EmpDept);
|
setseletedEmpDeptDrop(editstate?.EmpDept);
|
||||||
setseletedShiftDrop(editstate?.EmpShiftId);
|
setseletedShiftDrop(editstate?.EmpShiftId);
|
||||||
setSelectedDate(editstate?.EmpDOJ);
|
setSelectedDate(editstate?.EmpDOJ);
|
||||||
setImageUrl(editstate?.EmpPhotoLink);
|
setProfileImageUrl(editstate?.EmpPhotoLink);
|
||||||
setSelectedLatitude(editstate?.Latitude);
|
setSelectedLatitude(editstate?.Latitude);
|
||||||
setSelectedLongitude(editstate?.Longitude);
|
setSelectedLongitude(editstate?.Longitude);
|
||||||
|
if (editstate?.ImageDetails?.length > 0) {
|
||||||
|
setImageUrls(
|
||||||
|
editstate.ImageDetails.map((img) => ({
|
||||||
|
image: img.ImageUrl || '',
|
||||||
|
name: img.ImageType || '',
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
}
|
||||||
formRef.current?.setFieldsValue({
|
formRef.current?.setFieldsValue({
|
||||||
EmpDOJ: moment(editstate?.EmpDOJ),
|
EmpDOJ: moment(editstate?.EmpDOJ),
|
||||||
});
|
});
|
||||||
|
|
@ -245,8 +253,6 @@ const EmployeeForm = ({ formType }) => {
|
||||||
};
|
};
|
||||||
return copy;
|
return copy;
|
||||||
});
|
});
|
||||||
|
|
||||||
setImageUrl(url);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateImageName = (name, index = 0) => {
|
const updateImageName = (name, index = 0) => {
|
||||||
|
|
@ -672,7 +678,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
// seletedEmpTypeDrop
|
// seletedEmpTypeDrop
|
||||||
|
|
||||||
const updateImageUrl = (url) => {
|
const updateImageUrl = (url) => {
|
||||||
setImageUrl(url);
|
setProfileImageUrl(url);
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectValue = async (e) => {
|
const selectValue = async (e) => {
|
||||||
|
|
@ -1242,7 +1248,7 @@ const EmployeeForm = ({ formType }) => {
|
||||||
formType === 'edit'
|
formType === 'edit'
|
||||||
? editstate?.EmpPhotoLink
|
? editstate?.EmpPhotoLink
|
||||||
: formRef.current?.getFieldsValue()
|
: formRef.current?.getFieldsValue()
|
||||||
?.UserImage || ImageUrl;
|
?.UserImage || ProfileImageUrl;
|
||||||
// Always return a string
|
// Always return a string
|
||||||
return typeof link === 'string' ? link : '';
|
return typeof link === 'string' ? link : '';
|
||||||
})()}
|
})()}
|
||||||
|
|
@ -1624,11 +1630,10 @@ const EmployeeForm = ({ formType }) => {
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<div className="sports-masterimage">
|
<div className="sports-masterimage">
|
||||||
{Array.from({
|
{Array?.from({
|
||||||
length: Math.max(1, imageUrls.length),
|
length: Math.max(1, (imageUrls ?? []).length),
|
||||||
}).map((_, idx) => (
|
})?.map((_, idx) => (
|
||||||
<div key={idx} style={{ marginBottom: 12 }}>
|
<div key={idx} style={{ marginBottom: 12 }}>
|
||||||
<div style={{ width: 'max-content' }}>
|
<div style={{ width: 'max-content' }}>
|
||||||
<CropUpload
|
<CropUpload
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@ import { changeBookingType } from '../../../Features/BookingScreen/BookingData/K
|
||||||
import initialBg from '../../../Images/InitialPage1bgImg.png';
|
import initialBg from '../../../Images/InitialPage1bgImg.png';
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
import { isMobile } from 'react-device-detect';
|
import { isMobile } from 'react-device-detect';
|
||||||
|
import { PreferenceData } from '../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
|
import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin';
|
||||||
|
|
||||||
const InitialPage1 = (props) => {
|
const InitialPage1 = (props) => {
|
||||||
const actionContainerRef = useRef(null);
|
const actionContainerRef = useRef(null);
|
||||||
|
|
@ -20,7 +22,11 @@ const InitialPage1 = (props) => {
|
||||||
const getKioskCompLogodata = useSelector(getKioskCompLogo);
|
const getKioskCompLogodata = useSelector(getKioskCompLogo);
|
||||||
const getKioskBackgroundimgdata = useSelector(getKioskBackgroundimg);
|
const getKioskBackgroundimgdata = useSelector(getKioskBackgroundimg);
|
||||||
const SalesType = useSelector(globalSalesType);
|
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) => {
|
const FlowChange = async (event, eventName) => {
|
||||||
await dispatch(changeKioskPageName(event));
|
await dispatch(changeKioskPageName(event));
|
||||||
await dispatch(changeBookingType(eventName));
|
await dispatch(changeBookingType(eventName));
|
||||||
|
|
@ -96,7 +102,7 @@ const InitialPage1 = (props) => {
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div ref={actionContainerRef}>
|
<div ref={actionContainerRef}>
|
||||||
{(SalesType === 'D' || SalesType === 'B') && (
|
{((SalesType === 'D' || SalesType === 'B') && dineInPreference && dineInAppPreference) && (
|
||||||
<div
|
<div
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
FlowChange('categoryPage', 'Dine In');
|
FlowChange('categoryPage', 'Dine In');
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ import {
|
||||||
import '../../../Styles/Kiosk/InitialPage/InitialPage2.scss';
|
import '../../../Styles/Kiosk/InitialPage/InitialPage2.scss';
|
||||||
import { changeBookingType } from '../../../Features/BookingScreen/BookingData/KioskBookingData';
|
import { changeBookingType } from '../../../Features/BookingScreen/BookingData/KioskBookingData';
|
||||||
import initialBg from '../../../Images/theme3bgimg.png';
|
import initialBg from '../../../Images/theme3bgimg.png';
|
||||||
|
import { PreferenceData } from '../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
|
import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin';
|
||||||
|
|
||||||
const InitialPage2 = (props) => {
|
const InitialPage2 = (props) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
@ -17,6 +19,12 @@ const InitialPage2 = (props) => {
|
||||||
const getKioskBranchNamedata = useSelector(getKioskBranchName);
|
const getKioskBranchNamedata = useSelector(getKioskBranchName);
|
||||||
const getKioskBackgroundimgdata = useSelector(getKioskBackgroundimg);
|
const getKioskBackgroundimgdata = useSelector(getKioskBackgroundimg);
|
||||||
const SalesType = useSelector(globalSalesType);
|
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) => {
|
const FlowChange = async (event, eventName) => {
|
||||||
await dispatch(changeKioskPageName(event));
|
await dispatch(changeKioskPageName(event));
|
||||||
await dispatch(changeBookingType(eventName));
|
await dispatch(changeBookingType(eventName));
|
||||||
|
|
@ -78,7 +86,7 @@ const InitialPage2 = (props) => {
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="InitialPage2-dinein-takeaway-div">
|
<div className="InitialPage2-dinein-takeaway-div">
|
||||||
{(SalesType === 'D' || SalesType === 'B') && (
|
{((SalesType === 'D' || SalesType === 'B') && dineInPreference && dineInAppPreference) && (
|
||||||
<div
|
<div
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
FlowChange('categoryPage', 'Dine In');
|
FlowChange('categoryPage', 'Dine In');
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ import {
|
||||||
getKioskOfferType,
|
getKioskOfferType,
|
||||||
} from '../../../Features/Kiosk/kiosk';
|
} from '../../../Features/Kiosk/kiosk';
|
||||||
import { changeBookingType } from '../../../Features/BookingScreen/BookingData/KioskBookingData';
|
import { changeBookingType } from '../../../Features/BookingScreen/BookingData/KioskBookingData';
|
||||||
|
import { PreferenceData } from '../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
|
import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin';
|
||||||
|
|
||||||
const InitialPage3 = (props) => {
|
const InitialPage3 = (props) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
@ -40,6 +42,12 @@ const InitialPage3 = (props) => {
|
||||||
const getKioskOfferContent3Data = useSelector(getKioskOfferContent3);
|
const getKioskOfferContent3Data = useSelector(getKioskOfferContent3);
|
||||||
const getKioskOfferValueData = useSelector(getKioskOfferValue);
|
const getKioskOfferValueData = useSelector(getKioskOfferValue);
|
||||||
const getKioskOfferTypeData = useSelector(getKioskOfferType);
|
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) => {
|
const FlowChange = async (event, eventName) => {
|
||||||
await dispatch(changeKioskPageName(event));
|
await dispatch(changeKioskPageName(event));
|
||||||
|
|
@ -424,7 +432,7 @@ const InitialPage3 = (props) => {
|
||||||
{/* <h1>ORDER HERE</h1> */}
|
{/* <h1>ORDER HERE</h1> */}
|
||||||
<h5>Skip the Queue line & order now for instant service!</h5>
|
<h5>Skip the Queue line & order now for instant service!</h5>
|
||||||
<div className="InitialPage3-button-container">
|
<div className="InitialPage3-button-container">
|
||||||
{(SalesType === 'D' || SalesType === 'B') && (
|
{((SalesType === 'D' || SalesType === 'B') && dineInPreference && dineInAppPreference) && (
|
||||||
<button
|
<button
|
||||||
style={{ backgroundColor: getKioskDarkColourdata }}
|
style={{ backgroundColor: getKioskDarkColourdata }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,20 @@ import dinein from '../../../Images/dinein.png';
|
||||||
import TakeAway from '../../../Images/TakeAway.png';
|
import TakeAway from '../../../Images/TakeAway.png';
|
||||||
|
|
||||||
import DefaultBgimg from '../../../Images/theme3bgimg.png';
|
import DefaultBgimg from '../../../Images/theme3bgimg.png';
|
||||||
|
import { PreferenceData } from '../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
|
import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin';
|
||||||
const SelfInitialPage1 = (props) => {
|
const SelfInitialPage1 = (props) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const getKioskBranchNamedata = useSelector(getKioskBranchName);
|
const getKioskBranchNamedata = useSelector(getKioskBranchName);
|
||||||
const getKioskCompLogodata = useSelector(getKioskCompLogo);
|
const getKioskCompLogodata = useSelector(getKioskCompLogo);
|
||||||
const getKioskBackgroundimgdata = useSelector(getKioskBackgroundimg);
|
const getKioskBackgroundimgdata = useSelector(getKioskBackgroundimg);
|
||||||
const SalesType = useSelector(globalSalesType);
|
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';
|
||||||
|
|
||||||
console.log(SalesType, 'SalesType');
|
console.log(SalesType, 'SalesType');
|
||||||
const FlowChange = async (event, eventName) => {
|
const FlowChange = async (event, eventName) => {
|
||||||
await dispatch(changeKioskPageName(event));
|
await dispatch(changeKioskPageName(event));
|
||||||
|
|
@ -56,7 +64,7 @@ const SelfInitialPage1 = (props) => {
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{(SalesType === 'D' || SalesType === 'B') && (
|
{((SalesType === 'D' || SalesType === 'B') && dineInPreference && dineInAppPreference) && (
|
||||||
<div
|
<div
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
FlowChange('categoryPage', 'Dine In');
|
FlowChange('categoryPage', 'Dine In');
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import React, { useState, useRef, useEffect, useContext } from 'react';
|
import React, { useState, useRef, useEffect, useContext } from 'react';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
// import { read, utils } from 'xlsx';
|
|
||||||
import ExcelJS from 'exceljs';
|
import ExcelJS from 'exceljs';
|
||||||
import { Table, Form, Input, Tooltip, Modal, Select } from 'antd';
|
import { Table, Form, Input, Tooltip, Modal, Select } from 'antd';
|
||||||
import {
|
import {
|
||||||
|
|
@ -18,7 +17,6 @@ import {
|
||||||
getFieldSetupData,
|
getFieldSetupData,
|
||||||
} from '../../Features/ProductPage/ProductPage.js';
|
} from '../../Features/ProductPage/ProductPage.js';
|
||||||
import Imageupload from '../../Components/Forms/Upload.jsx';
|
import Imageupload from '../../Components/Forms/Upload.jsx';
|
||||||
import { BiSolidFileExport } from 'react-icons/bi';
|
|
||||||
import { CiExport } from 'react-icons/ci';
|
import { CiExport } from 'react-icons/ci';
|
||||||
|
|
||||||
import { uploadImage } from '../../Features/upload/upload.js';
|
import { uploadImage } from '../../Features/upload/upload.js';
|
||||||
|
|
@ -617,15 +615,20 @@ const ProductExcel = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(tableFieldPreferences, 'tableFieldPreferences');
|
console.log(tableFieldPreferences, 'tableFieldPreferences');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (excelData && excelData?.length > 0) {
|
if (excelData && excelData?.length > 0) {
|
||||||
let ExecelToJsConvertion = [];
|
let ExecelToJsConvertion = [];
|
||||||
let slicedData = excelData?.slice(1);
|
let slicedData = excelData?.slice(1);
|
||||||
let filteredData = slicedData?.filter(
|
let filteredData = slicedData?.filter((item) => {
|
||||||
(item) => item?.[item?.length - 1]?.trim() !== 'sample row'
|
const values = Object.values(item || {});
|
||||||
);
|
const lastVal = values[values.length - 1];
|
||||||
|
return typeof lastVal === 'string'
|
||||||
|
? lastVal.trim() !== 'sample row'
|
||||||
|
: true;
|
||||||
|
});
|
||||||
filteredData?.map((item, index) => {
|
filteredData?.map((item, index) => {
|
||||||
ExecelToJsConvertion.push({
|
ExecelToJsConvertion?.push({
|
||||||
key: index,
|
key: index,
|
||||||
ProductName: item?.['0'],
|
ProductName: item?.['0'],
|
||||||
Quantity: item?.['1'],
|
Quantity: item?.['1'],
|
||||||
|
|
@ -1005,112 +1008,6 @@ const ProductExcel = ({
|
||||||
reader.readAsArrayBuffer(file);
|
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(() => {
|
useEffect(() => {
|
||||||
imagecall();
|
imagecall();
|
||||||
addOnlineImage();
|
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
|
// Add empty rows for data entry
|
||||||
for (let i = 1; i <= 1000; i++) {
|
for (let i = 1; i <= 1000; i++) {
|
||||||
worksheet.addRow({});
|
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) => {
|
const handleFileSubmit = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (excelFile === null) {
|
if (excelFile === null) {
|
||||||
|
|
@ -2883,7 +2750,7 @@ const ProductExcel = ({
|
||||||
<div
|
<div
|
||||||
className="editable-cell-value-wrap"
|
className="editable-cell-value-wrap"
|
||||||
style={{
|
style={{
|
||||||
paddingRight: 24,
|
textAlign: 'right',
|
||||||
}}
|
}}
|
||||||
onClick={toggleEdit}
|
onClick={toggleEdit}
|
||||||
>
|
>
|
||||||
|
|
@ -3162,13 +3029,24 @@ const ProductExcel = ({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
height: '80%',
|
alignItems: 'center',
|
||||||
|
height: '60%',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
||||||
<span>{col.title}</span>
|
<span
|
||||||
|
style={{
|
||||||
|
whiteSpace: 'nowrap',
|
||||||
|
fontWeight: '500',
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{col.title}
|
||||||
|
</span>
|
||||||
{!isMapped && (
|
{!isMapped && (
|
||||||
<span style={{ color: 'red', fontSize: '11px' }}>Not mapped</span>
|
<span style={{ color: '#f7a0a0', fontSize: '11px' }}>
|
||||||
|
Not mapped
|
||||||
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -3217,7 +3095,7 @@ const ProductExcel = ({
|
||||||
style={{
|
style={{
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
right: '-17px',
|
right: '-17px',
|
||||||
top: '80%',
|
top: '90%',
|
||||||
transform: 'translateY(-50%)',
|
transform: 'translateY(-50%)',
|
||||||
color: 'red',
|
color: 'red',
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
|
|
@ -3347,14 +3225,15 @@ const ProductExcel = ({
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
onSubmit={handleFileSubmit}
|
onSubmit={handleFileSubmit}
|
||||||
>
|
>
|
||||||
<div
|
<div className="download-linkMain">
|
||||||
|
<div className="HeadingUploadExl">
|
||||||
|
<p
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
fontSize: '16px',
|
||||||
justifyContent: 'space-between',
|
fontWeight: '500',
|
||||||
flexWrap: 'wrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<p style={{ fontSize: '20px', fontWeight: '500' }}>
|
|
||||||
Upload Your Excel
|
Upload Your Excel
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -3363,7 +3242,6 @@ const ProductExcel = ({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
gap: '0.5rem',
|
gap: '0.5rem',
|
||||||
margin: '1rem 0',
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Tooltip title="Field Setup">
|
<Tooltip title="Field Setup">
|
||||||
|
|
@ -3394,18 +3272,10 @@ const ProductExcel = ({
|
||||||
Export Excel
|
Export Excel
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* {excelData?.length > 0 && excelData &&
|
|
||||||
<div className="export-excel-div" onClick={() => setMappingOpen(true)}>
|
{message && (
|
||||||
<div>
|
<div style={{ color: '#ff4d4f' }}>No Data Found</div>
|
||||||
<CiBoxList />
|
)}
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
Map Your Fields
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
} */}
|
|
||||||
{loading && <div style={{ color: '#ff4d4f' }}>Loading...</div>}
|
|
||||||
{message && <div style={{ color: '#ff4d4f' }}>No Data Found</div>}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{excelData?.length > 0 && excelData && (
|
{excelData?.length > 0 && excelData && (
|
||||||
|
|
@ -3426,11 +3296,9 @@ const ProductExcel = ({
|
||||||
className="download-link"
|
className="download-link"
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'flex-end',
|
|
||||||
// justifyContent: "space-between",
|
|
||||||
justifyContent:
|
justifyContent:
|
||||||
excelData?.length > 0 ? 'space-between' : 'flex-end',
|
excelData?.length > 0 ? 'space-between' : 'flex-end',
|
||||||
width: '100%',
|
gap: '1rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{excelData?.length > 0 && (
|
{excelData?.length > 0 && (
|
||||||
|
|
@ -3453,6 +3321,7 @@ const ProductExcel = ({
|
||||||
</button>
|
</button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{(!excelData || excelData?.length === 0) && (
|
{(!excelData || excelData?.length === 0) && (
|
||||||
<>
|
<>
|
||||||
|
|
@ -3542,13 +3411,6 @@ const ProductExcel = ({
|
||||||
margin: '1rem 0rem',
|
margin: '1rem 0rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* <Tooltip title="Format Sheet" placement="bottom">
|
|
||||||
<div className="download-link" onClick={handleDownload} style={{ display: 'flex', alignItems: 'center', gap: '.5rem', padding: '0.3rem 0.4rem', borderRadius: '6px', backgroundColor: 'ghostwhite' }} >
|
|
||||||
<FiDownload style={{ fontSize: '20px', }} />
|
|
||||||
<a style={{ color: '#000' }}> Download</a>
|
|
||||||
</div>
|
|
||||||
</Tooltip> */}
|
|
||||||
|
|
||||||
{excelData && excelData?.length > 0 && (
|
{excelData && excelData?.length > 0 && (
|
||||||
<div
|
<div
|
||||||
className="cancel-link"
|
className="cancel-link"
|
||||||
|
|
@ -3579,7 +3441,11 @@ const ProductExcel = ({
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="field-setup-content">
|
<div className="field-setup-content">
|
||||||
<Form onFinish={handleFieldSetupSubmit} ref={formRef}>
|
<Form
|
||||||
|
onFinish={handleFieldSetupSubmit}
|
||||||
|
ref={formRef}
|
||||||
|
style={{ marginTop: '1rem' }}
|
||||||
|
>
|
||||||
<Form.Item name="fields">
|
<Form.Item name="fields">
|
||||||
<DropDowns
|
<DropDowns
|
||||||
label="Select fields"
|
label="Select fields"
|
||||||
|
|
@ -3658,7 +3524,6 @@ const ProductExcel = ({
|
||||||
<Modal
|
<Modal
|
||||||
title="Map Your Fields"
|
title="Map Your Fields"
|
||||||
open={MappingOpen}
|
open={MappingOpen}
|
||||||
// onOk={handleMappingConfirm}
|
|
||||||
onCancel={() => setMappingOpen(false)}
|
onCancel={() => setMappingOpen(false)}
|
||||||
>
|
>
|
||||||
{requiredFields.map((field) => {
|
{requiredFields.map((field) => {
|
||||||
|
|
|
||||||
|
|
@ -2714,7 +2714,7 @@ const ProductList = () => {
|
||||||
open={openExcel}
|
open={openExcel}
|
||||||
title="Bulk Upload"
|
title="Bulk Upload"
|
||||||
footer={true}
|
footer={true}
|
||||||
width={excelDataValues?.length > 0 ? 2500 : 600}
|
width={excelDataValues?.length > 0 ? 2500 : 700}
|
||||||
className={'bulkuploadmodal'}
|
className={'bulkuploadmodal'}
|
||||||
children={
|
children={
|
||||||
<>
|
<>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import {
|
||||||
getTipAmountSettlementList,
|
getTipAmountSettlementList,
|
||||||
postTipSettle,
|
postTipSettle,
|
||||||
} from '../../../Features/TipAmountSettlementList/TipAmountSettlementList';
|
} from '../../../Features/TipAmountSettlementList/TipAmountSettlementList';
|
||||||
import { getSession } from '../../../Services/Others';
|
import { ExtractDateFormate, getSession } from '../../../Services/Others';
|
||||||
import { WaiterNames } from '../../../Features/Reports/Reports';
|
import { WaiterNames } from '../../../Features/Reports/Reports';
|
||||||
import { Messages } from '../../../Components/Notifications/Messages';
|
import { Messages } from '../../../Components/Notifications/Messages';
|
||||||
import {
|
import {
|
||||||
|
|
@ -32,9 +32,11 @@ import {
|
||||||
} from '../../../Features/EmployeeSettlement/EmployeeSettlement';
|
} from '../../../Features/EmployeeSettlement/EmployeeSettlement';
|
||||||
import FormHeader from '../../PageComponents/FormHeader';
|
import FormHeader from '../../PageComponents/FormHeader';
|
||||||
import { changeBreadCrumb } from '../../../Features/AppPage/CenterPage';
|
import { changeBreadCrumb } from '../../../Features/AppPage/CenterPage';
|
||||||
|
import "../../../Styles/OverAllStyle/OverAllStyle.scss"
|
||||||
|
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
|
|
||||||
const EmployeeSettlement = () => {
|
const EmployeeSettlement = () => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
@ -51,51 +53,70 @@ const EmployeeSettlement = () => {
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
const [TableData, setTableData] = useState([]);
|
const [TableData, setTableData] = useState([]);
|
||||||
const [employeeList, setEmployee] = useState([]); // Add this state for employee dropdown
|
const [employeeList, setEmployee] = useState([]);
|
||||||
|
const [statusValue, setStatusValue] = useState('toBe');
|
||||||
|
|
||||||
const checkedTotal = checkedRows.reduce(
|
const checkedTotal = checkedRows.reduce(
|
||||||
(sum, row) =>
|
(sum, row) =>
|
||||||
sum + (Number(row?.IncentiveDetails?.[0]?.IncentiveAmount) || 0),
|
sum + (Number(row?.IncentiveDetails?.[0]?.IncentiveAmount) || 0),
|
||||||
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 [filteredData, setFilteredData] = useState(TableData);
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
link: `${subDirectory}app-page/home`,
|
link: `${subDirectory}app-page/home`,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'Incentive Settlement',
|
|
||||||
link: `${subDirectory}report/EmployeeSettlement`,
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const modalColumns = [
|
const modalColumns = [
|
||||||
{
|
{
|
||||||
title: 'Tip Date',
|
title: 'Sales Start Date',
|
||||||
dataIndex: 'SalesDate',
|
dataIndex: 'SalesStartDate',
|
||||||
key: 'SalesDate',
|
key: 'SalesStartDate',
|
||||||
width: 100,
|
width: 130,
|
||||||
render: (date) => (date ? dayjs(date).format('DD/MM/YYYY') : ''),
|
render: (date) => (date ? ExtractDateFormate(date) : ''),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Tip Date',
|
title: 'Sales End Date',
|
||||||
dataIndex: 'TipsAmount',
|
dataIndex: 'SalesEndDate',
|
||||||
key: 'TipsAmount',
|
key: 'SalesEndDate',
|
||||||
width: 100,
|
width: 130,
|
||||||
render: (item) => <span style={{}}>{item}</span>,
|
render: (date) => (date ? ExtractDateFormate(date) : ''),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Total Sales Amount',
|
||||||
|
dataIndex: 'TotalSalesAmount',
|
||||||
|
key: 'TotalSalesAmount',
|
||||||
|
width: 150,
|
||||||
|
align: 'right',
|
||||||
|
render: (item) => <span>{item ?? 0}</span>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Incentive Amount',
|
||||||
|
dataIndex: 'IncentiveAmount',
|
||||||
|
key: 'IncentiveAmount',
|
||||||
|
width: 130,
|
||||||
|
align: 'right',
|
||||||
|
render: (item) => <span>{item ?? 0}</span>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Status',
|
||||||
|
dataIndex: 'SettledStatus',
|
||||||
|
key: 'SettledStatus',
|
||||||
|
width: 100,
|
||||||
|
align: 'center',
|
||||||
|
render: (item) => (
|
||||||
|
<span style={{ color: item === 'Y' ? 'green' : 'orange' }}>
|
||||||
|
{item === 'Y' ? 'Settled' : 'Pending'}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
// Add more columns as needed based on your TipsDetails structure
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const handleEyeClick = (record) => {
|
const handleEyeClick = (record) => {
|
||||||
// Assuming TipsDetails is an array inside WaiterDetails[0]
|
|
||||||
setModalData(record);
|
setModalData(record);
|
||||||
setModalOpen(true);
|
setModalOpen(true);
|
||||||
};
|
};
|
||||||
|
|
@ -111,13 +132,12 @@ const EmployeeSettlement = () => {
|
||||||
<a style={{ color: 'black' }}>{index + 1}</a>
|
<a style={{ color: 'black' }}>{index + 1}</a>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: 'Employee',
|
title: 'Employee',
|
||||||
dataIndex: 'EmployeeName',
|
dataIndex: 'EmployeeName',
|
||||||
key: 'EmployeeName',
|
key: 'EmployeeName',
|
||||||
render: (item, record) => (
|
render: (item, record) => (
|
||||||
<span style={{}}>{item ? item : record?.MobileNo}</span>
|
<span>{item ? item : record?.MobileNo}</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -127,7 +147,7 @@ const EmployeeSettlement = () => {
|
||||||
key: 'TotalSalesAmount',
|
key: 'TotalSalesAmount',
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
const statusMap = { toBe: 'N', already: 'Y' };
|
const statusMap = { toBe: 'N', already: 'Y' };
|
||||||
const value = statusMap[form.getFieldValue('status')];
|
const value = statusMap[statusValue];
|
||||||
const group = record?.StatusGroups?.find(
|
const group = record?.StatusGroups?.find(
|
||||||
(e) => e?.SettledStatus === value
|
(e) => e?.SettledStatus === value
|
||||||
);
|
);
|
||||||
|
|
@ -141,14 +161,51 @@ const EmployeeSettlement = () => {
|
||||||
key: 'IncentiveAmount',
|
key: 'IncentiveAmount',
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
const statusMap = { toBe: 'N', already: 'Y' };
|
const statusMap = { toBe: 'N', already: 'Y' };
|
||||||
const value = statusMap[form.getFieldValue('status')];
|
const value = statusMap[statusValue];
|
||||||
const group = record?.StatusGroups?.find(
|
const group = record?.StatusGroups?.find(
|
||||||
(e) => e?.SettledStatus === value
|
(e) => e?.SettledStatus === value
|
||||||
);
|
);
|
||||||
return <span>{group?.IncentiveAmount ?? 0}</span>;
|
return <span>{group?.IncentiveAmount ?? 0}</span>;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
...(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 (
|
||||||
|
<span
|
||||||
|
style={{ cursor: 'pointer' }}
|
||||||
|
onClick={() => handleEyeClick(group?.items ?? [])}
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
className="anticon anticon-eye"
|
||||||
|
style={{ fontSize: 18, color: '#1890ff' }}
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
focusable="false"
|
||||||
|
data-icon="eye"
|
||||||
|
width="1em"
|
||||||
|
height="1em"
|
||||||
|
fill="currentColor"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
<path d="M942.2 486.6C885.6 367.2 765.8 288 624 288c-141.8 0-261.6 79.2-318.2 198.6-7.9 16.6-7.9 35.2 0 51.8C362.4 656.8 482.2 736 624 736c141.8 0 261.6-79.2 318.2-198.6 7.9-16.6 7.9-35.2 0-51.8zM624 672c-79.5 0-144-64.5-144-144s64.5-144 144-144 144 64.5 144 144-64.5 144-144 144zm0-240c-53 0-96 43-96 96s43 96 96 96 96-43 96-96-43-96-96-96z" />
|
||||||
|
</svg>
|
||||||
|
</i>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
...(statusValue !== 'already'
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
title: 'Settle',
|
title: 'Settle',
|
||||||
|
|
@ -157,7 +214,12 @@ const EmployeeSettlement = () => {
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
const waiterId = record?.EmployeeId;
|
const waiterId = record?.EmployeeId;
|
||||||
const isDisabled = record?.IncentiveAmount === 12;
|
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 (
|
return (
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
|
@ -193,15 +255,16 @@ const EmployeeSettlement = () => {
|
||||||
// Handle select all checkboxes
|
// Handle select all checkboxes
|
||||||
const handleSelectAll = (e) => {
|
const handleSelectAll = (e) => {
|
||||||
if (e.target.checked) {
|
if (e.target.checked) {
|
||||||
const allWaiterIds = groupByEmployeeAndStatus(TableData)
|
const allEmployees = groupByEmployeeAndStatus(TableData)
|
||||||
.map((emp) => ({
|
.map((emp) => ({
|
||||||
...emp,
|
...emp,
|
||||||
StatusGroups: emp.StatusGroups.filter((g) => g.SettledStatus === 'N'),
|
StatusGroups: emp.StatusGroups.filter((g) => g.SettledStatus === 'N'),
|
||||||
}))
|
}))
|
||||||
.filter((emp) => emp.StatusGroups.length > 0)
|
.filter((emp) => emp.StatusGroups.length > 0);
|
||||||
?.map((row) => row?.EmployeeId);
|
|
||||||
setCheckedRowKeys(allWaiterIds);
|
const allIds = allEmployees.map((row) => row?.EmployeeId);
|
||||||
setCheckedRows(TableData.slice());
|
setCheckedRowKeys(allIds);
|
||||||
|
setCheckedRows(allEmployees);
|
||||||
} else {
|
} else {
|
||||||
setCheckedRowKeys([]);
|
setCheckedRowKeys([]);
|
||||||
setCheckedRows([]);
|
setCheckedRows([]);
|
||||||
|
|
@ -209,7 +272,6 @@ const EmployeeSettlement = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Set today's date for fromDate and toDate in the form
|
|
||||||
const today = dayjs();
|
const today = dayjs();
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
fromDate: today,
|
fromDate: today,
|
||||||
|
|
@ -230,8 +292,8 @@ const EmployeeSettlement = () => {
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
setTableData(response?.data?.data?.EmployeeDetails);
|
setTableData(response?.data?.data?.EmployeeDetails);
|
||||||
}
|
}
|
||||||
// handle response as needed
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
let data = {
|
let data = {
|
||||||
activeStatus: 'A',
|
activeStatus: 'A',
|
||||||
|
|
@ -250,6 +312,9 @@ const EmployeeSettlement = () => {
|
||||||
setSelectedRowKeys([]);
|
setSelectedRowKeys([]);
|
||||||
setFilteredData(TableData);
|
setFilteredData(TableData);
|
||||||
setTableData([]);
|
setTableData([]);
|
||||||
|
setCheckedRows([]);
|
||||||
|
setCheckedRowKeys([]);
|
||||||
|
setStatusValue('toBe');
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFinish = async (values) => {
|
const onFinish = async (values) => {
|
||||||
|
|
@ -269,18 +334,18 @@ const EmployeeSettlement = () => {
|
||||||
getEmployeeSettlementListindIvidually(data)
|
getEmployeeSettlementListindIvidually(data)
|
||||||
).unwrap())
|
).unwrap())
|
||||||
: (response = await dispatch(getEmployeeSettlementList(data)).unwrap());
|
: (response = await dispatch(getEmployeeSettlementList(data)).unwrap());
|
||||||
|
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
setTableData(response?.data?.data?.EmployeeDetails);
|
setTableData(response?.data?.data?.EmployeeDetails);
|
||||||
|
|
||||||
const StatusValue = form.getFieldValue('status') === 'toBe' ? 'N' : 'Y';
|
const StatusValue = form.getFieldValue('status') === 'toBe' ? 'N' : 'Y';
|
||||||
|
|
||||||
const employees = response?.data?.data?.EmployeeDetails ?? [];
|
const employees = response?.data?.data?.EmployeeDetails ?? [];
|
||||||
const data = employees.some((e) =>
|
const hasData = employees.some((e) =>
|
||||||
e?.IncentiveDetails?.some(
|
e?.IncentiveDetails?.some(
|
||||||
(a) => a?.SettledStatus === StatusValue && a?.IncentiveAmount > 0
|
(a) => a?.SettledStatus === StatusValue && a?.IncentiveAmount > 0
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if (data) {
|
if (hasData) {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(response?.data?.response);
|
setMessageData(response?.data?.response);
|
||||||
}
|
}
|
||||||
|
|
@ -294,7 +359,7 @@ const EmployeeSettlement = () => {
|
||||||
const handleCheckedSubmit = async () => {
|
const handleCheckedSubmit = async () => {
|
||||||
const today = dayjs();
|
const today = dayjs();
|
||||||
const statusMap = { toBe: 'N', already: 'Y' };
|
const statusMap = { toBe: 'N', already: 'Y' };
|
||||||
const value = statusMap[form.getFieldValue('status')]; // "N" or "Y"
|
const value = statusMap[statusValue];
|
||||||
|
|
||||||
const postData = {
|
const postData = {
|
||||||
CompId,
|
CompId,
|
||||||
|
|
@ -305,7 +370,6 @@ const EmployeeSettlement = () => {
|
||||||
const group = item?.StatusGroups?.find(
|
const group = item?.StatusGroups?.find(
|
||||||
(g) => g?.SettledStatus === value
|
(g) => g?.SettledStatus === value
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
SettlementAmount: group?.IncentiveAmount ?? 0,
|
SettlementAmount: group?.IncentiveAmount ?? 0,
|
||||||
EmployeeId: item?.EmployeeId,
|
EmployeeId: item?.EmployeeId,
|
||||||
|
|
@ -315,27 +379,23 @@ const EmployeeSettlement = () => {
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(postData);
|
|
||||||
|
|
||||||
let response = await dispatch(postEmployeeSettle(postData))?.unwrap();
|
let response = await dispatch(postEmployeeSettle(postData))?.unwrap();
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(response?.data?.response);
|
setMessageData(response?.data?.response);
|
||||||
handleReset();
|
handleReset();
|
||||||
setCheckedRows([]);
|
|
||||||
} else {
|
} else {
|
||||||
setMessageType('error');
|
setMessageType('error');
|
||||||
setMessageData(response?.data?.response);
|
setMessageData(response?.data?.response);
|
||||||
handleReset();
|
handleReset();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function formatToYYYYMMDD(dateString) {
|
function formatToYYYYMMDD(dateString) {
|
||||||
const date = new Date(dateString);
|
const date = new Date(dateString);
|
||||||
|
|
||||||
const year = date.getFullYear();
|
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');
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
|
||||||
return `${year}/${month}/${day}`;
|
return `${year}/${month}/${day}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -344,24 +404,11 @@ const EmployeeSettlement = () => {
|
||||||
setMessageType(null);
|
setMessageType(null);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// const getFilteredTableData = useCallback(() => {
|
// ✅ FIXED: No longer skips records with IncentiveAmount === 0
|
||||||
// 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]);
|
|
||||||
function groupByEmployeeAndStatus(tableData) {
|
function groupByEmployeeAndStatus(tableData) {
|
||||||
return tableData
|
return tableData
|
||||||
.map((emp) => {
|
.map((emp) => {
|
||||||
const grouped = emp.IncentiveDetails.reduce((acc, curr) => {
|
const grouped = emp.IncentiveDetails.reduce((acc, curr) => {
|
||||||
if ((curr.IncentiveAmount || 0) === 0) {
|
|
||||||
return acc; // skip this detail entirely
|
|
||||||
}
|
|
||||||
|
|
||||||
const status = curr.SettledStatus;
|
const status = curr.SettledStatus;
|
||||||
if (!acc[status]) {
|
if (!acc[status]) {
|
||||||
acc[status] = {
|
acc[status] = {
|
||||||
|
|
@ -380,20 +427,33 @@ const EmployeeSettlement = () => {
|
||||||
return {
|
return {
|
||||||
EmployeeId: emp?.EmployeeId,
|
EmployeeId: emp?.EmployeeId,
|
||||||
EmployeeName: emp.EmployeeName,
|
EmployeeName: emp.EmployeeName,
|
||||||
|
MobileNo: emp.MobileNo,
|
||||||
StatusGroups: Object.values(grouped),
|
StatusGroups: Object.values(grouped),
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter((emp) => emp.StatusGroups.length > 0); // remove employees with no valid items
|
.filter((emp) => emp.StatusGroups.length > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
let dataaaa = groupByEmployeeAndStatus(TableData);
|
const getTableDataSource = () => {
|
||||||
console.log(dataaaa, 'dataaaa');
|
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(() => {
|
useEffect(() => {
|
||||||
setCheckedRowKeys([]);
|
setCheckedRowKeys([]);
|
||||||
setCheckedRows([]);
|
setCheckedRows([]);
|
||||||
}, [form.getFieldValue('status'), TableData]);
|
}, [statusValue, TableData]);
|
||||||
|
|
||||||
const handleStatusChange = () => {
|
const handleStatusChange = (e) => {
|
||||||
|
setStatusValue(e.target.value);
|
||||||
setCheckedRowKeys([]);
|
setCheckedRowKeys([]);
|
||||||
setCheckedRows([]);
|
setCheckedRows([]);
|
||||||
setFilteredData([]);
|
setFilteredData([]);
|
||||||
|
|
@ -408,9 +468,6 @@ const EmployeeSettlement = () => {
|
||||||
overflow: 'scroll',
|
overflow: 'scroll',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div style={{ marginBottom: '10px' }}>
|
|
||||||
<FormHeader title={'Incentive'} />
|
|
||||||
</div>
|
|
||||||
<Messages
|
<Messages
|
||||||
messageType={messageType}
|
messageType={messageType}
|
||||||
messageData={messageData}
|
messageData={messageData}
|
||||||
|
|
@ -425,12 +482,13 @@ const EmployeeSettlement = () => {
|
||||||
Employee: 'all',
|
Employee: 'all',
|
||||||
status: 'toBe',
|
status: 'toBe',
|
||||||
}}
|
}}
|
||||||
|
style={{
|
||||||
|
padding: '10px',
|
||||||
|
border: '1px solid #d7d7d7',
|
||||||
|
borderRadius: '10px',
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Row
|
<Row style={{ rowGap: '1rem', flexWrap: 'wrap' }} wrap={true} gutter={16}>
|
||||||
style={{ rowGap: '1rem', flexWrap: 'wrap' }}
|
|
||||||
wrap={true}
|
|
||||||
gutter={16}
|
|
||||||
>
|
|
||||||
<Col>
|
<Col>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="Employee"
|
name="Employee"
|
||||||
|
|
@ -452,35 +510,6 @@ const EmployeeSettlement = () => {
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
{/* <Col>
|
|
||||||
<Form.Item
|
|
||||||
name="fromDate"
|
|
||||||
label="From Date"
|
|
||||||
style={{ marginBottom: '8px' }}
|
|
||||||
rules={[{ required: true, message: 'Please select from date' }]}
|
|
||||||
>
|
|
||||||
<DatePicker
|
|
||||||
format="DD/MM/YYYY"
|
|
||||||
style={{ width: 140 }}
|
|
||||||
disabledDate={current => current && current > dayjs().endOf('day')}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
<Col>
|
|
||||||
<Form.Item
|
|
||||||
name="toDate"
|
|
||||||
label="To Date"
|
|
||||||
style={{ marginBottom: '8px' }}
|
|
||||||
rules={[{ required: true, message: 'Please select to date' }]}
|
|
||||||
>
|
|
||||||
<DatePicker
|
|
||||||
format="DD/MM/YYYY"
|
|
||||||
style={{ width: 140 }}
|
|
||||||
disabledDate={current => current && current > dayjs().endOf('day')}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
</Col> */}
|
|
||||||
|
|
||||||
<Col>
|
<Col>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="status"
|
name="status"
|
||||||
|
|
@ -512,17 +541,17 @@ const EmployeeSettlement = () => {
|
||||||
</Row>
|
</Row>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
||||||
{/* Data Table */}
|
{/* Select All checkbox */}
|
||||||
{Paymentstatus !== 'already' && (
|
{statusValue !== 'already' && (
|
||||||
<div style={{ marginBottom: 8, float: 'right' }}>
|
<div style={{ marginBottom: 8, float: 'right' }}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
indeterminate={
|
indeterminate={
|
||||||
checkedRowKeys?.length > 0 &&
|
checkedRowKeys?.length > 0 &&
|
||||||
checkedRowKeys?.length < TableData?.length
|
checkedRowKeys?.length < getTableDataSource()?.length
|
||||||
}
|
}
|
||||||
checked={
|
checked={
|
||||||
TableData?.length > 0 &&
|
getTableDataSource()?.length > 0 &&
|
||||||
checkedRowKeys?.length === TableData?.length
|
checkedRowKeys?.length === getTableDataSource()?.length
|
||||||
}
|
}
|
||||||
onChange={handleSelectAll}
|
onChange={handleSelectAll}
|
||||||
>
|
>
|
||||||
|
|
@ -530,28 +559,13 @@ const EmployeeSettlement = () => {
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* Data Table */}
|
||||||
<div className="reportTable">
|
<div className="reportTable">
|
||||||
<Table
|
<Table
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={
|
dataSource={getTableDataSource()}
|
||||||
form.getFieldValue('status') == 'toBe'
|
rowKey={(record) => record?.EmployeeId}
|
||||||
? groupByEmployeeAndStatus(TableData)
|
|
||||||
.map((emp) => ({
|
|
||||||
...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)
|
|
||||||
}
|
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scroll={{ x: 'max-content' }}
|
scroll={{ x: 'max-content' }}
|
||||||
size="middle"
|
size="middle"
|
||||||
|
|
@ -559,20 +573,12 @@ const EmployeeSettlement = () => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Button to submit checked rows */}
|
{/* Pay Button */}
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="incenbtivepayBTN"
|
className="incenbtivepayBTN"
|
||||||
style={{ marginTop: 16, float: 'right' }}
|
style={{ marginTop: 16, float: 'right' }}
|
||||||
>
|
>
|
||||||
<div style={{ display: 'flex', gap: '1rem' }}>
|
<div style={{ display: 'flex', gap: '1rem' }}>
|
||||||
{/* {checkedRowKeys.length !== 0 && (
|
|
||||||
<input
|
|
||||||
disabled
|
|
||||||
style={{ width: "100px", borderRadius: "10px", height: "38px", textAlign: "right", paddingRight: 8 }}
|
|
||||||
value={checkedTotal.toFixed(2)}
|
|
||||||
/>
|
|
||||||
)} */}
|
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
disabled={checkedRowKeys.length === 0}
|
disabled={checkedRowKeys.length === 0}
|
||||||
|
|
@ -583,12 +589,13 @@ const EmployeeSettlement = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Detail Modal */}
|
||||||
<Modal
|
<Modal
|
||||||
open={modalOpen}
|
open={modalOpen}
|
||||||
onCancel={() => setModalOpen(false)}
|
onCancel={() => setModalOpen(false)}
|
||||||
footer={null}
|
footer={null}
|
||||||
title="Tip Details"
|
title="Incentive Details"
|
||||||
width={600}
|
width={700}
|
||||||
>
|
>
|
||||||
<Table
|
<Table
|
||||||
columns={modalColumns}
|
columns={modalColumns}
|
||||||
|
|
|
||||||
|
|
@ -35,23 +35,17 @@ const RevenueItemWiseReport = () => {
|
||||||
const formattedToday = today.toISOString()?.split('T')[0];
|
const formattedToday = today.toISOString()?.split('T')[0];
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const formRef = useRef();
|
const formRef = useRef();
|
||||||
// const [filteredInfo, setFilteredInfo] = useState({});
|
|
||||||
const [sortedInfo, setSortedInfo] = useState({});
|
const [sortedInfo, setSortedInfo] = useState({});
|
||||||
// const [sortedInfo2, setSortedInfo2] = useState({});
|
|
||||||
const [searchedText, setSearchedText] = useState('');
|
const [searchedText, setSearchedText] = useState('');
|
||||||
// const [searchedText2, setSearchedText2] = useState("");
|
|
||||||
const [OrderFromDate, setOrderFromDate] = useState(formattedToday);
|
const [OrderFromDate, setOrderFromDate] = useState(formattedToday);
|
||||||
const [OrderToDate, setOrderToDate] = useState(formattedToday);
|
const [OrderToDate, setOrderToDate] = useState(formattedToday);
|
||||||
const [RevenueData, setRevenueData] = useState();
|
const [RevenueData, setRevenueData] = useState();
|
||||||
// const [CateWiseData, setCateWiseData] = useState();
|
|
||||||
const [userDropDown, setuserDropDown] = useState([]);
|
const [userDropDown, setuserDropDown] = useState([]);
|
||||||
// const [chartData, setchartdata] = useState([]);
|
|
||||||
const [apiCall, setapiCall] = useState(false);
|
const [apiCall, setapiCall] = useState(false);
|
||||||
const [chart, setchart] = useState(false);
|
const [chart, setchart] = useState(false);
|
||||||
|
|
||||||
const [selectedUserData, setSelectedUserData] = useState(null);
|
const [selectedUserData, setSelectedUserData] = useState(null);
|
||||||
const [receiptTextItemWise, setreceiptTextItemWise] = useState();
|
const [receiptTextItemWise, setreceiptTextItemWise] = useState();
|
||||||
// const [receiptTextCatWise, setreceiptTextCatWise] = useState()
|
|
||||||
const SettingDataSelector = useSelector(PreferenceData);
|
const SettingDataSelector = useSelector(PreferenceData);
|
||||||
|
|
||||||
const UomPrint = SettingDataSelector?.[0]?.SettingDtlDetails?.filter(
|
const UomPrint = SettingDataSelector?.[0]?.SettingDtlDetails?.filter(
|
||||||
|
|
@ -174,32 +168,11 @@ const RevenueItemWiseReport = () => {
|
||||||
fetchInitialData();
|
fetchInitialData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// setchart(false)
|
|
||||||
// }, [apiCall]);
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (UserRole != 'Employee') {
|
if (UserRole != 'Employee') {
|
||||||
userDropData();
|
userDropData();
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
// useEffect(() => {
|
|
||||||
// if (apiCall) {
|
|
||||||
// setSelectedUserData(0);
|
|
||||||
// fetchCatData();
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
|
|
||||||
// setSelectedUserData(0);
|
|
||||||
// fetchInitialData();
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }, [apiCall]);
|
|
||||||
// useEffect(() => {
|
|
||||||
// if (UserId==0){
|
|
||||||
// onFinish();
|
|
||||||
// }
|
|
||||||
// }, []);
|
|
||||||
|
|
||||||
function safeRound(amountStr) {
|
function safeRound(amountStr) {
|
||||||
if (amountStr == null) return allowDecimal ? '0.00' : '0';
|
if (amountStr == null) return allowDecimal ? '0.00' : '0';
|
||||||
|
|
||||||
|
|
@ -211,28 +184,6 @@ const RevenueItemWiseReport = () => {
|
||||||
return allowDecimal ? num.toFixed(2) : Math.round(num).toString();
|
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 userDropData = async () => {
|
||||||
const gettinguserDropDown = await dispatch(
|
const gettinguserDropDown = await dispatch(
|
||||||
UserDataBasedOnBranchId(BranchId)
|
UserDataBasedOnBranchId(BranchId)
|
||||||
|
|
@ -268,27 +219,14 @@ const RevenueItemWiseReport = () => {
|
||||||
setFilteredInfo(filters);
|
setFilteredInfo(filters);
|
||||||
setSortedInfo(sorter);
|
setSortedInfo(sorter);
|
||||||
};
|
};
|
||||||
// const handleChange2 = (pagination, filters, sorter) => {
|
|
||||||
// setSortedInfo2(sorter);
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const onComplete = useCallback(() => {
|
|
||||||
// setMessageData(null);
|
|
||||||
// setMessageType(null);
|
|
||||||
// }, [])
|
|
||||||
|
|
||||||
const onSearch = (value) => {
|
const onSearch = (value) => {
|
||||||
setSearchedText(value);
|
setSearchedText(typeof value === "string" ? value : "");
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSearchChange = (e) => {
|
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 () => {
|
const Print = async () => {
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
if (MobileA4Print) {
|
if (MobileA4Print) {
|
||||||
|
|
@ -426,45 +364,7 @@ const RevenueItemWiseReport = () => {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
// const columns2 = [
|
|
||||||
// {
|
|
||||||
// title: "SI NO",
|
|
||||||
// dataIndex: "SINO",
|
|
||||||
// key: "SINO",
|
|
||||||
// align: "center",
|
|
||||||
// render: (text, object, index) => <a style={{ color: "black" }}>{index + 1}</a>,
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// 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)=> (
|
|
||||||
// <span style={{ color: "black" }}>{safeRound(text)}</span>
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
|
|
||||||
// ];
|
|
||||||
const DateWisTableData = RevenueData?.map((item, index) => ({
|
const DateWisTableData = RevenueData?.map((item, index) => ({
|
||||||
SINO: index + 1,
|
SINO: index + 1,
|
||||||
ItemName:
|
ItemName:
|
||||||
|
|
@ -511,40 +411,16 @@ const RevenueItemWiseReport = () => {
|
||||||
UserId: UserId,
|
UserId: UserId,
|
||||||
type: 'E',
|
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) {
|
if (!apiCall) {
|
||||||
let Response = await dispatch(getRevenueItemWiseReport(data)).unwrap();
|
let Response = await dispatch(getRevenueItemWiseReport(data)).unwrap();
|
||||||
setRevenueData(Response?.data?.data);
|
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) {
|
} catch (error) {
|
||||||
console.error('An error occurred:', 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);
|
let filterPurchaseRate = RevenueData?.map((item) => item.ProductPurchaseRate);
|
||||||
const PurchaseRate = filterPurchaseRate?.reduce(
|
const PurchaseRate = filterPurchaseRate?.reduce(
|
||||||
|
|
@ -562,10 +438,6 @@ const RevenueItemWiseReport = () => {
|
||||||
|
|
||||||
const TotalSalesAmt = salesRate - PurchaseRate;
|
const TotalSalesAmt = salesRate - PurchaseRate;
|
||||||
|
|
||||||
// const onChange = (checked) => {
|
|
||||||
// setapiCall(checked);
|
|
||||||
// };
|
|
||||||
|
|
||||||
const reprintDate = (date) => {
|
const reprintDate = (date) => {
|
||||||
const salesDate = new Date(date);
|
const salesDate = new Date(date);
|
||||||
const formattedDate = salesDate.toLocaleDateString('en-GB', {
|
const formattedDate = salesDate.toLocaleDateString('en-GB', {
|
||||||
|
|
@ -582,58 +454,6 @@ const RevenueItemWiseReport = () => {
|
||||||
}
|
}
|
||||||
}, [itemData]);
|
}, [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]<b><font size='big'>" + "Category Wise Sales" + "</font></b>\n" +
|
|
||||||
// "[L]<b>From Date :" + reprintDate(OrderFromDate) +
|
|
||||||
// "[L]<b>" + " " + "To Date :" + reprintDate(OrderToDate) +
|
|
||||||
// "</b>\n" +
|
|
||||||
// "[C]------------------------------------------------\n" +
|
|
||||||
|
|
||||||
// "[L]<b>" + "" + "S.No" + " " + " Category " + " " + "Quantity " + " " + "Amount " + "" + "</b>" +
|
|
||||||
// "[L]\n" +
|
|
||||||
// "[C]------------------------------------------------\n" +
|
|
||||||
// Tabledata.join("") +
|
|
||||||
// "[C]<b>------------------------------------------------</b>\n" +
|
|
||||||
// "[R]<b>" + "TotalAmount:" + parseFloat(TotalAmount).toFixed(2) + "</b>\n" +
|
|
||||||
// "[L]<b>------------------------------------------------</b>\n"
|
|
||||||
|
|
||||||
// setreceiptTextCatWise(receiptTextdata)
|
|
||||||
// }
|
|
||||||
|
|
||||||
const mobileItemWisePrintFun = async (printdata) => {
|
const mobileItemWisePrintFun = async (printdata) => {
|
||||||
let Tabledata = printdata?.map((data, index) => {
|
let Tabledata = printdata?.map((data, index) => {
|
||||||
|
|
@ -721,12 +541,6 @@ const RevenueItemWiseReport = () => {
|
||||||
TotalSalesAmt={TotalSalesAmt}
|
TotalSalesAmt={TotalSalesAmt}
|
||||||
RevenueData={RevenueData}
|
RevenueData={RevenueData}
|
||||||
/>
|
/>
|
||||||
{/* <CategoryWiseReportPdf
|
|
||||||
OrderFromDate={OrderFromDate?.split("T")?.[0]}
|
|
||||||
OrderToDate={OrderToDate?.split("T")?.[0]}
|
|
||||||
TotalAmount={TotalAmount2}
|
|
||||||
itemData={CateWiseData}
|
|
||||||
/> */}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ overflow: "auto" }}>
|
<div style={{ overflow: "auto" }}>
|
||||||
|
|
@ -735,57 +549,6 @@ const RevenueItemWiseReport = () => {
|
||||||
<p className="ItemWiseReport-heading">Gross Margin</p>
|
<p className="ItemWiseReport-heading">Gross Margin</p>
|
||||||
<div className="ItemWiseReport-dateaAnd-buttons">
|
<div className="ItemWiseReport-dateaAnd-buttons">
|
||||||
<div className="ItemWiseReport-Date-picker">
|
<div className="ItemWiseReport-Date-picker">
|
||||||
{/* <div className="ItemWiseReport-DateFrom">
|
|
||||||
<div className="ItemWiseReport-Date">
|
|
||||||
<p className="ItemWiseReport-Date-from-heading required">
|
|
||||||
From Date
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<Form.Item
|
|
||||||
name="Fromdate"
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
pattern: /^(?!\s*$).+/,
|
|
||||||
message: 'Please Enter the From Date ',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<DatePicProd
|
|
||||||
onChange={OrderFromDatefetch}
|
|
||||||
// style={{ width: "24vw", height: "2.6rem" }}
|
|
||||||
valueData={OrderFromDate}
|
|
||||||
canSelectPast={true}
|
|
||||||
cancelFuture={true}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="ItemWiseReport-DateTo">
|
|
||||||
<div className="ItemWiseReport-Date">
|
|
||||||
<p className="required">To Date</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Form.Item
|
|
||||||
name="Todate"
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
pattern: /^(?!\s*$).+/,
|
|
||||||
message: 'Please Enter the To Date ',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<DatePicProd
|
|
||||||
onChange={OrderToDatefetch}
|
|
||||||
// style={{ width: "24vw", height: "2.6rem" }}
|
|
||||||
valueData={OrderToDate}
|
|
||||||
canSelectPast={true}
|
|
||||||
cancelFuture={true}
|
|
||||||
minDate={OrderFromDate}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
</div> */}
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="dateRange"
|
name="dateRange"
|
||||||
>
|
>
|
||||||
|
|
@ -863,59 +626,20 @@ const RevenueItemWiseReport = () => {
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
{/* <div className="ItemWiseReport-PrinterIcon-Container">
|
|
||||||
<Tooltip title="Print">
|
|
||||||
{!apiCall ? <BiSolidPrinter
|
|
||||||
onClick={Print}
|
|
||||||
className={
|
|
||||||
itemData?.length > 0
|
|
||||||
? "ItemWiseReport-printerIcon"
|
|
||||||
: "ItemWiseReport-printerIcon-disabled"
|
|
||||||
}
|
|
||||||
/> :
|
|
||||||
<BiSolidPrinter
|
|
||||||
onClick={Print2}
|
|
||||||
className={
|
|
||||||
CateWiseData?.length > 0
|
|
||||||
? "ItemWiseReport-printerIcon"
|
|
||||||
: "ItemWiseReport-printerIcon-disabled"
|
|
||||||
}
|
|
||||||
/>}
|
|
||||||
</Tooltip>
|
|
||||||
</div> */}
|
|
||||||
<div className="ItemWiseReport-search">
|
<div className="ItemWiseReport-search">
|
||||||
{!apiCall ? (
|
|
||||||
<Search
|
<Search
|
||||||
placeholder="Search by Item Name"
|
placeholder="Search by Item Name"
|
||||||
onSearch={onSearch}
|
onSearch={onSearch}
|
||||||
onSearchChange={onSearchChange}
|
onSearchChange={onSearchChange}
|
||||||
/>
|
/>
|
||||||
) : !chart ? (
|
|
||||||
<Search
|
|
||||||
placeholder="Search"
|
|
||||||
onSearch={onSearch2}
|
|
||||||
onSearchChange={onSearchChange2}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
''
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* {apiCall && <div className="toggle">
|
|
||||||
<p> PieChart</p> <Switch onChange={openChart} /> <p> TableData</p>
|
|
||||||
</div>} */}
|
|
||||||
|
|
||||||
<div className="ItemWiseReport-table1">
|
<div className="ItemWiseReport-table1">
|
||||||
{/* <Tables
|
|
||||||
columns={columns}
|
|
||||||
data={itemData}
|
|
||||||
dataSource={itemData}
|
|
||||||
onChange={handleChange}
|
|
||||||
/> */}
|
|
||||||
|
|
||||||
<table className="custom-table">
|
<table className="custom-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -929,16 +653,17 @@ const RevenueItemWiseReport = () => {
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{itemData &&
|
{itemData &&
|
||||||
itemData
|
(itemData || [])
|
||||||
.filter(
|
.filter((row) => {
|
||||||
(row) =>
|
const search = (searchedText || "").toLowerCase();
|
||||||
!searchedText ||
|
|
||||||
|
return (
|
||||||
|
!search ||
|
||||||
(row.ItemName &&
|
(row.ItemName &&
|
||||||
row.ItemName?.toLowerCase()?.includes(
|
row.ItemName.toLowerCase().includes(search))
|
||||||
searchedText?.toLowerCase()
|
);
|
||||||
))
|
})
|
||||||
)
|
?.sort((a, b) => {
|
||||||
.sort((a, b) => {
|
|
||||||
if (sortedInfo.columnKey === 'ItemName') {
|
if (sortedInfo.columnKey === 'ItemName') {
|
||||||
return sortedInfo.order === 'ascend'
|
return sortedInfo.order === 'ascend'
|
||||||
? a.ItemName?.localeCompare(b.ItemName)
|
? a.ItemName?.localeCompare(b.ItemName)
|
||||||
|
|
@ -946,7 +671,7 @@ const RevenueItemWiseReport = () => {
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
})
|
})
|
||||||
.map((row, idx) => (
|
?.map((row, idx) => (
|
||||||
<tr key={idx}>
|
<tr key={idx}>
|
||||||
<td style={{ textAlign: 'center' }}>{idx + 1}</td>
|
<td style={{ textAlign: 'center' }}>{idx + 1}</td>
|
||||||
<td style={{ textAlign: 'left' }}>{row.ItemName}</td>
|
<td style={{ textAlign: 'left' }}>{row.ItemName}</td>
|
||||||
|
|
@ -994,30 +719,10 @@ const RevenueItemWiseReport = () => {
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{/* <div className="ItemWiseReport-table">
|
|
||||||
{!apiCall ? <Tables
|
|
||||||
columns={columns}
|
|
||||||
data={itemData}
|
|
||||||
// dataSource={itemData}
|
|
||||||
onChange={handleChange}
|
|
||||||
/> : !chart ? (<Tables
|
|
||||||
columns={columns2}
|
|
||||||
data={chartData}
|
|
||||||
// dataSource={itemData}
|
|
||||||
onChange={handleChange2}
|
|
||||||
/>
|
|
||||||
|
|
||||||
) : (<DynamicPieChart chartData={chartData} />)
|
|
||||||
}
|
|
||||||
</div> */}
|
|
||||||
<div
|
<div
|
||||||
className="ItemWiseReport-netAmount"
|
className="ItemWiseReport-netAmount"
|
||||||
style={{ margin: '2rem 1.5rem' }}
|
style={{ margin: '2rem 1.5rem' }}
|
||||||
>
|
>
|
||||||
{/* {apiCall && chart ? null : (
|
|
||||||
<h3> Net Amount: {!apiCall ? TotalAmount : (!chart ? TotalAmount2 : "")}</h3>
|
|
||||||
)} */}
|
|
||||||
|
|
||||||
{!apiCall ? (
|
{!apiCall ? (
|
||||||
<div className="ItemWiseReport-Amount-Collected-table">
|
<div className="ItemWiseReport-Amount-Collected-table">
|
||||||
<table className="ItemWiseReport-Amount-Collected-table-div">
|
<table className="ItemWiseReport-Amount-Collected-table-div">
|
||||||
|
|
@ -1030,15 +735,6 @@ const RevenueItemWiseReport = () => {
|
||||||
<td>Sales Rate</td>
|
<td>Sales Rate</td>
|
||||||
<td>{safeRound(salesRate)}</td>
|
<td>{safeRound(salesRate)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/* {RevenueData?.[0]?.OverallDisc > 0 && <tr>
|
|
||||||
<td>Discount Amount</td>
|
|
||||||
<td>{RevenueData?.[0]?.OverallDisc}</td>
|
|
||||||
</tr>}
|
|
||||||
|
|
||||||
{RevenueData?.[0]?.TaxAmt > 0 && <tr>
|
|
||||||
<td>Total Tax</td>
|
|
||||||
<td>{RevenueData?.[0]?.TaxAmt}</td>
|
|
||||||
</tr>} */}
|
|
||||||
<p className="ItemWiseReport-border-dashed"></p>
|
<p className="ItemWiseReport-border-dashed"></p>
|
||||||
<tr>
|
<tr>
|
||||||
<th className="ItemWiseReport-netAmount">
|
<th className="ItemWiseReport-netAmount">
|
||||||
|
|
@ -1093,11 +789,6 @@ const RevenueItemWiseReport = () => {
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{/* <div className="ItemWiseReport-netAmount">
|
|
||||||
{apiCall && chart ? null : (
|
|
||||||
<h3> Net Amount: {!apiCall ? TotalAmount : (!chart ? TotalAmount2 : "")}</h3>
|
|
||||||
)}
|
|
||||||
</div> */}
|
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -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 (
|
||||||
|
<div className="userPageTable">
|
||||||
|
<div className="userPageContent">
|
||||||
|
<Messages
|
||||||
|
messageType={messageType}
|
||||||
|
messageData={messageData}
|
||||||
|
onComplete={onComplete}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* ✅ Tabs */}
|
||||||
|
<div className="formAddNew">
|
||||||
|
<div className="settlementTabs">
|
||||||
|
|
||||||
|
<div
|
||||||
|
className={`tabItem ${
|
||||||
|
selectedComponent === "tips" ? "active" : ""
|
||||||
|
}`}
|
||||||
|
onClick={() => setSelectedComponent("tips")}
|
||||||
|
>
|
||||||
|
Tip Settlement
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
className={`tabItem ${
|
||||||
|
selectedComponent === "insentive" ? "active" : ""
|
||||||
|
}`}
|
||||||
|
onClick={() => setSelectedComponent("insentive")}
|
||||||
|
>
|
||||||
|
Incentive Settlement
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* ✅ Content */}
|
||||||
|
<div className="tabContent">
|
||||||
|
{selectedComponent === "tips" ? (
|
||||||
|
<TipAmountSettlementList />
|
||||||
|
) : (
|
||||||
|
<EmployeeSettlement />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Settlement;
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -444,9 +444,9 @@ const TipAmountSettlementList = () => {
|
||||||
<div
|
<div
|
||||||
style={{ padding: '0px', width: '99%', overflow: 'auto', height: '90vh' }}
|
style={{ padding: '0px', width: '99%', overflow: 'auto', height: '90vh' }}
|
||||||
>
|
>
|
||||||
<div style={{ marginBottom: '10px' }}>
|
{/* <div style={{ marginBottom: '10px' }}>
|
||||||
<FormHeader title={'Tip Amount Setlement'} />
|
<FormHeader title={'Tip Amount Settlement'} />
|
||||||
</div>
|
</div> */}
|
||||||
<Messages
|
<Messages
|
||||||
messageType={messageType}
|
messageType={messageType}
|
||||||
messageData={messageData}
|
messageData={messageData}
|
||||||
|
|
@ -499,7 +499,6 @@ const TipAmountSettlementList = () => {
|
||||||
<Col>
|
<Col>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="dateRange"
|
name="dateRange"
|
||||||
label="Date Range"
|
|
||||||
style={{ marginBottom: '8px' }}
|
style={{ marginBottom: '8px' }}
|
||||||
rules={[{ type: 'array', required: true, message: 'Please select date range' }]}
|
rules={[{ type: 'array', required: true, message: 'Please select date range' }]}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.BSItemCard-content {
|
.BSItemCard-content {
|
||||||
padding: 1px 0;
|
padding: 3px 0;
|
||||||
background-color: rgba(255, 255, 255, 0.8);
|
background-color: rgba(255, 255, 255, 0.8);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -96,7 +96,8 @@
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
max-width: 130px;
|
max-width: 130px;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-line-clamp: 3;
|
-webkit-line-clamp: 2;
|
||||||
|
line-height: 1;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1721,3 +1721,17 @@ table {
|
||||||
right: 2rem;
|
right: 2rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.addVariant {
|
||||||
|
background: #23378a29;
|
||||||
|
color: #23378a;
|
||||||
|
padding: 12px 24px;
|
||||||
|
border: none;
|
||||||
|
font-family: "Poppins", sans-serif;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 6px;
|
||||||
|
outline: none;
|
||||||
|
height: max-content;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,7 @@
|
||||||
font-weight: bold !important;
|
font-weight: bold !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// .viewerExcelupload table {
|
|
||||||
// // table-layout: auto !important;
|
|
||||||
// }
|
|
||||||
|
|
||||||
.viewerExcelupload::-webkit-scrollbar {
|
.viewerExcelupload::-webkit-scrollbar {
|
||||||
// display: block !important;
|
|
||||||
width: 0rem;
|
width: 0rem;
|
||||||
height: 0.5rem;
|
height: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
@ -28,7 +23,7 @@
|
||||||
background-color: #1292ee;
|
background-color: #1292ee;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
font-family: 'Poppins';
|
font-family: "Poppins";
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
|
|
@ -48,6 +43,8 @@
|
||||||
.tableExcelUpload {
|
.tableExcelUpload {
|
||||||
.ant-table-cell {
|
.ant-table-cell {
|
||||||
padding: 0 8px !important;
|
padding: 0 8px !important;
|
||||||
|
font-family: "Poppins";
|
||||||
|
font-weight: 500 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-select-selection-placeholder {
|
.ant-select-selection-placeholder {
|
||||||
|
|
@ -129,16 +126,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.mdsheet {
|
.mdsheet {
|
||||||
width: 25px;
|
width: 20px;
|
||||||
height: 25px;
|
height: 20px;
|
||||||
border: 1px solid #5bff73;
|
border: 1px solid #5bff73;
|
||||||
background-color: #b3ffbf;
|
background-color: #b3ffbf;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
.mdsheet2 {
|
.mdsheet2 {
|
||||||
width: 25px;
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
height: 25px;
|
|
||||||
background-color: #ffc7f8;
|
background-color: #ffc7f8;
|
||||||
border: 1px solid #ff74ec;
|
border: 1px solid #ff74ec;
|
||||||
}
|
}
|
||||||
|
|
@ -148,5 +145,88 @@
|
||||||
font-family: "Poppins";
|
font-family: "Poppins";
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
@media (max-width: 500px) {
|
||||||
|
font-size: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.field-setup-selected-fields {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 4px;
|
||||||
|
margin-bottom: 50px;
|
||||||
|
height: max-content;
|
||||||
|
max-height: 50vh;
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
|
.selected-field {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
background: #0bad77;
|
||||||
|
padding: 6px 10px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
.close-icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
> svg {
|
||||||
|
color: #ffffffff !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.HeadingUploadExl {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 1rem;
|
||||||
|
width: 50%;
|
||||||
|
@media (max-width: 950px) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.download-linkMain {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1rem;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
@media (max-width: 950px) {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.download-link {
|
||||||
|
width: 50%;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
@media (max-width: 950px) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.viewerExcelupload {
|
||||||
|
.ant-select-selection-item {
|
||||||
|
margin-top: 0 !important ;
|
||||||
|
padding-top: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.download-link span {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
.imgUpldr {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 2px;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -552,6 +552,9 @@ const TipAmountSettlementList = lazy(
|
||||||
const EmployeeSettlement = lazy(
|
const EmployeeSettlement = lazy(
|
||||||
() => import('./Pages/Reports/EmployeeSettlement/EmployeeSettlement.jsx')
|
() => import('./Pages/Reports/EmployeeSettlement/EmployeeSettlement.jsx')
|
||||||
);
|
);
|
||||||
|
const Settlement = lazy(
|
||||||
|
() => import ('./Pages/Reports/TipAmountSettlement/Settlement.jsx')
|
||||||
|
);
|
||||||
const PublicQrCode = lazy(() => import('./Pages/Reports/PublicQrCode.jsx'));
|
const PublicQrCode = lazy(() => import('./Pages/Reports/PublicQrCode.jsx'));
|
||||||
|
|
||||||
const TableMapping = lazy(
|
const TableMapping = lazy(
|
||||||
|
|
@ -684,7 +687,7 @@ const initSession = () => {
|
||||||
|
|
||||||
sessionStorage.setItem(
|
sessionStorage.setItem(
|
||||||
'auth',
|
'auth',
|
||||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiODA3MjMyOTE1MyIsIlBhc3N3b3JkIjoiWkB6MTIzNCIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTIiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTQiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiXSwiZXhwIjoxNzczNDI3NTExLCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMDEifQ.Elg8MMqbF4nMYwcWgzrxVaLfYhxdx3drixoV83RbuAM'
|
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiODA3MjMyOTE1MyIsIlBhc3N3b3JkIjoiWkB6MTIzNCIsImF1ZCI6WyJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTIiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTQiLCJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMTMiXSwiZXhwIjoxNzc0Mzc5NTY2LCJpc3MiOiJodHRwOi8vMTkyLjE2OC4xLjM3OjgwMDEifQ.uTdcz-FHE4GTux7FTtT2pQt9gEe-17_mIrwJWbHdHE8'
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -865,16 +868,22 @@ export const routesConfig = [
|
||||||
component: MenuQRCode,
|
component: MenuQRCode,
|
||||||
empAccess: 'MenuQRCode',
|
empAccess: 'MenuQRCode',
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// path: 'tipamountsettlementlist',
|
||||||
|
// component: TipAmountSettlementList,
|
||||||
|
// empAccess: 'Tips',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// path: 'EmployeeSettlement',
|
||||||
|
// component: EmployeeSettlement,
|
||||||
|
// empAccess: 'Incentive',
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
path: 'tipamountsettlementlist',
|
path: 'Settlement',
|
||||||
component: TipAmountSettlementList,
|
component: Settlement,
|
||||||
empAccess: 'Tips',
|
empAccess: 'Settlement',
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'EmployeeSettlement',
|
|
||||||
component: EmployeeSettlement,
|
|
||||||
empAccess: 'Incentive',
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: 'datewisereport',
|
path: 'datewisereport',
|
||||||
component: DateWiseReport,
|
component: DateWiseReport,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue