diff --git a/src/Features/StockMaster/StockMaster.js b/src/Features/StockMaster/StockMaster.js index 1724919..9944eb5 100644 --- a/src/Features/StockMaster/StockMaster.js +++ b/src/Features/StockMaster/StockMaster.js @@ -1,6 +1,8 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit'; -import { axiosRetailInstanceData,axiosRetailOcrData } from '../AuthenicationToken/AuthenticationToken'; - +import { + axiosRetailInstanceData, + axiosRetailOcrData, +} from '../AuthenicationToken/AuthenticationToken'; // get Product dropdown export const getProductData = createAsyncThunk( @@ -28,17 +30,13 @@ export const getInvoiceImageData = createAsyncThunk( if (!file) return; const formData = new FormData(); - formData.append("file", file); // 👈 actual file here + formData.append('file', file); // 👈 actual file here - const response = await axiosRetailOcrData.post( - "/invoice", - formData, - { - headers: { - "Content-Type": "multipart/form-data", - }, - } - ); + const response = await axiosRetailOcrData.post('/invoice', formData, { + headers: { + 'Content-Type': 'multipart/form-data', + }, + }); return response.data; } @@ -125,16 +123,34 @@ export const postPurchaseData = createAsyncThunk( export const getPurchaseData = createAsyncThunk( 'Stock/getPurchaseData', async (ProdData) => { + console.log(ProdData, 'ProdData'); if ( ProdData?.CompId != null && ProdData?.CompId != undefined && ProdData?.BranchId != null && ProdData?.BranchId != undefined && ProdData?.AppId != null && - ProdData?.AppId != undefined + ProdData?.AppId != undefined && + ProdData?.OrderFromDate && + ProdData?.OrderToDate ) { + const params = new URLSearchParams({ + compId: ProdData.CompId, + branchId: ProdData.BranchId, + appId: ProdData.AppId, + fromDate: ProdData.OrderFromDate, + toDate: ProdData.OrderToDate, + }); + + if (ProdData?.search) { + params.append('searchText', ProdData.search); + } + if (ProdData?.PageNumber) { + params.append('pageNumber', ProdData.PageNumber); + } + return await axiosRetailInstanceData.get( - `/Purchase?compId=${ProdData?.CompId}&branchId=${ProdData?.BranchId}&appId=${ProdData?.AppId}` + `/Purchase?${params.toString()}` ); } } @@ -306,7 +322,7 @@ const StockSlice = createSlice({ name: 'Stock', initialState, extraReducers: (builder) => { - builder.addCase(getProductData.fulfilled, (state, action) => { + (builder.addCase(getProductData.fulfilled, (state, action) => { if (action?.payload?.status) { state.ProductData = action?.payload?.data?.data?.filter( (item) => item?.ProdTypeName === 'Product' @@ -335,7 +351,7 @@ const StockSlice = createSlice({ } else { state.PurchaseData = []; } - }); + })); }, }); diff --git a/src/Pages/Product/QRCodeCopiesModal.jsx b/src/Pages/Product/QRCodeCopiesModal.jsx new file mode 100644 index 0000000..5d3cc66 --- /dev/null +++ b/src/Pages/Product/QRCodeCopiesModal.jsx @@ -0,0 +1,94 @@ +import { Table, message } from 'antd'; +import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx'; + +const QRCodeCopiesModal = ({ + open, + onClose, + type = 'stock', // 'stock' or 'product' + onFinish, + QrandbarcodeDatas, + setQrandbarcodeDatas, +}) => { + const title = type === 'stock' ? 'Stock Wise Qrcode' : 'Product Wise Qrcode'; + const showStockIndication = type === 'stock'; + const totalCopies = QrandbarcodeDatas?.reduce( + (sum, item) => sum + Number(item?.copiesCount || 0), + 0 + ); + const handleSubmit = () => { + if (totalCopies == 0) { + message.error('Please enter copies count'); + return; + } else { + onClose(); + onFinish(); + } + }; + + const columns = [ + { title: 'Product Name', dataIndex: 'productName', key: 'productName' }, + { + title: 'Copies Count', + dataIndex: 'copiesCount', + key: 'copiesCount', + render: (text, record) => ( + { + const newValue = + type === 'product' + ? parseInt(e.target.value) || 1 + : parseInt(e.target.value); + setQrandbarcodeDatas((prev) => + prev.map((item) => + item.key === record.key + ? { ...item, copiesCount: newValue } + : item + ) + ); + }} + style={{ width: '80px' }} + /> + ), + }, + ]; + + return ( + +
+ (record.StockAvailable === 'N' ? 'row-red' : '') + : undefined + } + /> + + {showStockIndication && ( +
+

+ Stock is not Maintained +
+ )} + + } + /> + ); +}; + +export default QRCodeCopiesModal; diff --git a/src/Pages/Product/StickerPrintModal.jsx b/src/Pages/Product/StickerPrintModal.jsx new file mode 100644 index 0000000..b9fd032 --- /dev/null +++ b/src/Pages/Product/StickerPrintModal.jsx @@ -0,0 +1,1435 @@ +import { Form, Empty } from 'antd'; +import { GiHorizontalFlip, GiVerticalFlip } from 'react-icons/gi'; +import { FaPlus } from 'react-icons/fa6'; +import { InputField } from '../../Components/Forms/InputField.jsx'; +import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx'; +import Buttons from '../../Components/Forms/Buttons'; +import { validateSafeInput } from '../../Services/Others'; +import { useEffect } from 'react'; + +const StickerPrintModel = ({ + open, + handleCancel, + formRef, + onFinish, + MultiCode, + activeTab, + setActiveTab, + selectedRecords, + coresdata, + dropdownValue, + CoresOnChange, + barcodeTemplateDetails, + detail, + proName, + nickName, + ProdId, + size, + CopiesOnChange, + printProductName, + totalCopies, + setstockWiseQrcode, + setProductWiseQrcode, + setNickName, + templateOptions, +}) => { + const secondValueStyle = { + flexDirection: templateOptions.secondValue === 'R' ? 'row' : 'row-reverse', + }; + const valueStyleRow = { + flexDirection: templateOptions.value === 'R' ? 'row' : 'row-reverse', + }; + const valueStyleColumn = { + flexDirection: templateOptions.value === 'T' ? 'column' : 'column-reverse', + }; + const barCodeImage = + 'https://cdn.pixabay.com/photo/2014/04/02/16/19/barcode-306926_1280.png'; + const qrCodeImage = + 'https://cdn.pixabay.com/photo/2015/03/21/09/34/qr-683354_640.png'; + const previewText = 'Barcode Preview'; + const formatDate = (dateStr) => { + const d = new Date(dateStr); + + const day = String(d.getDate()).padStart(2, '0'); + + const months = [ + 'JAN', + 'FEB', + 'MAR', + 'APR', + 'MAY', + 'JUN', + 'JUL', + 'AUG', + 'SEP', + 'OCT', + 'NOV', + 'DEC', + ]; + const month = months[d.getMonth()]; + + const year = String(d.getFullYear()).slice(-2); + + return `${day}-${month}-${year}`; + }; + const colorText = 'Color : Red'; + const handleImageTag = (w, h = '40px', barcodeOrQr) => { + return ( + {previewText} + ); + }; + useEffect(() => { + if (coresdata?.length > 0 && open) { + CoresOnChange(coresdata?.[0].ConfigName); + } + }, [open]); + return ( + + {MultiCode && ( +
+
setActiveTab('stock')} + > + Stock Wise{' '} + ({selectedRecords?.length}) +
+
{ + e.stopPropagation(); + setstockWiseQrcode(true); + }} + style={{ + animation: + activeTab === 'stock' ? 'blink 1s infinite' : 'none', + }} + > + Add +
+
+
+ +
setActiveTab('product')} + > + Product Wise{' '} + ({selectedRecords?.length}) +
{ + e.stopPropagation(); + setProductWiseQrcode(true); + }} + style={{ + animation: + activeTab === 'product' ? 'blink 1s infinite' : 'none', + }} + > + Add +
+
+
+ )} +
+ +
+ +
+
+ {coresdata?.map((option) => ( +
CoresOnChange(option.ConfigName)} + className={`radio-sidebar-item ${dropdownValue === option.ConfigName ? 'selected' : ''}`} + > +
+ {option.ConfigName} +
+
+ ))} +
+
+
+
PREVIEW
+ {(() => { + const template = barcodeTemplateDetails?.find( + (find) => find.SessionName === dropdownValue + ); + const templateAvailable = + template === undefined ? false : true; + const checkComponent = (name) => + template?.OptionDetails?.some( + (some) => some.OptionName === name + ); + + const mrp = checkComponent('MRP'); + const qrcode = checkComponent('Qrcode'); + const barcode = checkComponent('Barcode'); + const color = checkComponent('Color'); + const eDate = checkComponent('E Date'); + const mDate = checkComponent('M Date'); + const sellingPrice = checkComponent('Selling Price'); + const productName = checkComponent('Product Name'); + const barcodeOrQr = template?.CodeType + ? template?.CodeType === 'B' + : true; + const templateValue = + template?.Position !== '' ? template?.Position : ''; + switch (dropdownValue) { + case '15X15 6cross': + return templateAvailable ? ( + !(productName || barcode || qrcode || mrp) ? ( + + ) : ( + <> +
+ {[...Array(6)].map((_, index) => ( +
+
+ {(barcode || qrcode) && + templateValue === 'T' && + handleImageTag( + barcodeOrQr ? 50 : 20, + 20, + barcodeOrQr + )} + {productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} +
+ )} + {(barcode || qrcode) && + templateValue === 'C' && + handleImageTag( + barcodeOrQr ? 50 : 20, + 20, + barcodeOrQr + )} + {mrp && ( +
+ {'₹:' + + (detail?.MRP + ? detail?.MRP + : 0.0)} +
+ )} + {(barcode || qrcode) && + templateValue === 'B' && + handleImageTag( + barcodeOrQr ? 50 : 20, + 20, + barcodeOrQr + )} +
+
+ ))} +
+
+

+ Vertical +

+ {' '} +
+ - {'15mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'15mm'} +

+
+ + ) + ) : ( + <> +
+ {Array.from({ length: 6 }).map((_, index) => ( +
+ {`QR +
+ ))} +
+
+

+ Vertical +

+ {' '} +
+ - {'15mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'15mm'} +

+
+ + ); + case '22X35 3cross': + return templateAvailable ? ( + !(barcode || qrcode || mrp) ? ( + + ) : ( + <> +
+ {[...Array(3)].map((_, index) => ( +
+
+ {(barcode || qrcode) && + handleImageTag( + barcodeOrQr ? 100 : 35, + 35, + barcodeOrQr + )} + {(productName || mrp) && ( +
+ {productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName || 'Product Name'} +
+ )} + {mrp && ( +
+ {'₹:' + + (detail?.MRP + ? detail?.MRP + : 10.0)} +
+ )} +
+ )} +
+
+ ))} +
+
+

+ Vertical +

+ {' '} +
+ - {'22mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'35mm'} +

+
+ + ) + ) : ( + <> +
+ {Array?.from({ length: 3 })?.map( + (_, index) => ( +
+
+

8 ? 'text-ellipsis' : ''}`} + > + {proName || 'Product Name'} ( + {size || '1 PCS'}) +

+

{ProdId || 'QR579890770'}

+
+ +
+ ) + )} +
+
+

+ Vertical +

+ {' '} +
+ - {'22mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'35mm'} +

+
+ + ); + case '25X25 4cross': + return templateAvailable ? ( + !( + productName || + mDate || + eDate || + barcode || + qrcode || + mrp + ) ? ( + + ) : ( + <> +
+ {[...Array(4)].map((_, index) => ( +
+
+ {(barcode || qrcode) && + templateValue === 'T' && + handleImageTag( + barcodeOrQr ? 60 : 35, + 35, + barcodeOrQr + )} + {productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} +
+ )} + {mrp && ( +
+ {'₹:' + + (detail?.MRP + ? detail?.MRP + : 10.0)} +
+ )} + {(barcode || qrcode) && + templateValue === 'C' && + handleImageTag( + barcodeOrQr ? 60 : 35, + 35, + barcodeOrQr + )} + {mDate && ( +
+ )} + {eDate && ( +
+ DD-MM-YYYY +
+ )} + {(barcode || qrcode) && + templateValue === 'B' && + handleImageTag( + barcodeOrQr ? 60 : 35, + 35, + barcodeOrQr + )} +
+
+ ))} +
+
+

+ Vertical +

+ {' '} +
+ - {'25mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'25mm'} +

+
+ + ) + ) : ( + <> +
+ {Array.from({ length: 4 })?.map( + (_, index) => ( +
+

12 ? 'text-ellipsis' : ''}`} + > + + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} + + + ({size || '1 PCS'}) + +

+
+ barcode +

+ {ProdId || 'QR8575956'} +

+
+
+ ) + )} +
+
+

+ Vertical +

+ {' '} +
+ - {'25mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'25mm'} +

+
+ + ); + case '25X50 2cross': + return templateAvailable ? ( + !(productName || barcode || qrcode || mrp) ? ( + + ) : ( + <> +
+ {[...Array(2)].map((_, index) => ( +
+
+ {(barcode || qrcode) && + handleImageTag( + barcodeOrQr ? 140 : 30, + 30, + barcodeOrQr + )} + {productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} +
+ )} + {mrp && ( +
+ {'₹:' + + (detail?.MRP + ? detail?.MRP + : 10.0)} +
+ )} +
+
+ ))} +
+
+

+ Vertical +

+ {' '} +
+ - {'25mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'50mm'} +

+
+ + ) + ) : ( + <> +
+ {Array.from({ length: 2 })?.map( + (_, index) => ( +
+
+

12 ? 'text-ellipsis' : ''}`} + > + {proName || 'Product Name'} ( + {size || '1 PCS'}) +

+

{ProdId || 'QR74478578'}

+
+ +
+ ) + )} +
+
+

+ Vertical +

+ {' '} +
+ - {'25mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'50mm'} +

+
+ + ); + case '50X30 Single': + return templateAvailable ? ( + !( + productName || + mDate || + eDate || + barcode || + qrcode || + mrp + ) ? ( + + ) : ( + <> +
+
+ {productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} +
+ )} + {mDate && + detail?.ProdVariantPriceDetails?.[0] + ?.ManufDate && ( +
+ {formatDate( + detail + ?.ProdVariantPriceDetails?.[0] + ?.ManufDate + )} +
+ )} + {eDate && + detail?.ProdVariantPriceDetails?.[0] + ?.ExpDate && ( +
+ {formatDate( + detail + ?.ProdVariantPriceDetails?.[0] + ?.ExpDate + )} +
+ )} +
+
+ {(barcode || qrcode) && + handleImageTag( + barcodeOrQr ? 70 : 35, + 35, + barcodeOrQr + )} + {mrp && ( +
+ {'MRP : ' + (detail?.MRP || 10.0)} +
+ )} +
+
+
+

+ Vertical +

+ {' '} +
+ - {'30mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'50mm'} +

+
+ + ) + ) : ( + <> +
+
+
+

12 ? 'text-ellipsis' : ''}`} + > + {proName || 'Product Name'} ( + {size || '1 PCS'}) +

+

{ProdId || 'QR987968'}

+
+ +
+
+
+

+ Vertical +

+ {' '} +
+ - {'30mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'50mm'} +

+
+ + ); + case '50X25 Single': + return templateAvailable ? ( + !( + productName || + mDate || + barcode || + qrcode || + mrp + ) ? ( + + ) : ( + <> +
+
+ {productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} +
+ )} + {mDate && + detail?.ProdVariantPriceDetails?.[0] + ?.ManufDate && ( +
+ {formatDate( + detail + ?.ProdVariantPriceDetails?.[0] + ?.ManufDate + )} +
+ )} +
+
+ {(barcode || qrcode) && + handleImageTag( + barcodeOrQr ? 70 : 35, + 35, + barcodeOrQr + )} + {mrp && ( +
+ {'MRP : ' + (detail?.MRP || '10.0')} +
+ )} +
+
+
+

+ Vertical +

+ {' '} +
+ - {'25mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'50mm'} +

+
+ + ) + ) : ( + <> +
+
+
+

12 ? 'text-ellipsis' : ''}`} + > + {proName || 'Product Name'} ( + {size || '1 PCS'}) +

+

{ProdId || 'QR8798639'}

+
+ +
+
+
+

+ Vertical +

+ {' '} +
+ - {'25mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'50mm'} +

+
+ + ); + case '100X13 (55MM Printable)': + return templateAvailable ? ( + !( + productName || + sellingPrice || + barcode || + qrcode + ) ? ( + + ) : ( + <> +
+ {(barcode || qrcode) && + handleImageTag( + barcodeOrQr ? 140 : 35, + 35, + barcodeOrQr + )} +
+ {productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} +
+ )} + {sellingPrice && ( +
+ {`Selling Price : ` + + (detail?.SellPrice || '10.0')} +
+ )} +
+
+
+

+ Vertical +

+ {' '} +
+ - {'13mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'100mm'} +

+
+ + ) + ) : ( + <> +
+
+
+

12 ? 'text-ellipsis' : ''}`} + > + {proName || 'Product Name'} ( + {size || '1 PCS'}) +

+

{ProdId || 'QR0970970'}

+
+ +
+
+
+

+ Vertical +

+ {' '} +
+ - {'13mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'100mm'} +

+
+ + ); + case '100X15 (70MM Printable)': + return templateAvailable ? ( + !( + productName || + sellingPrice || + barcode || + qrcode || + mrp + ) ? ( + + ) : ( + <> +
+
+ {productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} +
+ )} + {mrp && ( +
+ {'MRP : ' + (detail?.MRP || '10.0')} +
+ )} + {sellingPrice && ( +
+ {`Selling Price : ` + + (detail?.SellPrice || '10.0')} +
+ )} +
+
+ {(barcode || qrcode) && + handleImageTag( + barcodeOrQr ? 90 : 40, + null, + barcodeOrQr + )} +
+
+
+

+ Vertical +

+ {' '} +
+ - {'15mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'100mm'} +

+
+ + ) + ) : ( + <> +
+
+
+

12 ? 'text-ellipsis' : ''}`} + > + {proName || 'Product Name'} ( + {size || '1 PCS'}) +

+

{ProdId || 'QR858755'}

+
+ +
+
+
+

+ Vertical +

+ {' '} +
+ - {'15mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'100mm'} +

+
+ + ); + case '100X150': + return templateAvailable ? ( + !( + productName || + sellingPrice || + mDate || + eDate || + color || + barcode || + qrcode || + mrp + ) ? ( + + ) : ( + <> +
+
+ {productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} +
+ )} + {sellingPrice && ( +
+ {`Selling Price : ` + + detail?.SellPrice} +
+ )} + {mDate && + detail?.ProdVariantPriceDetails?.[0] + ?.ManufDate && ( +
+ {formatDate( + detail + ?.ProdVariantPriceDetails?.[0] + ?.ManufDate + )} +
+ )} + {eDate && + detail?.ProdVariantPriceDetails?.[0] + ?.ExpDate && ( +
+ {formatDate( + detail + ?.ProdVariantPriceDetails?.[0] + ?.ExpDate + )} +
+ )} + {color && ( +
+ {colorText} +
+ )} +
+
+ {(barcode || qrcode) && + handleImageTag( + barcodeOrQr ? 140 : 35, + 35, + barcodeOrQr + )} + {mrp && ( +
+ {'MRP : ' + (detail?.MRP || '10.0')} +
+ )} +
+
+
+

