Added Warehouse condition
This commit is contained in:
parent
289e4744d3
commit
770a65945a
|
|
@ -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 (
|
||||||
|
|
@ -2183,24 +2202,24 @@ const RetailDashboard = () => {
|
||||||
>
|
>
|
||||||
{preorderData?.[0]?.BranchDtl
|
{preorderData?.[0]?.BranchDtl
|
||||||
? preorderData?.[0]?.BranchDtl?.map(
|
? preorderData?.[0]?.BranchDtl?.map(
|
||||||
(item, index) => (
|
(item, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
style={{
|
style={{
|
||||||
marginBottom: 8,
|
marginBottom: 8,
|
||||||
paddingBottom: 8,
|
paddingBottom: 8,
|
||||||
borderBottom: '1px solid #f0f0f0',
|
borderBottom: '1px solid #f0f0f0',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<strong>
|
<strong>
|
||||||
{item.BranchName || 'N/A'}
|
{item.BranchName || 'N/A'}
|
||||||
</strong>
|
</strong>
|
||||||
<br />
|
<br />
|
||||||
Total Orders: {item.TotalOrders || 0}
|
Total Orders: {item.TotalOrders || 0}
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
: 'No Data'}
|
: 'No Data'}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
@ -2223,24 +2242,24 @@ const RetailDashboard = () => {
|
||||||
>
|
>
|
||||||
{preorderData?.[0]?.BranchDtl
|
{preorderData?.[0]?.BranchDtl
|
||||||
? preorderData?.[0]?.BranchDtl?.map(
|
? preorderData?.[0]?.BranchDtl?.map(
|
||||||
(item, index) => (
|
(item, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
style={{
|
style={{
|
||||||
marginBottom: 8,
|
marginBottom: 8,
|
||||||
paddingBottom: 8,
|
paddingBottom: 8,
|
||||||
borderBottom: '1px solid #f0f0f0',
|
borderBottom: '1px solid #f0f0f0',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<strong>
|
<strong>
|
||||||
{item.BranchName || 'N/A'}
|
{item.BranchName || 'N/A'}
|
||||||
</strong>
|
</strong>
|
||||||
<br />
|
<br />
|
||||||
Total Orders: {item.PendingOrders || 0}
|
Total Orders: {item.PendingOrders || 0}
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
: 'No Data'}
|
: 'No Data'}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
@ -2263,24 +2282,24 @@ const RetailDashboard = () => {
|
||||||
>
|
>
|
||||||
{preorderData?.[0]?.BranchDtl
|
{preorderData?.[0]?.BranchDtl
|
||||||
? preorderData?.[0]?.BranchDtl?.map(
|
? preorderData?.[0]?.BranchDtl?.map(
|
||||||
(item, index) => (
|
(item, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
style={{
|
style={{
|
||||||
marginBottom: 8,
|
marginBottom: 8,
|
||||||
paddingBottom: 8,
|
paddingBottom: 8,
|
||||||
borderBottom: '1px solid #f0f0f0',
|
borderBottom: '1px solid #f0f0f0',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<strong>
|
<strong>
|
||||||
{item.BranchName || 'N/A'}
|
{item.BranchName || 'N/A'}
|
||||||
</strong>
|
</strong>
|
||||||
<br />
|
<br />
|
||||||
Total Orders: {item.CompletedOrders || 0}
|
Total Orders: {item.CompletedOrders || 0}
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
: 'No Data'}
|
: 'No Data'}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
@ -2440,14 +2459,12 @@ 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>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue