Merge pull request 'Fix #110 : Open Quick Add modal only when QRCode is selected' (#111) from enhancement/entryandquickadd into main
Reviewed-on: Pozomind/pozo-retail-app#111
This commit is contained in:
commit
4304076c8d
|
|
@ -1609,6 +1609,7 @@ const initialState = {
|
|||
salesBillEdit: false,
|
||||
previousOrderPayment: [],
|
||||
previousOrderOfferDetails: [],
|
||||
getmultipleSearchDatas: []
|
||||
};
|
||||
|
||||
const BookingData = createSlice({
|
||||
|
|
@ -2110,6 +2111,13 @@ const BookingData = createSlice({
|
|||
state.AllCustomers = [];
|
||||
}
|
||||
});
|
||||
builder.addCase(getmultipleSearch.fulfilled, (state, action) => {
|
||||
if (action?.payload?.data?.statusCode === 1) {
|
||||
state.getmultipleSearchDatas = action?.payload?.data?.data[0]?.SearchTermDtl?.map((e) => e?.SearchTerm) || [];
|
||||
} else {
|
||||
state.getmultipleSearchDatas = [];
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -2387,5 +2395,7 @@ export const GlobalPreviousOrderPayment = (state) =>
|
|||
state?.BookingData?.previousOrderPayment;
|
||||
export const GlobalPreviousOrderOfferDetails = (state) =>
|
||||
state?.BookingData?.previousOrderOfferDetails;
|
||||
export const GlobalGetmultipleSearchDatas = (state) =>
|
||||
state?.BookingData?.getmultipleSearchDatas;
|
||||
|
||||
export default BookingData.reducer;
|
||||
|
|
|
|||
|
|
@ -59,6 +59,8 @@ import {
|
|||
changeCardData,
|
||||
GlobaldraggingComponent,
|
||||
GlobalCombocarddata,
|
||||
GlobalGetmultipleSearchDatas,
|
||||
getmultipleSearch,
|
||||
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||
import {
|
||||
GlobalPreOrderAdditem,
|
||||
|
|
@ -223,6 +225,7 @@ const BSComboItemCard = (props) => {
|
|||
SelectedGlobalCardColorDetail,
|
||||
shallowEqual
|
||||
);
|
||||
const GetmultipleSearchDatas = useSelector(GlobalGetmultipleSearchDatas, shallowEqual)
|
||||
const SelectedCardFont = useSelector(SelectedGlobalCardFont, shallowEqual);
|
||||
const CartOrderDetails = useSelector(GlobalOrderCardDetails, shallowEqual);
|
||||
const SelectedDatas = useSelector(GlobalSelectedDatas, shallowEqual);
|
||||
|
|
@ -244,7 +247,7 @@ const BSComboItemCard = (props) => {
|
|||
const paymentloader = useSelector(GlobalPayementloader, shallowEqual);
|
||||
const SessionData = useSelector(StoredSessionData, shallowEqual);
|
||||
const GlobalCombocarddatas = useSelector(GlobalCombocarddata);
|
||||
console.log(GlobalCombocarddatas, 'GlobalCombocarddatas combo card');
|
||||
console.log(GlobalCombocarddatas, 'GlobalCombocarddatas combo card');
|
||||
const [messageType, setMessageType] = useState(null);
|
||||
const [messageData, setMessageData] = useState(null);
|
||||
const [repeatedModel, setRepeatedModel] = useState(false);
|
||||
|
|
@ -297,7 +300,7 @@ console.log(GlobalCombocarddatas, 'GlobalCombocarddatas combo card');
|
|||
: GlobalCombocarddatas
|
||||
: '';
|
||||
//
|
||||
console.log(cardData, 'cardData combo card');
|
||||
console.log(cardData, 'cardData combo card');
|
||||
useEffect(() => {
|
||||
// fetchedit();
|
||||
getPreferenceStock();
|
||||
|
|
@ -307,10 +310,25 @@ console.log(cardData, 'cardData combo card');
|
|||
useEffect(() => {
|
||||
if (AppId && CompId && BranchId) {
|
||||
fetchedit();
|
||||
GetmultipleSearchData()
|
||||
}
|
||||
|
||||
// dispatch(changepreOrder(false)); Commented to Add Normal Produts After Adding the Combo Pack !!!!!! Dont Touch Without Shifayath Permission
|
||||
}, [AppId, CompId, BranchId]);
|
||||
const GetmultipleSearchData = async () => {
|
||||
const data = {
|
||||
AppId,
|
||||
CompId,
|
||||
BranchId,
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await dispatch(getmultipleSearch(data))
|
||||
|
||||
} catch (error) {
|
||||
console.error("Get Search Terms Error:", error);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setPreOrderSelectedProdNames([]);
|
||||
|
|
@ -328,10 +346,13 @@ console.log(cardData, 'cardData combo card');
|
|||
if (noSubcatCardData) {
|
||||
setNoSubcatCardData();
|
||||
}
|
||||
if (ProductSearch?.length > 5) {
|
||||
|
||||
if (ProductSearch?.length > 5 && GetmultipleSearchDatas.some(
|
||||
e => e.toLowerCase() === "qrcode"
|
||||
)) {
|
||||
setQuickAdd(true);
|
||||
}
|
||||
}, [ProductSearch]);
|
||||
}, [ProductSearch,GetmultipleSearchDatas]);
|
||||
|
||||
// useEffect(() => {
|
||||
// if (
|
||||
|
|
@ -4620,7 +4641,9 @@ console.log(cardData, 'cardData combo card');
|
|||
</SortableContext>
|
||||
</DndContext>
|
||||
</>
|
||||
) : ProductSearch?.length > 5 &&
|
||||
) : ProductSearch?.length > 5 && GetmultipleSearchDatas.some(
|
||||
e => e.toLowerCase() === "qrcode"
|
||||
) &&
|
||||
(cardData?.length == 0 || cardData == undefined) ? (
|
||||
<div>
|
||||
{/* cardData mohan 18-04-2025 */}
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ import {
|
|||
GlobalCategorieData,
|
||||
GlobalSubcategorieData,
|
||||
GlobalProductCardTrigger,
|
||||
GlobalGetmultipleSearchDatas,
|
||||
getmultipleSearch,
|
||||
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||
import {
|
||||
GlobalPreOrderAdditem,
|
||||
|
|
@ -244,6 +246,7 @@ const BSItemCard = (props) => {
|
|||
SelectedGlobalCardColorDetail,
|
||||
shallowEqual
|
||||
);
|
||||
const GetmultipleSearchDatas = useSelector(GlobalGetmultipleSearchDatas, shallowEqual)
|
||||
const SelectedCardFont = useSelector(SelectedGlobalCardFont, shallowEqual);
|
||||
const CartOrderDetails = useSelector(GlobalOrderCardDetails, shallowEqual);
|
||||
const SelectedDatas = useSelector(GlobalSelectedDatas, shallowEqual);
|
||||
|
|
@ -251,6 +254,7 @@ const BSItemCard = (props) => {
|
|||
const WSProductdata = useSelector(GlobalWSProduct, shallowEqual);
|
||||
const NewQrProductData = useSelector(GlobalNewQrProduct, shallowEqual);
|
||||
const ReportholdData = useSelector(GlobalReorderHoldDetails, shallowEqual);
|
||||
console.log(GetmultipleSearchDatas, "GetmultipleSearchDatas")
|
||||
const ReorderProductData = useSelector(
|
||||
GlobalReorderProductDetails,
|
||||
shallowEqual
|
||||
|
|
@ -1025,10 +1029,27 @@ const BSItemCard = (props) => {
|
|||
useEffect(() => {
|
||||
if (AppId && CompId && BranchId) {
|
||||
fetchedit();
|
||||
GetmultipleSearchData()
|
||||
}
|
||||
|
||||
// dispatch(changepreOrder(false)); Commented to Add Normal Produts After Adding the Combo Pack !!!!!! Dont Touch Without Shifayath Permission
|
||||
}, [AppId, CompId, BranchId]);
|
||||
|
||||
const GetmultipleSearchData = async () => {
|
||||
const data = {
|
||||
AppId,
|
||||
CompId,
|
||||
BranchId,
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await dispatch(getmultipleSearch(data))
|
||||
|
||||
} catch (error) {
|
||||
console.error("Get Search Terms Error:", error);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setPreOrderSelectedProdNames([]);
|
||||
// dispatch(changePreOrderAdditem(null));
|
||||
|
|
@ -1043,10 +1064,14 @@ const BSItemCard = (props) => {
|
|||
if (noSubcatCardData) {
|
||||
setNoSubcatCardData();
|
||||
}
|
||||
if (ProductSearch?.length > 5) {
|
||||
|
||||
if (ProductSearch?.length > 5 && GetmultipleSearchDatas.some(
|
||||
e => e.toLowerCase() === "qrcode"
|
||||
)) {
|
||||
setQuickAdd(true);
|
||||
}
|
||||
}, [ProductSearch]);
|
||||
}, [ProductSearch, GetmultipleSearchDatas]);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
!initialRun &&
|
||||
|
|
@ -7433,7 +7458,12 @@ const BSItemCard = (props) => {
|
|||
</SortableContext>
|
||||
</DndContext>
|
||||
</>
|
||||
) : ProductSearch?.length > 5 &&
|
||||
)
|
||||
|
||||
|
||||
: ProductSearch?.length > 5 && GetmultipleSearchDatas.some(
|
||||
e => e.toLowerCase() === "qrcode"
|
||||
) &&
|
||||
(cardData?.length == 0 || cardData == undefined) ? (
|
||||
<div>
|
||||
{/* cardData mohan 18-04-2025 */}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,8 @@ import {
|
|||
changeCardData,
|
||||
GlobaldraggingComponent,
|
||||
GlobalCombocarddata,
|
||||
GlobalGetmultipleSearchDatas,
|
||||
getmultipleSearch,
|
||||
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||
import {
|
||||
GlobalPreOrderAdditem,
|
||||
|
|
@ -92,7 +94,7 @@ import {
|
|||
import { useSortable } from '@dnd-kit/sortable';
|
||||
import { CSS } from '@dnd-kit/utilities';
|
||||
import { getCombolist } from '../../../../Features/ComboMaster/ComboMaster.js';
|
||||
import {GlobalOtherServicesdata, OtherServicesCardlistdata} from '../../../../Features/OtherServices/OtherServices.js';
|
||||
import { GlobalOtherServicesdata, OtherServicesCardlistdata } from '../../../../Features/OtherServices/OtherServices.js';
|
||||
|
||||
|
||||
export function SortableCard({ id, children, item }) {
|
||||
|
|
@ -183,9 +185,10 @@ const BSOtherServiceItemCard = (props) => {
|
|||
SelectedGlobalCardColorDetail,
|
||||
shallowEqual
|
||||
);
|
||||
const GetmultipleSearchDatas = useSelector(GlobalGetmultipleSearchDatas, shallowEqual)
|
||||
const SelectedCardFont = useSelector(SelectedGlobalCardFont, shallowEqual);
|
||||
const CartOrderDetails = useSelector(GlobalOrderCardDetails, shallowEqual);
|
||||
console.log(CartOrderDetails,"CartOrderDetailsOTHERSERVICESITEMCARD");
|
||||
console.log(CartOrderDetails, "CartOrderDetailsOTHERSERVICESITEMCARD");
|
||||
const SelectedDatas = useSelector(GlobalSelectedDatas, shallowEqual);
|
||||
const otherscarddata = useSelector(Globalothersdata, shallowEqual);
|
||||
const WSProductdata = useSelector(GlobalWSProduct, shallowEqual);
|
||||
|
|
@ -269,11 +272,25 @@ const BSOtherServiceItemCard = (props) => {
|
|||
useEffect(() => {
|
||||
if (AppId && CompId && BranchId) {
|
||||
fetchedit();
|
||||
GetmultipleSearchData()
|
||||
}
|
||||
|
||||
// dispatch(changepreOrder(false)); Commented to Add Normal Produts After Adding the Combo Pack !!!!!! Dont Touch Without Shifayath Permission
|
||||
}, [AppId, CompId, BranchId]);
|
||||
const GetmultipleSearchData = async () => {
|
||||
const data = {
|
||||
AppId,
|
||||
CompId,
|
||||
BranchId,
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await dispatch(getmultipleSearch(data))
|
||||
|
||||
} catch (error) {
|
||||
console.error("Get Search Terms Error:", error);
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
setPreOrderSelectedProdNames([]);
|
||||
// dispatch(changePreOrderAdditem(null));
|
||||
|
|
@ -290,10 +307,13 @@ const BSOtherServiceItemCard = (props) => {
|
|||
if (noSubcatCardData) {
|
||||
setNoSubcatCardData();
|
||||
}
|
||||
if (ProductSearch?.length > 5) {
|
||||
if (ProductSearch?.length > 5 && GetmultipleSearchDatas.some(
|
||||
e => e.toLowerCase() === "qrcode"
|
||||
)) {
|
||||
setQuickAdd(true);
|
||||
}
|
||||
}, [ProductSearch]);
|
||||
|
||||
}, [ProductSearch, GetmultipleSearchDatas]);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
|
|
@ -402,7 +422,7 @@ const BSOtherServiceItemCard = (props) => {
|
|||
}
|
||||
};
|
||||
|
||||
let Otherservicedata = [
|
||||
let Otherservicedata = [
|
||||
{
|
||||
"CompId": 1,
|
||||
"BranchId": 101,
|
||||
|
|
@ -479,7 +499,7 @@ let Otherservicedata = [
|
|||
]
|
||||
|
||||
|
||||
const processGlobalComboData = () => {
|
||||
const processGlobalComboData = () => {
|
||||
|
||||
const serviceCategories = GlobalOtherServicescarddatas?.[0]?.ServiceDetails;
|
||||
|
||||
|
|
@ -496,9 +516,9 @@ const processGlobalComboData = () => {
|
|||
}));
|
||||
|
||||
return comboList;
|
||||
};
|
||||
};
|
||||
|
||||
const comboList = processGlobalComboData() || [];
|
||||
const comboList = processGlobalComboData() || [];
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -2885,7 +2905,7 @@ const comboList = processGlobalComboData() || [];
|
|||
const onAutocompleteChange = async (selectedOption) => {
|
||||
|
||||
|
||||
console.log(selectedOption,"selectedOptionselectedOption");
|
||||
console.log(selectedOption, "selectedOptionselectedOption");
|
||||
|
||||
let data = {
|
||||
|
||||
|
|
@ -2913,9 +2933,9 @@ console.log(selectedOption,"selectedOptionselectedOption");
|
|||
TotalSellPrice: selectedOption?.TotalAmt,
|
||||
Price: selectedOption.TotalAmt,
|
||||
|
||||
TaxAmt:selectedOption?.TaxAmt,
|
||||
TaxId:selectedOption?.TaxId,
|
||||
TaxName:selectedOption?.TaxName,
|
||||
TaxAmt: selectedOption?.TaxAmt,
|
||||
TaxId: selectedOption?.TaxId,
|
||||
TaxName: selectedOption?.TaxName,
|
||||
TaxPercentage: selectedOption?.TaxPercentage,
|
||||
|
||||
QRCode: selectedOption?.ComboInwardDetails?.[0]?.QRCode,
|
||||
|
|
@ -2943,7 +2963,7 @@ console.log(selectedOption,"selectedOptionselectedOption");
|
|||
};
|
||||
|
||||
const AddOrderDetails = async (item) => {
|
||||
console.log("AddOrderDetails item",item)
|
||||
console.log("AddOrderDetails item", item)
|
||||
if (preOrder) {
|
||||
let Response = await dispatch(
|
||||
getConfigType({ TypeName: 'Booking Type' })
|
||||
|
|
@ -3099,7 +3119,7 @@ console.log("AddOrderDetails item",item)
|
|||
);
|
||||
|
||||
const BookingTypeProd = item?.BookingTypeName;
|
||||
if (isItemInCart && BookingTypeProd != 'Dine In' && OrderType != 'Hold' ) {
|
||||
if (isItemInCart && BookingTypeProd != 'Dine In' && OrderType != 'Hold') {
|
||||
if (BillOrderPre === 'Y') {
|
||||
|
||||
const UpdatedCartItem =
|
||||
|
|
@ -3201,7 +3221,7 @@ console.log("AddOrderDetails item",item)
|
|||
setMessageData("Service Already Exist")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (isItemInCart && BookingTypeProd === 'Dine In' && OrderType != 'Hold') {
|
||||
|
||||
|
|
@ -3530,49 +3550,49 @@ console.log("AddOrderDetails item",item)
|
|||
);
|
||||
}
|
||||
|
||||
// else {
|
||||
// const baseItem = {
|
||||
// ...item,
|
||||
// OrderQty: 1,
|
||||
// OfferPrice: item?.OfferPrice,
|
||||
// TotalAmt:
|
||||
// item?.OfferPrice > 0
|
||||
// ? item?.OrderRate -
|
||||
// (item?.OfferType === 'F'
|
||||
// ? item?.OfferPrice
|
||||
// : (item?.OrderRate * item?.OfferPrice) / 100)
|
||||
// : item?.OrderRate,
|
||||
// TaxAmt: (
|
||||
// (item?.OrderRate * item?.TaxPercentage) /
|
||||
// (100 + item?.TaxPercentage)
|
||||
// ).toFixed(2),
|
||||
// WithoutTaxRate: (
|
||||
// item?.OrderRate -
|
||||
// (item?.OrderRate * item?.TaxPercentage) /
|
||||
// (100 + item?.TaxPercentage)
|
||||
// ).toFixed(2),
|
||||
// };
|
||||
// else {
|
||||
// const baseItem = {
|
||||
// ...item,
|
||||
// OrderQty: 1,
|
||||
// OfferPrice: item?.OfferPrice,
|
||||
// TotalAmt:
|
||||
// item?.OfferPrice > 0
|
||||
// ? item?.OrderRate -
|
||||
// (item?.OfferType === 'F'
|
||||
// ? item?.OfferPrice
|
||||
// : (item?.OrderRate * item?.OfferPrice) / 100)
|
||||
// : item?.OrderRate,
|
||||
// TaxAmt: (
|
||||
// (item?.OrderRate * item?.TaxPercentage) /
|
||||
// (100 + item?.TaxPercentage)
|
||||
// ).toFixed(2),
|
||||
// WithoutTaxRate: (
|
||||
// item?.OrderRate -
|
||||
// (item?.OrderRate * item?.TaxPercentage) /
|
||||
// (100 + item?.TaxPercentage)
|
||||
// ).toFixed(2),
|
||||
// };
|
||||
|
||||
// if (item?.ServiceType == 'I') {
|
||||
// // Always add as a separate entry (individual)
|
||||
// dispatch(changeOrderCardDetails([
|
||||
// ...CartOrderDetails,
|
||||
// baseItem,
|
||||
// ]));
|
||||
// } else {
|
||||
// if (item?.ServiceType == 'I') {
|
||||
// // Always add as a separate entry (individual)
|
||||
// dispatch(changeOrderCardDetails([
|
||||
// ...CartOrderDetails,
|
||||
// baseItem,
|
||||
// ]));
|
||||
// } else {
|
||||
|
||||
// // Use your existing logic with BillOrderPre check
|
||||
// BillOrderPre === 'Y'
|
||||
// ? dispatch(changeOrderCardDetails([
|
||||
// baseItem,
|
||||
// ...CartOrderDetails,
|
||||
// ]))
|
||||
// : dispatch(changeOrderCardDetails([
|
||||
// ...CartOrderDetails,
|
||||
// baseItem,
|
||||
// ]));
|
||||
// }
|
||||
// }
|
||||
// // Use your existing logic with BillOrderPre check
|
||||
// BillOrderPre === 'Y'
|
||||
// ? dispatch(changeOrderCardDetails([
|
||||
// baseItem,
|
||||
// ...CartOrderDetails,
|
||||
// ]))
|
||||
// : dispatch(changeOrderCardDetails([
|
||||
// ...CartOrderDetails,
|
||||
// baseItem,
|
||||
// ]));
|
||||
// }
|
||||
// }
|
||||
|
||||
else {
|
||||
const baseItem = {
|
||||
|
|
@ -4118,7 +4138,7 @@ console.log("AddOrderDetails item",item)
|
|||
</p>
|
||||
)} */}
|
||||
</p>
|
||||
{ cardFunction?.Price && (
|
||||
{cardFunction?.Price && (
|
||||
<p
|
||||
className="BSItemCard-itemPrice"
|
||||
style={{
|
||||
|
|
@ -4493,7 +4513,9 @@ console.log("AddOrderDetails item",item)
|
|||
</SortableContext>
|
||||
</DndContext>
|
||||
</>
|
||||
) : ProductSearch?.length > 5 &&
|
||||
) : ProductSearch?.length > 5 && GetmultipleSearchDatas.some(
|
||||
e => e.toLowerCase() === "qrcode"
|
||||
) &&
|
||||
(cardData?.length == 0 || cardData == undefined) ? (
|
||||
<div>
|
||||
{/* cardData mohan 18-04-2025 */}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,8 @@ import {
|
|||
slotTimeStatus,
|
||||
changeAddBookingDetailsTrigger,
|
||||
GlobalAddBookingDetailsTrigger,
|
||||
GlobalGetmultipleSearchDatas,
|
||||
getmultipleSearch,
|
||||
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||
import {
|
||||
GlobalPreOrderAdditem,
|
||||
|
|
@ -216,6 +218,7 @@ const BsBookingitemCard = (props) => {
|
|||
shallowEqual
|
||||
);
|
||||
// const SelectedCust = useSelector(GlobalSelOption, shallowEqual);
|
||||
const GetmultipleSearchDatas = useSelector(GlobalGetmultipleSearchDatas, shallowEqual)
|
||||
const RetailWSSalesType = useSelector(GlobalRetailWSSalesType, shallowEqual);
|
||||
// const CustDetails = SelectedCust ? SelectedCust : AddCustomerDetails?.[0];
|
||||
const BookingTypeBoth = useSelector(GlobalBookingTypeBoth);
|
||||
|
|
@ -1090,10 +1093,25 @@ const BsBookingitemCard = (props) => {
|
|||
useEffect(() => {
|
||||
if (AppId && CompId && BranchId) {
|
||||
fetchedit();
|
||||
GetmultipleSearchData()
|
||||
}
|
||||
|
||||
// dispatch(changepreOrder(false)); Commented to Add Normal Produts After Adding the Combo Pack !!!!!! Dont Touch Without Shifayath Permission
|
||||
}, [AppId, CompId, BranchId]);
|
||||
const GetmultipleSearchData = async () => {
|
||||
const data = {
|
||||
AppId,
|
||||
CompId,
|
||||
BranchId,
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await dispatch(getmultipleSearch(data))
|
||||
|
||||
} catch (error) {
|
||||
console.error("Get Search Terms Error:", error);
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
setPreOrderSelectedProdNames([]);
|
||||
// dispatch(changePreOrderAdditem(null));
|
||||
|
|
@ -1126,10 +1144,12 @@ const BsBookingitemCard = (props) => {
|
|||
if (noSubcatCardData) {
|
||||
setNoSubcatCardData();
|
||||
}
|
||||
if (ProductSearch?.length > 5) {
|
||||
if (ProductSearch?.length > 5 && GetmultipleSearchDatas.some(
|
||||
e => e.toLowerCase() === "qrcode"
|
||||
)) {
|
||||
setQuickAdd(true);
|
||||
}
|
||||
}, [ProductSearch]);
|
||||
}, [ProductSearch, GetmultipleSearchDatas]);
|
||||
useEffect(() => {
|
||||
if (
|
||||
!initialRun &&
|
||||
|
|
@ -2318,7 +2338,7 @@ const BsBookingitemCard = (props) => {
|
|||
parseInt(totalSelectedProductQty || 0) +
|
||||
parseInt(reorderComboConsumed || 0);
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
let getCurrentProdDtl = orderDetails?.filter(
|
||||
(a) => a?.ProdName === ProdName
|
||||
);
|
||||
|
|
@ -2519,7 +2539,7 @@ const BsBookingitemCard = (props) => {
|
|||
parseInt(totalSelectedProductQty || 0) +
|
||||
parseInt(reorderComboConsumed || 0);
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId);
|
||||
let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => {
|
||||
return (
|
||||
|
|
@ -2555,7 +2575,7 @@ const BsBookingitemCard = (props) => {
|
|||
}, 0);
|
||||
totalOrderQty =
|
||||
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
||||
if (
|
||||
parseInt(ItemQuantity) >
|
||||
|
|
@ -2641,7 +2661,7 @@ const BsBookingitemCard = (props) => {
|
|||
parseInt(totalSelectedProductQty || 0) +
|
||||
parseInt(reorderComboConsumed || 0);
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
let getCurrentProdDtl = orderDetails?.filter((a) => a?.ProdId === ProdId);
|
||||
let totalOrderQty = getCurrentProdDtl?.reduce((accumulator, card) => {
|
||||
return (
|
||||
|
|
@ -2680,7 +2700,7 @@ const BsBookingitemCard = (props) => {
|
|||
}, 0);
|
||||
totalOrderQty =
|
||||
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
||||
if (
|
||||
parseInt(ItemQuantity) >
|
||||
|
|
@ -2772,7 +2792,7 @@ const BsBookingitemCard = (props) => {
|
|||
parseInt(totalSelectedProductQty || 0) +
|
||||
parseInt(reorderComboConsumed || 0);
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
let getCurrentProdDtl = orderDetails?.filter(
|
||||
(a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId
|
||||
);
|
||||
|
|
@ -2815,7 +2835,7 @@ const BsBookingitemCard = (props) => {
|
|||
}, 0);
|
||||
totalOrderQty =
|
||||
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
|
||||
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
||||
if (
|
||||
|
|
@ -2899,7 +2919,7 @@ const BsBookingitemCard = (props) => {
|
|||
parseInt(totalSelectedProductQty || 0) +
|
||||
parseInt(reorderComboConsumed || 0);
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
let getCurrentProdDtl = orderDetails?.filter(
|
||||
(a) => a?.ProdId === ProdId && a?.InwardDtlId === InwardDtlId
|
||||
);
|
||||
|
|
@ -2946,7 +2966,7 @@ const BsBookingitemCard = (props) => {
|
|||
}, 0);
|
||||
totalOrderQty =
|
||||
parseInt(totalOrderQty || 0) + parseInt(comboConsumed || 0);
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
|
||||
let OverallProdQty = totalOrderQty - totalSelectedProductQty;
|
||||
if (
|
||||
|
|
@ -4883,7 +4903,7 @@ const BsBookingitemCard = (props) => {
|
|||
className="BSItemCard-itemName"
|
||||
>
|
||||
{item?.ProdName}
|
||||
{}
|
||||
{ }
|
||||
</p>
|
||||
{cardFunction?.Price && (
|
||||
<p
|
||||
|
|
@ -5340,7 +5360,9 @@ const BsBookingitemCard = (props) => {
|
|||
</SortableContext>
|
||||
</DndContext>
|
||||
</>
|
||||
) : ProductSearch?.length > 5 &&
|
||||
) : ProductSearch?.length > 5 && GetmultipleSearchDatas.some(
|
||||
e => e.toLowerCase() === "qrcode"
|
||||
) &&
|
||||
(cardData?.length == 0 || cardData == undefined) ? (
|
||||
<div>
|
||||
{/* cardData mohan 18-04-2025 */}
|
||||
|
|
@ -6072,8 +6094,7 @@ const BsBookingitemCard = (props) => {
|
|||
return (
|
||||
<div
|
||||
key={idx}
|
||||
className={`slotTimingSelect ${
|
||||
isBooked
|
||||
className={`slotTimingSelect ${isBooked
|
||||
? 'booked'
|
||||
: isAlreadyAdded
|
||||
? 'incart'
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import React, { useEffect, useState } from "react";
|
||||
import { getSession } from "../../../../Services/Others";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { shallowEqual, useDispatch, useSelector } from "react-redux";
|
||||
import {
|
||||
getmultipleSearch,
|
||||
GlobalGetmultipleSearchDatas,
|
||||
PostProductSearch,
|
||||
} from "../../../../Features/BookingScreen/BookingData/BookingData";
|
||||
import Buttons from "../../../../Components/Forms/Buttons";
|
||||
|
|
@ -12,6 +13,7 @@ const MultipleSearch = ({ close }) => {
|
|||
const BranchId = getSession("BranchId");
|
||||
const AppId = getSession("AppId");
|
||||
const dispatch = useDispatch();
|
||||
const GetmultipleSearchDatas = useSelector(GlobalGetmultipleSearchDatas, shallowEqual)
|
||||
|
||||
const options = [
|
||||
{ label: "Product Name", value: "ProdName" },
|
||||
|
|
@ -29,7 +31,8 @@ const MultipleSearch = ({ close }) => {
|
|||
console.log(selectedValues, "selectedValuesselectedValues");
|
||||
|
||||
useEffect(() => {
|
||||
GetmultipleSearchData();
|
||||
// GetmultipleSearchData();
|
||||
setSelectedValues(GetmultipleSearchDatas)
|
||||
}, []);
|
||||
|
||||
const postMultipleSearch = async () => {
|
||||
|
|
@ -47,6 +50,7 @@ const MultipleSearch = ({ close }) => {
|
|||
const response = await dispatch(PostProductSearch(data)).unwrap();
|
||||
console.log("Search Response:", response);
|
||||
if (response?.data?.statusCode == 1) {
|
||||
GetmultipleSearchData();
|
||||
setSelectedValues("");
|
||||
close(false);
|
||||
}
|
||||
|
|
@ -63,21 +67,12 @@ const MultipleSearch = ({ close }) => {
|
|||
};
|
||||
|
||||
try {
|
||||
const response = await dispatch(getmultipleSearch(data)).unwrap();
|
||||
const response = await dispatch(getmultipleSearch(data))
|
||||
|
||||
if (response?.data?.statusCode === 1) {
|
||||
const selected =
|
||||
response?.data?.data?.[0]?.SearchTermDtl?.map(
|
||||
(item) => item?.SearchTerm,
|
||||
) || [];
|
||||
|
||||
setSelectedValues(selected);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Get Search Terms Error:", error);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
|
|
|
|||
Loading…
Reference in New Issue