+ Vertical +

+ {' '} +
+ - {'150mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'100mm'} +

+
+ + ) + ) : ( + <> +
+
+
+

{detail?.BrName}

+
+
+
+

+ Product Name:{' '} +

12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} +

+

+

+ SIZE:{' '} + + {size || '1 PCS'} + +

+

+ Id:{' '} + + {ProdId || 'QR86868'} + +

+

+ MRP:{' '} + + {'MRP : ' + (detail?.MRP || '10.0')} + +

+

+ Selling Price:{' '} + + {detail?.SellPrice || '10.0'} + +

+
+ +
+
+
+
+

+ Vertical +

+ {' '} +
+ - {'150mm'} +

+

+ Horizontal +

+ {' '} +
+ - {'100mm'} +

+
+ + ); + default: + return ; + } + })()} +

{dropdownValue}

+
+
+
+
+
+ {!MultiCode && ( + { + await validateSafeInput(value); + return Promise.resolve(); + }, + }, + ]} + > + Copies} + isOnChange={false} + onChange={(e) => { + CopiesOnChange(e?.target?.value); + }} + /> + + )} + {proName?.length > 12 && printProductName && !MultiCode && ( + <> +
+ Note: Product name is very long. Please add a short/nick name + to proceed print. +
+ + { + setNickName(e?.target?.value); + }} + maxLength={12} + /> + + + )} +
+
+ {(!MultiCode || totalCopies > 0) && ( + + )} + {MultiCode && totalCopies === 0 && ( + + )} +
+ + } + /> + ); +}; + +export default StickerPrintModel; diff --git a/src/Pages/Product/StickerTemplates.jsx b/src/Pages/Product/StickerTemplates.jsx new file mode 100644 index 0000000..af64540 --- /dev/null +++ b/src/Pages/Product/StickerTemplates.jsx @@ -0,0 +1,1826 @@ +const StickerPrintTemplates = ({ + selectedRecords, + copies, + nickName, + proName, + ProdId, + size, + detail, + templateOptions, + base64Image, + QrandbarcodeDatas, + MultiCode, + generateQRCodeCopy, + generateCodeImage, + imageTagBarcodeAndQR, + dropdownValue, + barcodeTemplateDetails, +}) => { + const template = barcodeTemplateDetails?.find( + (find) => find.SessionName === dropdownValue + ); + const templateAvailable = template === undefined ? false : true; + + function choosenPrintStyle(dropdownValue, templateAvailable) { + switch (dropdownValue) { + case '15X15 6cross': + return templateAvailable ? 'label-15X156cross' : 'StickerPrints0'; + + case '22X35 3cross': + return templateAvailable ? '22X353cross' : 'StickerPrints1'; + + case '25X25 4cross': + return templateAvailable ? '25X254cross' : 'StickerPrints2'; + + case '25X50 2cross': + return templateAvailable ? '25X502cross' : 'StickerPrints3'; + + case '50X30 Single': + return templateAvailable ? '50X30Single' : 'StickerPrints4'; + + case '50X25 Single': + return templateAvailable ? '50X25Single' : 'StickerPrints5'; + + case '100X13 (55MM Printable)': + return templateAvailable ? '100X13(55MMPrintable)' : 'StickerPrints6'; + + case '100X15 (70MM Printable)': + return templateAvailable ? '100X15(70MMPrintable)' : 'StickerPrints7'; + + case '100X150': + return templateAvailable ? '100X150' : 'StickerPrints8'; + + default: + return null; + } + } + const selectStyle = choosenPrintStyle(dropdownValue, templateAvailable); + const secondValueStyle = { + flexDirection: templateOptions.secondValue === 'R' ? 'row' : 'row-reverse', + }; + const valueStyleRow = { + flexDirection: templateOptions.value === 'R' ? 'row' : 'row-reverse', + }; + const valueStyleColumn = { + flexDirection: templateOptions.value === 'T' ? 'column' : 'column-reverse', + }; + const formatDate = (dateStr) => { + const d = new Date(dateStr); + + const day = String(d.getDate()).padStart(2, '0'); + + const months = [ + 'JAN', + 'FEB', + 'MAR', + 'APR', + 'MAY', + 'JUN', + 'JUL', + 'AUG', + 'SEP', + 'OCT', + 'NOV', + 'DEC', + ]; + const month = months[d.getMonth()]; + + const year = String(d.getFullYear()).slice(-2); + + return `${day}-${month}-${year}`; + }; + const colorText = 'Color : Red'; + console.log(selectStyle, 'selectStyle'); + return ( +
+ {selectStyle == 'StickerPrints0' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + console.log(copyCount, 'copyCountcopyCountcopyCount'); + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+ +
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+ +
+ ))} +
+
+ )} + {selectStyle == 'StickerPrints1' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + return Array?.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+
+

8 ? 'text-clamp-2' : ''}`} + > + {record.ProdName} ({record.Size} + {record.UomName}) +

+

{record.QRCode}

+
+ +
+ ) + ); + }) + : Array?.from({ length: copies })?.map((_, index) => ( +
+
+

8 ? 'text-ellipsis' : ''}`} + > + {proName} ({size}) +

+

{ProdId}

+
+ +
+ ))} +
+
+ )} + {selectStyle == 'StickerPrints2' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + console.log(copyCount, 'copyCount2'); + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+

14 ? 'text-ellipsis' : ''}`} + > + + {record?.NickName || record?.ProdName} + + + ({record?.Size} + {record?.UomName}) + +

+
+ barcode +

+ {record?.QRCode || record?.ProdId} +

+
+
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+

14 ? 'text-ellipsis' : ''}`} + > + + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} + + + ({size}) + +

+
+ barcode +

{ProdId}

+
+
+ ))} +
+
+ )} + {selectStyle == 'StickerPrints3' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + console.log(copyCount, 'copyCount3'); + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+
+

12 ? 'text-clamp-2' : ''}`} + > + {record?.NickName || record?.ProdName} ( + {record?.Size} + {record?.UomName}) +

+

{record?.QRCode || record?.ProdId}

+
+ +
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+
+

12 ? 'text-clamp-2' : ''}`} + > + {proName} ({size}) +

+

{ProdId}

+
+ +
+ ))} +
+
+ )} + {selectStyle == 'StickerPrints4' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + console.log(copyCount, 'copyCount4'); + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+
+

12 ? 'text-ellipsis' : ''}`} + > + {record?.NickName || record?.ProdName} ( + {record?.Size} + {record?.UomName}) +

+

{record?.QRCode || record?.ProdId}

+
+ +
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+
+

12 ? 'text-ellipsis' : ''}`} + > + {proName} ({size}) +

+

{ProdId}

+
+ +
+ ))} +
+
+ )} + {selectStyle == 'StickerPrints5' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + console.log(copyCount, 'copyCount5'); + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+
+

12 ? 'text-ellipsis' : ''}`} + > + {record?.NickName || record?.ProdName} ( + {record?.Size} + {record?.UomName}) +

+

{record?.QRCode || record?.ProdId}

+
+ +
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+
+

12 ? 'text-ellipsis' : ''}`} + > + {proName} ({size}) +

+

{ProdId}

+
+ +
+ ))} +
+
+ )} + {selectStyle == 'StickerPrints6' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + console.log(copyCount, 'copyCount6'); + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+
+

12 ? 'text-ellipsis' : ''}`} + > + {record?.NickName || record?.ProdName} ( + {record?.Size} + {record?.UomName}) +

+

{record?.QRCode || record?.ProdId}

+
+ +
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+
+

12 ? 'text-ellipsis' : ''}`} + > + {proName} ({size}) +

+

{ProdId}

+
+ +
+ ))} +
+
+ )} + {selectStyle == 'StickerPrints7' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + console.log(copyCount, 'copyCount7'); + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+
+

12 ? 'text-ellipsis' : ''}`} + > + {record?.NickName || record?.ProdName} ( + {record?.Size} + {record?.UomName}) +

+

{record?.QRCode || record?.ProdId}

+
+ +
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+
+

12 ? 'text-ellipsis' : ''}`} + > + {proName} ({size}) +

+

{ProdId}

+
+ +
+ ))} +
+
+ )} + {selectStyle == 'StickerPrints8' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + console.log(copyCount, 'copyCount8'); + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+
+

{record?.BrName || detail?.BrName}

+
+
+
+

+ Product Name:{' '} +

12 ? 'text-ellipsis' : ''}`} + > + {record?.NickName || record?.ProdName} +

+

+

+ SIZE:{' '} + + {record?.Size} + {record?.UomName} + +

+

+ Id:{' '} + + {record?.QRCode || record?.ProdId} + +

+

+ MRP:{' '} + + {'MRP : ' + record?.MRP} + +

+

+ Selling Price:{' '} + + {record?.SellPrice} + +

+
+ +
+
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+
+

{detail?.BrName}

+
+
+
+

+ Product Name:{' '} +

12 ? 'text-ellipsis' : ''}`} + > + {proName} +

+

+

+ SIZE: {size} +

+

+ Id: {ProdId} +

+

+ MRP:{' '} + + {'MRP : ' + detail?.MRP} + +

+

+ Selling Price:{' '} + + {detail?.SellPrice} + +

+
+ +
+
+ ))} +
+
+ )} + {selectStyle == '25X254cross' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => { + const hasProductName = !!templateOptions.productName; + const hasMrp = !!templateOptions.mrp; + + const hasMDate = + templateOptions.mDate && record?.ManufDate; + + const hasEDate = templateOptions.eDate && record?.ExpDate; + + // IMAGE SIZE LOGIC + let imageSize = 50; + if (!hasMDate && !hasEDate) { + imageSize = 52; + } + + if (!hasProductName || !hasMrp) { + imageSize = 60; + } + + if (!hasProductName && !hasMrp) { + imageSize = 80; + } + + // FLEX DIRECTION LOGIC + const forceColumnLayout = + !hasProductName || !hasMrp || (!hasMDate && !hasEDate); + return ( +
+
+ {templateOptions.value === 'T' && ( +
+ {imageTagBarcodeAndQR( + templateOptions.codeType === 'B' + ? '90%' + : `${imageSize}%`, + '7px', + record?.QRCode || record?.ProdId + )} +
+ )} + {hasProductName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {record?.NickName || record?.ProdName} +
+ )} + {hasMrp && ( +
+ {'₹' + record?.MRP} +
+ )} + {templateOptions.value === 'C' && ( +
+ {imageTagBarcodeAndQR( + templateOptions.codeType === 'B' + ? '90%' + : `${imageSize}%`, + '7px', + record?.QRCode || record?.ProdId + )} +
+ )} + {(hasMDate || hasEDate) && ( +
+ {hasMDate && ( +
+ {hasMDate && !hasEDate ? 'MFG: ' : ''} + {formatDate(record?.ManufDate)} +
+ )} + {hasMDate && hasEDate && ( + | + )} + {hasEDate && ( +
+ {!hasMDate && hasEDate ? 'EXP: ' : ''} + {formatDate(record?.ExpDate)} +
+ )} +
+ )} + {templateOptions.value === 'B' && ( +
+ {imageTagBarcodeAndQR( + templateOptions.codeType === 'B' + ? '25mm' + : `${imageSize}%`, + '7px', + record?.QRCode || record?.ProdId + )} +
+ )} +
+
+ ); + } + ); + }) + : Array.from({ length: copies })?.map((_, index) => { + const hasProductName = !!templateOptions.productName; + const hasMrp = !!templateOptions.mrp; + + const hasMDate = + templateOptions.mDate && + detail?.ProdVariantPriceDetails?.[0]?.ManufDate; + + const hasEDate = + templateOptions.eDate && + detail?.ProdVariantPriceDetails?.[0]?.ExpDate; + + // IMAGE SIZE LOGIC + let imageSize = 50; + if (!hasMDate && !hasEDate) { + imageSize = 52; + } + + if (!hasProductName || !hasMrp) { + imageSize = 60; + } + + if (!hasProductName && !hasMrp) { + imageSize = 80; + } + + // FLEX DIRECTION LOGIC + const forceColumnLayout = + !hasProductName || !hasMrp || (!hasMDate && !hasEDate); + return ( +
+
+ {templateOptions.value === 'T' && ( +
+ {imageTagBarcodeAndQR( + templateOptions.codeType === 'B' + ? '90%' + : `${imageSize}%`, + '7px' + )} +
+ )} + {hasProductName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} +
+ )} + {hasMrp && ( +
+ {'₹' + detail?.MRP} +
+ )} + {templateOptions.value === 'C' && ( +
+ {imageTagBarcodeAndQR( + templateOptions.codeType === 'B' + ? '90%' + : `${imageSize}%`, + '7px' + )} +
+ )} + {(hasMDate || hasEDate) && ( +
+ {hasMDate && ( +
+ {hasMDate && !hasEDate ? 'MFG: ' : ''} + {formatDate( + detail?.ProdVariantPriceDetails?.[0] + ?.ManufDate + )} +
+ )} + {hasMDate && hasEDate && ( + | + )} + {hasEDate && ( +
+ {!hasMDate && hasEDate ? 'EXP: ' : ''} + {formatDate( + detail?.ProdVariantPriceDetails?.[0]?.ExpDate + )} +
+ )} +
+ )} + {templateOptions.value === 'B' && ( +
+ {imageTagBarcodeAndQR( + templateOptions.codeType === 'B' + ? '25mm' + : `${imageSize}%`, + '7px' + )} +
+ )} +
+
+ ); + })} +
+
+ )} + + {selectStyle == '25X502cross' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+
+ {imageTagBarcodeAndQR( + templateOptions.codeType === 'B' ? '45mm' : '16mm', + '6px', + record?.QRCode || record?.ProdId + )} + {templateOptions.productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {record?.NickName || record?.ProdName} +
+ )} + {templateOptions.mrp && ( +
+ {'MRP : ' + record?.MRP} +
+ )} +
+
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+
+ {imageTagBarcodeAndQR( + templateOptions.codeType === 'B' ? '45mm' : '16mm' + )} + {templateOptions.productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {proName} +
+ )} + {templateOptions.mrp && ( +
+ {'MRP : ' + detail?.MRP} +
+ )} +
+
+ ))} +
+
+ )} + + {selectStyle == '50X30Single' && ( +
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+
+ {templateOptions.productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {record?.NickName || record?.ProdName} +
+ )} + {templateOptions.mDate && record?.ManufDate && ( +
+ {record?.ManufDate} +
+ )} + {templateOptions.eDate && record?.ExpDate && ( +
+ {record?.ExpDate} +
+ )} +
+
+ {imageTagBarcodeAndQR( + '70%', + '6px', + record?.QRCode || record?.ProdId + )} + {templateOptions.mrp && ( +
{'MRP : ' + record?.MRP}
+ )} +
+
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+
+ {templateOptions.productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} +
+ )} + {templateOptions.mDate && + detail?.ProdVariantPriceDetails?.[0]?.ManufDate && ( +
+ {detail?.ProdVariantPriceDetails?.[0]?.ManufDate} +
+ )} + {templateOptions.eDate && + detail?.ProdVariantPriceDetails?.[0]?.ExpDate && ( +
+ {detail?.ProdVariantPriceDetails?.[0]?.ExpDate} +
+ )} +
+
+ {imageTagBarcodeAndQR('70%')} + {templateOptions.mrp && ( +
{'MRP : ' + detail?.MRP}
+ )} +
+
+ ))} +
+ )} + + {selectStyle == '50X25Single' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+
+ {templateOptions.productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {record?.NickName || record?.ProdName} +
+ )} + {templateOptions.mDate && record?.ManufDate && ( +
+ {record?.ManufDate} +
+ )} + {templateOptions.eDate && record?.ExpDate && ( +
+ {record?.ExpDate} +
+ )} +
+
+ {imageTagBarcodeAndQR( + '90%', + '6px', + record?.QRCode || record?.ProdId + )} + {templateOptions.mrp && ( +
+ {'MRP : ' + record?.MRP} +
+ )} +
+
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+
+ {templateOptions.productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} +
+ )} + {templateOptions.mDate && + detail?.ProdVariantPriceDetails?.[0]?.ManufDate && ( +
+ {detail?.ProdVariantPriceDetails?.[0]?.ManufDate} +
+ )} + {templateOptions.eDate && + detail?.ProdVariantPriceDetails?.[0]?.ExpDate && ( +
+ {detail?.ProdVariantPriceDetails?.[0]?.ExpDate} +
+ )} +
+
+ {imageTagBarcodeAndQR('90%')} + {templateOptions.mrp && ( +
{'MRP : ' + detail?.MRP}
+ )} +
+
+ ))} +
+
+ )} + + {selectStyle == '100X13(55MMPrintable)' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+ {imageTagBarcodeAndQR( + 'auto', + '6px', + record?.QRCode || record?.ProdId + )} +
+ {templateOptions.productName && ( +
+ {'Product Name :' + + (record?.NickName || record?.ProdName)} +
+ )} + {templateOptions.sellingPrice && ( +
+ {'Selling Price :' + record?.SellPrice} +
+ )} +
+
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+ {imageTagBarcodeAndQR()} +
+ {templateOptions.productName && ( +
+ {'Product Name :' + proName} +
+ )} + {templateOptions.sellingPrice && ( +
+ {'Selling Price :' + detail?.SellPrice} +
+ )} +
+
+ ))} +
+
+ )} + + {selectStyle == '100X15(70MMPrintable)' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+
+ {templateOptions.productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {'Product Name: ' + + (record?.NickName || record?.ProdName)} +
+ )} + {templateOptions.mrp && ( +
+ {'MRP : ' + record?.MRP} +
+ )} + {templateOptions.sellingPrice && ( +
+ {'Selling Price :' + record?.SellPrice} +
+ )} +
+
+ {imageTagBarcodeAndQR( + 'auto', + '6px', + record?.QRCode || record?.ProdId + )} +
+
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+
+ {templateOptions.productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {'Product Name' + proName} +
+ )} + {templateOptions.mrp && ( +
{'MRP : ' + detail?.MRP}
+ )} + {templateOptions.sellingPrice && ( +
+ {'Selling Price :' + detail?.SellPrice} +
+ )} +
+
+ {imageTagBarcodeAndQR()} +
+
+ ))} +
+
+ )} + {selectStyle == '100X150' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+
+ {templateOptions.productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {'Product Name: ' + + (record?.NickName || record?.ProdName)} +
+ )} + {templateOptions.sellingPrice && ( +
+ {'Selling Price :' + record?.SellPrice} +
+ )} + {templateOptions.mDate && record?.ManufDate && ( +
{record?.ManufDate}
+ )} + {templateOptions.eDate && record?.ExpDate && ( +
{record?.ExpDate}
+ )} + {templateOptions.color && ( +
+ {record?.Color || colorText} +
+ )} +
+
+ { +
+ {imageTagBarcodeAndQR( + '70%', + '6px', + record?.QRCode || record?.ProdId + )} +
+ } + {templateOptions.mrp && ( +
+ {'MRP : ' + record?.MRP} +
+ )} +
+
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+
+ {templateOptions.productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {'Product Name' + (nickName ? nickName : proName)} +
+ )} + {templateOptions.sellingPrice && ( +
+ {'Selling Price :' + detail?.SellPrice} +
+ )} + {templateOptions.mDate && + detail?.ProdVariantPriceDetails?.[0]?.ManufDate && ( +
+ {detail?.ProdVariantPriceDetails?.[0]?.ManufDate} +
+ )} + {templateOptions.eDate && + detail?.ProdVariantPriceDetails?.[0]?.ExpDate && ( +
+ {detail?.ProdVariantPriceDetails?.[0]?.ExpDate} +
+ )} + {templateOptions.color && ( +
{colorText}
+ )} +
+
+ {
{imageTagBarcodeAndQR('70%')}
} + {templateOptions.mrp && ( +
{'MRP : ' + detail?.MRP}
+ )} +
+
+ ))} +
+
+ )} + {selectStyle == 'label-15X156cross' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+ {templateOptions.value === 'T' && + imageTagBarcodeAndQR( + templateOptions.codeType === 'B' ? '100%' : '6mm', + '6px', + record?.QRCode || record?.ProdId + )} + {templateOptions.productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {record?.NickName + ? record?.NickName + : record?.ProdName} +
+ )} + {templateOptions.value === 'C' && + imageTagBarcodeAndQR( + templateOptions.codeType === 'B' + ? '80%' + : !templateOptions.productName && + !templateOptions.mrp + ? '80%' + : '35%', + '6px', + record?.QRCode || record?.ProdId + )} + {templateOptions.mrp && ( +
+ {'₹:' + record?.MRP} +
+ )} + {templateOptions.value === 'B' && + imageTagBarcodeAndQR( + templateOptions.codeType === 'B' ? '100%' : '50%', + '6px', + record?.QRCode || record?.ProdId + )} +
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+ {templateOptions.value === 'T' && + imageTagBarcodeAndQR( + templateOptions.codeType === 'B' ? '100%' : '6mm' + )} + {templateOptions.productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} +
+ )} + {templateOptions.value === 'C' && + imageTagBarcodeAndQR( + templateOptions.codeType === 'B' + ? '80%' + : !templateOptions.productName && !templateOptions.mrp + ? '80%' + : '7.5mm', + '5px' + )} + {templateOptions.mrp && ( +
+ {'₹:' + (detail?.MRP ? detail?.MRP : 10.0)} +
+ )} + {templateOptions.value === 'B' && + imageTagBarcodeAndQR( + templateOptions.codeType === 'B' ? '100%' : '7.5mm' + )} +
+ ))} +
+
+ )} + + {selectStyle == '22X353cross' && ( +
+
+ {selectedRecords?.length > 0 + ? selectedRecords?.map((record, recordIndex) => { + const copyCount = generateQRCodeCopy(record?.QRCode); + + return Array.from({ length: copyCount })?.map( + (_, copyIndex) => ( +
+
+ {imageTagBarcodeAndQR( + templateOptions.codeType === 'B' + ? '100%' + : !templateOptions.mrp && + !templateOptions.productName + ? '60%' + : '40%', + '8px', + record?.QRCode || record?.ProdId + )} + {(templateOptions.productName || + templateOptions.mrp) && ( +
+ {templateOptions.productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {record?.NickName + ? record?.NickName + : record?.ProdName} +
+ )} + {templateOptions.mrp && ( +
+ {'MRP : ' + record?.MRP} +
+ )} +
+ )} +
+
+ ) + ); + }) + : Array.from({ length: copies })?.map((_, index) => ( +
+
+ {imageTagBarcodeAndQR( + templateOptions.codeType === 'B' + ? '100%' + : !templateOptions.mrp && !templateOptions.productName + ? '60%' + : '40%', + '8px' + )} + {(templateOptions.productName || templateOptions.mrp) && ( +
+ {templateOptions.productName && ( +
12 ? 'text-ellipsis' : ''}`} + > + {nickName + ? nickName + : proName + ? proName + : 'Product Name'} +
+ )} + {templateOptions.mrp && ( +
+ {'MRP : ' + detail?.MRP} +
+ )} +
+ )} +
+
+ ))} +
+
+ )} +
+ ); +}; +export default StickerPrintTemplates;