User Preference Bases Task added All Component UserId
This commit is contained in:
parent
69b93e6be3
commit
426e521ebf
|
|
@ -748,17 +748,20 @@ export const UserDataBasedOnBranchId = createAsyncThunk(
|
||||||
|
|
||||||
export const getPreferenceData = createAsyncThunk(
|
export const getPreferenceData = createAsyncThunk(
|
||||||
'BookingData/getPreferenceData',
|
'BookingData/getPreferenceData',
|
||||||
async ({ CompId, BranchId, AppId }) => {
|
async ({ CompId, BranchId, AppId, UserId }) => {
|
||||||
|
// debugger
|
||||||
if (
|
if (
|
||||||
CompId != null &&
|
CompId != null &&
|
||||||
CompId != undefined &&
|
CompId != undefined &&
|
||||||
BranchId != null &&
|
BranchId != null &&
|
||||||
BranchId != undefined &&
|
BranchId != undefined &&
|
||||||
AppId != null &&
|
AppId != null &&
|
||||||
AppId != undefined
|
AppId != undefined &&
|
||||||
|
UserId != null &&
|
||||||
|
UserId != undefined
|
||||||
) {
|
) {
|
||||||
return await axiosRetailInstanceData.get(
|
return await axiosRetailInstanceData.get(
|
||||||
`/Settings?branchId=${BranchId}&compId=${CompId}&appId=${AppId}`
|
`/Settings?branchId=${BranchId}&compId=${CompId}&appId=${AppId}&userId=${UserId}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ export const postPreferenceAppNames = createAsyncThunk(
|
||||||
);
|
);
|
||||||
|
|
||||||
export const gettableData = createAsyncThunk(
|
export const gettableData = createAsyncThunk(
|
||||||
'settings/ gettableData',
|
'settings/gettableData',
|
||||||
async (data) => {
|
async (data) => {
|
||||||
if (
|
if (
|
||||||
data?.AppId != null &&
|
data?.AppId != null &&
|
||||||
|
|
@ -39,7 +39,9 @@ export const gettableData = createAsyncThunk(
|
||||||
data?.CompId != null &&
|
data?.CompId != null &&
|
||||||
data?.CompId != undefined &&
|
data?.CompId != undefined &&
|
||||||
data?.BranchId != null &&
|
data?.BranchId != null &&
|
||||||
data?.BranchId != undefined
|
data?.BranchId != undefined &&
|
||||||
|
data?.UserId != null &&
|
||||||
|
data?.UserId != undefined
|
||||||
) {
|
) {
|
||||||
return await axiosRetailInstanceData.get(
|
return await axiosRetailInstanceData.get(
|
||||||
`/Settings?appId=${data?.AppId}&compId=${data?.CompId}&branchId=${data?.BranchId}&userId=${data?.UserId}`
|
`/Settings?appId=${data?.AppId}&compId=${data?.CompId}&branchId=${data?.BranchId}&userId=${data?.UserId}`
|
||||||
|
|
|
||||||
|
|
@ -249,6 +249,7 @@ const AppPage = () => {
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
CompId: CompId,
|
CompId: CompId,
|
||||||
BranchId: BranchId,
|
BranchId: BranchId,
|
||||||
|
UserId:UserId
|
||||||
};
|
};
|
||||||
const response = await dispatch(getPreferenceData(DineinData)).unwrap();
|
const response = await dispatch(getPreferenceData(DineinData)).unwrap();
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
|
|
|
||||||
|
|
@ -371,7 +371,7 @@ const BSNavbar1 = (props, BookingNavbar) => {
|
||||||
}).format(d);
|
}).format(d);
|
||||||
setFormattedDate(formatted);
|
setFormattedDate(formatted);
|
||||||
dispatch(
|
dispatch(
|
||||||
getPreferenceData({ CompId: CompId, AppId: AppId, BranchId: BranchId })
|
getPreferenceData({ CompId: CompId, AppId: AppId, BranchId: BranchId,UserId:UserId })
|
||||||
);
|
);
|
||||||
dispatch(getUserProfile({ UserId: UserId, ActiveStatus: 'A' })).unwrap();
|
dispatch(getUserProfile({ UserId: UserId, ActiveStatus: 'A' })).unwrap();
|
||||||
fetchBranchData();
|
fetchBranchData();
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,7 @@ const BSNavbar2 = () => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// fetchEditFavItems();
|
// fetchEditFavItems();
|
||||||
dispatch(
|
dispatch(
|
||||||
getPreferenceData({ CompId: CompId, AppId: AppId, BranchId: BranchId })
|
getPreferenceData({ CompId: CompId, AppId: AppId, BranchId: BranchId,UserId:UserId })
|
||||||
);
|
);
|
||||||
fetchBranchData();
|
fetchBranchData();
|
||||||
dispatch(getUserProfile({ UserId: UserId, ActiveStatus: 'A' })).unwrap();
|
dispatch(getUserProfile({ UserId: UserId, ActiveStatus: 'A' })).unwrap();
|
||||||
|
|
|
||||||
|
|
@ -598,7 +598,7 @@ const SelectionComponent = forwardRef((props, ref) => {
|
||||||
|
|
||||||
const GetPreferenceDetails = async () => {
|
const GetPreferenceDetails = async () => {
|
||||||
let Preference = await dispatch(
|
let Preference = await dispatch(
|
||||||
getPreferenceData({ CompId: CompId, BranchId: BranchId, AppId: AppId })
|
getPreferenceData({ CompId: CompId, BranchId: BranchId, AppId: AppId, UserId:UserId })
|
||||||
).unwrap();
|
).unwrap();
|
||||||
if (Preference?.data?.statusCode === 1) {
|
if (Preference?.data?.statusCode === 1) {
|
||||||
let Prefencedata = Preference?.data?.data?.[0]?.[
|
let Prefencedata = Preference?.data?.data?.[0]?.[
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ const SelectPrintMode = ({ closeModel }) => {
|
||||||
|
|
||||||
const fetchTableData = async () => {
|
const fetchTableData = async () => {
|
||||||
const response = await dispatch(
|
const response = await dispatch(
|
||||||
gettableData({ CompId, BranchId, AppId })
|
gettableData({ CompId, BranchId, AppId,UserId })
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
const data = response?.data?.data?.[0]?.SettingDtlDetails || [];
|
const data = response?.data?.data?.[0]?.SettingDtlDetails || [];
|
||||||
|
|
@ -79,7 +79,7 @@ const SelectPrintMode = ({ closeModel }) => {
|
||||||
const handleSave = async () => {
|
const handleSave = async () => {
|
||||||
const allowed = ['whatsapp', 'sms', 'print', 'email'];
|
const allowed = ['whatsapp', 'sms', 'print', 'email'];
|
||||||
|
|
||||||
const updatedSettings = modes.map((item) => {
|
const updatedSettings = modes?.map((item) => {
|
||||||
const name = item.SettingIdName?.trim()?.toLowerCase();
|
const name = item.SettingIdName?.trim()?.toLowerCase();
|
||||||
|
|
||||||
if (allowed?.includes(name)) {
|
if (allowed?.includes(name)) {
|
||||||
|
|
@ -98,6 +98,7 @@ const SelectPrintMode = ({ closeModel }) => {
|
||||||
CreatedBy: UserId,
|
CreatedBy: UserId,
|
||||||
AppId,
|
AppId,
|
||||||
SettingDtlDetails: updatedSettings,
|
SettingDtlDetails: updatedSettings,
|
||||||
|
UserId:UserId
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(payload, 'payload to send');
|
console.log(payload, 'payload to send');
|
||||||
|
|
@ -123,7 +124,7 @@ const SelectPrintMode = ({ closeModel }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const updatePreference = async () => {
|
const updatePreference = async () => {
|
||||||
await dispatch(getPreferenceData({ CompId, BranchId, AppId }));
|
await dispatch(getPreferenceData({ CompId, BranchId, AppId ,UserId}));
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,7 @@ const SelectionComponent = (props) => {
|
||||||
|
|
||||||
const getSizePreferenceDetails = async () => {
|
const getSizePreferenceDetails = async () => {
|
||||||
let Preference = await dispatch(
|
let Preference = await dispatch(
|
||||||
getPreferenceData({ CompId: CompId, BranchId: BranchId, AppId: AppId })
|
getPreferenceData({ CompId: CompId, BranchId: BranchId, AppId: AppId,UserId : UserId })
|
||||||
).unwrap();
|
).unwrap();
|
||||||
if (Preference?.data?.statusCode === 1) {
|
if (Preference?.data?.statusCode === 1) {
|
||||||
const filteredData =
|
const filteredData =
|
||||||
|
|
|
||||||
|
|
@ -381,7 +381,7 @@ const ThemeSelection = () => {
|
||||||
|
|
||||||
const GetPreferenceDetails = async () => {
|
const GetPreferenceDetails = async () => {
|
||||||
let Preference = await dispatch(
|
let Preference = await dispatch(
|
||||||
getPreferenceData({ CompId: CompId, BranchId: BranchId, AppId: AppId })
|
getPreferenceData({ CompId: CompId, BranchId: BranchId, AppId: AppId,UserId : UserId })
|
||||||
).unwrap();
|
).unwrap();
|
||||||
if (Preference?.data?.statusCode === 1) {
|
if (Preference?.data?.statusCode === 1) {
|
||||||
let Prefencedata = Preference?.data?.data?.[0]?.[
|
let Prefencedata = Preference?.data?.data?.[0]?.[
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ const PricingPage = () => {
|
||||||
getPurchasedAppDetails({ AppId, UserId })
|
getPurchasedAppDetails({ AppId, UserId })
|
||||||
).unwrap();
|
).unwrap();
|
||||||
let response1 = await dispatch(
|
let response1 = await dispatch(
|
||||||
getPreferenceData({ AppId, BranchId, CompId })
|
getPreferenceData({ AppId, BranchId, CompId,UserId })
|
||||||
).unwrap();
|
).unwrap();
|
||||||
setPurchasedDetails(response?.data?.data);
|
setPurchasedDetails(response?.data?.data);
|
||||||
setCompanydetails(response1?.data?.data);
|
setCompanydetails(response1?.data?.data);
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ const BackToBranchLogin = () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
const AppId = getSession('AppId');
|
const AppId = getSession('AppId');
|
||||||
|
const UserId = getSession('UserId');
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
|
|
@ -68,6 +69,7 @@ const BackToBranchLogin = () => {
|
||||||
CompId: ComId?.CompId,
|
CompId: ComId?.CompId,
|
||||||
BranchId: e,
|
BranchId: e,
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
|
UserId:UserId
|
||||||
};
|
};
|
||||||
await dispatch(
|
await dispatch(
|
||||||
getTemplate({ CompId: ComId?.CompId, BranchId: e, AppId: AppId })
|
getTemplate({ CompId: ComId?.CompId, BranchId: e, AppId: AppId })
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,7 @@ const BranchLogin = () => {
|
||||||
CompId: CompId,
|
CompId: CompId,
|
||||||
BranchId: e,
|
BranchId: e,
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
|
UserId: UserId,
|
||||||
};
|
};
|
||||||
|
|
||||||
let res = await dispatch(getPreferenceData(data)).unwrap();
|
let res = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ const CustomerMaster = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId, UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
|
|
|
||||||
|
|
@ -897,6 +897,7 @@ const RetailDashboard = () => {
|
||||||
CompId: CompId,
|
CompId: CompId,
|
||||||
BranchId: BranchId ? BranchId : globalbranchid,
|
BranchId: BranchId ? BranchId : globalbranchid,
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
|
UserId: UserId,
|
||||||
};
|
};
|
||||||
|
|
||||||
let res = await dispatch(getPreferenceData(data)).unwrap();
|
let res = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
|
|
|
||||||
|
|
@ -324,7 +324,7 @@ const DeliveryChallanToInvoiceList = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
await dispatch(getPreferenceData({ AppId: AppId, CompId: CompId, BranchId: BranchId })).unwrap();
|
await dispatch(getPreferenceData({ AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId })).unwrap();
|
||||||
const decimalSetting = PreferenceDatas?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = PreferenceDatas?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
setAllowDecimal(true)
|
setAllowDecimal(true)
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,7 @@ const EmpAccessForm = ({ formType }) => {
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
CompId: cmpId,
|
CompId: cmpId,
|
||||||
BranchId: brId,
|
BranchId: brId,
|
||||||
|
UserId: UserId,
|
||||||
};
|
};
|
||||||
const response = await dispatch(gettableData(DineinData)).unwrap();
|
const response = await dispatch(gettableData(DineinData)).unwrap();
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
|
|
|
||||||
|
|
@ -301,7 +301,7 @@ const EmpCommisionOrIncentiveList = () => {
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
await dispatch(
|
await dispatch(
|
||||||
getPreferenceData({ AppId: AppId, CompId: CompId, BranchId: BranchId })
|
getPreferenceData({ AppId: AppId, CompId: CompId, BranchId: BranchId, UserId:UserId })
|
||||||
).unwrap();
|
).unwrap();
|
||||||
const decimalSetting = PreferenceDatas?.[0]?.SettingDtlDetails?.find(
|
const decimalSetting = PreferenceDatas?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
|
|
|
||||||
|
|
@ -432,7 +432,7 @@ function ExtraChargesList() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId, UserId:UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
|
|
|
||||||
|
|
@ -365,6 +365,7 @@ const CardPage1Sports = (props) => {
|
||||||
CompId: SessionDtl?.CompId,
|
CompId: SessionDtl?.CompId,
|
||||||
BranchId: SessionDtl?.BranchId,
|
BranchId: SessionDtl?.BranchId,
|
||||||
AppId: SessionDtl?.AppId,
|
AppId: SessionDtl?.AppId,
|
||||||
|
UserId:SessionDtl?.UserId,
|
||||||
})
|
})
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ const KioskBookingPage = () => {
|
||||||
CompId: SessionDtl?.CompId,
|
CompId: SessionDtl?.CompId,
|
||||||
BranchId: SessionDtl?.BranchId,
|
BranchId: SessionDtl?.BranchId,
|
||||||
AppId: SessionDtl?.AppId,
|
AppId: SessionDtl?.AppId,
|
||||||
|
UserId: SessionDtl?.UserId,
|
||||||
})).unwrap();
|
})).unwrap();
|
||||||
const queryParams = await getQueryParams();
|
const queryParams = await getQueryParams();
|
||||||
|
|
||||||
|
|
@ -171,6 +172,7 @@ const KioskBookingPage = () => {
|
||||||
CompId: responseData?.CompId,
|
CompId: responseData?.CompId,
|
||||||
BranchId: responseData?.BranchId,
|
BranchId: responseData?.BranchId,
|
||||||
AppId: responseData?.AppId,
|
AppId: responseData?.AppId,
|
||||||
|
UserId: responseData?.UserId,
|
||||||
})).unwrap();
|
})).unwrap();
|
||||||
dispatch(
|
dispatch(
|
||||||
getProductCategories({
|
getProductCategories({
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,7 @@ const KioskPayment = (props) => {
|
||||||
};
|
};
|
||||||
dispatch(getKioskPrinterDetails(data)).unwrap();
|
dispatch(getKioskPrinterDetails(data)).unwrap();
|
||||||
}
|
}
|
||||||
dispatch(getPreferenceData({ CompId: SessionData.CompId, BranchId: SessionData.BranchId, AppId: SessionData.AppId })).unwrap();
|
dispatch(getPreferenceData({ CompId: SessionData.CompId, BranchId: SessionData.BranchId, AppId: SessionData.AppId,UserId: SessionData.UserId })).unwrap();
|
||||||
}
|
}
|
||||||
}, [SessionData.CompId, SessionData.BranchId, SessionData.AppId]);
|
}, [SessionData.CompId, SessionData.BranchId, SessionData.AppId]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ const BundleOfferList = () => {
|
||||||
const [allowDecimal, setAllowDecimal] = useState(false);
|
const [allowDecimal, setAllowDecimal] = useState(false);
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId:UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ const ComboOfferMaster = ({ formType }) => {
|
||||||
const [allowDecimal, setAllowDecimal] = useState(false);
|
const [allowDecimal, setAllowDecimal] = useState(false);
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId, UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ const CouponWiseOfferlist = () => {
|
||||||
const indeterminate = checkedList.length > 0 && checkedList.length < plainOptions.length;
|
const indeterminate = checkedList.length > 0 && checkedList.length < plainOptions.length;
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId:UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
|
|
|
||||||
|
|
@ -409,7 +409,7 @@ const ItemWiseForm = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId:UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ const LoyaltyPointsList = () => {
|
||||||
const [allowDecimal, setAllowDecimal] = useState(false);
|
const [allowDecimal, setAllowDecimal] = useState(false);
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId:UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ const OfferList = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ const OfferCodeList = () => {
|
||||||
const indeterminate =
|
const indeterminate =
|
||||||
checkedList.length > 0 && checkedList.length < plainOptions.length;
|
checkedList.length > 0 && checkedList.length < plainOptions.length;
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId:UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ const PromocodeList = () => {
|
||||||
const checkAll = plainOptions.length === checkedList.length;
|
const checkAll = plainOptions.length === checkedList.length;
|
||||||
const indeterminate = checkedList.length > 0 && checkedList.length < plainOptions.length;
|
const indeterminate = checkedList.length > 0 && checkedList.length < plainOptions.length;
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
|
|
|
||||||
|
|
@ -416,7 +416,7 @@ const QuantityWiseForm = () => {
|
||||||
setEmpData(datas?.[0]);
|
setEmpData(datas?.[0]);
|
||||||
};
|
};
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId:UserId};
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ const SalesWiseList = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,7 @@ const PaymentReceivedRetail = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import { useAuth } from '../../AuthContext.jsx';
|
||||||
import { ApplicationPreferences } from '../../Features/BrachLogin/BranchLogin.js';
|
import { ApplicationPreferences } from '../../Features/BrachLogin/BranchLogin.js';
|
||||||
import './PreferenceList.scss';
|
import './PreferenceList.scss';
|
||||||
import { InputField } from '../../Components/Forms/InputField.jsx';
|
import { InputField } from '../../Components/Forms/InputField.jsx';
|
||||||
import { changePreferenceData } from '../../Features/BookingScreen/BookingData/BookingData.js';
|
import { changePreferenceData, getPreferenceData } from '../../Features/BookingScreen/BookingData/BookingData.js';
|
||||||
import { DropDowns } from '../../Components/Forms/DropDown.jsx';
|
import { DropDowns } from '../../Components/Forms/DropDown.jsx';
|
||||||
import { getBranchUsers } from '../../Features/UserAccount/userData.js';
|
import { getBranchUsers } from '../../Features/UserAccount/userData.js';
|
||||||
import { UserDataBasedOnBranchId } from '../../Features/Reports/Reports.js';
|
import { UserDataBasedOnBranchId } from '../../Features/Reports/Reports.js';
|
||||||
|
|
@ -311,6 +311,8 @@ const PreferenceList = ({ setting = false }) => {
|
||||||
|
|
||||||
const fetchTableData = async () => {
|
const fetchTableData = async () => {
|
||||||
const res = await dispatch(gettableData({ CompId, BranchId, AppId,UserId:selectedUserId })).unwrap();
|
const res = await dispatch(gettableData({ CompId, BranchId, AppId,UserId:selectedUserId })).unwrap();
|
||||||
|
const data = { CompId, BranchId, AppId, UserId: selectedUserId };
|
||||||
|
// const res = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
if (res?.data?.statusCode === 1 && res?.data?.data?.length > 0) {
|
if (res?.data?.statusCode === 1 && res?.data?.data?.length > 0) {
|
||||||
await dispatch(changePreferenceData(res?.data?.data));
|
await dispatch(changePreferenceData(res?.data?.data));
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -507,10 +509,7 @@ const userDropData = async () => {
|
||||||
|
|
||||||
|
|
||||||
if (gettinguserDropDown?.data?.statusCode === 1) {
|
if (gettinguserDropDown?.data?.statusCode === 1) {
|
||||||
const finaluserDropDown = gettinguserDropDown?.data?.data?.filter(
|
const finaluserDropDown = gettinguserDropDown?.data?.data?.filter((value) => value.ActiveStatus === "A");
|
||||||
(value) => value.ActiveStatus === "A"
|
|
||||||
);
|
|
||||||
|
|
||||||
setUserDropDown(finaluserDropDown);
|
setUserDropDown(finaluserDropDown);
|
||||||
|
|
||||||
if (UserType === 'Employee') {
|
if (UserType === 'Employee') {
|
||||||
|
|
|
||||||
|
|
@ -1596,7 +1596,7 @@ const ProductList = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
|
|
|
||||||
|
|
@ -588,7 +588,7 @@ const SalesQuotationForm = () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId, UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
|
|
|
||||||
|
|
@ -368,7 +368,7 @@ const DateWiseReport = () => {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ const EstimateDateWiseReport = () => {
|
||||||
return allowDecimal ? parseFloat(value || 0).toFixed(2) : Math.round(value || 0);
|
return allowDecimal ? parseFloat(value || 0).toFixed(2) : Math.round(value || 0);
|
||||||
};
|
};
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId ,UserId: UserId};
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
|
|
|
||||||
|
|
@ -737,7 +737,7 @@ const EstimateItemWiseReport = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId, UserId : UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,7 @@ const ItemWiseReport = () => {
|
||||||
}
|
}
|
||||||
}, [apiCall]);
|
}, [apiCall]);
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
|
|
|
||||||
|
|
@ -701,7 +701,7 @@ const RevenueItemWiseReport = () => {
|
||||||
return allowDecimal ? parseFloat(value || 0).toFixed(2) : Math.round(value || 0);
|
return allowDecimal ? parseFloat(value || 0).toFixed(2) : Math.round(value || 0);
|
||||||
};
|
};
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
|
|
|
||||||
|
|
@ -314,7 +314,7 @@ const StockList = () => {
|
||||||
setSearchText(e?.target?.value);
|
setSearchText(e?.target?.value);
|
||||||
};
|
};
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
|
|
|
||||||
|
|
@ -737,7 +737,7 @@ const StockPriceUpdate = () => {
|
||||||
fetchData();
|
fetchData();
|
||||||
}, []);
|
}, []);
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
|
|
|
||||||
|
|
@ -981,7 +981,7 @@ const KitechenFinishform = ({ formType }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
|
|
|
||||||
|
|
@ -179,16 +179,16 @@ const commonModulePreference = appPreferences?.find(
|
||||||
setIsDataLoading(false);
|
setIsDataLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadAllRequiredData = async (firstInvoice) => {
|
const loadAllRequiredData = async (firstInvoice) => {
|
||||||
try {
|
try {
|
||||||
const { AppId, CompId, BranchId } = firstInvoice;
|
const { AppId, CompId, BranchId,UserId } = firstInvoice;
|
||||||
const pricingData = {
|
const pricingData = {
|
||||||
appId: AppId,
|
appId: AppId,
|
||||||
compId: CompId,
|
compId: CompId,
|
||||||
branchId: BranchId,
|
branchId: BranchId,
|
||||||
|
UserId : UserId
|
||||||
};
|
};
|
||||||
const printData = { AppId, CompId, BranchId };
|
const printData = { AppId, CompId, BranchId, UserId };
|
||||||
|
|
||||||
// Step 1: Call PricingAppPricingName to update global state
|
// Step 1: Call PricingAppPricingName to update global state
|
||||||
console.log("Step 1: Calling PricingAppPricingNameData...");
|
console.log("Step 1: Calling PricingAppPricingNameData...");
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,7 @@ const ProtectedRoutes = ({ routesConfig }) => {
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
CompId: CompId,
|
CompId: CompId,
|
||||||
BranchId: BranchId,
|
BranchId: BranchId,
|
||||||
|
UserId:UserId
|
||||||
};
|
};
|
||||||
const response = await dispatch(gettableData(DineinData)).unwrap();
|
const response = await dispatch(gettableData(DineinData)).unwrap();
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue