Merge pull request 'employee-Access' (#18) from employee-Access into main
Reviewed-on: Pozomind/pozo-retail-app#18
This commit is contained in:
commit
6a6baca89f
|
|
@ -444,7 +444,7 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
|
||||||
|
|
||||||
const SadminUserPurchaseMenuItem = [
|
const SadminUserPurchaseMenuItem = [
|
||||||
getsubItem('Purchase Order', `${subDirectory}setting/purchase-order`),
|
getsubItem('Purchase Order', `${subDirectory}setting/purchase-order`),
|
||||||
getsubItem('Purchase Entry', `${subDirectory}setting/purchase-entry/new`),
|
getsubItem('Product Receipt', `${subDirectory}setting/purchase-entry/new`),
|
||||||
getsubItem('Purchase Return', `${subDirectory}setting/purchase-return`),
|
getsubItem('Purchase Return', `${subDirectory}setting/purchase-return`),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -498,7 +498,7 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
|
||||||
),
|
),
|
||||||
!iswarehouse &&
|
!iswarehouse &&
|
||||||
getsubItem(
|
getsubItem(
|
||||||
'Counter Category Mapping',
|
'Counter Mapping',
|
||||||
`${subDirectory}setting/counter-category-mapping`
|
`${subDirectory}setting/counter-category-mapping`
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
@ -533,7 +533,7 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
|
||||||
getsubItem('Print Setup', `${subDirectory}saleslayouts/print-selection`),
|
getsubItem('Print Setup', `${subDirectory}saleslayouts/print-selection`),
|
||||||
getsubItem('Kiosk Setup', `${subDirectory}saleslayouts/kiosk-selection`),
|
getsubItem('Kiosk Setup', `${subDirectory}saleslayouts/kiosk-selection`),
|
||||||
getsubItem(
|
getsubItem(
|
||||||
'Barcode / Qr Setup',
|
'Barcode / QR',
|
||||||
`${subDirectory}saleslayouts/barcode-qr-selection`
|
`${subDirectory}saleslayouts/barcode-qr-selection`
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
@ -875,7 +875,7 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
|
||||||
`${subDirectory}setting/sales-bill-cancel`
|
`${subDirectory}setting/sales-bill-cancel`
|
||||||
),
|
),
|
||||||
getsubItem(
|
getsubItem(
|
||||||
'Product Return',
|
'Sales Product Return',
|
||||||
`${subDirectory}setting/sales-bill-product-return`
|
`${subDirectory}setting/sales-bill-product-return`
|
||||||
),
|
),
|
||||||
sportsAppPreference &&
|
sportsAppPreference &&
|
||||||
|
|
@ -1047,9 +1047,9 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
|
||||||
|
|
||||||
const Purchase = [
|
const Purchase = [
|
||||||
getsubItem('Automated Reorder', `${subDirectory}setting/automated-reorder`),
|
getsubItem('Automated Reorder', `${subDirectory}setting/automated-reorder`),
|
||||||
getsubItem('Purchase Order', `${subDirectory}setting/purchase-order/new`),
|
getsubItem('Purchase Order', `${subDirectory}setting/purchase-order`),
|
||||||
getsubItem('Product Receipt', `${subDirectory}setting/purchase-entry/new`),
|
getsubItem('Product Receipt', `${subDirectory}setting/purchase-entry`),
|
||||||
getsubItem('Product Return', `${subDirectory}setting/purchase-return`),
|
getsubItem('Product Return', `${subDirectory}setting/purchase-return/list`),
|
||||||
getsubItem(
|
getsubItem(
|
||||||
'Stock Adjustment',
|
'Stock Adjustment',
|
||||||
`${subDirectory}setting/stock-adjustment-list`
|
`${subDirectory}setting/stock-adjustment-list`
|
||||||
|
|
@ -1087,7 +1087,7 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
|
||||||
!sportsAppPreference &&
|
!sportsAppPreference &&
|
||||||
getsubItem(
|
getsubItem(
|
||||||
'DC to Invoice',
|
'DC to Invoice',
|
||||||
`${subDirectory}setting/delivery-challan-to-invoice`
|
`${subDirectory}setting/delivery-challan-to-invoice/list`
|
||||||
),
|
),
|
||||||
!iswarehouse &&
|
!iswarehouse &&
|
||||||
getsubItem('Customer', `${subDirectory}setting/customer-master`),
|
getsubItem('Customer', `${subDirectory}setting/customer-master`),
|
||||||
|
|
@ -1119,8 +1119,8 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
|
||||||
`${subDirectory}setting/sales-bill-cancel`
|
`${subDirectory}setting/sales-bill-cancel`
|
||||||
),
|
),
|
||||||
getsubItem(
|
getsubItem(
|
||||||
'Product Return',
|
'Sales Product Return',
|
||||||
`${subDirectory}setting/sales-bill-product-return`
|
`${subDirectory}setting/sales-bill-product-return/list`
|
||||||
),
|
),
|
||||||
sportsAppPreference &&
|
sportsAppPreference &&
|
||||||
getsubItem(
|
getsubItem(
|
||||||
|
|
@ -1139,8 +1139,8 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
|
||||||
const PurchaseMenuItem = [
|
const PurchaseMenuItem = [
|
||||||
getsubItem('Automated Reorder', `${subDirectory}setting/automated-reorder`),
|
getsubItem('Automated Reorder', `${subDirectory}setting/automated-reorder`),
|
||||||
getsubItem('Purchase Order', `${subDirectory}setting/purchase-order`),
|
getsubItem('Purchase Order', `${subDirectory}setting/purchase-order`),
|
||||||
getsubItem('Purchase Entry', `${subDirectory}setting/purchase-entry/new`),
|
getsubItem('Product Receipt', `${subDirectory}setting/purchase-entry/new`),
|
||||||
getsubItem('Purchase Return', `${subDirectory}setting/purchase-return`),
|
getsubItem('Product Return', `${subDirectory}setting/purchase-return`),
|
||||||
getsubItem(
|
getsubItem(
|
||||||
'Stock Adjustment',
|
'Stock Adjustment',
|
||||||
`${subDirectory}setting/stock-adjustment-list`
|
`${subDirectory}setting/stock-adjustment-list`
|
||||||
|
|
@ -1196,7 +1196,7 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
|
||||||
)
|
)
|
||||||
: '',
|
: '',
|
||||||
getsubItem(
|
getsubItem(
|
||||||
'Counter Category Mapping',
|
'Counter Mapping',
|
||||||
`${subDirectory}setting/counter-category-mapping`
|
`${subDirectory}setting/counter-category-mapping`
|
||||||
),
|
),
|
||||||
getsubItem('Image Bulk Upload', `${subDirectory}setting/image-bulk-upload`),
|
getsubItem('Image Bulk Upload', `${subDirectory}setting/image-bulk-upload`),
|
||||||
|
|
@ -1240,7 +1240,7 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
|
||||||
),
|
),
|
||||||
getsubItem('Sales Bill Cancel', `${subDirectory}setting/sales-bill-cancel`),
|
getsubItem('Sales Bill Cancel', `${subDirectory}setting/sales-bill-cancel`),
|
||||||
getsubItem(
|
getsubItem(
|
||||||
'Sales Bill Product Return',
|
'Sales Product Return',
|
||||||
`${subDirectory}setting/sales-bill-product-return`
|
`${subDirectory}setting/sales-bill-product-return`
|
||||||
),
|
),
|
||||||
sportsAppPreference &&
|
sportsAppPreference &&
|
||||||
|
|
@ -1845,7 +1845,7 @@ const customizedmenuitem = []
|
||||||
`${subDirectory}setting/sales-bill-cancel`
|
`${subDirectory}setting/sales-bill-cancel`
|
||||||
),
|
),
|
||||||
getsubItem(
|
getsubItem(
|
||||||
'Product Return',
|
'Sales Product Return',
|
||||||
`${subDirectory}setting/sales-bill-product-return`
|
`${subDirectory}setting/sales-bill-product-return`
|
||||||
),
|
),
|
||||||
sportsAppPreference &&
|
sportsAppPreference &&
|
||||||
|
|
@ -2433,7 +2433,7 @@ const customizedmenuitem = []
|
||||||
),
|
),
|
||||||
!sportsAppPreference &&
|
!sportsAppPreference &&
|
||||||
getsubItem(
|
getsubItem(
|
||||||
'Product Return',
|
'Sales Product Return',
|
||||||
`${subDirectory}setting/sales-bill-product-return`
|
`${subDirectory}setting/sales-bill-product-return`
|
||||||
),
|
),
|
||||||
sportsAppPreference &&
|
sportsAppPreference &&
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
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 } from "../../Features/AppPage/CenterPage";
|
import { changeBreadCrumb, getEmpAccess } from "../../Features/AppPage/CenterPage";
|
||||||
import { Messages } from "../../Components/Notifications/Messages";
|
import { Messages } from "../../Components/Notifications/Messages";
|
||||||
import { Tables } from "../../Components/Tables/Table";
|
import { Tables } from "../../Components/Tables/Table";
|
||||||
import FormHeader from "../PageComponents/FormHeader";
|
import FormHeader from "../PageComponents/FormHeader";
|
||||||
|
|
@ -19,6 +19,7 @@ import { deleteAutomatedReorder, getAutomatedReorderList } from "../../Features/
|
||||||
import { DefaultModal } from "../../Components/Modal/DefaultModal";
|
import { DefaultModal } from "../../Components/Modal/DefaultModal";
|
||||||
import { FaRegEye } from "react-icons/fa";
|
import { FaRegEye } from "react-icons/fa";
|
||||||
import { render } from "react-dom";
|
import { render } from "react-dom";
|
||||||
|
import { useAuth } from "../../AuthContext";
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
|
|
||||||
|
|
@ -40,11 +41,18 @@ const AutomatedReorderList = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const state = location?.state;
|
const state = location?.state;
|
||||||
|
const { SadminuserAccess } = useAuth();
|
||||||
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
|
(e) => e?.MenuName === 'Product Receipt'
|
||||||
|
);
|
||||||
|
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
const CompId = getSession('CompId');
|
const CompId = getSession('CompId');
|
||||||
const BranchId = getSession('BranchId');
|
const BranchId = getSession('BranchId');
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
|
const UserType = getSession('UserType');
|
||||||
|
const [empData, setEmpData] = useState();
|
||||||
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
|
|
||||||
const [messageType, setMessageType] = useState(null);
|
const [messageType, setMessageType] = useState(null);
|
||||||
const [messageData, setMessageData] = useState(null);
|
const [messageData, setMessageData] = useState(null);
|
||||||
|
|
@ -176,6 +184,40 @@ const AutomatedReorderList = () => {
|
||||||
}
|
}
|
||||||
}, [AppId, CompId, BranchId]);
|
}, [AppId, CompId, BranchId]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === 'Employee') {
|
||||||
|
fetchApi();
|
||||||
|
}
|
||||||
|
}, [UserType]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
|
||||||
|
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
||||||
|
hasAccess = true;
|
||||||
|
} else if (UserType === 'Employee') {
|
||||||
|
hasAccess = empData?.AddAccess === 'Y';
|
||||||
|
} else if (UserType === 'Super Admin User') {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
|
||||||
|
const fetchApi = async () => {
|
||||||
|
let data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
EmpId: UserId,
|
||||||
|
};
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
|
(item) => item.ConfigName === 'Automated Reorder'
|
||||||
|
);
|
||||||
|
setEmpData(datas?.[0]);
|
||||||
|
};
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await dispatch(getAutomatedReorderList({ AppId, CompId, BranchId }))?.unwrap();
|
const res = await dispatch(getAutomatedReorderList({ AppId, CompId, BranchId }))?.unwrap();
|
||||||
|
|
@ -251,6 +293,7 @@ const AutomatedReorderList = () => {
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText={'Add New'}
|
buttonText={'Add New'}
|
||||||
handleSubmit={handleAdd}
|
handleSubmit={handleAdd}
|
||||||
|
disabled={addnewAccess}
|
||||||
color="901D77"
|
color="901D77"
|
||||||
icon={<PlusOutlined />}
|
icon={<PlusOutlined />}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ const BarcodeTemplateSetup = () => {
|
||||||
|
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
const SAAccessCommonMaster = SadminuserAccess?.find(
|
const SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Barcode / Qr Setup'
|
(e) => e?.MenuName === 'Barcode / QR'
|
||||||
);
|
);
|
||||||
// useDispatch
|
// useDispatch
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
@ -335,7 +335,7 @@ const BarcodeTemplateSetup = () => {
|
||||||
};
|
};
|
||||||
let response = await dispatch(getEmpAccess(data)).unwrap();
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
(item) => item.ConfigName === 'Barcode / Qr Setup'
|
(item) => item.ConfigName === 'Barcode / QR'
|
||||||
);
|
);
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2208,7 +2208,15 @@ const ComboSalesBillTable = () => {
|
||||||
{row?.BrandName ? ` ${row.BrandName}` : ''}
|
{row?.BrandName ? ` ${row.BrandName}` : ''}
|
||||||
{row?.Type !== 'C' && (
|
{row?.Type !== 'C' && (
|
||||||
<p className="Tbl3-Variant">
|
<p className="Tbl3-Variant">
|
||||||
{row?.ProdVariantName} {row?.Size} {row?.UomName}
|
{/* {row?.ProdVariantName} {row?.Size} {row?.UomName} */}
|
||||||
|
(
|
||||||
|
{!row?.ProdVariantName?.toLowerCase()?.includes(
|
||||||
|
'variant'
|
||||||
|
) && <span>{row?.ProdVariantName} </span>}
|
||||||
|
{row?.Size}
|
||||||
|
{row?.SinglePc == 'Y' ? 'PCS' : row?.UomName}
|
||||||
|
|
||||||
|
)
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{row?.Type === 'C' &&
|
{row?.Type === 'C' &&
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,15 @@ import { getSession } from '../../../../Services/Others';
|
||||||
import Buttons from '../../../../Components/Forms/Buttons';
|
import Buttons from '../../../../Components/Forms/Buttons';
|
||||||
import { BiSkipNext, BiSkipPrevious } from 'react-icons/bi';
|
import { BiSkipNext, BiSkipPrevious } from 'react-icons/bi';
|
||||||
import { MdOutlineDisplaySettings } from "react-icons/md";
|
import { MdOutlineDisplaySettings } from "react-icons/md";
|
||||||
|
import { useAuth } from '../../../../AuthContext';
|
||||||
|
import { getEmpAccess } from '../../../../Features/AppPage/CenterPage';
|
||||||
|
|
||||||
|
|
||||||
const BookingSelectionPage = (props) => {
|
const BookingSelectionPage = (props) => {
|
||||||
|
const { SadminuserAccess } = useAuth();
|
||||||
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
|
(e) => e?.MenuName === 'Sales Screen'
|
||||||
|
);
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
const CompId = getSession('CompId');
|
const CompId = getSession('CompId');
|
||||||
|
|
@ -42,6 +47,8 @@ const BookingSelectionPage = (props) => {
|
||||||
console.log(SelectedTheme, "currentSlide")
|
console.log(SelectedTheme, "currentSlide")
|
||||||
const [OthersCount, setOthersCount] = useState(1);
|
const [OthersCount, setOthersCount] = useState(1);
|
||||||
const [isNext, isSetNext] = useState(true);
|
const [isNext, isSetNext] = useState(true);
|
||||||
|
const [empData, setEmpData] = useState();
|
||||||
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
const rightIsLastSlide = currentSlide === mergedThemes.length - 1;
|
const rightIsLastSlide = currentSlide === mergedThemes.length - 1;
|
||||||
const leftIsFirstSlide = currentSlide === 0 && OthersCount > 1;
|
const leftIsFirstSlide = currentSlide === 0 && OthersCount > 1;
|
||||||
const [pendingSlide, setPendingSlide] = useState(null);
|
const [pendingSlide, setPendingSlide] = useState(null);
|
||||||
|
|
@ -64,6 +71,40 @@ const BookingSelectionPage = (props) => {
|
||||||
GetOthersTemplate()
|
GetOthersTemplate()
|
||||||
// gettemplatedetail()
|
// gettemplatedetail()
|
||||||
}, [])
|
}, [])
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === 'Employee') {
|
||||||
|
fetchApi();
|
||||||
|
}
|
||||||
|
}, [UserType]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
|
||||||
|
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
||||||
|
hasAccess = true;
|
||||||
|
} else if (UserType === 'Employee') {
|
||||||
|
hasAccess = empData?.AddAccess === 'Y';
|
||||||
|
} else if (UserType === 'Super Admin User') {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
|
||||||
|
const fetchApi = async () => {
|
||||||
|
let data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
EmpId: UserId,
|
||||||
|
};
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
|
(item) => item.ConfigName === 'Sales Screen'
|
||||||
|
);
|
||||||
|
setEmpData(datas?.[0]);
|
||||||
|
};
|
||||||
|
|
||||||
const gettemplatedetail = async () => {
|
const gettemplatedetail = async () => {
|
||||||
let tempdetail = await dispatch(
|
let tempdetail = await dispatch(
|
||||||
getTemplate({ CompId: CompId, BranchId: BranchId, AppId: AppId })
|
getTemplate({ CompId: CompId, BranchId: BranchId, AppId: AppId })
|
||||||
|
|
@ -305,6 +346,7 @@ const BookingSelectionPage = (props) => {
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText="Save"
|
buttonText="Save"
|
||||||
color="901D77"
|
color="901D77"
|
||||||
|
disabled = {addnewAccess}
|
||||||
handleSubmit={handleMainSubmit}
|
handleSubmit={handleMainSubmit}
|
||||||
icon={<ArrowRightOutlined />}
|
icon={<ArrowRightOutlined />}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ const SelectionComponent = forwardRef((props, ref) => {
|
||||||
console.log(SadminuserAccess, 'SadminuserAccess');
|
console.log(SadminuserAccess, 'SadminuserAccess');
|
||||||
|
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Sales Setup'
|
(e) => e?.MenuName === 'Sales Screen'
|
||||||
);
|
);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const formRef = useRef(null);
|
const formRef = useRef(null);
|
||||||
|
|
@ -453,7 +453,7 @@ const SelectionComponent = forwardRef((props, ref) => {
|
||||||
};
|
};
|
||||||
let response = await dispatch(getEmpAccess(data)).unwrap();
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
(item) => item.ConfigName === 'Sales Setup'
|
(item) => item.ConfigName === 'Sales Screen'
|
||||||
);
|
);
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ const SelectionComponent = forwardRef((props, ref) => {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Print Setup'
|
(e) => e?.MenuName === 'Print Forms'
|
||||||
);
|
);
|
||||||
|
|
||||||
const formRef = useRef(null);
|
const formRef = useRef(null);
|
||||||
|
|
@ -395,7 +395,7 @@ const SelectionComponent = forwardRef((props, ref) => {
|
||||||
};
|
};
|
||||||
let response = await dispatch(getEmpAccess(data)).unwrap();
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
(item) => item.ConfigName === 'Print Setup'
|
(item) => item.ConfigName === 'Print Forms'
|
||||||
);
|
);
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ const CancellationList = () => {
|
||||||
console.log(SadminuserAccess, 'SadminuserAccess');
|
console.log(SadminuserAccess, 'SadminuserAccess');
|
||||||
|
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Cancellation and Reschedule Rules'
|
(e) => e?.MenuName === 'Cancel / Reschedule'
|
||||||
);
|
);
|
||||||
|
|
||||||
const navigateTo = useNavigate();
|
const navigateTo = useNavigate();
|
||||||
|
|
@ -234,7 +234,7 @@ const CancellationList = () => {
|
||||||
};
|
};
|
||||||
let response = await dispatch(getEmpAccess(data)).unwrap();
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
(item) => item.ConfigName === 'Cancellation and Reschedule Rules'
|
(item) => item.ConfigName === 'Cancel / Reschedule'
|
||||||
);
|
);
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ const valueStyle = {
|
||||||
const ChangePaymentmode = () => {
|
const ChangePaymentmode = () => {
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Cancel Payment Change'
|
(e) => e?.MenuName === 'Payment Mode Change'
|
||||||
);
|
);
|
||||||
|
|
||||||
const formRef = useRef();
|
const formRef = useRef();
|
||||||
|
|
@ -182,6 +182,11 @@ const ChangePaymentmode = () => {
|
||||||
getCreditcustDetail();
|
getCreditcustDetail();
|
||||||
}, [SelectCustId, SelectCust]);
|
}, [SelectCustId, SelectCust]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === 'Employee') {
|
||||||
|
fetchApi();
|
||||||
|
}
|
||||||
|
}, [UserType]);
|
||||||
const fetchApi = async () => {
|
const fetchApi = async () => {
|
||||||
let data = {
|
let data = {
|
||||||
CompId: CompId,
|
CompId: CompId,
|
||||||
|
|
@ -191,7 +196,7 @@ const ChangePaymentmode = () => {
|
||||||
};
|
};
|
||||||
let response = await dispatch(getEmpAccess(data)).unwrap();
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
(item) => item.ConfigName === 'Cancel Payment Change'
|
(item) => item.ConfigName === 'Payment Mode Change'
|
||||||
);
|
);
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
|
|
@ -2119,7 +2124,7 @@ const ChangePaymentmode = () => {
|
||||||
buttonText="SUBMIT"
|
buttonText="SUBMIT"
|
||||||
color="901D77"
|
color="901D77"
|
||||||
icon={<ArrowRightOutlined />}
|
icon={<ArrowRightOutlined />}
|
||||||
disabled={addnewAccess ? false : isdisabled}
|
disabled={addnewAccess}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import { PlusOutlined } from '@ant-design/icons';
|
||||||
import { Messages } from '../../Components/Notifications/Messages';
|
import { Messages } from '../../Components/Notifications/Messages';
|
||||||
import { Tables } from '../../Components/Tables/Table';
|
import { Tables } from '../../Components/Tables/Table';
|
||||||
import { Search } from '../../Components/Forms/Search';
|
import { Search } from '../../Components/Forms/Search';
|
||||||
import { changeBreadCrumb } from '../../Features/AppPage/CenterPage.js';
|
import { changeBreadCrumb, getEmpAccess } from '../../Features/AppPage/CenterPage.js';
|
||||||
import { BsEye } from "react-icons/bs";
|
import { BsEye } from "react-icons/bs";
|
||||||
import Buttons from '../../Components/Forms/Buttons';
|
import Buttons from '../../Components/Forms/Buttons';
|
||||||
import { getSession } from '../../Services/Others';
|
import { getSession } from '../../Services/Others';
|
||||||
|
|
@ -14,6 +14,7 @@ import FormHeader from '../PageComponents/FormHeader.jsx';
|
||||||
import { getSalesReturn } from '../../Features/CancelReschedule/CancelApplicableProd.js';
|
import { getSalesReturn } from '../../Features/CancelReschedule/CancelApplicableProd.js';
|
||||||
import '../../Styles/OverAllStyle/OverAllStyle.scss';
|
import '../../Styles/OverAllStyle/OverAllStyle.scss';
|
||||||
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
|
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
|
||||||
|
import { useAuth } from '../../AuthContext.jsx';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
const items = [
|
const items = [
|
||||||
|
|
@ -33,16 +34,24 @@ const items = [
|
||||||
];
|
];
|
||||||
|
|
||||||
const SalesBillProductReturnList = () => {
|
const SalesBillProductReturnList = () => {
|
||||||
|
const { SadminuserAccess } = useAuth();
|
||||||
|
const SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
|
(e) => e?.MenuName === 'Sales Product Return'
|
||||||
|
);
|
||||||
const [page, setpage] = useState(1);
|
const [page, setpage] = useState(1);
|
||||||
const CompId = getSession('CompId');
|
const CompId = getSession('CompId');
|
||||||
const BranchId = getSession('BranchId');
|
const BranchId = getSession('BranchId');
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
|
const UserId = getSession('UserId');
|
||||||
|
const UserType = getSession('UserType');
|
||||||
const navigateTo = useNavigate();
|
const navigateTo = useNavigate();
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const [tabledata, setTabledata] = useState();
|
const [tabledata, setTabledata] = useState();
|
||||||
const [message, setMessage] = useState({ type: null, data: null });
|
const [message, setMessage] = useState({ type: null, data: null });
|
||||||
const [searchedText, setSearchedText] = useState('');
|
const [searchedText, setSearchedText] = useState('');
|
||||||
const [sortedInfo, setSortedInfo] = useState({});
|
const [sortedInfo, setSortedInfo] = useState({});
|
||||||
|
const [empData, setEmpData] = useState();
|
||||||
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
const [productDetailsModel, setProductDetailsModel] = useState({
|
const [productDetailsModel, setProductDetailsModel] = useState({
|
||||||
model: false,
|
model: false,
|
||||||
data: []
|
data: []
|
||||||
|
|
@ -98,6 +107,38 @@ const SalesBillProductReturnList = () => {
|
||||||
setMessage({ type: null, data: null })
|
setMessage({ type: null, data: null })
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
||||||
|
hasAccess = true;
|
||||||
|
} else if (UserType === 'Employee') {
|
||||||
|
hasAccess = empData?.AddAccess === 'Y';
|
||||||
|
} else if (UserType === 'Super Admin User') {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === "Employee") {
|
||||||
|
fetchApi()
|
||||||
|
}
|
||||||
|
}, [UserType])
|
||||||
|
const fetchApi = async () => {
|
||||||
|
let data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
EmpId: UserId,
|
||||||
|
};
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
|
(item) => item.ConfigName === 'Sales Product Return'
|
||||||
|
);
|
||||||
|
setEmpData(datas?.[0]);
|
||||||
|
};
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: 'Sl.No',
|
title: 'Sl.No',
|
||||||
|
|
@ -170,6 +211,7 @@ const SalesBillProductReturnList = () => {
|
||||||
buttonText={'Add New'}
|
buttonText={'Add New'}
|
||||||
handleSubmit={() => handelAddButton()}
|
handleSubmit={() => handelAddButton()}
|
||||||
color="901D77"
|
color="901D77"
|
||||||
|
disabled={addnewAccess}
|
||||||
icon={<PlusOutlined />}
|
icon={<PlusOutlined />}
|
||||||
>
|
>
|
||||||
OPEN
|
OPEN
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ const items = [
|
||||||
const ComboList = () => {
|
const ComboList = () => {
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Combo Product'
|
(e) => e?.MenuName === 'Add Product'
|
||||||
);
|
);
|
||||||
console.log(SadminuserAccess, 'SadminuserAccessSadminuserAccess');
|
console.log(SadminuserAccess, 'SadminuserAccessSadminuserAccess');
|
||||||
|
|
||||||
|
|
@ -205,7 +205,7 @@ const ComboList = () => {
|
||||||
};
|
};
|
||||||
let response = await dispatch(getEmpAccess(data)).unwrap();
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
(item) => item.ConfigName === 'Combo Product'
|
(item) => item.ConfigName === 'Add Product'
|
||||||
);
|
);
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ import { isMobile } from 'react-device-detect';
|
||||||
const DeliveryChellanForm = () => {
|
const DeliveryChellanForm = () => {
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Delivery challan'
|
(e) => e?.MenuName === 'Delivery Challan'
|
||||||
);
|
);
|
||||||
const formRef = useRef(null);
|
const formRef = useRef(null);
|
||||||
const transportFormRef = useRef(null);
|
const transportFormRef = useRef(null);
|
||||||
|
|
@ -182,7 +182,7 @@ const DeliveryChellanForm = () => {
|
||||||
};
|
};
|
||||||
let response = await dispatch(getEmpAccess(data)).unwrap();
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
(item) => item.ConfigName === 'Purchase Quotation'
|
(item) => item.ConfigName === 'Delivery Challan'
|
||||||
);
|
);
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ const items = [
|
||||||
const EmployeeMaster = () => {
|
const EmployeeMaster = () => {
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Employee'
|
(e) => e?.MenuName === 'Add Employee'
|
||||||
);
|
);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
@ -144,7 +144,7 @@ const EmployeeMaster = () => {
|
||||||
})
|
})
|
||||||
).unwrap();
|
).unwrap();
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
(item) => item.ConfigName === 'Employee'
|
(item) => item.ConfigName === 'Add Employee'
|
||||||
);
|
);
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ const ExchangeAndReplacementList = () => {
|
||||||
const UserType = getSession('UserType');
|
const UserType = getSession('UserType');
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
|
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find((e) => e?.MenuName === 'ExchangeAndReplacement');
|
let SAAccessCommonMaster = SadminuserAccess?.find((e) => e?.MenuName === 'Exchange / Return');
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
|
|
@ -87,7 +87,7 @@ const ExchangeAndReplacementList = () => {
|
||||||
})
|
})
|
||||||
).unwrap();
|
).unwrap();
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
(item) => item.ConfigName === 'ExchangeAndReplacement'
|
(item) => item.ConfigName === 'Exchange / Return'
|
||||||
);
|
);
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import Search from '../../Components/Forms/Search';
|
||||||
import { Tables } from '../../Components/Tables/Table';
|
import { Tables } from '../../Components/Tables/Table';
|
||||||
import FormHeader from '../PageComponents/FormHeader';
|
import FormHeader from '../PageComponents/FormHeader';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { changeBreadCrumb } from '../../Features/AppPage/CenterPage';
|
import { changeBreadCrumb, getEmpAccess } from '../../Features/AppPage/CenterPage';
|
||||||
import {
|
import {
|
||||||
DeleteFilled,
|
DeleteFilled,
|
||||||
EditFilled,
|
EditFilled,
|
||||||
|
|
@ -26,7 +26,7 @@ import {
|
||||||
import { Space, Table, message, Modal, Alert } from 'antd';
|
import { Space, Table, message, Modal, Alert } from 'antd';
|
||||||
import { DefaultModal } from '../../Components/Modal/DefaultModal';
|
import { DefaultModal } from '../../Components/Modal/DefaultModal';
|
||||||
import { IoEye } from 'react-icons/io5';
|
import { IoEye } from 'react-icons/io5';
|
||||||
|
import { useAuth } from '../../AuthContext';
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
|
|
@ -40,6 +40,11 @@ const items = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const ExchangeReturnMapList = () => {
|
const ExchangeReturnMapList = () => {
|
||||||
|
|
||||||
|
const { SadminuserAccess } = useAuth();
|
||||||
|
const SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
|
(e) => e?.MenuName === 'Rules Mapping'
|
||||||
|
);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const CompId = getSession('CompId');
|
const CompId = getSession('CompId');
|
||||||
const BranchId = getSession('BranchId');
|
const BranchId = getSession('BranchId');
|
||||||
|
|
@ -53,7 +58,7 @@ const ExchangeReturnMapList = () => {
|
||||||
const [messageData, setMessageData] = useState(null);
|
const [messageData, setMessageData] = useState(null);
|
||||||
|
|
||||||
// Add missing variables for access control
|
// Add missing variables for access control
|
||||||
const [SAAccessCommonMaster, setSAAccessCommonMaster] = useState({});
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
const [empData, setEmpData] = useState({});
|
const [empData, setEmpData] = useState({});
|
||||||
|
|
||||||
const [sortedInfo, setSortedInfo] = useState({});
|
const [sortedInfo, setSortedInfo] = useState({});
|
||||||
|
|
@ -132,6 +137,38 @@ const ExchangeReturnMapList = () => {
|
||||||
// }
|
// }
|
||||||
// };
|
// };
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
||||||
|
hasAccess = true;
|
||||||
|
} else if (UserType === 'Employee') {
|
||||||
|
hasAccess = empData?.AddAccess === 'Y';
|
||||||
|
} else if (UserType === 'Super Admin User') {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === "Employee") {
|
||||||
|
fetchApiEmpAccess()
|
||||||
|
}
|
||||||
|
}, [UserType])
|
||||||
|
const fetchApiEmpAccess = async () => {
|
||||||
|
let data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
EmpId: UserId,
|
||||||
|
};
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
|
(item) => item.ConfigName === 'Rules Mapping'
|
||||||
|
);
|
||||||
|
setEmpData(datas?.[0]);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const statusDeactive = async (data) => {
|
const statusDeactive = async (data) => {
|
||||||
let deleteData = {
|
let deleteData = {
|
||||||
PolicyId: data.PolicyId,
|
PolicyId: data.PolicyId,
|
||||||
|
|
@ -270,7 +307,7 @@ const ExchangeReturnMapList = () => {
|
||||||
(UserType === 'Super Admin User' &&
|
(UserType === 'Super Admin User' &&
|
||||||
SAAccessCommonMaster?.UpdateAccess === 'Y') ||
|
SAAccessCommonMaster?.UpdateAccess === 'Y') ||
|
||||||
(UserType === 'Employee' &&
|
(UserType === 'Employee' &&
|
||||||
empData?.UpdateAccess === 'Y') ||
|
addnewAccess) ||
|
||||||
UserType === 'Admin'
|
UserType === 'Admin'
|
||||||
? actionsFormatter(record, index)
|
? actionsFormatter(record, index)
|
||||||
: null
|
: null
|
||||||
|
|
@ -301,7 +338,7 @@ const ExchangeReturnMapList = () => {
|
||||||
(UserType === 'Super Admin User' &&
|
(UserType === 'Super Admin User' &&
|
||||||
SAAccessCommonMaster?.DeleteAccess === 'Y') ||
|
SAAccessCommonMaster?.DeleteAccess === 'Y') ||
|
||||||
(UserType === 'Employee' &&
|
(UserType === 'Employee' &&
|
||||||
empData?.DeleteAccess === 'Y') ||
|
addnewAccess) ||
|
||||||
UserType === 'Admin'
|
UserType === 'Admin'
|
||||||
? statusDeactive(record)
|
? statusDeactive(record)
|
||||||
: null
|
: null
|
||||||
|
|
@ -441,6 +478,7 @@ const ExchangeReturnMapList = () => {
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText={'Add New '}
|
buttonText={'Add New '}
|
||||||
handleSubmit={handleAddNew}
|
handleSubmit={handleAddNew}
|
||||||
|
disabled={addnewAccess}
|
||||||
icon={<PlusOutlined />}
|
icon={<PlusOutlined />}
|
||||||
color="901D77"
|
color="901D77"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -19,23 +19,31 @@ import { deleteOfferCodeData, getCodeBaseProductData, putOfferCodeData } from '.
|
||||||
import {
|
import {
|
||||||
ReloadOutlined,
|
ReloadOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { changeBreadCrumb } from '../../../Features/AppPage/CenterPage.js';
|
import { changeBreadCrumb, getEmpAccess } from '../../../Features/AppPage/CenterPage.js';
|
||||||
|
import { useAuth } from '../../../AuthContext.jsx';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
|
|
||||||
const CodeBaseList = () => {
|
const CodeBaseList = () => {
|
||||||
dayjs.extend(isSameOrBefore);
|
dayjs.extend(isSameOrBefore);
|
||||||
|
const { SadminuserAccess } = useAuth();
|
||||||
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
|
(e) => e?.MenuName === 'Code Based'
|
||||||
|
);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const AppId = getSession("AppId")
|
const AppId = getSession("AppId")
|
||||||
const CompId = getSession('CompId');
|
const CompId = getSession('CompId');
|
||||||
const BranchId = getSession('BranchId');
|
const BranchId = getSession('BranchId');
|
||||||
|
const UserType = getSession('UserType');
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
|
|
||||||
const [productdata, setProductdata] = useState()
|
const [productdata, setProductdata] = useState()
|
||||||
const [searchText, setSearchText] = useState("");
|
const [searchText, setSearchText] = useState("");
|
||||||
const [messageType, setMessageType] = useState(null);
|
const [messageType, setMessageType] = useState(null);
|
||||||
const [messageData, setMessageData] = useState(null);
|
const [messageData, setMessageData] = useState(null);
|
||||||
|
const [empData, setEmpData] = useState();
|
||||||
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
const [variantModal, setVariantModal] = useState({
|
const [variantModal, setVariantModal] = useState({
|
||||||
open: false,
|
open: false,
|
||||||
variants: [],
|
variants: [],
|
||||||
|
|
@ -68,6 +76,38 @@ const CodeBaseList = () => {
|
||||||
dispatch(changeBreadCrumb({ items: items }));
|
dispatch(changeBreadCrumb({ items: items }));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
||||||
|
hasAccess = true;
|
||||||
|
} else if (UserType === 'Employee') {
|
||||||
|
hasAccess = empData?.AddAccess === 'Y';
|
||||||
|
} else if (UserType === 'Super Admin User') {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === "Employee") {
|
||||||
|
fetchApi()
|
||||||
|
}
|
||||||
|
}, [UserType])
|
||||||
|
const fetchApi = async () => {
|
||||||
|
let data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
EmpId: UserId,
|
||||||
|
};
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
|
(item) => item.ConfigName === 'Code Based'
|
||||||
|
);
|
||||||
|
setEmpData(datas?.[0]);
|
||||||
|
};
|
||||||
const onSearch = (value) => {
|
const onSearch = (value) => {
|
||||||
setSearchText(value.toLowerCase());
|
setSearchText(value.toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
@ -137,6 +177,13 @@ const CodeBaseList = () => {
|
||||||
setMessageType(null);
|
setMessageType(null);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const canUpdate =
|
||||||
|
UserType === 'Super Admin' ||
|
||||||
|
UserType === 'Admin' ||
|
||||||
|
(UserType === 'Super Admin User' &&
|
||||||
|
SAAccessCommonMaster?.UpdateAccess === 'Y') ||
|
||||||
|
(UserType === 'Employee' && empData?.UpdateAccess === 'Y');
|
||||||
|
|
||||||
const generalColumns = [
|
const generalColumns = [
|
||||||
{
|
{
|
||||||
title: 'Sl.No',
|
title: 'Sl.No',
|
||||||
|
|
@ -231,40 +278,63 @@ const CodeBaseList = () => {
|
||||||
title: "Extend Date",
|
title: "Extend Date",
|
||||||
key: "extend",
|
key: "extend",
|
||||||
align: "center",
|
align: "center",
|
||||||
render: (_, record) => (
|
render: (_, record) => {
|
||||||
|
const canExtend =
|
||||||
|
record?.ActiveStatus === 'A' && canUpdate;
|
||||||
|
|
||||||
|
return (
|
||||||
<Button
|
<Button
|
||||||
className="extend-button"
|
className="extend-button"
|
||||||
onClick={() => handleView(record)}
|
onClick={() => {
|
||||||
disabled={record.ActiveStatus !== "A"}
|
if (!canExtend) return;
|
||||||
|
handleView(record);
|
||||||
|
}}
|
||||||
|
disabled={!canExtend}
|
||||||
style={{
|
style={{
|
||||||
opacity: record.ActiveStatus === "A" ? 1 : 0.6,
|
opacity: canExtend ? 1 : 0.6,
|
||||||
pointerEvents: record.ActiveStatus === "A" ? "auto" : "none",
|
pointerEvents: canExtend ? "auto" : "none",
|
||||||
height: "32px",
|
height: "32px",
|
||||||
width: '100px',
|
width: "100px",
|
||||||
padding: "1 12px",
|
padding: "1px 12px",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center"
|
justifyContent: "center",
|
||||||
|
cursor: canExtend ? "pointer" : "not-allowed",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extend
|
Extend
|
||||||
</Button>
|
</Button>
|
||||||
),
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "Actions",
|
title: "Actions",
|
||||||
key: "actions",
|
key: "actions",
|
||||||
render: (_, record, index) => (
|
render: (_, record, index) => {
|
||||||
|
const canUpdate =
|
||||||
|
UserType === "Super Admin" ||
|
||||||
|
UserType === "Admin" ||
|
||||||
|
(UserType === "Super Admin User" && SAAccessCommonMaster?.UpdateAccess === "Y") ||
|
||||||
|
(UserType === "Employee" && empData?.UpdateAccess === "Y");
|
||||||
|
|
||||||
|
const canDelete =
|
||||||
|
UserType === "Super Admin" ||
|
||||||
|
UserType === "Admin" ||
|
||||||
|
(UserType === "Super Admin User" && SAAccessCommonMaster?.DeleteAccess === "Y") ||
|
||||||
|
(UserType === "Employee" && empData?.DeleteAccess === "Y");
|
||||||
|
|
||||||
|
return (
|
||||||
<div style={{ display: "flex", gap: "8px" }}>
|
<div style={{ display: "flex", gap: "8px" }}>
|
||||||
<IoEyeOutline
|
<IoEyeOutline
|
||||||
color="#2563EA"
|
color="#2563EA"
|
||||||
size={18}
|
size={18}
|
||||||
|
style={{ cursor: "pointer" }}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
setVariantModal({
|
setVariantModal({
|
||||||
open: true,
|
open: true,
|
||||||
product: record, // store the selected product
|
product: record,
|
||||||
variants: record?.ProdOfferDetails || [],
|
variants: record?.ProdOfferDetails || [],
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
|
@ -272,9 +342,13 @@ const CodeBaseList = () => {
|
||||||
{record.ActiveStatus === "A" && (
|
{record.ActiveStatus === "A" && (
|
||||||
<FiEdit
|
<FiEdit
|
||||||
color="#2563EA"
|
color="#2563EA"
|
||||||
style={{ cursor: "pointer" }}
|
style={{
|
||||||
|
cursor: canUpdate ? "pointer" : "not-allowed",
|
||||||
|
opacity: canUpdate ? 1 : 0.5,
|
||||||
|
}}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
if (!canUpdate) return;
|
||||||
navigate(`${subDirectory}setting/code-base/new`, {
|
navigate(`${subDirectory}setting/code-base/new`, {
|
||||||
state: { formType: "edit", editOffer: record },
|
state: { formType: "edit", editOffer: record },
|
||||||
});
|
});
|
||||||
|
|
@ -285,25 +359,37 @@ const CodeBaseList = () => {
|
||||||
<RiDeleteBinLine
|
<RiDeleteBinLine
|
||||||
color="#2563EA"
|
color="#2563EA"
|
||||||
size={16}
|
size={16}
|
||||||
style={{ cursor: "pointer" }}
|
style={{
|
||||||
|
cursor: canDelete ? "pointer" : "not-allowed",
|
||||||
|
opacity: canDelete ? 1 : 0.5,
|
||||||
|
}}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
if (!canDelete) return;
|
||||||
statusFormatter(record, "D", index);
|
statusFormatter(record, "D", index);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<ReloadOutlined
|
<ReloadOutlined
|
||||||
style={{ color: "#2563EA", fontSize: "16px", cursor: "pointer" }}
|
style={{
|
||||||
|
color: "#2563EA",
|
||||||
|
fontSize: "16px",
|
||||||
|
cursor: canDelete ? "pointer" : "not-allowed",
|
||||||
|
opacity: canDelete ? 1 : 0.5,
|
||||||
|
}}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
if (!canDelete) return;
|
||||||
statusFormatter(record, "A", index);
|
statusFormatter(record, "A", index);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
),
|
);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -324,7 +410,8 @@ const CodeBaseList = () => {
|
||||||
|
|
||||||
<div className="offers-card">
|
<div className="offers-card">
|
||||||
<h3 className="offers-card__title">Code Base Offers</h3>
|
<h3 className="offers-card__title">Code Base Offers</h3>
|
||||||
<button className='CreateNewOfferBtn' onClick={handleNewOffer}>
|
<button className='CreateNewOfferBtn' onClick={handleNewOffer}
|
||||||
|
disabled={addnewAccess}>
|
||||||
Create New Offer
|
Create New Offer
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -18,23 +18,31 @@ import { deleteLoyaltyData, getLoyaltiPointsProductData, putLayoltiPointsData }
|
||||||
import {
|
import {
|
||||||
ReloadOutlined,
|
ReloadOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { changeBreadCrumb } from '../../../Features/AppPage/CenterPage.js';
|
import { changeBreadCrumb, getEmpAccess } from '../../../Features/AppPage/CenterPage.js';
|
||||||
|
import { useAuth } from '../../../AuthContext.jsx';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
|
|
||||||
const LoyaltyBasedList = () => {
|
const LoyaltyBasedList = () => {
|
||||||
dayjs.extend(isSameOrBefore);
|
dayjs.extend(isSameOrBefore);
|
||||||
|
const { SadminuserAccess } = useAuth();
|
||||||
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
|
(e) => e?.MenuName === 'Loyalty Points'
|
||||||
|
);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const AppId = getSession("AppId")
|
const AppId = getSession("AppId")
|
||||||
const CompId = getSession('CompId');
|
const CompId = getSession('CompId');
|
||||||
const BranchId = getSession('BranchId');
|
const BranchId = getSession('BranchId');
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
|
const UserType = getSession('UserType');
|
||||||
|
|
||||||
const [productdata, setProductdata] = useState()
|
const [productdata, setProductdata] = useState()
|
||||||
const [searchText, setSearchText] = useState("");
|
const [searchText, setSearchText] = useState("");
|
||||||
const [messageType, setMessageType] = useState(null);
|
const [messageType, setMessageType] = useState(null);
|
||||||
const [messageData, setMessageData] = useState(null);
|
const [messageData, setMessageData] = useState(null);
|
||||||
|
const [empData, setEmpData] = useState();
|
||||||
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
const [variantModal, setVariantModal] = useState({
|
const [variantModal, setVariantModal] = useState({
|
||||||
open: false,
|
open: false,
|
||||||
reward: null,
|
reward: null,
|
||||||
|
|
@ -69,6 +77,37 @@ const LoyaltyBasedList = () => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(changeBreadCrumb({ items: items }));
|
dispatch(changeBreadCrumb({ items: items }));
|
||||||
}, []);
|
}, []);
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
||||||
|
hasAccess = true;
|
||||||
|
} else if (UserType === 'Employee') {
|
||||||
|
hasAccess = empData?.AddAccess === 'Y';
|
||||||
|
} else if (UserType === 'Super Admin User') {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === "Employee") {
|
||||||
|
fetchApi()
|
||||||
|
}
|
||||||
|
}, [UserType])
|
||||||
|
const fetchApi = async () => {
|
||||||
|
let data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
EmpId: UserId,
|
||||||
|
};
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
|
(item) => item.ConfigName === 'Loyalty Points'
|
||||||
|
);
|
||||||
|
setEmpData(datas?.[0]);
|
||||||
|
};
|
||||||
|
|
||||||
const onSearch = (value) => {
|
const onSearch = (value) => {
|
||||||
setSearchText(value.toLowerCase());
|
setSearchText(value.toLowerCase());
|
||||||
|
|
@ -224,18 +263,31 @@ const LoyaltyBasedList = () => {
|
||||||
{
|
{
|
||||||
title: "Extend Days",
|
title: "Extend Days",
|
||||||
key: "extend",
|
key: "extend",
|
||||||
// align: "center",
|
render: (_, record) => {
|
||||||
render: (_, record) => (
|
const canExtend =
|
||||||
|
record.ActiveStatus === "A" &&
|
||||||
|
(
|
||||||
|
UserType === "Super Admin" ||
|
||||||
|
UserType === "Admin" ||
|
||||||
|
(UserType === "Super Admin User" && SAAccessCommonMaster?.UpdateAccess === "Y") ||
|
||||||
|
(UserType === "Employee" && empData?.UpdateAccess === "Y")
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
<Button
|
<Button
|
||||||
className="extend-button"
|
className="extend-button"
|
||||||
onClick={() => handleView(record)}
|
onClick={() => {
|
||||||
disabled={record.ActiveStatus !== "A"}
|
if (!canExtend) return;
|
||||||
|
handleView(record);
|
||||||
|
}}
|
||||||
|
disabled={!canExtend}
|
||||||
style={{
|
style={{
|
||||||
opacity: record.ActiveStatus === "A" ? 1 : 0.6,
|
opacity: canExtend ? 1 : 0.6,
|
||||||
pointerEvents: record.ActiveStatus === "A" ? "auto" : "none",
|
pointerEvents: canExtend ? "auto" : "none",
|
||||||
|
cursor: canExtend ? "pointer" : "not-allowed",
|
||||||
height: "32px",
|
height: "32px",
|
||||||
width: '100px',
|
width: '100px',
|
||||||
padding: "1 12px",
|
padding: "1px 12px",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center"
|
justifyContent: "center"
|
||||||
|
|
@ -243,13 +295,28 @@ const LoyaltyBasedList = () => {
|
||||||
>
|
>
|
||||||
Extend
|
Extend
|
||||||
</Button>
|
</Button>
|
||||||
),
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "Actions",
|
title: "Actions",
|
||||||
key: "actions",
|
key: "actions",
|
||||||
render: (_, record) => (
|
render: (_, record) => {
|
||||||
|
// Permission checks
|
||||||
|
const canUpdate =
|
||||||
|
UserType === "Super Admin" ||
|
||||||
|
UserType === "Admin" ||
|
||||||
|
(UserType === "Super Admin User" && SAAccessCommonMaster?.UpdateAccess === "Y") ||
|
||||||
|
(UserType === "Employee" && empData?.UpdateAccess === "Y");
|
||||||
|
|
||||||
|
const canDelete =
|
||||||
|
UserType === "Super Admin" ||
|
||||||
|
UserType === "Admin" ||
|
||||||
|
(UserType === "Super Admin User" && SAAccessCommonMaster?.DeleteAccess === "Y") ||
|
||||||
|
(UserType === "Employee" && empData?.DeleteAccess === "Y");
|
||||||
|
|
||||||
|
return (
|
||||||
<div style={{ display: "flex", gap: "8px" }}>
|
<div style={{ display: "flex", gap: "8px" }}>
|
||||||
{/* View - only if RewardType !== Cash */}
|
{/* View - only if RewardType !== Cash */}
|
||||||
{record?.RewardType !== "Cash" && (
|
{record?.RewardType !== "Cash" && (
|
||||||
|
|
@ -259,10 +326,7 @@ const LoyaltyBasedList = () => {
|
||||||
style={{ cursor: "pointer" }}
|
style={{ cursor: "pointer" }}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
setVariantModal({
|
setVariantModal({ open: true, product: record });
|
||||||
open: true,
|
|
||||||
product: record,
|
|
||||||
});
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
@ -272,9 +336,13 @@ const LoyaltyBasedList = () => {
|
||||||
<FiEdit
|
<FiEdit
|
||||||
color="#2563EA"
|
color="#2563EA"
|
||||||
size={14}
|
size={14}
|
||||||
style={{ cursor: "pointer" }}
|
style={{
|
||||||
|
cursor: canUpdate ? "pointer" : "not-allowed",
|
||||||
|
opacity: canUpdate ? 1 : 0.5,
|
||||||
|
}}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
if (!canUpdate) return;
|
||||||
navigate(`${subDirectory}setting/loyalty-based/update`, {
|
navigate(`${subDirectory}setting/loyalty-based/update`, {
|
||||||
state: { formType: "edit", editLoyalty: record },
|
state: { formType: "edit", editLoyalty: record },
|
||||||
});
|
});
|
||||||
|
|
@ -287,25 +355,37 @@ const LoyaltyBasedList = () => {
|
||||||
<RiDeleteBinLine
|
<RiDeleteBinLine
|
||||||
color="#2563EA"
|
color="#2563EA"
|
||||||
size={16}
|
size={16}
|
||||||
style={{ cursor: "pointer" }}
|
style={{
|
||||||
|
cursor: canDelete ? "pointer" : "not-allowed",
|
||||||
|
opacity: canDelete ? 1 : 0.5,
|
||||||
|
}}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
if (!canDelete) return;
|
||||||
statusFormatter(record, "D"); // deactivate
|
statusFormatter(record, "D"); // deactivate
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<ReloadOutlined
|
<ReloadOutlined
|
||||||
style={{ color: "#2563EA", fontSize: "14px", cursor: "pointer" }}
|
style={{
|
||||||
|
color: "#2563EA",
|
||||||
|
fontSize: "14px",
|
||||||
|
cursor: canDelete ? "pointer" : "not-allowed",
|
||||||
|
opacity: canDelete ? 1 : 0.5,
|
||||||
|
}}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
if (!canDelete) return;
|
||||||
statusFormatter(record, "A"); // reactivate
|
statusFormatter(record, "A"); // reactivate
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
),
|
);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -326,7 +406,7 @@ const LoyaltyBasedList = () => {
|
||||||
|
|
||||||
<div className="offers-card">
|
<div className="offers-card">
|
||||||
<h3 className="offers-card__title">Loyalty Points</h3>
|
<h3 className="offers-card__title">Loyalty Points</h3>
|
||||||
<button className='CreateNewOfferBtn' onClick={handleNewOffer}>
|
<button className='CreateNewOfferBtn' onClick={handleNewOffer} disabled={addnewAccess}>
|
||||||
Create New Offer
|
Create New Offer
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,8 @@ import {
|
||||||
} from '../../../Features/Offer/Offernew/Offernew.js';
|
} from '../../../Features/Offer/Offernew/Offernew.js';
|
||||||
|
|
||||||
import { Messages } from '../../../Components/Notifications/Messages.jsx';
|
import { Messages } from '../../../Components/Notifications/Messages.jsx';
|
||||||
import { changeBreadCrumb } from '../../../Features/AppPage/CenterPage.js';
|
import { changeBreadCrumb, getEmpAccess } from '../../../Features/AppPage/CenterPage.js';
|
||||||
|
import { useAuth } from '../../../AuthContext.jsx';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
const OfferListNew = () => {
|
const OfferListNew = () => {
|
||||||
|
|
@ -39,6 +40,8 @@ const OfferListNew = () => {
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
const CompId = getSession('CompId');
|
const CompId = getSession('CompId');
|
||||||
const BranchId = getSession('BranchId');
|
const BranchId = getSession('BranchId');
|
||||||
|
const UserType = getSession('UserType');
|
||||||
|
const UserId = getSession('UserId');
|
||||||
|
|
||||||
const [messageType, setMessageType] = useState(null);
|
const [messageType, setMessageType] = useState(null);
|
||||||
const [messageData, setMessageData] = useState(null);
|
const [messageData, setMessageData] = useState(null);
|
||||||
|
|
@ -46,6 +49,10 @@ const OfferListNew = () => {
|
||||||
const [page, setpage] = useState(1);
|
const [page, setpage] = useState(1);
|
||||||
const [sortedInfo, setSortedInfo] = useState({});
|
const [sortedInfo, setSortedInfo] = useState({});
|
||||||
|
|
||||||
|
const { SadminuserAccess } = useAuth();
|
||||||
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
|
(e) => e?.MenuName === 'Product Based'
|
||||||
|
);
|
||||||
console.log(products, 'products');
|
console.log(products, 'products');
|
||||||
|
|
||||||
const [allOffers, setAllOffers] = useState([]);
|
const [allOffers, setAllOffers] = useState([]);
|
||||||
|
|
@ -54,6 +61,8 @@ const OfferListNew = () => {
|
||||||
offer: null,
|
offer: null,
|
||||||
newToDate: null,
|
newToDate: null,
|
||||||
});
|
});
|
||||||
|
const [empData, setEmpData] = useState();
|
||||||
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
|
|
@ -540,6 +549,37 @@ const OfferListNew = () => {
|
||||||
// ])
|
// ])
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
||||||
|
hasAccess = true;
|
||||||
|
} else if (UserType === 'Employee') {
|
||||||
|
hasAccess = empData?.AddAccess === 'Y';
|
||||||
|
} else if (UserType === 'Super Admin User') {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === "Employee") {
|
||||||
|
fetchApi()
|
||||||
|
}
|
||||||
|
}, [UserType])
|
||||||
|
const fetchApi = async () => {
|
||||||
|
let data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
EmpId: UserId,
|
||||||
|
};
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
|
(item) => item.ConfigName === 'Product Based'
|
||||||
|
);
|
||||||
|
setEmpData(datas?.[0]);
|
||||||
|
};
|
||||||
function ExtractDateFormate(dateString) {
|
function ExtractDateFormate(dateString) {
|
||||||
if (!dateString) return '';
|
if (!dateString) return '';
|
||||||
|
|
||||||
|
|
@ -683,73 +723,131 @@ const OfferListNew = () => {
|
||||||
dataIndex: 'extend',
|
dataIndex: 'extend',
|
||||||
key: 'extend',
|
key: 'extend',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render: (_, record) =>
|
render: (_, record) => {
|
||||||
record?.ActiveStatus === 'A' ? (
|
|
||||||
|
const canUpdate =
|
||||||
|
UserType === 'Super Admin' ||
|
||||||
|
UserType === 'Admin' ||
|
||||||
|
(UserType === 'Super Admin User' &&
|
||||||
|
SAAccessCommonMaster?.UpdateAccess === 'Y') ||
|
||||||
|
(UserType === 'Employee' && empData?.UpdateAccess === 'Y');
|
||||||
|
|
||||||
|
const canEdit =
|
||||||
|
record?.ActiveStatus === 'A' && canUpdate;
|
||||||
|
|
||||||
|
return record?.ActiveStatus === 'A' ? (
|
||||||
<div
|
<div
|
||||||
className="extend-button"
|
className={canEdit ? 'extend-button' : 'extendisabled'}
|
||||||
onClick={() =>
|
onClick={() => {
|
||||||
setExtendModal({ open: true, offer: record, newToDate: null })
|
if (!canEdit) return;
|
||||||
}
|
setExtendModal({
|
||||||
|
open: true,
|
||||||
|
offer: record,
|
||||||
|
newToDate: null,
|
||||||
|
});
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
height: '32px',
|
height: '32px',
|
||||||
width: '100px',
|
width: '100px',
|
||||||
padding: '1 12px',
|
padding: '1px 12px',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
|
cursor: canEdit ? 'pointer' : 'not-allowed',
|
||||||
|
opacity: canEdit ? 1 : 0.5,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extend
|
Extend
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="extendisabled">Extend</div>
|
<div className="extendisabled">Extend</div>
|
||||||
),
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
title: 'Actions',
|
title: 'Actions',
|
||||||
dataIndex: 'actions',
|
dataIndex: 'actions',
|
||||||
key: 'actions',
|
key: 'actions',
|
||||||
render: (_, record, index) => (
|
render: (_, record, index) => {
|
||||||
|
|
||||||
|
const canUpdate =
|
||||||
|
UserType === 'Super Admin' ||
|
||||||
|
UserType === 'Admin' ||
|
||||||
|
(UserType === 'Super Admin User' && SAAccessCommonMaster?.UpdateAccess === 'Y') ||
|
||||||
|
(UserType === 'Employee' && empData?.UpdateAccess === 'Y');
|
||||||
|
|
||||||
|
const canDelete =
|
||||||
|
UserType === 'Super Admin' ||
|
||||||
|
UserType === 'Admin' ||
|
||||||
|
(UserType === 'Super Admin User' && SAAccessCommonMaster?.DeleteAccess === 'Y') ||
|
||||||
|
(UserType === 'Employee' && empData?.DeleteAccess === 'Y');
|
||||||
|
|
||||||
|
return (
|
||||||
<div style={{ display: 'flex', gap: '8px' }}>
|
<div style={{ display: 'flex', gap: '8px' }}>
|
||||||
<IoEyeOutline
|
<IoEyeOutline
|
||||||
color="#2563EA"
|
color="#2563EA"
|
||||||
size={18}
|
size={18}
|
||||||
|
style={{ cursor: 'pointer' }}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
(e.stopPropagation(),
|
e.stopPropagation();
|
||||||
setOpen((prev) => !prev),
|
setOpen((prev) => !prev);
|
||||||
setProducts(record));
|
setProducts(record);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{record.ActiveStatus == 'A' && (
|
|
||||||
|
{/* Edit */}
|
||||||
|
{record?.ActiveStatus === 'A' && (
|
||||||
<FiEdit
|
<FiEdit
|
||||||
color="#2563EA"
|
color="#2563EA"
|
||||||
|
style={{
|
||||||
|
cursor: canUpdate ? 'pointer' : 'not-allowed',
|
||||||
|
opacity: canUpdate ? 1 : 0.5,
|
||||||
|
}}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
(e.stopPropagation(), actionsFormatter(record, index));
|
e.stopPropagation();
|
||||||
|
if (!canUpdate) return;
|
||||||
|
actionsFormatter(record, index);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{record?.ActiveStatus == 'A' ? (
|
{record?.ActiveStatus === 'A' ? (
|
||||||
<RiDeleteBinLine
|
<RiDeleteBinLine
|
||||||
color="#2563EA"
|
color="#2563EA"
|
||||||
size={16}
|
size={16}
|
||||||
|
style={{
|
||||||
|
cursor: canDelete ? 'pointer' : 'not-allowed',
|
||||||
|
opacity: canDelete ? 1 : 0.5,
|
||||||
|
}}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
(e.stopPropagation(), statusFormatter(record, index));
|
e.stopPropagation();
|
||||||
|
if (!canDelete) return;
|
||||||
|
statusFormatter(record, index);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<ReloadOutlined
|
<ReloadOutlined
|
||||||
color="#2563EA"
|
color="#2563EA"
|
||||||
size={16}
|
size={16}
|
||||||
|
style={{
|
||||||
|
cursor: canDelete ? 'pointer' : 'not-allowed',
|
||||||
|
opacity: canDelete ? 1 : 0.5,
|
||||||
|
}}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
(e.stopPropagation(), statusFormatter(record, index));
|
e.stopPropagation();
|
||||||
|
if (!canDelete) return;
|
||||||
|
statusFormatter(record, index);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
),
|
);
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const handleNewOffer = () => {
|
const handleNewOffer = () => {
|
||||||
|
|
@ -797,7 +895,9 @@ const OfferListNew = () => {
|
||||||
<h3 className="offers-card__title">Product Offers</h3>
|
<h3 className="offers-card__title">Product Offers</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button className="CreateNewOfferBtn" onClick={handleNewOffer}>
|
<button className="CreateNewOfferBtn"
|
||||||
|
onClick={handleNewOffer}
|
||||||
|
disabled={addnewAccess}>
|
||||||
Create New Offer
|
Create New Offer
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ const colorText = 'Color : Red';
|
||||||
const ProductList = () => {
|
const ProductList = () => {
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Product'
|
(e) => e?.MenuName === 'Add Product'
|
||||||
);
|
);
|
||||||
const formRef = useRef();
|
const formRef = useRef();
|
||||||
// const ref1 = useRef(null);
|
// const ref1 = useRef(null);
|
||||||
|
|
@ -1708,7 +1708,7 @@ const ProductList = () => {
|
||||||
};
|
};
|
||||||
let response = await dispatch(getEmpAccess(data)).unwrap();
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
(item) => item.ConfigName === 'Product'
|
(item) => item.ConfigName === 'Add Product'
|
||||||
);
|
);
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -612,7 +612,7 @@ const SalesQuotationForm = () => {
|
||||||
};
|
};
|
||||||
let response = await dispatch(getEmpAccess(data)).unwrap();
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
(item) => item.ConfigName === 'Purchase Quotation'
|
(item) => item.ConfigName === 'Sales Quotation'
|
||||||
);
|
);
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
|
|
@ -1653,7 +1653,7 @@ const SalesQuotationForm = () => {
|
||||||
|
|
||||||
// Add these functions inside your component, before the return statement:
|
// Add these functions inside your component, before the return statement:
|
||||||
// const handleEmailClick = () => {
|
// const handleEmailClick = () => {
|
||||||
// const subject = encodeURIComponent('Purchase Quotation');
|
// const subject = encodeURIComponent('Sales Quotation');
|
||||||
// const body = encodeURIComponent('Please find attached the purchase quotation.');
|
// const body = encodeURIComponent('Please find attached the purchase quotation.');
|
||||||
// window.open(`mailto:?subject=${subject}&body=${body}`);
|
// window.open(`mailto:?subject=${subject}&body=${body}`);
|
||||||
// };
|
// };
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ const items = [
|
||||||
const PurchaseReturnGet = () => {
|
const PurchaseReturnGet = () => {
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Purchase Return'
|
(e) => e?.MenuName === 'Product Return'
|
||||||
);
|
);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
@ -158,7 +158,7 @@ const PurchaseReturnGet = () => {
|
||||||
};
|
};
|
||||||
let response = await dispatch(getEmpAccess(data)).unwrap();
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
(item) => item.ConfigName === 'Purchase Return'
|
(item) => item.ConfigName === 'Product Return'
|
||||||
);
|
);
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,12 @@ import {
|
||||||
ApplicationPreferences,
|
ApplicationPreferences,
|
||||||
getBranchDetail,
|
getBranchDetail,
|
||||||
} from '../../Features/BrachLogin/BranchLogin';
|
} from '../../Features/BrachLogin/BranchLogin';
|
||||||
import { changeBreadCrumb } from '../../Features/AppPage/CenterPage';
|
import { changeBreadCrumb, getEmpAccess } from '../../Features/AppPage/CenterPage';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import PublicQrCodeShare from './PublicQrCodeShare/PublicQrCodeShare';
|
import PublicQrCodeShare from './PublicQrCodeShare/PublicQrCodeShare';
|
||||||
import { FeatureAddon } from '../../Features/BookingScreen/BookingData/BookingData';
|
import { FeatureAddon } from '../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import { getPaymentOptionsData } from '../../Features/Payment/Paymentoptions/Paymentoptions';
|
import { getPaymentOptionsData } from '../../Features/Payment/Paymentoptions/Paymentoptions';
|
||||||
|
import { useAuth } from '../../AuthContext';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.ENV_MAIN_BASE_URL;
|
const subDirectory = import.meta.env.ENV_MAIN_BASE_URL;
|
||||||
const items = [
|
const items = [
|
||||||
|
|
@ -57,6 +58,8 @@ const PublicQrCode = () => {
|
||||||
const [Tabledata, setTabledata] = useState([]);
|
const [Tabledata, setTabledata] = useState([]);
|
||||||
const [CheckTabledata, setCheckTabledata] = useState([]);
|
const [CheckTabledata, setCheckTabledata] = useState([]);
|
||||||
const [qrCodeUrl, setQrCodeUrl] = useState('');
|
const [qrCodeUrl, setQrCodeUrl] = useState('');
|
||||||
|
const [empData, setEmpData] = useState();
|
||||||
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
const [selectedConfig, setSelectedConfig] = useState({
|
const [selectedConfig, setSelectedConfig] = useState({
|
||||||
id: '',
|
id: '',
|
||||||
name: 'Both',
|
name: 'Both',
|
||||||
|
|
@ -78,6 +81,11 @@ const PublicQrCode = () => {
|
||||||
const BranchId = getSession('BranchId');
|
const BranchId = getSession('BranchId');
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
|
const UserType = getSession('UserType');
|
||||||
|
const { SadminuserAccess } = useAuth();
|
||||||
|
const SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
|
(e) => e?.MenuName === 'SelfBooking QR Code'
|
||||||
|
);
|
||||||
const allowed = ['TakeAway', CheckTabledata?.length > 0 ? 'Dine In' : ''];
|
const allowed = ['TakeAway', CheckTabledata?.length > 0 ? 'Dine In' : ''];
|
||||||
const bookingTypePreference = appPreferences?.find(
|
const bookingTypePreference = appPreferences?.find(
|
||||||
(preference) => preference?.PreferredCatName === 'Booking Type'
|
(preference) => preference?.PreferredCatName === 'Booking Type'
|
||||||
|
|
@ -210,6 +218,38 @@ const PublicQrCode = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
|
||||||
|
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
||||||
|
hasAccess = true;
|
||||||
|
} else if (UserType === 'Employee') {
|
||||||
|
hasAccess = empData?.AddAccess === 'Y';
|
||||||
|
} else if (UserType === 'Super Admin User') {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === "Employee") {
|
||||||
|
fetchApiEmpAccess()
|
||||||
|
}
|
||||||
|
}, [UserType])
|
||||||
|
const fetchApiEmpAccess = async () => {
|
||||||
|
let data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
EmpId: UserId,
|
||||||
|
};
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
|
(item) => item.ConfigName === 'SelfBooking QR Code'
|
||||||
|
);
|
||||||
|
setEmpData(datas?.[0]);
|
||||||
|
};
|
||||||
|
|
||||||
const fetchApi = async () => {
|
const fetchApi = async () => {
|
||||||
let response = await dispatch(getConfiguration({ Type: 'SA' })).unwrap();
|
let response = await dispatch(getConfiguration({ Type: 'SA' })).unwrap();
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
|
|
@ -752,7 +792,7 @@ const PublicQrCode = () => {
|
||||||
className="tertiary_Button"
|
className="tertiary_Button"
|
||||||
color="901D77"
|
color="901D77"
|
||||||
handleSubmit={HandleSubmit}
|
handleSubmit={HandleSubmit}
|
||||||
// disabled={addnewAccess}
|
disabled={addnewAccess}
|
||||||
icon={<PlusOutlined />}
|
icon={<PlusOutlined />}
|
||||||
>
|
>
|
||||||
GENERATE
|
GENERATE
|
||||||
|
|
|
||||||
|
|
@ -26,11 +26,12 @@ import {
|
||||||
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
|
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
|
||||||
import { Form, Table, Input } from 'antd';
|
import { Form, Table, Input } from 'antd';
|
||||||
import { TiDelete } from 'react-icons/ti';
|
import { TiDelete } from 'react-icons/ti';
|
||||||
import { changeBreadCrumb } from '../../Features/AppPage/CenterPage.js';
|
import { changeBreadCrumb, getEmpAccess } from '../../Features/AppPage/CenterPage.js';
|
||||||
import { EditFilled, StopOutlined } from '@ant-design/icons';
|
import { EditFilled, StopOutlined } from '@ant-design/icons';
|
||||||
import { ArrowRightOutlined } from '@ant-design/icons';
|
import { ArrowRightOutlined } from '@ant-design/icons';
|
||||||
import { DropDowns } from '../../Components/Forms/DropDown.jsx';
|
import { DropDowns } from '../../Components/Forms/DropDown.jsx';
|
||||||
import { CgCloseR } from 'react-icons/cg';
|
import { CgCloseR } from 'react-icons/cg';
|
||||||
|
import { useAuth } from '../../AuthContext.jsx';
|
||||||
|
|
||||||
const SalesRemovallist = () => {
|
const SalesRemovallist = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
@ -38,8 +39,13 @@ const SalesRemovallist = () => {
|
||||||
const BranchId = getSession('BranchId');
|
const BranchId = getSession('BranchId');
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
|
const UserType = getSession('UserType');
|
||||||
const formRef = useRef(null);
|
const formRef = useRef(null);
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
|
const { SadminuserAccess } = useAuth();
|
||||||
|
const SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
|
(e) => e?.MenuName === 'Sales Entry Cancel'
|
||||||
|
);
|
||||||
|
|
||||||
const [messageType, setMessageType] = useState(null);
|
const [messageType, setMessageType] = useState(null);
|
||||||
const [messageData, setMessageData] = useState(null);
|
const [messageData, setMessageData] = useState(null);
|
||||||
|
|
@ -64,6 +70,8 @@ const SalesRemovallist = () => {
|
||||||
const [IdentifyDetails, setIdentifyDetails] = useState([]);
|
const [IdentifyDetails, setIdentifyDetails] = useState([]);
|
||||||
const [Identifiersnumber, setIdentifiersnumber] = useState([]);
|
const [Identifiersnumber, setIdentifiersnumber] = useState([]);
|
||||||
const [Qty, setQty] = useState();
|
const [Qty, setQty] = useState();
|
||||||
|
const [empData, setEmpData] = useState();
|
||||||
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
|
|
||||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
|
|
||||||
|
|
@ -79,6 +87,8 @@ const SalesRemovallist = () => {
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const onComplete = useCallback(() => {
|
const onComplete = useCallback(() => {
|
||||||
setMessageData(null);
|
setMessageData(null);
|
||||||
setMessageType(null);
|
setMessageType(null);
|
||||||
|
|
@ -107,6 +117,39 @@ const SalesRemovallist = () => {
|
||||||
dispatch(changeBreadCrumb({ items: items }));
|
dispatch(changeBreadCrumb({ items: items }));
|
||||||
Tabledatas();
|
Tabledatas();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
|
||||||
|
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
||||||
|
hasAccess = true;
|
||||||
|
} else if (UserType === 'Employee') {
|
||||||
|
hasAccess = empData?.AddAccess === 'Y';
|
||||||
|
} else if (UserType === 'Super Admin User') {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === "Employee") {
|
||||||
|
fetchApi()
|
||||||
|
}
|
||||||
|
}, [UserType])
|
||||||
|
const fetchApi = async () => {
|
||||||
|
let data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
EmpId: UserId,
|
||||||
|
};
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
|
(item) => item.ConfigName === 'Sales Entry Cancel'
|
||||||
|
);
|
||||||
|
setEmpData(datas?.[0]);
|
||||||
|
};
|
||||||
|
|
||||||
function safeRound(amountStr) {
|
function safeRound(amountStr) {
|
||||||
if (amountStr == null) return '0.00';
|
if (amountStr == null) return '0.00';
|
||||||
const cleaned = String(amountStr).replace(/[^0-9.-]+/g, '');
|
const cleaned = String(amountStr).replace(/[^0-9.-]+/g, '');
|
||||||
|
|
@ -1252,6 +1295,7 @@ const SalesRemovallist = () => {
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText="SUBMIT"
|
buttonText="SUBMIT"
|
||||||
color="901D77"
|
color="901D77"
|
||||||
|
disabled={addnewAccess}
|
||||||
icon={<ArrowRightOutlined />}
|
icon={<ArrowRightOutlined />}
|
||||||
handleSubmit={handleSubmit}
|
handleSubmit={handleSubmit}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import {
|
||||||
import Buttons from '../../Components/Forms/Buttons';
|
import Buttons from '../../Components/Forms/Buttons';
|
||||||
import './StockAdjustment.scss';
|
import './StockAdjustment.scss';
|
||||||
import { DropDowns } from '../../Components/Forms/DropDown';
|
import { DropDowns } from '../../Components/Forms/DropDown';
|
||||||
import { changeBreadCrumb } from '../../Features/AppPage/CenterPage';
|
import { changeBreadCrumb, getEmpAccess } from '../../Features/AppPage/CenterPage';
|
||||||
import { useDispatch } from 'react-redux';
|
import { useDispatch } from 'react-redux';
|
||||||
import { getSession } from '../../Services/Others';
|
import { getSession } from '../../Services/Others';
|
||||||
import { getAllprodIName } from '../../Features/ProductPage/ProductPage';
|
import { getAllprodIName } from '../../Features/ProductPage/ProductPage';
|
||||||
|
|
@ -25,17 +25,26 @@ import FormHeader from '../PageComponents/FormHeader';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { DefaultModal } from '../../Components/Modal/DefaultModal';
|
import { DefaultModal } from '../../Components/Modal/DefaultModal';
|
||||||
import { IoBagRemove } from 'react-icons/io5';
|
import { IoBagRemove } from 'react-icons/io5';
|
||||||
|
import { useAuth } from '../../AuthContext';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
const StockAdjustment = () => {
|
const StockAdjustment = () => {
|
||||||
|
|
||||||
|
const { SadminuserAccess } = useAuth();
|
||||||
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
|
(e) => e?.MenuName === 'Stock Adjustment'
|
||||||
|
);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const CompId = getSession('CompId');
|
const CompId = getSession('CompId');
|
||||||
const BranchId = getSession('BranchId');
|
const BranchId = getSession('BranchId');
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
|
const UserType = getSession('UserType');
|
||||||
const [productsData, setProductsData] = useState([]);
|
const [productsData, setProductsData] = useState([]);
|
||||||
const [stockData, setStockData] = useState([]);
|
const [stockData, setStockData] = useState([]);
|
||||||
|
const [empData, setEmpData] = useState();
|
||||||
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
|
|
||||||
const uniqueData = useMemo(() => {
|
const uniqueData = useMemo(() => {
|
||||||
return stockData.reduce((acc, current) => {
|
return stockData.reduce((acc, current) => {
|
||||||
|
|
@ -164,6 +173,42 @@ const StockAdjustment = () => {
|
||||||
// link: null,
|
// link: null,
|
||||||
// },
|
// },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === 'Employee') {
|
||||||
|
fetchApi();
|
||||||
|
}
|
||||||
|
}, [UserType]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
|
||||||
|
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
||||||
|
hasAccess = true;
|
||||||
|
} else if (UserType === 'Employee') {
|
||||||
|
hasAccess = empData?.AddAccess === 'Y';
|
||||||
|
} else if (UserType === 'Super Admin User') {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
|
||||||
|
const fetchApi = async () => {
|
||||||
|
let data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
EmpId: UserId,
|
||||||
|
};
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
|
(item) => item.ConfigName === 'Stock Adjustment'
|
||||||
|
);
|
||||||
|
setEmpData(datas?.[0]);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(changeBreadCrumb({ items: items }));
|
dispatch(changeBreadCrumb({ items: items }));
|
||||||
getAllProduct();
|
getAllProduct();
|
||||||
|
|
@ -318,6 +363,7 @@ const StockAdjustment = () => {
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText="Search"
|
buttonText="Search"
|
||||||
handleSubmit={handleTriggerClick}
|
handleSubmit={handleTriggerClick}
|
||||||
|
disabled = {addnewAccess}
|
||||||
style={{ marginLeft: 8 }}
|
style={{ marginLeft: 8 }}
|
||||||
icon={<FiSearch size={16} />}
|
icon={<FiSearch size={16} />}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ const items = [
|
||||||
const StockList = () => {
|
const StockList = () => {
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Purchase Entry'
|
(e) => e?.MenuName === 'Product Receipt'
|
||||||
);
|
);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
@ -140,7 +140,7 @@ const StockList = () => {
|
||||||
};
|
};
|
||||||
let response = await dispatch(getEmpAccess(data)).unwrap();
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
(item) => item.ConfigName === 'Purchase Entry'
|
(item) => item.ConfigName === 'Product Receipt'
|
||||||
);
|
);
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -180,12 +180,20 @@ const CreateTransfer = () => {
|
||||||
variant ? `Already added in the table` : 'This product is already Added'
|
variant ? `Already added in the table` : 'This product is already Added'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (scanner) {
|
||||||
|
setTimeout(() => {
|
||||||
|
productInputRef.current?.focus();
|
||||||
|
setProductSearchText('');
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
|
||||||
formProductRef?.current?.resetFields();
|
formProductRef?.current?.resetFields();
|
||||||
|
if (!scanner) {
|
||||||
setProductSearchText('');
|
setProductSearchText('');
|
||||||
|
}
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}, []);
|
}, [scanner]);
|
||||||
|
|
||||||
const focusProductInput = () => {
|
const focusProductInput = () => {
|
||||||
// give React a tick to close modal/input blur before refocusing
|
// give React a tick to close modal/input blur before refocusing
|
||||||
|
|
@ -367,7 +375,13 @@ const CreateTransfer = () => {
|
||||||
setVariantDetails([]);
|
setVariantDetails([]);
|
||||||
setSelectedProductForVariant(null);
|
setSelectedProductForVariant(null);
|
||||||
setSelectedVariants([]);
|
setSelectedVariants([]);
|
||||||
focusProductInput();
|
|
||||||
|
if (scanner) {
|
||||||
|
setTimeout(() => {
|
||||||
|
productInputRef.current?.focus();
|
||||||
|
setProductSearchText('');
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDeleteRow = (index) => {
|
const handleDeleteRow = (index) => {
|
||||||
|
|
@ -618,7 +632,13 @@ const CreateTransfer = () => {
|
||||||
setVariantDetails([]);
|
setVariantDetails([]);
|
||||||
setSelectedProductForVariant(null);
|
setSelectedProductForVariant(null);
|
||||||
setSelectedVariants([]);
|
setSelectedVariants([]);
|
||||||
focusProductInput();
|
|
||||||
|
if (scanner) {
|
||||||
|
setTimeout(() => {
|
||||||
|
productInputRef.current?.focus();
|
||||||
|
setProductSearchText('');
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
onOk={handleAddSelectedVariants}
|
onOk={handleAddSelectedVariants}
|
||||||
okText="Add Selected Variants"
|
okText="Add Selected Variants"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { useState, useCallback, useEffect } from 'react';
|
import React, { useState, useCallback, useEffect } from 'react';
|
||||||
import { Messages } from '../../../Components/Notifications/Messages';
|
import { Messages } from '../../../Components/Notifications/Messages';
|
||||||
import { useNavigate, useLocation } from 'react-router-dom';
|
import { useNavigate, useLocation } from 'react-router-dom';
|
||||||
import { changeBreadCrumb } from '../../../Features/AppPage/CenterPage';
|
import { changeBreadCrumb, getEmpAccess } from '../../../Features/AppPage/CenterPage';
|
||||||
import FormHeader from '../../PageComponents/FormHeader';
|
import FormHeader from '../../PageComponents/FormHeader';
|
||||||
import Buttons from '../../../Components/Forms/Buttons';
|
import Buttons from '../../../Components/Forms/Buttons';
|
||||||
import Search from '../../../Components/Forms/Search';
|
import Search from '../../../Components/Forms/Search';
|
||||||
|
|
@ -18,10 +18,12 @@ import { getSession } from '../../../Services/Others';
|
||||||
import { Table, Space } from 'antd';
|
import { Table, Space } from 'antd';
|
||||||
import { IoEye } from 'react-icons/io5';
|
import { IoEye } from 'react-icons/io5';
|
||||||
import { DefaultModal } from '../../../Components/Modal/DefaultModal';
|
import { DefaultModal } from '../../../Components/Modal/DefaultModal';
|
||||||
|
import { useAuth } from '../../../AuthContext';
|
||||||
|
|
||||||
const KitchenFinishlist = () => {
|
const KitchenFinishlist = () => {
|
||||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
|
const { SadminuserAccess } = useAuth();
|
||||||
|
let SAAccessCommonMaster = SadminuserAccess?.find((e) => e?.MenuName === "Finished Goods");
|
||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
|
|
@ -50,6 +52,9 @@ const KitchenFinishlist = () => {
|
||||||
const [page, setpage] = useState(1);
|
const [page, setpage] = useState(1);
|
||||||
const [AllocatedProductStocks, setAllocatedProductStocks] = useState();
|
const [AllocatedProductStocks, setAllocatedProductStocks] = useState();
|
||||||
const [AllocatedProductModal, setAllocatedProductModal] = useState(false);
|
const [AllocatedProductModal, setAllocatedProductModal] = useState(false);
|
||||||
|
const [empData, setEmpData] = useState();
|
||||||
|
const UserType = getSession('UserType');
|
||||||
|
const [addnewAccess, setaddnewAccess] = useState(true)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(changeBreadCrumb({ items: items }));
|
dispatch(changeBreadCrumb({ items: items }));
|
||||||
|
|
@ -64,6 +69,42 @@ const KitchenFinishlist = () => {
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === "Employee") {
|
||||||
|
fetchApi()
|
||||||
|
}
|
||||||
|
}, [UserType])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
|
||||||
|
if (UserType === "Admin" || UserType === "Super Admin") {
|
||||||
|
hasAccess = true;
|
||||||
|
}
|
||||||
|
else if (UserType === "Employee") {
|
||||||
|
hasAccess = empData?.AddAccess === "Y";
|
||||||
|
}
|
||||||
|
else if (UserType === "Super Admin User") {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === "Y";
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
const fetchApi = async () => {
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
'CompId': CompId,
|
||||||
|
'BranchId': BranchId,
|
||||||
|
'AppId': AppId,
|
||||||
|
'EmpId': UserId
|
||||||
|
}
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter((item) => item.ConfigName === 'Finished Goods')
|
||||||
|
setEmpData(datas?.[0])
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const onComplete = useCallback(() => {
|
const onComplete = useCallback(() => {
|
||||||
setMessageData(null);
|
setMessageData(null);
|
||||||
setMessageType(null);
|
setMessageType(null);
|
||||||
|
|
@ -232,7 +273,7 @@ const KitchenFinishlist = () => {
|
||||||
<div className="productMaster-input">
|
<div className="productMaster-input">
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText={'Add New'}
|
buttonText={'Add New'}
|
||||||
// disabled={addnewAccess}
|
disabled={addnewAccess}
|
||||||
handleSubmit={() => handelAddButton()}
|
handleSubmit={() => handelAddButton()}
|
||||||
color="901D77"
|
color="901D77"
|
||||||
icon={<PlusOutlined />}
|
icon={<PlusOutlined />}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { useState, useCallback, useEffect } from 'react';
|
import React, { useState, useCallback, useEffect } from 'react';
|
||||||
import { Messages } from '../../../Components/Notifications/Messages';
|
import { Messages } from '../../../Components/Notifications/Messages';
|
||||||
import { useNavigate, useLocation } from 'react-router-dom';
|
import { useNavigate, useLocation } from 'react-router-dom';
|
||||||
import { changeBreadCrumb } from '../../../Features/AppPage/CenterPage';
|
import { changeBreadCrumb, getEmpAccess } from '../../../Features/AppPage/CenterPage';
|
||||||
import FormHeader from '../../PageComponents/FormHeader';
|
import FormHeader from '../../PageComponents/FormHeader';
|
||||||
import Buttons from '../../../Components/Forms/Buttons';
|
import Buttons from '../../../Components/Forms/Buttons';
|
||||||
import Search from '../../../Components/Forms/Search';
|
import Search from '../../../Components/Forms/Search';
|
||||||
|
|
@ -21,6 +21,7 @@ import {
|
||||||
} from '../../../Features/StoreKitchen/StoreRecipe';
|
} from '../../../Features/StoreKitchen/StoreRecipe';
|
||||||
import { getSession } from '../../../Services/Others';
|
import { getSession } from '../../../Services/Others';
|
||||||
import { DefaultModal } from '../../../Components/Modal/DefaultModal';
|
import { DefaultModal } from '../../../Components/Modal/DefaultModal';
|
||||||
|
import { useAuth } from '../../../AuthContext';
|
||||||
|
|
||||||
const StoreRecipelist = () => {
|
const StoreRecipelist = () => {
|
||||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
|
|
@ -34,6 +35,8 @@ const StoreRecipelist = () => {
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
const UserType = getSession('UserType');
|
const UserType = getSession('UserType');
|
||||||
|
const { SadminuserAccess } = useAuth();
|
||||||
|
let SAAccessCommonMaster = SadminuserAccess?.find((e) => e?.MenuName === "Bill Of Material");
|
||||||
|
|
||||||
const [messageType, setMessageType] = useState(null);
|
const [messageType, setMessageType] = useState(null);
|
||||||
const [messageData, setMessageData] = useState(null);
|
const [messageData, setMessageData] = useState(null);
|
||||||
|
|
@ -44,6 +47,8 @@ const StoreRecipelist = () => {
|
||||||
const [sortedInfo, setSortedInfo] = useState({});
|
const [sortedInfo, setSortedInfo] = useState({});
|
||||||
const [CreatedProductdata, setCreatedProductdata] = useState();
|
const [CreatedProductdata, setCreatedProductdata] = useState();
|
||||||
const [CreatedProdModal, setCreatedProdModal] = useState();
|
const [CreatedProdModal, setCreatedProdModal] = useState();
|
||||||
|
const [empData, setEmpData] = useState();
|
||||||
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(changeBreadCrumb({ items: items }));
|
dispatch(changeBreadCrumb({ items: items }));
|
||||||
|
|
@ -58,6 +63,41 @@ const StoreRecipelist = () => {
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === "Employee") {
|
||||||
|
fetchApi()
|
||||||
|
}
|
||||||
|
}, [UserType])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
|
||||||
|
if (UserType === "Admin" || UserType === "Super Admin") {
|
||||||
|
hasAccess = true;
|
||||||
|
}
|
||||||
|
else if (UserType === "Employee") {
|
||||||
|
hasAccess = empData?.AddAccess === "Y";
|
||||||
|
}
|
||||||
|
else if (UserType === "Super Admin User") {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === "Y";
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
|
||||||
|
const fetchApi = async () => {
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
'CompId': CompId,
|
||||||
|
'BranchId': BranchId,
|
||||||
|
'AppId': AppId,
|
||||||
|
'EmpId': UserId
|
||||||
|
}
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter((item) => item.ConfigName === 'Bill Of Material')
|
||||||
|
setEmpData(datas?.[0])
|
||||||
|
|
||||||
|
}
|
||||||
const onComplete = useCallback(() => {
|
const onComplete = useCallback(() => {
|
||||||
setMessageData(null);
|
setMessageData(null);
|
||||||
setMessageType(null);
|
setMessageType(null);
|
||||||
|
|
@ -315,7 +355,7 @@ const StoreRecipelist = () => {
|
||||||
<div className="productMaster-input">
|
<div className="productMaster-input">
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText={'Add New'}
|
buttonText={'Add New'}
|
||||||
// disabled={addnewAccess}
|
disabled={addnewAccess}
|
||||||
handleSubmit={() => handelAddButton()}
|
handleSubmit={() => handelAddButton()}
|
||||||
color="901D77"
|
color="901D77"
|
||||||
icon={<PlusOutlined />}
|
icon={<PlusOutlined />}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { useState, useCallback, useEffect } from 'react';
|
import React, { useState, useCallback, useEffect } from 'react';
|
||||||
import { Messages } from '../../../Components/Notifications/Messages';
|
import { Messages } from '../../../Components/Notifications/Messages';
|
||||||
import { useNavigate, useLocation } from 'react-router-dom';
|
import { useNavigate, useLocation } from 'react-router-dom';
|
||||||
import { changeBreadCrumb } from '../../../Features/AppPage/CenterPage';
|
import { changeBreadCrumb, getEmpAccess } from '../../../Features/AppPage/CenterPage';
|
||||||
import FormHeader from '../../PageComponents/FormHeader';
|
import FormHeader from '../../PageComponents/FormHeader';
|
||||||
import Buttons from '../../../Components/Forms/Buttons';
|
import Buttons from '../../../Components/Forms/Buttons';
|
||||||
import Search from '../../../Components/Forms/Search';
|
import Search from '../../../Components/Forms/Search';
|
||||||
|
|
@ -18,9 +18,12 @@ import { DefaultModal } from '../../../Components/Modal/DefaultModal';
|
||||||
import { IoEye } from 'react-icons/io5';
|
import { IoEye } from 'react-icons/io5';
|
||||||
import { getSession } from '../../../Services/Others';
|
import { getSession } from '../../../Services/Others';
|
||||||
import { getStoretoProduction } from '../../../Features/StoreKitchen/StoreRecipe';
|
import { getStoretoProduction } from '../../../Features/StoreKitchen/StoreRecipe';
|
||||||
|
import { useAuth } from '../../../AuthContext';
|
||||||
|
|
||||||
const Storekitchenlist = () => {
|
const Storekitchenlist = () => {
|
||||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
|
const { SadminuserAccess } = useAuth();
|
||||||
|
let SAAccessCommonMaster = SadminuserAccess?.find((e) => e?.MenuName === "Material Issue");
|
||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigateTo = useNavigate();
|
const navigateTo = useNavigate();
|
||||||
|
|
@ -40,6 +43,8 @@ const Storekitchenlist = () => {
|
||||||
const [Tablelist, setTablelist] = useState();
|
const [Tablelist, setTablelist] = useState();
|
||||||
const [AllocatedProductStocks, setAllocatedProductStocks] = useState([]);
|
const [AllocatedProductStocks, setAllocatedProductStocks] = useState([]);
|
||||||
const [AllocatedProductModal, setAllocatedProductModal] = useState(false);
|
const [AllocatedProductModal, setAllocatedProductModal] = useState(false);
|
||||||
|
const [empData, setEmpData] = useState();
|
||||||
|
const [addnewAccess, setaddnewAccess] = useState(true)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(changeBreadCrumb({ items: items }));
|
dispatch(changeBreadCrumb({ items: items }));
|
||||||
|
|
@ -54,6 +59,41 @@ const Storekitchenlist = () => {
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === "Employee") {
|
||||||
|
fetchApi()
|
||||||
|
}
|
||||||
|
}, [UserType])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
|
||||||
|
if (UserType === "Admin" || UserType === "Super Admin") {
|
||||||
|
hasAccess = true;
|
||||||
|
}
|
||||||
|
else if (UserType === "Employee") {
|
||||||
|
hasAccess = empData?.AddAccess === "Y";
|
||||||
|
}
|
||||||
|
else if (UserType === "Super Admin User") {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === "Y";
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
const fetchApi = async () => {
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
'CompId': CompId,
|
||||||
|
'BranchId': BranchId,
|
||||||
|
'AppId': AppId,
|
||||||
|
'EmpId': UserId
|
||||||
|
}
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter((item) => item.ConfigName === 'Material Issue')
|
||||||
|
setEmpData(datas?.[0])
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const onComplete = useCallback(() => {
|
const onComplete = useCallback(() => {
|
||||||
setMessageData(null);
|
setMessageData(null);
|
||||||
setMessageType(null);
|
setMessageType(null);
|
||||||
|
|
@ -292,7 +332,7 @@ const Storekitchenlist = () => {
|
||||||
<div className="productMaster-input">
|
<div className="productMaster-input">
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText={'Add New'}
|
buttonText={'Add New'}
|
||||||
// disabled={addnewAccess}
|
disabled={addnewAccess}
|
||||||
handleSubmit={() => handelAddButton()}
|
handleSubmit={() => handelAddButton()}
|
||||||
color="901D77"
|
color="901D77"
|
||||||
icon={<PlusOutlined />}
|
icon={<PlusOutlined />}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ const SupplierMaster = () => {
|
||||||
|
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === (AppType === 'Wholesale' ? 'Seller' : 'Supplier')
|
(e) => e?.MenuName === (AppType === 'Wholesale' ? 'Seller' : 'Add Supplier')
|
||||||
);
|
);
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
@ -103,7 +103,7 @@ const SupplierMaster = () => {
|
||||||
let response = await dispatch(getEmpAccess(data)).unwrap();
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
item.ConfigName === (AppType === 'Wholesale' ? 'Seller' : 'Supplier')
|
item.ConfigName === (AppType === 'Wholesale' ? 'Seller' : 'Add Supplier')
|
||||||
);
|
);
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { DeleteFilled, PlusOutlined, ReloadOutlined } from '@ant-design/icons';
|
||||||
import { Messages } from '../../Components/Notifications/Messages';
|
import { Messages } from '../../Components/Notifications/Messages';
|
||||||
import { Tables } from '../../Components/Tables/Table';
|
import { Tables } from '../../Components/Tables/Table';
|
||||||
import { Search } from '../../Components/Forms/Search';
|
import { Search } from '../../Components/Forms/Search';
|
||||||
import { changeBreadCrumb } from '../../Features/AppPage/CenterPage.js';
|
import { changeBreadCrumb, getEmpAccess } from '../../Features/AppPage/CenterPage.js';
|
||||||
import Buttons from '../../Components/Forms/Buttons';
|
import Buttons from '../../Components/Forms/Buttons';
|
||||||
import { ExtractDateFormate, getSession } from '../../Services/Others';
|
import { ExtractDateFormate, getSession } from '../../Services/Others';
|
||||||
import FormHeader from '../PageComponents/FormHeader.jsx';
|
import FormHeader from '../PageComponents/FormHeader.jsx';
|
||||||
|
|
@ -34,7 +34,7 @@ const items = [
|
||||||
const SupplierProductMapping = () => {
|
const SupplierProductMapping = () => {
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
const SAAccessCommonMaster = SadminuserAccess?.find(
|
const SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Supplier Product Mapping'
|
(e) => e?.MenuName === 'Product Mapping'
|
||||||
);
|
);
|
||||||
|
|
||||||
const [page, setpage] = useState(1);
|
const [page, setpage] = useState(1);
|
||||||
|
|
@ -132,14 +132,13 @@ const SupplierProductMapping = () => {
|
||||||
}}
|
}}
|
||||||
onClick={
|
onClick={
|
||||||
() =>
|
() =>
|
||||||
// (
|
((UserType === 'Super Admin') ||
|
||||||
// (UserType === 'Super Admin') ||
|
(UserType === "Super Admin User" && SAAccessCommonMaster?.DeleteAccess === "Y") ||
|
||||||
// (UserType === "Super Admin User" && SAAccessCommonMaster?.DeleteAccess === "Y") ||
|
(UserType === 'Employee' && empData?.DeleteAccess === "Y") ||
|
||||||
// (UserType === 'Employee' && empData?.DeleteAccess === "Y") ||
|
(UserType === 'Admin'))
|
||||||
// (UserType === 'Admin'))
|
?
|
||||||
// ?
|
|
||||||
statusFormatter(record)
|
statusFormatter(record)
|
||||||
// : null
|
: null
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
|
@ -149,14 +148,13 @@ const SupplierProductMapping = () => {
|
||||||
}}
|
}}
|
||||||
onClick={
|
onClick={
|
||||||
() =>
|
() =>
|
||||||
// (
|
((UserType === 'Super Admin') ||
|
||||||
// (UserType === 'Super Admin') ||
|
(UserType === "Super Admin User" && SAAccessCommonMaster?.DeleteAccess === "Y") ||
|
||||||
// (UserType === "Super Admin User" && SAAccessCommonMaster?.DeleteAccess === "Y") ||
|
(UserType === 'Employee' && empData?.DeleteAccess === "Y") ||
|
||||||
// (UserType === 'Employee' && empData?.DeleteAccess === "Y") ||
|
(UserType === 'Admin'))
|
||||||
// (UserType === 'Admin'))
|
?
|
||||||
// ?
|
|
||||||
statusFormatter(record)
|
statusFormatter(record)
|
||||||
// : null
|
: null
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
@ -186,6 +184,25 @@ const SupplierProductMapping = () => {
|
||||||
setaddnewAccess(!hasAccess);
|
setaddnewAccess(!hasAccess);
|
||||||
}, [empData, SAAccessCommonMaster, UserType]);
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === "Employee") {
|
||||||
|
fetchApi()
|
||||||
|
}
|
||||||
|
}, [UserType])
|
||||||
|
const fetchApi = async () => {
|
||||||
|
let data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
EmpId: UserId,
|
||||||
|
};
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
|
(item) => item.ConfigName === 'Product Mapping'
|
||||||
|
);
|
||||||
|
setEmpData(datas?.[0]);
|
||||||
|
};
|
||||||
|
|
||||||
const handleModalCancel = () => {
|
const handleModalCancel = () => {
|
||||||
setIsModalOpen(false);
|
setIsModalOpen(false);
|
||||||
setModalSelectedSupplier(null);
|
setModalSelectedSupplier(null);
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ import { InputField } from '../../Components/Forms/InputField.jsx';
|
||||||
import Buttons from '../../Components/Forms/Buttons.jsx';
|
import Buttons from '../../Components/Forms/Buttons.jsx';
|
||||||
import { Messages } from '../../Components/Notifications/Messages.jsx';
|
import { Messages } from '../../Components/Notifications/Messages.jsx';
|
||||||
import { DeleteFilled } from '@ant-design/icons';
|
import { DeleteFilled } from '@ant-design/icons';
|
||||||
import { changeBreadCrumb } from '../../Features/AppPage/CenterPage.js';
|
import { changeBreadCrumb, getEmpAccess } from '../../Features/AppPage/CenterPage.js';
|
||||||
import FormHeader from '../PageComponents/FormHeader.jsx';
|
import FormHeader from '../PageComponents/FormHeader.jsx';
|
||||||
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
|
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
|
||||||
import { getSession, validateSafeInput } from '../../Services/Others.js';
|
import { getSession, validateSafeInput } from '../../Services/Others.js';
|
||||||
|
|
@ -65,6 +65,7 @@ import {
|
||||||
import { FiUploadCloud } from 'react-icons/fi';
|
import { FiUploadCloud } from 'react-icons/fi';
|
||||||
import OpeningStockExcel from './OpeningStockExcel.jsx';
|
import OpeningStockExcel from './OpeningStockExcel.jsx';
|
||||||
import { sendupiotp } from '../../Features/UpiDetails/UpiDetails.js';
|
import { sendupiotp } from '../../Features/UpiDetails/UpiDetails.js';
|
||||||
|
import { useAuth } from '../../AuthContext.jsx';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
const EditableContext = React.createContext(null);
|
const EditableContext = React.createContext(null);
|
||||||
|
|
@ -160,6 +161,10 @@ const OpeningStockList = () => {
|
||||||
const productAddInfoRef = useRef(null);
|
const productAddInfoRef = useRef(null);
|
||||||
const navigateTo = useNavigate();
|
const navigateTo = useNavigate();
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
const { SadminuserAccess } = useAuth();
|
||||||
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
|
(e) => e?.MenuName === 'Opening Stock'
|
||||||
|
);
|
||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
@ -171,7 +176,10 @@ const OpeningStockList = () => {
|
||||||
const BranchId = getSession('BranchId');
|
const BranchId = getSession('BranchId');
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
|
const UserType = getSession('UserType');
|
||||||
const MobileNo = getSession('MobileNo');
|
const MobileNo = getSession('MobileNo');
|
||||||
|
const [empData, setEmpData] = useState();
|
||||||
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
|
|
||||||
const [openExcel, setOpenExcel] = useState(false);
|
const [openExcel, setOpenExcel] = useState(false);
|
||||||
const [applicationRestrictedFields, setApplicationRestrictedFields] =
|
const [applicationRestrictedFields, setApplicationRestrictedFields] =
|
||||||
|
|
@ -207,6 +215,40 @@ const OpeningStockList = () => {
|
||||||
return () => clearTimeout(timer);
|
return () => clearTimeout(timer);
|
||||||
}
|
}
|
||||||
}, [timeLeft]);
|
}, [timeLeft]);
|
||||||
|
useEffect(() => {
|
||||||
|
if (UserType === 'Employee') {
|
||||||
|
fetchApi();
|
||||||
|
}
|
||||||
|
}, [UserType]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let hasAccess = false;
|
||||||
|
|
||||||
|
if (UserType === 'Admin' || UserType === 'Super Admin') {
|
||||||
|
hasAccess = true;
|
||||||
|
} else if (UserType === 'Employee') {
|
||||||
|
hasAccess = empData?.AddAccess === 'Y';
|
||||||
|
} else if (UserType === 'Super Admin User') {
|
||||||
|
hasAccess = SAAccessCommonMaster?.AddAccess === 'Y';
|
||||||
|
}
|
||||||
|
|
||||||
|
setaddnewAccess(!hasAccess);
|
||||||
|
}, [empData, SAAccessCommonMaster, UserType]);
|
||||||
|
|
||||||
|
const fetchApi = async () => {
|
||||||
|
let data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
EmpId: UserId,
|
||||||
|
};
|
||||||
|
let response = await dispatch(getEmpAccess(data)).unwrap();
|
||||||
|
let datas = response?.data?.data?.[0]?.EmpAccessDetails?.filter(
|
||||||
|
(item) => item.ConfigName === 'Opening Stock'
|
||||||
|
);
|
||||||
|
setEmpData(datas?.[0]);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
console.log(otpAccessMap, 'otpAccessMap');
|
console.log(otpAccessMap, 'otpAccessMap');
|
||||||
const [Delete, setDelete] = useState(false);
|
const [Delete, setDelete] = useState(false);
|
||||||
|
|
@ -1209,6 +1251,7 @@ const OpeningStockList = () => {
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText={'Add New'}
|
buttonText={'Add New'}
|
||||||
handleSubmit={() => handelAddButton()}
|
handleSubmit={() => handelAddButton()}
|
||||||
|
disabled={addnewAccess}
|
||||||
color="901D77"
|
color="901D77"
|
||||||
icon={<PlusOutlined />}
|
icon={<PlusOutlined />}
|
||||||
/>
|
/>
|
||||||
|
|
@ -1218,7 +1261,7 @@ const OpeningStockList = () => {
|
||||||
buttonText="Upload Excel"
|
buttonText="Upload Excel"
|
||||||
className="tertiary_Button"
|
className="tertiary_Button"
|
||||||
handleSubmit={openModal}
|
handleSubmit={openModal}
|
||||||
disabled={false}
|
disabled={addnewAccess}
|
||||||
icon={<FiUploadCloud size={18} />}
|
icon={<FiUploadCloud size={18} />}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -718,7 +718,7 @@ export const routesConfig = [
|
||||||
{
|
{
|
||||||
path: 'counter-category-mapping',
|
path: 'counter-category-mapping',
|
||||||
component: CounterCategoryMappingForm,
|
component: CounterCategoryMappingForm,
|
||||||
empAccess: 'Counter Category Mapping',
|
empAccess: 'Counter Mapping',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -873,17 +873,17 @@ export const routesConfig = [
|
||||||
{
|
{
|
||||||
path: 'code-base',
|
path: 'code-base',
|
||||||
component: CodeBaseList,
|
component: CodeBaseList,
|
||||||
empAccess: 'Code Base',
|
empAccess: 'Code Based',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'code-base/new',
|
path: 'code-base/new',
|
||||||
component: (props) => <CodeBase {...props} formType="add" />,
|
component: (props) => <CodeBase {...props} formType="add" />,
|
||||||
empAccess: 'Code Base',
|
empAccess: 'Code Based',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'code-base/new',
|
path: 'code-base/new',
|
||||||
component: (props) => <CodeBase {...props} formType="edit" />,
|
component: (props) => <CodeBase {...props} formType="edit" />,
|
||||||
empAccess: 'Code Base',
|
empAccess: 'Code Based',
|
||||||
},
|
},
|
||||||
|
|
||||||
{ path: 'item-wise', component: ItemWise, empAccess: 'Item Wise Offer' },
|
{ path: 'item-wise', component: ItemWise, empAccess: 'Item Wise Offer' },
|
||||||
|
|
@ -923,17 +923,17 @@ export const routesConfig = [
|
||||||
path: 'loyalty-based',
|
path: 'loyalty-based',
|
||||||
// component: LoyaltyBased,
|
// component: LoyaltyBased,
|
||||||
component: LoyaltyBasedList,
|
component: LoyaltyBasedList,
|
||||||
empAccess: 'Loyalty Based',
|
empAccess: 'Loyalty Points',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'loyalty-based/new',
|
path: 'loyalty-based/new',
|
||||||
component: (props) => <LoyaltyBased {...props} formType="add" />,
|
component: (props) => <LoyaltyBased {...props} formType="add" />,
|
||||||
empAccess: 'Loyalty Based',
|
empAccess: 'Loyalty Points',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'loyalty-based/update',
|
path: 'loyalty-based/update',
|
||||||
component: (props) => <LoyaltyBased {...props} formType="edit" />,
|
component: (props) => <LoyaltyBased {...props} formType="edit" />,
|
||||||
empAccess: 'Loyalty Based',
|
empAccess: 'Loyalty Points',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -1081,11 +1081,7 @@ export const routesConfig = [
|
||||||
empAccess: 'Product Receipt',
|
empAccess: 'Product Receipt',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
path: 'purchase-order',
|
|
||||||
component: PurchaseOrderList,
|
|
||||||
empAccess: 'Purchase Order',
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
path: 'receive-stocks',
|
path: 'receive-stocks',
|
||||||
|
|
@ -1109,6 +1105,11 @@ export const routesConfig = [
|
||||||
component: gstInvoiceSetUpList,
|
component: gstInvoiceSetUpList,
|
||||||
empAccess: 'Gst Invoice Setup',
|
empAccess: 'Gst Invoice Setup',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'purchase-order',
|
||||||
|
component: PurchaseOrderList,
|
||||||
|
empAccess: 'Purchase Order',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'purchase-order/new',
|
path: 'purchase-order/new',
|
||||||
component: (props) => <PurchaseOrder {...props} formType="add" />,
|
component: (props) => <PurchaseOrder {...props} formType="add" />,
|
||||||
|
|
@ -1118,7 +1119,7 @@ export const routesConfig = [
|
||||||
{
|
{
|
||||||
path: 'purchase-return/list',
|
path: 'purchase-return/list',
|
||||||
component: PurchaseReturnget,
|
component: PurchaseReturnget,
|
||||||
empAccess: 'Purchase Return',
|
empAccess: 'Product Return',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'purchaseconfirm',
|
path: 'purchaseconfirm',
|
||||||
|
|
@ -1128,7 +1129,7 @@ export const routesConfig = [
|
||||||
{
|
{
|
||||||
path: 'purchase-return',
|
path: 'purchase-return',
|
||||||
component: PurchaseReturn,
|
component: PurchaseReturn,
|
||||||
empAccess: 'Purchase Return',
|
empAccess: 'Product Return',
|
||||||
},
|
},
|
||||||
//free Products
|
//free Products
|
||||||
{
|
{
|
||||||
|
|
@ -1186,6 +1187,11 @@ export const routesConfig = [
|
||||||
component: PurchaseQuotationForm,
|
component: PurchaseQuotationForm,
|
||||||
empAccess: 'Sales Quotation',
|
empAccess: 'Sales Quotation',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'sales-quotation/list',
|
||||||
|
component: PurchaseQuotationList,
|
||||||
|
empAccess: 'Sales Quotation',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'sales-order',
|
path: 'sales-order',
|
||||||
component: SalesOrder,
|
component: SalesOrder,
|
||||||
|
|
@ -1215,11 +1221,7 @@ export const routesConfig = [
|
||||||
component: DeliveryChallanToInvoiceForm,
|
component: DeliveryChallanToInvoiceForm,
|
||||||
empAccess: 'DC to Invoice',
|
empAccess: 'DC to Invoice',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: 'sales-quotation/list',
|
|
||||||
component: PurchaseQuotationList,
|
|
||||||
empAccess: 'Sales Quotation',
|
|
||||||
},
|
|
||||||
|
|
||||||
{ path: 'shift-master', component: ShiftMasterList, empAccess: 'Shift' },
|
{ path: 'shift-master', component: ShiftMasterList, empAccess: 'Shift' },
|
||||||
{
|
{
|
||||||
|
|
@ -1324,17 +1326,17 @@ export const routesConfig = [
|
||||||
{
|
{
|
||||||
path: 'combo-master',
|
path: 'combo-master',
|
||||||
component: ComboList,
|
component: ComboList,
|
||||||
empAccess: 'Combo Product',
|
empAccess: 'Add Product',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'combo-master/new',
|
path: 'combo-master/new',
|
||||||
component: (props) => <ComboMaster {...props} formType="add" />,
|
component: (props) => <ComboMaster {...props} formType="add" />,
|
||||||
empAccess: 'Combo Product',
|
empAccess: 'Add Product',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'combo-master/update',
|
path: 'combo-master/update',
|
||||||
component: (props) => <ComboMaster {...props} formType="edit" />,
|
component: (props) => <ComboMaster {...props} formType="edit" />,
|
||||||
empAccess: 'Combo Product',
|
empAccess: 'Add Product',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -1443,17 +1445,17 @@ export const routesConfig = [
|
||||||
{
|
{
|
||||||
path: 'sales-bill-cancel',
|
path: 'sales-bill-cancel',
|
||||||
component: SalesBillCancel,
|
component: SalesBillCancel,
|
||||||
empAccess: 'Sales Bill Cancel',
|
empAccess: 'Sales Entry Cancel',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'sales-bill-product-return/list',
|
path: 'sales-bill-product-return/list',
|
||||||
component: SalesBillProductsReturnList,
|
component: SalesBillProductsReturnList,
|
||||||
empAccess: 'Product Return',
|
empAccess: 'Sales Product Return',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'sales-bill-product-return',
|
path: 'sales-bill-product-return',
|
||||||
component: SalesBillProductsReturn,
|
component: SalesBillProductsReturn,
|
||||||
empAccess: 'Product Return',
|
empAccess: 'Sales Product Return',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'booking-reschedule',
|
path: 'booking-reschedule',
|
||||||
|
|
@ -1583,7 +1585,7 @@ export const routesConfig = [
|
||||||
{
|
{
|
||||||
path: `barcode-qr-selection`,
|
path: `barcode-qr-selection`,
|
||||||
component: BarcodeTemplateSetup,
|
component: BarcodeTemplateSetup,
|
||||||
empAccess: 'Barcode / Qr',
|
empAccess: 'Barcode / QR',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'kiosk-component',
|
path: 'kiosk-component',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue