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