Merge pull request 'color-print-testing' (#250) from color-print-testing into main
Reviewed-on: Pozomind/pozo-retail-app#250
This commit is contained in:
commit
9b0821c4b1
|
|
@ -92,7 +92,6 @@ const BranchLogin = () => {
|
||||||
setAftergetPin(true);
|
setAftergetPin(true);
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (aftergetPin == true && UserType == 'Super Admin User') {
|
if (aftergetPin == true && UserType == 'Super Admin User') {
|
||||||
fetchData(seletedBranchData);
|
fetchData(seletedBranchData);
|
||||||
|
|
@ -117,7 +116,7 @@ const BranchLogin = () => {
|
||||||
};
|
};
|
||||||
}, [seconds, disabled]);
|
}, [seconds, disabled]);
|
||||||
|
|
||||||
const fetchData = async (e) => {
|
const fetchData = async (e, type) => {
|
||||||
await sessionStore('BranchId', e);
|
await sessionStore('BranchId', e);
|
||||||
let data = {
|
let data = {
|
||||||
CompId: CompId,
|
CompId: CompId,
|
||||||
|
|
@ -135,7 +134,7 @@ const BranchLogin = () => {
|
||||||
(item) => item.SettingIdName === filterSettingIdName
|
(item) => item.SettingIdName === filterSettingIdName
|
||||||
);
|
);
|
||||||
|
|
||||||
if (res?.data?.statusCode == 1) {
|
if (res?.data?.statusCode == 1 && type !== 'W') {
|
||||||
filteredDatas?.[0]?.SettingValue == 'Y'
|
filteredDatas?.[0]?.SettingValue == 'Y'
|
||||||
? navigate(`${subDirectory}app-page/home`)
|
? navigate(`${subDirectory}app-page/home`)
|
||||||
: navigate(`${subDirectory}sales`);
|
: navigate(`${subDirectory}sales`);
|
||||||
|
|
@ -192,8 +191,12 @@ const BranchLogin = () => {
|
||||||
|
|
||||||
const onChangeBranch = async (e) => {
|
const onChangeBranch = async (e) => {
|
||||||
let data = CompBranchData?.find((a) => a?.BrId == e);
|
let data = CompBranchData?.find((a) => a?.BrId == e);
|
||||||
if (data?.LocationType == 'W') await dispatch(changeWarehouse(true));
|
if (data?.LocationType == 'W') {
|
||||||
|
sessionStore("Warehouse", true)
|
||||||
|
await dispatch(changeWarehouse(true));
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
sessionStore("Warehouse", false)
|
||||||
await dispatch(changeWarehouse(false));
|
await dispatch(changeWarehouse(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -204,7 +207,7 @@ const BranchLogin = () => {
|
||||||
|
|
||||||
dispatch(changeOrderCardDetails([]));
|
dispatch(changeOrderCardDetails([]));
|
||||||
if (UserType != 'Super Admin User') {
|
if (UserType != 'Super Admin User') {
|
||||||
await fetchData(e);
|
await fetchData(e, data?.LocationType);
|
||||||
} else {
|
} else {
|
||||||
const checkData = SAdminUserData?.filter(
|
const checkData = SAdminUserData?.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ import {
|
||||||
encryptedValuesUrlFun,
|
encryptedValuesUrlFun,
|
||||||
ExtractDateFormate,
|
ExtractDateFormate,
|
||||||
getSession,
|
getSession,
|
||||||
|
sessionStore,
|
||||||
} from '../../Services/Others';
|
} from '../../Services/Others';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
@ -46,6 +47,7 @@ import {
|
||||||
} from '../../Features/ProductPage/ProductPage.js';
|
} from '../../Features/ProductPage/ProductPage.js';
|
||||||
import {
|
import {
|
||||||
ApplicationPreferences,
|
ApplicationPreferences,
|
||||||
|
changeWarehouse,
|
||||||
checkSession,
|
checkSession,
|
||||||
GenerateLogout,
|
GenerateLogout,
|
||||||
getCompBranchData,
|
getCompBranchData,
|
||||||
|
|
@ -308,6 +310,23 @@ const RetailDashboard = () => {
|
||||||
isMountedRef.current = false;
|
isMountedRef.current = false;
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
//sri checkin warehouse condition
|
||||||
|
useEffect(() => {
|
||||||
|
const checkWarehouseorNot = async (e) => {
|
||||||
|
let data = CompBranchData?.find((a) => a?.BrId == e);
|
||||||
|
if (data?.LocationType == 'W') {
|
||||||
|
sessionStore("Warhouse", true)
|
||||||
|
await dispatch(changeWarehouse(true));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sessionStore("Warehouse", false)
|
||||||
|
await dispatch(changeWarehouse(false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CompBranchData?.length > 0 && BranchId) {
|
||||||
|
checkWarehouseorNot(BranchId)
|
||||||
|
}
|
||||||
|
}, [CompBranchData, BranchId])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
|
|
@ -2440,13 +2459,11 @@ const RetailDashboard = () => {
|
||||||
{SelectTypeName === 'OTP'
|
{SelectTypeName === 'OTP'
|
||||||
? !FirstTimeOtp
|
? !FirstTimeOtp
|
||||||
? `send ${SelectTypeName.toLocaleLowerCase()}`
|
? `send ${SelectTypeName.toLocaleLowerCase()}`
|
||||||
: `resend ${SelectTypeName.toLocaleLowerCase()}${
|
: `resend ${SelectTypeName.toLocaleLowerCase()}${seconds > 0 ? ` in ${seconds}s` : ''
|
||||||
seconds > 0 ? ` in ${seconds}s` : ''
|
|
||||||
}`
|
}`
|
||||||
: !FirstTimePin
|
: !FirstTimePin
|
||||||
? `send ${SelectTypeName.toLocaleLowerCase()}`
|
? `send ${SelectTypeName.toLocaleLowerCase()}`
|
||||||
: `resend ${SelectTypeName.toLocaleLowerCase()}${
|
: `resend ${SelectTypeName.toLocaleLowerCase()}${seconds > 0 ? ` in ${seconds}s` : ''
|
||||||
seconds > 0 ? ` in ${seconds}s` : ''
|
|
||||||
}`}
|
}`}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import {
|
||||||
checkSession,
|
checkSession,
|
||||||
getCompBranchData,
|
getCompBranchData,
|
||||||
getCommonAppPreference,
|
getCommonAppPreference,
|
||||||
|
changeWarehouse,
|
||||||
} from './Features/BrachLogin/BranchLogin.js';
|
} from './Features/BrachLogin/BranchLogin.js';
|
||||||
import { clearSession, getSession } from './Services/Others';
|
import { clearSession, getSession } from './Services/Others';
|
||||||
import {
|
import {
|
||||||
|
|
@ -39,6 +40,7 @@ const ProtectedRoutes = ({ routesConfig }) => {
|
||||||
const BranchId = getSession('BranchId');
|
const BranchId = getSession('BranchId');
|
||||||
const UserId = getSession('UserId');
|
const UserId = getSession('UserId');
|
||||||
const sessionId = getSession('SessionId');
|
const sessionId = getSession('SessionId');
|
||||||
|
const Warehouse = getSession('Warehouse');
|
||||||
const [accessCheckComplete, setAccessCheckComplete] = useState(false);
|
const [accessCheckComplete, setAccessCheckComplete] = useState(false);
|
||||||
const FeatureAddonData = useSelector(GlobalFeatAddOnData);
|
const FeatureAddonData = useSelector(GlobalFeatAddOnData);
|
||||||
useTemplate(CompId, BranchId, AppId);
|
useTemplate(CompId, BranchId, AppId);
|
||||||
|
|
@ -46,7 +48,12 @@ const ProtectedRoutes = ({ routesConfig }) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getApplicationPreference();
|
getApplicationPreference();
|
||||||
}, []);
|
}, []);
|
||||||
|
//sri
|
||||||
|
useEffect(() => {
|
||||||
|
if (Warehouse) {
|
||||||
|
dispatch(changeWarehouse(true));
|
||||||
|
}
|
||||||
|
}, [Warehouse]);
|
||||||
const getApplicationPreference = async () => {
|
const getApplicationPreference = async () => {
|
||||||
await dispatch(getCommonAppPreference(AppId)).unwrap();
|
await dispatch(getCommonAppPreference(AppId)).unwrap();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue