From 5cd65fa1040f27c9592980130f31c0759792b38a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Feb 2026 09:57:03 +0530 Subject: [PATCH] camera feature added for upload --- src/Components/Forms/CropUpload.jsx | 33 +- src/Components/Forms/Upload.jsx | 30 + src/Components/MobileComponent/Camera.jsx | 43 + .../BSBillingTable3/BSBillingTable3pay.jsx | 2 +- .../FeaturesFunctionalities.jsx | 5 + .../OtherConponents/Reprint/BSReprint.jsx | 3 +- .../BookingScreen/Forms/QuickAdd/QuickAdd.jsx | 12 +- src/Pages/CommonMaster/CommonMaster.jsx | 94 +- src/Pages/EmpMaster/EmpMasterForm.jsx | 65 +- src/Pages/OtherServices/OtherServicesForm.jsx | 2 +- src/Pages/Product/ProductForm.jsx | 2338 +++++++++-------- src/Pages/Ticket/TicketForm.jsx | 42 +- 12 files changed, 1394 insertions(+), 1275 deletions(-) create mode 100644 src/Components/MobileComponent/Camera.jsx diff --git a/src/Components/Forms/CropUpload.jsx b/src/Components/Forms/CropUpload.jsx index e1eb22d..9d65183 100644 --- a/src/Components/Forms/CropUpload.jsx +++ b/src/Components/Forms/CropUpload.jsx @@ -9,6 +9,8 @@ import { FiPenTool } from 'react-icons/fi'; import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx'; import '../../Styles/Product/Product.scss'; import { Messages } from '../Notifications/Messages.jsx'; +import { isMobile } from 'react-device-detect'; +import Camera from '../MobileComponent/Camera.jsx'; const allowedTypes = [ 'image/jpeg', 'image/png', @@ -22,7 +24,7 @@ const CropUpload = ({ ImageLink, onlineImage, isProductList = {}, - handleClose = () => {} + handleClose = () => { } }) => { const dispatch = useDispatch(); const [messageType, setMessageType] = useState(null); @@ -405,13 +407,36 @@ const CropUpload = ({ Preview + {isMobile && fileList?.length == 0 && <> +
OR
+ { + const file = e.target.files?.[0]; + if (!file) return; + + try { + await handleUpload({ + file, + onSuccess: () => { + setEditImageOpen(true); + }, + onError: () => { + console.error("Upload failed"); + } + }); + } catch (error) { + console.error(error); + } + }} + /> + } { const [previewImage, setPreviewImage] = useState(''); const [previewTitle, setPreviewTitle] = useState(''); const [fileList, setFileList] = useState([]); + console.log(fileList, "fileList") useEffect(() => { // Inside Imageupload.jsx @@ -94,6 +97,19 @@ const App = ({ singleImage, updateImageUrl, ImageLink = '', listType }) => { ); + const handleCameraCapture = async (e) => { + const file = e.target.files[0]; + + if (!file) return; + + let data = await dispatch(uploadImage(file)).unwrap(); + + if (data?.data?.status) { + updateImageUrl(data?.data?.image); + setFileList([{ url: data?.data?.image }]); + } + }; + return ( <> { src={previewImage} /> + {isMobile && fileList?.length == 0 && <> +
OR
+ { + const files = Array.from(e.target.files); + + const formattedFileList = files.map((file) => ({ + originFileObj: file, + })); + + handleChange({ fileList: formattedFileList }); + }} + /> + } ); }; diff --git a/src/Components/MobileComponent/Camera.jsx b/src/Components/MobileComponent/Camera.jsx new file mode 100644 index 0000000..3b337f0 --- /dev/null +++ b/src/Components/MobileComponent/Camera.jsx @@ -0,0 +1,43 @@ +import { useRef } from 'react' +import { TbCapture } from "react-icons/tb"; + +const Camera = ({ handleCapture = () => { } }) => { + + const cameraRef = useRef(null); + + return ( +
+ +
cameraRef.current.click()}> + + Take Photo +
+
+ ) +} + +export default Camera \ No newline at end of file diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3pay.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3pay.jsx index ab5f497..116745e 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3pay.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3pay.jsx @@ -355,7 +355,7 @@ const BSBillingTable3Pay = () => { const OrderCardDetail = useSelector(GlobalOrderCardDetails); const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false); - console.log(paybtns, 'paybtnspaybtnspaybtnspaybtns', currentOrderNetAmount, previousNetAmount); + console.log(OrderCardDetail, 'OrderCardDetail'); //Total calculation const TotalItems = OrderCardDetail?.length; const [formattedDate, setFormattedDate] = useState(''); diff --git a/src/Pages/BookingScreen/Components/BookingFunctionality/FeaturesFunctionalities.jsx b/src/Pages/BookingScreen/Components/BookingFunctionality/FeaturesFunctionalities.jsx index 2deb79f..8fd9272 100644 --- a/src/Pages/BookingScreen/Components/BookingFunctionality/FeaturesFunctionalities.jsx +++ b/src/Pages/BookingScreen/Components/BookingFunctionality/FeaturesFunctionalities.jsx @@ -1193,6 +1193,11 @@ const FeaturesFunctionalities = (props) => { ), }, ]; + + console.log(ReorderHoldDetails, + BookingType, + GlobalExtraCharge, "GlobalExtraCharge"); + const defaultColumns1 = [ { title: 'ExtraCharge Type', diff --git a/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx b/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx index 65d399f..0c73699 100644 --- a/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx +++ b/src/Pages/BookingScreen/Components/OtherConponents/Reprint/BSReprint.jsx @@ -1292,6 +1292,7 @@ function BSReprint({ setOpenModel = () => { } }) { OrderQty: item?.SalesQty, OrderRate: item?.Rate, SellingPrice: item?.Rate, + TaxPercentage: (item?.ProdTaxPercentage || 0) // TotalAmt: formatAmount((item.TotalAmt - item.OfferValue)), })); @@ -1855,7 +1856,7 @@ function BSReprint({ setOpenModel = () => { } }) { ))} - { showShareModal &&

Upload Icon



- +
+ +
)} diff --git a/src/Pages/CommonMaster/CommonMaster.jsx b/src/Pages/CommonMaster/CommonMaster.jsx index a2ee297..01df14e 100644 --- a/src/Pages/CommonMaster/CommonMaster.jsx +++ b/src/Pages/CommonMaster/CommonMaster.jsx @@ -90,11 +90,11 @@ const CommonMaster = () => { const TypeNames = AppType === 'Wholesale' ? ConfigTypeNames.filter((item) => - baseConfigTypeOptions.includes(item.TypeName) - ) // include only these for Wholesale + baseConfigTypeOptions.includes(item.TypeName) + ) // include only these for Wholesale : ConfigTypeNames.filter( - (item) => !baseConfigTypeOptions.includes(item.TypeName) - ); + (item) => !baseConfigTypeOptions.includes(item.TypeName) + ); const [open, setOpen] = useState(false); const [EditState, setEditState] = useState(false); @@ -203,34 +203,34 @@ const CommonMaster = () => { setCommonDataFilter([ ...(Array.isArray(CommonData) ? CommonData.filter( - (data) => - ![ - 'Product Category', - 'Product Sub-Category', - 'Product Brand', - 'Product Tax', - 'Designation', - 'Wholesale Extra Charges', - 'Wholesale Unit Of Measure', - 'Wholesale Quantity', - 'Wholesale Screen Name', - 'Wholesale Payment Mode', - 'Wholesale Designation', - ].includes(data?.TypeName) - ) - : []), - - ...(Array.isArray(CommonData) - ? CommonData.filter((data) => - [ + (data) => + ![ 'Product Category', 'Product Sub-Category', 'Product Brand', 'Product Tax', 'Designation', - 'PackingType', + 'Wholesale Extra Charges', + 'Wholesale Unit Of Measure', + 'Wholesale Quantity', + 'Wholesale Screen Name', + 'Wholesale Payment Mode', + 'Wholesale Designation', ].includes(data?.TypeName) - ).filter((item) => item.AlphaNumFId == AppId) + ) + : []), + + ...(Array.isArray(CommonData) + ? CommonData.filter((data) => + [ + 'Product Category', + 'Product Sub-Category', + 'Product Brand', + 'Product Tax', + 'Designation', + 'PackingType', + ].includes(data?.TypeName) + ).filter((item) => item.AlphaNumFId == AppId) : []), ]); } @@ -675,11 +675,11 @@ const CommonMaster = () => { style={{ color: '#1292EE' }} onClick={() => UserType === 'Super Admin' || - (UserType === 'Super Admin User' && - SAAccessCommonMaster?.UpdateAccess === 'Y') || - (UserType === 'Employee' && - empData?.UpdateAccess === 'Y') || - UserType === 'Admin' + (UserType === 'Super Admin User' && + SAAccessCommonMaster?.UpdateAccess === 'Y') || + (UserType === 'Employee' && + empData?.UpdateAccess === 'Y') || + UserType === 'Admin' ? actionsFormatter(record, index) : '' } @@ -696,11 +696,11 @@ const CommonMaster = () => { }} onClick={() => UserType === 'Super Admin' || - (UserType === 'Super Admin User' && - SAAccessCommonMaster?.DeleteAccess === 'Y') || - (UserType === 'Employee' && - empData?.DeleteAccess === 'Y') || - UserType === 'Admin' + (UserType === 'Super Admin User' && + SAAccessCommonMaster?.DeleteAccess === 'Y') || + (UserType === 'Employee' && + empData?.DeleteAccess === 'Y') || + UserType === 'Admin' ? statusFormatter(record) : '' } @@ -712,11 +712,11 @@ const CommonMaster = () => { }} onClick={() => UserType === 'Super Admin' || - (UserType === 'Super Admin User' && - SAAccessCommonMaster?.DeleteAccess === 'Y') || - (UserType === 'Employee' && - empData?.DeleteAccess === 'Y') || - UserType === 'Admin' + (UserType === 'Super Admin User' && + SAAccessCommonMaster?.DeleteAccess === 'Y') || + (UserType === 'Employee' && + empData?.DeleteAccess === 'Y') || + UserType === 'Admin' ? statusFormatter(record) : '' } @@ -1158,11 +1158,13 @@ const CommonMaster = () => {

Upload Icon


- +
+ +
diff --git a/src/Pages/EmpMaster/EmpMasterForm.jsx b/src/Pages/EmpMaster/EmpMasterForm.jsx index ce07e0a..56e6606 100644 --- a/src/Pages/EmpMaster/EmpMasterForm.jsx +++ b/src/Pages/EmpMaster/EmpMasterForm.jsx @@ -33,6 +33,8 @@ import { getCommonAppPreference } from '../../Features/BrachLogin/BranchLogin.js import { AiOutlineDownCircle, AiOutlineUpCircle } from 'react-icons/ai'; // import TextArea from 'antd/es/input/TextArea.js'; import CropUpload from '../../Components/Forms/CropUpload.jsx'; +import { isMobile } from 'react-device-detect'; +import Camera from '../../Components/MobileComponent/Camera.jsx'; const { Panel } = Collapse; const { TextArea } = Input; const subDirectory = import.meta.env.BASE_URL; @@ -804,7 +806,7 @@ const EmployeeForm = ({ formType }) => { isOnchanges={formType == 'edit' ? true : false} valueData={selectedUserData} disabled={formType == 'edit' ? true : false} - // defaultValue={LastSelectConfig} + // defaultValue={LastSelectConfig} /> ) : null} @@ -918,7 +920,7 @@ const EmployeeForm = ({ formType }) => { disabled={true} isOnChange={ formRef.current?.getFieldsValue()?.MobileNo != - undefined + undefined ? true : false } @@ -967,8 +969,8 @@ const EmployeeForm = ({ formType }) => { {SelectedUserCreation === 'N' ? ( { addonBefore="Password" isOnChange={formType == 'edit' ? true : false} style={{ width: '250px' }} - // disabled={formType == "edit" ? true : false} + // disabled={formType == "edit" ? true : false} /> ) : null} @@ -1039,7 +1041,7 @@ const EmployeeForm = ({ formType }) => { onChangeFunction={(e) => EmpTypeDropDownChange(e)} isOnchanges={formType == 'edit' ? true : false} valueData={seletedEmpTypeDrop} - // defaultValue={LastSelectConfig} + // defaultValue={LastSelectConfig} /> {/* EmpDesig */} @@ -1066,7 +1068,7 @@ const EmployeeForm = ({ formType }) => { onChangeFunction={(e) => EmpDesigDropDownChange(e)} isOnchanges={formType == 'edit' ? true : false} valueData={seletedEmpDesigDrop} - // defaultValue={LastSelectConfig} + // defaultValue={LastSelectConfig} /> {/* EmpDept */} @@ -1093,7 +1095,7 @@ const EmployeeForm = ({ formType }) => { onChangeFunction={(e) => EmpDeptDropDownChange(e)} isOnchanges={formType == 'edit' ? true : false} valueData={seletedEmpDeptDrop} - // defaultValue={LastSelectConfig} + // defaultValue={LastSelectConfig} /> @@ -1122,7 +1124,7 @@ const EmployeeForm = ({ formType }) => { onChangeFunction={(e) => ShiftDropDownChange(e)} isOnchanges={formType == 'edit' ? true : false} valueData={seletedShiftDrop} - // defaultValue={LastSelectConfig} + // defaultValue={LastSelectConfig} /> @@ -1242,7 +1244,7 @@ const EmployeeForm = ({ formType }) => { formType === 'edit' ? editstate?.EmpPhotoLink : formRef.current?.getFieldsValue() - ?.UserImage || ImageUrl; + ?.UserImage || ImageUrl; // Always return a string return typeof link === 'string' ? link : ''; })()} @@ -1288,7 +1290,7 @@ const EmployeeForm = ({ formType }) => { // isOnChange={editstate?.Address1 ? true : false} isOnChange={ formRef.current?.getFieldsValue()?.Address1 != - undefined + undefined ? true : false } @@ -1327,7 +1329,7 @@ const EmployeeForm = ({ formType }) => { // isOnChange={editstate?.Address2 ? true : false} isOnChange={ formRef.current?.getFieldsValue()?.Address2 != - undefined + undefined ? true : false } @@ -1350,13 +1352,13 @@ const EmployeeForm = ({ formType }) => { { validator: (_, value) => (value || editstate?.Zip) && - value?.toString().length === 6 + value?.toString().length === 6 ? Promise.resolve() : editstate?.Zip?.toString().length === 6 ? Promise.resolve() : Promise.reject( - 'Please enter a 6-digit ZIP code' - ), + 'Please enter a 6-digit ZIP code' + ), }, ]} > @@ -1509,7 +1511,7 @@ const EmployeeForm = ({ formType }) => { isOnChange={ SelectedLatitude || (formRef.current?.getFieldsValue()?.Latitude != - undefined + undefined ? true : false) } @@ -1562,7 +1564,7 @@ const EmployeeForm = ({ formType }) => { isOnChange={ SelectedLatitude || (formRef.current?.getFieldsValue()?.Longitude != - undefined + undefined ? true : false) } @@ -1601,7 +1603,7 @@ const EmployeeForm = ({ formType }) => { } isOnChange={ formType == 'edit' || - fieldChangeMap['Description'] + fieldChangeMap['Description'] ? true : false } @@ -1618,7 +1620,7 @@ const EmployeeForm = ({ formType }) => { } isOnChange={ formType == 'edit' || - fieldChangeMap['Certification'] + fieldChangeMap['Certification'] ? true : false } @@ -1630,14 +1632,17 @@ const EmployeeForm = ({ formType }) => { length: Math.max(1, imageUrls.length), }).map((_, idx) => (
- - updateImageUrls(url, idx) - } - /> + +
+ + updateImageUrls(url, idx) + } + /> +
{ prevlca={ editstate ? { - lat: editstate.Latitude, - lng: editstate.Longitude, - } + lat: editstate.Latitude, + lng: editstate.Longitude, + } : null } /> @@ -1712,7 +1717,7 @@ const EmployeeForm = ({ formType }) => { buttonText="SUBMIT" color="901D77" icon={} - // handleSubmit={handleSubmit} + // handleSubmit={handleSubmit} />
diff --git a/src/Pages/OtherServices/OtherServicesForm.jsx b/src/Pages/OtherServices/OtherServicesForm.jsx index ba86181..d6b4493 100644 --- a/src/Pages/OtherServices/OtherServicesForm.jsx +++ b/src/Pages/OtherServices/OtherServicesForm.jsx @@ -57,7 +57,7 @@ const OtherServices = ({ formType }) => { }, { - name: 'OtherServices', + name: 'Other Services', link: `${subDirectory}setting/other-services`, }, ]; diff --git a/src/Pages/Product/ProductForm.jsx b/src/Pages/Product/ProductForm.jsx index 5f08c76..2e979ab 100644 --- a/src/Pages/Product/ProductForm.jsx +++ b/src/Pages/Product/ProductForm.jsx @@ -84,6 +84,7 @@ import { getCommonAppPreference, } from '../../Features/BrachLogin/BranchLogin.js'; import RackForm from '../Rack/RackForm.jsx'; +import { isMobile } from 'react-device-detect'; const subDirectory = import.meta.env.ENV_BASE_URL; const ProductForm = ({ formType }) => { @@ -125,7 +126,7 @@ const ProductForm = ({ formType }) => { UomTypePreference?.some?.( (e) => e?.PreferredSubCatName?.toLowerCase() == - item?.ConfigName?.toLowerCase() && e?.PreferredStatus == 'Y' + item?.ConfigName?.toLowerCase() && e?.PreferredStatus == 'Y' ) ); console.log(UomTypePreference, 'UomTypePreference'); @@ -1128,7 +1129,7 @@ const ProductForm = ({ formType }) => { (item) => parseFloat(item.MRP) === parseFloat(subVariantPriceData?.MRP) && parseFloat(item.SellPrice) === - parseFloat(subVariantPriceData?.SellPrice) && + parseFloat(subVariantPriceData?.SellPrice) && //dhana 18-02-2025 item.ProdVariantName == subVariantPriceData?.ProdVariantName ); @@ -1143,20 +1144,20 @@ const ProductForm = ({ formType }) => { SellPrice: subVariantPriceData?.SellPrice, WhSalePrice: subVariantPriceData?.WhSalePrice == undefined || - subVariantPriceData?.WhSalePrice == null || - subVariantPriceData?.WhSalePrice == '' + subVariantPriceData?.WhSalePrice == null || + subVariantPriceData?.WhSalePrice == '' ? 0 : subVariantPriceData?.WhSalePrice, OfferPrice: subVariantPriceData?.OfferPrice == undefined || - subVariantPriceData?.OfferPrice == null || - subVariantPriceData?.OfferPrice == '' + subVariantPriceData?.OfferPrice == null || + subVariantPriceData?.OfferPrice == '' ? 0 : subVariantPriceData?.OfferPrice, SpecialPrice: subVariantPriceData?.SpecialPrice == undefined || - subVariantPriceData?.SpecialPrice == null || - subVariantPriceData?.SpecialPrice == '' + subVariantPriceData?.SpecialPrice == null || + subVariantPriceData?.SpecialPrice == '' ? 0 : subVariantPriceData?.SpecialPrice, InwardDtlId: null, @@ -1212,20 +1213,20 @@ const ProductForm = ({ formType }) => { SellPrice: subVariantPriceData?.SellPrice, WhSalePrice: subVariantPriceData?.WhSalePrice == undefined || - subVariantPriceData?.WhSalePrice == null || - subVariantPriceData?.WhSalePrice == '' + subVariantPriceData?.WhSalePrice == null || + subVariantPriceData?.WhSalePrice == '' ? 0 : subVariantPriceData?.WhSalePrice, OfferPrice: subVariantPriceData?.OfferPrice == undefined || - subVariantPriceData?.OfferPrice == null || - subVariantPriceData?.OfferPrice == '' + subVariantPriceData?.OfferPrice == null || + subVariantPriceData?.OfferPrice == '' ? 0 : subVariantPriceData?.OfferPrice, SpecialPrice: subVariantPriceData?.SpecialPrice == undefined || - subVariantPriceData?.SpecialPrice == null || - subVariantPriceData?.SpecialPrice == '' + subVariantPriceData?.SpecialPrice == null || + subVariantPriceData?.SpecialPrice == '' ? 0 : subVariantPriceData?.SpecialPrice, InwardDtlId: null, @@ -1291,20 +1292,20 @@ const ProductForm = ({ formType }) => { SellPrice: subVariantPriceData?.SellPrice, WhSalePrice: subVariantPriceData?.WhSalePrice == undefined || - subVariantPriceData?.WhSalePrice == null || - subVariantPriceData?.WhSalePrice == '' + subVariantPriceData?.WhSalePrice == null || + subVariantPriceData?.WhSalePrice == '' ? 0 : subVariantPriceData?.WhSalePrice, OfferPrice: subVariantPriceData?.OfferPrice == undefined || - subVariantPriceData?.OfferPrice == null || - subVariantPriceData?.OfferPrice == '' + subVariantPriceData?.OfferPrice == null || + subVariantPriceData?.OfferPrice == '' ? 0 : subVariantPriceData?.OfferPrice, SpecialPrice: subVariantPriceData?.SpecialPrice == undefined || - subVariantPriceData?.SpecialPrice == null || - subVariantPriceData?.SpecialPrice == '' + subVariantPriceData?.SpecialPrice == null || + subVariantPriceData?.SpecialPrice == '' ? 0 : subVariantPriceData?.SpecialPrice, InwardDtlId: null, @@ -1359,20 +1360,20 @@ const ProductForm = ({ formType }) => { SellPrice: subVariantPriceData?.SellPrice, WhSalePrice: subVariantPriceData?.WhSalePrice == undefined || - subVariantPriceData?.WhSalePrice == null || - subVariantPriceData?.WhSalePrice == '' + subVariantPriceData?.WhSalePrice == null || + subVariantPriceData?.WhSalePrice == '' ? 0 : subVariantPriceData?.WhSalePrice, OfferPrice: subVariantPriceData?.OfferPrice == undefined || - subVariantPriceData?.OfferPrice == null || - subVariantPriceData?.OfferPrice == '' + subVariantPriceData?.OfferPrice == null || + subVariantPriceData?.OfferPrice == '' ? 0 : subVariantPriceData?.OfferPrice, SpecialPrice: subVariantPriceData?.SpecialPrice == undefined || - subVariantPriceData?.SpecialPrice == null || - subVariantPriceData?.SpecialPrice == '' + subVariantPriceData?.SpecialPrice == null || + subVariantPriceData?.SpecialPrice == '' ? 0 : subVariantPriceData?.SpecialPrice, InwardDtlId: null, @@ -1441,17 +1442,17 @@ const ProductForm = ({ formType }) => { (item) => parseFloat(item.MRP) === parseFloat(subVariantPriceData?.MRP) && parseFloat(item.SellPrice) === - parseFloat(subVariantPriceData?.SellPrice) + parseFloat(subVariantPriceData?.SellPrice) ); if ( existsData?.length == 0 || (parseFloat(variantPriceData[variantEditIndex]?.MRP) === parseFloat(subVariantPriceData?.MRP) && parseFloat(variantPriceData[variantEditIndex]?.SellPrice) === - parseFloat(subVariantPriceData?.SellPrice) && + parseFloat(subVariantPriceData?.SellPrice) && //dhana 18-02-2025 variantPriceData[variantEditIndex]?.ProdVariantName == - subVariantPriceData?.ProdVariantName) + subVariantPriceData?.ProdVariantName) ) { let editVariantData = [...variantPriceData]; if ( @@ -1469,20 +1470,20 @@ const ProductForm = ({ formType }) => { SellPrice: subVariantPriceData?.SellPrice, WhSalePrice: subVariantPriceData?.WhSalePrice == undefined || - subVariantPriceData?.WhSalePrice == null || - subVariantPriceData?.WhSalePrice == '' + subVariantPriceData?.WhSalePrice == null || + subVariantPriceData?.WhSalePrice == '' ? 0 : subVariantPriceData?.WhSalePrice, OfferPrice: subVariantPriceData?.OfferPrice == undefined || - subVariantPriceData?.OfferPrice == null || - subVariantPriceData?.OfferPrice == '' + subVariantPriceData?.OfferPrice == null || + subVariantPriceData?.OfferPrice == '' ? 0 : subVariantPriceData?.OfferPrice, SpecialPrice: subVariantPriceData?.SpecialPrice == undefined || - subVariantPriceData?.SpecialPrice == null || - subVariantPriceData?.SpecialPrice == '' + subVariantPriceData?.SpecialPrice == null || + subVariantPriceData?.SpecialPrice == '' ? 0 : subVariantPriceData?.SpecialPrice, InwardDtlId: editVariantData[variantEditIndex]?.InwardDtlId, @@ -1496,20 +1497,20 @@ const ProductForm = ({ formType }) => { SellPrice: subVariantPriceData?.SellPrice, WhSalePrice: subVariantPriceData?.WhSalePrice == undefined || - subVariantPriceData?.WhSalePrice == null || - subVariantPriceData?.WhSalePrice == '' + subVariantPriceData?.WhSalePrice == null || + subVariantPriceData?.WhSalePrice == '' ? 0 : subVariantPriceData?.WhSalePrice, OfferPrice: subVariantPriceData?.OfferPrice == undefined || - subVariantPriceData?.OfferPrice == null || - subVariantPriceData?.OfferPrice == '' + subVariantPriceData?.OfferPrice == null || + subVariantPriceData?.OfferPrice == '' ? 0 : subVariantPriceData?.OfferPrice, SpecialPrice: subVariantPriceData?.SpecialPrice == undefined || - subVariantPriceData?.SpecialPrice == null || - subVariantPriceData?.SpecialPrice == '' + subVariantPriceData?.SpecialPrice == null || + subVariantPriceData?.SpecialPrice == '' ? 0 : subVariantPriceData?.SpecialPrice, InwardDtlId: editVariantData[variantEditIndex]?.InwardDtlId, @@ -1637,20 +1638,20 @@ const ProductForm = ({ formType }) => { SellPrice: row?.SellPrice, WhSalePrice: row?.WhSalePrice == undefined || - row?.WhSalePrice == null || - row?.WhSalePrice == '' + row?.WhSalePrice == null || + row?.WhSalePrice == '' ? 0 : row?.WhSalePrice, OfferPrice: row?.OfferPrice == undefined || - row?.OfferPrice == null || - row?.OfferPrice == '' + row?.OfferPrice == null || + row?.OfferPrice == '' ? 0 : row?.OfferPrice, SpecialPrice: row?.SpecialPrice == undefined || - row?.SpecialPrice == null || - row?.SpecialPrice == '' + row?.SpecialPrice == null || + row?.SpecialPrice == '' ? 0 : row?.SpecialPrice, InwardDtlId: row?.InwardDtlId, @@ -1664,20 +1665,20 @@ const ProductForm = ({ formType }) => { SellPrice: row?.SellPrice, WhSalePrice: row?.WhSalePrice == undefined || - row?.WhSalePrice == null || - row?.WhSalePrice == '' + row?.WhSalePrice == null || + row?.WhSalePrice == '' ? 0 : row?.WhSalePrice, OfferPrice: row?.OfferPrice == undefined || - row?.OfferPrice == null || - row?.OfferPrice == '' + row?.OfferPrice == null || + row?.OfferPrice == '' ? 0 : row?.OfferPrice, SpecialPrice: row?.SpecialPrice == undefined || - row?.SpecialPrice == null || - row?.SpecialPrice == '' + row?.SpecialPrice == null || + row?.SpecialPrice == '' ? 0 : row?.SpecialPrice, InwardDtlId: row?.InwardDtlId, @@ -1814,14 +1815,14 @@ const ProductForm = ({ formType }) => { postData['InwardDate'] = new Date().toJSON(); postData['AutoGenerateQr'] = values?.QRCode === undefined || - values?.QRCode === null || - values?.QRCode === '' + values?.QRCode === null || + values?.QRCode === '' ? QrcodeAuto : 'N'; postData['AutoGenerateSingleQr'] = values?.OnePcQR === undefined || - values?.OnePcQR === null || - values?.OnePcQR === '' + values?.OnePcQR === null || + values?.OnePcQR === '' ? QrcodeAutoSingle : 'N'; postData['CreatedBy'] = UserId; @@ -2178,7 +2179,7 @@ const ProductForm = ({ formType }) => { /> - + {/* dhana */}
@@ -2212,8 +2213,8 @@ const ProductForm = ({ formType }) => { label={} isOnChange={ editstate?.ProdName || - QrcodeExistsData?.[0]?.ProdName || - voiceData?.product + QrcodeExistsData?.[0]?.ProdName || + voiceData?.product ? true : false } @@ -2249,8 +2250,8 @@ const ProductForm = ({ formType }) => { label={} isOnChange={ editstate?.Size || - QrcodeExistsData?.[0]?.Size || - voiceData?.qty + QrcodeExistsData?.[0]?.Size || + voiceData?.qty ? true : false } @@ -2278,20 +2279,20 @@ const ProductForm = ({ formType }) => { /> } - // inputMode="decimal" - // onInput={(e) => { - // let cleanedValue = e.target.value.replace(/[^0-9.]/g, ""); // Remove invalid characters - // const parts = cleanedValue.split("."); + // inputMode="decimal" + // onInput={(e) => { + // let cleanedValue = e.target.value.replace(/[^0-9.]/g, ""); // Remove invalid characters + // const parts = cleanedValue.split("."); - // if (cleanedValue.startsWith(".")) { - // cleanedValue = "0" + cleanedValue; - // } + // if (cleanedValue.startsWith(".")) { + // cleanedValue = "0" + cleanedValue; + // } - // e.target.value = - // parts.length > 2 - // ? `${parts[0]}.${parts.slice(1).join("")}` - // : cleanedValue; - // }} + // e.target.value = + // parts.length > 2 + // ? `${parts[0]}.${parts.slice(1).join("")}` + // : cleanedValue; + // }} /> { label={} isOnChange={ editstate?.SellPrice || - QrcodeExistsData?.[0]?.SellPrice + QrcodeExistsData?.[0]?.SellPrice ? true : false } @@ -2461,12 +2462,12 @@ const ProductForm = ({ formType }) => { } onChangeFunction={handleProdCatDropDownChange} valueData={SelectedProdCat} - // disabled={ - // editstate?.ProdTypeName == 'Others' || - // formType == 'add' - // ? false - // : true - // } + // disabled={ + // editstate?.ProdTypeName == 'Others' || + // formType == 'add' + // ? false + // : true + // } /> { } onChangeFunction={handleProdSubCatDropDownChange} valueData={SelectedProdSubCat} - // disabled={ - // editstate?.ProdTypeName == 'Others' || - // formType == 'add' - // ? false - // : true - // } + // disabled={ + // editstate?.ProdTypeName == 'Others' || + // formType == 'add' + // ? false + // : true + // } /> { ImageLink={imageUrl} updateImageUrl={updateImageUrl} /> -
+