Merge pull request 'added offer for combo sales screen' (#36) from temp/gokul-offer-add-on-sales-sccreen-for-combo into main
Reviewed-on: Pozomind/pozo-retail-app#36
This commit is contained in:
commit
fadf942865
|
|
@ -89,7 +89,9 @@ const BSBillingEditQuantity = (props) => {
|
||||||
const templateData = useSelector(getTemplateData);
|
const templateData = useSelector(getTemplateData);
|
||||||
const OfferCheckedInSetup = templateData?.BookingNavbar?.[1].some(
|
const OfferCheckedInSetup = templateData?.BookingNavbar?.[1].some(
|
||||||
(item) => item?.OptionName == 'Offer'
|
(item) => item?.OptionName == 'Offer'
|
||||||
);
|
) || (templateData?.BookingCombo1?.[1]?.some(
|
||||||
|
(item) => item?.OptionName == 'Offer'
|
||||||
|
));
|
||||||
const [ClearQuantity, setClearQuantity] = useState(false);
|
const [ClearQuantity, setClearQuantity] = useState(false);
|
||||||
const CartOrderDetails = useSelector(GlobalOrderCardDetails);
|
const CartOrderDetails = useSelector(GlobalOrderCardDetails);
|
||||||
const SettingDataSelector = useSelector(PreferenceData);
|
const SettingDataSelector = useSelector(PreferenceData);
|
||||||
|
|
@ -702,7 +704,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
return (
|
return (
|
||||||
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
cartItem?.OfferMessage?.[0]?.OfferId ===
|
cartItem?.OfferMessage?.[0]?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
cartItem?.OfferMode === editedProduct?.OfferMode &&
|
cartItem?.OfferMode === editedProduct?.OfferMode &&
|
||||||
cartItem?.BookingTypeName !== editedProduct?.BookingTypeName
|
cartItem?.BookingTypeName !== editedProduct?.BookingTypeName
|
||||||
);
|
);
|
||||||
|
|
@ -836,7 +838,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
||||||
cartItem?.BookingTypeName !==
|
cartItem?.BookingTypeName !==
|
||||||
editedProduct?.BookingTypeName &&
|
editedProduct?.BookingTypeName &&
|
||||||
!cartItem?.OfferMode &&
|
!cartItem?.OfferMode &&
|
||||||
cartItem?.Offer === 0
|
cartItem?.Offer === 0
|
||||||
);
|
);
|
||||||
|
|
@ -850,7 +852,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
||||||
cartItem?.BookingTypeName !==
|
cartItem?.BookingTypeName !==
|
||||||
editedProduct?.BookingTypeName &&
|
editedProduct?.BookingTypeName &&
|
||||||
cartItem?.OfferMode === editedProduct?.OfferMode &&
|
cartItem?.OfferMode === editedProduct?.OfferMode &&
|
||||||
cartItem?.Offer > 0
|
cartItem?.Offer > 0
|
||||||
);
|
);
|
||||||
|
|
@ -983,7 +985,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
)
|
)
|
||||||
) &&
|
) &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
product?.OfferMode === editedProduct?.OfferMode
|
product?.OfferMode === editedProduct?.OfferMode
|
||||||
) {
|
) {
|
||||||
const freeQty =
|
const freeQty =
|
||||||
|
|
@ -1016,7 +1018,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
|
|
@ -1099,7 +1101,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
)
|
)
|
||||||
) &&
|
) &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
product?.OfferMode === editedProduct?.OfferMode
|
product?.OfferMode === editedProduct?.OfferMode
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
|
|
@ -1129,7 +1131,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
|
|
@ -1316,7 +1318,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
|
|
@ -1418,7 +1420,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
|
|
@ -1572,7 +1574,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
) &&
|
) &&
|
||||||
cartItem?.Offer &&
|
cartItem?.Offer &&
|
||||||
isFreeProductApplicable?.OfferId ===
|
isFreeProductApplicable?.OfferId ===
|
||||||
cartItem?.OfferMessage?.[0]?.OfferId
|
cartItem?.OfferMessage?.[0]?.OfferId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -1861,11 +1863,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
product?.ProdId === editedProduct?.ProdId &&
|
product?.ProdId === editedProduct?.ProdId &&
|
||||||
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) &&
|
otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) &&
|
||||||
product?.OfferMode ===
|
product?.OfferMode ===
|
||||||
(sameBookingTypeProduct?.OfferMode ||
|
(sameBookingTypeProduct?.OfferMode ||
|
||||||
otherBookingTypeProduct?.OfferMode)
|
otherBookingTypeProduct?.OfferMode)
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
...product,
|
...product,
|
||||||
|
|
@ -1899,11 +1901,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) &&
|
otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) &&
|
||||||
offerProduct?.OfferMode ===
|
offerProduct?.OfferMode ===
|
||||||
(sameBookingTypeProduct?.OfferMode ||
|
(sameBookingTypeProduct?.OfferMode ||
|
||||||
otherBookingTypeProduct?.OfferMode);
|
otherBookingTypeProduct?.OfferMode);
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
// Get loyalty points from the matching free product
|
// Get loyalty points from the matching free product
|
||||||
|
|
@ -2044,7 +2046,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
cartItem?.Offer > 0 &&
|
cartItem?.Offer > 0 &&
|
||||||
isFreeProductApplicable?.OfferMode === cartItem?.OfferMode &&
|
isFreeProductApplicable?.OfferMode === cartItem?.OfferMode &&
|
||||||
isFreeProductApplicable?.OfferId ===
|
isFreeProductApplicable?.OfferId ===
|
||||||
cartItem?.OfferMessage?.[0]?.OfferId
|
cartItem?.OfferMessage?.[0]?.OfferId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -2147,11 +2149,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2222,12 +2224,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
product?.ProdId === editedProduct?.ProdId &&
|
product?.ProdId === editedProduct?.ProdId &&
|
||||||
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
product?.OfferMode ===
|
product?.OfferMode ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMode ||
|
(sameBookingTypeFreeProduct?.OfferMode ||
|
||||||
otherBookingTypeFreeProduct?.OfferMode)
|
otherBookingTypeFreeProduct?.OfferMode)
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
...product,
|
...product,
|
||||||
|
|
@ -2261,13 +2263,13 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMessage?.[0]
|
(sameBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId ||
|
?.OfferId ||
|
||||||
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
offerProduct?.OfferMode ===
|
offerProduct?.OfferMode ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMode ||
|
(sameBookingTypeFreeProduct?.OfferMode ||
|
||||||
otherBookingTypeFreeProduct?.OfferMode);
|
otherBookingTypeFreeProduct?.OfferMode);
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
// Get loyalty points from the matching free product
|
// Get loyalty points from the matching free product
|
||||||
|
|
@ -2349,11 +2351,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
sameBookingTypeProduct.InwardDtlId &&
|
sameBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
sameBookingTypeProduct.BookingTypeName &&
|
sameBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
sameBookingTypeProduct.OrderRate &&
|
sameBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2406,11 +2408,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
sameBookingTypeProduct.InwardDtlId &&
|
sameBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
sameBookingTypeProduct.BookingTypeName &&
|
sameBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
sameBookingTypeProduct.OrderRate &&
|
sameBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2499,11 +2501,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem?.InwardDtlId ===
|
cartItem?.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem?.BookingTypeName ===
|
cartItem?.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem?.OrderRate ===
|
cartItem?.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem?.OfferMode &&
|
cartItem?.OfferMode &&
|
||||||
cartItem?.Offer > 0
|
cartItem?.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2532,11 +2534,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2566,11 +2568,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2669,12 +2671,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
product?.ProdId === editedProduct?.ProdId &&
|
product?.ProdId === editedProduct?.ProdId &&
|
||||||
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
product?.OfferMode ===
|
product?.OfferMode ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMode ||
|
(sameBookingTypeFreeProduct?.OfferMode ||
|
||||||
otherBookingTypeFreeProduct?.OfferMode)
|
otherBookingTypeFreeProduct?.OfferMode)
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
...product,
|
...product,
|
||||||
|
|
@ -2708,12 +2710,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeProduct?.OfferMessage?.[0]
|
otherBookingTypeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
offerProduct?.OfferMode ===
|
offerProduct?.OfferMode ===
|
||||||
(sameBookingTypeProduct?.OfferMode ||
|
(sameBookingTypeProduct?.OfferMode ||
|
||||||
otherBookingTypeProduct?.OfferMode);
|
otherBookingTypeProduct?.OfferMode);
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
// Get loyalty points from the matching free product
|
// Get loyalty points from the matching free product
|
||||||
|
|
@ -2792,11 +2794,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
sameBookingTypeProduct.InwardDtlId &&
|
sameBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
sameBookingTypeProduct.BookingTypeName &&
|
sameBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
sameBookingTypeProduct.OrderRate &&
|
sameBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2855,11 +2857,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2931,12 +2933,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
product?.ProdId === editedProduct?.ProdId &&
|
product?.ProdId === editedProduct?.ProdId &&
|
||||||
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
product?.OfferMode ===
|
product?.OfferMode ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMode ||
|
(sameBookingTypeFreeProduct?.OfferMode ||
|
||||||
otherBookingTypeFreeProduct?.OfferMode)
|
otherBookingTypeFreeProduct?.OfferMode)
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
...product,
|
...product,
|
||||||
|
|
@ -2970,12 +2972,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeProduct?.OfferMessage?.[0]
|
otherBookingTypeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
offerProduct?.OfferMode ===
|
offerProduct?.OfferMode ===
|
||||||
(sameBookingTypeProduct?.OfferMode ||
|
(sameBookingTypeProduct?.OfferMode ||
|
||||||
otherBookingTypeProduct?.OfferMode);
|
otherBookingTypeProduct?.OfferMode);
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
// Get loyalty points from the matching free product
|
// Get loyalty points from the matching free product
|
||||||
|
|
@ -3129,17 +3131,17 @@ const BSBillingEditQuantity = (props) => {
|
||||||
changeOrderCardDetails(
|
changeOrderCardDetails(
|
||||||
CartOrderDetails?.map((i) =>
|
CartOrderDetails?.map((i) =>
|
||||||
i?.InwardDtlId == updatedProduct?.InwardDtlId &&
|
i?.InwardDtlId == updatedProduct?.InwardDtlId &&
|
||||||
i?.BookingTypeName == updatedProduct?.BookingTypeName &&
|
i?.BookingTypeName == updatedProduct?.BookingTypeName &&
|
||||||
i?.localId === updatedProduct?.localId
|
i?.localId === updatedProduct?.localId
|
||||||
? {
|
? {
|
||||||
...updatedProduct,
|
...updatedProduct,
|
||||||
Offer: 0,
|
Offer: 0,
|
||||||
OfferType:
|
OfferType:
|
||||||
updatedProduct?.Type === 'C'
|
updatedProduct?.Type === 'C'
|
||||||
? updatedProduct?.OfferType
|
? updatedProduct?.OfferType
|
||||||
: null,
|
: null,
|
||||||
OfferMessage: null,
|
OfferMessage: null,
|
||||||
}
|
}
|
||||||
: i
|
: i
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -3156,7 +3158,9 @@ const BSBillingEditQuantity = (props) => {
|
||||||
|
|
||||||
const UpdatedCartItemWithOffer = {
|
const UpdatedCartItemWithOffer = {
|
||||||
...updatedProduct,
|
...updatedProduct,
|
||||||
Offer: updatedProduct.Offer || bestOffer?.OfferAmount,
|
Offer: (bestOffer?.OfferMode === 'I' || bestOffer?.OfferMode === 'Q') ?
|
||||||
|
bestOffer?.OfferAmount || updatedProduct.Offer :
|
||||||
|
updatedProduct.Offer || bestOffer?.OfferAmount,
|
||||||
OfferType: updatedProduct?.OfferType || bestOffer?.OfferType,
|
OfferType: updatedProduct?.OfferType || bestOffer?.OfferType,
|
||||||
OfferMessage: updatedProduct?.OfferMessage || bestOffer?.OfferMessage,
|
OfferMessage: updatedProduct?.OfferMessage || bestOffer?.OfferMessage,
|
||||||
};
|
};
|
||||||
|
|
@ -3169,7 +3173,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
c.OrderRate === updatedProduct.OrderRate &&
|
c.OrderRate === updatedProduct.OrderRate &&
|
||||||
c.BookingTypeName === updatedProduct.BookingTypeName &&
|
c.BookingTypeName === updatedProduct.BookingTypeName &&
|
||||||
!c.SalesId &&
|
!c.SalesId &&
|
||||||
(c?.OfferType !== 'B' && c?.OfferType !== 'P' && c?.OfferType !== 'L'
|
((c?.OfferModeType && c?.OfferMode === 'B'
|
||||||
|
? true
|
||||||
|
: c?.OfferMode !== 'B')
|
||||||
|
&& c?.OfferMode !== 'P'
|
||||||
|
&& c?.OfferMode !== 'C' && c?.OfferMode !== 'O'
|
||||||
|
&& c?.OfferMode !== 'L'
|
||||||
? true
|
? true
|
||||||
: c?.Offer === 0);
|
: c?.Offer === 0);
|
||||||
|
|
||||||
|
|
@ -3819,15 +3828,15 @@ const BSBillingEditQuantity = (props) => {
|
||||||
3
|
3
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid-item" onClick={() => AddQuantity(4)}>
|
<div className="grid-item" onClick={() => AddQuantity(4)}>
|
||||||
4
|
4
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-item" onClick={() => AddQuantity(5)}>
|
<div className="grid-item" onClick={() => AddQuantity(5)}>
|
||||||
5
|
5
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-item" onClick={() => AddQuantity(6)}>
|
<div className="grid-item" onClick={() => AddQuantity(6)}>
|
||||||
6
|
6
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid-item" onClick={() => AddQuantity(7)}>
|
<div className="grid-item" onClick={() => AddQuantity(7)}>
|
||||||
7
|
7
|
||||||
|
|
@ -3853,23 +3862,23 @@ const BSBillingEditQuantity = (props) => {
|
||||||
per item{' '}
|
per item{' '}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
{!RadioDetails && (
|
{!RadioDetails && (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="SellPrice"
|
name="SellPrice"
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
pattern: /^(0\d+|[1-9]\d*)(\.\d+)?$/,
|
pattern: /^(0\d+|[1-9]\d*)(\.\d+)?$/,
|
||||||
message: 'Please Enter Number Only',
|
message: 'Please Enter Number Only',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
validator: async (_, value) => {
|
validator: async (_, value) => {
|
||||||
await validateSafeInput(value);
|
await validateSafeInput(value);
|
||||||
|
|
||||||
if (value && value.length > 10) {
|
if (value && value.length > 10) {
|
||||||
return Promise.reject(
|
return Promise.reject(
|
||||||
'Selling Price should not exceed 10 characters'
|
'Selling Price should not exceed 10 characters'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
},
|
},
|
||||||
|
|
@ -3894,7 +3903,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
? `${parts[0]}.${parts.slice(1).join('')}`
|
? `${parts[0]}.${parts.slice(1).join('')}`
|
||||||
: cleanedValue;
|
: cleanedValue;
|
||||||
}}
|
}}
|
||||||
// isOnChange={formType == "edit" || formRef.current?.getFieldsValue()?.CustName ? true : false}
|
// isOnChange={formType == "edit" || formRef.current?.getFieldsValue()?.CustName ? true : false}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3957,7 +3966,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
? `${parts[0]}.${parts.slice(1).join('')}`
|
? `${parts[0]}.${parts.slice(1).join('')}`
|
||||||
: cleanedValue;
|
: cleanedValue;
|
||||||
}}
|
}}
|
||||||
// isOnChange={formType == "edit" || formRef.current?.getFieldsValue()?.CustName ? true : false}
|
// isOnChange={formType == "edit" || formRef.current?.getFieldsValue()?.CustName ? true : false}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{/* <input type="text"
|
{/* <input type="text"
|
||||||
|
|
@ -3993,14 +4002,14 @@ const BSBillingEditQuantity = (props) => {
|
||||||
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
||||||
{((RadioBtnSelection == 'Price' && disableSubmitButton) ||
|
{((RadioBtnSelection == 'Price' && disableSubmitButton) ||
|
||||||
RadioBtnSelection == 'Quantity') && (
|
RadioBtnSelection == 'Quantity') && (
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText="Submit"
|
buttonText="Submit"
|
||||||
color="901D77"
|
color="901D77"
|
||||||
htmlType
|
htmlType
|
||||||
// handleSubmit={AddProductQuantity}
|
// handleSubmit={AddProductQuantity}
|
||||||
icon={<ArrowRightOutlined />}
|
icon={<ArrowRightOutlined />}
|
||||||
></Buttons>
|
></Buttons>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -137,13 +137,13 @@ const ComboSalesBillTable = () => {
|
||||||
OrderType === 'Hold'
|
OrderType === 'Hold'
|
||||||
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
||||||
: tableData?.filter(
|
: tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
||||||
);
|
);
|
||||||
const OldtableDataTakeAway =
|
const OldtableDataTakeAway =
|
||||||
OrderType != 'Hold'
|
OrderType != 'Hold'
|
||||||
? tableData?.filter(
|
? tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
||||||
)
|
)
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const [EditQuantity, setEditQuantity] = useState(false);
|
const [EditQuantity, setEditQuantity] = useState(false);
|
||||||
|
|
@ -1024,9 +1024,9 @@ const ComboSalesBillTable = () => {
|
||||||
)?.map((item, idx) =>
|
)?.map((item, idx) =>
|
||||||
idx === 0
|
idx === 0
|
||||||
? {
|
? {
|
||||||
...item,
|
...item,
|
||||||
FreeQty,
|
FreeQty,
|
||||||
}
|
}
|
||||||
: item
|
: item
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
@ -2082,8 +2082,8 @@ const ComboSalesBillTable = () => {
|
||||||
{/* Delete */}
|
{/* Delete */}
|
||||||
{item.OptionName === 'Delete' && (
|
{item.OptionName === 'Delete' && (
|
||||||
<th className="deleteTh"
|
<th className="deleteTh"
|
||||||
style={{ textAlign: 'center', width: '80px' }}
|
style={{ textAlign: 'center', width: '80px' }}
|
||||||
key={item.OptionId}>
|
key={item.OptionId}>
|
||||||
{tableData?.length > 0 ? (
|
{tableData?.length > 0 ? (
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title="Delete the items"
|
title="Delete the items"
|
||||||
|
|
@ -2091,18 +2091,18 @@ const ComboSalesBillTable = () => {
|
||||||
okText="Yes"
|
okText="Yes"
|
||||||
cancelText="No"
|
cancelText="No"
|
||||||
placement="leftTop"
|
placement="leftTop"
|
||||||
onConfirm={() => {
|
onConfirm={() => {
|
||||||
Clearall();
|
Clearall();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="del-all-btn">
|
<div className="del-all-btn">
|
||||||
{!isMobile ? (
|
{!isMobile ? (
|
||||||
<Tooltip title="Delete All" placement="left">
|
<Tooltip title="Delete All" placement="left">
|
||||||
<AiFillDelete color="#ef4444" size={18} />
|
<AiFillDelete color="#ef4444" size={18} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
<AiFillDelete color="#ef4444" size={18} />
|
<AiFillDelete color="#ef4444" size={18} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -2146,20 +2146,20 @@ const ComboSalesBillTable = () => {
|
||||||
tableDataDinein?.length >= PreviousdataLength
|
tableDataDinein?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length + index === 0 &&
|
OldtableDataTakeAway?.length + index === 0 &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
background: row?.SalesId
|
background: row?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
row?.InwardDtlId + ' ' + row?.BookingTypeName
|
row?.InwardDtlId + ' ' + row?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
||||||
? 'white'
|
? 'white'
|
||||||
|
|
@ -2194,39 +2194,39 @@ const ComboSalesBillTable = () => {
|
||||||
{/* Product Name / Item */}
|
{/* Product Name / Item */}
|
||||||
{(item.OptionName === 'Item' ||
|
{(item.OptionName === 'Item' ||
|
||||||
item.OptionName === 'Product Name') && (
|
item.OptionName === 'Product Name') && (
|
||||||
<td
|
<td
|
||||||
key={`prod-${index}`}
|
key={`prod-${index}`}
|
||||||
className="productNameTd"
|
className="productNameTd"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
row.FullProductIdentifierDtls?.length > 0 ||
|
row.FullProductIdentifierDtls?.length > 0 ||
|
||||||
row.ProductIdentifierDtls?.length > 0
|
row.ProductIdentifierDtls?.length > 0
|
||||||
? handleImeiDetails(row)
|
? handleImeiDetails(row)
|
||||||
: editField && handleEditQuantity(row)
|
: editField && handleEditQuantity(row)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{row?.Type !== 'OS' ? row.ProdName : row.ServiceName}
|
{row?.Type !== 'OS' ? row.ProdName : row.ServiceName}
|
||||||
{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(
|
{!row?.ProdVariantName?.toLowerCase()?.includes(
|
||||||
'variant'
|
'variant'
|
||||||
) && <span>{row?.ProdVariantName} </span>}
|
) && <span>{row?.ProdVariantName} </span>}
|
||||||
{row?.Size}
|
{row?.Size}
|
||||||
{row?.SinglePc == 'Y' ? 'PCS' : row?.UomName}
|
{row?.SinglePc == 'Y' ? 'PCS' : row?.UomName}
|
||||||
|
|
||||||
)
|
)
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
{row?.Type === 'C' &&
|
|
||||||
row.ProdDetail?.map((prod, idx) => (
|
|
||||||
<p key={idx}>
|
|
||||||
{prod.ProdName} - {prod.Size} {prod.UomName}
|
|
||||||
</p>
|
</p>
|
||||||
))}
|
)}
|
||||||
</td>
|
{row?.Type === 'C' &&
|
||||||
)}
|
row.ProdDetail?.map((prod, idx) => (
|
||||||
|
<p key={idx}>
|
||||||
|
{prod.ProdName} - {prod.Size} {prod.UomName}
|
||||||
|
</p>
|
||||||
|
))}
|
||||||
|
</td>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Barcode */}
|
{/* Barcode */}
|
||||||
{item.OptionName === 'Barcode' && (
|
{item.OptionName === 'Barcode' && (
|
||||||
|
|
@ -2270,9 +2270,12 @@ const ComboSalesBillTable = () => {
|
||||||
className="discPerTd"
|
className="discPerTd"
|
||||||
onClick={() => editField && handleEditQuantity(row)}
|
onClick={() => editField && handleEditQuantity(row)}
|
||||||
>
|
>
|
||||||
{row?.OfferType === 'F'
|
{row?.Offer > 0
|
||||||
? `₹${row.Offer}`
|
? `${(
|
||||||
: `${row.Offer || '-'}`}
|
(row.Offer / (row?.OrderQty * row?.OrderRate)) *
|
||||||
|
100
|
||||||
|
).toFixed(2)}%`
|
||||||
|
: '-'}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -2283,7 +2286,7 @@ const ComboSalesBillTable = () => {
|
||||||
className="discAmtTd"
|
className="discAmtTd"
|
||||||
onClick={() => editField && handleEditQuantity(row)}
|
onClick={() => editField && handleEditQuantity(row)}
|
||||||
>
|
>
|
||||||
{row.discAmt || '-'}
|
{row.Offer || '-'}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -230,6 +230,8 @@ import CardPopover from '../BSBillingTables/StandardTable/Utils/CardPopover.jsx'
|
||||||
import UpiPopover from '../BSBillingTables/StandardTable/Utils/UpiPopOver.jsx';
|
import UpiPopover from '../BSBillingTables/StandardTable/Utils/UpiPopOver.jsx';
|
||||||
import { useDateStore } from '../../../../Features/BookingScreen/BookingData/DateStore.js';
|
import { useDateStore } from '../../../../Features/BookingScreen/BookingData/DateStore.js';
|
||||||
import { getPaymentOptionsData } from '../../../../Features/BookingScreen/BookingData/KioskBookingData.js';
|
import { getPaymentOptionsData } from '../../../../Features/BookingScreen/BookingData/KioskBookingData.js';
|
||||||
|
import { GlobalFreeProdList, GlobalOfferAppliedProducts, GlobalOverAllOfferAmt } from '../../../../Features/Offer/Offernew/BookingOffernew.js';
|
||||||
|
import BSNavBarTable from '../UtillComponents/BSNavBarTable.jsx';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
||||||
|
|
@ -449,6 +451,7 @@ const BSC1Payment = (props) => {
|
||||||
const [OpenFailData, SetOpenFailData] = useState(false);
|
const [OpenFailData, SetOpenFailData] = useState(false);
|
||||||
const [paymentfeataddon, setpaymentfeataddon] = useState(false);
|
const [paymentfeataddon, setpaymentfeataddon] = useState(false);
|
||||||
const [isFloatMenuOpen, setIsFloatMenuOpen] = useState(false);
|
const [isFloatMenuOpen, setIsFloatMenuOpen] = useState(false);
|
||||||
|
const Discount = useSelector(GlobalOverAllOfferAmt);
|
||||||
const OverAllSales = useSelector(GlobalOverAllDiscSales);
|
const OverAllSales = useSelector(GlobalOverAllDiscSales);
|
||||||
const OverAllEstimate = useSelector(GlobalOverAllDiscEstimate);
|
const OverAllEstimate = useSelector(GlobalOverAllDiscEstimate);
|
||||||
const [blink, setBlink] = useState(false);
|
const [blink, setBlink] = useState(false);
|
||||||
|
|
@ -475,6 +478,8 @@ const BSC1Payment = (props) => {
|
||||||
// for customised invoice number
|
// for customised invoice number
|
||||||
const { invoiceDate, clearInvoiceDate } = useDateStore();
|
const { invoiceDate, clearInvoiceDate } = useDateStore();
|
||||||
const CurrentOrderId = useSelector(GlobalCurrentOrderId);
|
const CurrentOrderId = useSelector(GlobalCurrentOrderId);
|
||||||
|
const FreeProdList = useSelector(GlobalFreeProdList);
|
||||||
|
const offerAppliedProducts = useSelector(GlobalOfferAppliedProducts);
|
||||||
|
|
||||||
console.log(BSComboData, 'BSComboData');
|
console.log(BSComboData, 'BSComboData');
|
||||||
const canHold =
|
const canHold =
|
||||||
|
|
@ -619,7 +624,9 @@ const BSC1Payment = (props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
let withdiscTotal =
|
let withdiscTotal =
|
||||||
Total - ((OverAllSales || 0) + (OverAllEstimate || 0));
|
Total - ((OverAllSales || 0) + (OverAllEstimate || 0) +
|
||||||
|
(Discount > 0 ? Discount : 0));
|
||||||
|
|
||||||
|
|
||||||
setTotalAmount(
|
setTotalAmount(
|
||||||
withdiscTotal >= 0
|
withdiscTotal >= 0
|
||||||
|
|
@ -651,6 +658,7 @@ const BSC1Payment = (props) => {
|
||||||
OverAllEstimate,
|
OverAllEstimate,
|
||||||
globalTipAmount,
|
globalTipAmount,
|
||||||
OtherServiceTicketClaim,
|
OtherServiceTicketClaim,
|
||||||
|
Discount
|
||||||
]);
|
]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let data = {
|
let data = {
|
||||||
|
|
@ -1590,7 +1598,7 @@ const BSC1Payment = (props) => {
|
||||||
|
|
||||||
const selectedStyle =
|
const selectedStyle =
|
||||||
stylesMap[
|
stylesMap[
|
||||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||||
];
|
];
|
||||||
|
|
||||||
if (selectedStyle) {
|
if (selectedStyle) {
|
||||||
|
|
@ -1969,23 +1977,25 @@ const BSC1Payment = (props) => {
|
||||||
OrderStatus: 'O',
|
OrderStatus: 'O',
|
||||||
OrderType:
|
OrderType:
|
||||||
BookingType === 'Dine In' ||
|
BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
Estimation?.SettingValue == 'N'
|
Estimation?.SettingValue == 'N'
|
||||||
? 'S'
|
? 'S'
|
||||||
: GlobEstBooking === 'OvrAllEst'
|
: GlobEstBooking === 'OvrAllEst'
|
||||||
? 'E'
|
? 'E'
|
||||||
: GlobEstBooking === 'ParEst'
|
: GlobEstBooking === 'ParEst'
|
||||||
? GlobProdwisedata?.includes(
|
? GlobProdwisedata?.includes(
|
||||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||||
)
|
)
|
||||||
? 'E'
|
? 'E'
|
||||||
: 'S'
|
: 'S'
|
||||||
: 'S',
|
: 'S',
|
||||||
SinglePc: a.SinglePc,
|
SinglePc: a.SinglePc,
|
||||||
BookingType: a.BookingTypeName === 'Dine In' ? DineinId : TakAwayId,
|
BookingType: a.BookingTypeName === 'Dine In' ? DineinId : TakAwayId,
|
||||||
OfferValue: a?.Type === 'C' ? a?.OfferPrice : a.Offer,
|
OfferValue: a?.Type === 'C' ? a?.OfferValue : a.Offer,
|
||||||
OfferAmt: a?.Type === 'C' ? a?.TotalAmt : a.Offer,
|
OfferAmt: a?.Type === 'C' ? a?.TotalAmt : a.Offer,
|
||||||
OfferType: a?.Type === 'C' ? a?.OfferType : '',
|
OfferType: a?.Type === 'C' ? a?.OfferType : '',
|
||||||
|
OfferMode: a?.OfferMode,
|
||||||
|
OfferMessage: a?.OfferMessage,
|
||||||
CounterName: a?.TokenAvailable === 'Y' ? a?.CounterName : null,
|
CounterName: a?.TokenAvailable === 'Y' ? a?.CounterName : null,
|
||||||
ProductIdentifierDtls: a.ProductIdentifierDtls,
|
ProductIdentifierDtls: a.ProductIdentifierDtls,
|
||||||
ModelNumber: a.ModelNumber,
|
ModelNumber: a.ModelNumber,
|
||||||
|
|
@ -1995,9 +2005,9 @@ const BSC1Payment = (props) => {
|
||||||
const NotSlectedTypeFind = temporderdetail?.find(
|
const NotSlectedTypeFind = temporderdetail?.find(
|
||||||
(a) => a?.BookingType != SelectedBookingType
|
(a) => a?.BookingType != SelectedBookingType
|
||||||
);
|
);
|
||||||
let updatedOfferDetails = OrderOfferDetail;
|
let updatedOfferDetails = offerAppliedProducts;
|
||||||
if (GlobEstBooking !== 'Sales') {
|
if (GlobEstBooking !== 'Sales') {
|
||||||
updatedOfferDetails = OrderOfferDetail?.filter(
|
updatedOfferDetails = offerAppliedProducts?.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
!(
|
!(
|
||||||
item.TableName === 'LoyaltyPoints' &&
|
item.TableName === 'LoyaltyPoints' &&
|
||||||
|
|
@ -2059,7 +2069,7 @@ const BSC1Payment = (props) => {
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
OrderDtlDetails:
|
OrderDtlDetails:
|
||||||
|
|
@ -2076,9 +2086,9 @@ const BSC1Payment = (props) => {
|
||||||
? globalTipAmount === 0
|
? globalTipAmount === 0
|
||||||
? SelectedTableDetails
|
? SelectedTableDetails
|
||||||
: SelectedTableDetails?.map((item) => ({
|
: SelectedTableDetails?.map((item) => ({
|
||||||
...item,
|
...item,
|
||||||
TipsAmount: globalTipAmount,
|
TipsAmount: globalTipAmount,
|
||||||
}))
|
}))
|
||||||
: null,
|
: null,
|
||||||
// "Credit": TotalAmount,
|
// "Credit": TotalAmount,
|
||||||
// "Debit": 0,
|
// "Debit": 0,
|
||||||
|
|
@ -2112,23 +2122,23 @@ const BSC1Payment = (props) => {
|
||||||
ModeOfPayment:
|
ModeOfPayment:
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||||
?.UPIDetailId
|
?.UPIDetailId
|
||||||
: null,
|
: null,
|
||||||
AccountDtl:
|
AccountDtl:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||||
(upipay) => upipay?.UPIId === UpiId
|
(upipay) => upipay?.UPIId === UpiId
|
||||||
)
|
)
|
||||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||||
SelectedCardOption?.toLowerCase() === 'pd')
|
SelectedCardOption?.toLowerCase() === 'pd')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
||||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||||
SelectedCardOption?.toLowerCase() === 'pg')
|
SelectedCardOption?.toLowerCase() === 'pg')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||||
: [],
|
: [],
|
||||||
PaymentStatus:
|
PaymentStatus:
|
||||||
|
|
@ -2137,7 +2147,7 @@ const BSC1Payment = (props) => {
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
Debit: 0,
|
Debit: 0,
|
||||||
|
|
@ -2148,6 +2158,12 @@ const BSC1Payment = (props) => {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
OrderOfferDetail: updatedOfferDetails,
|
OrderOfferDetail: updatedOfferDetails,
|
||||||
|
RefDetails: [
|
||||||
|
{
|
||||||
|
FreeProdList: FreeProdList,
|
||||||
|
OfferAppliedProductList: offerAppliedProducts,
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
let PostData = temppostdata;
|
let PostData = temppostdata;
|
||||||
|
|
||||||
|
|
@ -2196,14 +2212,14 @@ const BSC1Payment = (props) => {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(
|
setMessageData(
|
||||||
response?.data?.response +
|
response?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(response?.data?.OrderDetails?.length > 0
|
(response?.data?.OrderDetails?.length > 0
|
||||||
? response?.data?.OrderId &&
|
? response?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
response?.data?.OrderId,
|
response?.data?.OrderId,
|
||||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
response?.data?.OrderDetails?.length > 0 &&
|
response?.data?.OrderDetails?.length > 0 &&
|
||||||
setPrintOrderDetails([response?.data]);
|
setPrintOrderDetails([response?.data]);
|
||||||
|
|
@ -2347,14 +2363,14 @@ const BSC1Payment = (props) => {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(
|
setMessageData(
|
||||||
response?.data?.response +
|
response?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(response?.data?.OrderDetails?.length > 0
|
(response?.data?.OrderDetails?.length > 0
|
||||||
? response?.data?.OrderId &&
|
? response?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
response?.data?.OrderId,
|
response?.data?.OrderId,
|
||||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
response?.data?.OrderDetails?.length > 0 &&
|
response?.data?.OrderDetails?.length > 0 &&
|
||||||
setPrintOrderDetails([response?.data]);
|
setPrintOrderDetails([response?.data]);
|
||||||
|
|
@ -2456,14 +2472,14 @@ const BSC1Payment = (props) => {
|
||||||
}
|
}
|
||||||
setMessageData(
|
setMessageData(
|
||||||
response?.data?.response +
|
response?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(response?.data?.OrderDetails?.length > 0
|
(response?.data?.OrderDetails?.length > 0
|
||||||
? response?.data?.OrderId &&
|
? response?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
response?.data?.OrderId,
|
response?.data?.OrderId,
|
||||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
if (response?.data?.OrderDetails?.length > 0) {
|
if (response?.data?.OrderDetails?.length > 0) {
|
||||||
setPrintOrderDetails([response?.data]);
|
setPrintOrderDetails([response?.data]);
|
||||||
|
|
@ -2560,14 +2576,14 @@ const BSC1Payment = (props) => {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(
|
setMessageData(
|
||||||
bookingpaymentupdate?.data?.response +
|
bookingpaymentupdate?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||||
? bookingpaymentupdate?.data?.OrderId &&
|
? bookingpaymentupdate?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
bookingpaymentupdate?.data?.OrderId,
|
bookingpaymentupdate?.data?.OrderId,
|
||||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
||||||
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
||||||
|
|
@ -2585,7 +2601,7 @@ const BSC1Payment = (props) => {
|
||||||
if (
|
if (
|
||||||
Date.now() - startTime >
|
Date.now() - startTime >
|
||||||
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
||||||
60000
|
60000
|
||||||
) {
|
) {
|
||||||
// 60,000 ms = 1 minute
|
// 60,000 ms = 1 minute
|
||||||
|
|
||||||
|
|
@ -3599,16 +3615,16 @@ const BSC1Payment = (props) => {
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 'none'
|
? 'none'
|
||||||
: 'auto',
|
: 'auto',
|
||||||
opacity:
|
opacity:
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 0.5
|
? 0.5
|
||||||
: 1,
|
: 1,
|
||||||
}}
|
}}
|
||||||
|
|
@ -3619,10 +3635,10 @@ const BSC1Payment = (props) => {
|
||||||
<button
|
<button
|
||||||
className={
|
className={
|
||||||
paybtnselected === payment.ModeId &&
|
paybtnselected === payment.ModeId &&
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
(UpinotSelected || CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode-notupisel'
|
? 'Btn-payment-mode-notupisel'
|
||||||
: paybtnselected === payment.ModeId &&
|
: paybtnselected === payment.ModeId &&
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
(!UpinotSelected || !CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode'
|
? 'Btn-payment-mode'
|
||||||
: 'Btn-payment-mode-sel'
|
: 'Btn-payment-mode-sel'
|
||||||
}
|
}
|
||||||
|
|
@ -3700,16 +3716,16 @@ const BSC1Payment = (props) => {
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 'none'
|
? 'none'
|
||||||
: 'auto',
|
: 'auto',
|
||||||
opacity:
|
opacity:
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 0.5
|
? 0.5
|
||||||
: 1,
|
: 1,
|
||||||
}}
|
}}
|
||||||
|
|
@ -3729,14 +3745,14 @@ const BSC1Payment = (props) => {
|
||||||
style={{
|
style={{
|
||||||
cursor:
|
cursor:
|
||||||
OrderCardDetail?.length === 0 ||
|
OrderCardDetail?.length === 0 ||
|
||||||
CheckBookingStatus == 'Close' ||
|
CheckBookingStatus == 'Close' ||
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'not-allowed'
|
? 'not-allowed'
|
||||||
: 'pointer',
|
: 'pointer',
|
||||||
color:
|
color:
|
||||||
OrderCardDetail?.length === 0 ||
|
OrderCardDetail?.length === 0 ||
|
||||||
CheckBookingStatus == 'Close' ||
|
CheckBookingStatus == 'Close' ||
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? '#fff'
|
? '#fff'
|
||||||
: '#ffffffff',
|
: '#ffffffff',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
|
@ -3832,19 +3848,61 @@ const BSC1Payment = (props) => {
|
||||||
{/* {item?.OptionName=="Hold" && */}
|
{/* {item?.OptionName=="Hold" && */}
|
||||||
{unpaidFlow == false
|
{unpaidFlow == false
|
||||||
? item?.OptionName == 'Hold' &&
|
? item?.OptionName == 'Hold' &&
|
||||||
BookingType !== 'Dine In' &&
|
BookingType !== 'Dine In' &&
|
||||||
!BookingTypeBoth &&
|
!BookingTypeBoth &&
|
||||||
OrderCardDetail?.length != 0 &&
|
OrderCardDetail?.length != 0 &&
|
||||||
CheckOrderType?.length === 0 &&
|
CheckOrderType?.length === 0 &&
|
||||||
OrderType != 'Failed' &&
|
OrderType != 'Failed' &&
|
||||||
CheckBookingStatus != 'Close' &&
|
CheckBookingStatus != 'Close' &&
|
||||||
!addnewAccess && (
|
!addnewAccess && (
|
||||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||||
{' '}
|
{' '}
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
backgroundColor: '' ? '#52c41a' : '#1292EE',
|
||||||
|
color: '' ? '#52c41a' : '#ffffffff',
|
||||||
|
height: '40px',
|
||||||
|
width: '45px',
|
||||||
|
borderRadius: '6px',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
padding: '8px 8px 12px 8px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PozoHoldIcon
|
||||||
|
className="BSBillingNav-icon-table-icon"
|
||||||
|
onClick={() => AddBookingDetails('Hold')}
|
||||||
|
style={{
|
||||||
|
cursor: 'pointer',
|
||||||
|
// color: '' ? '#52c41a' : '#1292EE',
|
||||||
|
}}
|
||||||
|
/>{' '}
|
||||||
|
{/* <p className="payOptionDecition"> Hold</p> */}
|
||||||
|
</div>
|
||||||
|
</TooltipWrapper>
|
||||||
|
)
|
||||||
|
: ''}
|
||||||
|
|
||||||
|
{unpaidFlow == false
|
||||||
|
? item?.OptionName == 'Hold' &&
|
||||||
|
BookingType !== 'Dine In' &&
|
||||||
|
!BookingTypeBoth &&
|
||||||
|
Holddata?.length > 0 &&
|
||||||
|
OrderCardDetail?.length == 0 &&
|
||||||
|
CheckBookingStatus != 'Close' &&
|
||||||
|
!addnewAccess && (
|
||||||
|
<TooltipWrapper title={'Recall'} isMobile={isMobile}>
|
||||||
|
{' '}
|
||||||
|
<Badge
|
||||||
|
count={Holddata?.length}
|
||||||
|
size={'small'}
|
||||||
|
offset={[0, 7]}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: '' ? '#52c41a' : '#1292EE',
|
backgroundColor: Holddata ? '#52c41a' : 'default',
|
||||||
color: '' ? '#52c41a' : '#ffffffff',
|
color: Holddata ? '#ffffffff' : 'default',
|
||||||
height: '40px',
|
height: '40px',
|
||||||
width: '45px',
|
width: '45px',
|
||||||
borderRadius: '6px',
|
borderRadius: '6px',
|
||||||
|
|
@ -3856,60 +3914,18 @@ const BSC1Payment = (props) => {
|
||||||
>
|
>
|
||||||
<PozoHoldIcon
|
<PozoHoldIcon
|
||||||
className="BSBillingNav-icon-table-icon"
|
className="BSBillingNav-icon-table-icon"
|
||||||
onClick={() => AddBookingDetails('Hold')}
|
onClick={() => HandleholdModelOpen()}
|
||||||
style={{
|
style={{
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
// color: '' ? '#52c41a' : '#1292EE',
|
// color: Holddata ? '#52c41a' : 'default',
|
||||||
|
pointerEvents:
|
||||||
|
OrderType === 'Failed' ? 'none' : 'auto',
|
||||||
}}
|
}}
|
||||||
/>{' '}
|
/>
|
||||||
{/* <p className="payOptionDecition"> Hold</p> */}
|
|
||||||
</div>
|
</div>
|
||||||
</TooltipWrapper>
|
</Badge>
|
||||||
)
|
</TooltipWrapper>
|
||||||
: ''}
|
)
|
||||||
|
|
||||||
{unpaidFlow == false
|
|
||||||
? item?.OptionName == 'Hold' &&
|
|
||||||
BookingType !== 'Dine In' &&
|
|
||||||
!BookingTypeBoth &&
|
|
||||||
Holddata?.length > 0 &&
|
|
||||||
OrderCardDetail?.length == 0 &&
|
|
||||||
CheckBookingStatus != 'Close' &&
|
|
||||||
!addnewAccess && (
|
|
||||||
<TooltipWrapper title={'Recall'} isMobile={isMobile}>
|
|
||||||
{' '}
|
|
||||||
<Badge
|
|
||||||
count={Holddata?.length}
|
|
||||||
size={'small'}
|
|
||||||
offset={[0, 7]}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
backgroundColor: Holddata ? '#52c41a' : 'default',
|
|
||||||
color: Holddata ? '#ffffffff' : 'default',
|
|
||||||
height: '40px',
|
|
||||||
width: '45px',
|
|
||||||
borderRadius: '6px',
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
padding: '8px 8px 12px 8px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<PozoHoldIcon
|
|
||||||
className="BSBillingNav-icon-table-icon"
|
|
||||||
onClick={() => HandleholdModelOpen()}
|
|
||||||
style={{
|
|
||||||
cursor: 'pointer',
|
|
||||||
// color: Holddata ? '#52c41a' : 'default',
|
|
||||||
pointerEvents:
|
|
||||||
OrderType === 'Failed' ? 'none' : 'auto',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</Badge>
|
|
||||||
</TooltipWrapper>
|
|
||||||
)
|
|
||||||
: ''}
|
: ''}
|
||||||
{tabledata?.length > 0 && dinePreference && (
|
{tabledata?.length > 0 && dinePreference && (
|
||||||
<>
|
<>
|
||||||
|
|
@ -3978,9 +3994,9 @@ const BSC1Payment = (props) => {
|
||||||
style={{
|
style={{
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
OrderCardDetail?.length > 0 ||
|
OrderCardDetail?.length > 0 ||
|
||||||
(selOption?.value === undefined &&
|
(selOption?.value === undefined &&
|
||||||
GlobalAddCustomerDetails1?.length === 0 &&
|
GlobalAddCustomerDetails1?.length === 0 &&
|
||||||
GetCustId?.CustMobile === undefined)
|
GetCustId?.CustMobile === undefined)
|
||||||
? 'gray'
|
? 'gray'
|
||||||
: '#1292eeff',
|
: '#1292eeff',
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
|
|
@ -4023,36 +4039,36 @@ const BSC1Payment = (props) => {
|
||||||
{FeatureAddonData?.FeatureDtls?.find(
|
{FeatureAddonData?.FeatureDtls?.find(
|
||||||
(item) => item?.FeatureAddonName?.toLowerCase() === 'preorder'
|
(item) => item?.FeatureAddonName?.toLowerCase() === 'preorder'
|
||||||
) && (
|
) && (
|
||||||
<>
|
<>
|
||||||
{
|
{
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
pointerEvents:
|
pointerEvents:
|
||||||
OrderCardDetail?.length > 0 || OrderType === 'Failed'
|
OrderCardDetail?.length > 0 || OrderType === 'Failed'
|
||||||
? 'none'
|
? 'none'
|
||||||
: 'auto',
|
: 'auto',
|
||||||
opacity: OrderCardDetail?.length > 0 ? 0.5 : 1,
|
opacity: OrderCardDetail?.length > 0 ? 0.5 : 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<TooltipWrapper title={'Pre Order'} isMobile={isMobile}>
|
<TooltipWrapper title={'Pre Order'} isMobile={isMobile}>
|
||||||
<Badge
|
<Badge
|
||||||
count={preOrderPendingCount}
|
count={preOrderPendingCount}
|
||||||
offset={[-5, 10]}
|
offset={[-5, 10]}
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<PozoPreOrderIcon
|
<PozoPreOrderIcon
|
||||||
className="BSBillingNav-icon"
|
className="BSBillingNav-icon"
|
||||||
fill={preOrderOpen ? '#52C41A' : '#1292EE'}
|
fill={preOrderOpen ? '#52C41A' : '#1292EE'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
openPreOrder();
|
openPreOrder();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Badge>
|
</Badge>
|
||||||
</TooltipWrapper>
|
</TooltipWrapper>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{preOrderOpen && <BSNavBarPreOrder />}
|
{preOrderOpen && <BSNavBarPreOrder />}
|
||||||
{sportsAppPreference && <BSMembership />}
|
{sportsAppPreference && <BSMembership />}
|
||||||
{dinePreference &&
|
{dinePreference &&
|
||||||
|
|
@ -4210,9 +4226,9 @@ const BSC1Payment = (props) => {
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'BSC1Payment-div4-button-disable'
|
? 'BSC1Payment-div4-button-disable'
|
||||||
: FirstPaymentclick === false &&
|
: FirstPaymentclick === false &&
|
||||||
OrderCardDetail?.length > 0 &&
|
OrderCardDetail?.length > 0 &&
|
||||||
paybtnselected &&
|
paybtnselected &&
|
||||||
CheckBookingStatus != 'Close'
|
CheckBookingStatus != 'Close'
|
||||||
? !OrderStatus
|
? !OrderStatus
|
||||||
? 'BSC1Payment-div4-button'
|
? 'BSC1Payment-div4-button'
|
||||||
: 'BSC1Payment-div4-button Order'
|
: 'BSC1Payment-div4-button Order'
|
||||||
|
|
@ -4441,8 +4457,8 @@ const BSC1Payment = (props) => {
|
||||||
columns={columns}
|
columns={columns}
|
||||||
data={TableData}
|
data={TableData}
|
||||||
dataSource={TableData}
|
dataSource={TableData}
|
||||||
// pagination={handlePageChange}
|
// pagination={handlePageChange}
|
||||||
// onChange={handleChange}
|
// onChange={handleChange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -68,12 +68,12 @@ export const useSaleswiseOfferWatcher = () => {
|
||||||
const BOOKING_TYPE = "DineIn";
|
const BOOKING_TYPE = "DineIn";
|
||||||
|
|
||||||
// Helper function to create offer payload
|
// Helper function to create offer payload
|
||||||
const createOfferPayload = (offer) => ({
|
const createOfferPayload = (offer, discount = null) => ({
|
||||||
OfferId: offer.OfferId || "",
|
OfferId: offer.OfferId || "",
|
||||||
OfferAmount: offer.OfferAmt || 0,
|
OfferAmount: discount || offer.OfferAmt || 0,
|
||||||
OfferMode: offer.OfferType,
|
OfferMode: offer.OfferType,
|
||||||
AcuvalOfferAmount: offer.OfferAmt,
|
AcuvalOfferAmount: discount || offer.OfferAmt,
|
||||||
OfferValue: offer.OfferAmt || 0,
|
OfferValue: discount || offer.OfferAmt || 0,
|
||||||
TableName: offer.TableName || "",
|
TableName: offer.TableName || "",
|
||||||
TableUniqueName: offer.TableUniqueName || "",
|
TableUniqueName: offer.TableUniqueName || "",
|
||||||
TableUniqueId: offer.TableUniqueId || "",
|
TableUniqueId: offer.TableUniqueId || "",
|
||||||
|
|
@ -117,7 +117,7 @@ export const useSaleswiseOfferWatcher = () => {
|
||||||
console.log("💡 NetAmount:", netAmount);
|
console.log("💡 NetAmount:", netAmount);
|
||||||
console.log("👉 Applying best offer:", bestOffer.offer);
|
console.log("👉 Applying best offer:", bestOffer.offer);
|
||||||
|
|
||||||
dispatch(ChangeOfferAppliedProducts(createOfferPayload(bestOffer.offer)));
|
dispatch(ChangeOfferAppliedProducts(createOfferPayload(bestOffer.offer, bestOffer?.discount)));
|
||||||
} else {
|
} else {
|
||||||
// Remove any existing sales offers
|
// Remove any existing sales offers
|
||||||
dispatch(RemoveOfferAppliedProduct({
|
dispatch(RemoveOfferAppliedProduct({
|
||||||
|
|
|
||||||
|
|
@ -108,9 +108,12 @@ const BSCustomerSelect = ({ TopName = null }) => {
|
||||||
offerOption
|
offerOption
|
||||||
} = useMemo(() => {
|
} = useMemo(() => {
|
||||||
const navbarOptions = layoutData?.BookingNavbar?.[1];
|
const navbarOptions = layoutData?.BookingNavbar?.[1];
|
||||||
|
const comboOptions = layoutData?.BookingCombo1?.[1];
|
||||||
return {
|
return {
|
||||||
offerOption: navbarOptions?.find(
|
offerOption: navbarOptions?.find(
|
||||||
(option) => option?.OptionName?.toLowerCase() === 'offer'
|
(option) => option?.OptionName?.toLowerCase() === 'offer'
|
||||||
|
) || comboOptions?.find(
|
||||||
|
(option) => option?.OptionName?.toLowerCase() === 'offer'
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
}, [layoutData]);
|
}, [layoutData]);
|
||||||
|
|
@ -121,7 +124,7 @@ const BSCustomerSelect = ({ TopName = null }) => {
|
||||||
}, [OrderOfferDetails]);
|
}, [OrderOfferDetails]);
|
||||||
|
|
||||||
const loyaltyFreeProductsInCart = useMemo(() => {
|
const loyaltyFreeProductsInCart = useMemo(() => {
|
||||||
return OrderOfferDetails?.filter((offer) => offer?.FreeProductsList?.OfferMode === 'L' && offer?.FreeProductsList?.TableUniqueName === "FreeProduct") || [];
|
return OrderOfferDetails?.filter((offer) => (offer?.FreeProductsList?.OfferMode === 'L' || offer?.OfferMode === 'L') && (offer?.FreeProductsList?.TableUniqueName === "FreeProduct" || offer?.TableUniqueName === "FreeProduct")) || [];
|
||||||
}, [OrderOfferDetails]);
|
}, [OrderOfferDetails]);
|
||||||
|
|
||||||
const filteredLoyaltyFreeProducts = useMemo(() => {
|
const filteredLoyaltyFreeProducts = useMemo(() => {
|
||||||
|
|
@ -573,6 +576,23 @@ const BSCustomerSelect = ({ TopName = null }) => {
|
||||||
const updatedOrderOfferDetails = OrderOfferDetails?.filter(
|
const updatedOrderOfferDetails = OrderOfferDetails?.filter(
|
||||||
offer => !(offer?.OfferMode === 'L' && offer?.TableUniqueName === "Cash")
|
offer => !(offer?.OfferMode === 'L' && offer?.TableUniqueName === "Cash")
|
||||||
);
|
);
|
||||||
|
let updatedOrderCardDetails = OrderCardDetail?.map(item => {
|
||||||
|
if (item?.OfferMode === 'L') {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
Offer: null,
|
||||||
|
OfferMessage: undefined,
|
||||||
|
OfferMode: undefined,
|
||||||
|
OfferModeType: false,
|
||||||
|
OfferType: undefined,
|
||||||
|
OfferValue: null,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return item
|
||||||
|
}
|
||||||
|
}) || [];
|
||||||
|
dispatch(changeOrderCardDetails(updatedOrderCardDetails));
|
||||||
|
|
||||||
dispatch(changeFullOfferAppliedProducts(updatedOrderOfferDetails));
|
dispatch(changeFullOfferAppliedProducts(updatedOrderOfferDetails));
|
||||||
setLoyaltyModal(false);
|
setLoyaltyModal(false);
|
||||||
};
|
};
|
||||||
|
|
@ -699,7 +719,19 @@ const BSCustomerSelect = ({ TopName = null }) => {
|
||||||
dispatch(changeOrderCardDetails(updatedOrderCardDetails));
|
dispatch(changeOrderCardDetails(updatedOrderCardDetails));
|
||||||
setClearPopoverVisible(false);
|
setClearPopoverVisible(false);
|
||||||
dispatch(ChangeFullFreeProductList(freeProductList.filter(item => item.OfferMode !== 'L')));
|
dispatch(ChangeFullFreeProductList(freeProductList.filter(item => item.OfferMode !== 'L')));
|
||||||
dispatch(changeFullOfferAppliedProducts(OrderOfferDetails?.filter(item => item.OfferMode !== 'L')));
|
dispatch(changeFullOfferAppliedProducts(OrderOfferDetails?.filter(item => {
|
||||||
|
// if OfferMode exists and is 'L' → remove
|
||||||
|
if (item?.OfferMode && item.OfferMode === 'L') return false;
|
||||||
|
|
||||||
|
// if FreeProductsList OfferMode exists and is 'L' → remove
|
||||||
|
if (
|
||||||
|
item?.FreeProductsList?.OfferMode &&
|
||||||
|
item.FreeProductsList.OfferMode === 'L'
|
||||||
|
)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
})));
|
||||||
setSelectedProducts([]);
|
setSelectedProducts([]);
|
||||||
setProductQuantities({});
|
setProductQuantities({});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ import {
|
||||||
changeTipAmount,
|
changeTipAmount,
|
||||||
changeChairLevelServiceDefault,
|
changeChairLevelServiceDefault,
|
||||||
changeDefaultBookingType,
|
changeDefaultBookingType,
|
||||||
|
getCustomerForHold,
|
||||||
} from '../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import { ApplicationPreferences, getBranchDetail } from '../../Features/BrachLogin/BranchLogin';
|
import { ApplicationPreferences, getBranchDetail } from '../../Features/BrachLogin/BranchLogin';
|
||||||
import '../../Styles/Tablebooking/TableBooking.scss';
|
import '../../Styles/Tablebooking/TableBooking.scss';
|
||||||
|
|
@ -130,6 +131,8 @@ import DiningTableCompass from './Compass.jsx';
|
||||||
import Compass from './Compass.jsx';
|
import Compass from './Compass.jsx';
|
||||||
import { DropDowns } from "../../Components/Forms/DropDown.jsx";
|
import { DropDowns } from "../../Components/Forms/DropDown.jsx";
|
||||||
import MergeBill from "./MergeBill/MergeBill.jsx";
|
import MergeBill from "./MergeBill/MergeBill.jsx";
|
||||||
|
import { ChangeFullFreeProductList, changeFullOfferAppliedProducts, changeLoyaltyConsumedQuantities } from "../../Features/Offer/Offernew/BookingOffernew.js";
|
||||||
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
const MainHomeUrl = import.meta.env.ENV_Main_BASE_URL;
|
const MainHomeUrl = import.meta.env.ENV_Main_BASE_URL;
|
||||||
|
|
@ -1038,32 +1041,84 @@ const TableBooking = ({ PaymentStatus }) => {
|
||||||
ExtraChargeDetails,
|
ExtraChargeDetails,
|
||||||
CustSuppId,
|
CustSuppId,
|
||||||
OrderOfferDetails,
|
OrderOfferDetails,
|
||||||
|
RefDetails,
|
||||||
|
OrderId
|
||||||
} = OrderDetails;
|
} = OrderDetails;
|
||||||
|
RefDetails?.[0]?.FreeProdList &&
|
||||||
|
dispatch(ChangeFullFreeProductList(RefDetails?.[0]?.FreeProdList));
|
||||||
|
RefDetails?.[0]?.OfferAppliedProductList &&
|
||||||
|
dispatch(changeFullOfferAppliedProducts(RefDetails?.[0]?.OfferAppliedProductList));
|
||||||
|
|
||||||
|
const loyaltyFreeProductOfferApplied =
|
||||||
|
RefDetails?.[0]?.OfferAppliedProductList?.filter(
|
||||||
|
(off) =>
|
||||||
|
off?.FreeProductsList?.OfferMode === 'L' &&
|
||||||
|
off?.TableUniqueName === 'FreeProduct'
|
||||||
|
);
|
||||||
|
|
||||||
|
const updatedOrderCardDetails = OrderDtlDetails?.map((item) => ({
|
||||||
|
...item,
|
||||||
|
Offer: item?.OfferAmt,
|
||||||
|
localId: uuidv4(),
|
||||||
|
OfferMode: item?.OfferMode ? item?.OfferMode?.trim() : null,
|
||||||
|
}));
|
||||||
|
|
||||||
dispatch(changeOrderType('Reorder'));
|
dispatch(changeOrderType('Reorder'));
|
||||||
dispatch(changeBookingType('Dine In'));
|
dispatch(changeBookingType('Dine In'));
|
||||||
dispatch(changeReorderHoldDetails(OrderDetails));
|
dispatch(changeReorderHoldDetails(OrderDetails));
|
||||||
dispatch(changeReorderProductDetails(OrderDtlDetails));
|
dispatch(changeReorderProductDetails(updatedOrderCardDetails));
|
||||||
dispatch(ChangeTotalAmount(ExtraChargeDetails));
|
dispatch(ChangeTotalAmount(ExtraChargeDetails));
|
||||||
dispatch(changeSelectedTableDetails(OrderDetails?.SalesTableLinkDetails));
|
dispatch(changeSelectedTableDetails(OrderDetails?.SalesTableLinkDetails));
|
||||||
dispatch(changeOrderCardDetails(OrderDtlDetails));
|
dispatch(changeOrderCardDetails(updatedOrderCardDetails));
|
||||||
if (CustSuppId) {
|
if (CustSuppId) {
|
||||||
dispatch(changeSelectedCustId(CustSuppId));
|
dispatch(changeSelectedCustId(CustSuppId));
|
||||||
let res = await dispatch(
|
let res = await dispatch(
|
||||||
getAllCustomer({ CompId: CompId, AppId: AppId, branchId: BranchId })
|
getCustomerForHold({
|
||||||
|
CompId: CompId,
|
||||||
|
AppId: AppId,
|
||||||
|
branchId: BranchId,
|
||||||
|
OrderId: OrderId,
|
||||||
|
})
|
||||||
).unwrap();
|
).unwrap();
|
||||||
if (res?.data?.statusCode === 1) {
|
if (res?.data?.statusCode === 1) {
|
||||||
const { CustId, CustName, CustMobile } = res?.data?.data?.find(
|
const { CustId, CustName, CustMobile, LoyaltyPointsDetail, TotalLoyaltyPoints } = res?.data?.data?.find(
|
||||||
(item) => item.CustId === CustSuppId
|
(item) => item.CustId === CustSuppId
|
||||||
);
|
);
|
||||||
const data = {
|
const data = {
|
||||||
CustId: CustId,
|
CustId: CustId,
|
||||||
CustName: CustName,
|
CustName: CustName,
|
||||||
label: CustName,
|
label: CustName ? CustName : CustMobile,
|
||||||
value: CustMobile,
|
value: CustMobile,
|
||||||
|
LoyaltyPointsDetail: LoyaltyPointsDetail,
|
||||||
|
TotalLoyaltyPoints: TotalLoyaltyPoints
|
||||||
};
|
};
|
||||||
dispatch(changeOrderOfferDetail([...OrderOfferDetails]));
|
dispatch(changeOrderOfferDetail([...OrderOfferDetails]));
|
||||||
dispatch(changeSelectedOption(data));
|
dispatch(changeSelectedOption(data));
|
||||||
dispatch(ChangeSelectedCustDisable(true));
|
dispatch(ChangeSelectedCustDisable(true));
|
||||||
|
if (loyaltyFreeProductOfferApplied?.length > 0) {
|
||||||
|
const loyaltyProdQuantities = {};
|
||||||
|
|
||||||
|
loyaltyFreeProductOfferApplied.forEach((off) => {
|
||||||
|
const freeProdDtls = off?.FreeProductsList;
|
||||||
|
const freeProdOfferId =
|
||||||
|
freeProdDtls?.ProdVariantDetails?.[0]?.StockDetails?.[0]
|
||||||
|
?.ProdOfferId;
|
||||||
|
|
||||||
|
const key = [
|
||||||
|
freeProdDtls?.OfferId,
|
||||||
|
freeProdDtls?.FreeProdId,
|
||||||
|
freeProdDtls?.FreeProdVariantName,
|
||||||
|
freeProdOfferId,
|
||||||
|
].join('|');
|
||||||
|
|
||||||
|
loyaltyProdQuantities[key] = freeProdDtls?.FreeQty || 0;
|
||||||
|
});
|
||||||
|
if (Object.keys(loyaltyProdQuantities).length > 0) {
|
||||||
|
dispatch(changeLoyaltyConsumedQuantities(loyaltyProdQuantities));
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(loyaltyProdQuantities, 'loyaltyProdQuantities');
|
||||||
|
}
|
||||||
} else if (res?.data?.statusCode == 0) {
|
} else if (res?.data?.statusCode == 0) {
|
||||||
const OrderOffer = OrderOfferDetails?.filter(
|
const OrderOffer = OrderOfferDetails?.filter(
|
||||||
(fil) =>
|
(fil) =>
|
||||||
|
|
@ -1072,18 +1127,18 @@ const TableBooking = ({ PaymentStatus }) => {
|
||||||
fil.TableUniqueName === 'UniqueId'
|
fil.TableUniqueName === 'UniqueId'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if (OfferCheckedInSetup && preferenceOffer) {
|
// if (OfferCheckedInSetup && preferenceOffer) {
|
||||||
applyOffer(OrderDtlDetails, OrderOffer);
|
// applyOffer(OrderDtlDetails, OrderOffer);
|
||||||
} else {
|
// } else {
|
||||||
dispatch(changeOrderCardDetails(OrderDtlDetails));
|
dispatch(changeOrderCardDetails(updatedOrderCardDetails));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (OfferCheckedInSetup && preferenceOffer) {
|
// if (OfferCheckedInSetup && preferenceOffer) {
|
||||||
applyOffer(OrderDtlDetails, OrderOfferDetails);
|
// applyOffer(OrderDtlDetails, OrderOfferDetails);
|
||||||
} else {
|
// } else {
|
||||||
dispatch(changeOrderCardDetails(OrderDtlDetails));
|
dispatch(changeOrderCardDetails(updatedOrderCardDetails));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SelectedChair?.length > 0) {
|
if (SelectedChair?.length > 0) {
|
||||||
|
|
@ -1219,12 +1274,12 @@ const TableBooking = ({ PaymentStatus }) => {
|
||||||
|
|
||||||
const UpiPayment = () => {
|
const UpiPayment = () => {
|
||||||
let TotalAmount = ModalType === 'ChairlevelSer'
|
let TotalAmount = ModalType === 'ChairlevelSer'
|
||||||
? matchedChairData?.OrderDetails?.[0]?.NetAmount
|
? matchedChairData?.OrderDetails?.[0]?.NetAmount
|
||||||
: matchedChairData?.OrderDetails?.[0]
|
: matchedChairData?.OrderDetails?.[0]
|
||||||
?.NetAmount
|
?.NetAmount
|
||||||
if (SelectedUpiOption && TotalAmount == 0) {
|
if (SelectedUpiOption && TotalAmount == 0) {
|
||||||
Upimodel('Submit');
|
Upimodel('Submit');
|
||||||
} else if (SelectedUpiOption) {
|
} else if (SelectedUpiOption) {
|
||||||
setUpiOpen(true);
|
setUpiOpen(true);
|
||||||
const customerDisplayWindow = getCustomerDisplayWindow();
|
const customerDisplayWindow = getCustomerDisplayWindow();
|
||||||
if (customerDisplayWindow && !customerDisplayWindow.closed) {
|
if (customerDisplayWindow && !customerDisplayWindow.closed) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue