Reviewed-on: Pozomind/pozo-retail-app#179
This commit is contained in:
commit
5bd84fe7d4
|
|
@ -3693,7 +3693,7 @@ const BSItemCard = (props) => {
|
|||
parseInt(totalSelectedProductQty || 0) +
|
||||
parseInt(reorderComboConsumed || 0);
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
let getCurrentProdDtl = orderDetails?.filter(
|
||||
(a) => a?.ProdName === ProdName
|
||||
);
|
||||
|
|
@ -3894,7 +3894,7 @@ const BSItemCard = (props) => {
|
|||
parseInt(totalSelectedProductQty || 0) +
|
||||
parseInt(reorderComboConsumed || 0);
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId);
|
||||
let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => {
|
||||
return (
|
||||
|
|
@ -3930,7 +3930,7 @@ const BSItemCard = (props) => {
|
|||
}, 0);
|
||||
totalOrderQty =
|
||||
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
||||
if (
|
||||
parseInt(ItemQuantity) >
|
||||
|
|
@ -4016,7 +4016,7 @@ const BSItemCard = (props) => {
|
|||
parseInt(totalSelectedProductQty || 0) +
|
||||
parseInt(reorderComboConsumed || 0);
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId);
|
||||
let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => {
|
||||
return (
|
||||
|
|
@ -4055,7 +4055,7 @@ const BSItemCard = (props) => {
|
|||
}, 0);
|
||||
totalOrderQty =
|
||||
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
||||
if (
|
||||
parseInt(ItemQuantity) >
|
||||
|
|
@ -4147,7 +4147,7 @@ const BSItemCard = (props) => {
|
|||
parseInt(totalSelectedProductQty || 0) +
|
||||
parseInt(reorderComboConsumed || 0);
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
let getCurrentProdDtl = orderDetails?.filter(
|
||||
(a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId
|
||||
);
|
||||
|
|
@ -4190,7 +4190,7 @@ const BSItemCard = (props) => {
|
|||
}, 0);
|
||||
totalOrderQty =
|
||||
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
|
||||
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
||||
if (
|
||||
|
|
@ -4274,7 +4274,7 @@ const BSItemCard = (props) => {
|
|||
parseInt(totalSelectedProductQty || 0) +
|
||||
parseInt(reorderComboConsumed || 0);
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
let getCurrentProdDtl = orderDetails?.filter(
|
||||
(a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId
|
||||
);
|
||||
|
|
@ -4321,7 +4321,7 @@ const BSItemCard = (props) => {
|
|||
}, 0);
|
||||
totalOrderQty =
|
||||
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
|
||||
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
||||
if (
|
||||
|
|
@ -5203,7 +5203,33 @@ const BSItemCard = (props) => {
|
|||
return null; // or any other value you want to return
|
||||
}
|
||||
};
|
||||
const ItemMRP = (item) => {
|
||||
// const variantWithDetails = item?.ProductDetail?.find((variant) => variant?.ProdVariantDetails?.length > 0);
|
||||
|
||||
if (preferenceSingleSales && item.OnePcsAvailable === 'Y') {
|
||||
return (
|
||||
item?.ProductDetail?.[0]?.ProdVariantDetails?.[0]?.StockDetails?.[0]
|
||||
?.OnePcsPrice || null
|
||||
);
|
||||
// OnePcsPrice
|
||||
}
|
||||
|
||||
const variantWithDetails = item?.ProductDetail?.find(
|
||||
(variant) =>
|
||||
variant?.ProdVariantDetails?.length > 0 &&
|
||||
variant?.ProdVariantDetails?.[0]?.StockDetails?.[0]?.MRP
|
||||
);
|
||||
if (variantWithDetails) {
|
||||
// Access the details of the first variant with ProdVariantDetails
|
||||
const firstVariantDetails =
|
||||
variantWithDetails?.ProdVariantDetails?.[0]?.StockDetails?.[0]
|
||||
?.MRP;
|
||||
return firstVariantDetails;
|
||||
} else {
|
||||
// Handle the case where no variant satisfies the condition
|
||||
return null; // or any other value you want to return
|
||||
}
|
||||
};
|
||||
const ItemSize = (item) => {
|
||||
if (preferenceSingleSales && item?.OnePcsAvailable === 'Y') {
|
||||
return 1;
|
||||
|
|
@ -6429,6 +6455,40 @@ const BSItemCard = (props) => {
|
|||
</p>
|
||||
)}
|
||||
</p>
|
||||
{cardFunction?.MRP &&
|
||||
((item?.OverAllQty !== undefined &&
|
||||
(!preferenceSingleSales
|
||||
? item?.OverAllQty !== 0
|
||||
: item?.OverAllPcs !== 0) &&
|
||||
item?.OverAllQty !== null) ||
|
||||
item?.ProductDetail?.some(
|
||||
(item) =>
|
||||
item?.StockAvailable !== 'Y'
|
||||
)) && (
|
||||
<p
|
||||
className="BSItemCard-itemPrice"
|
||||
style={{
|
||||
fontSize:
|
||||
!cardFunction?.SmallImage
|
||||
? cardFunction?.BigImage &&
|
||||
'12px'
|
||||
: '12px',
|
||||
textAlign: 'center',
|
||||
lineHeight: '2',
|
||||
fontFamily: SelectedCardFont
|
||||
? SelectedCardFont
|
||||
: '',
|
||||
color: SelectedCardColor
|
||||
? SelectedCardColor?.[
|
||||
'FontColor'
|
||||
]
|
||||
: '',
|
||||
}}
|
||||
>
|
||||
MRP: ₹ {ItemMRP(item)}
|
||||
|
||||
</p>
|
||||
)}
|
||||
{cardFunction?.Price &&
|
||||
((item?.OverAllQty !== undefined &&
|
||||
(!preferenceSingleSales
|
||||
|
|
@ -6842,6 +6902,40 @@ const BSItemCard = (props) => {
|
|||
</p>
|
||||
)}
|
||||
</p>
|
||||
{cardFunction?.MRP &&
|
||||
((item?.OverAllQty !== undefined &&
|
||||
(!preferenceSingleSales
|
||||
? item?.OverAllQty !== 0
|
||||
: item?.OverAllPcs !== 0) &&
|
||||
item?.OverAllQty !== null) ||
|
||||
item?.ProductDetail?.some(
|
||||
(item) =>
|
||||
item?.StockAvailable !== 'Y'
|
||||
)) && (
|
||||
<p
|
||||
className="BSItemCard-itemPrice"
|
||||
style={{
|
||||
fontSize:
|
||||
!cardFunction?.SmallImage
|
||||
? cardFunction?.BigImage &&
|
||||
'12px'
|
||||
: '12px',
|
||||
textAlign: 'center',
|
||||
lineHeight: '2',
|
||||
fontFamily: SelectedCardFont
|
||||
? SelectedCardFont
|
||||
: '',
|
||||
color: SelectedCardColor
|
||||
? SelectedCardColor?.[
|
||||
'FontColor'
|
||||
]
|
||||
: '',
|
||||
}}
|
||||
>
|
||||
MRP: ₹ {ItemMRP(item)}
|
||||
|
||||
</p>
|
||||
)}
|
||||
{cardFunction?.Price &&
|
||||
((item?.OverAllQty !== undefined &&
|
||||
(!preferenceSingleSales
|
||||
|
|
@ -7146,7 +7240,29 @@ const BSItemCard = (props) => {
|
|||
</p>
|
||||
)}
|
||||
</div>
|
||||
{((item?.OverAllQty !== undefined &&
|
||||
{cardFunction?.MRP && ((item?.OverAllQty !== undefined &&
|
||||
!preferenceSingleSales
|
||||
? returnCount(
|
||||
item?.ProductDetail?.[0]?.ProdName,
|
||||
item?.OverAllQty,
|
||||
CartOrderDetails,
|
||||
item
|
||||
)
|
||||
: returnOnepcCount(
|
||||
item?.ProductDetail?.[0]?.ProdName,
|
||||
item?.OverAllPcs,
|
||||
CartOrderDetails
|
||||
) > 0) ||
|
||||
item?.ProductDetail?.some(
|
||||
(item) => item?.StockAvailable !== 'Y'
|
||||
)) && (
|
||||
<div className="card4PriceUom">
|
||||
<div className="card4MRP">
|
||||
MRP: ₹ {ItemMRP(item)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{ ((item?.OverAllQty !== undefined &&
|
||||
!preferenceSingleSales
|
||||
? returnCount(
|
||||
item?.ProductDetail?.[0]?.ProdName,
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ function dynamicComponentProps(sessionName, data, componentName) {
|
|||
ImageUp: false,
|
||||
ImageDown: false,
|
||||
BigImage: false,
|
||||
MRP: false,
|
||||
|
||||
};
|
||||
let output = {};
|
||||
|
||||
|
|
|
|||
|
|
@ -975,6 +975,17 @@
|
|||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
.card4MRP {
|
||||
font-size: 0.80rem;
|
||||
line-height: 0.80rem;
|
||||
font-weight: 600;
|
||||
color: #059669;
|
||||
-webkit-text-stroke-width: 0.3px;
|
||||
|
||||
@media (max-width: 500px) {
|
||||
font-size: 0.50rem;
|
||||
}
|
||||
}
|
||||
|
||||
.card4Uom {
|
||||
background-color: #f3f4f6;
|
||||
|
|
|
|||
Loading…
Reference in New Issue