From 12fe504bb07f668270885c69cb369c817e2ce8c2 Mon Sep 17 00:00:00 2001 From: Srinath Date: Mon, 30 Mar 2026 15:49:03 +0530 Subject: [PATCH] issue fixing --- .../OtherConponents/Reprint/BSReprint.jsx | 17 ++++++++++------- .../UtillComponents/BSExpireProductsList.jsx | 4 ++++ .../ThermalPrinter/OtherServicePrintStyle1.jsx | 15 +-------------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx b/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx index 74de142..0b2ee52 100644 --- a/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx +++ b/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx @@ -274,13 +274,16 @@ function BSReprint({ setOpenModel = () => { } }) { // dispatch(getPrintSelectionComponentData(Data1)).unwrap(); }, []); - const handleDateChange = (dates, dateStrings) => { - // setDateRange(dateStrings); - if (dateStrings[0] && dateStrings[1]) { - setDateStrings(dateStrings); - setpage(1); - } - }; + const handleDateChange = (dates) => { + if (dates && dates[0] && dates[1]) { + const formattedDates = [ + dates[0].format("YYYY-MM-DD"), + dates[1].format("YYYY-MM-DD"), + ]; + setDateStrings(formattedDates); + setpage(1); + } +}; const DefaultReprintReason = async () => { let data = { AppId: AppId, diff --git a/src/Pages/BookingScreen/Components/UtillComponents/BSExpireProductsList.jsx b/src/Pages/BookingScreen/Components/UtillComponents/BSExpireProductsList.jsx index 0c784f0..e3f82a5 100644 --- a/src/Pages/BookingScreen/Components/UtillComponents/BSExpireProductsList.jsx +++ b/src/Pages/BookingScreen/Components/UtillComponents/BSExpireProductsList.jsx @@ -66,6 +66,10 @@ const BSExpireProductsList = () => { fetchData(); }, []); + useEffect(() => { + if (expireModelOpen) fetchData(); + }, [expireModelOpen]); + // useEffect(() => { // fetchData(); // }, [cartDetails]); diff --git a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/OtherServicePrintStyle1.jsx b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/OtherServicePrintStyle1.jsx index 7559f21..028c58d 100644 --- a/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/OtherServicePrintStyle1.jsx +++ b/src/Pages/BookingScreen/PrintTemplates/ThermalPrinter/OtherServicePrintStyle1.jsx @@ -8,41 +8,28 @@ import { changeReprintDataFound, } from "../../../../Features/ThemeChange/ThemeChange"; import "../../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle1.scss"; -import QRCode from "react-qr-code"; +import { QRCode } from "react-qr-code"; import { ApplicationPreferences } from "../../../../Features/BrachLogin/BranchLogin"; const OtherServicePrintStyle1 = ({ - table2Data, PaymentStatus, printDatas, }) => { - - - const dispatch = useDispatch(); - const GlobaldummyData = useSelector(GlobalPritdummyData); - const appPreferences = useSelector(ApplicationPreferences); const bookingTypePreference = appPreferences?.find((preference) => preference?.PreferredCatName === 'Booking Type')?.PreferenceCatDetails - const takeAwayPreference = bookingTypePreference?.find((type) => type?.PreferredSubCatName?.toLowerCase() === "take away" && type?.PreferredStatus === 'Y') const keysLength = Object.keys(table2Data ?? {}).length; - let FormatTheme = printDatas?.PrintType == "S" ? true : false let PageSize = printDatas?.PageSize - - console.log("table2Datatable2Datatable2Datatable2Data", table2Data,table2Data?.[0]?.BranchName ); if (keysLength > 0) { dispatch(changeReprintDataFound(true)); } - - - const formattedDate =dateFormatChange1(table2Data?.[0]?.CreatedDate); // `${day}-${monthNames[monthIndex]}-${year}`;